/* Self-hosted fonts (OFL): Plus Jakarta Sans (Latin, variable 200–800) + Mukta (Devanagari) + Instrument Serif (display headings, M19).
 * unicode-range means the Devanagari files download only when Hindi text is on the page. */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/plus-jakarta-sans-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/instrument-serif-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-display: swap; font-weight: 400; src: url(../fonts/instrument-serif-latin-400-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Mukta"; font-style: normal; font-display: swap; font-weight: 400; src: url(../fonts/mukta-devanagari-400-normal.woff2) format("woff2"); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF; }
@font-face { font-family: "Mukta"; font-style: normal; font-display: swap; font-weight: 500 600; src: url(../fonts/mukta-devanagari-600-normal.woff2) format("woff2"); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF; }
@font-face { font-family: "Mukta"; font-style: normal; font-display: swap; font-weight: 700 800; src: url(../fonts/mukta-devanagari-700-normal.woff2) format("woff2"); unicode-range: U+0900-097F,U+1CD0-1CF9,U+200C-200D,U+20A8,U+20B9,U+20F0,U+25CC,U+A830-A839,U+A8E0-A8FF; }

/* Ivoric Billing — design tokens + base styles.
 * Direction (M19, D-139): "ivory & ink" — warm ivory surfaces, deep midnight ink for actions, a champagne-gold detail, an elegant
 * serif for display headings over a crisp sans for everything you read and tap. Quiet, premium, simple. See docs/DESIGN.md.
 * Dark theme via [data-theme="dark"] or prefers-color-scheme (gold becomes the accent on near-black). */

:root {
  /* Colour — base: warm ivory paper, ink text */
  --c-bg: #F6F3ED;
  --c-surface: #FFFDFA;
  --c-surface-2: #F0EBE2;
  --c-border: #DFD7C8;
  --c-hairline: rgba(22, 23, 28, .07);
  --c-text: #16171C;
  --c-text-2: #55575F;
  --c-text-3: #66686F;
  /* Accent: midnight ink for actions and links; champagne gold only for small details (never for text) */
  --c-accent: #1F2B4D;
  --c-accent-hover: #172140;
  --c-accent-soft: #E8EBF2;
  --c-on-accent: #FFFFFF;
  --c-gold: #A57C3A;
  --c-gold-soft: #F4EBDA;
  --c-ink: #14151A;
  /* Status — muted, colour-blind-safe (paired with icons + labels, never colour alone) */
  --c-ok: #1B7950;      --c-ok-soft: #E6F4EC;
  --c-warn: #975F00;    --c-warn-soft: #FBF1DD;
  --c-danger: #BA3E37;  --c-danger-soft: #FBEAE8;
  --c-info: #2C69BA;    --c-info-soft: #E7F0FB;

  /* Type */
  --font-sans: "Plus Jakarta Sans", "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --font-num: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Instrument Serif", "Mukta", Georgia, "Times New Roman", serif;
  --fs-xs: 0.8125rem;  /* 13 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-md: 1rem;       /* 16 base */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28 */
  --fs-3xl: 2.25rem;   /* 36 — big numbers */
  --lh: 1.5;

  /* Space (4px grid) */
  --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;

  /* Shape & depth */
  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-pill: 999px;
  --shadow-1: 0 0 0 1px var(--c-hairline), 0 1px 2px rgba(22, 23, 28, .04), 0 2px 6px rgba(22, 23, 28, .03);
  --shadow-2: 0 0 0 1px var(--c-hairline), 0 12px 32px rgba(22, 23, 28, .10);

  /* Motion */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 150ms; --t-med: 220ms;

  --tap: 48px; /* minimum touch target */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0E0F12; --c-surface: #16171B; --c-surface-2: #1F2025; --c-border: #2E3036; --c-hairline: rgba(244, 239, 228, .08);
    --c-text: #F4EFE4; --c-text-2: #BAB5AA; --c-text-3: #A39E94;
    --c-accent: #D9BA7C; --c-accent-hover: #E6CB94; --c-accent-soft: #2D271A; --c-on-accent: #16171C; --c-gold: #D9BA7C; --c-gold-soft: #2D271A;
    --c-ok: #4CC38A; --c-ok-soft: #173326; --c-warn: #E2A93B; --c-warn-soft: #3A2D12;
    --c-danger: #F07167; --c-danger-soft: #3B1C1A; --c-info: #6FA8F5; --c-info-soft: #172A44;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --c-bg: #0E0F12; --c-surface: #16171B; --c-surface-2: #1F2025; --c-border: #2E3036; --c-hairline: rgba(244, 239, 228, .08);
  --c-text: #F4EFE4; --c-text-2: #BAB5AA; --c-text-3: #A39E94;
  --c-accent: #D9BA7C; --c-accent-hover: #E6CB94; --c-accent-soft: #2D271A; --c-on-accent: #16171C; --c-gold: #D9BA7C; --c-gold-soft: #2D271A;
  --c-ok: #4CC38A; --c-ok-soft: #173326; --c-warn: #E2A93B; --c-warn-soft: #3A2D12;
  --c-danger: #F07167; --c-danger-soft: #3B1C1A; --c-info: #6FA8F5; --c-info-soft: #172A44;
  color-scheme: dark;
}
:root[data-text="large"] { font-size: 112.5%; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s-3); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); font-weight: 750; }
h2 { font-size: var(--fs-xl); font-weight: 700; }
h3 { font-size: var(--fs-lg); font-weight: 650; }
p { margin: 0 0 var(--s-3); }
a { color: var(--c-accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 6px; }
.num, .amount { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--c-text-2); }
.small { font-size: var(--fs-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Layout */
.container { width: 100%; max-width: 720px; margin: 0 auto; padding: var(--s-6) var(--s-4) var(--s-12); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Cards */
.card { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-1); }
.card + .card { margin-top: var(--s-4); }
.card--hero { color: #F6F1E7; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-6); border-radius: var(--r-pill); border: 0;
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--c-accent); color: var(--c-on-accent); }
.btn--primary:hover { background: var(--c-accent-hover); }
.btn--ghost { background: var(--c-surface-2); color: var(--c-text); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Forms */
.field { display: block; margin-bottom: var(--s-4); }
.field__label { display: block; font-weight: 600; margin-bottom: var(--s-2); }
.field__hint { display: block; color: var(--c-text-2); font-size: var(--fs-sm); margin-top: var(--s-1); }
.input {
  width: 100%; min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-md);
  border: 1.5px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font: inherit;
  transition: border-color var(--t-fast) var(--ease-out);
}
.input:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 4px var(--c-accent-soft); }
.check { display: flex; gap: var(--s-3); align-items: flex-start; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--c-accent); }

/* Alerts & status */
.alert { border-radius: var(--r-md); padding: var(--s-3) var(--s-4); margin-bottom: var(--s-4); }
.alert--error { background: var(--c-danger-soft); color: var(--c-danger); }
.alert--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.alert--warn { background: var(--c-warn-soft); color: var(--c-warn); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 650; }
.pill--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.pill--warn { background: var(--c-warn-soft); color: var(--c-warn); }
.pill--fail { background: var(--c-danger-soft); color: var(--c-danger); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--c-border); }
.checklist li:last-child { border-bottom: 0; }
.checklist__body { flex: 1; min-width: 0; }
.checklist__detail { color: var(--c-text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }

.brandmark { display: flex; align-items: center; gap: var(--s-2); font-weight: 800; letter-spacing: -0.02em; font-size: var(--fs-lg); }
.brandmark__dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c-accent); transform: rotate(45deg); }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--c-surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===================================================================== Accent options
 * Three candidates for the founder to choose from (Part 10.0). A is the default until
 * one is locked; switch with <html data-accent="b|c"> (see /admin/styleguide). */
:root[data-accent="b"] { --c-accent: #097266; --c-accent-hover: #075E54; --c-accent-soft: #E3F6EE; --c-accent-2: #B7E36A; }
:root[data-accent="c"] { --c-accent: #8E2C7E; --c-accent-hover: #76226A; --c-accent-soft: #F7E8F4; --c-accent-2: #F2A65A; }
:root { --c-accent-2: #3A4A78; }
@media (prefers-color-scheme: dark) {
  :root[data-accent="b"]:not([data-theme="light"]) { --c-accent: #3FC8B3; --c-accent-hover: #64D6C4; --c-accent-soft: #123A35; }
  :root[data-accent="c"]:not([data-theme="light"]) { --c-accent: #E07BD0; --c-accent-hover: #EA9ADD; --c-accent-soft: #3A1834; }
}
:root[data-theme="dark"][data-accent="b"] { --c-accent: #3FC8B3; --c-accent-hover: #64D6C4; --c-accent-soft: #123A35; }
:root[data-theme="dark"][data-accent="c"] { --c-accent: #E07BD0; --c-accent-hover: #EA9ADD; --c-accent-soft: #3A1834; }

/* ===================================================================== Icons */
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 18px; height: 18px; }
.icon--lg { width: 28px; height: 28px; }

/* ===================================================================== App shell */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); padding-top: max(var(--s-3), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--c-bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px);
}
.topbar__title { font-weight: 700; font-size: var(--fs-lg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { width: 100%; max-width: 1080px; margin: 0 auto; padding: var(--s-2) var(--s-4) calc(96px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-2) 0 var(--s-5); }
.page-head h1 { margin: 0; }
.back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-pill); color: var(--c-text); background: var(--c-surface); box-shadow: var(--shadow-1); }

.org-chip {
  display: inline-flex; align-items: center; gap: var(--s-2); max-width: 60vw; padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill); background: var(--c-surface); box-shadow: var(--shadow-1); color: var(--c-text);
  text-decoration: none; font-weight: 650; font-size: var(--fs-sm);
}
.org-chip__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none;
  border-radius: 50%; background: var(--c-accent-soft); color: var(--c-accent); font-weight: 750; font-size: var(--fs-sm);
}
.avatar--lg { width: 48px; height: 48px; font-size: var(--fs-lg); }

/* Bottom navigation (mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--c-surface) 94%, transparent); backdrop-filter: blur(14px);
  box-shadow: 0 -1px 0 var(--c-border);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center;
  color: var(--c-text-3); text-decoration: none; font-size: 11.5px; font-weight: 650; border-radius: var(--r-md);
}
.bottomnav a[aria-current="page"] { color: var(--c-accent); }
.bottomnav a[aria-current="page"] .icon { stroke-width: 2.3; }

/* Sidebar (desktop) */
@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s-1); width: 248px; flex: none; padding: var(--s-5) var(--s-3);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--c-border); background: var(--c-surface);
  }
  .sidebar .brandmark { padding: 0 var(--s-3) var(--s-4); }
  .sidebar a.nav-item {
    display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-3);
    border-radius: var(--r-md); color: var(--c-text-2); text-decoration: none; font-weight: 600;
    transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
  }
  .sidebar a.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
  .sidebar a.nav-item[aria-current="page"] { background: var(--c-accent-soft); color: var(--c-accent); }
  .sidebar__section { margin: var(--s-4) var(--s-3) var(--s-1); color: var(--c-text-3); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
  .sidebar__foot { margin-top: auto; }
  .bottomnav { display: none; }
  .content { padding: var(--s-4) var(--s-8) var(--s-12); }
  .topbar { padding: var(--s-4) var(--s-8); }
  .fab { right: var(--s-8); bottom: var(--s-8); }
}

/* Floating "Add anything" button */
.fab {
  position: fixed; right: var(--s-4); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31;
  display: inline-flex; align-items: center; gap: var(--s-2); height: 56px; padding: 0 var(--s-5) 0 var(--s-4);
  border: 0; border-radius: var(--r-pill); cursor: pointer; font: inherit; font-weight: 700; color: var(--c-on-accent);
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent-2) 140%);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c-accent) 35%, transparent);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.fab:hover { transform: translateY(-1px); }
.fab:active { transform: scale(.97); }

/* ===================================================================== Bottom sheet & menu */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(15, 14, 20, .38); animation: fade-in var(--t-med) var(--ease-out); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 86vh; overflow-y: auto;
  background: var(--c-surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s-3) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-2); animation: sheet-up var(--t-med) var(--ease-out);
}
.sheet__grip { width: 40px; height: 4px; border-radius: 4px; background: var(--c-border); margin: 0 auto var(--s-3); }
@media (min-width: 900px) { .sheet { max-height: 80vh; left: 50%; right: auto; bottom: auto; top: 10vh; width: 480px; transform: translateX(-50%); border-radius: var(--r-lg); animation: pop-in var(--t-med) var(--ease-out); } }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 40; background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: var(--s-2); animation: pop-in var(--t-fast) var(--ease-out); }
.menu a, .menu button { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-3); border: 0; background: none; border-radius: var(--r-sm); color: var(--c-text); text-decoration: none; font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--c-surface-2); }
.relative { position: relative; }

/* ===================================================================== Tiles (Home) */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--shadow-1); text-decoration: none; color: var(--c-text); display: block; min-width: 0; container-type: inline-size; }
.tile__q { color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 600; }
.tile__v { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-2xl); font-weight: 780; letter-spacing: -0.02em; margin-top: var(--s-1); overflow-wrap: anywhere; }
/* Amounts shrink to fit a narrow tile instead of breaking mid-number. */
@supports (font-size: 1cqi) { .tile__v { font-size: clamp(15px, 14.5cqi, var(--fs-2xl)); } }
.tile__s { color: var(--c-text-3); font-size: var(--fs-xs); margin-top: 2px; }
.hero {
  border-radius: var(--r-lg); padding: var(--s-6); color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c-accent-2) 70%, transparent) 0%, transparent 55%), var(--c-accent);
}
.hero h1, .hero h2 { color: #fff; }
.hero p { color: rgba(255,255,255,.86); margin: 0; }

/* ===================================================================== Lists */
.list { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.list__item { display: flex; align-items: center; gap: var(--s-3); min-height: 60px; padding: var(--s-3) var(--s-4); color: var(--c-text); text-decoration: none; }
.list__item + .list__item { border-top: 1px solid var(--c-border); }
a.list__item:hover { background: var(--c-surface-2); }
.list__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--c-accent-soft); color: var(--c-accent); flex: none; }
.list__body { flex: 1; min-width: 0; }
.list__title { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.list__sub { display: block; color: var(--c-text-2); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The hidden attribute wins over component display rules (.row, .grid-2 …). */
[hidden] { display: none !important; }
.list__end { color: var(--c-text-3); display: flex; align-items: center; gap: var(--s-2); }
.section-title { font-size: var(--fs-sm); font-weight: 700; color: var(--c-text-2); margin: var(--s-6) var(--s-1) var(--s-2); }

/* ===================================================================== Choice grid (business type) */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@media (min-width: 640px) { .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; flex-direction: column; gap: var(--s-2); min-height: 92px; padding: var(--s-3); cursor: pointer;
  border-radius: var(--r-md); background: var(--c-surface); border: 1.5px solid var(--c-border); font-weight: 650; font-size: var(--fs-sm);
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.choice label .icon { color: var(--c-accent); }
.choice input:checked + label { border-color: var(--c-accent); background: var(--c-accent-soft); }
.choice input:focus-visible + label { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.choice label:active { transform: scale(.98); }

/* Segmented control */
.segmented { display: inline-flex; padding: 4px; gap: 4px; background: var(--c-surface-2); border-radius: var(--r-pill); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { min-height: 40px; display: inline-flex; align-items: center; padding: 0 var(--s-4); border-radius: var(--r-pill); font-weight: 650; font-size: var(--fs-sm); cursor: pointer; color: var(--c-text-2); }
.segmented input:checked + label { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-1); }

/* OTP boxes */
.otp { display: flex; gap: var(--s-2); justify-content: space-between; }
.otp input { width: 100%; max-width: 52px; height: 58px; text-align: center; font-size: var(--fs-xl); font-weight: 750; font-family: var(--font-num);
  border-radius: var(--r-md); border: 1.5px solid var(--c-border); background: var(--c-surface); color: var(--c-text); padding: 0; }
.otp input:focus { border-color: var(--c-accent); outline: none; box-shadow: 0 0 0 4px var(--c-accent-soft); }
.otp.is-bad input { border-color: var(--c-danger); animation: shake 300ms var(--ease-out); }
.input--big { min-height: 58px; font-size: var(--fs-lg); font-weight: 650; letter-spacing: .02em; }
.prefix-field { display: flex; align-items: stretch; }
.prefix-field__prefix { display: inline-flex; align-items: center; padding: 0 var(--s-3); border: 1.5px solid var(--c-border); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); background: var(--c-surface-2); font-weight: 650; color: var(--c-text-2); }
.prefix-field .input { border-radius: 0 var(--r-md) var(--r-md) 0; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-3) 50%), linear-gradient(135deg, var(--c-text-3) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.field__error { display: block; color: var(--c-danger); font-size: var(--fs-sm); margin-top: var(--s-1); }
.input[aria-invalid="true"] { border-color: var(--c-danger); }

/* Auth / onboarding layout */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.auth__top { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4); max-width: 520px; width: 100%; margin: 0 auto; }
.auth__body { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: var(--s-2) var(--s-4) var(--s-10); }
.auth__title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; margin: var(--s-6) 0 var(--s-2); }
.auth__lead { color: var(--c-text-2); margin-bottom: var(--s-6); }
.divider { display: flex; align-items: center; gap: var(--s-3); color: var(--c-text-3); font-size: var(--fs-sm); margin: var(--s-6) 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.steps { display: flex; gap: 6px; margin: var(--s-2) 0 0; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--c-border); }
.steps span.is-done { background: var(--c-accent); }

/* Empty state */
.empty { text-align: center; padding: var(--s-10) var(--s-6); color: var(--c-text-2); }
.empty__art { width: 96px; height: 96px; margin: 0 auto var(--s-4); border-radius: 28px; display: flex; align-items: center; justify-content: center; background: var(--c-accent-soft); color: var(--c-accent); }
.empty__title { color: var(--c-text); font-weight: 700; font-size: var(--fs-lg); margin-bottom: var(--s-1); }

/* Checklist (getting started) */
.todo { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; text-decoration: none; color: var(--c-text); }
.todo + .todo { border-top: 1px solid var(--c-border); }
.todo__mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c-border); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.todo.is-done .todo__mark { background: var(--c-ok); border-color: var(--c-ok); color: #fff; }
.todo.is-done .todo__text { color: var(--c-text-3); }
.progress { height: 8px; border-radius: 8px; background: var(--c-surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 8px; background: var(--c-accent); transition: width 600ms var(--ease-out); }

/* Toasts */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: var(--s-2); width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--c-text); color: var(--c-bg); box-shadow: var(--shadow-2); font-weight: 600; animation: toast-in var(--t-med) var(--ease-out); }
.toast .icon { color: var(--c-ok); }
@media (min-width: 900px) { .toasts { bottom: var(--s-8); } }

/* Badges, tags, key-value */
.badge { display: inline-flex; align-items: center; white-space: nowrap; height: 22px; padding: 0 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; background: var(--c-surface-2); color: var(--c-text-2); }
.badge--accent { background: var(--c-accent-soft); color: var(--c-accent); }
.badge--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.badge--warn { background: var(--c-warn-soft); color: var(--c-warn); }
.badge--danger { background: var(--c-danger-soft); color: var(--c-danger); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-4); }
.kv dt { color: var(--c-text-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* Desktop tables (accountant views) */
.table-wrap { overflow-x: auto; background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: var(--s-3) var(--s-4); text-align: left; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.table th { color: var(--c-text-2); font-weight: 650; background: var(--c-surface-2); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }

/* Skeleton loaders */
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--c-surface-2) 0%, var(--c-border) 50%, var(--c-surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; min-height: 16px; }

/* Success tick (bill saved) */
.tick { width: 72px; height: 72px; border-radius: 50%; background: var(--c-ok); display: inline-flex; align-items: center; justify-content: center; animation: pop-in 260ms var(--ease-out); }
.tick svg { width: 40px; height: 40px; stroke: #fff; stroke-width: 3; fill: none; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 360ms 120ms var(--ease-out) forwards; }

.htmx-request.btn, .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.grid-2 { display: grid; gap: var(--s-4); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.swatch { width: 100%; height: 56px; border-radius: var(--r-md); }
[x-cloak] { display: none !important; }
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: initial; } .hide-desktop { display: none !important; } }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: var(--s-3) var(--s-4); background: var(--c-surface); }
.skip-link:focus { left: var(--s-2); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 900px) { @keyframes pop-in { from { opacity: 0; } to { opacity: 1; } } }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ===================================================================== Sales document (screen, print, PDF) */
.doc { position: relative; min-width: 0; max-width: 100%; box-sizing: border-box; background: #fff; color: #17161c; border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--s-6); font-size: 13px; line-height: 1.45; overflow: hidden; }
.doc table { border-collapse: collapse; width: 100%; }
.doc th, .doc td { padding: 4px 6px; text-align: left; vertical-align: top; }
.doc .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc__head { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; border-bottom: 2px solid #17161c; padding-bottom: var(--s-3); }
.doc__seller { font-size: 20px; font-weight: 800; }
.doc__muted { color: #5c5a66; font-size: 12px; }
.doc__titleblock { text-align: right; }
.doc__title { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--doc-accent, var(--c-accent)); }
.doc__meta { width: auto !important; margin-left: auto; }
.doc__meta th { color: #5c5a66; font-weight: 600; text-align: right; }
.doc__meta td { font-weight: 700; text-align: right; }
.doc__parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid #d9d7e0; }
.doc__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #5c5a66; font-weight: 700; margin-bottom: 2px; }
.doc__strong { font-weight: 700; }
.doc__lines { margin-top: var(--s-3); }
.doc__lines thead th { background: #f3f2f7; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #45434d; }
.doc__lines tbody tr { border-bottom: 1px solid #ebeaf0; }
.doc__foot { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-3); }
.doc__left { flex: 1; min-width: 240px; }
.doc__taxsum { width: auto !important; font-size: 12px; }
.doc__taxsum th { background: #f3f2f7; font-size: 11px; }
.doc__totals { width: auto !important; min-width: 240px; }
.doc__totals th { color: #45434d; font-weight: 600; }
.doc__totals td { text-align: right; font-variant-numeric: tabular-nums; }
.doc__grand th, .doc__grand td { font-size: 16px; font-weight: 800; border-top: 2px solid #17161c; padding-top: 6px; }
.doc__due th, .doc__due td { color: #b42318; font-weight: 700; }
.doc__words { font-style: italic; margin: var(--s-3) 0; }
.doc__terms { font-size: 12px; color: #45434d; margin-top: var(--s-2); }
.doc__sign { display: flex; justify-content: space-between; align-items: flex-end; margin-top: var(--s-6); gap: var(--s-4); flex-wrap: wrap; }
.doc__signbox { text-align: right; font-size: 12px; }
.doc__composition { text-align: center; font-weight: 700; margin: 0 0 var(--s-2); }
.doc__stamp { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); font-size: 64px; font-weight: 900; color: rgba(180, 35, 24, .16); border: 6px solid rgba(180, 35, 24, .16); padding: 0 24px; pointer-events: none; text-transform: uppercase; }
.doc__stamp--draft { color: rgba(92, 90, 102, .16); border-color: rgba(92, 90, 102, .16); }
.spacer { flex: 1; }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .sidebar, .topbar, .bottomnav, .fab, .toasts, .no-print, .skip-link { display: none !important; }
  .shell, .main, .content, .container { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .doc { border: 0; padding: 0; border-radius: 0; font-size: 11.5px; }
  .doc__title { color: #17161c; }
  a { color: inherit; text-decoration: none; }
}
@media (max-width: 640px) {
  .doc { padding: var(--s-4); font-size: 12px; }
  .doc__titleblock { text-align: left; }
  .doc__meta { margin-left: 0; }
  .doc__meta th, .doc__meta td { text-align: left; }
  .doc__lines { min-width: 560px; }
  .doc__stamp { font-size: 40px; }
}
.doc__scroll { overflow-x: auto; max-width: 100%; }
.doc__copy { text-align: right; font-size: 11px; color: #5c5a66; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.doc__upi { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.doc__upi svg { width: 112px; height: 112px; flex: none; }

/* Public customer link (/i/{token}). */
.public-doc { max-width: 900px; margin: 0 auto; padding: var(--s-4); }
.public-doc__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); margin-bottom: var(--s-4); }
.public-doc__seller { font-size: var(--fs-lg); font-weight: 800; }
.public-doc__pay { margin-bottom: var(--s-3); }
.public-doc__foot { text-align: center; margin-top: var(--s-6); }
@media print { .public-doc { padding: 0; max-width: none; } .public-doc__head, .public-doc__pay, .public-doc__foot { display: none; } }

/* Bill layouts (D-070): classic is the base; the others only change emphasis, never the particulars. */
.doc__logo { display: block; max-height: 56px; max-width: 180px; margin-bottom: 6px; object-fit: contain; }
.doc--modern { padding-top: 0; }
.doc--modern .doc__head { background: var(--doc-accent); color: #fff; margin: 0 calc(-1 * var(--s-6)) var(--s-2); padding: var(--s-5) var(--s-6); border-bottom: 0; }
.doc--modern .doc__head .doc__muted, .doc--modern .doc__meta th { color: rgba(255, 255, 255, .78); }
.doc--modern .doc__title { color: #fff; }
.doc--modern .doc__logo { background: #fff; border-radius: 8px; padding: 4px; }
.doc--modern .doc__lines thead th, .doc--modern .doc__taxsum th { background: color-mix(in srgb, var(--doc-accent) 12%, #fff); }
.doc--bold .doc__title { font-size: 26px; letter-spacing: .02em; }
.doc--bold .doc__head { border-bottom: 4px solid var(--doc-accent); }
.doc--bold .doc__grand th, .doc--bold .doc__grand td { background: var(--doc-accent); color: #fff; border-top: 0; padding: 8px; font-size: 18px; }
.doc--compact { font-size: 11.5px; padding: var(--s-4); }
.doc--compact .doc__seller { font-size: 16px; }
.doc--compact th, .doc--compact td { padding: 2px 4px; }
.doc--compact .doc__parties { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: var(--s-2) 0; }
.doc--compact .doc__sign { margin-top: var(--s-4); }
.doc--boxed { border: 1.5px solid #17161c; border-radius: 0; }
.doc--boxed .doc__lines th, .doc--boxed .doc__lines td, .doc--boxed .doc__taxsum th, .doc--boxed .doc__taxsum td, .doc--boxed .doc__totals th, .doc--boxed .doc__totals td { border: 1px solid #8f8d99; }
.doc--boxed .doc__lines tbody tr { border-bottom: 0; }
.doc--boxed .doc__head, .doc--boxed .doc__parties { border-bottom: 1.5px solid #17161c; }
.doc--boxed .doc__title { color: #17161c; border: 1.5px solid #17161c; padding: 2px 10px; display: inline-block; }
.doc--minimal .doc__title { color: #17161c; font-weight: 700; }
.doc--minimal .doc__head { border-bottom: 1px solid #17161c; }
.doc--minimal .doc__lines thead th, .doc--minimal .doc__taxsum th { background: none; border-bottom: 1px solid #17161c; }
.doc--minimal .doc__grand th, .doc--minimal .doc__grand td { border-top-width: 1px; }
.doc__bank { margin-top: var(--s-3); }
@media print { .doc--modern .doc__head, .doc--bold .doc__grand th, .doc--bold .doc__grand td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .doc--modern .doc__head { margin: 0 0 var(--s-2); } }

/* Print page: A4 / A5 sheets and 58 / 80 mm thermal rolls (print-CSS path). */
.print-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-border); background: var(--c-surface); position: sticky; top: 0; z-index: 5; }
.print-sheet { padding: var(--s-4); display: grid; gap: var(--s-6); justify-items: center; }
.print-sheet--a4 .doc { width: 210mm; max-width: 100%; }
.print-sheet--a5 .doc { width: 148mm; max-width: 100%; font-size: 11px; }
.print-break { break-after: page; }
.roll { background: #fff; color: #000; font: 12px/1.35 "Plus Jakarta Sans", system-ui, sans-serif; padding: 3mm; box-sizing: border-box; }
.print-sheet--t80 .roll { width: 80mm; }
.print-sheet--t58 .roll { width: 58mm; font-size: 10.5px; }
.roll__c { text-align: center; }
.roll__b { font-weight: 800; }
.roll__seller { font-size: 1.25em; font-weight: 800; }
.roll__small { font-size: .85em; }
.roll__rule { border-top: 1px dashed #000; margin-top: 4px; padding-top: 4px; }
.roll__row { display: flex; justify-content: space-between; gap: 6px; font-variant-numeric: tabular-nums; }
.roll__item { margin-top: 3px; }
.roll__amt { white-space: nowrap; }
.roll__total { font-size: 1.2em; font-weight: 800; border-top: 1px solid #000; margin-top: 3px; padding-top: 3px; }
.roll__logo { max-width: 60%; max-height: 18mm; filter: grayscale(1); }
.roll__qr svg { width: 34mm; height: 34mm; margin: 4px auto 0; display: block; }
@media print {
  .print-sheet { padding: 0; display: block; }
  .print-sheet--a4 .doc, .print-sheet--a5 .doc { width: auto; }
  .print-sheet--t80 .roll, .print-sheet--t58 .roll { padding: 0 1mm; }
}

/* Page headers wrap on phones (long document numbers + actions). */
.page-head { flex-wrap: wrap; row-gap: var(--s-2); }
.page-head h1 { min-width: 0; overflow-wrap: anywhere; }

/* ===================================================================== Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); font: inherit; font-size: var(--fs-sm); font-weight: 650; cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--c-surface-2); }
.chip--on { background: var(--c-accent-soft); border-color: transparent; color: var(--c-accent); }

/* ===================================================================== Counter (POS) */
.pos { display: grid; gap: var(--s-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .pos { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; } .pos__right { position: sticky; top: var(--s-4); } }
.pos__searchbar { display: flex; gap: var(--s-2); }
.pos__search { flex: 1; min-height: 52px; font-size: var(--fs-lg); }
@media (max-width: 520px) { .pos__scanlabel { display: none; } }
.pos__video { width: 100%; max-height: 240px; object-fit: cover; border-radius: var(--r-md); margin-top: var(--s-2); background: #000; }
.pos__results { margin-top: var(--s-2); display: grid; gap: 2px; background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: var(--s-1); max-height: 60vh; overflow-y: auto; }
.pos-result { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; min-height: 52px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--c-text); font: inherit; text-align: left; cursor: pointer; }
.pos-result.is-active, .pos-result:hover { background: var(--c-accent-soft); }
.pos-result__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pos-result__meta { white-space: nowrap; color: var(--c-text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pos__favs, .pos-grid { margin-top: var(--s-3); display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.pos-fav { display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-2); min-height: 84px; padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-text); font: inherit; text-align: left; cursor: pointer; transition: transform var(--t-fast) var(--ease-out); }
.pos-fav:active { transform: scale(.97); }
.pos-fav__name { font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.pos-fav__price { color: var(--c-text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pos__right { display: flex; flex-direction: column; gap: var(--s-3); }
.pos__tabs { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 2px; }
.pos-cust { display: flex; align-items: center; gap: var(--s-2); width: 100%; min-height: 44px; padding: 0 var(--s-3); border: 1px dashed var(--c-border); border-radius: var(--r-md); background: none; color: var(--c-text); font: inherit; cursor: pointer; text-align: left; flex-wrap: wrap; }
.pos__cart { display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; }
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s-3); padding: var(--s-2) var(--s-2); border: 0; border-bottom: 1px solid var(--c-border); background: none; color: var(--c-text); font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-sm); }
.pos-line:hover { background: var(--c-surface-2); }
.pos-line__name { font-weight: 650; overflow-wrap: anywhere; }
.pos-line__name { grid-column: 1; grid-row: 1; }
.pos-line__qty { grid-column: 1; grid-row: 2; }
.pos-line__amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-line__qty, .pos-line__warn { color: var(--c-text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pos-line__warn { color: var(--c-warn); grid-column: 1 / -1; }
.pos-line--new { animation: pos-flash 600ms var(--ease-out); }
@keyframes pos-flash { from { background: var(--c-accent-soft); } to { background: transparent; } }
.pos-empty { padding: var(--s-4); text-align: center; margin: 0; }
.pos-tot { display: flex; justify-content: space-between; color: var(--c-text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pos-tot--grand { color: var(--c-text); font-size: var(--fs-xl); font-weight: 800; }
@media (max-width: 899px) { .pos__charge { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); } }
.pos-kp__title { font-size: var(--fs-lg); margin: 0 0 var(--s-2); }
.pos-kp__modes { margin-bottom: var(--s-2); }
.pos-kp__out { display: block; font-size: var(--fs-3xl); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; padding: var(--s-2) 0; }
.pos-kp__hint { min-height: 1.4em; margin: 0 0 var(--s-2); text-align: right; }
.pos-kp { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); margin-bottom: var(--s-3); }
.pos-kp__key { min-height: 56px; border: 0; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-text); font: inherit; font-size: var(--fs-xl); font-weight: 700; cursor: pointer; }
.pos-kp__key:active { background: var(--c-accent-soft); }
.pos-sheet h2 { margin-top: 0; }
.pos-pay__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-3); }
.pos-pay__total strong { font-size: var(--fs-3xl); font-variant-numeric: tabular-nums; }
.pos-pay__row { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); min-height: 52px; }
.pos-pay__row .prefix-field { width: 160px; }
.pos-pay__change strong { color: var(--c-ok); }
.pos-pay__printer { margin: var(--s-3) 0; flex-wrap: wrap; }
.pos-upi { text-align: center; padding: var(--s-3); background: #fff; color: #17161c; border-radius: var(--r-md); }
.pos-upi svg { width: 200px; height: 200px; }
.pos-done { text-align: center; display: grid; gap: var(--s-3); justify-items: center; }
.pos-done h2 { margin: 0; }
.pos-done__no { font-size: var(--fs-lg); margin: 0; }
.pos-done__actions { justify-content: center; flex-wrap: wrap; }
.pos-print-frame { position: fixed; width: 1px; height: 1px; right: 0; bottom: 0; border: 0; opacity: 0; pointer-events: none; }

/* Counter PIN sign-in */
.counter-people { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.counter-person { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: 0 var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-md); cursor: pointer; }
.counter-person:has(input:checked) { border-color: var(--c-accent); background: var(--c-accent-soft); }
.counter-person input { accent-color: var(--c-accent); }
@media (max-width: 640px) { .doc--modern .doc__head { margin: 0 calc(-1 * var(--s-4)) var(--s-2); padding: var(--s-4); } }

/* Invoice design settings */
.design-layouts { display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.design-layout { display: grid; gap: var(--s-2); padding: var(--s-3); border: 1px solid var(--c-border); border-radius: var(--r-md); cursor: pointer; }
.design-layout:has(input:checked) { border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-accent-soft); }
.design-layout input { position: absolute; opacity: 0; pointer-events: none; }
.design-layout strong, .design-layout .small { display: block; }
.design-layout__thumb { display: grid; gap: 4px; height: 76px; padding: 8px; background: #fff; border: 1px solid #e3e1ea; border-radius: 6px; }
.design-layout__thumb i { display: block; height: 14px; background: #d9d7e0; border-radius: 2px; }
.design-layout__thumb b { display: block; height: 6px; background: #ebeaf0; }
.design-layout__thumb em { display: block; height: 8px; width: 45%; margin-left: auto; background: #d9d7e0; }
.design-layout__thumb--modern i { background: var(--c-accent); height: 18px; }
.design-layout__thumb--bold em { background: var(--c-accent); height: 12px; }
.design-layout__thumb--compact { gap: 2px; } .design-layout__thumb--compact b { height: 4px; }
.design-layout__thumb--boxed b, .design-layout__thumb--boxed i { border: 1px solid #8f8d99; background: #fff; }
.design-layout__thumb--minimal i { background: none; border-bottom: 1px solid #17161c; border-radius: 0; }
.design-swatches { gap: var(--s-2); flex-wrap: wrap; }
.design-swatch { position: relative; cursor: pointer; }
.design-swatch input { position: absolute; opacity: 0; }
.design-swatch span { display: block; width: 36px; height: 36px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.design-swatch input:checked + span { outline: 3px solid var(--sw); outline-offset: 2px; }
.design-swatch input:focus-visible + span { outline: 3px solid var(--c-text); outline-offset: 2px; }
.design-logo { max-height: 64px; max-width: 200px; object-fit: contain; }

/* Money: a row of quick actions that scrolls sideways on a phone rather than wrapping inside buttons. */
#money-actions .btn { white-space: nowrap; flex: none; }

/* Reports (M8) */
.report-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--s-4); }
.list--plain .list__item { box-shadow: none; padding-left: 0; padding-right: 0; }
.report-table tr.report-head td { background: var(--c-surface-2); font-weight: 700; }
.report-table tr.report-sub td { font-weight: 650; }
.report-table tr.report-total td { font-weight: 800; border-top: 2px solid var(--c-text); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s-4); }
.health-item { display: flex; flex-direction: column; gap: 4px; }
.home-chart { display: flex; align-items: flex-end; gap: 4px; height: 72px; }
.home-chart span { flex: 1; background: var(--c-accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.home-chart span.is-today { opacity: 1; outline: 2px solid var(--c-accent); outline-offset: 1px; }

/* ===================================================================== Offline counter (M9) */
.pos-sync { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-pill); font: inherit; font-size: var(--fs-sm); font-weight: 650; cursor: pointer; background: var(--c-surface-2); color: var(--c-text-2); }
.pos-sync::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pos-sync--ok { color: var(--c-ok); background: var(--c-ok-soft); }
.pos-sync--busy { color: var(--c-accent); background: var(--c-accent-soft); }
.pos-sync--warn { color: var(--c-warn); background: var(--c-warn-soft); }
.pos-sync.is-syncing::before { animation: pos-pulse 900ms ease-in-out infinite; }
@keyframes pos-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pos-sync.is-syncing::before { animation: none; } }
.pos-receipt { display: none; }
@media print {
  body.printing-receipt > *:not(#pos-receipt) { display: none !important; }
  body.printing-receipt #pos-receipt { display: block; }
  body.printing-receipt { background: #fff; }
}
.sync-row { display: grid; gap: var(--s-2); }
.sync-row__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2); }
.sync-row__conflicts { margin: 0; padding-left: 1.2em; color: var(--c-text-2); font-size: var(--fs-sm); }
.offline-page { max-width: 520px; margin: 10vh auto; padding: var(--s-6) var(--s-4); text-align: center; display: grid; gap: var(--s-3); justify-items: center; }
.offline-page img { border-radius: 18px; }
/* ===================================================================== AI: snap a bill (M10) */
.ai-panel { border-left: 3px solid var(--c-accent); }
.ai-pages { display: flex; gap: var(--s-2); overflow-x: auto; padding-bottom: 4px; }
.ai-page { flex: none; display: block; border-radius: var(--r-sm, 8px); overflow: hidden; border: 1px solid var(--c-border); background: var(--c-surface-2); }
.ai-page img { display: block; height: 220px; width: auto; max-width: 70vw; object-fit: contain; }
@media (min-width: 900px) { .ai-page img { height: 320px; } }
[data-conf="mid"] { border-left: 3px solid var(--c-warn); }
[data-conf="low"] { border-left: 3px solid var(--c-danger); background: var(--c-warn-soft); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c-border); border-top-color: var(--c-accent); animation: ai-spin 800ms linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2400ms; } }
[data-mic].is-listening { color: var(--c-danger); background: var(--c-danger-soft); }
.is-suggested { outline: 2px dashed var(--c-accent); outline-offset: 1px; }
/* Partner portal (M13): the sign-in layout, wider. */
.auth--wide .auth__top, .auth--wide .auth__body { max-width: 980px; }
.portal-nav { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: 0 0 var(--s-4); }
/* Plan & billing (M14): plan cards with a radio each; banners above the page. */
.plans { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.plan { position: relative; display: flex; flex-direction: column; gap: var(--s-2); background: var(--c-surface); border: 2px solid var(--c-border); border-radius: var(--r-lg); padding: var(--s-4); cursor: pointer; }
.plan input[type=radio] { position: absolute; top: var(--s-3); right: var(--s-3); width: 18px; height: 18px; accent-color: var(--c-accent); }
.plan:has(input:checked) { border-color: var(--c-accent); box-shadow: var(--shadow-1); }
.plan--popular { border-color: color-mix(in srgb, var(--c-accent) 45%, var(--c-border)); }
.plan--current::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; outline: 2px dashed var(--c-ok); outline-offset: -6px; }
.plan__name { font-weight: 600; display: flex; gap: var(--s-2); align-items: center; padding-right: 1.5rem; }
.plan__price { font-size: 1.4rem; font-weight: 700; }
.plan__price small { font-size: .8rem; font-weight: 400; color: var(--c-text-2); }
.plan__list { margin: 0; padding-left: 1.1em; color: var(--c-text-2); }
.banners { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.banners .alert { margin: 0; display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.banners .alert form { margin-left: auto; }
.alert--info { background: var(--c-accent-soft); color: var(--c-text); }
.chip:has(input:checked) { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); }
/* Online Dukaan (M15): the public shop page — phone first, two cards a row, a cart bar at the bottom. */
.shop-body { background: var(--c-bg); }
.shop { max-width: 1100px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.shop__top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--c-surface); box-shadow: var(--shadow-1); }
.shop__name { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; color: var(--c-text); text-decoration: none; }
.shop__cart { position: relative; padding: 0 10px; min-height: 44px; }
.shop__cart .badge { position: absolute; top: 2px; right: 0; }
.shop__main { flex: 1; padding: var(--s-4); }
.shop__hero h1 { margin: 0 0 var(--s-1); font-size: 1.5rem; }
.shop__search { margin: var(--s-3) 0; }
.shop__cats { overflow-x: auto; flex-wrap: nowrap; gap: var(--s-2); margin-bottom: var(--s-3); padding-bottom: 4px; }
.shop__cats .chip { flex: none; }
.shop__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); padding-bottom: 5rem; }
@media (min-width: 720px) { .shop__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .shop__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.shop-item { background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; display: flex; flex-direction: column; }
.shop-item--out { opacity: .6; }
.shop-item__img { aspect-ratio: 1 / 1; background: var(--c-surface-2); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--c-text-2); }
.shop-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-item__body { padding: var(--s-3); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.shop-item__name { font-size: .95rem; font-weight: 600; margin: 0; line-height: 1.3; }
.shop-item__price s { margin-left: 4px; }
.shop-item__qty { margin-top: auto; }
.shop-item__qty .btn { width: 100%; min-height: 40px; }
.shop-stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.shop-stepper .btn { width: auto; min-width: 40px; padding: 0 8px; }
.shop-cartbar { position: fixed; left: var(--s-3); right: var(--s-3); bottom: calc(var(--s-3) + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; z-index: 6;
  display: flex; justify-content: space-between; align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r-lg); background: var(--c-accent); color: var(--c-on-accent);
  font-weight: 600; text-decoration: none; box-shadow: var(--shadow-2, var(--shadow-1)); }
.shop__foot { padding: var(--s-4); display: grid; gap: 4px; text-align: center; }
.shop-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.shop-steps { list-style: none; padding: 0; margin: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.shop-steps li { flex: 1; min-width: 5.5rem; text-align: center; font-size: .78rem; padding: 6px 4px; border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-text-2); }
.shop-steps li.is-done { background: var(--c-accent-soft); color: var(--c-text); font-weight: 600; }
.co-line .btn { min-height: 32px; padding: 0 8px; }

/* ===================================================================== Premium layer (M19, D-139)
 * "Ivory & ink": the serif carries display headings; ink actions; gold only as a small detail. Hindi headings keep the sans
 * (the serif has no Devanagari). Everything below builds on the tokens above. */
h1, .display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.005em; }
h1 { font-size: 2.125rem; line-height: 1.08; }
.page-head h1 { font-size: clamp(1.85rem, 3vw, 2.35rem); }
:lang(hi) h1, :lang(hi) .display { font-family: var(--font-sans); font-weight: 760; letter-spacing: -0.01em; }
:lang(hi) h1 { font-size: var(--fs-2xl); }
h2 { letter-spacing: -0.015em; }
::selection { background: var(--c-gold-soft); color: var(--c-text); }
.eyebrow { margin: 0 0 var(--s-1); font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-3); }
:lang(hi) .eyebrow { letter-spacing: .02em; text-transform: none; font-size: var(--fs-xs); }

/* Hero: ink with a soft gold glow */
.hero, .card--hero {
  color: #F6F1E7;
  background: radial-gradient(70% 120% at 100% 0%, rgba(214, 178, 108, .28) 0%, transparent 60%),
    radial-gradient(60% 90% at 0% 100%, rgba(58, 74, 120, .55) 0%, transparent 70%), linear-gradient(135deg, #14151A 0%, #1F2B4D 100%);
  box-shadow: 0 16px 40px rgba(20, 21, 26, .16);
}
.hero { padding: var(--s-8) var(--s-6); }
.hero h1, .hero h2, .card--hero h1 { color: #FBF7EE; }
.hero h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); line-height: 1.04; margin: var(--s-2) 0 0; }
.hero p, .card--hero p { color: rgba(246, 241, 231, .78); }
.hero__eyebrow { margin: 0; color: #E2C68F; letter-spacing: .14em; text-transform: uppercase; font-size: 11.5px; font-weight: 700; }
:lang(hi) .hero__eyebrow { text-transform: none; letter-spacing: .02em; font-size: var(--fs-sm); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--s-4); }
.hero__chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: rgba(246, 241, 231, .07);
  box-shadow: inset 0 0 0 1px rgba(246, 241, 231, .14); color: #F6F1E7; font-size: var(--fs-xs); font-weight: 600; }
.hero__chip .icon { color: #E2C68F; }
.card--hero .btn { background: #FBF7EE !important; color: #14151A !important; }

/* Buttons and inputs */
.btn--primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(20, 21, 26, .16); }
.btn--ghost { background: var(--c-surface); box-shadow: inset 0 0 0 1px var(--c-border); }
.btn--ghost:hover { background: var(--c-surface-2); }
.input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-accent) 12%, transparent); }
.choice input:checked + label { box-shadow: inset 0 0 0 1px var(--c-accent); }
.choice label .icon { color: var(--c-gold); }

/* Brand and navigation */
.brandmark { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; letter-spacing: 0; }
.brandmark__dot { background: var(--c-gold); border-radius: 3px; width: 10px; height: 10px; }
:lang(hi) .brandmark { font-family: var(--font-sans); font-weight: 800; font-size: var(--fs-lg); }
@media (min-width: 900px) {
  .sidebar a.nav-item[aria-current="page"] { box-shadow: inset 3px 0 0 var(--c-gold); }
}
.bottomnav a[aria-current="page"] { position: relative; }
.bottomnav a[aria-current="page"]::before { content: ""; position: absolute; top: 2px; width: 20px; height: 3px; border-radius: 3px; background: var(--c-gold); }
.list__icon { background: var(--c-surface-2); color: var(--c-accent); }

/* Language switch (topbar, sign-in, portals) */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 2px 0 10px; border-radius: var(--r-pill); background: var(--c-surface);
  box-shadow: inset 0 0 0 1px var(--c-border); color: var(--c-text-2); }
.lang-switch select { border: 0; background: transparent; font: inherit; font-size: var(--fs-sm); font-weight: 650; color: var(--c-text); min-height: 38px;
  padding: 0 8px 0 4px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.lang-switch select:focus { outline: none; }
.lang-switch:focus-within { outline: 3px solid var(--c-accent); outline-offset: 2px; }
/* Narrow screens: the switch is a globe button with the native picker over it (still labelled, still a real <select>). */
@media (max-width: 640px) {
  .topbar .lang-switch { position: relative; width: 44px; height: 44px; padding: 0; justify-content: center; flex: none; }
  .topbar .lang-switch select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; padding: 0; }
  .topbar .org-chip { max-width: calc(100vw - 170px); }
  .topbar { gap: var(--s-2); }
}

/* Industry (M19, D-138) */
.ind-hero { display: flex; gap: var(--s-4); align-items: center; }
.ind-hero__icon, .industry-card__icon, .solar__badge { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px;
  border-radius: 16px; background: var(--c-gold-soft); color: var(--c-gold); flex: none; }
.industry-card__icon, .solar__badge { width: 40px; height: 40px; border-radius: 12px; }
.chip--static { cursor: default; background: var(--c-surface-2); border-color: transparent; }
.chip--static .icon { color: var(--c-ok); }
.badge--soft { background: var(--c-gold-soft); color: #6B4F1D; height: 18px; font-size: 10.5px; vertical-align: 1px; margin-left: 4px; }
:root[data-theme="dark"] .badge--soft { color: var(--c-gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge--soft { color: var(--c-gold); } }
.ind-fields { border: 0; margin: var(--s-2) 0 0; padding: var(--s-4); border-radius: var(--r-md); background: var(--c-surface-2); min-width: 0; }
.ind-fields__title { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; padding: 0; margin-bottom: var(--s-3); float: left; width: 100%; }
.ind-fields > :not(legend) { clear: both; }
.ind-fields__title .icon { color: var(--c-gold); }
.grid-span { grid-column: 1 / -1; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-4) var(--s-5); margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 600; margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ind-facts h3 .icon, .industry-card .icon { color: var(--c-gold); }
.stages { list-style: none; display: flex; margin: var(--s-5) 0 var(--s-6); padding: 0; overflow-x: auto; }
.stages__item { flex: 1; min-width: 88px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; text-align: center;
  font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 600; }
.stages__item::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 2px; background: var(--c-border); }
.stages__item:first-child::before { display: none; }
.stages__dot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-surface); box-shadow: inset 0 0 0 2px var(--c-border); color: var(--c-text-3); font-weight: 700; font-size: var(--fs-xs); }
.stages__item--done, .stages__item--current { color: var(--c-text); }
.stages__item--done .stages__dot { background: var(--c-accent); box-shadow: none; color: var(--c-on-accent); }
.stages__item--done::before, .stages__item--current::before { background: var(--c-accent); }
.stages__item--current .stages__dot { box-shadow: inset 0 0 0 2px var(--c-gold); color: var(--c-text); background: var(--c-gold-soft); }
.solar__estimate { background: var(--c-surface-2); border-radius: var(--r-md); padding: var(--s-4); }
.solar__estimate .kv dd { font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
@media (min-width: 720px) { .mini-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mini-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--c-surface-2); color: var(--c-text);
  text-decoration: none; min-width: 0; transition: background var(--t-fast) var(--ease-out); }
a.mini-stat:hover { background: var(--c-accent-soft); }
.mini-stat__value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 720; letter-spacing: -0.01em; }
.mini-stat__value small { font-size: var(--fs-xs); color: var(--c-text-3); font-weight: 600; }
.mini-stat__label { font-size: var(--fs-xs); color: var(--c-text-2); }
.industry-card__todo { margin-top: var(--s-3); padding: var(--s-3); gap: var(--s-2); border-radius: var(--r-md); background: var(--c-gold-soft); color: var(--c-text);
  text-decoration: none; font-size: var(--fs-sm); font-weight: 600; flex-wrap: nowrap; }
@media (min-width: 900px) { #home-actions { flex-wrap: wrap !important; overflow: visible !important; } }
.auth__title { font-weight: 400; font-size: clamp(2.2rem, 7vw, 2.75rem); letter-spacing: -0.005em; line-height: 1.05; }
:lang(hi) .auth__title { font-weight: 800; font-size: var(--fs-2xl); letter-spacing: -0.02em; }
@media (max-width: 640px) { .topbar .org-chip { flex: 0 1 auto; min-width: 0; max-width: calc(100vw - 204px); } .topbar .spacer { min-width: 0; } }
.card-title { font-family: var(--font-sans); font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.01em; }
/* A select with a long option (e.g. the state list) never grows past its container on a phone. */
.input { min-width: 0; }
select.input { max-width: 100%; text-overflow: ellipsis; }
/* A segmented choice that wraps on a phone (team size, M20). */
.segmented--wrap { display: flex; flex-wrap: wrap; border-radius: var(--r-md); }
.segmented--wrap label { flex: 1 1 auto; justify-content: center; }
.segmented input:focus-visible + label { outline: 2px solid var(--c-accent); outline-offset: 2px; }
/* Terms acceptance (M20, D-141) */
.terms-check { align-items: flex-start; gap: var(--s-2); font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.45; }
.terms-check input { margin-top: 2px; flex: none; }
.terms-check a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-docs { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-2); }
.legal-docs li { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--c-surface-2); }
.legal-docs a { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 650; color: var(--c-text); }
/* "Continue with Google" (D-142): Google's own look — white button, the four-colour G. */
.btn--google { background: #FFFFFF; color: #1F1F1F; box-shadow: inset 0 0 0 1px #DADCE0; gap: var(--s-3); }
.btn--google:hover { background: #F8F9FA; }
/* Your data & moving in (M20, D-143/D-144) */
.data-move { display: flex; align-items: center; gap: var(--s-4); text-decoration: none; color: inherit; margin-bottom: var(--s-4); }
.data-move__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--c-accent-soft); color: var(--c-accent); flex: none; }
.data-move > :last-child { margin-left: auto; color: var(--c-text-3); }
.data-set { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.chips-check { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; inset: 0; }
.chip-check span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--c-surface-2); color: var(--c-text-2); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; box-shadow: inset 0 0 0 1px var(--c-border); }
.chip-check input:checked + span { background: var(--c-accent-soft); color: var(--c-accent); box-shadow: inset 0 0 0 1.5px var(--c-accent); }
.chip-check input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-2); }
.app-tile { display: flex; align-items: center; justify-content: space-between; text-decoration: none; color: inherit; min-height: 56px; padding: var(--s-3) var(--s-4); }
.app-tile:hover { box-shadow: var(--shadow-2); }
.stages--static { margin: var(--s-4) 0; }
/* Phones (M20e): a fieldset never grows to fit a wide table; tables inside cards scroll sideways in place. */
fieldset { min-width: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
/* Phones (M20e): More as grouped tiles; Home quick actions as a grid of icon tiles; the industry card stacks. */
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: var(--s-2); }
.more-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 92px; padding: var(--s-3) var(--s-2);
  border-radius: var(--r-md); background: var(--c-surface); box-shadow: var(--shadow-1); color: var(--c-text); text-decoration: none; text-align: center; }
.more-tile:hover, .more-tile:focus-visible { box-shadow: var(--shadow-2); }
.more-tile__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--c-accent-soft); color: var(--c-accent); }
.more-tile__label { font-size: var(--fs-sm); font-weight: 650; line-height: 1.25; }
@media (max-width: 640px) {
  #home-actions { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); overflow: visible !important; }
  #home-actions .btn { flex-direction: column; min-height: 78px; height: auto; padding: var(--s-2) 2px; border-radius: var(--r-md); font-size: 12px; line-height: 1.2;
    white-space: normal; text-align: center; gap: 6px; }
  #home-actions .btn .icon { width: 22px; height: 22px; }
  #home-industry > .row { flex-wrap: wrap; }
  #home-industry > .row > strong { flex-basis: calc(100% - 64px) !important; }
  #home-industry > .row > a.small { flex-basis: 100%; }
}
/* Phones (M20e): the save row of a long form stays within thumb reach, just above the bottom bar. */
@media (max-width: 899px) {
  .form-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 5; margin-inline: calc(-1 * var(--s-4)); padding: var(--s-3) var(--s-4);
    background: color-mix(in srgb, var(--c-bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--c-hairline); }
}
@supports not (background: color-mix(in srgb, red 50%, transparent)) { @media (max-width: 899px) { .form-actions { background: var(--c-bg); } } }
