/* Field Capture: design language v1. Source of truth: field-capture-context/plan_E.md (FC-E-01). Class contract: plan_D2.md §10.3 + plan_E.md §5.0.
   Tokens first, then components. No framework, no build. Mobile first.
   Every text/background pair is checked by tools/check_design.py. Run it after any colour change. */

/* ============================== 1. TOKENS ============================== */
:root {
  color-scheme: light dark;

  /* Type: the system font on every platform (SF on iPhone, Roboto on Android). */
  --fc-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fc-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fc-fs-largetitle: 2.125rem;  --fc-lh-largetitle: 1.18;  /* 34px */
  --fc-fs-title1: 1.75rem;       --fc-lh-title1: 1.2;       /* 28px: the question */
  --fc-fs-title2: 1.375rem;      --fc-lh-title2: 1.25;      /* 22px: Yes / No */
  --fc-fs-title3: 1.25rem;       --fc-lh-title3: 1.3;       /* 20px */
  --fc-fs-headline: 1.0625rem;   --fc-lh-headline: 1.3;     /* 17px semibold */
  --fc-fs-body: 1.0625rem;       --fc-lh-body: 1.45;        /* 17px */
  --fc-fs-callout: 1rem;         --fc-lh-callout: 1.4;      /* 16px */
  --fc-fs-subhead: 0.9375rem;    --fc-lh-subhead: 1.35;     /* 15px */
  --fc-fs-footnote: 0.8125rem;   --fc-lh-footnote: 1.35;    /* 13px: the smallest size used */
  --fc-track-display: -0.015em;

  /* Space: 4px grid */
  --fc-space-1: 4px;  --fc-space-2: 8px;  --fc-space-3: 12px; --fc-space-4: 16px; --fc-space-5: 20px;
  --fc-space-6: 24px; --fc-space-7: 32px; --fc-space-8: 40px; --fc-space-9: 48px; --fc-space-10: 64px;
  --fc-gutter: 20px;

  /* Radius */
  --fc-radius-s: 10px; --fc-radius-m: 14px; --fc-radius-l: 20px; --fc-radius-xl: 28px; --fc-radius-round: 999px;

  /* Touch targets: gloves, cold hands, one thumb */
  --fc-tap-min: 56px;      /* nothing tappable is smaller */
  --fc-tap-answer: 104px;  /* Yes / No */
  --fc-tap-stepper: 72px;  /* - / + */
  --fc-tap-shutter: 76px;  /* camera */

  /* Motion */
  --fc-dur-press: 90ms;   /* press feedback */
  --fc-dur-quick: 160ms;  /* selection, toggles */
  --fc-dur-base: 240ms;   /* screen push / pop, fades */
  --fc-dur-sheet: 320ms;  /* sheet up */
  --fc-dur-draw: 420ms;   /* the Sent tick */
  --fc-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --fc-ease-enter: cubic-bezier(0, 0, 0.2, 1);
  --fc-ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --fc-ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);

  /* Colour: light. The accent comes from theme.js (tenant); the fallbacks are the neutral default. */
  --fc-bg: #FFFFFF;
  --fc-bg-grouped: #F2F2F7;
  --fc-surface: #FFFFFF;
  --fc-fill: #E9E9EE;
  --fc-fill-pressed: #DCDCE2;
  --fc-separator: #C6C6C8;
  --fc-text: #0B0B0C;
  --fc-text-2: #46464B;
  --fc-text-3: #626267;
  --fc-accent: var(--fc-accent-l, #0A5BD3);
  --fc-accent-pressed: var(--fc-accent-pressed-l, #084BAD);
  --fc-accent-tint: var(--fc-accent-tint-l, #E7EFFB);
  --fc-accent-text: var(--fc-accent-text-l, #0A5BD3);
  --fc-on-accent: #FFFFFF;
  --fc-success: #1B7336;
  --fc-success-tint: #E6F4EA;
  --fc-warning: #8A5200;
  --fc-warning-tint: #FFF3D6;
  --fc-danger: #C0262D;
  --fc-danger-tint: #FCE9EA;
  --fc-danger-solid: #C0262D;
  --fc-on-danger: #FFFFFF;
  --fc-toast-bg: #1C1C1E;
  --fc-toast-text: #FFFFFF;
  --fc-toast-action: #8AB4FF;
  --fc-scrim: rgba(0, 0, 0, 0.4);
  --fc-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.05);
  --fc-shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.18);
  --fc-ink: #0B0B0C;        /* signature ink: the pad is always white */
  --fc-pad-bg: #FFFFFF;
  --fc-pad-guide: #8E8E93;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fc-bg: #000000;
    --fc-bg-grouped: #000000;
    --fc-surface: #1C1C1E;
    --fc-fill: #2C2C2E;
    --fc-fill-pressed: #3A3A3C;
    --fc-separator: #3A3A3C;
    --fc-text: #FFFFFF;
    --fc-text-2: #D1D1D6;
    --fc-text-3: #A1A1A8;
    --fc-accent: var(--fc-accent-d, #0A5BD3);
    --fc-accent-pressed: var(--fc-accent-pressed-d, #094DB3);
    --fc-accent-tint: var(--fc-accent-tint-d, #172E51);
    --fc-accent-text: var(--fc-accent-text-d, #6296E3);
    --fc-on-accent: #FFFFFF;
    --fc-success: #5FD17F;
    --fc-success-tint: #10301A;
    --fc-warning: #FFC45C;
    --fc-warning-tint: #3A2A08;
    --fc-danger: #FF7A7F;
    --fc-danger-tint: #3D1215;
    --fc-danger-solid: #C8323A;
    --fc-on-danger: #FFFFFF;
    --fc-toast-bg: #3A3A3C;
    --fc-toast-text: #FFFFFF;
    --fc-toast-action: #9CC2FF;
    --fc-scrim: rgba(0, 0, 0, 0.6);
    --fc-shadow-card: none;
    --fc-shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.6);
  }
}

/* ============================== 2. BASE ============================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--fc-font); font-size: var(--fc-fs-body); line-height: var(--fc-lh-body);
  color: var(--fc-text); background: var(--fc-bg);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; touch-action: manipulation; text-align: inherit; }
a { color: var(--fc-accent-text); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--fc-bg), 0 0 0 6px var(--fc-accent); border-radius: var(--fc-radius-s); }
.fc-icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fc-icon--s { width: 16px; height: 16px; }

/* The frame: full screen on a phone; a centred phone on a desktop (demos). */
#app { position: relative; display: flex; flex-direction: column; min-height: 100dvh; max-width: 480px; margin: 0 auto; background: var(--fc-bg); overflow: hidden; }
@media (min-width: 600px) {
  body { background: var(--fc-bg-grouped); display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 32px; }
  #app { width: 430px; height: min(900px, calc(100dvh - 64px)); min-height: 0; border-radius: 36px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18); }
}

/* ============================== 3. SCREEN STRUCTURE ============================== */
/* <section class="fc-screen fc-<kind>"> [header.fc-top] [div.fc-progress] main.fc-scroll [footer.fc-dock] */
.fc-screen { flex: 1; min-height: 0; min-width: 0; width: 100%; display: flex; flex-direction: column; background: var(--fc-bg); animation: fc-in var(--fc-dur-base) var(--fc-ease-enter); }
.fc-today, .fc-job, .fc-review, .fc-crew, .fc-pending { background: var(--fc-bg-grouped); }
.fc-screen.is-back { animation-name: fc-in-back; }
.fc-screen.is-root { animation-name: fc-fade-in; }

.fc-top {
  flex: none; display: grid; grid-template-columns: minmax(64px, 1fr) minmax(0, auto) minmax(64px, 1fr); align-items: center;
  min-height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--fc-space-2) 0;
}
.fc-back, .fc-close {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--fc-tap-min); min-width: var(--fc-tap-min);
  padding: 0 var(--fc-space-3); color: var(--fc-accent-text); font-size: var(--fc-fs-body);
}
.fc-back { justify-self: start; padding-left: var(--fc-space-1); }
.fc-close { justify-self: end; justify-content: flex-end; grid-column: 3; }
.fc-top-title { grid-column: 2; font-size: var(--fc-fs-headline); font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.fc-progress { flex: none; height: 4px; margin: var(--fc-space-1) var(--fc-gutter) var(--fc-space-5); border-radius: 2px; background: var(--fc-fill); overflow: hidden; }
.fc-progress > span { display: block; height: 100%; border-radius: 2px; background: var(--fc-accent); transition: width var(--fc-dur-base) var(--fc-ease-standard); }

.fc-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: var(--fc-space-2) var(--fc-gutter) var(--fc-space-8); }
.fc-dock { flex: none; display: flex; flex-direction: column; gap: var(--fc-space-2); padding: var(--fc-space-3) var(--fc-gutter) calc(var(--fc-space-3) + env(safe-area-inset-bottom)); background: inherit; }

/* ============================== 4. TEXT ============================== */
.fc-org-row { display: flex; align-items: center; gap: var(--fc-space-2); }
.fc-org-logo { height: 28px; width: auto; max-width: 120px; object-fit: contain; }
.fc-org { font-size: var(--fc-fs-subhead); font-weight: 600; color: var(--fc-text-2); margin-bottom: var(--fc-space-1); }
.fc-today-head { display: flex; align-items: center; justify-content: space-between; gap: var(--fc-space-3); }
.fc-today-head .fc-h1 { margin-bottom: 0; }
.fc-refresh-btn { flex: none; }
.fc-h1 { font-family: var(--fc-font-display); font-size: var(--fc-fs-largetitle); line-height: var(--fc-lh-largetitle); font-weight: 700; letter-spacing: var(--fc-track-display); overflow-wrap: anywhere; }
.fc-h1:not(:last-child) { margin-bottom: var(--fc-space-4); }
.fc-h1 + .fc-sub { margin-top: calc(-1 * var(--fc-space-3)); }
.fc-sub { margin: var(--fc-space-1) 0 var(--fc-space-5); font-size: var(--fc-fs-subhead); line-height: var(--fc-lh-subhead); color: var(--fc-text-2); overflow-wrap: anywhere; }
.fc-job-chips { margin: 0 0 var(--fc-space-4); }
.fc-section-h { margin: var(--fc-space-6) 0 var(--fc-space-2); font-size: var(--fc-fs-subhead); font-weight: 600; color: var(--fc-text-2); }
.fc-group, .fc-kicker { margin-bottom: var(--fc-space-2); font-size: var(--fc-fs-subhead); font-weight: 600; color: var(--fc-text-2); }
.fc-group { color: var(--fc-accent-text); }
.fc-prompt { font-family: var(--fc-font-display); font-size: var(--fc-fs-title1); line-height: var(--fc-lh-title1); font-weight: 700; letter-spacing: var(--fc-track-display); overflow-wrap: anywhere; }
.fc-body { font-size: var(--fc-fs-body); line-height: var(--fc-lh-body); color: var(--fc-text-2); }
.fc-error { margin-top: var(--fc-space-2); font-size: var(--fc-fs-subhead); font-weight: 600; color: var(--fc-danger); }

/* ============================== 5. BUTTONS ============================== */
.fc-primary, .fc-secondary, .fc-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--fc-space-2);
  width: 100%; min-height: var(--fc-tap-min); padding: 0 var(--fc-space-5); border-radius: var(--fc-radius-m);
  font-size: var(--fc-fs-headline); font-weight: 600; line-height: 1.2; text-align: center;
  transition: transform var(--fc-dur-press) var(--fc-ease-standard), background-color var(--fc-dur-press) var(--fc-ease-standard), opacity var(--fc-dur-quick) var(--fc-ease-standard);
}
.fc-primary:active, .fc-secondary:active, .fc-danger:active { transform: scale(0.97); }
.fc-primary { background: var(--fc-accent); color: var(--fc-on-accent); }
.fc-primary:active { background: var(--fc-accent-pressed); }
.fc-secondary { background: var(--fc-fill); color: var(--fc-accent-text); }
.fc-secondary:active { background: var(--fc-fill-pressed); }
.fc-danger { background: var(--fc-danger-solid); color: var(--fc-on-danger); }
.fc-link { display: inline-flex; align-items: center; justify-content: center; min-height: var(--fc-tap-min); padding: 0 var(--fc-space-3); font-size: var(--fc-fs-body); font-weight: 600; color: var(--fc-accent-text); }
.fc-dock .fc-link { align-self: center; }
.fc-primary[disabled], .fc-secondary[disabled], .fc-danger[disabled], .fc-link[disabled] { opacity: 0.38; pointer-events: none; }
.fc-spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: fc-spin 800ms linear infinite; flex: none; }

/* ============================== 6. BANNERS, CHIPS, BADGE ============================== */
.fc-banner { display: flex; align-items: flex-start; gap: var(--fc-space-3); margin: 0 0 var(--fc-space-4); padding: var(--fc-space-3) var(--fc-space-4); min-height: var(--fc-tap-min); border-radius: var(--fc-radius-m); font-size: var(--fc-fs-subhead); line-height: var(--fc-lh-subhead); font-weight: 600; color: var(--fc-text); background: var(--fc-fill); }
.fc-banner > .fc-icon { margin-top: 1px; }
.fc-banner.is-offline, .fc-banner.is-warn { background: var(--fc-warning-tint); }
.fc-banner.is-offline > .fc-icon, .fc-banner.is-warn > .fc-icon { color: var(--fc-warning); }
.fc-banner.is-demo { background: var(--fc-accent-tint); }
.fc-banner.is-demo > .fc-icon { color: var(--fc-accent-text); }
.fc-banner.is-stale > .fc-icon { color: var(--fc-text-2); }
.fc-banner .fc-link { margin-left: auto; min-height: 0; padding: 0; }

.fc-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 var(--fc-space-2); border-radius: var(--fc-radius-round); font-size: var(--fc-fs-footnote); font-weight: 600; background: var(--fc-fill); color: var(--fc-text-2); }
.fc-chip .fc-icon { width: 14px; height: 14px; stroke-width: 2.5; }
.fc-chip.is-draft { background: var(--fc-accent-tint); color: var(--fc-accent-text); }
.fc-chip.is-waiting { background: var(--fc-warning-tint); color: var(--fc-warning); }
.fc-chip.is-sent { background: var(--fc-success-tint); color: var(--fc-success); }
.fc-chip.is-stuck, .fc-chip.is-overdue { background: var(--fc-danger-tint); color: var(--fc-danger); }
.fc-chip.is-other { background: var(--fc-fill); color: var(--fc-text-2); }

/* The pending badge lives outside #app (D2). It is a strip pinned under the status bar; while it shows,
   #app is pushed down by its height so it never covers content (:has() — Chrome 105+, Safari 15.4+). */
.fc-badge { position: fixed; z-index: 90; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: center; gap: var(--fc-space-2);
  min-height: calc(36px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) var(--fc-gutter) 0;
  font-size: var(--fc-fs-subhead); font-weight: 600; background: var(--fc-accent-tint); color: var(--fc-text); cursor: pointer; }
.fc-badge.is-offline { background: var(--fc-warning-tint); }
.fc-badge.is-stuck { background: var(--fc-danger-tint); color: var(--fc-danger); }
body:has(.fc-badge:not([style*="none"])) #app { margin-top: 36px; min-height: calc(100dvh - 36px); }
body:has(.fc-badge:not([style*="none"])) .fc-top { padding-top: 0; min-height: 56px; }

/* ============================== 7. LISTS, ROWS, KEY-VALUES ============================== */
.fc-list { margin: 0 0 var(--fc-space-5); background: var(--fc-surface); border-radius: var(--fc-radius-m); overflow: hidden; }
.fc-list > li { position: relative; }
.fc-list > li + li::before { content: ""; position: absolute; top: 0; left: var(--fc-space-4); right: 0; border-top: 1px solid var(--fc-separator); }

.fc-row, .fc-toggle { display: flex; align-items: center; gap: var(--fc-space-3); width: 100%; min-height: var(--fc-tap-min); padding: var(--fc-space-3) var(--fc-space-4); text-align: left; }
button.fc-row:active, .fc-toggle:active { background: var(--fc-fill); }
.fc-row-q { flex: 1; min-width: 0; font-size: var(--fc-fs-body); line-height: var(--fc-lh-body); overflow-wrap: anywhere; }
.fc-row-a { flex: none; max-width: 45%; text-align: right; font-size: var(--fc-fs-body); font-weight: 600; color: var(--fc-text-2); font-variant-numeric: tabular-nums; }
.fc-row-a.is-yes { color: var(--fc-text); }

.fc-toggle > span:first-child { flex: 1; min-width: 0; font-size: var(--fc-fs-body); overflow-wrap: anywhere; }
.fc-toggle::after { content: ""; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--fc-separator); transition: background-color var(--fc-dur-quick) var(--fc-ease-standard), border-color var(--fc-dur-quick) var(--fc-ease-standard); }
.fc-toggle.is-on::after, .fc-toggle[aria-pressed="true"]::after { border-color: var(--fc-accent); background: var(--fc-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4L18 8'/%3E%3C/svg%3E") center / 18px no-repeat; }
.fc-crew-sub { padding: var(--fc-space-3) var(--fc-space-4); font-size: var(--fc-fs-subhead); color: var(--fc-text-2); }

.fc-kv { margin: 0 0 var(--fc-space-5); background: var(--fc-surface); border-radius: var(--fc-radius-m); overflow: hidden; }
.fc-kv > div { position: relative; padding: var(--fc-space-3) var(--fc-space-4); min-height: var(--fc-tap-min); }
.fc-kv > div + div::before { content: ""; position: absolute; top: 0; left: var(--fc-space-4); right: 0; border-top: 1px solid var(--fc-separator); }
.fc-kv dt { font-size: var(--fc-fs-footnote); font-weight: 600; color: var(--fc-text-2); }
.fc-kv dd { margin-top: 2px; font-size: var(--fc-fs-body); line-height: var(--fc-lh-body); overflow-wrap: anywhere; }
.fc-kv dd a { display: inline-flex; align-items: center; gap: var(--fc-space-1); min-height: 32px; font-weight: 600; }

/* ============================== 8. TODAY: JOB ROWS ============================== */
.fc-jobrow { display: grid; grid-template-columns: 40px 1fr 20px; gap: var(--fc-space-3); align-items: start; width: 100%; min-height: 88px; padding: var(--fc-space-4); text-align: left; transition: background-color var(--fc-dur-press) var(--fc-ease-standard); }
.fc-jobrow:active { background: var(--fc-fill); }
.fc-jobrow-seq { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--fc-fill); font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-jobrow.is-next .fc-jobrow-seq { background: var(--fc-accent); color: var(--fc-on-accent); }
.fc-jobrow-main { min-width: 0; }
.fc-jobrow-site { display: block; font-size: var(--fc-fs-headline); line-height: var(--fc-lh-headline); font-weight: 600; overflow-wrap: anywhere; }
.fc-jobrow-title { display: block; margin-top: 2px; font-size: var(--fc-fs-subhead); line-height: var(--fc-lh-subhead); color: var(--fc-text-2); overflow-wrap: anywhere; }
.fc-jobrow-meta { display: flex; flex-wrap: wrap; gap: var(--fc-space-2); margin-top: var(--fc-space-2); }
.fc-jobrow > .fc-icon { align-self: center; color: var(--fc-text-3); width: 20px; height: 20px; }
.fc-jobrow.is-done .fc-jobrow-site { color: var(--fc-text-2); }
.fc-skel { display: block; border-radius: var(--fc-radius-s); background: linear-gradient(90deg, var(--fc-fill) 0%, var(--fc-bg-grouped) 50%, var(--fc-fill) 100%); background-size: 200% 100%; animation: fc-shimmer 1.2s linear infinite; height: 14px; margin: 6px 0; }
.fc-skel.is-disc { width: 40px; height: 40px; border-radius: 50%; margin: 0; }

.fc-empty { display: flex; flex-direction: column; align-items: center; gap: var(--fc-space-2); padding: var(--fc-space-9) var(--fc-space-4); text-align: center; }
.fc-empty > .fc-icon { width: 48px; height: 48px; stroke-width: 1.5; color: var(--fc-text-3); margin-bottom: var(--fc-space-2); }
.fc-empty > p:first-of-type { font-size: var(--fc-fs-title3); line-height: var(--fc-lh-title3); font-weight: 700; color: var(--fc-text); }
.fc-empty > p + p { font-size: var(--fc-fs-subhead); color: var(--fc-text-2); max-width: 300px; }
.fc-empty > button { margin-top: var(--fc-space-4); width: auto; min-width: 200px; }

/* ============================== 9. QUESTION ============================== */
.fc-q .fc-scroll, .fc-qty-screen .fc-scroll { display: flex; flex-direction: column; }
.fc-answers { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: var(--fc-space-3); padding-top: var(--fc-space-6); }
.fc-answer {
  display: flex; align-items: center; justify-content: center; gap: var(--fc-space-2);
  min-height: var(--fc-tap-answer); border-radius: var(--fc-radius-l); background: var(--fc-fill); color: var(--fc-text);
  font-size: var(--fc-fs-title2); font-weight: 700;
  transition: background-color var(--fc-dur-quick) var(--fc-ease-standard), color var(--fc-dur-quick) var(--fc-ease-standard), transform var(--fc-dur-press) var(--fc-ease-standard);
}
.fc-answer:active { transform: scale(0.96); background: var(--fc-fill-pressed); }
.fc-answer.is-picked { background: var(--fc-accent); color: var(--fc-on-accent); animation: fc-pop var(--fc-dur-base) var(--fc-ease-spring); }
.fc-answer.is-picked::before { content: ""; width: 22px; height: 22px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.fc-skip { display: block; margin: var(--fc-space-2) auto 0; min-height: var(--fc-tap-min); padding: 0 var(--fc-space-5); font-size: var(--fc-fs-body); font-weight: 600; color: var(--fc-text-2); }

/* ============================== 10. QUANTITY ============================== */
.fc-stepper { display: grid; grid-template-columns: var(--fc-tap-stepper) 1fr var(--fc-tap-stepper); grid-template-rows: auto auto; align-items: center; column-gap: var(--fc-space-3); margin: auto 0; padding: var(--fc-space-8) 0; }
.fc-step { grid-row: 1 / span 2; width: var(--fc-tap-stepper); height: var(--fc-tap-stepper); border-radius: 50%; display: grid; place-items: center; background: var(--fc-fill); color: var(--fc-accent-text); font-size: 2.25rem; font-weight: 500; line-height: 1; transition: transform var(--fc-dur-press) var(--fc-ease-standard), background-color var(--fc-dur-press) var(--fc-ease-standard); }
.fc-step:active { transform: scale(0.94); background: var(--fc-fill-pressed); }
.fc-step[disabled] { opacity: 0.38; pointer-events: none; }
.fc-step[data-dir="-1"] { grid-column: 1; }
.fc-step[data-dir="1"] { grid-column: 3; }
.fc-qty { grid-column: 2; grid-row: 1; text-align: center; font-family: var(--fc-font-display); font-size: 3.5rem; line-height: 1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fc-unit { grid-column: 2; grid-row: 2; text-align: center; margin-top: var(--fc-space-1); font-size: var(--fc-fs-subhead); color: var(--fc-text-2); }

/* ============================== 11. INPUTS ============================== */
.fc-label { display: block; margin: var(--fc-space-4) 0 var(--fc-space-2); font-size: var(--fc-fs-subhead); font-weight: 600; color: var(--fc-text-2); }
.fc-input, .fc-textarea { display: block; width: 100%; min-height: var(--fc-tap-min); padding: 0 var(--fc-space-4); border-radius: var(--fc-radius-s); border: 1.5px solid transparent; background: var(--fc-fill); font-size: var(--fc-fs-body); color: var(--fc-text); -webkit-appearance: none; appearance: none; transition: border-color var(--fc-dur-quick) var(--fc-ease-standard); }
.fc-textarea { min-height: 160px; padding: var(--fc-space-3) var(--fc-space-4); line-height: var(--fc-lh-body); resize: none; }
.fc-input:focus, .fc-textarea:focus { border-color: var(--fc-accent); background: var(--fc-surface); box-shadow: none; }
.fc-input[aria-invalid="true"] { border-color: var(--fc-danger); }
.fc-input::placeholder, .fc-textarea::placeholder { color: var(--fc-text-3); }

/* ============================== 12. PHOTOS ============================== */
.fc-photo-screen .fc-scroll { display: flex; flex-direction: column; }
.fc-photo-screen .fc-thumb { margin-top: var(--fc-space-5); width: 100%; max-height: 52vh; object-fit: cover; border-radius: var(--fc-radius-l); background: var(--fc-fill); }
.fc-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fc-space-2); margin: 0 0 var(--fc-space-5); }
.fc-thumbs > button { position: relative; aspect-ratio: 1 / 1; border-radius: var(--fc-radius-s); overflow: hidden; background: var(--fc-fill); }
.fc-thumbs .fc-thumb { width: 100%; height: 100%; object-fit: cover; }

/* Camera overlay (existing class names, kept by D2). Always black, whatever the theme. */
.camov { position: absolute; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #000000; animation: fc-fade-in var(--fc-dur-quick) var(--fc-ease-enter); }
.camov video { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #000000; }
.camlabel { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + var(--fc-space-4)); left: 50%; transform: translateX(-50%); max-width: calc(100% - 2 * var(--fc-gutter)); padding: var(--fc-space-2) var(--fc-space-4); border-radius: var(--fc-radius-round); background: rgba(0, 0, 0, 0.62); color: #FFFFFF; font-size: var(--fc-fs-title3); line-height: var(--fc-lh-title3); font-weight: 700; text-align: center; }
.cambar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--fc-space-5) var(--fc-gutter) calc(var(--fc-space-6) + env(safe-area-inset-bottom)); background: #000000; }
.camcancel { justify-self: start; min-height: var(--fc-tap-min); font-size: var(--fc-fs-body); color: #FFFFFF; }
.camshot { width: var(--fc-tap-shutter); height: var(--fc-tap-shutter); border-radius: 50%; background: #FFFFFF; box-shadow: 0 0 0 4px #000000, 0 0 0 7px #FFFFFF; transition: transform var(--fc-dur-press) var(--fc-ease-standard); }
.camshot:active { transform: scale(0.9); }

/* ============================== 13. WARNINGS ============================== */
.fc-warn { margin: 0 0 var(--fc-space-4); padding: var(--fc-space-4); border-radius: var(--fc-radius-m); background: var(--fc-danger-tint); }
.fc-warn-what { font-size: var(--fc-fs-body); font-weight: 700; color: var(--fc-text); }
.fc-warn-why { margin-top: var(--fc-space-1); font-size: var(--fc-fs-subhead); color: var(--fc-text); }
.fc-warn-why:empty { display: none; }
.fc-warn-actions { display: flex; flex-wrap: wrap; gap: var(--fc-space-2); margin-top: var(--fc-space-3); }
.fc-warn-actions > button { width: auto; flex: 1 1 140px; }

/* ============================== 14. SIGNATURES ============================== */
/* D2's functional block sets .fc-pad's aspect-ratio 5/2, white background and touch-action. */
.fc-sign-screen .fc-pad { border-radius: var(--fc-radius-l); box-shadow: inset 0 0 0 1.5px var(--fc-separator); margin-top: var(--fc-space-4); }
.fc-sig-preview { width: 100%; aspect-ratio: 5 / 2; object-fit: contain; margin-top: var(--fc-space-4); border-radius: var(--fc-radius-l); background: #FFFFFF; box-shadow: inset 0 0 0 1.5px var(--fc-separator); }
.fc-sign-tools { display: flex; justify-content: space-between; align-items: center; margin-top: var(--fc-space-1); }
.fc-reasons { margin-top: var(--fc-space-4); background: var(--fc-surface); border-radius: var(--fc-radius-m); overflow: hidden; }
.fc-sign-screen .fc-reasons { background: var(--fc-fill); }

/* ============================== 15. DONE, SIGN-IN, GUARD ============================== */
.fc-done .fc-scroll, .fc-ready .fc-scroll, .fc-guard .fc-scroll { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.fc-mark { width: 96px; height: 96px; margin-bottom: var(--fc-space-5); }
.fc-mark circle { fill: var(--fc-success); }
.fc-mark path { fill: none; stroke: #FFFFFF; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: fc-draw var(--fc-dur-draw) var(--fc-ease-standard) 120ms forwards; }
.fc-mark.is-queued circle { fill: var(--fc-warning-tint); }
.fc-mark.is-queued path { stroke: var(--fc-warning); }
.fc-mark.is-stuck circle { fill: var(--fc-danger-solid); }
.fc-done .fc-h1, .fc-ready .fc-h1, .fc-guard .fc-h1 { font-size: var(--fc-fs-title1); line-height: var(--fc-lh-title1); }
.fc-done .fc-body, .fc-ready .fc-body, .fc-guard .fc-body { margin-top: var(--fc-space-2); max-width: 320px; }

.fc-signin .fc-scroll { display: flex; flex-direction: column; justify-content: center; }
.fc-signin .fc-h1 { text-align: center; }
.fc-signin-mark { display: block; height: 72px; width: auto; margin: 0 auto var(--fc-space-5); }
.fc-signin-lead { text-align: center; }
.fc-signin .fc-primary { margin-top: var(--fc-space-5); }
.fc-signin .fc-body { margin-top: var(--fc-space-5); text-align: center; font-size: var(--fc-fs-subhead); }
.fc-signin-footer { margin-top: var(--fc-space-6); text-align: center; font-size: var(--fc-fs-footnote); color: var(--fc-text-3); }

/* ============================== 16. MOTION ============================== */
@keyframes fc-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes fc-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes fc-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fc-pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes fc-draw { to { stroke-dashoffset: 0; } }
@keyframes fc-spin { to { transform: rotate(360deg); } }
@keyframes fc-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .fc-spinner { animation: fc-spin 1600ms linear infinite !important; }
  .fc-mark path { stroke-dashoffset: 0; }
}

/* ---- D2 functional rules: behaviour, not look. plan_E owns the look; do not restyle here. ---- */
.fc-pad{display:block;width:100%;aspect-ratio:5/2;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;background:#fff}
.fc-sign-screen{overscroll-behavior:none}
.fc-input,.fc-textarea{font-size:16px}
.fc-hidden{display:none!important}
