﻿
  :root {
    /* Government-trusted blue palette
       — ink: deep navy (primary surface/button color)
       — accent: royal blue (links + focus)
       — neutrals carry a faint cool tint */
    --bg: oklch(0.985 0.006 255);
    --surface: oklch(1 0 0);
    --surface-2: oklch(0.965 0.012 255);
    --line: oklch(0.9 0.018 255);
    --line-strong: oklch(0.82 0.03 255);
    --ink: oklch(0.26 0.085 258);
    --ink-2: oklch(0.4 0.06 258);
    --ink-3: oklch(0.55 0.035 258);
    --accent: oklch(0.48 0.16 256);
    --accent-hover: oklch(0.42 0.17 256);
    --accent-ink: oklch(0.99 0.005 255);
    --accent-soft: oklch(0.94 0.04 256);
    --ink-hover: oklch(0.32 0.09 258);
    --good: oklch(0.55 0.13 155);
    --good-soft: oklch(0.95 0.04 155);
    --warn: oklch(0.65 0.14 70);
    --warn-soft: oklch(0.96 0.05 70);
    --bad: oklch(0.55 0.17 25);
    --bad-soft: oklch(0.96 0.035 25);
    --info: oklch(0.5 0.13 240);
    --info-soft: oklch(0.95 0.035 240);
    --shadow-sm: 0 1px 2px oklch(0.2 0.06 258 / 0.08);
    --shadow-md: 0 8px 32px oklch(0.2 0.08 258 / 0.1), 0 2px 6px oklch(0.2 0.06 258 / 0.05);
    --radius: 10px;
    --radius-lg: 14px;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: "Public Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
  body { min-height: 100vh; }
  button { font-family: inherit; cursor: pointer; }
  input { font-family: inherit; }
  .mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "ss01"; letter-spacing: -0.01em; }
  #root { min-height: 100vh; }

  /* shared */
  .app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .topbar {
    height: 60px;
    display: flex; align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    gap: 16px;
  }
  .org-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
  }
  .org-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .org-brand image-slot {
    border: 1.5px dashed var(--line-strong);
    background: var(--surface-2);
    border-radius: 8px;
    transition: border-color .15s, background .15s;
  }
  .org-brand:hover image-slot { border-color: var(--accent); background: var(--accent-soft); }
  .org-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
  }
  .org-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
    outline: none;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  .org-name:focus,
  .org-sub:focus {
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px var(--accent-soft);
  }
  .org-name:empty::before,
  .org-sub:empty::before {
    content: attr(data-placeholder);
    color: var(--ink-3);
    font-style: italic;
  }
  .org-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
    letter-spacing: 0;
    margin-top: 2px;
    outline: none;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
  }
  .brand-sep {
    width: 1px;
    height: 28px;
    background: var(--line);
    flex-shrink: 0;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 600; font-size: 14px; letter-spacing: -0.005em;
    color: var(--ink-2);
  }
  .brand-mark {
    width: 26px; height: 26px;
    background: var(--ink);
    color: var(--bg);
    display: grid; place-items: center;
    border-radius: 6px;
    font-size: 12px; font-weight: 800;
    letter-spacing: 0.02em;
  }
  .brand-mark svg { width: 14px; height: 14px; }
  .brand small {
    color: var(--ink-3);
    font-weight: 500;
    font-size: 12px;
    margin-left: 2px;
  }
  .topbar-spacer { flex: 1; }
  .topbar-meta { color: var(--ink-3); font-size: 13px; display: flex; gap: 14px; align-items: center; }
  .topbar-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--good); display: inline-block; margin-right: 6px; vertical-align: 1px; }

  /* auth screens */
  .auth-stage {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 0;
  }
  .auth-side {
    border-right: 1px solid oklch(0.22 0.08 258);
    background:
      radial-gradient(ellipse at 100% 100%, oklch(0.34 0.11 258) 0%, transparent 55%),
      radial-gradient(ellipse at 0% 0%, oklch(0.32 0.1 258) 0%, transparent 50%),
      var(--ink);
    color: oklch(0.98 0.01 255);
    padding: 48px 56px;
    display: flex; flex-direction: column;
    position: relative;
    overflow: hidden;
  }
  .auth-side > * { position: relative; z-index: 1; }
  .auth-side h1 {
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin: 0 0 16px;
    max-width: 460px;
    color: oklch(0.99 0.005 255);
  }
  .auth-side p.lede {
    font-size: 16px;
    color: oklch(0.86 0.02 255);
    max-width: 440px;
    margin: 0 0 36px;
    line-height: 1.55;
  }
  .auth-features {
    display: flex; flex-direction: column;
    gap: 18px;
    margin-top: auto;
  }
  .auth-feat {
    display: flex; gap: 14px;
    align-items: flex-start;
    max-width: 460px;
  }
  .auth-feat .ic {
    width: 34px; height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    background: oklch(1 0 0 / 0.08);
    border: 1px solid oklch(1 0 0 / 0.14);
    display: grid; place-items: center;
    color: oklch(0.94 0.02 255);
  }
  .auth-feat .ic svg { width: 16px; height: 16px; }
  .auth-feat h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: oklch(0.98 0.01 255); }
  .auth-feat p { margin: 0; font-size: 13px; color: oklch(0.78 0.025 255); line-height: 1.5; }

  /* decorative grid + soft glow */
  .auth-side::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(to right, oklch(1 0 0 / 0.05) 1px, transparent 1px),
      linear-gradient(to bottom, oklch(1 0 0 / 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(circle at 80% 90%, black, transparent 65%);
            mask-image: radial-gradient(circle at 80% 90%, black, transparent 65%);
    pointer-events: none;
    z-index: 0;
  }
  .auth-side::after {
    content: "";
    position: absolute;
    right: -120px; top: -120px;
    width: 360px; height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, oklch(0.55 0.18 256 / 0.35) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
  }

  .auth-form-wrap {
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
  }
  .auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-md);
  }
  .auth-card .step-pill {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 18px;
  }
  .auth-card h2 {
    margin: 0 0 8px;
    font-size: 24px; font-weight: 700;
    letter-spacing: -0.015em;
  }
  .auth-card p.sub {
    margin: 0 0 26px;
    color: var(--ink-3); font-size: 14px; line-height: 1.5;
  }

  .field { display: block; margin-bottom: 18px; }
  .field label {
    display: block;
    font-size: 13px; font-weight: 500;
    margin-bottom: 6px;
    color: var(--ink-2);
    overflow-wrap: break-word;
  }
  .input-wrap {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    overflow: hidden;
  }
  .input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .input-prefix {
    display: flex; align-items: center;
    padding: 0 12px;
    background: var(--surface-2);
    border-right: 1px solid var(--line);
    font-size: 14px;
    color: var(--ink-2);
    font-weight: 500;
  }
  .input-wrap input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0 12px;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    height: 44px;
    min-width: 0;
  }
  .input-wrap input::placeholder { color: oklch(0.7 0.01 250); }

  /* ---------- Chip / token input (Khasra numbers) ---------- */
  .chip-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
    cursor: text;
  }
  .chip-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 4px 0 6px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    font-family: "JetBrains Mono", monospace;
    font-size: 12.5px;
    color: var(--ink);
    cursor: grab;
    user-select: none;
    transition: background .12s, border-color .12s, box-shadow .12s;
  }
  .chip:hover { border-color: var(--ink-3); }
  .chip:active { cursor: grabbing; }
  .chip.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
  .chip-grip { display: inline-flex; color: var(--ink-3); }
  .chip-label { line-height: 1; }
  .chip-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    border: 0; border-radius: 4px;
    background: transparent; color: var(--ink-3);
    cursor: pointer; padding: 0;
    transition: background .12s, color .12s;
  }
  .chip-x:hover { background: var(--bad-soft); color: var(--bad); }
  .chip-entry {
    flex: 1 1 120px;
    min-width: 120px;
    border: 0; background: transparent; outline: none;
    height: 28px;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
  }
  .chip-entry::placeholder { color: oklch(0.7 0.01 250); }

  /* ---------- Sub-TDR: FSI credit callout + retrieved (read-only) fields ---------- */
  .fsi-callout {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin: 4px 0 20px;
    padding: 15px 18px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
  }
  .fsi-callout .fsi-k { font-size: 13px; font-weight: 600; color: var(--ink-2); }
  .fsi-callout .fsi-v { font-family: "JetBrains Mono", monospace; color: var(--ink); white-space: nowrap; }
  .fsi-callout .fsi-v .num { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
  .fsi-callout .fsi-v .unit { font-size: 14px; color: var(--ink-3); margin-left: 4px; }

  .retrieved-block {
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface-2);
  }
  .retrieved-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 11.5px; font-weight: 600; color: var(--ink-3);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin-bottom: 14px;
  }
  .retrieved-head svg { color: oklch(0.45 0.12 150); }
  .retrieved-head .mono { font-family: "JetBrains Mono", monospace; text-transform: none; letter-spacing: 0; color: var(--ink-2); }
  .ro-field .ro-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .ro-field .ro-value {
    min-height: 44px; display: flex; align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); font-size: 15px; color: var(--ink);
  }
  .ro-field .ro-value.mono { font-family: "JetBrains Mono", monospace; font-size: 14px; }

  .field .err {
    color: var(--bad);
    font-size: 12px;
    margin-top: 6px;
    display: flex; align-items: center; gap: 5px;
  }
  .field .hint {
    color: var(--ink-3);
    font-size: 12px;
    margin-top: 6px;
  }

  .btn {
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--bg);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .08s, background .15s;
  }
  .btn:hover { background: var(--ink-hover); }
  .btn:active { transform: scale(0.99); }
  .btn:disabled { background: var(--ink-3); cursor: not-allowed; }
  .btn.secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-strong);
  }
  .btn.secondary:hover { background: var(--surface-2); }
  .btn.ghost {
    background: transparent;
    color: var(--ink-2);
    height: auto;
    width: auto;
    padding: 4px 0;
    font-weight: 500;
    font-size: 13px;
  }
  .btn.ghost:hover { color: var(--ink); }
  .btn.accent {
    background: var(--accent);
    color: var(--accent-ink);
  }
  .btn.accent:hover { background: var(--accent-hover); }

  .otp-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 18px;
  }
  .otp-row input {
    width: 100%;
    height: 56px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    font-family: "JetBrains Mono", monospace;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
  }
  .otp-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .otp-row input.filled {
    background: var(--surface-2);
    border-color: var(--line-strong);
  }

  .row-between {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
  }

  .login-note {
    margin-top: 18px;
    padding: 10px 12px;
    background: var(--info-soft);
    border: 1px dashed oklch(0.75 0.06 240);
    border-radius: 8px;
    font-size: 12px;
    color: var(--info);
    line-height: 1.5;
  }

  /* Registration */
  .reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .reg-grid .field { margin: 0; }
  .reg-grid .span-2 { grid-column: span 2; }

  select.title-input {
    height: 44px;
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0 12px;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    font-family: inherit;
  }
  select.title-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

  .verify-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 3px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: 1px;
  }
  .verify-chip.pending { background: var(--warn-soft); color: oklch(0.45 0.1 75); }
  .verify-chip.done { background: var(--good-soft); color: oklch(0.42 0.1 150); }
  .verify-chip.rejected { background: var(--bad-soft); color: var(--bad); }

  .verify-btn {
    height: 44px;
    padding: 0 14px;
    border: 0;
    background: var(--ink);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    border-bottom-right-radius: var(--radius);
    border-top-right-radius: var(--radius);
    border-left: 1px solid var(--line);
    white-space: nowrap;
  }
  .verify-btn:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
  .verify-btn.done { background: var(--good-soft); color: oklch(0.42 0.1 150); }

  .reg-wide-wrap {
    padding: 32px;
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
  }
  .reg-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-md);
  }

  /* Inline OTP modal */
  .modal-backdrop {
    position: fixed; inset: 0;
    background: oklch(0.2 0.02 250 / 0.5);
    display: grid; place-items: center;
    z-index: 50;
    padding: 24px;
    backdrop-filter: blur(4px);
  }
  .modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px oklch(0.1 0.05 250 / 0.25);
  }
  .modal h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
  .modal p { margin: 0 0 18px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
  .modal .modal-target {
    background: var(--surface-2);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0 20px;
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    color: var(--ink);
    display: flex; align-items: center; gap: 8px;
  }

  /* Approved-document PDF viewer modal — large so the browser's own built-in PDF
     toolbar (zoom in/out, page nav) is comfortably usable. */
  .doc-viewer-modal {
    max-width: 92vw;
    width: 92vw;
    height: 90vh;
    padding: 18px;
    display: flex;
    flex-direction: column;
  }
  .doc-viewer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-shrink: 0;
  }
  .doc-viewer-head h3 { margin: 0; }
  .doc-viewer-frame {
    flex: 1;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
  }
  .doc-viewer-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 10px;
    color: var(--ink-3);
  }

  /* Dashboard */
  .dash {
    display: grid;
    grid-template-columns: 280px 1fr;
    flex: 1;
    min-height: 0;
  }
  .dash-side {
    border-right: 1px solid var(--line);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .dash-side-head {
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--line);
  }
  .dash-side-head h3 {
    margin: 0 0 4px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
  }
  .dash-side-head .citizen-name {
    font-size: 15px; font-weight: 600;
    color: var(--ink);
  }
  .dash-side-search {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
  }
  .dash-side-search .input-wrap input { height: 38px; font-size: 13px; }
  .dash-side-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
  }
  .dash-side-section {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-3);
    padding: 14px 12px 6px;
  }
  .svc-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    margin: 1px 0;
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .12s;
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
    position: relative;
  }
  .svc-item:hover { background: var(--surface-2); color: var(--ink); }
  .svc-item.active {
    background: var(--ink);
    color: var(--bg);
  }
  .svc-item.active .svc-icon { color: var(--bg); }
  .svc-item.active .svc-count { color: oklch(0.85 0.01 250); background: oklch(1 0 0 / 0.1); }
  .svc-icon {
    width: 18px; height: 18px;
    color: var(--ink-3);
    flex-shrink: 0;
  }
  .svc-item:hover .svc-icon { color: var(--ink-2); }
  .svc-label { flex: 1; }
  .svc-count {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--ink-3);
    background: var(--surface-2);
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 500;
  }

  .dash-main {
    padding: 28px 36px;
    overflow-y: auto;
    background: var(--bg);
  }
  .dash-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 26px;
    gap: 24px;
  }
  .dash-head-left h1 {
    margin: 0 0 4px;
    font-size: 26px; font-weight: 700;
    letter-spacing: -0.015em;
  }
  .breadcrumb {
    font-size: 12px;
    color: var(--ink-3);
    margin-bottom: 6px;
    display: flex; align-items: center; gap: 6px;
  }
  .breadcrumb svg { width: 12px; height: 12px; }
  .dash-head-left p.sub {
    margin: 0;
    font-size: 13px;
    color: var(--ink-3);
  }
  .new-app-btn {
    height: 42px;
    padding: 0 16px;
    background: var(--ink);
    color: var(--bg);
    border: 0;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13.5px;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
  }
  .new-app-btn:hover { background: var(--ink-hover); }
  .new-app-btn svg { width: 16px; height: 16px; }

  /* stat table */
  .stat-table {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
  }
  .stat-table .stat-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center;
    background: var(--surface-2);
  }
  .stat-head h3 {
    margin: 0;
    font-size: 14px; font-weight: 600;
    letter-spacing: -0.005em;
  }
  .stat-head .updated {
    font-size: 11px;
    color: var(--ink-3);
    font-family: "JetBrains Mono", monospace;
  }
  .stat-row {
    display: grid;
    grid-template-columns: 38px 1fr auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
  }
  .stat-row:first-of-type { border-top: 0; }
  .stat-row:hover { background: var(--surface-2); }
  .stat-row .ic {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: grid; place-items: center;
    flex-shrink: 0;
  }
  .stat-row .ic svg { width: 17px; height: 17px; }
  .stat-row .lbl {
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
  }
  .stat-row .desc {
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 1px;
  }
  .stat-row .count {
    font-family: "JetBrains Mono", monospace;
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
    min-width: 56px;
    text-align: right;
    letter-spacing: -0.02em;
  }
  .stat-row .chev {
    color: var(--ink-3);
  }
  .stat-row .chev svg { width: 14px; height: 14px; }

  /* Clickable stat row */
  button.stat-row {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
  }
  button.stat-row:first-of-type { border-top: 0; }
  button.stat-row:hover { background: var(--surface-2); }
  button.stat-row:hover .chev { color: var(--ink); transform: translateX(2px); }
  button.stat-row .chev { transition: transform .15s, color .15s; }
  button.stat-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    background: var(--surface-2);
  }

  /* ---------- Per-category application list ---------- */
  .applist-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  .applist-head {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
  }
  .applist-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 10px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
  }
  .applist-back:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .applist-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
  }
  .applist-cat-pill svg { width: 13px; height: 13px; }
  .applist-cat-pill.new      { background: var(--info-soft); color: var(--info);                border-color: oklch(0.86 0.05 240); }
  .applist-cat-pill.approved { background: var(--good-soft); color: oklch(0.42 0.1 150);        border-color: oklch(0.85 0.07 150); }
  .applist-cat-pill.rejected { background: var(--bad-soft);  color: var(--bad);                 border-color: oklch(0.85 0.07 25); }
  .applist-cat-pill.pdoc     { background: var(--warn-soft); color: oklch(0.45 0.13 70);        border-color: oklch(0.85 0.07 70); }
  .applist-cat-pill.ppay     { background: var(--accent-soft); color: var(--accent);            border-color: oklch(0.86 0.05 256); }
  .applist-cat-pill.scrutiny { background: oklch(0.94 0.015 255); color: var(--ink-2);          border-color: var(--line-strong); }
  .applist-title {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
  }
  .applist-title .ttl { font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .applist-title .cnt { font-size: 11.5px; color: var(--ink-3); font-family: "JetBrains Mono", monospace; }
  .applist-search { min-width: 220px; }
  .applist-search .input-wrap input { height: 32px; font-size: 12.5px; }
  .applist-search .input-prefix { padding: 0 9px; }

  .applist-table-wrap { overflow-x: auto; }
  .applist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }
  .applist-table thead th {
    text-align: left;
    padding: 11px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .applist-table thead th.col-center { text-align: center; }
  .applist-table tbody td {
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    color: var(--ink-2);
    vertical-align: middle;
  }
  .applist-table tbody td.mono { font-family: "JetBrains Mono", monospace; font-size: 12.5px; color: var(--ink-2); }
  .applist-table tbody td.ink-strong { color: var(--ink); font-weight: 500; }
  .applist-table tbody td.col-center { text-align: center; }
  .applist-table tbody tr:hover td { background: var(--surface-2); }
  .applist-table tbody td .dash { color: var(--ink-3); }
  .applist-empty-row {
    text-align: center !important;
    padding: 36px 14px !important;
    color: var(--ink-3) !important;
    font-style: italic;
  }

  .row-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background .12s, color .12s, border-color .12s, transform .08s;
  }
  .row-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .row-btn:active { transform: scale(0.98); }
  .row-btn.ghost { background: transparent; }
  .row-btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
  .row-btn.neutral { background: var(--surface-2); }
  .row-btn.neutral:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
  .row-btn.good     { background: var(--good-soft); color: oklch(0.42 0.1 150); border-color: oklch(0.82 0.08 150); }
  .row-btn.good:hover { background: oklch(0.42 0.1 150); color: var(--bg); border-color: oklch(0.42 0.1 150); }
  .row-btn.bad      { background: var(--bad-soft); color: var(--bad); border-color: oklch(0.82 0.09 25); }
  .row-btn.bad:hover { background: var(--bad); color: var(--bg); border-color: var(--bad); }
  .row-btn.warn     { background: var(--warn-soft); color: oklch(0.45 0.13 70); border-color: oklch(0.82 0.09 70); }
  .row-btn.warn:hover { background: oklch(0.55 0.15 70); color: var(--bg); border-color: oklch(0.55 0.15 70); }
  .row-btn.accent   { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .row-btn.accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

  .row-pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--ink-3);
    font-style: italic;
  }
  .row-pending .pulse-dot {
    width: 7px; height: 7px;
    background: var(--info);
    border-radius: 50%;
    box-shadow: 0 0 0 0 oklch(0.5 0.13 240 / 0.6);
    animation: pulsePending 1.8s infinite;
  }
  @keyframes pulsePending {
    0%   { box-shadow: 0 0 0 0 oklch(0.5 0.13 240 / 0.55); }
    70%  { box-shadow: 0 0 0 6px oklch(0.5 0.13 240 / 0); }
    100% { box-shadow: 0 0 0 0 oklch(0.5 0.13 240 / 0); }
  }

  .applist-empty {
    padding: 48px 24px;
    text-align: center;
  }
  .applist-empty .empty-ic {
    width: 48px; height: 48px;
    margin: 0 auto 14px;
    border-radius: 12px;
    display: grid; place-items: center;
    background: var(--surface-2);
    color: var(--ink-3);
  }
  .applist-empty .empty-ic.new      { background: var(--info-soft); color: var(--info); }
  .applist-empty .empty-ic.approved { background: var(--good-soft); color: oklch(0.42 0.1 150); }
  .applist-empty .empty-ic.rejected { background: var(--bad-soft);  color: var(--bad); }
  .applist-empty .empty-ic.pdoc     { background: var(--warn-soft); color: oklch(0.45 0.13 70); }
  .applist-empty .empty-ic.ppay     { background: var(--accent-soft); color: var(--accent); }
  .applist-empty .empty-ic svg { width: 22px; height: 22px; }
  .applist-empty h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink); }
  .applist-empty p  { margin: 0; font-size: 13px; color: var(--ink-3); }

  /* ---------- Acknowledgement receipt overlay ---------- */
  .ack-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: oklch(0.93 0.015 255);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: ackFadeIn .18s ease;
  }
  @keyframes ackFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .ack-overlay .print-shell { flex: 1; }
  body.ack-active { overflow: hidden; }

  /* ---------- Acknowledgement modal ---------- */
  .ack-modal {
    background: var(--bg);
    border-radius: var(--radius-lg);
    width: min(680px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px oklch(0.2 0.08 258 / 0.32);
    position: relative;
    padding: 26px 28px 22px;
  }
  .ack-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink-2);
    display: grid; place-items: center;
    z-index: 2;
  }
  .ack-close:hover { background: var(--surface-2); color: var(--ink); }
  .ack-close svg { width: 14px; height: 14px; }

  .ack-paper {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 28px 30px;
    position: relative;
    overflow: hidden;
    background-image:
      linear-gradient(var(--surface), var(--surface)),
      repeating-linear-gradient(45deg, oklch(0.94 0.015 255) 0 1px, transparent 1px 14px);
    background-blend-mode: multiply;
  }
  .ack-watermark {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) rotate(-22deg);
    font-size: 64px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: oklch(0.93 0.02 258);
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
  }

  .ack-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1.5px solid var(--ink);
    margin-bottom: 18px;
    position: relative;
  }
  .ack-emblem {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--ink);
    display: grid; place-items: center;
    color: var(--ink);
    background: var(--surface);
  }
  .ack-emblem svg { width: 22px; height: 22px; }
  .ack-gov {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
  }
  .ack-dept {
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-top: 1px;
  }
  .ack-dept-sub {
    font-size: 10.5px;
    color: var(--ink-3);
    margin-top: 2px;
    letter-spacing: 0.01em;
  }
  .ack-stamp {
    align-self: flex-start;
    border: 2px solid var(--good);
    color: var(--good);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    transform: rotate(6deg);
    background: oklch(1 0 0 / 0.5);
  }

  .ack-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: var(--ink);
    position: relative;
  }
  .ack-intro {
    margin: 0 0 18px;
    text-align: center;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.5;
    position: relative;
  }
  .ack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 18px;
    position: relative;
  }
  .ack-cell {
    background: var(--surface);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  .ack-cell .k {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    font-weight: 600;
  }
  .ack-cell .v {
    font-size: 13px;
    color: var(--ink);
    font-weight: 500;
  }
  .ack-cell .v.mono { font-family: "JetBrains Mono", monospace; font-size: 12.5px; }

  .ack-foot {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 14px 0 0;
    border-top: 1px dashed var(--line-strong);
    position: relative;
  }
  .ack-foot-k {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    font-weight: 600;
  }
  .ack-foot-v {
    font-size: 12.5px;
    color: var(--ink);
    margin-top: 2px;
  }
  .ack-qr { text-align: center; }
  .qr-art {
    width: 70px; height: 70px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 1px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--ink);
    border-radius: 4px;
  }
  .qr-art span { display: block; }
  .ack-note {
    margin-top: 14px;
    font-size: 11px;
    color: var(--ink-3);
    line-height: 1.55;
    text-align: center;
    position: relative;
  }
  .ack-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
  }
  .ack-actions .btn { height: 38px; width: auto; padding: 0 18px; font-size: 13px; }
  .ack-actions .btn.secondary { padding: 0 16px; }

  @media (max-width: 720px) {
    .applist-head {
      grid-template-columns: auto 1fr;
      grid-template-rows: auto auto auto;
    }
    .applist-cat-pill { grid-column: 2; }
    .applist-title { grid-column: 1 / -1; }
    .applist-search { grid-column: 1 / -1; min-width: 0; }
    .ack-grid { grid-template-columns: 1fr; }
    .ack-modal { padding: 16px; }
    .ack-paper { padding: 18px 16px; }
    .ack-watermark { font-size: 44px; }
    .ack-header { grid-template-columns: auto 1fr; }
    .ack-stamp { grid-column: 2; justify-self: end; }
  }

  .ic.new { background: var(--info-soft); color: var(--info); }
  .ic.approved { background: var(--good-soft); color: oklch(0.45 0.12 150); }
  .ic.rejected { background: var(--bad-soft); color: var(--bad); }
  .ic.pdoc { background: var(--warn-soft); color: oklch(0.5 0.12 75); }
  .ic.ppay { background: oklch(0.95 0.04 320); color: oklch(0.5 0.12 320); }
  .ic.scrutiny { background: oklch(0.95 0.025 200); color: oklch(0.45 0.1 200); }

  /* meta cards in dash */
  .meta-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
  }
  .meta-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
  }
  .meta-card .k {
    font-size: 11px; font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }
  .meta-card .v {
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    color: var(--ink);
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  .empty-state {
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 60px 24px;
    text-align: center;
  }
  .empty-state .ic {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--surface-2);
    display: grid; place-items: center;
    margin: 0 auto 14px;
    color: var(--ink-3);
  }
  .empty-state h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
  .empty-state p { margin: 0; font-size: 13px; color: var(--ink-3); }

  /* misc */
  .resend-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin: 4px 0 18px;
    font-size: 13px;
    color: var(--ink-3);
  }
  .resend-bar button { font-size: 13px; }
  .timer { font-family: "JetBrains Mono", monospace; font-weight: 500; }

  .change-link {
    background: transparent; border: 0;
    color: var(--accent);
    font-weight: 500; font-size: 13px;
    padding: 4px 0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  /* Mobile drawer toggle (hidden on desktop) */
  .nav-toggle {
    display: none;
    width: 36px; height: 36px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: 8px;
    align-items: center; justify-content: center;
    color: var(--ink-2);
    flex-shrink: 0;
  }
  .nav-toggle svg { width: 16px; height: 16px; }
  .nav-toggle:hover { background: var(--surface-2); }
  .drawer-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: oklch(0.2 0.02 250 / 0.4);
    z-index: 40;
    backdrop-filter: blur(2px);
  }

  /* ---------- Dashboard tabs ---------- */
  .dash-tabs {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    box-shadow: var(--shadow-sm);
  }
  .dash-tabs::-webkit-scrollbar { display: none; }
  .dash-tab {
    background: transparent;
    border: 0;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    white-space: nowrap;
    transition: background .15s, color .15s;
    letter-spacing: -0.005em;
  }
  .dash-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
  .dash-tab:hover {
    color: var(--ink);
    background: var(--surface-2);
  }
  .dash-tab .tab-count {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    background: var(--surface-2);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid var(--line);
    line-height: 1.4;
    letter-spacing: -0.01em;
  }
  .dash-tab .tab-count.alert {
    color: oklch(0.5 0.14 70);
    background: var(--warn-soft);
    border-color: oklch(0.85 0.07 70);
  }
  .dash-tab.active {
    color: var(--bg);
    background: var(--ink);
    font-weight: 600;
  }
  .dash-tab.active:hover {
    background: var(--ink-hover);
    color: var(--bg);
  }
  .dash-tab.active .tab-count {
    color: var(--bg);
    background: oklch(1 0 0 / 0.12);
    border-color: oklch(1 0 0 / 0.18);
  }
  .dash-tab.active .tab-count.alert {
    color: oklch(0.96 0.06 75);
    background: oklch(1 0 0 / 0.14);
    border-color: oklch(1 0 0 / 0.22);
  }

  .tab-panel { display: none; }
  .tab-panel.active { display: block; animation: tabFadeIn .22s ease; }
  @keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .tab-label-short { display: none; }

  @media (max-width: 1180px) {
    .dash-tab { padding: 8px 12px; font-size: 13px; }
    .dash-tab .tab-label-long { display: none; }
    .tab-label-short { display: inline; }
  }
  @media (max-width: 880px) {
    .dash-tab { padding: 8px 11px; font-size: 12.5px; }
  }

  /* ---------- Track Your Application ---------- */
  .track-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    overflow: hidden;
  }
  .track-head {
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px;
  }
  .track-head h3 {
    margin: 0;
    font-size: 14px; font-weight: 600;
    letter-spacing: -0.005em;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .track-head h3 .pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .track-head .helper {
    font-size: 11px; color: var(--ink-3);
    font-family: "JetBrains Mono", monospace;
  }
  .track-body { padding: 18px 20px; }
  .track-search {
    display: flex; gap: 10px;
    margin-bottom: 12px;
  }
  .track-search .input-wrap { flex: 1; }
  .track-search .input-wrap input { height: 42px; font-family: "JetBrains Mono", monospace; font-size: 13.5px; letter-spacing: -0.01em; }
  .track-search .input-prefix { font-family: "JetBrains Mono", monospace; font-size: 12px; }
  .track-btn {
    height: 42px; padding: 0 18px;
    background: var(--accent);
    color: var(--accent-ink);
    border: 0;
    border-radius: var(--radius);
    font-weight: 600; font-size: 13.5px;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
  }
  .track-btn:hover { background: var(--accent-hover); }
  .track-recent {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    font-size: 12px; color: var(--ink-3);
  }
  .track-recent .lbl {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 2px;
  }
  .track-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: 999px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11.5px;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
    font-weight: 500;
  }
  .track-chip:hover { background: var(--surface-2); color: var(--ink); }
  .track-chip.active {
    background: var(--accent-soft); border-color: var(--accent); color: var(--accent);
  }
  .track-chip .chip-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3);
  }
  .track-chip .chip-dot.in-progress { background: var(--accent); }
  .track-chip .chip-dot.action { background: var(--warn); }
  .track-chip .chip-dot.done { background: var(--good); }

  .track-detail {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
  }
  .track-meta {
    display: flex; flex-wrap: wrap;
    gap: 16px 28px;
    margin-bottom: 22px;
  }
  .track-meta .pair { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .track-meta .pair .k {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-3);
  }
  .track-meta .pair .v {
    font-size: 13.5px; color: var(--ink);
    font-weight: 500;
    letter-spacing: -0.005em;
  }
  .track-meta .pair .v.mono {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
  }
  .track-meta .pair.status .v {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 600;
  }
  .track-meta .pair.status .v::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
  }
  .track-meta .pair.status.action .v::before { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
  .track-meta .pair.status.done .v::before { background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }

  .track-stages {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    position: relative;
    margin: 6px 0 22px;
  }
  .track-stage {
    display: flex; flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 0 4px;
    min-width: 0;
  }
  .track-stage:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 13px; left: calc(50% + 16px);
    right: calc(-50% + 16px);
    height: 2px;
    background: var(--line-strong);
    z-index: 0;
  }
  .track-stage.done:not(:last-child)::after { background: var(--good); }
  .track-stage .dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--line-strong);
    display: grid; place-items: center;
    position: relative; z-index: 1;
    margin-bottom: 10px;
    color: var(--ink-3);
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
  }
  .track-stage .dot svg { width: 12px; height: 12px; }
  .track-stage.done .dot {
    background: var(--good); border-color: var(--good);
    color: white;
  }
  .track-stage.current .dot {
    background: var(--accent); border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-soft);
  }
  .track-stage.action .dot {
    background: var(--warn); border-color: var(--warn);
    color: white;
    box-shadow: 0 0 0 4px var(--warn-soft);
  }
  .track-stage .stage-text { min-width: 0; }
  .track-stage .stage-label {
    font-size: 12px; font-weight: 600;
    color: var(--ink-3);
    margin-bottom: 3px;
    line-height: 1.25;
    letter-spacing: -0.005em;
  }
  .track-stage.done .stage-label,
  .track-stage.current .stage-label,
  .track-stage.action .stage-label { color: var(--ink); }
  .track-stage .stage-date {
    font-size: 10.5px; color: var(--ink-3);
    font-family: "JetBrains Mono", monospace;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }
  .track-stage .stage-office {
    font-size: 10.5px;
    color: var(--ink-3);
    margin-top: 2px;
    line-height: 1.3;
  }

  .track-next {
    background: var(--accent-soft);
    border: 1px solid oklch(0.82 0.06 256);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex; gap: 12px; align-items: flex-start;
  }
  .track-next.action {
    background: var(--warn-soft);
    border-color: oklch(0.82 0.08 70);
  }
  .track-next.done {
    background: var(--good-soft);
    border-color: oklch(0.78 0.08 155);
  }
  .track-next .next-ic {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: white;
    display: grid; place-items: center;
    color: var(--accent);
  }
  .track-next.action .next-ic { color: oklch(0.5 0.13 70); }
  .track-next.done .next-ic { color: oklch(0.45 0.12 155); }
  .track-next .copy h5 {
    margin: 0 0 2px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--accent);
  }
  .track-next.action .copy h5 { color: oklch(0.45 0.13 70); }
  .track-next.done .copy h5 { color: oklch(0.4 0.12 155); }
  .track-next .copy p { margin: 0; font-size: 13px; color: var(--ink); line-height: 1.45; }
  .track-next .copy .next-cta {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 8px;
    background: white;
    border: 1px solid oklch(0.78 0.08 256);
    color: var(--accent);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
  }
  .track-next.action .copy .next-cta { border-color: oklch(0.78 0.1 70); color: oklch(0.45 0.13 70); }
  .track-next.done .copy .next-cta { border-color: oklch(0.7 0.1 155); color: oklch(0.4 0.12 155); }
  .track-next .copy .next-cta:hover { background: var(--surface-2); }

  .track-sla {
    display: flex; align-items: center; gap: 12px;
    margin-top: 14px;
    font-size: 11.5px;
    color: var(--ink-3);
  }
  .track-sla .sla-lbl {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    color: var(--ink-3);
  }
  .track-sla .bar {
    flex: 1; height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--line);
  }
  .track-sla .bar > span {
    display: block; height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width .4s ease;
  }
  .track-sla.warn .bar > span { background: var(--warn); }
  .track-sla.over .bar > span { background: var(--bad); }
  .track-sla .sla-text {
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-2);
    font-weight: 500;
  }
  .track-sla.over .sla-text { color: var(--bad); }
  .track-sla.warn .sla-text { color: oklch(0.45 0.13 70); }

  .track-empty {
    padding: 22px 18px;
    text-align: center;
    color: var(--ink-3);
    font-size: 13px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    margin-top: 14px;
  }
  .track-empty .empty-ic {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--surface-2);
    display: grid; place-items: center;
    margin: 0 auto 8px;
    color: var(--ink-3);
  }

  /* Roll-out animation for inline details */
  .track-rollout {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .42s cubic-bezier(.32, .72, .25, 1);
  }
  .track-rollout.open { grid-template-rows: 1fr; }
  .track-rollout > .rollout-inner {
    overflow: hidden;
    min-height: 0;
  }
  .track-rollout .track-detail {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .25s ease .12s, transform .32s ease .12s;
  }
  .track-rollout.open .track-detail {
    opacity: 1;
    transform: translateY(0);
  }
  .track-detail-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
    gap: 12px;
  }
  .track-detail-head .arn-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink);
    color: var(--bg);
    padding: 6px 12px;
    border-radius: 999px;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .track-detail-head .arn-pill .pill-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: oklch(0.78 0.04 256);
  }
  .track-detail-head .collapse-btn {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-2);
    border-radius: 8px;
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer;
    font-family: inherit;
  }
  .track-detail-head .collapse-btn:hover { background: var(--surface-2); color: var(--ink); }
  .track-detail-head .collapse-btn svg { width: 12px; height: 12px; }

  @media (max-width: 880px) {
    .track-search { flex-direction: column; }
    .track-btn { width: 100%; justify-content: center; }
    .track-stages { grid-template-columns: 1fr; gap: 14px; }
    .track-stage { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; padding: 0; }
    .track-stage:not(:last-child)::after {
      top: 28px; left: 13px; right: auto;
      width: 2px; height: calc(100% - 16px);
    }
    .track-stage .dot { margin-bottom: 0; }
    .track-stage .stage-text { flex: 1; padding-top: 4px; }
    .track-meta { gap: 14px 20px; }
  }

  /* ---------- Appeals & Grievances ---------- */
  .appeals-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-top: 22px;
  }
  .appeals-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    display: flex; justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
  }
  .appeals-head > div { flex: 1; min-width: 0; }
  .appeals-head h3 {
    margin: 0 0 4px;
    font-size: 14px; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    letter-spacing: -0.005em;
    color: var(--ink);
  }
  .appeals-head p {
    margin: 0;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.5;
    max-width: 640px;
  }
  .appeals-toggle {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
    flex-shrink: 0;
    transition: background .12s, color .12s;
  }
  .appeals-toggle:hover { background: var(--accent); color: var(--accent-ink); }
  .appeals-toggle.open {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink-2);
  }
  .appeals-toggle.open:hover { background: var(--surface-2); color: var(--ink); }

  .appeals-body { padding: 18px 20px 20px; }
  .appeals-section-label {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
    margin-bottom: 10px;
  }
  .appeals-list {
    display: flex; flex-direction: column;
    gap: 10px;
  }
  .appeal-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: var(--surface);
    border-left: 3px solid var(--accent);
  }
  .appeal-item.done { border-left-color: var(--good); }
  .appeal-item.action { border-left-color: var(--warn); }
  .appeal-item-head {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
  }
  .appeal-level {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 4px 9px;
    border-radius: 4px;
  }
  .appeal-level-2 {
    background: oklch(0.94 0.05 290);
    color: oklch(0.42 0.16 290);
  }
  .appeal-id {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
  }
  .appeal-status {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-2);
  }
  .appeal-status .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
  }
  .appeal-status-done .dot { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
  .appeal-status-action .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
  .appeal-against {
    font-size: 13px; color: var(--ink-2);
    margin-bottom: 4px;
    line-height: 1.4;
  }
  .appeal-meta {
    font-size: 11.5px;
    color: var(--ink-3);
    font-family: "JetBrains Mono", monospace;
    display: flex; gap: 6px;
    flex-wrap: wrap;
    letter-spacing: -0.005em;
  }
  .appeal-note {
    margin-top: 10px;
    padding: 9px 12px;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: 12.5px;
    color: var(--ink-2);
    line-height: 1.5;
    border-left: 2px solid var(--line-strong);
  }

  /* Form rollout */
  .appeals-rollout {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .42s cubic-bezier(.32, .72, .25, 1);
  }
  .appeals-rollout.open { grid-template-rows: 1fr; }
  .appeals-rollout > .rollout-inner { overflow: hidden; min-height: 0; }
  .appeal-form {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: var(--surface-2);
    margin-top: 14px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .28s ease .14s, transform .32s ease .14s;
  }
  .appeals-rollout.open .appeal-form { opacity: 1; transform: translateY(0); }
  .appeal-form h4 {
    margin: 0 0 4px;
    font-size: 15px; font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--ink);
  }
  .appeal-form-sub {
    margin: 0 0 18px;
    font-size: 12.5px;
    color: var(--ink-3);
    line-height: 1.5;
  }
  .appeal-form-sub strong { color: var(--ink-2); font-weight: 600; }

  .appeal-field { margin-bottom: 16px; }
  .appeal-field > label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .appeal-field .hint {
    font-size: 11.5px;
    color: var(--ink-3);
    margin-top: 6px;
    line-height: 1.4;
  }
  .appeal-radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .appeal-radio {
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 12px 14px;
    cursor: pointer;
    background: var(--surface);
    display: flex; flex-direction: column;
    gap: 3px;
    transition: border-color .12s, background .12s;
    position: relative;
  }
  .appeal-radio input { position: absolute; opacity: 0; pointer-events: none; }
  .appeal-radio .title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: flex; align-items: center; gap: 8px;
  }
  .appeal-radio .title::before {
    content: "";
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--surface);
    flex-shrink: 0;
    transition: border-color .12s, background .12s;
  }
  .appeal-radio .sub {
    font-size: 11.5px;
    color: var(--ink-3);
    line-height: 1.3;
    padding-left: 22px;
  }
  .appeal-radio.active {
    border-color: var(--accent);
    background: var(--accent-soft);
  }
  .appeal-radio.active .title { color: var(--accent); }
  .appeal-radio.active .title::before {
    border-color: var(--accent);
    background: radial-gradient(circle, var(--accent) 0 4px, var(--surface) 4.5px);
  }

  .appeal-fee-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
  }
  .appeal-fee-strip > div {
    background: var(--surface);
    padding: 12px 14px;
  }
  .appeal-fee-strip .k {
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-3);
    margin-bottom: 3px;
  }
  .appeal-fee-strip .v {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    font-family: "JetBrains Mono", monospace;
    letter-spacing: -0.01em;
  }

  .appeal-form-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 4px;
  }

  .appeal-success {
    text-align: center;
    padding: 32px 22px;
    border: 1px solid oklch(0.78 0.08 155);
    background: var(--good-soft);
    border-radius: var(--radius);
    margin-top: 14px;
  }
  .appeal-success .check {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--good);
    color: white;
    margin: 0 auto 14px;
    display: grid; place-items: center;
  }
  .appeal-success h4 {
    margin: 0 0 6px;
    font-size: 16px; font-weight: 700;
    color: oklch(0.4 0.12 155);
  }
  .appeal-success p {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.5;
  }
  .appeal-success-id {
    display: inline-block;
    background: white;
    border: 1px solid oklch(0.7 0.08 155);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: oklch(0.4 0.12 155);
    font-weight: 600;
    font-family: "JetBrains Mono", monospace;
  }

  @media (max-width: 880px) {
    .appeals-head { flex-direction: column; align-items: stretch; }
    .appeals-toggle { width: 100%; justify-content: center; }
    .appeal-radio-group { grid-template-columns: 1fr; }
    .appeal-status { margin-left: 0; }
    .appeal-fee-strip { grid-template-columns: 1fr; }
    .appeal-form-foot { flex-direction: column-reverse; }
    .appeal-form-foot .btn { width: 100% !important; }
  }

  /* ---------- New Application wizard ---------- */
  .wiz {
    flex: 1;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .wiz-info {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--ink);
    color: var(--bg);
    padding: 14px 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 22px 32px;
    align-items: center;
    border-bottom: 1px solid oklch(0 0 0);
  }
  .wiz-info .pair { display: flex; flex-direction: column; gap: 2px; }
  .wiz-info .pair .k {
    font-size: 10px; font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: oklch(0.72 0.015 250);
  }
  .wiz-info .pair .v {
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    color: var(--bg);
    font-weight: 500;
    letter-spacing: -0.01em;
  }
  .wiz-info .spacer { flex: 1; min-width: 16px; }
  .wiz-info .pill {
    background: oklch(1 0 0 / 0.08);
    border: 1px solid oklch(1 0 0 / 0.16);
    color: var(--bg);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: inline-flex; align-items: center; gap: 6px;
  }
  .wiz-info .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: oklch(0.75 0.15 80); }

  .wiz-shell {
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 36px 60px;
  }

  /* Two-column wizard: main form + sticky proforma rail */
  .wiz-shell.with-aside {
    max-width: 1280px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 312px;
    gap: 34px;
    align-items: start;
  }
  .wiz-main { min-width: 0; }
  .wiz-aside { min-width: 0; position: sticky; top: 24px; }

  /* ---------- Proforma download panel ---------- */
  .proforma-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
  }
  .proforma-panel.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-md);
  }
  .proforma-head {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border-bottom: 1px solid var(--line);
  }
  .proforma-head .proforma-ic {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
  }
  .proforma-head .ph-text { min-width: 0; }
  .proforma-head h3 {
    margin: 0;
    font-size: 14px; font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
    display: flex; align-items: center; gap: 8px;
  }
  .proforma-head h3 .pf-badge {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px; font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid oklch(0.86 0.05 256);
    border-radius: 999px;
    min-width: 19px; height: 19px;
    padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    letter-spacing: 0;
  }
  .proforma-head .ph-mr {
    margin: 2px 0 0;
    font-size: 11px; font-style: italic;
    color: var(--ink-3);
  }

  /* contextual cue shown on the Documents step */
  .pf-cue {
    display: flex; gap: 7px; align-items: center;
    margin: 12px 14px 0;
    padding: 8px 11px;
    background: var(--accent-soft);
    border: 1px solid oklch(0.86 0.05 256);
    border-radius: 8px;
    font-size: 11.5px;
    color: var(--accent);
    line-height: 1.35;
  }
  .pf-cue svg { flex-shrink: 0; }
  .pf-cue b { font-weight: 700; }

  /* 3-step process */
  .pf-steps {
    list-style: none;
    margin: 13px 14px;
    padding: 11px 13px;
    background: var(--surface-2);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    display: flex; flex-direction: column; gap: 9px;
    counter-reset: pf;
  }
  .pf-steps li {
    display: flex; align-items: center; gap: 9px;
    font-size: 11.5px; color: var(--ink-2);
    line-height: 1.3;
    position: relative;
  }
  .pf-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 9px; top: 19px; height: 9px;
    width: 1.5px;
    background: var(--line-strong);
  }
  .pf-steps .pf-step-n {
    flex-shrink: 0;
    width: 19px; height: 19px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 10.5px; font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    display: grid; place-items: center;
    z-index: 1;
  }
  .pf-steps .pf-step-t b { color: var(--ink); font-weight: 600; }

  .proforma-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 0 14px;
  }
  .proforma-item {
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .15s, background .15s;
  }
  .proforma-item.is-downloaded {
    border-left-color: var(--good);
    background: oklch(0.99 0.012 155);
  }
  .proforma-item .pf-top {
    display: flex; gap: 10px; align-items: flex-start;
  }
  .proforma-item .pf-file-ic {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 7px;
    display: grid; place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--ink-2);
    transition: background .15s, color .15s, border-color .15s;
  }
  .proforma-item.is-downloaded .pf-file-ic {
    background: var(--good-soft);
    border-color: oklch(0.82 0.08 155);
    color: oklch(0.45 0.12 155);
  }
  .proforma-item .pf-text { min-width: 0; padding-top: 1px; }
  .pf-title { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
  .pf-sub   { font-size: 10.5px; color: var(--ink-3); font-style: italic; margin-top: 2px; line-height: 1.3; }
  .pf-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px dashed var(--line);
  }
  .pf-meta  {
    flex: 1;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px; color: var(--ink-3);
    letter-spacing: -0.01em;
    line-height: 1.4;
    min-width: 0;
  }
  .pf-dl {
    flex-shrink: 0;
    height: 28px;
    padding: 0 11px;
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--accent);
    font-family: inherit;
    font-size: 11.5px; font-weight: 600;
    cursor: pointer;
    transition: background .14s, color .14s, border-color .14s, transform .08s;
  }
  .pf-dl:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .pf-dl:active { transform: scale(0.97); }
  .pf-dl.done {
    color: oklch(0.45 0.12 155);
    border-color: oklch(0.82 0.08 155);
    background: var(--good-soft);
  }
  .pf-dl.done:hover { background: oklch(0.45 0.12 155); color: var(--bg); border-color: oklch(0.45 0.12 155); }

  .pf-dl-all {
    margin: 12px 14px;
    width: calc(100% - 28px);
    height: 36px;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    font-family: inherit;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    transition: background .14s, transform .08s;
  }
  .pf-dl-all:hover { background: var(--ink-hover); }
  .pf-dl-all:active { transform: scale(0.99); }
  .pf-dl-all.done { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
  .pf-dl-all.done:hover { background: var(--surface-2); }

  .proforma-foot {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px 16px 14px;
    border-top: 1px dashed var(--line);
    background: var(--surface-2);
    font-size: 10.5px;
    line-height: 1.45;
    color: var(--ink-3);
  }
  .proforma-foot svg { flex-shrink: 0; margin-top: 1px; color: var(--ink-3); }

  @media (max-width: 1080px) {
    .wiz-shell.with-aside {
      grid-template-columns: 1fr;
      max-width: 920px;
      gap: 20px;
    }
    .wiz-aside { position: static; }
  }

  /* Proforma panel when stacked below the wizard on narrow screens */
  @media (max-width: 720px) {
    .wiz-aside {
      margin-top: 4px;
    }
    .proforma-head {
      padding: 12px 14px;
    }
    .proforma-head h3 {
      font-size: 13px;
    }
    .proforma-panel .pf-steps {
      margin: 10px 12px;
      padding: 9px 11px;
    }
    .proforma-list {
      padding: 0 12px;
    }
    .proforma-item {
      padding: 10px 11px;
    }
    .pf-dl-all {
      margin: 10px 12px;
      width: calc(100% - 24px);
    }
    .proforma-foot {
      padding: 10px 14px 12px;
    }
  }
  .wiz-head { margin-bottom: 22px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
  .wiz-head h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -0.015em; }
  .wiz-head .breadcrumb { margin-bottom: 4px; }

  .stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-sm);
  }
  .step-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    color: var(--ink-3);
    font-family: inherit;
    transition: background .12s, color .12s;
  }
  .step-chip:hover { background: var(--surface-2); color: var(--ink-2); }
  .step-chip.active {
    background: var(--ink);
    color: var(--bg);
  }
  .step-chip.done { color: var(--ink-2); }
  .step-chip .step-num {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    flex-shrink: 0;
    font-family: "JetBrains Mono", monospace;
  }
  .step-chip.active .step-num { background: var(--bg); color: var(--ink); border-color: var(--bg); }
  .step-chip.done .step-num { background: var(--good); color: white; border-color: var(--good); }
  .step-chip .step-label { font-size: 13px; font-weight: 500; line-height: 1.2; }
  .step-chip .step-label small { display: block; font-size: 11px; font-weight: 400; opacity: 0.7; margin-top: 1px; font-style: italic; }

  .wiz-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 30px 32px;
    box-shadow: var(--shadow-sm);
  }
  .wiz-card h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
  .wiz-card h2 .mr { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 8px; font-style: italic; }
  .wiz-card p.sub { margin: 0 0 22px; color: var(--ink-3); font-size: 13px; }

  .field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .field-grid-2 > .field { margin: 0; }

  .applicant-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: var(--surface-2);
    margin-bottom: 14px;
    overflow: hidden;
  }
  .applicant-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
  }
  .applicant-card-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    display: flex; align-items: center; gap: 8px;
  }
  .applicant-card-head h4 .num {
    width: 22px; height: 22px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11px;
    font-family: "JetBrains Mono", monospace;
  }
  .remove-btn {
    background: transparent;
    border: 0;
    color: var(--bad);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
  }
  .remove-btn:hover { background: var(--bad-soft); }
  .add-applicant {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
  }
  .add-applicant:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-3); }

  /* ---------- Applicants Details — enhanced ---------- */
  .applicants-summary {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
    margin: -8px 0 18px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 12.5px;
    color: var(--ink-2);
  }
  .applicants-summary .as-ic {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid; place-items: center;
  }
  .applicants-summary .as-ic svg { width: 15px; height: 15px; }
  .applicants-summary strong { color: var(--ink); font-weight: 600; }
  .applicants-summary .as-sep { width: 1px; height: 16px; background: var(--line-strong); }
  .applicants-summary .as-prog {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 11.5px; color: var(--ink-3);
  }
  .applicants-summary .as-prog .bar {
    width: 84px; height: 6px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    overflow: hidden;
  }
  .applicants-summary .as-prog .bar > span {
    display: block; height: 100%; border-radius: 999px;
    background: var(--good); transition: width .35s ease;
  }

  .applicant-card { transition: border-color .15s, box-shadow .15s, background .15s; position: relative; }
  .applicant-card.is-primary {
    border-color: oklch(0.82 0.06 256);
    background: var(--surface);
    box-shadow: 0 0 0 1px var(--accent-soft) inset;
  }
  .applicant-card.is-complete .app-avatar { background: var(--good); }
  .applicant-card-head { gap: 12px; }
  .app-head-id {
    display: flex; align-items: center; gap: 11px;
    min-width: 0; flex: 1;
  }
  .app-avatar {
    width: 38px; height: 38px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    display: grid; place-items: center;
    font-size: 14px; font-weight: 700;
    letter-spacing: 0.01em;
    transition: background .2s;
  }
  .applicant-card.is-primary .app-avatar { background: var(--accent); }
  .app-avatar.has-initials { font-family: "Public Sans", system-ui, sans-serif; }
  .app-avatar.num { font-family: "JetBrains Mono", monospace; font-size: 13px; font-weight: 600; }
  .app-headline { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .app-headline .app-name {
    font-size: 14px; font-weight: 600; color: var(--ink);
    letter-spacing: -0.005em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.2;
  }
  .app-headline .app-name.placeholder { color: var(--ink-3); font-weight: 500; font-style: italic; }
  .app-headline .app-tags { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
  .app-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 2px 7px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
  }
  .app-badge svg { width: 10px; height: 10px; }
  .app-status {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600;
    padding: 2px 8px 2px 6px; border-radius: 999px;
  }
  .app-status svg { width: 12px; height: 12px; }
  .app-status.complete { background: var(--good-soft); color: oklch(0.42 0.1 150); }
  .app-status.pending  { background: var(--warn-soft);  color: oklch(0.46 0.13 70); }
  .app-status .dotc { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.85; }

  .applicant-fields { display: flex; flex-direction: column; gap: 16px; }
  .name-grid {
    display: grid;
    grid-template-columns: 116px repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
  }
  .name-grid > .field { margin: 0; min-width: 0; }
  .field label .opt-inline { color: var(--ink-3); font-weight: 400; font-style: italic; }
  .field label .req-star { color: var(--bad); margin-left: 3px; font-weight: 700; }
  @media (max-width: 760px) {
    .name-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 480px) {
    .name-grid { grid-template-columns: 1fr; }
  }

  textarea.text-input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 10px 12px;
    font-size: 14px;
    color: var(--ink);
    font-family: inherit;
    outline: none;
    min-height: 70px;
    resize: vertical;
  }
  textarea.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

  .doc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .doc-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    transition: border-color .12s;
  }
  .doc-row.attached { border-color: var(--good); background: var(--good-soft); }
  .doc-row .doc-ic {
    width: 36px; height: 36px;
    background: var(--surface-2);
    border-radius: 8px;
    display: grid; place-items: center;
    color: var(--ink-2);
  }
  .doc-row.attached .doc-ic { background: white; color: oklch(0.45 0.12 150); }
  .doc-row .doc-lbl { font-size: 14px; font-weight: 500; color: var(--ink); }
  .doc-row .doc-lbl .mr { font-size: 12px; font-style: italic; color: var(--ink-3); margin-left: 6px; }
  .doc-row .doc-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-family: "JetBrains Mono", monospace; }
  .doc-row.attached .doc-meta { color: oklch(0.42 0.1 150); }
  .doc-upload-btn {
    height: 36px;
    padding: 0 14px;
    background: var(--ink);
    color: var(--bg);
    border: 0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit;
  }
  .doc-upload-btn:hover { background: var(--ink-hover); }
  .doc-upload-btn.secondary {
    background: white;
    color: oklch(0.42 0.1 150);
    border: 1px solid oklch(0.7 0.08 150);
  }
  .doc-upload-btn.secondary:hover { background: oklch(0.96 0.04 150); }
  .doc-row input[type=file] { display: none; }

  .preview-section {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .preview-section-head {
    background: var(--surface-2);
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-2);
    display: flex; justify-content: space-between; align-items: center;
  }
  .preview-section-head .edit-link {
    font-size: 11px;
    color: var(--accent);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
  }
  .preview-section-body { padding: 14px 16px; background: var(--surface); }
  .preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
  .preview-grid .k {
    font-size: 11px; font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .preview-grid .v {
    font-size: 14px;
    color: var(--ink);
    margin-top: 2px;
  }

  .pay-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 6px;
  }
  .pay-table th, .pay-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
  }
  .pay-table th {
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-2);
  }
  .pay-table th:first-child { border-top-left-radius: var(--radius); }
  .pay-table th:last-child { border-top-right-radius: var(--radius); }
  .pay-table tr:last-child td { border-bottom: 0; }
  .pay-table .amount { font-family: "JetBrains Mono", monospace; text-align: right; font-weight: 500; }
  .pay-table .sr { font-family: "JetBrains Mono", monospace; color: var(--ink-3); width: 60px; }
  .pay-total {
    margin-top: 14px;
    padding: 14px 16px;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius);
    display: flex; justify-content: space-between; align-items: center;
  }
  .pay-total .lbl { font-size: 13px; opacity: 0.85; }
  .pay-total .amt { font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

  /* ---------- Gunthewari: input suffix ---------- */
  .input-suffix {
    display: flex; align-items: center;
    padding: 0 12px;
    background: var(--surface-2);
    border-left: 1px solid var(--line);
    font-size: 13px;
    color: var(--ink-3);
    font-weight: 500;
    white-space: nowrap;
  }

  /* ---------- Gunthewari: 3-col grid + form sections ---------- */
  .field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .field-grid-3 > .field { margin: 0; }

  .form-section { margin-bottom: 28px; }
  .form-section:last-child { margin-bottom: 0; }
  .section-label {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ink-3);
    margin: 0 0 15px;
  }
  .section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
  .section-label .sec-num {
    display: grid; place-items: center;
    width: 20px; height: 20px; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--line);
    font-size: 10.5px; color: var(--ink-2);
    font-family: "JetBrains Mono", monospace; font-weight: 600;
  }

  /* ---------- Gunthewari: Yes / No choice cards ---------- */
  .yn-question { margin-bottom: 16px; }
  .yn-question:last-child { margin-bottom: 0; }
  .yn-question > .yn-label {
    display: block;
    font-size: 13px; font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 9px;
  }
  .yn-question > .yn-label .mr-i { color: var(--ink-3); font-style: italic; font-weight: 400; }
  .choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .choice-card {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 15px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: border-color .12s, background .12s, box-shadow .12s;
  }
  .choice-card input { position: absolute; opacity: 0; pointer-events: none; }
  .choice-card .cc-ic {
    width: 32px; height: 32px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--surface-2); color: var(--ink-3);
    flex-shrink: 0;
    transition: background .12s, color .12s;
  }
  .choice-card .cc-ic svg { width: 18px; height: 18px; }
  .choice-card .cc-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
  .choice-card .cc-txt b { font-size: 14px; font-weight: 600; color: var(--ink); }
  .choice-card .cc-txt span { font-size: 11.5px; color: var(--ink-3); }
  .choice-card .cc-radio {
    margin-left: auto;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--line-strong);
    background: var(--surface);
    display: grid; place-items: center;
    flex-shrink: 0;
    transition: border-color .12s, background .12s;
  }
  .choice-card .cc-radio svg { width: 11px; height: 11px; color: var(--accent-ink); opacity: 0; transition: opacity .1s; }
  .choice-card:hover { background: var(--surface-2); border-color: var(--ink-3); }
  .choice-card.active { box-shadow: 0 0 0 2px var(--accent-soft); }
  .choice-card.active.yes {
    border-color: var(--good); background: var(--good-soft);
  }
  .choice-card.active.yes { box-shadow: 0 0 0 2px var(--good-soft); }
  .choice-card.active.yes .cc-ic { background: var(--good); color: var(--bg); }
  .choice-card.active.yes .cc-radio { border-color: var(--good); background: var(--good); }
  .choice-card.active.no {
    border-color: var(--ink-2); background: var(--surface-2);
    box-shadow: 0 0 0 2px oklch(0.92 0.01 255);
  }
  .choice-card.active.no .cc-ic { background: var(--ink-2); color: var(--bg); }
  .choice-card.active.no .cc-radio { border-color: var(--ink-2); background: var(--ink-2); }
  .choice-card.active .cc-radio svg { opacity: 1; }

  .yn-note {
    margin-top: 10px;
    display: flex; align-items: flex-start; gap: 8px;
    padding: 9px 13px;
    background: var(--info-soft);
    border: 1px solid oklch(0.86 0.05 240);
    border-radius: 9px;
    font-size: 12px; color: var(--info);
    line-height: 1.45;
  }
  .yn-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }

  /* ---------- Gunthewari: document Required / Optional tags ---------- */
  .req-tag, .opt-tag {
    display: inline-block;
    font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: 1px;
    font-family: "Public Sans", system-ui, sans-serif;
  }
  .req-tag { background: var(--bad-soft); color: var(--bad); }
  .opt-tag { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
  .doc-row.na { opacity: 0.62; }
  .doc-row.na .doc-ic { background: var(--surface-2); }

  /* ---------- Gunthewari: doc actions (replace + clear) ---------- */
  .doc-actions { display: inline-flex; align-items: center; gap: 8px; }
  .doc-clear {
    width: 30px; height: 30px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    border-radius: 7px;
    display: grid; place-items: center;
    color: var(--ink-3);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
    flex-shrink: 0;
  }
  .doc-clear:hover { background: var(--bad-soft); color: var(--bad); border-color: oklch(0.82 0.09 25); }

  /* ---------- Shared checkbox styling (policy acceptance modal) ---------- */
  .pay-agree {
    display: flex; align-items: flex-start; gap: 11px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.55;
    cursor: pointer;
  }
  .pay-agree input[type=checkbox] {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px;
    margin: 1px 0 0;
    flex-shrink: 0;
    border: 1.5px solid var(--line-strong);
    border-radius: 5px;
    background: var(--surface);
    cursor: pointer;
    display: grid; place-items: center;
    transition: background .12s, border-color .12s;
  }
  .pay-agree input[type=checkbox]:checked {
    background: var(--accent);
    border-color: var(--accent);
  }
  .pay-agree input[type=checkbox]:checked::after {
    content: "";
    width: 5px; height: 9px;
    border: solid var(--accent-ink);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
  }
  .wiz-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
  }
  .wiz-foot .btn { width: auto; padding: 0 22px; min-width: 130px; }

  /* Policy acceptance modal (Terms & Conditions / Privacy Policy / Refund Policy) */
  .policy-modal { max-width: 640px; }
  .policy-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-3); margin-bottom: 6px;
  }
  .policy-doc-card {
    margin: 6px 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
  }
  .policy-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--surface-2); }
  .policy-tab {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
    padding: 12px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent;
    font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-3);
    cursor: pointer; transition: color .12s, border-color .12s;
  }
  .policy-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
  .policy-tab-check {
    width: 15px; height: 15px; border-radius: 50%; background: var(--good);
    color: var(--surface); display: grid; place-items: center; flex-shrink: 0;
  }
  .policy-doc-head {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
    font-size: 12px; color: var(--ink-3);
  }
  .policy-doc-frame { width: 100%; height: 360px; border: 0; background: var(--surface-2); display: block; }
  .policy-agree { margin-bottom: 4px; }
  .policy-hint { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
  .policy-actions { display: flex; gap: 10px; margin-top: 14px; }
  .policy-actions .btn { width: auto; padding: 0 20px; min-width: 0; }
  .policy-actions .btn.secondary { flex: 0 0 auto; }
  .policy-actions .btn.accent { flex: 1; }

  /* Payment gateway modal */
  .pg-modal { max-width: 480px; }
  .pg-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--surface-2); padding: 4px; border-radius: 10px; }
  .pg-tabs button {
    flex: 1; padding: 8px; border: 0; background: transparent; border-radius: 7px;
    font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
    font-family: inherit;
  }
  .pg-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 600; }
  .pg-method { padding: 14px 0; }
  .pg-icons { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; }
  .pg-icons span { font-family: "JetBrains Mono", monospace; font-size: 10px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-2); background: var(--surface-2); }
  .pg-success {
    text-align: center;
    padding: 8px 4px 14px;
  }
  .pg-success .check {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--good);
    color: white;
    display: grid; place-items: center;
    margin: 0 auto 16px;
  }
  .pg-success h3 { font-size: 20px; margin-bottom: 6px; }
  .pg-success .txn {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    background: var(--surface-2);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 16px 0;
    display: inline-block;
    color: var(--ink-2);
  }

  /* Print preview screen */
  .print-shell {
    background: oklch(0.93 0.015 255);
    flex: 1;
    overflow-y: auto;
    padding: 32px;
  }
  .print-toolbar {
    max-width: 820px;
    margin: 0 auto 18px;
    display: flex; gap: 10px; justify-content: space-between; align-items: center;
    flex-wrap: wrap;
  }
  .print-toolbar h2 { margin: 0; font-size: 18px; font-weight: 700; }
  .print-toolbar .btn { width: auto; padding: 0 16px; min-width: 0; }
  .print-page {
    max-width: 820px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 8px 32px oklch(0.2 0.03 250 / 0.12);
    padding: 56px 64px;
    border: 1px solid oklch(0.85 0.01 250);
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
    position: relative;
  }
  /* Org watermark — centered, low-opacity, aspect-ratio preserved, sits behind
     .ph-content so it never disturbs the existing text layout. */
  .print-page .ph-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 55%;
    max-height: 55%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.22;
    z-index: 0;
    pointer-events: none;
  }
  .print-page .ph-content {
    position: relative;
    z-index: 1;
  }
  .print-page .ph-letterhead {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
  }
  .print-page .ph-logo {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
  }
  .print-page .ph-org-name-local {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
  }
  .print-page .ph-head {
    border-bottom: 2px solid var(--ink);
    padding-bottom: 14px;
    margin-bottom: 22px;
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 18px;
  }
  .print-page .ph-head h1 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  .print-page .ph-head .ph-sub { color: var(--ink-2); font-size: 12px; }
  .print-page .ph-head .ph-id {
    text-align: right;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--ink-2);
  }
  .print-page h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 24px 0 10px;
    color: var(--ink);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .print-page table.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .print-page table.kv td { padding: 5px 0; vertical-align: top; }
  .print-page table.kv td.k { color: var(--ink-3); width: 35%; font-weight: 500; }
  .print-page table.kv td.v { color: var(--ink); }
  /* CSS table display, not flex or grid — Chromium has print-fragmentation bugs
     with BOTH flex and grid containers that duplicate content onto the next page
     when they land near a page boundary. Table layout uses the browser's much
     older, far more reliably-paginated rendering path (no gap support, hence the
     padding-based spacing below instead). */
  .print-page .ph-cols {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-spacing: 0;
  }
  .print-page .ph-cols > div {
    display: table-cell;
    width: 50%;
    vertical-align: top;
    padding-right: 32px;
  }
  .print-page .ph-cols > div:last-child { padding-right: 0; }
  .print-page .ph-section { margin-top: 4px; }
  .print-page .ph-applicants-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 32px;
  }
  .print-page .ph-applicants-grid > div { flex: 1 1 220px; min-width: 220px; }
  .print-page .ph-applicant-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }
  .print-page .sig-row { margin-top: 40px; display: flex; justify-content: space-between; gap: 60px; font-size: 11px; color: var(--ink-3); }
  .print-page .sig-row .sig { flex: 1; }
  .print-page .sig-row .sig .line { border-top: 1px solid var(--ink); margin-top: 40px; padding-top: 6px; }
  .print-page .stamp {
    border: 2px solid var(--good);
    color: var(--good);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: inline-block;
    transform: rotate(-3deg);
    margin-top: 10px;
  }
  /* A4, with the browser's print-margin doing the border — .print-page fills the
     printable area itself rather than adding its own padding on top. */
  @page { size: A4; margin: 12mm; }

  @media print {
    .topbar, .wiz-info, .print-toolbar, .drawer-backdrop { display: none !important; }
    body { background: white; }

    /* .print-shell/.ack-overlay are scrollable (overflow-y:auto) for the on-screen
       preview — left as-is, that overflow leaks into print output as a visible
       scrollbar and clips content to one scroll-viewport's worth. Printing needs
       plain document flow so the browser's own paginator takes over instead.
       position:static is essential here too: .ack-overlay is position:fixed on
       screen, and Chromium reprints a fixed-position element on EVERY page it
       paginates the document into — that's what was causing the receipt's
       content to repeat identically on page 2 regardless of how tall it was. */
    .print-shell, .ack-overlay {
      overflow: visible !important;
      height: auto !important;
      max-height: none !important;
      display: block !important;
      padding: 0;
      position: static !important;
    }
    .print-page {
      box-shadow: none;
      border: 0;
      padding: 0;
      margin: 0;
      max-width: 100%;
      width: 100%;
      font-size: 10.5px;
      line-height: 1.35;
    }
    .print-page .ph-letterhead { margin-bottom: 6px; }
    .print-page .ph-head { margin-bottom: 10px; padding-bottom: 6px; }
    .print-page h3 { margin: 10px 0 5px; }
    .print-page table.kv td { padding: 2px 0; }

    /* Keep each logical block from splitting awkwardly across a page boundary —
       but ONLY for blocks with a small, bounded height (one applicant's card:
       name/address/photo, at most 3 rows). Chromium has a print bug where
       break-inside:avoid on a block that turns out TALLER than the remaining
       page space duplicates that block's content onto the next page instead of
       just splitting it there. table.kv and .ph-cols > div both grow with the
       data (Documents Attached / Property Details can run to many rows, worse
       for services like Gunthewari with extra fields+documents), so they're
       exactly the blocks likely to exceed one page — avoidance is deliberately
       NOT applied to them; a natural row-level break there is a cosmetic wrinkle,
       not the duplicated-content bug. */
    .print-page .ph-applicants-grid > div {
      break-inside: avoid;
      page-break-inside: avoid;
    }

    /* When the Acknowledgement overlay is open, hide everything underneath so only
       the receipt prints. This previously targeted "#root" (an id this app never
       uses — the real Blazor Server root is #app) gated on a "body.ack-active"
       class nothing ever actually added — so it silently never matched anything,
       and the underlying dashboard kept printing (invisibly, since the overlay's
       opaque background covers it on screen) as extra page(s) beneath the
       receipt. AcknowledgementModal is always rendered as a sibling of .app-shell
       (see Dashboard.razor), so hiding .app-shell whenever .ack-overlay exists
       anywhere in the page reliably isolates the receipt regardless of which
       action opened it. */
    body:has(.ack-overlay) .app-shell { display: none !important; }
    .ack-overlay { background: white !important; }
  }

  /* Tablet — 1024px and below */
  @media screen and (max-width: 1024px) {
    .auth-side { padding: 36px 40px; }
    .auth-side h1 { font-size: 30px; }
    .auth-form-wrap { padding: 32px; }
    .dash-main { padding: 24px 28px; }
    .brand small { display: none; }
    .brand span { font-size: 13px; }
    .org-name { max-width: 180px; }
    .org-sub { max-width: 180px; }
  }

  /* Mobile — 880px and below */
  @media screen and (max-width: 880px) {
    .auth-stage { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .reg-grid { grid-template-columns: 1fr; }
    .reg-grid .span-2 { grid-column: span 1; }

    /* topbar tightens */
    .topbar { padding: 0 14px; gap: 10px; height: 56px; }
    .brand small { display: none; }
    .brand-sep { display: none; }
    .brand { display: none; }
    .org-name { font-size: 13px; max-width: 140px; }
    .org-sub { display: none; }
    .org-brand image-slot { width: 32px !important; height: 32px !important; }
    .topbar-meta { font-size: 12px; gap: 10px; }
    .topbar-meta .topbar-version { display: none; }

    /* dashboard sidebar becomes a drawer */
    .dash { grid-template-columns: 1fr; }
    .nav-toggle { display: inline-flex; }
    .dash-side {
      position: fixed;
      top: 0; left: 0; bottom: 0;
      width: min(320px, 86vw);
      transform: translateX(-100%);
      transition: transform .25s ease;
      z-index: 50;
      box-shadow: 0 16px 48px oklch(0.1 0.05 250 / 0.18);
      border-right: 1px solid var(--line);
    }
    .dash-side.open { transform: translateX(0); }
    .drawer-backdrop.open { display: block; }

    .dash-main { padding: 20px 18px; }
    .meta-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
    .dash-head { flex-direction: column; align-items: stretch; gap: 16px; }
    .new-app-btn { width: 100%; justify-content: center; }
    .dash-head-left h1 { font-size: 22px; }

    /* wizard */
    .wiz-info { padding: 12px 18px; gap: 14px 22px; }
    .wiz-shell { padding: 20px 18px 40px; }
    .wiz-card { padding: 22px 18px; }
    .wiz-head { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
    .wiz-head h1 { font-size: 22px; }
    .applicant-card { padding: 14px; }
    .stepper { grid-template-columns: 1fr 1fr; }
    .field-grid-2 { grid-template-columns: 1fr; }
    .field-grid-3 { grid-template-columns: 1fr; }
    .preview-grid { grid-template-columns: 1fr; }
    /* When these grids collapse to one column, neutralise any inline
       `grid-column: span N` on children (used by Gunthewari/NATP property
       fields) so they don't force a phantom overflowing extra column. */
    .field-grid-2 > *, .field-grid-3 > *, .preview-grid > * { grid-column: auto !important; }
    .wiz-foot { flex-direction: column-reverse; }
    .wiz-foot .btn { width: 100%; }
    .doc-row { grid-template-columns: 40px 1fr; }
    .doc-row .doc-upload-btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
    .doc-row .doc-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
    .print-page { padding: 32px 24px; }
    .print-page .ph-head { flex-direction: column; gap: 8px; }
    .print-page .ph-logo { width: 32px; height: 32px; max-width: 32px; max-height: 32px; }
    .print-page .ph-org-name-local { font-size: 14px; }
    .print-page .ph-head .ph-id { text-align: left; }
  }

  @media screen and (max-width: 560px) {
    .auth-form-wrap { padding: 16px; }
    .auth-card { padding: 24px 20px; border-radius: 12px; }
    .auth-card h2 { font-size: 20px; }
    .reg-wide-wrap { padding: 16px; }
    .reg-card { padding: 24px 20px; }
    .otp-row { gap: 6px; }
    .otp-row input { height: 48px; font-size: 18px; }
    .modal { padding: 22px; }
    .stat-row { grid-template-columns: 36px 1fr auto; padding: 12px 14px; gap: 10px; }
    .stat-row .chev { display: none; }
    .stat-row .count { font-size: 18px; min-width: 40px; }
    .stat-row .desc { display: none; }
    .stat-head { padding: 12px 14px; }
    .stat-head .updated { font-size: 10px; }
    .topbar-meta .secure-text { display: none; }
    .brand { font-size: 14px; }
  }

/* ===== Blazor-specific additions ===== */
#blazor-error-ui { display: none; }
.no-print { /* keep */ }
@media print { .no-print { display: none !important; } }

.print-overlay { position: fixed; inset: 0; z-index: 100; overflow-y: auto; background: oklch(0.93 0.015 255); display: flex; flex-direction: column; }

/* ===== Additional responsive rules ===== */
@media (max-width: 720px) {
  .auth-stage { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form-wrap { padding: 24px 16px; }
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: fixed; left: -280px; top: 60px; bottom: 0; z-index: 41; transition: left .25s; width: 280px; }
  .dash-side.open { left: 0; }
  .drawer-backdrop.open { display: block; }
  .nav-toggle { display: inline-flex; }
  .dash-main { padding: 20px 16px; }
  .meta-row { grid-template-columns: 1fr; }
  .track-stages { grid-template-columns: repeat(3, 1fr); gap: 16px 0; }
  .wiz-shell { flex-direction: column; }
  .reg-grid { grid-template-columns: 1fr; }
  .reg-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .dash-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .stepper { overflow-x: auto; }
  .track-stages { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .step-chip { padding: 7px 9px; gap: 6px; }
  .step-chip .step-label { font-size: 11.5px; }
  .step-chip .step-label small { display: none; }
  .step-chip .step-num { width: 20px; height: 20px; font-size: 10px; }
  .applicants-summary .as-sep { display: none; }
  .wiz-info { gap: 10px 16px; padding: 10px 14px; }
  .wiz-info .pair .k { font-size: 9.5px; }
  .wiz-info .pair .v { font-size: 12px; }
}
