/* r4 — Welcome, required profile form, locked profile, Home sections, simplified Money, PIN mode choice.
 * App Developer. Loads AFTER css/styles.css and only uses its v6 emerald/gold tokens (no new colours or images).
 * Contrast: text on cream uses --ink / --ink-soft / --gold-dark (bronze, >= 4.5:1). */

/* ---------- shared ---------- */
.r4-tap { min-height: 44px; min-width: 44px; }
.r4-welcome-rule {
  display: block; width: 56px; height: 3px; border-radius: 2px;
  background: var(--gold-grad); margin: 0 0 14px;
}
.r4-empty { margin: 6px 0 2px; color: var(--ink-soft); }
.card .empty.r4-empty, .card .r4-empty .empty { color: var(--ink-soft); }
.r4-error { color: var(--rose); font-weight: 600; margin: 6px 0 0; }
.r4-error::before { content: "! "; font-weight: 800; }
.r4-sec-panel[hidden], .r4-error[hidden] { display: none !important; }

/* ---------- Welcome ---------- */
.r4-welcome { display: grid; place-items: center; min-height: calc(100dvh - var(--header-h) - var(--tab-h) - 40px); padding: 8px 0; }
.r4-welcome-card {
  width: 100%; max-width: 520px; padding: 28px 22px 22px;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
}
.r4-welcome-title { font-size: 1.5rem; line-height: 1.35; margin: 0 0 6px; color: var(--teal); }
.r4-welcome-title:focus { outline: none; }
.r4-welcome-title:focus-visible { outline: 2px solid var(--teal-2); outline-offset: 4px; }
.r4-welcome-thanks { font-weight: 650; color: var(--gold-dark); margin: 0 0 12px; }
.r4-welcome-lede { color: var(--ink); margin: 0 0 10px; }
.card .r4-welcome-privacy { color: var(--ink-soft); margin: 0 0 18px; }
.r4-welcome-card .btn { width: 100%; }

/* ---------- profile form ---------- */
.r4-form { padding: 18px 16px 20px; }
.card .r4-required-note, .card .r4-hint, .card .r4-submit-note { color: var(--ink-soft); }
.r4-field { margin: 0 0 16px; min-width: 0; }
.r4-label { display: block; font-weight: 650; color: var(--ink); margin: 0 0 4px; }
.r4-hint { margin: 0 0 6px; }
.r4-field input, .r4-field select, .r4-field textarea { width: 100%; min-height: 44px; }
.r4-field.has-error input, .r4-field.has-error select, .r4-field.has-error textarea,
.r4-form [aria-invalid="true"], .r4-pin-setup [aria-invalid="true"] { border-color: var(--rose) !important; box-shadow: 0 0 0 1px var(--rose); }
.r4-fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.r4-fieldset > legend { padding: 0; }
.r4-error-summary {
  background: var(--rose-soft); color: var(--rose); border-radius: var(--radius-sm);
  padding: 10px 12px; margin: 0 0 14px; font-weight: 650;
}
.r4-check, .r4-radio {
  display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 6px 0 0;
  color: var(--ink); cursor: pointer;
}
.r4-check input, .r4-radio input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--teal-2); margin: 0; }
.r4-inline { display: flex; gap: 8px; align-items: stretch; }
.r4-inline input { flex: 1 1 0; width: auto; min-width: 0; }
.r4-inline-btn { flex: 0 0 auto; }
.r4-chips { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.r4-chip {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 2px 2px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); color: var(--ink);
  max-width: 100%; overflow-wrap: anywhere;
}
.r4-chip-x {
  min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink-soft);
  font-size: 1.2rem; border-radius: 999px; cursor: pointer;
}
.r4-job {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 12px 0;
  background: color-mix(in srgb, var(--surface-2) 50%, var(--surface));
}
.r4-job-legend { font-weight: 700; color: var(--gold-dark); padding: 0 6px; }
.r4-row { gap: 10px; }
.r4-remove { color: var(--rose); }
.r4-form [data-r4-submit] { width: 100%; margin-top: 6px; }

/* ---------- locked profile / Me ---------- */
.r4-locked { padding: 22px 18px; }
.r4-locked-title { font-size: 1.2rem; line-height: 1.45; margin: 0 0 8px; color: var(--teal); }
.r4-locked-title:focus { outline: none; }
.r4-locked p { color: var(--ink); }
.r4-contact { font-weight: 650; overflow-wrap: anywhere; }
.r4-summary { margin: 0; }
.r4-summary > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.r4-summary dt { font-size: 0.8rem; color: var(--ink-soft); }
.r4-summary dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.r4-wh { margin: 0; padding-inline-start: 18px; }
.r4-locked-link { width: 100%; justify-content: space-between; margin-top: 8px; }

/* ---------- Home ---------- */
.r4-home-lede { margin: 0 0 10px; }
.r4-gate { padding: 22px 18px; }
.r4-gate-title { margin: 0 0 6px; color: var(--teal); }
.r4-gate p { color: var(--ink); }
.r4-sec { padding: 0; margin: 0 0 10px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line)); }
.r4-sec-h { margin: 0; font-size: 1rem; }
.r4-sec-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px;
  padding: 12px 16px; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-weight: 700; text-align: start; cursor: pointer;
}
.r4-sec-btn:focus-visible { outline: 3px solid var(--teal-2); outline-offset: -3px; border-radius: var(--radius); }
.r4-sec-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.r4-sec-count {
  flex: 0 0 auto; font-size: 0.78rem; font-weight: 650; color: var(--gold-dark);
  background: var(--surface-2); border-radius: 999px; padding: 2px 10px;
}
.r4-sec-chev {
  flex: 0 0 auto; width: 10px; height: 10px; border-right: 2px solid var(--gold-dark); border-bottom: 2px solid var(--gold-dark);
  transform: rotate(45deg); margin: -4px 4px 0; transition: transform 0.18s ease;
}
.r4-sec.is-open .r4-sec-chev { transform: rotate(-135deg); margin-top: 4px; }
.r4-sec.is-open .r4-sec-btn { border-bottom: 1px solid var(--line); }
.r4-sec-panel { padding: 12px 16px 16px; }
.r4-sub { font-size: 0.9rem; color: var(--gold-dark); margin: 12px 0 6px; }
.r4-sub:first-of-type { margin-top: 4px; }
.card .r4-sec-lede, .card .r4-why { color: var(--ink-soft); margin: 2px 0 0; }
.r4-list { list-style: none; margin: 0; padding: 0; }
.r4-plan { counter-reset: r4plan; }
.r4-row-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.r4-row-item:last-child { border-bottom: 0; }
.r4-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--ink); }
.r4-row-top > :first-child { min-width: 0; overflow-wrap: anywhere; }
.r4-row-top .chip { flex: 0 0 auto; }
.r4-gaps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.r4-gaps-label { font-size: 0.78rem; color: var(--ink-soft); }
.r4-gap-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.r4-gap-chip {
  font-size: 0.78rem; padding: 2px 10px; border-radius: 999px; color: var(--ink);
  border: 1px dashed color-mix(in srgb, var(--gold) 60%, var(--line)); background: var(--surface);
}
/* Requirement status: text + icon shape, never colour alone. */
.r4-status {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
}
.r4-mark { display: inline-block; width: 10px; height: 10px; }
.r4-status-met { background: var(--green-soft); color: var(--green); }
.r4-status-met .r4-mark { width: 6px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -2px 2px 0; }
.r4-status-partial { background: var(--amber-soft); color: #8a3f06; }
.r4-status-partial .r4-mark { border-radius: 50%; border: 2px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.r4-status-missing { background: var(--surface); color: var(--ink-soft); border-color: var(--line); }
.r4-status-missing .r4-mark { border-radius: 50%; border: 2px solid currentColor; }
.r4-req-for { margin: 0 0 2px; color: var(--ink); }
.r4-hidden-note { margin: 0 0 6px; }
.r4-money.is-masked { letter-spacing: 0.02em; }

/* ---------- Money ---------- */
.r4-money-view .card { margin-bottom: 12px; }
.r4-total { padding: 18px 16px; border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line)); }
.r4-total-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r4-total-label { font-size: 0.95rem; margin: 0; color: var(--ink-soft); font-weight: 650; }
.r4-total-amt { margin: 4px 0 0; }
.r4-amt { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); white-space: nowrap; }
.r4-amt.is-negative { color: var(--rose); }
.r4-amt-lg { font-size: 1.7rem; color: var(--teal); }
.r4-amt.is-masked { color: var(--ink-soft); letter-spacing: 0.08em; }
.r4-accounts h2, .r4-history h2 { font-size: 1rem; margin: 0 0 6px; color: var(--ink); }
.r4-acc-list { list-style: none; margin: 0; padding: 0; }
.r4-acc { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.r4-acc:last-child { border-bottom: 0; }
.r4-acc-name { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.r4-add { margin: 4px 0 16px; }
.r4-add-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.r4-add-btn { width: 100%; padding-inline: 6px; line-height: 1.3; white-space: normal; }
@media (max-width: 370px) { html[lang="my"] .r4-add-row { grid-template-columns: 1fr; } }
.r4-cat-field select { width: 100%; }
.r4-orig-cat { margin: 4px 0 0; font-style: italic; }

/* ---------- PIN mode choice ---------- */
.r4-pin-setup { padding: 20px 16px; }
.r4-pin-setup p { color: var(--ink); }
.r4-radio {
  align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 8px 0 0;
}
.r4-radio > span { display: flex; flex-direction: column; }
.r4-radio:has(input:checked) { border-color: var(--gold-dark); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.card .r4-safer { color: var(--gold-dark); margin-top: 12px; }

/* Burmese text runs taller: keep line-height generous. */
html[lang="my"] .r4-sec-btn, html[lang="my"] .r4-label, html[lang="my"] .r4-status { line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  .r4-sec-chev { transition: none; }
  .r4-money-view *, .r4-home *, .r4-welcome * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- App Developer (profile form) additions: month/year picker, skill Add button, 360px rows ---------- */
.r4-month { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6px; }
.r4-month select { padding-inline: 8px; }
.r4-inline .btn.r4-inline-btn { width: auto; padding: 10px 16px; }
@media (max-width: 380px) { .r4-row.row-2 { grid-template-columns: 1fr; gap: 0; } }

/* Home greeting: one line, not a section. */
.r4-greet { color: var(--gold-2); font-size: 1.15rem; font-weight: 700; margin: 2px 0 12px; line-height: 1.5; overflow-wrap: anywhere; }
.r4-total-sub { margin: 2px 0 0; }
.r4-accounts .linkish { min-height: 44px; display: inline-flex; align-items: center; color: var(--gold-dark); }

/* ===== r4 UI hooks (IT): test badge, onboarding language toggle, weak-PIN prompt, restore card, locked inputs ===== */

/* Test build badge: small, calm, in normal flow (never overlaps). Dark-bg default; dark text inside cards. */
.test-badge {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  margin: 0 0 12px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 600; line-height: 1.5;
  color: var(--ink-on-dark-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  background: rgba(8, 24, 20, 0.55);
  overflow-wrap: anywhere;
}
.test-badge-dot { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.card .test-badge { color: var(--gold-dark); background: var(--surface-2); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.card .test-badge .test-badge-dot { background: var(--gold-dark); }
html[lang="my"] .test-badge { line-height: 1.7; }

/* Onboarding EN | MY toggle (the header is hidden in onboarding mode). Segmented control, 44px. */
#onboard-lang.onboard-lang { display: flex; justify-content: flex-end; margin: 8px 0 6px; }
#onboard-lang[hidden] { display: none !important; }
.onboard-lang-toggle { padding: 3px; gap: 2px; }
.onboard-lang-toggle button {
  min-height: 44px; min-width: 52px; padding: 0 14px; font-size: 0.85rem; cursor: pointer;
}
.onboard-lang-toggle button:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.onboard-lang-toggle button[aria-pressed="true"] { cursor: default; }

/* Weak-PIN prompt: calm cream banner with a gold rule, never alarming. */
#weak-pin-prompt.weak-pin-prompt {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-inline-start: 4px solid var(--gold);
  padding: 14px 14px 12px; margin: 8px 0 12px; font-size: 0.92rem;
}
.weak-pin-mark {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%;
  border: 2px solid var(--gold-dark); position: relative;
}
.weak-pin-mark::after {
  content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 8px; margin-left: -1px;
  background: var(--gold-dark); border-radius: 1px; box-shadow: 0 10px 0 0 var(--gold-dark);
}
.weak-pin-copy { flex: 1 1 auto; min-width: 0; }
.weak-pin-title { margin: 0 0 2px; color: var(--ink); }
.weak-pin-body { margin: 0; color: var(--ink-soft); font-size: 0.85rem; }
.weak-pin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.weak-pin-actions .btn { min-height: 44px; flex: 1 1 140px; width: auto; }
.weak-pin-later { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; padding: 0 12px; }
.weak-pin-actions .btn:focus-visible { outline: 3px solid var(--teal-2); outline-offset: 2px; }
html[lang="my"] .weak-pin-copy { line-height: 1.7; }

/* Restore card under the profile form. */
.r4-restore-card { margin-top: 12px; padding: 14px 16px; border-style: dashed; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.card .r4-restore-note { color: var(--ink-soft); margin: 0 0 10px; }
.r4-restore-btn { width: 100%; }

/* Fill-missing-once: filled fields are locked. Readable (ink on cream), quiet dashed look + small lock mark. */
.r4-form .r4-locked-input:disabled,
.r4-form .r4-locked-input[disabled] {
  opacity: 1; cursor: not-allowed;
  color: var(--ink); -webkit-text-fill-color: var(--ink);
  background: var(--surface-2);
  border: 1px dashed color-mix(in srgb, var(--gold-dark) 55%, var(--line));
  box-shadow: none;
}
.r4-form .r4-check .r4-locked-input:disabled + span { color: var(--ink); }
.r4-field.is-locked > .r4-label::after,
.r4-field.is-locked > legend.r4-label::after {
  content: ""; display: inline-block; width: 11px; height: 12px; margin-inline-start: 6px; vertical-align: -1px;
  background: var(--gold-dark);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 12'%3E%3Cpath d='M2.5 5V3.5a3 3 0 0 1 6 0V5h.5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 12'%3E%3Cpath d='M2.5 5V3.5a3 3 0 0 1 6 0V5h.5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.r4-form button[disabled][data-skill-remove], .r4-form button[disabled][data-skill-add],
.r4-form button[disabled][data-job-add], .r4-form button[disabled][data-job-remove] { opacity: 0.6; }

/* ===== r4b (App Developer) ===== */

/* Home: collapsed cards with a clear hierarchy — gold mark, title, quiet meta line, chevron in a soft disc. */
.r4-home .r4-sec { margin: 0 0 8px; border-radius: 14px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); box-shadow: 0 1px 0 rgba(12, 31, 26, 0.04); }
.r4-home .r4-sec-btn { min-height: 64px; padding: 10px 12px 10px 14px; gap: 12px; align-items: center; }
.r4-sec-mark { flex: 0 0 auto; width: 4px; align-self: stretch; min-height: 34px; border-radius: 4px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); }
.r4-sec.is-empty .r4-sec-mark { background: color-mix(in srgb, var(--gold) 35%, var(--line)); }
.r4-sec-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.r4-home .r4-sec-title { font-size: 1rem; font-weight: 700; color: var(--teal); line-height: 1.35; }
.r4-sec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); line-height: 1.4; }
.r4-sec-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-soft); }
.r4-sec-high { color: var(--gold-dark); }
.r4-home .r4-sec-chev { width: 32px; height: 32px; border: 0; margin: 0; transform: none; border-radius: 50%;
  background: var(--surface-2); position: relative; }
.r4-home .r4-sec-chev::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--gold-dark); border-bottom: 2px solid var(--gold-dark);
  transform: translate(-50%, -70%) rotate(45deg); transition: transform 0.18s ease; }
.r4-home .r4-sec.is-open .r4-sec-chev { transform: none; margin: 0; }
.r4-home .r4-sec.is-open .r4-sec-chev::before { transform: translate(-50%, -30%) rotate(-135deg); }
.r4-home .r4-sec-btn:hover .r4-sec-chev { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); }
.r4-home .r4-sec.is-open .r4-sec-btn { border-bottom: 1px solid var(--line); }
.r4-home .r4-sec-panel { padding: 10px 14px 14px; }
html[lang="my"] .r4-sec-meta { line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .r4-home .r4-sec-chev::before { transition: none; } }

/* Suggested skills: read-only chips, labelled as suggestions. */
.r4-suggested { margin: 14px 0 4px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 60%, var(--surface));
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, var(--line)); }
.r4-suggested-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.r4-suggested .r4-sub { margin: 0; }
.r4-tag { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; color: var(--gold-dark);
  border: 1px solid color-mix(in srgb, var(--gold-dark) 45%, transparent); background: var(--surface); }
.r4-skill-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.r4-skill-chip { font-size: 0.82rem; padding: 4px 12px; border-radius: 999px; color: var(--ink); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); max-width: 100%; overflow-wrap: anywhere; }

/* One action per section: text-only empty states (the header link is the action). */
.empty-state.is-text { padding: 14px 0 4px; text-align: start; }
.empty-state.is-text .empty { margin: 0; max-width: none; color: var(--ink-on-dark-soft); }
.card .empty-state.is-text .empty { color: var(--ink-soft); }
.back-row .btn-ghost { min-height: 44px; display: inline-flex; align-items: center; }

/* PIN setup: just the 3 types, nothing preselected; Continue disabled until one is picked. */
.r4-pin-setup .r4-pin-modes > legend { padding: 0; margin: 0 0 4px; }
.r4-pin-legend { font-size: 1.15rem; margin: 0; color: var(--teal); line-height: 1.4; }
.r4-pin-mode { min-height: 56px; }
.r4-pin-mode:has(input:focus-visible) { outline: 3px solid var(--teal-2); outline-offset: 2px; }
.r4-pin-setup [data-pin-mode-continue] { width: 100%; margin-top: 14px; }
.r4-pin-setup [data-pin-mode-continue]:disabled { opacity: 1; background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid var(--line); box-shadow: none; }

/* Profile form r4b groups */
.r4-group { padding: 0; margin: 18px 0 10px; }
.r4-group > legend.r4-label { margin: 0 0 6px; }
.r4-legend-lg { font-size: 1rem; color: var(--teal); }
.r4-subgroup { margin: 8px 0 4px; }
.r4-subgroup > .r4-label { margin: 0 0 2px; }
.r4-yesno, .r4-tf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.r4-yesno .r4-radio, .r4-tf .r4-radio { margin: 0; align-items: center; min-height: 48px; }
.r4-yesno .r4-radio:has(input:focus-visible), .r4-tf .r4-radio:has(input:focus-visible) { outline: 3px solid var(--teal-2); outline-offset: 2px; }
.r4-field.is-off .r4-month select { background: var(--surface-2); color: var(--ink-soft); }
.r4-form textarea { min-height: 72px; }
.r4-form .r4-job .r4-check { margin-top: 2px; }

/* #/work-experience */
.r4-wx { padding: 6px 14px 12px; }
.r4-wx-list { list-style: none; margin: 0; padding: 0; }
.r4-wx-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.r4-wx-item:last-child { border-bottom: 0; }
.r4-wx-main { display: flex; flex-direction: column; gap: 2px; color: var(--ink); overflow-wrap: anywhere; }
.card .r4-wx-main .tiny { color: var(--ink-soft); }
.r4-wx-note { font-style: italic; }
.r4-wx-btns { display: flex; gap: 8px; margin-top: 8px; }
.r4-wx-btns .btn { flex: 0 0 auto; width: auto; min-height: 44px; padding: 0 16px; }
.r4-wx-del { color: var(--rose); }
.r4-wx-actions .btn { min-height: 44px; }
.r4-wx-notice:empty { display: none; }
.card-head .linkish.r4-tap { min-height: 44px; display: inline-flex; align-items: center; }

/* Work entry: country/city and from/to stack so month, year and country names are never cut off at 360-430px. */
.r4-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 560px) { .r4-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
/* Radio groups: the error ring goes on the option rows, not on each small circle. */
.r4-form input[type="radio"][aria-invalid="true"], .r4-form input[type="checkbox"][aria-invalid="true"] { box-shadow: none; }
.r4-yesno:has([aria-invalid="true"]) .r4-radio, .r4-tf:has([aria-invalid="true"]) .r4-radio { border-color: var(--rose); }

/* Preview-r4b persistent header badge + Home sample-data note. */
/* Keep the PREVIEW chip on its own row under the title/language toggle. */
.app-header:has(#previewBanner) { flex-wrap: wrap; }
#previewBanner {
  flex: 1 1 100%;
  margin: 6px 0 0;
  align-self: flex-start;
}
.sample-banner {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--gold-dark, #8a6a12);
  background: color-mix(in srgb, var(--gold, #c9a227) 14%, var(--surface, #fff));
  border: 1px solid color-mix(in srgb, var(--gold, #c9a227) 40%, var(--line, #ddd));
}
html[lang="my"] .sample-banner { line-height: 1.7; }
