/* ==========================================================================
   Sayohatchi design tokens
   --------------------------------------------------------------------------
   The skeleton is the Platform Element Spec (sizes, spacing, shape, depth,
   motion, type); the colours are Sayohatchi's. Spec tokens are copied exactly
   (section "Spec tokens" below). Everything is on a 4px scale, controls come
   in three heights (30 / 36 / 44, inputs 38), radii are 8 for controls and 12
   for containers plus pill for badges and counts.

   The older composite tokens (--space-*, --pad-*, --radius-*, --type-*, …) are
   kept at the end as ALIASES onto the nearest spec value, so pages that still
   read them snap onto the spec until they are migrated. New code reads the
   spec tokens and the semantic colour aliases, never the legacy names.

   Load order per page: reset.css -> sayohatchi-tokens.css -> sayohatchi-ds.css
   -> page css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   fonts — Geist + Geist Mono (Vercel, SIL OFL 1.1; licenses in
   fonts/geist/OFL.txt and fonts/geist-mono/OFL.txt)
   One sans for all text, one mono for figures (times, prices, counts, IDs).

   Built from the official `geist` npm package (v1.7.2, Geist-Variable /
   GeistMono-Variable): the weight axis is limited to 400–700 and each family
   is split into a Latin file (Basic Latin, Latin-1, Latin Extended — Uzbek
   o‘ g‘ via U+2018 and U+02BC) and a Cyrillic file (Russian, plus Uzbek
   Cyrillic letters). All OpenType features are kept, including ss01.
   Geist has no U+02BB (ʻ); that one character falls back to system-ui.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist/Geist-latin.woff2") format("woff2");
  unicode-range: U+0000-03FF, U+0530-1C7F, U+1C90-2115, U+2117-2DDF, U+2E00-A63F, U+A6A0-FFFF;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist/Geist-cyrillic.woff2") format("woff2");
  unicode-range: U+0400-052F, U+1C80-1C8F, U+2116, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist-mono/GeistMono-latin.woff2") format("woff2");
  unicode-range: U+0000-03FF, U+0530-1C7F, U+1C90-2115, U+2117-2DDF, U+2E00-A63F, U+A6A0-FFFF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/geist-mono/GeistMono-cyrillic.woff2") format("woff2");
  unicode-range: U+0400-052F, U+1C80-1C8F, U+2116, U+2DE0-2DFF, U+A640-A69F;
}

:root {
  /* ======================================================================
     colors — Sayohatchi's palette. Hues unchanged; three text inks darkened
     so text reaches 4.5:1 (ratios measured on #FFFFFF / #F5F7F5):
       --neutral-700 #4A5D57  7.01 / 6.51   (was #5C6F69 5.34 / 4.96)
       --neutral-500 #65746F  4.91 / 4.56   (was #8B9A95 2.94 / 2.73)
       --amber-700   #97610A  4.63 on --amber-100 (was #9A6410 4.44)
     --neutral-350 keeps its value but is decoration only (dots, empty
     marks, disabled strokes) — never text. --text-faint is now muted ink.
     ====================================================================== */

  /* ---- Green: the brand spine. Ink is near-black green, never pure black. ---- */
  --green-900: #0F2E26; /* ink, dark panels, case header */
  --green-700: #0A5138; /* primary action, links, focus, active icon */
  --green-100: #E3F4E8; /* success wash, soft focus ring */
  --green-050: #F4F9F5; /* selected-option wash */

  /* ---- Lime: reserved accent. Progress fill and one lime CTA per dark panel. ---- */
  --lime-500: #B7EA3C;
  --lime-200: #D8E9B4;
  --lime-050: #FBFEF4;

  /* ---- Neutrals: warm-grey greens, never blue-grey ---- */
  --neutral-000: #FFFFFF;
  --neutral-025: #F7F9F8; /* mobile canvas, row hover */
  --neutral-050: #F5F7F5; /* desktop canvas, sidebar, table head strip */
  --neutral-075: #F0F3F1; /* inactive chip, avatar plate, count, quiet hover */
  --neutral-100: #EDF0EE; /* skeleton block */
  --neutral-150: #E9EDEB; /* doc-viewer plate */
  --neutral-200: #E4E8E6; /* hairline: panels, dividers */
  --neutral-250: #DDE3E0; /* control border: buttons, inputs, keys */
  --neutral-300: #C9D3CF; /* dashed border */
  --neutral-350: #A8B4B0; /* decoration only — never text */
  --neutral-500: #65746F; /* muted text: meta, hints, labels */
  --neutral-700: #4A5D57; /* body / secondary text */
  --divider: #EEF1EF;     /* row divider inside panels */
  --divider-soft: #F3F5F4;

  /* ---- Amber: needs replacing / attention. Never used for "error". ---- */
  --amber-700: #97610A;
  --amber-500: #E8B84B;
  --amber-100: #FDF0DC;
  --amber-050: #FFFBF4; /* attention wash */

  /* ---- Red: refusal and overdue only. Small doses, no red banners. ---- */
  --red-700: #B9453A;
  --red-300: #EDC8C2;
  --red-100: #FBE9E6;
  --red-on-dark: #F1A9A0;

  /* ---- Blue: external waiting (embassy). Informational, never actionable. ---- */
  --blue-700: #3A5A8C;
  --blue-100: #E7EDF6;

  /* ---- Semantic aliases: reach for these first ---- */
  --text-strong: var(--green-900);
  --text-body: var(--neutral-700);
  --text-muted: var(--neutral-500);
  --text-faint: var(--neutral-500);      /* text never goes below 4.5:1 */
  --decor-faint: var(--neutral-350);     /* non-text marks only */
  --text-on-dark: var(--neutral-000);
  --text-on-dark-muted: rgba(255, 255, 255, 0.6);  /* 6.2:1 on ink */
  --text-on-dark-faint: rgba(255, 255, 255, 0.5);  /* 4.7:1 on ink */
  --text-accent: var(--green-700);

  --surface-canvas: var(--neutral-050);
  --surface-canvas-mobile: var(--neutral-025);
  --surface-card: var(--neutral-000);
  --surface-sunken: var(--neutral-050);
  --surface-subtle: var(--neutral-025);
  --surface-muted: var(--neutral-075);
  --surface-plate: var(--neutral-150);
  --surface-dark: var(--green-900);
  --surface-attention: var(--amber-050);
  --surface-selected: var(--green-050);
  --surface-on-dark: rgba(255, 255, 255, 0.07);

  --border-default: var(--neutral-200);
  --border-control: var(--neutral-250);
  --border-strong: var(--green-700);
  --border-dashed: var(--neutral-300);
  --border-on-dark: rgba(255, 255, 255, 0.18);
  --border-attention: var(--amber-500);
  --border-danger: var(--red-300);
  --border-accent: var(--lime-200);

  --action-primary: var(--green-700);
  --action-primary-text: var(--neutral-000);
  --action-accent: var(--lime-500);
  --action-accent-text: var(--green-900);
  --action-quiet-text: var(--neutral-700);
  --action-danger-text: var(--red-700);

  --focus-ring: var(--green-700);
  --focus-ring-soft: var(--green-100);
  --selection-bg: var(--lime-200);
  --selection-text: var(--green-900);

  --status-ok-bg: var(--green-100);
  --status-ok-text: var(--green-700);
  --status-attention-bg: var(--amber-100);
  --status-attention-text: var(--amber-700);
  --status-danger-bg: var(--red-100);
  --status-danger-text: var(--red-700);
  --status-neutral-bg: var(--neutral-075);
  --status-neutral-text: var(--neutral-700);
  --status-external-bg: var(--blue-100);
  --status-external-text: var(--blue-700);

  --progress-track: var(--neutral-200);
  --progress-fill: var(--lime-500);
  --progress-fill-done: var(--green-700);
  --progress-fill-mid: var(--amber-500);
  --progress-track-on-dark: rgba(255, 255, 255, 0.18);

  --link: var(--green-700);
  --link-hover: var(--green-900);

  /* Hover = one step darker green, or the muted wash on quiet controls. */
  --hover-primary: #084229;
  --hover-accent: #A8DB2E;
  --hover-quiet-bg: var(--neutral-075);
  --hover-row-bg: var(--neutral-025);

  /* ======================================================================
     Spec tokens — copied from the Platform Element Spec, "Tokens to copy".
     ====================================================================== */

  /* Type */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "Geist", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs: 12px;      /* labels, column heads */
  --text-sm: 13px;      /* meta, small buttons */
  --text-dense: 13.5px; /* lists, sidebars, tables */
  --text-base: 14px;    /* body, titles at 600 */
  --text-lead: 17px;
  --title-page: 22px;   /* app page h1 */
  --title-form: 26px;

  /* Spacing, 4px base */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-14: 56px; --s-16: 64px;

  /* Heights */
  --h-sm: 30px;    /* small button */
  --h-md: 36px;    /* default button */
  --h-input: 38px;
  --h-lg: 44px;    /* large button, touch target, panel header */
  --h-nav: 32px;   /* sidebar item */
  --h-row: 56px;   /* list row minimum */

  /* Radii */
  --r-sm: 6px;   /* menu rows, keys */
  --r: 8px;      /* controls */
  --r-lg: 12px;  /* panels, menus, dialogs */
  --r-xl: 16px;  /* sheets */
  --r-pill: 999px; /* badges and counts only */

  /* Elevation — the spec's alphas, shadow colour tinted from ink #0F2E26 */
  --shadow-sm: 0 1px 2px rgb(15 46 38 / 0.05);
  --shadow: 0 1px 2px rgb(15 46 38 / 0.04), 0 8px 24px -10px rgb(15 46 38 / 0.14);
  --shadow-lg: 0 2px 4px rgb(15 46 38 / 0.04), 0 24px 64px -24px rgb(15 46 38 / 0.28);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-menu: 150ms;
  --t-overlay: 160ms;

  /* Layout */
  --sidebar: 240px;
  --rail: 320px;
  --content-max: 1240px;
  --form-max: 560px;

  /* ======================================================================
     Type roles (font shorthands built on the spec scale). Sentence case
     everywhere; nothing is uppercase or widely tracked.
     ====================================================================== */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --type-display: 600 clamp(36px, 6vw, 72px) / 1.02 var(--font-sans);        /* -0.04em */
  --type-section: 600 clamp(30px, 3.4vw, 40px) / 1.1 var(--font-sans);       /* -0.035em */
  --type-form-title: 600 var(--title-form) / 1.2 var(--font-sans);           /* -0.02em */
  --type-page-title: 600 var(--title-page) / 1.25 var(--font-sans);          /* -0.02em */
  --type-lead: 400 var(--text-lead) / 1.55 var(--font-sans);
  --type-title: 600 var(--text-base) / 1.4 var(--font-sans);                 /* -0.01em */
  --type-body: 400 var(--text-base) / 1.5 var(--font-sans);
  --type-dense: 400 var(--text-dense) / 1.45 var(--font-sans);
  --type-meta: 400 var(--text-sm) / 1.45 var(--font-sans);
  --type-label: 500 var(--text-xs) / 1.35 var(--font-sans);
  --type-figure: 500 var(--text-dense) / 1.35 var(--font-mono);              /* -0.01em, tabular */

  --tracking-display: -0.04em;
  --tracking-section: -0.035em;
  --tracking-page: -0.02em;
  --tracking-title: -0.01em;
  --tracking-figure: -0.01em;

  --transition-control: background-color var(--t-fast) ease,
    border-color var(--t-fast) ease, color var(--t-fast) ease,
    box-shadow var(--t-fast) ease;

  /* ======================================================================
     Legacy aliases — the pre-spec token names, each pointed at the nearest
     spec value so unmigrated sheets snap onto the spec. Do not use in new
     code; page migrations replace them with the tokens above.
     ====================================================================== */
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);
  --weight-bold: 600;
  --weight-black: 600;

  /* type: weights cap at 600; uppercase/tracked eyebrows become 12px/500 labels */
  --type-display-1: var(--type-section);
  --type-display-2: var(--type-section);
  --type-display-3: var(--type-form-title);
  --type-title-1: var(--type-page-title);
  --type-title-2: var(--type-page-title);
  --type-title-3: var(--type-title);
  --type-title-4: var(--type-title);
  --type-body-lg: var(--type-lead);
  --type-body-sm: var(--type-meta);
  --type-label-lg: var(--type-title);
  --type-label-sm: var(--type-label);
  --type-eyebrow: var(--type-label);
  --type-eyebrow-sm: var(--type-label);
  --type-mono-head: var(--type-label);
  --type-mono-data: var(--type-figure);
  --type-metric: 600 var(--title-page) / 1.2 var(--font-mono);
  --type-metric-sm: 600 var(--text-base) / 1.4 var(--font-mono);
  --tracking-eyebrow: normal;
  --tracking-mono-head: normal;

  /* spacing: odd values snap to the 4px scale */
  --space-1: var(--s-1);   /* 3 → 4 */
  --space-2: var(--s-1);   /* 5 → 4 */
  --space-3: var(--s-2);   /* 7 → 8 */
  --space-4: var(--s-2);   /* 9 → 8 */
  --space-5: var(--s-3);   /* 11 → 12 */
  --space-6: var(--s-3);   /* 13 → 12 */
  --space-7: var(--s-4);   /* 14 → 16 */
  --space-8: var(--s-4);   /* 16 */
  --space-9: var(--s-5);   /* 18 → 20 */
  --space-10: var(--s-5);  /* 20 */
  --space-11: var(--s-6);  /* 22 → 24 */
  --space-12: var(--s-6);  /* 26 → 24 */
  --space-13: var(--s-8);  /* 28 → 32 */
  --space-14: var(--s-8);  /* 34 → 32 */

  --pad-card: var(--s-5);                         /* panel padding 20 */
  --pad-card-lg: var(--s-6);
  --pad-row: 10px var(--s-4);                     /* list row 10 16 */
  --pad-row-tight: 10px var(--s-4);
  --pad-chip: 2px var(--s-2);                     /* inside a 22px badge */
  --pad-filter: 6px var(--s-3);
  --pad-button: 0 14px;
  --pad-button-lg: 0 18px;
  --pad-topbar: var(--s-2) var(--s-5);
  --pad-page: 28px var(--s-8);                    /* app content 28 32 */

  --gap-card: var(--s-4);    /* between panels 16 */
  --gap-field: var(--s-2);
  --gap-inline: var(--s-2);
  --gap-table: var(--s-3);

  --nav-width: var(--sidebar);
  --nav-width-agency: var(--sidebar);
  --rail-width: var(--rail);
  --list-width: 392px;
  --page-max: 820px;   /* client portal reading column (migrates in WS-C) */
  --phone-width: 375px;

  /* shape: two radii plus pill */
  --radius-chip: var(--r-sm);
  --radius-control: var(--r);
  --radius-button: var(--r);
  --radius-button-lg: var(--r);
  --radius-avatar: 28%;
  --radius-card: var(--r-lg);
  --radius-card-lg: var(--r-lg);
  --radius-panel: var(--r-lg);
  --radius-phone: 30px;
  --radius-bar: var(--r-pill);
  --radius-bar-lg: var(--r-pill);

  --border-width: 1px;
  --border-width-selected: 1px;
  --border-width-dashed: 1px;

  --shadow-card: var(--shadow-sm);
  --shadow-lifted: var(--shadow-lg);
  --shadow-device: var(--shadow-lg);

  --bar-height: 6px;
  --bar-height-sm: 4px;
  --bar-height-lg: 8px;
  --dot-size: 6px;
  --check-size: 16px;
  --icon-sm: 14px;
  --icon: 16px;
  --icon-lg: 20px;
  --hit-target: var(--h-lg);

  --duration-fast: var(--t-fast);
  --duration: var(--t-fast);
  --ease: ease;
}

/* Geist's stylistic set 1 (the spec's 'ss01'; Geist has no 'cv11'). */
html { font-feature-settings: "ss01"; }
