/* FinTax design system
 * Layout concept: ledger paper. A pale green-ruled page with white sheets laid on it,
 * left-aligned and asymmetric on the website, sidebar + sheets in the app.
 * One bold move: the violet approval stamp. Everything else stays quiet and precise.
 * Single light theme, chosen on purpose (the brief asks for light colours).
 */
:root {
  /* colour */
  --paper: #F4F7F3;          /* ledger-tinted page */
  --paper-2: #EAF0EA;        /* deeper paper for bands */
  --sheet: #FFFFFF;          /* surfaces laid on the paper */
  --ink: #10241B;            /* ledger ink */
  --ink-2: #3D5247;
  --muted: #677A6F;
  --faint: #95A69B;
  --rule: #DCE5DE;           /* ruled lines and borders */
  --rule-2: #E9EFEA;
  --ledger: #0E7A4F;         /* brand green, admin can change it */
  --ledger-deep: #0A5C3B;
  --ledger-ink: #07432B;
  --ledger-wash: #E4F1E8;
  --ledger-tint: #F0F7F2;
  --stamp: #4B3BC4;          /* violet rubber-stamp ink */
  --stamp-wash: #ECEAFB;
  --margin: #C8463C;         /* the red margin line of ledger paper: overdue, danger */
  --margin-wash: #FBEBE9;
  --amber: #A86400;          /* due soon */
  --amber-wash: #FDF1DC;
  --on-dark: #F4F7F3;
  --overlay: rgba(16, 36, 27, 0.42);

  /* type */
  --font: 'Archivo', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-doc: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  --wide: 118%;
  --fs-xs: 0.75rem; --fs-sm: 0.8125rem; --fs-base: 0.9375rem; --fs-md: 1.0625rem; --fs-lg: 1.25rem; --fs-xl: 1.5rem; --fs-2xl: 2rem; --fs-3xl: 2.75rem;

  /* shape */
  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-xl: 22px;
  --sh-1: 0 1px 0 rgba(16, 36, 27, 0.03), 0 1px 2px rgba(16, 36, 27, 0.06);
  --sh-2: 0 10px 28px -14px rgba(16, 36, 27, 0.22), 0 2px 6px -2px rgba(16, 36, 27, 0.07);
  --sh-pop: 0 28px 70px -24px rgba(16, 36, 27, 0.42), 0 6px 16px -8px rgba(16, 36, 27, 0.12);
  --ring: 0 0 0 3px color-mix(in srgb, var(--ledger) 28%, transparent);
  --side-w: 252px;
  --top-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-base); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--sheet); pointer-events: none; }
img, svg { max-width: 100%; }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
img { display: block; }
a { color: var(--ledger-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
::selection { background: var(--ledger-wash); color: var(--ledger-ink); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.wide { font-stretch: var(--wide); }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stack.tight { gap: 6px; }
.stack.loose { gap: 20px; }
.grow { flex: 1 1 auto; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.grid { display: grid; gap: 16px; min-width: 0; }
.grid > * { min-width: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 960px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------- buttons */
.btn {
  --b-bg: var(--sheet); --b-fg: var(--ink); --b-bd: var(--rule);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: var(--fs-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { border-color: color-mix(in srgb, var(--b-bd) 60%, var(--ink) 18%); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary { --b-bg: var(--ledger); --b-fg: #fff; --b-bd: var(--ledger); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 2px 6px -2px color-mix(in srgb, var(--ledger) 60%, transparent); }
.btn-primary:hover { --b-bg: var(--ledger-deep); --b-bd: var(--ledger-deep); }
.btn-stamp { --b-bg: var(--stamp); --b-fg: #fff; --b-bd: var(--stamp); }
.btn-stamp:hover { --b-bg: color-mix(in srgb, var(--stamp) 86%, black); }
.btn-quiet { --b-bg: transparent; --b-bd: transparent; color: var(--ink-2); }
.btn-quiet:hover { --b-bg: var(--paper-2); --b-bd: transparent; color: var(--ink); }
.btn-soft { --b-bg: var(--ledger-wash); --b-fg: var(--ledger-ink); --b-bd: transparent; }
.btn-soft:hover { --b-bg: color-mix(in srgb, var(--ledger-wash) 80%, var(--ledger) 12%); --b-bd: transparent; }
.btn-danger { --b-bg: var(--sheet); --b-fg: var(--margin); --b-bd: color-mix(in srgb, var(--margin) 35%, var(--rule)); }
.btn-danger:hover { --b-bg: var(--margin-wash); }
.btn-danger-solid { --b-bg: var(--margin); --b-fg: #fff; --b-bd: var(--margin); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: var(--fs-xs); border-radius: 8px; gap: 6px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: var(--fs-base); border-radius: 12px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn .badge-dot { position: absolute; top: 6px; right: 6px; }
.btn-wa { --b-bg: #E7F6EC; --b-fg: #0B6B3A; --b-bd: transparent; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- forms */
.form { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 14px; }
.form > .field { grid-column: span 12; }
.form > .span-6 { grid-column: span 6; } .form > .span-4 { grid-column: span 4; } .form > .span-8 { grid-column: span 8; } .form > .span-3 { grid-column: span 3; }
@media (max-width: 640px) { .form > .span-6, .form > .span-4, .form > .span-8, .form > .span-3 { grid-column: span 12; } }
.form-section { grid-column: span 12; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); padding-top: 6px; border-top: 1px solid var(--rule-2); margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.label .req { color: var(--margin); margin-left: 2px; }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--rule);
  background: var(--sheet); color: var(--ink); font-size: var(--fs-base); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--rule) 70%, var(--ink) 15%); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ledger); box-shadow: var(--ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23677A6F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input-sm, .select.input-sm { min-height: 34px; padding: 6px 10px; font-size: var(--fs-sm); }
.select.input-sm { padding-right: 30px; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--sheet); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.affix:focus-within { border-color: var(--ledger); box-shadow: var(--ring); }
.affix > span { display: flex; align-items: center; padding: 0 10px; background: var(--paper); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; border-right: 1px solid var(--rule); }
.affix > .input { border: 0; box-shadow: none !important; border-radius: 0; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--ledger); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--rule); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .track { background: var(--ledger); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipset label { position: relative; }
.chipset input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chipset span { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chipset input:checked + span { background: var(--ledger-wash); border-color: color-mix(in srgb, var(--ledger) 40%, var(--rule)); color: var(--ledger-ink); }
.chipset input:focus-visible + span { box-shadow: var(--ring); }
.form-error { grid-column: span 12; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--margin-wash); color: #8E2A22; font-size: var(--fs-sm); }
.form-error svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.dropzone { border: 1.5px dashed color-mix(in srgb, var(--ledger) 35%, var(--rule)); border-radius: var(--r); background: var(--ledger-tint); padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; position: relative; }
.dropzone:hover, .dropzone.over { background: var(--ledger-wash); border-color: var(--ledger); }
.dropzone svg { width: 26px; height: 26px; color: var(--ledger); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-list { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--sheet); border: 1px solid var(--rule); font-size: var(--fs-sm); text-align: left; }

/* -------------------------------------------------------------- sheets */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule-2); min-width: 0; }
.sheet-head h2, .sheet-head h3 { font-size: var(--fs-md); font-weight: 650; }
.sheet-head .sub { font-size: var(--fs-sm); color: var(--muted); }
.sheet-body { padding: 18px 20px; min-width: 0; }
.sheet-body.flush { padding: 0; }
.sheet-foot { padding: 12px 20px; border-top: 1px solid var(--rule-2); display: flex; gap: 10px; align-items: center; }
.sheet.tinted { background: var(--ledger-tint); border-color: color-mix(in srgb, var(--ledger) 18%, var(--rule)); box-shadow: none; }
.sheet.plain { box-shadow: none; }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--ledger-tint); border: 1px solid color-mix(in srgb, var(--ledger) 18%, var(--rule)); font-size: var(--fs-sm); color: var(--ink-2); }
.callout svg { width: 18px; height: 18px; flex: none; color: var(--ledger); margin-top: 1px; }
.callout.warn { background: var(--amber-wash); border-color: color-mix(in srgb, var(--amber) 25%, var(--rule)); }
.callout.warn svg { color: var(--amber); }
.callout.danger { background: var(--margin-wash); border-color: color-mix(in srgb, var(--margin) 25%, var(--rule)); }
.callout.danger svg { color: var(--margin); }
.callout.violet { background: var(--stamp-wash); border-color: color-mix(in srgb, var(--stamp) 22%, var(--rule)); }
.callout.violet svg { color: var(--stamp); }
.callout b { color: var(--ink); }

/* KPI strip: one sheet, divided cells, so the numbers read as one ledger row */
.kpis { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.kpi { padding: 16px 18px; border-left: 1px solid var(--rule-2); min-width: 0; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; position: relative; }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--ledger-tint); }
.kpi .k-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .k-label svg { width: 14px; height: 14px; }
.kpi .k-value { font-size: 1.6rem; font-weight: 700; font-stretch: 108%; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-foot { font-size: var(--fs-xs); color: var(--muted); }
.kpi.alert .k-value { color: var(--margin); }
.kpi.warn .k-value { color: var(--amber); }
.kpi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.kpi.alert::after { background: var(--margin); }
.kpi.warn::after { background: var(--amber); }
@media (max-width: 960px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi:nth-child(odd) { border-left: 0; } .kpi { border-top: 1px solid var(--rule-2); } .kpi:nth-child(-n+2) { border-top: 0; } .kpi:last-child:nth-child(odd) { grid-column: span 2; } }

/* -------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); padding: 10px 14px; border-bottom: 1px solid var(--rule); background: var(--ledger-tint); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--ledger-tint); }
.tbl .t-right, .tbl td.num, .tbl th.num { text-align: right; }
.tbl td.num { white-space: nowrap; }
.tbl .t-name { font-weight: 600; color: var(--ink); }
.tbl .t-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.tbl td.actions { text-align: right; white-space: nowrap; width: 1%; }
.tbl tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--margin); }
.tbl tr.soon td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.tbl-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--rule-2); }

/* --------------------------------------------------------------- pills */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.no-dot::before { display: none; }
.pill.green { background: var(--ledger-wash); color: var(--ledger-ink); }
.pill.amber { background: var(--amber-wash); color: #7A4800; }
.pill.red { background: var(--margin-wash); color: #932C24; }
.pill.violet { background: var(--stamp-wash); color: #3A2D9C; }
.pill.ink { background: var(--ink); color: var(--on-dark); }
.pill.line { background: transparent; border: 1px solid var(--rule); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); font-size: 0.72rem; font-weight: 500; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--margin); color: #fff; font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.count.soft { background: var(--paper-2); color: var(--ink-2); }
.count.green { background: var(--ledger); }
.badge-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--margin); border: 2px solid var(--sheet); }

/* the stamp: the one bold move */
.stamp {
  --s: var(--stamp);
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 3px; border: 2px solid var(--s); border-radius: 6px;
  color: var(--s); font-weight: 800; font-stretch: 125%; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  transform: rotate(-4deg); background: color-mix(in srgb, var(--s) 6%, transparent); white-space: nowrap; line-height: 1.2;
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 62%, rgba(0, 0, 0, .78) 63%, #000 72%);
  mask-image: radial-gradient(circle at 30% 40%, #000 62%, rgba(0, 0, 0, .78) 63%, #000 72%);
}
.stamp.green { --s: var(--ledger); }
.stamp.red { --s: var(--margin); }
.stamp.lg { font-size: 1.05rem; padding: 7px 16px 6px; border-width: 3px; border-radius: 9px; }
.stamp-in { animation: stampIn .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-14deg) scale(1.9); } 60% { opacity: 1; } 100% { opacity: 1; transform: rotate(-6deg) scale(1); } }

/* -------------------------------------------------------------- avatar */
.avatar { --a: var(--ledger); width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: color-mix(in srgb, var(--a) 14%, white); color: color-mix(in srgb, var(--a) 80%, black); font-weight: 700; font-size: 0.78rem; font-stretch: 110%; overflow: hidden; }
.avatar.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 0.7rem; }
.avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 1.05rem; }
.avatar.round { border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ledger-ink); border-bottom-color: var(--ledger); }
.tab svg { width: 16px; height: 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--paper-2); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; }
.seg::-webkit-scrollbar { display: none; }
.seg > * { flex: none; }
.seg button, .seg a { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.seg button.active, .seg a.active { background: var(--sheet); color: var(--ink); box-shadow: var(--sh-1); }
.seg svg { width: 15px; height: 15px; }

/* -------------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--rule-2); }
.search-field { position: relative; flex: 1 1 220px; min-width: 0; max-width: 360px; }
.search-field svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-field .input { padding-left: 34px; min-height: 36px; font-size: var(--fs-sm); }

/* ------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--sheet); border-right: 1px solid var(--rule); z-index: 40; padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; text-decoration: none; color: var(--ink); min-height: 64px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--ledger); display: grid; place-items: center; color: #fff; flex: none; position: relative; overflow: hidden; }
.brand-mark svg { width: 20px; height: 20px; }
.brand-logo { height: 34px; width: auto; max-width: 170px; object-fit: contain; }
.brand-name { font-weight: 800; font-stretch: 120%; font-size: 1.12rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.68rem; color: var(--muted); font-weight: 500; margin-top: -2px; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; display: flex; flex-direction: column; gap: 1px; scrollbar-width: thin; }
.nav-group { font-size: 0.7rem; font-weight: 600; color: var(--faint); padding: 14px 10px 5px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 0 10px; min-height: 38px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: var(--fs-sm); position: relative; }
.nav-item svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item.active { background: var(--ledger-wash); color: var(--ledger-ink); font-weight: 650; }
.nav-item.active svg { color: var(--ledger); }
.nav-item .count { margin-left: auto; }
.nav-item .lock { margin-left: auto; width: 14px; height: 14px; color: var(--faint); }
.side-foot { padding: 12px; border-top: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
.plan-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ledger-tint); text-decoration: none; color: inherit; font-size: var(--fs-xs); border: 1px solid color-mix(in srgb, var(--ledger) 14%, var(--rule)); }
.plan-chip b { display: block; font-size: var(--fs-sm); color: var(--ink); }
.plan-chip.warn { background: var(--amber-wash); border-color: color-mix(in srgb, var(--amber) 25%, var(--rule)); }
.plan-chip.danger { background: var(--margin-wash); border-color: color-mix(in srgb, var(--margin) 25%, var(--rule)); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--rule); }
.topbar .menu-btn { display: none; }
.cmd-btn { display: flex; align-items: center; gap: 10px; flex: 0 1 380px; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--rule); background: var(--sheet); color: var(--faint); font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.cmd-btn:hover { border-color: color-mix(in srgb, var(--rule) 60%, var(--ink) 20%); }
.cmd-btn svg { width: 16px; height: 16px; flex: none; }
.cmd-btn kbd { margin-left: auto; font: inherit; font-size: 0.7rem; padding: 2px 6px; border-radius: 5px; background: var(--paper); border: 1px solid var(--rule); color: var(--muted); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 7px; }
.icon-btn .count { position: absolute; top: 2px; right: 0; height: 18px; min-width: 18px; font-size: 0.62rem; }
.me-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 4px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; color: inherit; }
.me-btn:hover { background: var(--paper-2); }
.me-btn .me-name { font-size: var(--fs-sm); font-weight: 600; max-width: 140px; }
.page { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); padding-block: 22px 56px; width: 100%; max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; min-width: 0; }
.page-head h1 { font-size: 1.65rem; font-weight: 750; font-stretch: 112%; letter-spacing: -0.025em; }
.page-head .lede { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs svg { width: 13px; height: 13px; }
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px)); font-size: var(--fs-sm); background: var(--amber-wash); color: #6B4100; border-bottom: 1px solid color-mix(in srgb, var(--amber) 22%, var(--rule)); }
.banner.danger { background: var(--margin-wash); color: #7C241D; }
.banner.violet { background: var(--stamp-wash); color: #33278A; }
.banner.ink { background: var(--ink); color: var(--on-dark); border-bottom-color: var(--ink); }
.banner svg { width: 17px; height: 17px; flex: none; }
.banner .btn { min-height: 30px; }
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 1024px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--sh-pop); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .topbar .menu-btn { display: inline-grid; }
  .cmd-btn kbd { display: none; }
}
@media (max-width: 640px) {
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: 16px; }
  .topbar { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); gap: 6px; }
  .cmd-btn { flex: 1 1 auto; }
  .cmd-btn span { display: none; }
  .me-btn .me-name { display: none; }
  .page-head h1 { font-size: 1.4rem; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .hide-sm { display: none !important; }
}
@media (min-width: 641px) { .show-sm { display: none !important; } }

/* portal: phone-first tab bar */
.tabbar { display: none; }
@media (max-width: 1024px) {
  .portal .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: var(--sheet); border-top: 1px solid var(--rule); padding: 6px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); box-shadow: 0 -8px 24px -18px rgba(16, 36, 27, .3); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 0.68rem; font-weight: 600; position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a.active { color: var(--ledger-ink); background: var(--ledger-wash); }
  .tabbar a .count { position: absolute; top: 0; left: calc(50% + 4px); height: 17px; min-width: 17px; font-size: 0.6rem; }
  .portal .page { padding-bottom: 104px; }
}

/* --------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule-2); min-width: 0; text-decoration: none; color: inherit; }
.li:last-child { border-bottom: 0; }
a.li:hover, .li.clickable:hover { background: var(--ledger-tint); cursor: pointer; }
.li .li-main { flex: 1; min-width: 0; }
.li .li-title { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.li .li-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.li .li-side { flex: none; text-align: right; font-size: var(--fs-xs); color: var(--muted); }
.li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--paper-2); color: var(--ink-2); }
.li-icon svg { width: 18px; height: 18px; }
.li-icon.green { background: var(--ledger-wash); color: var(--ledger); }
.li-icon.violet { background: var(--stamp-wash); color: var(--stamp); }
.li-icon.red { background: var(--margin-wash); color: var(--margin); }
.li-icon.amber { background: var(--amber-wash); color: var(--amber); }
.date-tile { width: 46px; flex: none; border-radius: 10px; border: 1px solid var(--rule); background: var(--sheet); overflow: hidden; text-align: center; line-height: 1; }
.date-tile .m { font-size: 0.6rem; font-weight: 700; padding: 4px 0 3px; background: var(--ledger); color: #fff; letter-spacing: 0.04em; }
.date-tile .d { font-size: 1.05rem; font-weight: 750; padding: 5px 0 6px; font-variant-numeric: tabular-nums; font-stretch: 110%; }
.date-tile.red .m { background: var(--margin); }
.date-tile.amber .m { background: var(--amber); }
.date-tile.violet .m { background: var(--stamp); }
.dl { display: grid; grid-template-columns: minmax(120px, 38%) minmax(0, 1fr); gap: 0; font-size: var(--fs-sm); }
.dl > div { padding: 9px 0; border-bottom: 1px solid var(--rule-2); min-width: 0; overflow-wrap: anywhere; }
.dl > div:nth-child(odd) { color: var(--muted); padding-right: 12px; }
.dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.copyable { display: inline-flex; align-items: center; gap: 6px; }
.copyable button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--faint); border-radius: 4px; display: inline-grid; }
.copyable button:hover { color: var(--ledger); }
.copyable svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------- empty, skeleton */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--muted); }
.empty .e-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--ledger-wash); color: var(--ledger); display: grid; place-items: center; }
.empty .e-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); font-size: var(--fs-md); font-weight: 650; }
.empty p { max-width: 46ch; font-size: var(--fs-sm); }
.skel { background: linear-gradient(90deg, var(--paper-2) 25%, var(--rule-2) 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 8px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.page-loading { display: flex; flex-direction: column; gap: 16px; }

/* ------------------------------------------------------------- progress */
.bar { height: 8px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--ledger); }
.bar.amber > i { background: var(--amber); }
.bar.red > i { background: var(--margin); }
.bar.violet > i { background: var(--stamp); }
.meter { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-xs); }
.meter .row { justify-content: space-between; }

/* stepper used for filing stages */
.stepper { display: flex; align-items: center; gap: 0; min-width: 0; }
.stepper .st { flex: 1; height: 6px; background: var(--paper-2); position: relative; }
.stepper .st:first-child { border-radius: 999px 0 0 999px; }
.stepper .st:last-child { border-radius: 0 999px 999px 0; }
.stepper .st.done { background: var(--ledger); }
.stepper .st.now { background: var(--stamp); }
.stepper + .stepper-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; }
.track-steps { display: flex; flex-direction: column; gap: 0; }
.track-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; position: relative; padding-bottom: 14px; }
.track-step::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--rule); }
.track-step:last-child::before { display: none; }
.track-step .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--rule); background: var(--sheet); display: grid; place-items: center; color: var(--faint); }
.track-step .dot svg { width: 14px; height: 14px; }
.track-step.done .dot { background: var(--ledger); border-color: var(--ledger); color: #fff; }
.track-step.done::before { background: var(--ledger); }
.track-step.now .dot { border-color: var(--stamp); color: var(--stamp); box-shadow: 0 0 0 4px var(--stamp-wash); }
.track-step .t { font-weight: 600; font-size: var(--fs-sm); padding-top: 4px; }
.track-step .s { font-size: var(--fs-xs); color: var(--muted); }

/* ------------------------------------------------------------- timeline */
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 12px; padding: 0 20px; position: relative; }
.tl::before { content: ""; position: absolute; left: 27px; top: 0; bottom: 0; width: 1px; background: var(--rule); }
.tl:first-child::before { top: 16px; }
.tl:last-child::before { bottom: calc(100% - 16px); }
.tl .tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ledger); margin: 12px 0 0 3px; position: relative; z-index: 1; }
.tl .tl-dot.client { border-color: var(--stamp); }
.tl .tl-dot.sys { border-color: var(--faint); }
.tl .tl-body { padding: 8px 0 10px; font-size: var(--fs-sm); min-width: 0; }
.tl .tl-meta { font-size: var(--fs-xs); color: var(--muted); }

/* ---------------------------------------------------------------- kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; min-height: 420px; scroll-snap-type: x proximity; }
.kcol { background: var(--paper-2); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; scroll-snap-align: start; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.kcol.drop { border-color: var(--ledger); background: var(--ledger-wash); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-weight: 650; font-size: var(--fs-sm); }
.kcol-head .count { margin-left: auto; }
.kcol-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 12px; min-height: 60px; }
.kcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 11px 12px; display: flex; flex-direction: column; gap: 7px; cursor: grab; box-shadow: var(--sh-1); font-size: var(--fs-sm); }
.kcard:hover { border-color: color-mix(in srgb, var(--rule) 50%, var(--ledger) 40%); }
.kcard.dragging { opacity: .5; }
.kcard .kc-title { font-weight: 650; color: var(--ink); line-height: 1.3; }
.kcard .kc-sub { font-size: var(--fs-xs); color: var(--muted); }
.kcard .kc-foot { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.kcard.overdue { box-shadow: inset 3px 0 0 var(--margin), var(--sh-1); }
.kcard.soon { box-shadow: inset 3px 0 0 var(--amber), var(--sh-1); }

/* -------------------------------------------------------------- calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); }
.cal-dow { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule-2); }
.cal-day { min-height: 112px; padding: 6px 6px 8px; border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--ledger-tint); }
.cal-day .dn { font-size: var(--fs-xs); font-weight: 650; color: var(--ink-2); padding: 2px 4px; font-variant-numeric: tabular-nums; align-self: flex-start; border-radius: 6px; }
.cal-day.other { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.cal-day.other .dn { color: var(--faint); }
.cal-day.today .dn { background: var(--ledger); color: #fff; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--ledger); }
.cal-ev { font-size: 0.68rem; line-height: 1.25; padding: 3px 5px; border-radius: 5px; background: var(--paper-2); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--faint); }
.cal-ev.k-deadline { background: var(--ledger-wash); border-left-color: var(--ledger); color: var(--ledger-ink); }
.cal-ev.k-deadline.featured { background: var(--ledger); color: #fff; }
.cal-ev.k-filing { background: #EEF3EF; border-left-color: var(--ink-2); }
.cal-ev.k-notice, .cal-ev.k-hearing { background: var(--margin-wash); border-left-color: var(--margin); color: #7C241D; }
.cal-ev.k-task { background: var(--amber-wash); border-left-color: var(--amber); color: #6B4100; }
.cal-ev.k-event { background: var(--stamp-wash); border-left-color: var(--stamp); color: #33278A; }
.cal-ev.k-invoice { background: #F2F2EE; border-left-color: #8C8C80; }
.cal-ev.done { opacity: .55; text-decoration: line-through; }
.cal-more { font-size: 0.66rem; color: var(--muted); padding-left: 5px; }
@media (max-width: 760px) { .cal-day { min-height: 64px; padding: 4px 3px; } .cal-ev { font-size: 0; height: 6px; padding: 0; border-left-width: 0; } .cal-dow { padding: 6px 4px; font-size: 0.66rem; text-align: center; } .cal-day .dn { align-self: center; } }

/* -------------------------------------------------------------- chat */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 560px; height: calc(100dvh - 180px); }
.chat-list { border-right: 1px solid var(--rule-2); overflow-y: auto; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule-2); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(var(--ledger-tint), var(--sheet) 240px); }
.bubble { max-width: min(74%, 560px); padding: 9px 13px; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.45; background: var(--sheet); border: 1px solid var(--rule); align-self: flex-start; border-bottom-left-radius: 4px; overflow-wrap: anywhere; white-space: pre-wrap; }
.bubble.me { align-self: flex-end; background: var(--ledger); color: #fff; border-color: var(--ledger); border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.bubble .b-meta { display: block; font-size: 0.66rem; opacity: .7; margin-top: 4px; }
.chat-day { align-self: center; font-size: 0.68rem; color: var(--muted); background: var(--paper-2); padding: 3px 10px; border-radius: 999px; }
.chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--rule-2); align-items: flex-end; }
.chat-compose .textarea { min-height: 42px; max-height: 140px; resize: none; }
.thread { cursor: pointer; }
.thread.active { background: var(--ledger-wash); }
@media (max-width: 860px) { .chat { grid-template-columns: minmax(0, 1fr); height: auto; } .chat.has-open .chat-list { display: none; } .chat:not(.has-open) .chat-pane { display: none; } .chat-msgs { min-height: 50vh; max-height: 60vh; } }

/* ----------------------------------------------------------- doc paper */
.paper-doc { background: #FFFEFB; border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--sh-2); padding: 34px 36px 40px; font-family: var(--font-doc); color: #1d2a24; position: relative; max-width: 640px; margin: 0 auto; background-image: linear-gradient(90deg, transparent 54px, color-mix(in srgb, var(--margin) 35%, transparent) 54px, color-mix(in srgb, var(--margin) 35%, transparent) 55px, transparent 55px); }
.paper-doc .pd-firm { font-family: var(--font); font-weight: 750; font-stretch: 118%; font-size: 0.82rem; color: var(--ledger-ink); padding-left: 30px; }
.paper-doc h3 { font-family: var(--font-doc); font-weight: 600; font-size: 1.15rem; margin: 14px 0 4px; padding-left: 30px; }
.paper-doc .pd-meta { font-size: 0.82rem; color: #5d6b63; padding-left: 30px; margin-bottom: 18px; }
.paper-doc table { width: calc(100% - 30px); margin-left: 30px; border-collapse: collapse; font-size: 0.92rem; }
.paper-doc td { padding: 9px 0; border-bottom: 1px dotted #c8d2cb; vertical-align: top; }
.paper-doc td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.paper-doc .pd-stamp { position: absolute; right: 30px; top: 26px; }
.paper-doc .pd-note { font-size: 0.78rem; color: #6c7a72; margin-top: 18px; padding-left: 30px; font-family: var(--font); }
.preview-frame { width: 100%; height: 70vh; border: 1px solid var(--rule); border-radius: var(--r); background: var(--paper); }
.preview-img { max-height: 70vh; margin: 0 auto; border-radius: var(--r); border: 1px solid var(--rule); background: var(--paper); }
.file-icon { width: 38px; height: 44px; border-radius: 6px; flex: none; display: grid; place-items: center; font-size: 0.6rem; font-weight: 800; font-stretch: 120%; color: #fff; background: var(--ink-2); position: relative; letter-spacing: 0.03em; }
.file-icon::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: linear-gradient(225deg, var(--paper) 50%, rgba(0, 0, 0, .18) 50%); border-bottom-left-radius: 3px; }
.file-icon.pdf { background: #C8463C; } .file-icon.img { background: #4B3BC4; } .file-icon.xls { background: #0E7A4F; } .file-icon.doc { background: #2F5DA8; } .file-icon.zip { background: #7A6A3A; }
.file-icon.sm { width: 30px; height: 36px; font-size: 0.52rem; }

/* ------------------------------------------------------------ modal */
.modal-root { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: max(5vh, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--overlay); overflow-y: auto; animation: fade .16s ease; }
.modal { width: 100%; max-width: 560px; background: var(--sheet); border-radius: var(--r-xl); box-shadow: var(--sh-pop); display: flex; flex-direction: column; min-width: 0; animation: rise .22s cubic-bezier(.2, .9, .3, 1); margin-bottom: 24px; }
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1040px; } .modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-head h2 { font-size: 1.15rem; font-weight: 700; font-stretch: 108%; }
.modal-head .sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 3px; }
.modal-head .close { margin-left: auto; margin-top: -4px; margin-right: -6px; }
.modal-body { padding: 4px 22px 18px; min-width: 0; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--rule-2); flex-wrap: wrap; }
.modal-foot .right { margin-left: auto; display: flex; gap: 10px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .modal-root { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xl, .modal.sm { max-width: none; border-radius: 20px 20px 0 0; margin-bottom: 0; max-height: 94dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* drop-down menu */
.menu { position: fixed; z-index: 90; min-width: 220px; max-width: min(340px, calc(100vw - 24px)); background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--sh-pop); padding: 6px; animation: rise .14s ease; max-height: 70vh; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: none; text-align: left; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--paper); outline: none; }
.menu-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu-item.danger { color: var(--margin); }
.menu-item.danger svg { color: var(--margin); }
.menu-sep { height: 1px; background: var(--rule-2); margin: 5px 4px; }
.menu-head { padding: 10px 10px 8px; font-size: var(--fs-xs); color: var(--muted); }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.notif:hover { background: var(--paper); }
.notif.unread { background: var(--ledger-tint); }
.notif .n-title { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.notif .n-body { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.notif .n-time { font-size: 0.66rem; color: var(--faint); margin-top: 3px; }

/* toasts */
.toasts { position: fixed; z-index: 100; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 14px; border-radius: 12px; background: var(--ink); color: var(--on-dark); font-size: var(--fs-sm); box-shadow: var(--sh-pop); animation: rise .2s ease; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.success svg { color: #7FD8A6; } .toast.error svg { color: #FF9A8F; } .toast.warn svg { color: #F6C46B; }
.toast button { margin-left: 6px; background: none; border: 0; color: #9FE3BD; font-weight: 700; cursor: pointer; font-size: var(--fs-sm); }
@media (max-width: 1024px) { .portal ~ .toasts, body.has-tabbar .toasts { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); } }

/* command palette */
.cmdk { max-width: 620px; }
.cmdk .cmdk-input { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--rule-2); }
.cmdk .cmdk-input svg { width: 18px; height: 18px; color: var(--muted); }
.cmdk .cmdk-input input { flex: 1; border: 0; outline: none; font-size: var(--fs-md); background: none; min-width: 0; }
.cmdk-results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 0.7rem; font-weight: 600; color: var(--faint); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.cmdk-item:hover, .cmdk-item.on { background: var(--ledger-wash); }
.cmdk-item svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.cmdk-item .ci-sub { font-size: var(--fs-xs); color: var(--muted); margin-left: auto; text-align: right; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .grid-line { stroke: var(--rule-2); stroke-width: 1; }
.chart .axis-line { stroke: var(--rule); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-xs); color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: var(--fs-sm); padding: 6px 0; }
.hbar .bar { height: 10px; }

/* ----------------------------------------------------------- auth pages */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--paper); }
.auth-art { position: relative; overflow: hidden; background: var(--ledger-ink); color: var(--on-dark); padding: 40px max(40px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 28px; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .055) 0 1px, transparent 1px 34px); }
.auth-art::after { content: ""; position: absolute; top: 0; bottom: 0; left: 76px; width: 1px; background: rgba(255, 140, 120, .45); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .brand-name { color: #fff; }
.auth-art h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); font-weight: 800; font-stretch: 122%; letter-spacing: -0.03em; line-height: 1.04; max-width: 14ch; margin-top: auto; }
.auth-art .points { display: flex; flex-direction: column; gap: 12px; max-width: 44ch; font-size: var(--fs-sm); color: rgba(244, 247, 243, .82); }
.auth-art .points div { display: flex; gap: 10px; }
.auth-art .points svg { width: 18px; height: 18px; color: #7FD8A6; flex: none; margin-top: 1px; }
.auth-art .art-stamp { align-self: flex-start; }
.auth-art .stamp { --s: #CBC4FF; background: transparent; }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 40px max(24px, env(safe-area-inset-right, 0px)) 40px max(24px, env(safe-area-inset-left, 0px)); }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 1.7rem; font-weight: 800; font-stretch: 114%; letter-spacing: -0.025em; }
.auth-card .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 6px; }
.demo-box { border: 1px dashed color-mix(in srgb, var(--stamp) 40%, var(--rule)); border-radius: var(--r-lg); padding: 14px; background: var(--stamp-wash); display: flex; flex-direction: column; gap: 10px; }
.demo-box .demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--stamp) 22%, var(--rule)); background: var(--sheet); cursor: pointer; text-align: left; font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
.demo-pick:hover { border-color: var(--stamp); }
.demo-pick small { font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.steps-dots { display: flex; gap: 6px; }
.steps-dots i { height: 5px; flex: 1; border-radius: 99px; background: var(--rule); }
.steps-dots i.on { background: var(--ledger); }
.plan-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-pick label { position: relative; }
.plan-pick input { position: absolute; opacity: 0; }
.plan-pick .pp { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--sheet); cursor: pointer; height: 100%; }
.plan-pick input:checked + .pp { border-color: var(--ledger); background: var(--ledger-tint); box-shadow: var(--ring); }
.plan-pick .pp b { font-size: var(--fs-md); }
.plan-pick .pp .pr { font-weight: 750; font-stretch: 110%; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { padding: 24px max(20px, env(safe-area-inset-left, 0px)) 28px; min-height: 0; } .auth-art h2 { font-size: 1.7rem; margin-top: 4px; } .auth-art .points, .auth-art .art-stamp { display: none; } .auth-art::after { left: 34px; } }

/* =================================================================== *
 *  WEBSITE
 * =================================================================== */
.site { background: var(--paper); overflow-x: clip; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.ann { background: var(--ink); color: var(--on-dark); font-size: var(--fs-sm); }
.ann .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; padding-block: 9px; }
.ann b { color: #fff; }
.ann .ann-seats { display: inline-flex; align-items: center; gap: 8px; }
.ann .ann-seats .bar { width: 90px; height: 6px; background: rgba(255, 255, 255, .16); }
.ann .ann-seats .bar i { background: #F6C46B; }
.ann .cd { font-variant-numeric: tabular-nums; font-weight: 700; color: #F6C46B; letter-spacing: 0.01em; }
.ann a { color: #9FE3BD; font-weight: 700; text-decoration: none; }
.ann a:hover { text-decoration: underline; }
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.5) blur(12px); -webkit-backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s, background .2s; }
.nav.scrolled { border-bottom-color: var(--rule); background: color-mix(in srgb, var(--sheet) 92%, transparent); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 68px; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--ink-2); font-weight: 550; font-size: var(--fs-sm); }
.nav-links a:hover { background: var(--paper-2); color: var(--ink); }
.nav-cta { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.nav .menu-btn { display: none; }
@media (max-width: 980px) { .nav-links { display: none; } .nav .menu-btn { display: inline-grid; } .nav .hide-nav { display: none; } }
.mobile-menu { position: fixed; inset: 0; z-index: 70; background: var(--sheet); padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; gap: 6px; animation: fade .15s; }
.mobile-menu a.mm { padding: 14px 4px; border-bottom: 1px solid var(--rule-2); font-size: var(--fs-lg); font-weight: 650; text-decoration: none; color: var(--ink); }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ledger-deep); }
.eyebrow .dotlive { width: 8px; height: 8px; border-radius: 50%; background: var(--ledger); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ledger) 50%, transparent); animation: live 2s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ledger) 45%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.hero { position: relative; padding-block: 56px 36px; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--ledger) 9%, transparent) 0 1px, transparent 1px 36px); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 6.2vw, 4.7rem); font-weight: 820; font-stretch: 122%; letter-spacing: -0.045em; line-height: 0.98; margin-top: 18px; }
.hero h1 .ln { display: block; }
.hero .urdu { font-family: var(--font-urdu); direction: rtl; text-align: left; font-size: clamp(1.1rem, 2vw, 1.45rem); color: var(--ledger-deep); margin-top: 18px; line-height: 2; }
.hero .lede { font-size: clamp(1rem, 1.4vw, 1.14rem); color: var(--ink-2); max-width: 54ch; margin-top: 14px; line-height: 1.6; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero .assure { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font-size: var(--fs-sm); color: var(--muted); }
.hero .assure span { display: inline-flex; align-items: center; gap: 6px; }
.hero .assure svg { width: 16px; height: 16px; color: var(--ledger); }
@media (max-width: 980px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 34px; } .hero { padding-top: 34px; } }

/* hero: the case file with the stamp moment */
.casefile { position: relative; padding: 30px 0 18px 18px; margin-bottom: 30px; }
.cf-back { position: absolute; inset: 0 26px 30px 0; border-radius: var(--r-xl); background: var(--ledger-wash); border: 1px solid color-mix(in srgb, var(--ledger) 18%, var(--rule)); transform: rotate(-2.4deg); }
.cf-tab { position: absolute; top: 4px; left: 44px; padding: 6px 14px 10px; border-radius: 10px 10px 0 0; background: var(--ledger); color: #fff; font-size: var(--fs-xs); font-weight: 700; font-stretch: 112%; transform: rotate(-2.4deg); }
.cf-sheet { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--sh-pop); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cf-head { display: flex; align-items: center; gap: 12px; }
.cf-head .who b { display: block; font-size: var(--fs-md); }
.cf-head .who span { font-size: var(--fs-xs); color: var(--muted); }
.cf-lines { border-top: 1px solid var(--rule-2); }
.cf-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: var(--fs-sm); }
.cf-line > svg { width: 18px; height: 18px; color: var(--ledger); }
.cf-line .lbl { color: var(--ink-2); flex: 1; min-width: 0; }
.cf-line .val { font-weight: 700; font-variant-numeric: tabular-nums; }
.cf-line .val.green { color: var(--ledger); }
.cf-stamp { position: absolute; right: 22px; top: 20px; }
.cf-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule); box-shadow: var(--sh-2); font-size: var(--fs-xs); max-width: 250px; }
.cf-float b { display: block; font-size: var(--fs-sm); color: var(--ink); }
.cf-float.one { left: -18px; bottom: -44px; }
.cf-float.two { right: -14px; bottom: -44px; }
@media (max-width: 640px) { .cf-float.one { left: 0; bottom: -40px; } .cf-float.two { display: none; } .casefile { padding-left: 8px; margin-bottom: 26px; } }
@media (prefers-reduced-motion: reduce) { .stamp-in, .eyebrow .dotlive { animation: none !important; } }

/* deadline rail */
.rail { padding-block: 10px 30px; }
.rail-sheet { display: grid; grid-template-columns: auto repeat(var(--n, 4), minmax(0, 1fr)); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.rail-title { padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 2px; background: var(--ink); color: var(--on-dark); min-width: 170px; }
.rail-title b { font-size: var(--fs-md); font-stretch: 112%; }
.rail-title span { font-size: var(--fs-xs); color: rgba(244, 247, 243, .7); }
.rail-item { padding: 14px 16px; border-left: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rail-item .ri-days { font-size: 1.5rem; font-weight: 800; font-stretch: 112%; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.rail-item .ri-days small { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.rail-item .ri-title { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.rail-item .ri-date { font-size: var(--fs-xs); color: var(--muted); }
.rail-item.hot { background: var(--margin-wash); }
.rail-item.hot .ri-days { color: var(--margin); }
@media (max-width: 980px) { .rail-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rail-title { grid-column: span 2; } .rail-item:nth-child(even) { border-left: 0; } .rail-item { border-top: 1px solid var(--rule-2); } }

.section { padding-block: 72px; }
.section.tight { padding-block: 48px; }
.section.band { background: var(--sheet); border-block: 1px solid var(--rule); }
.section.ink { background: var(--ledger-ink); color: var(--on-dark); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 32px; align-items: end; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 800; font-stretch: 118%; letter-spacing: -0.035em; line-height: 1.02; }
.sec-head p { color: var(--ink-2); font-size: var(--fs-md); line-height: 1.6; }
.section.ink .sec-head p { color: rgba(244, 247, 243, .78); }
@media (max-width: 860px) { .sec-head { grid-template-columns: minmax(0, 1fr); gap: 14px; } .section { padding-block: 54px; } }

/* why: cost of the old way vs FinTax value */
.cost-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--sheet); }
.cost { padding: 22px 22px 24px; border-left: 1px solid var(--rule-2); display: flex; flex-direction: column; gap: 8px; }
.cost:first-child { border-left: 0; }
.cost .c-num { font-size: 2.2rem; font-weight: 820; font-stretch: 118%; letter-spacing: -0.03em; color: var(--margin); font-variant-numeric: tabular-nums; line-height: 1; }
.cost .c-num small { font-size: 0.95rem; letter-spacing: 0; font-weight: 700; margin-left: 4px; color: var(--ink-2); }
.cost h3 { font-size: var(--fs-md); font-weight: 700; }
.cost p { font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 860px) { .cost-strip { grid-template-columns: minmax(0, 1fr); } .cost { border-left: 0; border-top: 1px solid var(--rule-2); } .cost:first-child { border-top: 0; } }
.value-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 28px; border-top: 1px solid var(--rule); }
.value { padding: 22px 22px 22px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; align-items: start; }
.value:not(:nth-child(3n+1)) { padding-left: 22px; border-left: 1px solid var(--rule-2); }
.value .v-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--ledger-wash); color: var(--ledger); display: grid; place-items: center; }
.value .v-ic svg { width: 20px; height: 20px; }
.value h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: 6px; }
.value p { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }
.value .v-gain { display: inline-block; margin-top: 10px; font-size: var(--fs-xs); font-weight: 700; color: var(--ledger-deep); background: var(--ledger-wash); padding: 3px 8px; border-radius: 6px; }
@media (max-width: 960px) { .value-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .value:not(:nth-child(3n+1)) { padding-left: 0; border-left: 0; } .value:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--rule-2); } }
@media (max-width: 640px) { .value-grid { grid-template-columns: minmax(0, 1fr); } .value:nth-child(even) { padding-left: 0; border-left: 0; } }

/* day comparison */
.dayvs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.day { border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 0; }
.day.old { background: var(--sheet); border: 1px solid var(--rule); }
.day.new { background: var(--ledger-ink); color: var(--on-dark); }
.day h3 { font-size: var(--fs-lg); font-weight: 750; font-stretch: 112%; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.day .slot { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule-2); font-size: var(--fs-sm); }
.day.new .slot { border-top-color: rgba(255, 255, 255, .1); }
.day .slot time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.day.new .slot time { color: #9FE3BD; }
.day.old .slot.bad span { color: #8E2A22; }
.day .total { margin-top: 12px; padding-top: 14px; border-top: 2px solid var(--rule); font-weight: 700; display: flex; justify-content: space-between; gap: 10px; }
.day.new .total { border-top-color: rgba(255, 255, 255, .2); }
@media (max-width: 860px) { .dayvs { grid-template-columns: minmax(0, 1fr); } }

/* how it works: a real three-step sequence, so it is numbered */
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.how-step { position: relative; padding: 22px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 8px; }
.how-step::before { counter-increment: step; content: counter(step); width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-stretch: 115%; margin-bottom: 6px; }
.how-step h3 { font-size: var(--fs-md); font-weight: 700; }
.how-step p { font-size: var(--fs-sm); color: var(--ink-2); }
@media (max-width: 860px) { .how { grid-template-columns: minmax(0, 1fr); } }

/* feature modules: one large panel and a list, not a card grid */
.modules { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.mod-tabs { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.mod-tab { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 14px; align-items: center; padding: 16px 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; cursor: pointer; color: var(--ink); width: 100%; }
.mod-tab .mt-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--paper-2); color: var(--ink-2); display: grid; place-items: center; }
.mod-tab .mt-ic svg { width: 19px; height: 19px; }
.mod-tab b { display: block; font-size: var(--fs-md); color: var(--ink); }
.mod-tab span { font-size: var(--fs-sm); color: var(--muted); }
.mod-tab > svg { width: 18px; height: 18px; color: var(--faint); }
.mod-tab.active .mt-ic { background: var(--ledger); color: #fff; }
.mod-tab.active > svg { color: var(--ledger); }
.mod-view { position: sticky; top: 92px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-xl); box-shadow: var(--sh-2); overflow: hidden; min-width: 0; }
.mod-view .mv-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--rule-2); background: var(--ledger-tint); font-size: var(--fs-xs); color: var(--muted); }
.mod-view .mv-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--rule); }
.mod-view .mv-body { padding: 18px; min-height: 340px; display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 960px) { .modules { grid-template-columns: minmax(0, 1fr); } .mod-view { position: static; } }

/* calculators */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--rule); background: var(--sheet); box-shadow: var(--sh-2); }
.calc-in { padding: 28px; display: flex; flex-direction: column; gap: 22px; }
.calc-out { padding: 28px; background: var(--ledger-ink); color: var(--on-dark); display: flex; flex-direction: column; gap: 14px; }
.calc-out .big { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 820; font-stretch: 118%; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; color: #fff; }
.calc-out .lbl { font-size: var(--fs-sm); color: rgba(244, 247, 243, .72); }
.calc-out .rows { display: flex; flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .12); }
.calc-out .rows div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.calc-out .note { font-size: var(--fs-xs); color: rgba(244, 247, 243, .6); }
.slider { display: flex; flex-direction: column; gap: 8px; }
.slider .row { justify-content: space-between; }
.slider output { font-weight: 750; font-variant-numeric: tabular-nums; font-stretch: 110%; }
input[type=range] { width: 100%; accent-color: var(--ledger); height: 28px; }
@media (max-width: 860px) { .calc { grid-template-columns: minmax(0, 1fr); } .calc-in, .calc-out { padding: 22px; } }

/* pricing */
.price-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.offer-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: var(--sheet); border: 1px solid var(--rule); }
.offer-box .ob-seats { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.offer-box .bar i { background: var(--amber); }
.cd-cells { display: flex; gap: 6px; }
.cd-cells div { min-width: 50px; padding: 6px 6px 5px; border-radius: 10px; background: var(--ink); color: #fff; text-align: center; line-height: 1; }
.cd-cells b { display: block; font-size: 1.25rem; font-weight: 800; font-stretch: 110%; font-variant-numeric: tabular-nums; }
.cd-cells small { font-size: 0.6rem; color: rgba(255, 255, 255, .65); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-xl); padding: 26px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.plan.hi { background: var(--ledger-ink); color: var(--on-dark); border-color: var(--ledger-ink); box-shadow: var(--sh-pop); }
.plan .p-badge { position: absolute; top: -13px; left: 26px; }
.plan h3 { font-size: var(--fs-xl); font-weight: 800; font-stretch: 118%; letter-spacing: -0.02em; }
.plan .p-tag { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
.plan.hi .p-tag { color: rgba(244, 247, 243, .72); }
.plan .p-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan .p-price .amt { font-size: clamp(2.2rem, 4vw, 2.9rem); font-weight: 820; font-stretch: 116%; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.plan .p-price .per { font-size: var(--fs-sm); color: var(--muted); }
.plan.hi .p-price .per { color: rgba(244, 247, 243, .7); }
.plan .p-anchor { font-size: var(--fs-sm); color: var(--muted); }
.plan .p-anchor s { color: var(--margin); }
.plan.hi .p-anchor { color: rgba(244, 247, 243, .72); }
.plan.hi .p-anchor s { color: #FF9A8F; }
.plan .p-save { display: inline-flex; align-self: flex-start; font-size: var(--fs-xs); font-weight: 700; padding: 4px 9px; border-radius: 6px; background: var(--amber-wash); color: #7A4800; }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-sm); }
.plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.plan li svg { width: 18px; height: 18px; color: var(--ledger); margin-top: 1px; }
.plan.hi li svg { color: #7FD8A6; }
.plan .btn { margin-top: auto; }
.plan.hi .btn-primary { --b-bg: #fff; --b-fg: var(--ledger-ink); --b-bd: #fff; box-shadow: none; }
.plan.hi .btn-primary:hover { --b-bg: #E7F5EC; }
.plan .p-day { font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.plan.hi .p-day { color: rgba(244, 247, 243, .6); }
.assurances { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: center; margin-top: 22px; font-size: var(--fs-sm); color: var(--ink-2); }
.assurances span { display: inline-flex; align-items: center; gap: 7px; }
.assurances svg { width: 17px; height: 17px; color: var(--ledger); }
@media (max-width: 860px) { .plans { grid-template-columns: minmax(0, 1fr); } }

.quotes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.quote { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.quote blockquote { margin: 0; font-size: var(--fs-md); line-height: 1.55; }
.quote .stars { display: flex; gap: 2px; color: var(--amber); }
.quote .stars svg { width: 16px; height: 16px; fill: currentColor; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--sheet); overflow: hidden; margin-bottom: 28px; }
.stats-row div { padding: 18px; border-left: 1px solid var(--rule-2); }
.stats-row div:first-child { border-left: 0; }
.stats-row b { display: block; font-size: 1.8rem; font-weight: 820; font-stretch: 116%; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stats-row span { font-size: var(--fs-sm); color: var(--muted); }
@media (max-width: 760px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats-row div:nth-child(3) { border-left: 0; } .stats-row div:nth-child(n+3) { border-top: 1px solid var(--rule-2); } }

.faq { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px; }
.faq-list { border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }
.faq-item summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 18px 2px; cursor: pointer; font-weight: 650; font-size: var(--fs-md); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { margin-left: auto; width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex: none; }
.faq-item[open] summary svg { transform: rotate(45deg); color: var(--ledger); }
.faq-item p { padding: 0 2px 18px; color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; max-width: 66ch; }
@media (max-width: 860px) { .faq { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

.final { position: relative; overflow: hidden; }
.final .final-card { position: relative; border-radius: 28px; background: var(--ledger-ink); color: var(--on-dark); padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; overflow: hidden; }
.final .final-card::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 34px); }
.final .final-card > * { position: relative; }
.final h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); font-weight: 820; font-stretch: 120%; letter-spacing: -0.04em; line-height: 1.02; }
.final p { color: rgba(244, 247, 243, .8); margin-top: 14px; font-size: var(--fs-md); max-width: 46ch; }
.final .lead-form { display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 18px; padding: 18px; }
.final .lead-form .input { background: rgba(255, 255, 255, .96); border-color: transparent; }
.final .btn-primary { --b-bg: #fff; --b-fg: var(--ledger-ink); --b-bd: #fff; }
@media (max-width: 860px) { .final .final-card { grid-template-columns: minmax(0, 1fr); } }

.footer { padding-block: 44px max(28px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); background: var(--sheet); font-size: var(--fs-sm); color: var(--ink-2); }
.footer .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
.footer h4 { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.footer a { color: var(--ink-2); text-decoration: none; display: block; padding: 3px 0; }
.footer a:hover { color: var(--ledger-deep); }
.footer .fine { grid-column: 1 / -1; border-top: 1px solid var(--rule-2); padding-top: 18px; font-size: var(--fs-xs); color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
@media (max-width: 860px) { .footer .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer .wrap > :first-child { grid-column: 1 / -1; } }

/* live activity toast: shown only for real sign-ups */
.live-toast { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 45; display: flex; align-items: center; gap: 12px; padding: 12px 14px; max-width: min(340px, calc(100vw - 32px)); background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; box-shadow: var(--sh-pop); font-size: var(--fs-sm); animation: rise .3s ease; }
.live-toast .li-icon { width: 34px; height: 34px; }
.live-toast b { display: block; font-size: var(--fs-sm); }
.live-toast span { font-size: var(--fs-xs); color: var(--muted); }
.live-toast button { border: 0; background: none; color: var(--faint); cursor: pointer; align-self: flex-start; padding: 0; }
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 46; gap: 10px; align-items: center; padding: 10px max(14px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); background: var(--sheet); border-top: 1px solid var(--rule); box-shadow: 0 -12px 30px -20px rgba(16, 36, 27, .4); transform: translateY(110%); transition: transform .25s ease; }
  .sticky-cta.show { transform: none; }
  .sticky-cta .sc-text { font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; flex: 1; min-width: 0; }
  .sticky-cta .sc-text b { display: block; color: var(--ink); font-size: var(--fs-sm); }
  .live-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
.install-fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 44; }
.preview-flag { position: fixed; z-index: 47; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: var(--stamp); color: #fff; font-size: 0.68rem; font-weight: 700; box-shadow: var(--sh-2); pointer-events: none; opacity: .92; }

/* role switcher shown in preview mode */
.role-switch { position: fixed; z-index: 48; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
.role-switch .btn { box-shadow: var(--sh-pop); }
@media (max-width: 1024px) { body.has-tabbar .role-switch { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 760px) { body.on-site .role-switch { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* invoice document */
.invoice { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: clamp(20px, 4vw, 40px); display: flex; flex-direction: column; gap: 24px; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.invoice h2 { font-size: 1.6rem; font-weight: 820; font-stretch: 120%; letter-spacing: -0.02em; }
.invoice .inv-meta { display: grid; grid-template-columns: auto auto; gap: 4px 18px; font-size: var(--fs-sm); }
.invoice .inv-meta span:nth-child(odd) { color: var(--muted); }
.inv-total { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: var(--fs-sm); }
.inv-total div { display: flex; gap: 24px; justify-content: space-between; min-width: min(260px, 100%); font-variant-numeric: tabular-nums; }
.inv-total .grand { font-size: var(--fs-lg); font-weight: 800; border-top: 2px solid var(--ink); padding-top: 8px; }
@media print {
  body { background: #fff; }
  .side, .topbar, .page-head .actions, .no-print, .toasts, .role-switch, .preview-flag, .banner, .tabbar { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .invoice { border: 0; padding: 0; }
}

/* ---------------------------------------------------------- html charts */
.faint { color: var(--faint); }
.chart-tip { position: fixed; z-index: 120; pointer-events: none; padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--on-dark); font-size: 0.74rem; font-weight: 600; white-space: nowrap; box-shadow: var(--sh-2); font-variant-numeric: tabular-nums; }
.hchart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--h, 200px) auto; column-gap: 10px; min-width: 0; }
.hc-y { position: relative; font-size: 0.7rem; color: var(--muted); min-width: 46px; }
.hc-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hc-plot { position: relative; display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); min-width: 0; }
.hc-plot .gl { position: absolute; left: 0; right: 0; height: 1px; background: var(--rule-2); }
.hc-col { flex: 1 1 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; position: relative; z-index: 1; min-width: 0; cursor: default; }
.hc-col:hover { background: color-mix(in srgb, var(--ledger) 5%, transparent); }
.hc-bar { border-radius: 4px 4px 0 0; flex: none; transition: opacity .15s; }
.hc-x { grid-column: 2; display: flex; font-size: 0.7rem; color: var(--muted); padding-top: 6px; min-width: 0; }
.hc-x span { flex: 1 1 0; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lchart { position: relative; }
.lchart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lchart .end-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--sheet); transform: translate(-50%, 50%); }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 140px; height: 140px; flex: none; }
.donut svg { width: 140px; height: 140px; transform: rotate(-90deg); }
.donut .d-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut .d-center b { font-size: 1.5rem; font-weight: 800; font-stretch: 110%; font-variant-numeric: tabular-nums; line-height: 1; }
.donut .d-center span { font-size: 0.7rem; color: var(--muted); margin-top: 3px; }
.d-legend { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); min-width: 0; }
.d-legend div { display: flex; align-items: center; gap: 8px; }
.d-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.d-legend b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
