/* Claimrang
   Idea: a calm command center, "midnight and ocean": deep navy, one ocean-blue accent. A deep navy side menu, layered cards that float a little above the page,
   and one 3D centerpiece (the deadline runway) where depth carries meaning: taller = more money, closer = sooner.
   Documents (letters, templates, the original denial) always sit on light paper, in either theme,
   and one highlighter colour is reserved for "a person must fill this in". */

@font-face {
  font-family: "Public Sans";
  src: url("/fonts/public-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: light;
  --bg: #f1f5fb;
  --bg-glow: rgba(31, 111, 224, 0.09);
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --surface-3: #ebf1f9;
  --line: #e1e8f2;
  --line-strong: #c8d3e3;
  --text: #0f1a2e;
  --text-2: #50607a;
  --text-3: #8293ab;

  --accent: #1f6fe0;
  --accent-2: #3b8cf5;
  --accent-ink: #1552b5;
  --accent-tint: #e6f0fe;
  --on-accent: #ffffff;

  --ok: #10a37a;
  --ok-bg: #ddf5ec;
  --ok-ink: #0a6b50;
  --soon: #e8930c;
  --soon-bg: #fff1d4;
  --soon-ink: #8a5300;
  --late: #e5484d;
  --late-bg: #fde3e3;
  --late-ink: #a3201a;
  --calm: #3d8ef0;

  --mark: #ffe14d;
  --mark-soft: #fff4b0;
  --paper: #fffefb;
  --paper-ink: #1d2233;
  --paper-line: #e7e3d8;

  --side: #0c1830;
  --side-2: #14284a;
  --side-text: #a9b9d6;
  --side-strong: #ffffff;

  --shadow-1: 0 1px 2px rgba(20, 22, 43, 0.06), 0 1px 1px rgba(20, 22, 43, 0.03);
  --shadow-2: 0 1px 2px rgba(20, 22, 43, 0.05), 0 10px 30px -10px rgba(15, 55, 130, 0.18);
  --shadow-3: 0 30px 70px -20px rgba(10, 40, 100, 0.35), 0 8px 20px -8px rgba(20, 22, 43, 0.15);
  --ring: 0 0 0 3px rgba(31, 111, 224, 0.28);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;

  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --step--1: 0.86rem;
  --step-0: 1rem;
  --step-1: 1.18rem;
  --step-2: 1.6rem;
  --step-3: 2rem;
}

/* Dark theme: chosen in the side menu, or following the computer's setting. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a1426;
    --bg-glow: rgba(90, 168, 245, 0.14);
    --surface: #112039;
    --surface-2: #162843;
    --surface-3: #1c3050;
    --line: #21375a;
    --line-strong: #2d4870;
    --text: #eef3fb;
    --text-2: #a9b8d0;
    --text-3: #7489a8;
    --accent: #5aa8f5;
    --accent-2: #7cc0ff;
    --accent-ink: #a5d3ff;
    --accent-tint: rgba(90, 168, 245, 0.16);
    --ok: #2fd39a;
    --ok-bg: rgba(47, 211, 154, 0.14);
    --ok-ink: #67e6b8;
    --soon: #f5a524;
    --soon-bg: rgba(245, 165, 36, 0.15);
    --soon-ink: #ffc46b;
    --late: #ff6369;
    --late-bg: rgba(255, 99, 105, 0.15);
    --late-ink: #ff9ea2;
    --calm: #6cb2f7;
    --side: #060d1c;
    --side-2: #0f1f3d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px -12px rgba(0, 0, 0, 0.6);
    --shadow-3: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
    --ring: 0 0 0 3px rgba(90, 168, 245, 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a1426;
  --bg-glow: rgba(90, 168, 245, 0.14);
  --surface: #112039;
  --surface-2: #162843;
  --surface-3: #1c3050;
  --line: #21375a;
  --line-strong: #2d4870;
  --text: #eef3fb;
  --text-2: #a9b8d0;
  --text-3: #7489a8;
  --accent: #5aa8f5;
  --accent-2: #7cc0ff;
  --accent-ink: #a5d3ff;
  --accent-tint: rgba(90, 168, 245, 0.16);
  --ok: #2fd39a;
  --ok-bg: rgba(47, 211, 154, 0.14);
  --ok-ink: #67e6b8;
  --soon: #f5a524;
  --soon-bg: rgba(245, 165, 36, 0.15);
  --soon-ink: #ffc46b;
  --late: #ff6369;
  --late-bg: rgba(255, 99, 105, 0.15);
  --late-ink: #ff9ea2;
  --calm: #6cb2f7;
  --side: #060d1c;
  --side-2: #0f1f3d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 34px -12px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 30px 70px -20px rgba(0, 0, 0, 0.75);
  --ring: 0 0 0 3px rgba(90, 168, 245, 0.4);
}

/* ---------- base ---------- */

* { box-sizing: border-box; }
/* Classes that set display (buttons, flex rows) must never override the hidden attribute. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(700px 400px at -10% 110%, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 400 var(--step-0)/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: var(--step-1); letter-spacing: -0.01em; }
h3 { font-size: var(--step-0); letter-spacing: 0; }
p { margin: 0 0 0.75rem; }

a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; top: 8px; }
.noscript { padding: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--step--1); }

/* ---------- icons (drawn with masks so they take the text colour) ---------- */

.icon {
  display: inline-block; flex: none; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.i-layers { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5z'/%3E%3Cpath d='m2 13 10 5 10-5'/%3E%3Cpath d='m2 17.5 10 5 10-5'/%3E%3C/svg%3E"); }
.i-check { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 4.5 3.4 8 8 9 4.6-1 8-4.5 8-9V6z'/%3E%3Cpath d='m8.5 12 2.5 2.5 4.5-5'/%3E%3C/svg%3E"); }
.i-badge { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2.5'/%3E%3Cpath d='M5.5 17c.7-1.8 2-2.7 3.5-2.7s2.8.9 3.5 2.7M15 9h3M15 13h3'/%3E%3C/svg%3E"); }
.i-grid { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='9' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='5' rx='1.5'/%3E%3Crect x='14' y='12' width='7' height='9' rx='1.5'/%3E%3Crect x='3' y='16' width='7' height='5' rx='1.5'/%3E%3C/svg%3E"); }
.i-plus { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.i-file { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E"); }
.i-gear { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E"); }
.i-logout { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }
.i-sun { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4'/%3E%3C/svg%3E"); }
.i-moon { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E"); }
.i-coins { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='9' cy='7' rx='6' ry='3'/%3E%3Cpath d='M3 7v5c0 1.7 2.7 3 6 3s6-1.3 6-3V7'/%3E%3Cpath d='M9 15v2c0 1.7 2.7 3 6 3s6-1.3 6-3v-5c0-1.7-2.7-3-6-3'/%3E%3C/svg%3E"); }
.i-trophy { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E"); }
.i-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.i-users { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21v-1a5 5 0 0 1 5-5h4a5 5 0 0 1 5 5v1'/%3E%3Ccircle cx='10' cy='8' r='4'/%3E%3Cpath d='M17 4.5a4 4 0 0 1 0 7M21 21v-1a5 5 0 0 0-3-4.6'/%3E%3C/svg%3E"); }
.i-download { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E"); }
.i-chart { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M8 17V11M13 17V7M18 17v-4'/%3E%3C/svg%3E"); }
.i-down { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7l7 7 4-4 7 7'/%3E%3Cpath d='M15 17h6v-6'/%3E%3C/svg%3E"); }

/* ---------- app shell: side menu + main ---------- */

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px;
  padding: 20px 14px; color: var(--side-text);
  background:
    radial-gradient(300px 220px at 0% 0%, rgba(59, 140, 245, 0.35), transparent 70%),
    linear-gradient(180deg, var(--side-2), var(--side));
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px; color: var(--side-strong); text-decoration: none; font-weight: 750; font-size: 1.06rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--side-strong); }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: url("/logo-mark.svg") center / cover no-repeat;
  box-shadow: 0 6px 16px -4px rgba(59, 140, 245, 0.7);
  transform: perspective(80px) rotateX(10deg) rotateY(-14deg);
}
.brand small { display: block; font-size: 0.7rem; font-weight: 600; color: var(--side-text); letter-spacing: 0.04em; text-transform: uppercase; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(183, 181, 220, 0.6); padding: 0 12px; margin: 6px 0 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px;
  color: var(--side-text); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: background 160ms, color 160ms, transform 160ms;
}
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--side-strong); }
.side-link[aria-current="page"] {
  color: var(--side-strong);
  background: linear-gradient(90deg, rgba(90, 168, 245, 0.35), rgba(90, 168, 245, 0.08));
  box-shadow: inset 2px 0 0 #8fc8ff;
}
.side-link[aria-current="page"] .icon { color: #b6dcff; }
.sidebar :focus-visible { outline-color: #b6dcff; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.who-card { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 13px; padding: 12px; display: flex; gap: 10px; align-items: center; min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 750; font-size: 0.85rem; color: #fff; background: linear-gradient(135deg, #4fc3f7, #3b8cf5);
}
.who-text { min-width: 0; font-size: 0.82rem; line-height: 1.35; }
.who-text strong { display: block; color: var(--side-strong); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-actions { display: flex; gap: 6px; }
.side-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 10px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(255, 255, 255, 0.04);
  color: var(--side-text); font: 600 0.84rem/1 var(--sans); cursor: pointer;
}
.side-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--side-strong); }

.main { min-width: 0; }

/* ---------- client portal ---------- */

.portal-brand { align-items: center; }
.portal-logo { max-width: 46px; max-height: 40px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; flex: none; }

/* ---------- RCM accounts: client switcher ---------- */

.client-switch { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 13px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); }
.client-switch .side-label { margin: 0; padding: 0 2px; }
.client-select {
  width: 100%; font: 650 0.92rem/1.3 var(--sans); color: #fff; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px; padding: 8px 10px; cursor: pointer;
}
.client-select option { color: #14162b; background: #fff; }
.client-select:focus { outline: 2px solid #b6dcff; outline-offset: 1px; }

/* ---------- page ---------- */

.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px 32px 72px; }
.page:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 6px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: var(--step--1); font-weight: 600;
  color: var(--text-2); text-decoration: none;
}
.back::before { content: "\2190"; }
.back:hover { color: var(--accent-ink); }
.section { margin-top: 36px; }
.section > h2 { margin-bottom: 12px; }

/* ---------- cards / panels ---------- */

.panel, .empty, .table-wrap, .stat, .runway, .auth-panel, .setup, .source {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.panel { padding: 20px; }
.panel + .panel { margin-top: 20px; }
.panel.narrow { max-width: 540px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head > .btn, .panel-head > a.btn { white-space: nowrap; flex-shrink: 0; }
.panel-head > p { margin: 0; flex: 1 1 320px; }

/* ---------- buttons ---------- */

.btn {
  font: 650 0.95rem/1.2 var(--sans);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px rgba(31, 111, 224, 0.7);
  transition: transform 140ms, box-shadow 140ms, background 140ms, color 140ms;
}
.btn:hover { color: var(--on-accent); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 22px -8px rgba(31, 111, 224, 0.8); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: var(--surface); color: var(--accent-ink); border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.btn-secondary:hover { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--shadow-1); }
.btn-quiet { background: transparent; color: var(--accent-ink); box-shadow: none; padding-left: 8px; padding-right: 8px; }
.btn-quiet:hover { background: var(--accent-tint); color: var(--accent-ink); box-shadow: none; transform: none; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-small { padding: 7px 12px; font-size: var(--step--1); border-radius: 9px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */

.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 650; font-size: 0.9rem; margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; font: 400 var(--step-0)/1.45 var(--sans); color: var(--text);
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color 140ms, box-shadow 140ms, background 140ms;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.input[readonly], .input[disabled], .select[disabled], .textarea[disabled], .textarea[readonly] { background: var(--surface-3); color: var(--text-2); border-color: var(--line); }
.textarea { resize: vertical; min-height: 90px; }
.help { font-size: var(--step--1); color: var(--text-2); margin: 6px 0 0; }
.evidence { font-size: var(--step--1); color: var(--text-2); margin: 6px 0 0; overflow-wrap: anywhere; }
.field-error { font-size: var(--step--1); color: var(--late-ink); font-weight: 650; margin: 6px 0 0; }
.field-error:empty, .help:empty { display: none; }
.field.is-missing .input, .field.is-missing .select, .field.is-missing .textarea { background: var(--mark-soft); color: #2a2400; border-color: #c9a800; }
.field.is-check .input, .field.is-check .select, .field.is-check .textarea { border-color: #c9a800; }
.field-missing-note { font-size: var(--step--1); font-weight: 650; margin: 6px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }

/* ---------- messages ---------- */

.notice {
  padding: 14px 16px; border-radius: 13px; margin-bottom: 18px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-1); position: relative; padding-left: 20px;
}
.notice::before { content: ""; position: absolute; left: 8px; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--accent); }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--soon-bg); border-color: transparent; color: var(--text); }
.notice-warn::before { background: var(--soon); }
.notice-bad { background: var(--late-bg); border-color: transparent; color: var(--text); }
.notice-bad::before { background: var(--late); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }

#toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 50; pointer-events: none; width: min(560px, calc(100vw - 24px));
}
.toast {
  background: #15142e; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; pointer-events: auto;
  box-shadow: 0 16px 40px -12px rgba(20, 16, 70, 0.55); max-width: 100%; border: 1px solid rgba(255, 255, 255, 0.08);
  animation: toast-in 220ms cubic-bezier(.2, .9, .3, 1.15);
}
.toast-warn { background: #4d3300; }
.toast-bad { background: #8f1d19; }
@keyframes toast-in { from { transform: translateY(10px) scale(0.97); opacity: 0; } }

/* ---------- badges ---------- */

.due {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 0.8rem; padding: 4px 10px;
  border-radius: 999px; white-space: nowrap;
}
.due::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.due-late { background: var(--late-bg); color: var(--late-ink); }
.due-soon { background: var(--soon-bg); color: var(--soon-ink); }
.due-ok { background: var(--ok-bg); color: var(--ok-ink); }
.due-none { background: var(--surface-3); color: var(--text-2); }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 0.85rem; color: var(--text-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: currentColor; }
.status-new { color: var(--text-2); }
.status-sent { color: var(--ok-ink); }
.status-drafted { color: var(--accent-ink); }
.status-won { color: var(--ok-ink); }
.status-partial { color: var(--soon-ink); }
.status-lost { color: var(--late-ink); }
.status-closed { color: var(--text-3); }

/* ---------- stat cards (tilt a little toward the pointer) ---------- */

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  padding: 18px; position: relative; overflow: hidden;
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 200ms ease-out, box-shadow 200ms;
}
.stat:hover { box-shadow: var(--shadow-3); }
.stat::after {
  content: ""; position: absolute; width: 140px; height: 140px; right: -50px; top: -60px; border-radius: 50%;
  background: radial-gradient(circle, var(--tone-glow, rgba(31, 111, 224, 0.18)), transparent 70%);
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: var(--step--1); font-weight: 650; color: var(--text-2); }
.stat-icon {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  color: var(--tone, var(--accent)); background: var(--tone-bg, var(--accent-tint));
}
.stat-value { font-size: 1.85rem; font-weight: 750; letter-spacing: -0.03em; margin: 10px 0 2px; }
.stat .help { position: relative; z-index: 1; }
.tone-ok { --tone: var(--ok-ink); --tone-bg: var(--ok-bg); --tone-glow: rgba(16, 163, 122, 0.2); }
.tone-soon { --tone: var(--soon-ink); --tone-bg: var(--soon-bg); --tone-glow: rgba(232, 147, 12, 0.2); }
.tone-late { --tone: var(--late-ink); --tone-bg: var(--late-bg); --tone-glow: rgba(229, 72, 77, 0.2); }

/* Rubber stamp: encodes the letter's state. */
.stamp {
  display: inline-block; font-weight: 800; font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 12px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(-3deg);
  color: var(--text-2); background: transparent;
}
.stamp-draft { border-style: dashed; }
.stamp-approved { color: var(--accent-ink); }
.stamp-sent { color: var(--ok-ink); }
.stamp-in { animation: thunk 260ms cubic-bezier(.2,.9,.3,1.2); }
@keyframes thunk {
  from { transform: rotate(-9deg) scale(1.7); opacity: 0; }
  to { transform: rotate(-3deg) scale(1); opacity: 1; }
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; padding: 4px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3);
  padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }
.table tbody tr { transition: background 120ms; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.row-link { font-weight: 700; text-decoration: none; color: var(--text); }
.row-link, .row-link + .help { white-space: nowrap; }
.row-link:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- money at risk (the dashboard headline) ---------- */

.risk {
  display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  margin-bottom: 20px; padding: 24px 26px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
  background:
    radial-gradient(500px 260px at 100% 0%, rgba(79, 195, 247, 0.35), transparent 70%),
    radial-gradient(420px 260px at 0% 120%, rgba(59, 140, 245, 0.5), transparent 70%),
    linear-gradient(135deg, #15346b, #0c1c3b);
  box-shadow: 0 24px 50px -24px rgba(15, 40, 100, 0.8);
}
.risk-hot {
  background:
    radial-gradient(520px 280px at 100% 0%, rgba(255, 99, 105, 0.45), transparent 70%),
    radial-gradient(420px 260px at 0% 120%, rgba(59, 140, 245, 0.5), transparent 70%),
    linear-gradient(135deg, #1b2a5a, #0d1834);
}
.risk-main { flex: 1 1 420px; min-width: 0; }
.risk-eyebrow { margin: 0 0 6px; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; color: #b6dcff; }
.risk-hot .risk-eyebrow { color: #ffb3b6; }
.risk-title { font-size: clamp(1.5rem, 2.6vw, 2.2rem); letter-spacing: -0.03em; margin-bottom: 6px; color: #fff; }
.risk-line { color: #cbd8ee; max-width: 62ch; margin-bottom: 14px; }
.risk-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, 0.12); gap: 2px; }
.risk-seg { display: block; height: 100%; }
.seg-late { background: #ff6369; }
.seg-soon { background: #f5a524; }
.seg-later { background: #7fbdf7; }
.seg-none { background: #8b8fb0; }
.risk-keys { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 0.85rem; color: #cbd8ee; }
.risk-keys span { display: inline-flex; align-items: center; gap: 6px; }
.risk-keys strong { color: #fff; }
.risk-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.risk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 14px; flex: 0 0 auto; }
.risk-btn { background: #fff; color: #15346b; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); }
.risk-btn:hover { background: #eef5ff; color: #15346b; }
.risk-won { margin: 0; text-align: right; font-size: 0.85rem; color: #b9c7e0; }
.risk-won span { display: block; }
.risk-won strong { display: block; font-size: 1.35rem; color: #6ff0c0; letter-spacing: -0.02em; }

/* ---------- all clients ---------- */

.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.client-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 18px;
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 200ms ease-out, box-shadow 200ms;
  display: flex; flex-direction: column; gap: 12px;
}
.client-card:hover { box-shadow: var(--shadow-3); }
.client-card.is-hot { border-color: color-mix(in srgb, var(--late) 45%, var(--line)); }
.client-card.is-active { border-color: var(--accent); box-shadow: var(--ring), var(--shadow-2); }
.client-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.client-top h2 { font-size: 1.1rem; }
.client-risk { margin: 0; display: flex; flex-direction: column; }
.client-risk span { font-size: var(--step--1); color: var(--text-2); font-weight: 650; }
.client-risk strong { font-size: 1.6rem; letter-spacing: -0.03em; }
.client-card.is-hot .client-risk strong { color: var(--late-ink); }
.client-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.client-nums div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.client-nums div { background: var(--surface-2); border-radius: 10px; padding: 8px; }
.client-nums dt { font-size: 0.72rem; color: var(--text-2); font-weight: 650; }
.client-nums dd { margin: 0; font-weight: 750; font-size: 1rem; overflow-wrap: anywhere; }
.client-nums .is-late dd { color: var(--late-ink); }
.client-nums .is-soon dd { color: var(--soon-ink); }
.client-card .btn-row { margin-top: auto; }
.staff-list { max-height: 50vh; overflow-y: auto; margin: 8px 0; }
.acct-kinds { margin-bottom: 14px; }

/* ---------- 3D deadline runway ----------
   A floor tilted away from you. Lanes run left (overdue) to right (later); each open claim is a block.
   Block height = money at stake. Front of a lane = soonest. */

@property --h { syntax: "<length>"; inherits: true; initial-value: 0px; }

.runway { padding: 20px 20px 16px; margin-bottom: 24px; overflow: hidden; position: relative; }
.runway-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.runway-head h2 { display: flex; align-items: center; gap: 10px; }
.runway-summary { margin: 4px 0 0; color: var(--text-2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-late { background: var(--late); }
.lg-soon { background: var(--soon); }
.lg-calm { background: var(--calm); }
.lg-later { background: #9aa0c3; }

.runway-stage { position: relative; height: 250px; perspective: 1000px; perspective-origin: 50% -30%; margin-top: 4px; }
.runway-floor {
  position: absolute; left: 3%; right: 3%; bottom: 0; height: 270px;
  transform-origin: 50% 100%;
  transform: rotateX(var(--tilt-x, 58deg)) rotateZ(var(--tilt-z, 0deg));
  transform-style: preserve-3d; transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  border-radius: 18px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 45px,
    linear-gradient(180deg, var(--surface-3), var(--surface-2));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.lane { position: relative; transform-style: preserve-3d; border-right: 1px dashed var(--line-strong); }
.lane:last-child { border-right: 0; }
.lane-late { background: linear-gradient(0deg, var(--late-bg), transparent 90%); border-radius: 18px 0 0 18px; }
.lane-more {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%) translateZ(2px); font-size: 0.75rem; font-weight: 700;
  color: var(--text-2); background: var(--surface); border-radius: 999px; padding: 2px 8px; white-space: nowrap; box-shadow: var(--shadow-1);
}

.block {
  position: absolute; width: 24%; height: 34px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-style: preserve-3d; transform: translateZ(0);
  transition: transform 220ms cubic-bezier(.2, .9, .3, 1.2);
  --c: var(--calm);
  /* Only the height animates: fading (opacity) would flatten the 3D boxes. */
  animation: rise 900ms cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--delay, 0ms);
}
.block > span { position: absolute; display: block; border-radius: 3px; }
.block .f-top { inset: 0; transform: translateZ(var(--h)); background: color-mix(in srgb, var(--c) 72%, white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.block .f-front { left: 0; right: 0; bottom: 0; height: var(--h); transform-origin: 50% 100%; transform: rotateX(-90deg); background: var(--c); }
.block .f-left { left: 0; top: 0; bottom: 0; width: var(--h); transform-origin: 0 50%; transform: rotateY(-90deg); background: color-mix(in srgb, var(--c) 75%, black); }
.block .f-right { right: 0; top: 0; bottom: 0; width: var(--h); transform-origin: 100% 50%; transform: rotateY(90deg); background: color-mix(in srgb, var(--c) 75%, black); }
.block-late { --c: var(--late); }
.block-soon { --c: var(--soon); }
.block-calm { --c: var(--calm); }
.block-later { --c: #9aa0c3; }
.block:hover, .block:focus-visible, .block.is-hot { transform: translateZ(14px); outline: none; }
.block:hover .f-top, .block:focus-visible .f-top, .block.is-hot .f-top { background: color-mix(in srgb, var(--c) 45%, white); box-shadow: 0 0 0 2px #fff, 0 0 18px 2px var(--c); }
@keyframes rise { from { --h: 0px; } }

.runway-labels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 8px 3% 0; gap: 0; }
.runway-labels div { text-align: center; font-size: 0.8rem; color: var(--text-2); line-height: 1.3; padding: 0 2px; overflow-wrap: anywhere; }
.runway-labels strong { display: block; font-size: 1.05rem; color: var(--text); }
.runway-labels .is-late strong { color: var(--late-ink); }
.runway-labels em { display: block; font-style: normal; font-weight: 700; font-size: 0.82rem; color: var(--text); margin-top: 2px; }
.runway-labels .is-late em { color: var(--late-ink); }

.runway-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 190px; max-width: 260px;
  background: #15142e; color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 0.85rem; line-height: 1.4;
  box-shadow: 0 18px 40px -12px rgba(20, 16, 70, 0.6); transform: translate(-50%, calc(-100% - 12px));
  opacity: 0; transition: opacity 120ms;
}
.runway-tip.is-on { opacity: 1; }
.runway-tip strong { display: block; font-size: 0.95rem; }
.runway-tip span { display: block; color: #b9c7e0; }
.runway-tip::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #15142e; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.runway-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-2); font-weight: 600; z-index: 2; pointer-events: none; }

/* ---------- reports ---------- */

.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.report-section { margin: 0; }
.report-grid > .report-section:first-child { grid-column: 1 / -1; }
.panel + .report-section, .report-grid .panel + .panel { margin-top: 0; }
.report-section h2 { margin-bottom: 2px; }
.report-section > .help { margin: 0 0 12px; }
.report-table { box-shadow: none; border: 0; padding: 0; }
.report-desc { max-width: 30ch; white-space: normal; }
.meter-wrap { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.meter { width: 56px; height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.meter-fill { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.chart-panel { margin-bottom: 0; }
.chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; height: 220px; align-items: end; padding: 8px 4px 0; border-bottom: 1px solid var(--line-strong); }
.chart-col { display: flex; flex-direction: column; align-items: stretch; height: 100%; }
.chart-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar { display: block; width: 42%; max-width: 22px; min-height: 2px; border-radius: 5px 5px 0 0; transition: height 500ms cubic-bezier(.2, .8, .2, 1); }
.bar-denied { background: linear-gradient(180deg, #ff8a8e, var(--late)); }
.bar-recovered { background: linear-gradient(180deg, #5fe3b3, var(--ok)); }
.chart-x { text-align: center; font-size: 0.75rem; color: var(--text-2); padding: 6px 0 0; }
.lg-denied { background: var(--late); }
.lg-recovered { background: var(--ok); }
.aging { display: flex; flex-direction: column; gap: 12px; }
.aging-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.aging-label { font-weight: 650; font-size: 0.9rem; }
.aging-bar { height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.aging-fill { display: block; height: 100%; border-radius: 999px; }
.age-0 { background: var(--calm); }
.age-1 { background: var(--soon); }
.age-2 { background: #f07a3c; }
.age-3 { background: var(--late); }
.aging-num { font-size: 0.85rem; color: var(--text-2); white-space: nowrap; }
.aging-num strong { color: var(--text); }

/* ---------- branding and monthly report ---------- */

.brand-preview { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 14px; color: #fff; min-height: 84px; }
.brand-preview strong { display: block; font-size: 1.1rem; }
.brand-preview span { font-size: 0.85rem; opacity: 0.9; }
.brand-logo-preview { max-width: 110px; max-height: 52px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.color-input { width: 64px; height: 40px; padding: 4px; cursor: pointer; }
.monthly-panel { margin-bottom: 20px; }
.monthly-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.monthly-row .help { margin: 4px 0 0; max-width: 60ch; }

/* ---------- prevention tips ---------- */

.tips-panel { margin-bottom: 20px; border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.tips { list-style: none; counter-reset: tip; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tips li { counter-increment: tip; position: relative; padding: 14px 14px 14px 52px; border-radius: 14px; background: var(--surface-2); }
.tips li::before { content: counter(tip); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; color: var(--ok-ink); background: var(--ok-bg); }
.tips strong { display: block; margin-bottom: 4px; }
.tips p { margin: 0; color: var(--text-2); font-size: 0.92rem; }

/* ---------- empty / setup ---------- */

.empty { padding: 44px 28px; text-align: left; }
.empty h2 { margin-bottom: 8px; font-size: var(--step-2); }
.empty p { max-width: 58ch; color: var(--text-2); }
.setup { padding: 16px 18px 16px 22px; margin-bottom: 24px; position: relative; }
.setup::before { content: ""; position: absolute; left: 9px; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--mark); }
.setup ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- sign in (split screen with a floating 3D illustration) ---------- */

.auth-split { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(59, 140, 245, 0.55), transparent 70%),
    radial-gradient(500px 400px at 90% 90%, rgba(79, 195, 247, 0.45), transparent 70%),
    linear-gradient(160deg, #14284a, #081224);
}
.auth-hero .brand { padding: 0; font-size: 1.15rem; }
.auth-hero h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); line-height: 1.12; letter-spacing: -0.03em; max-width: 15ch; margin-bottom: 14px; }
.auth-hero p { color: #b9c7e0; max-width: 40ch; font-size: 1.05rem; }
.hero-scene { position: relative; height: 230px; perspective: 900px; margin: 12px 0 20px; }
.hero-card {
  position: absolute; width: 230px; padding: 16px; border-radius: 16px; color: #1d2233;
  background: rgba(255, 255, 255, 0.96); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  transform-style: preserve-3d; animation: float 7s ease-in-out infinite;
}
.hero-card small { display: block; color: #6b6f8d; font-weight: 600; font-size: 0.78rem; }
.hero-card b { display: block; font-size: 1.5rem; letter-spacing: -0.02em; }
.hero-card .bar { height: 7px; border-radius: 4px; margin-top: 10px; }
.hero-card-1 { left: 2%; top: 26%; transform: rotateY(18deg) rotateX(8deg); }
.hero-card-2 { left: 42%; top: 0; transform: rotateY(-14deg) rotateX(10deg) translateZ(40px); animation-delay: -2.5s; }
.hero-card-3 { left: 34%; top: 58%; transform: rotateY(10deg) rotateX(-6deg) translateZ(-20px); animation-delay: -4.5s; width: 200px; }
@keyframes float { 50% { translate: 0 -12px; } }
.hero-foot { color: #9fb0cc; font-size: 0.85rem; margin: 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hero-tags span { font-size: 0.78rem; font-weight: 700; color: #e3eefc; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); }
.hero-usps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; max-width: 46ch; }
.hero-usps li { display: flex; gap: 12px; align-items: flex-start; }
.hero-usps strong { display: block; color: #fff; font-size: 0.98rem; }
.hero-usps span { color: #b9c7e0; font-size: 0.9rem; }
.hero-usp-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, rgba(59, 140, 245, 0.9), rgba(79, 195, 247, 0.9)); box-shadow: 0 8px 18px -8px rgba(59, 140, 245, 0.9); }
.auth-side { display: grid; place-items: center; padding: 32px 16px; }
.auth-wrap { width: 100%; max-width: 420px; margin: 0 auto; padding: 0 16px; }
.auth-wrap h1 { margin-bottom: 6px; }
.auth-sub { color: var(--text-2); margin-bottom: 22px; }
.auth-panel { padding: 24px; }
.tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; background: var(--surface-3); border-radius: 12px; }
.tab {
  font: 650 0.92rem/1.2 var(--sans); background: none; border: 0; flex: 1 0 auto; text-align: center;
  padding: 9px 14px; color: var(--text-2); cursor: pointer; text-decoration: none; border-radius: 9px; transition: background 140ms, color 140ms;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-1); }
.settings-tabs { display: inline-flex; flex-wrap: wrap; }
.settings-tabs .tab { flex: 0 0 auto; }

/* ---------- two-step sign-in ---------- */

.code-input { font: 650 1.3rem/1.2 var(--sans); letter-spacing: 0.25em; max-width: 220px; text-align: center; }
.mfa-steps { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 16px; }
.mfa-steps li > strong { display: block; margin-bottom: 4px; }
.mfa-steps li > label { display: block; margin-bottom: 6px; }
.mfa-steps .help { display: block; margin: 4px 0; }
.mfa-qr-wrap { display: inline-block; padding: 10px; background: #fff; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0; }
.mfa-qr { display: block; width: 200px; height: 200px; }
.mfa-key { display: inline-block; font: 600 0.95rem/1.4 ui-monospace, Menlo, monospace; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); letter-spacing: 0.05em; overflow-wrap: anywhere; }
.recovery-codes { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.recovery-codes code { display: block; font: 600 0.95rem/1.4 ui-monospace, Menlo, monospace; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); text-align: center; }
.mfa-off { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.team-actions { justify-content: flex-end; gap: 4px; }

/* ---------- free denial checker ---------- */

.checker { max-width: 1040px; margin: 0 auto; padding: 0 20px 64px; }
.checker-hero {
  margin: 24px 0 24px; padding: 36px; border-radius: 24px; color: #fff;
  background: radial-gradient(600px 300px at 10% 0%, rgba(59, 140, 245, 0.55), transparent 70%), radial-gradient(500px 300px at 100% 100%, rgba(79, 195, 247, 0.4), transparent 70%), linear-gradient(160deg, #14284a, #081224);
}
.checker-hero .brand { padding: 0; margin-bottom: 18px; }
.checker-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.12; max-width: 20ch; margin-bottom: 10px; color: #fff; }
.checker-sub { color: #cbd8ee; max-width: 60ch; font-size: 1.05rem; }
.checker-privacy { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 0; padding: 8px 12px; border-radius: 999px; background: rgba(47, 211, 154, 0.16); color: #8ff0c8; font-weight: 650; font-size: 0.9rem; }
.checker-total { margin-top: 0; }
.checker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.checker-grid .panel + .panel { margin-top: 0; }
.checker-reasons { list-style: none; padding: 0; margin: 12px 0 0; }
.checker-reasons li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.checker-reasons li:first-child { border-top: 0; }
.checker-reasons .help { display: block; margin: 2px 0 0; }
.checker-reasons .num { text-align: right; }
.checker-fix { grid-column: 1 / -1; }
.checker-due { font-weight: 700; font-size: 1.05rem; color: var(--ok-ink); margin: 6px 0 0; }
.checker-due.is-soon { color: var(--soon-ink); }
.checker-due.is-late { color: var(--late-ink); }
.num-right { margin-left: auto; }
.checker-cta { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px 26px; border-radius: 20px; background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); margin-bottom: 14px; }
.checker-cta h2 { margin-bottom: 4px; }
.checker-cta p { margin: 0; color: var(--text-2); max-width: 56ch; }
/* The free-check card on the sign-in page: a dark card with a slowly turning glow around its edge. */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.check-card {
  position: relative; margin: 0 0 28px; padding: 22px 22px 18px; border-radius: 20px; color: #fff;
  border: 2px solid transparent;
  background:
    radial-gradient(320px 180px at 0% 0%, rgba(59, 140, 245, 0.45), transparent 70%) padding-box,
    radial-gradient(280px 160px at 100% 100%, rgba(47, 211, 154, 0.22), transparent 70%) padding-box,
    linear-gradient(160deg, #13284d, #0a1528) padding-box,
    conic-gradient(from var(--spin), #3b8cf5, #4fc3f7, #2fd39a, #ffb547, #3b8cf5) border-box;
  box-shadow: 0 22px 44px -22px rgba(31, 95, 200, 0.75);
  animation: check-spin 6s linear infinite;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@keyframes check-spin { to { --spin: 360deg; } }
.check-card.is-over { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(47, 211, 154, 0.45), 0 26px 50px -20px rgba(31, 95, 200, 0.9); }
.check-card h2 { color: #fff; font-size: 1.3rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 6px; }
.check-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.check-card-tags span { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #0a1528; background: #8ff0c8; padding: 3px 9px; border-radius: 999px; }
.check-card-tags span + span { color: #e3eefc; background: rgba(255, 255, 255, 0.12); }
.check-card-text { color: #cbd8ee; font-size: 0.95rem; margin: 0 0 14px; }
.check-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.check-card-btn { background: linear-gradient(135deg, #2fd39a, #1fb5a0); color: #062a22; box-shadow: 0 10px 22px -10px rgba(47, 211, 154, 0.9); }
.check-card-btn:hover { filter: brightness(1.06); }
.check-card-pick { background: none; border: 0; padding: 4px 0; color: #b6dcff; font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.check-card-privacy { margin: 12px 0 0; color: #9fb0cc; font-size: 0.8rem; }
@media (max-width: 760px) { .checker-grid { grid-template-columns: 1fr; } .checker-hero { padding: 24px; } }

/* ---------- upload ---------- */

.dropzone {
  display: block; border: 2px dashed var(--line-strong); background: var(--surface); padding: 52px 20px; text-align: center; cursor: pointer;
  border-radius: var(--radius); transition: border-color 160ms, background 160ms, transform 160ms;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-tint); transform: translateY(-2px); }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone strong { display: block; font-size: var(--step-1); margin-bottom: 4px; }

.spinner-line { display: flex; align-items: center; gap: 10px; padding: 20px 0; color: var(--text-2); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 835 import ---------- */

.era-promo { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-tint); }
.era-promo .help { margin: 2px 0 0; }
.era-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.era-summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 4px; }
.era-summary .help { margin: 0; }
.era-summary strong { font-size: 1.02rem; }
.era-actions { margin-bottom: 12px; }
.era-table td:first-child { width: 36px; }
.era-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.era-table tr.is-dup { opacity: 0.85; }
.era-table tr.is-dup td { background: var(--surface-2); }
.era-desc { max-width: 34ch; }
.era-warn { color: var(--soon-ink); font-weight: 650; }

/* ---------- split review ---------- */

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.source { position: sticky; top: 16px; overflow: hidden; }
.source-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: var(--step--1); }
.source-frame { width: 100%; height: min(78vh, 760px); border: 0; display: block; background: #fff; }
.source-img { display: block; max-width: 100%; margin: 0 auto; }
.source-text { margin: 0; padding: 14px; white-space: pre-wrap; max-height: 78vh; overflow: auto; font: 400 0.9rem/1.55 var(--serif); background: var(--paper); color: var(--paper-ink); }
.source-empty { padding: 28px 16px; color: var(--text-2); }

/* ---------- details ---------- */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; }
.facts dt { color: var(--text-2); font-size: var(--step--1); padding-top: 2px; }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 550; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.draft-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 12px; margin: 0 -12px; border-top: 1px solid var(--line); border-radius: 10px; }
.draft-row:hover { background: var(--surface-2); }
.draft-row:first-of-type { border-top: 0; }
.draft-row .meta { grid-column: 1 / -1; font-size: var(--step--1); color: var(--text-2); }

/* ---------- next action (root cause + resolution path) ---------- */

.next-action { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.suggest { background: var(--accent-tint); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.suggest-label { margin: 0 0 2px; font-size: 0.75rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
.suggest-text { margin: 0; font-size: 1.02rem; }
.suggest .help { margin-top: 4px; }
.path-pill { display: inline-block; font-weight: 700; font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-ink); }
.path-corrected_claim { background: var(--ok-bg); color: var(--ok-ink); }
.path-request_info { background: var(--soon-bg); color: var(--soon-ink); }
.path-not_recoverable { background: var(--surface-3); color: var(--text-2); }
.path-step { margin: 14px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--text-2); }
.path-done { color: var(--ok-ink); font-weight: 600; }
.path-options { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.path-options legend { margin-bottom: 6px; }
.path-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  cursor: pointer; transition: border-color 120ms, background 120ms;
}
.path-option:hover { border-color: var(--accent); }
.path-option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: var(--ring); }
.path-option input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.path-option strong { display: block; }
.path-option span span { display: block; color: var(--text-2); font-size: 0.88rem; }

/* ---------- playbook ---------- */

.next-level { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-tint); }
.next-level p { margin: 0 0 8px; }
.level-history { margin-top: 14px; }
.level-history h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 6px; }
.level-history ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; }
.era-under { margin-top: 24px; }
.era-under h2 { margin-bottom: 4px; }
.era-under-hint { margin-top: 16px; }
.today { margin-bottom: 20px; }
.today .panel-head { align-items: flex-start; }
.today-sub { margin: 2px 0 0; color: var(--text-2); }
.today-done { font-size: 0.82rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--accent-tint); color: var(--text-2); white-space: nowrap; }
.today-done.is-on { background: var(--ok-bg); color: var(--ok-ink); }
.today-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.today-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); color: inherit; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.today-item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 10px 22px -16px rgba(31, 95, 200, 0.6); }
.today-rank { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3b8cf5, #4fc3f7); }
.today-main { display: grid; gap: 2px; min-width: 0; }
.today-why { font-weight: 700; font-size: 0.9rem; color: var(--ok-ink); }
.today-why.is-hot { color: var(--late-ink); }
.today-next { font-size: 0.9rem; color: var(--text-2); }
.today-money { display: grid; text-align: right; gap: 1px; }
.today-basis { max-width: 22ch; font-size: 0.75rem; }
@media (max-width: 640px) {
  .today-item { grid-template-columns: auto minmax(0, 1fr); }
  .today-money { grid-column: 2; text-align: left; }
  .today-basis { max-width: none; }
}
.check-line { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.mono-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.auth-units { display: grid; gap: 3px; }
.auth-units .meter { width: 100%; max-width: 120px; }
.auth-state { display: inline-block; font-size: 0.78rem; font-weight: 750; padding: 3px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok-ink); white-space: nowrap; }
.auth-expiring, .auth-low_units { background: var(--soon-bg); color: var(--soon-ink); }
.auth-used_up, .auth-expired { background: var(--late-bg); color: var(--late-ink); }
.auth-not_started { background: var(--accent-tint); color: var(--text-2); }
.auth-onfile { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.auth-onfile li { padding: 8px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok-ink); }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent-ink); cursor: pointer; text-align: left; }
.linklike:hover { text-decoration: underline; }
.linklike:disabled { color: inherit; cursor: default; text-decoration: none; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; }
.cred-list { display: grid; gap: 18px; }
.cred-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.cred-grid h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 8px; }
.cred-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.cred-head h3 { margin: 0; }
.cred-dates, .cred-enroll { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cred-dates li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; }
.cred-label { display: grid; gap: 1px; }
.cred-dates li.is-flag { background: var(--soon-bg); }
.cred-dates li.is-late { background: var(--late-bg); }
.cred-enroll li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.cred-enroll li:first-child { border-top: 0; }
.enroll-state { font-size: 0.78rem; font-weight: 750; padding: 3px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--text-2); white-space: nowrap; }
.enroll-approved { background: var(--ok-bg); color: var(--ok-ink); }
.enroll-denied { background: var(--late-bg); color: var(--late-ink); }
.enroll-submitted, .enroll-in_process { background: var(--soon-bg); color: var(--soon-ink); }
@media (max-width: 760px) { .cred-grid { grid-template-columns: minmax(0, 1fr); } }
.code-hero h1 { max-width: 26ch; }
.code-crumbs { font-size: 0.85rem; color: #b9c7e0; margin: -8px 0 14px; }
.code-crumbs a { color: #e3eefc; }
.code-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 20px; overflow-wrap: anywhere; }
.code-page .checker-sub, .code-page h1 { overflow-wrap: anywhere; }
.code-body .panel { margin: 0; }
.code-body h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); margin: 12px 0 4px; }
.code-body ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.code-index { list-style: none; padding-left: 0 !important; }
.code-index a { display: block; padding: 6px 0; text-decoration: none; color: inherit; }
.code-index a:hover strong { text-decoration: underline; }
.code-index strong { display: inline-block; min-width: 4.5ch; color: var(--accent-ink); }
.site-foot { max-width: 1040px; margin: 0 auto; padding: 0 20px 40px; color: var(--text-2); font-size: 0.9rem; }
.lede { color: var(--text-2); max-width: 70ch; margin: -6px 0 18px; }
.batch-list { display: grid; gap: 18px; }
.batch-card .panel-head { align-items: flex-start; }
.batch-total { text-align: right; display: grid; }
.batch-total strong { font-size: 1.25rem; }
.batch-due { margin: 0 0 8px; font-weight: 650; color: var(--ok-ink); }
.batch-due.is-soon { color: var(--soon-ink); }
.batch-due.is-late { color: var(--late-ink); }
.batch-claims { list-style: none; margin: 0 0 12px; padding: 0; }
.batch-claims li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.batch-claims li:first-child { border-top: 0; }
.batch-result { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-tint); }
.batch-result p { margin: 0 0 6px; }
.batch-result ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.contact-list { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.contact-list li { display: grid; gap: 1px; }
.contact-list a { font-weight: 700; }
.call-script { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.call-script summary { cursor: pointer; font-weight: 700; }
.call-script[open] summary { margin-bottom: 8px; }
.script-part h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-ink); margin: 10px 0 4px; }
.script-part ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.remark-list { list-style: none; margin: 8px 0 10px; padding: 0; display: grid; gap: 10px; }
.remark-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border-radius: 12px; background: var(--accent-tint); }
.remark-list li.is-stop { background: color-mix(in srgb, var(--late-bg, #fde8e8) 70%, transparent); }
.remark-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; font-size: 0.85rem; padding: 3px 8px; border-radius: 8px; background: var(--surface, #fff); border: 1px solid var(--line); }
.remark-meaning { margin: 0 0 2px; font-weight: 650; }
.remark-ask { margin: 0; color: var(--text-2); }
.playbook { border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-bg) 45%, transparent); border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; }
.playbook .help { margin: 0 0 8px; }
.playbook ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.playbook li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 0.9rem; }
.playbook .pb-path { grid-column: 1 / -1; }
.playbook .meter { width: 100%; }
.playbook li.is-best .pb-path { font-weight: 750; }
.pb-rate { font-weight: 700; white-space: nowrap; }
.pb-rate small { font-weight: 500; color: var(--text-2); }

/* ---------- follow-up and documents ---------- */

.next-follow { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.next-follow > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.next-follow .help { margin: 0; }
.escalated { display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.82rem; background: var(--late-bg); color: var(--late-ink); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline li.is-escalated::before { border-color: var(--late); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tl-head .help { margin: 0; }
.tl-note { margin: 6px 0 0; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.doc-list li:first-child { border-top: 0; }
.checker-remark { flex-basis: 100%; }
.doc-list a { font-weight: 650; overflow-wrap: anywhere; }
.doc-list .help { margin: 0; }
.doc-list .btn { margin-left: auto; }
.doc-kind { font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-ink); white-space: nowrap; }
.kind-submission_proof { background: var(--ok-bg); color: var(--ok-ink); }
.escalated-tag { color: var(--late-ink); font-weight: 700; }
.kind-payer_response { background: var(--soon-bg); color: var(--soon-ink); }

/* ---------- evidence checklist ---------- */

.check-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 8px 0 12px; }
.check-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--ok)); transition: width 300ms ease; }
.evidence-list { list-style: none; margin: 0; padding: 0; }
.evidence-list li { border-top: 1px solid var(--line); }
.evidence-list li:first-child { border-top: 0; }
.evidence-list .check { margin: 0; padding: 10px 0; cursor: pointer; }
.evidence-list .check strong { display: block; font-weight: 600; }
.evidence-list .check .help { display: block; margin: 2px 0 0; }
.evidence-list li.is-done strong { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--ok); }

/* ---------- documents: always light paper ---------- */

.letter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.sheet {
  background: var(--paper); color: var(--paper-ink); max-width: 800px; border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 24px 60px -24px rgba(10, 40, 100, 0.35);
  padding: clamp(20px, 4vw, 56px) clamp(18px, 4vw, 60px);
}
.editor { position: relative; }
.editor-mirror, .editor-text {
  display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0;
  font: 400 1.06rem/1.7 var(--serif); letter-spacing: 0; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4;
}
.editor-mirror { position: absolute; inset: 0; color: transparent; pointer-events: none; overflow: hidden; }
.editor-text { position: relative; background: transparent; color: var(--paper-ink); resize: none; overflow: hidden; min-height: 24rem; }
.editor-text:focus { outline: none; }
.editor:focus-within { outline: 2px solid var(--accent); outline-offset: 12px; border-radius: 4px; }
.editor-text[readonly] { color: #2b3548; cursor: default; }
.mark { background: var(--mark); border-radius: 2px; box-shadow: 0 0 0 1px var(--mark); }
.rail { position: sticky; top: 16px; }
.rail .panel { padding: 16px; }
.todo { list-style: none; margin: 8px 0 0; padding: 0; }
.todo li { margin: 0 0 6px; }
.todo-btn {
  display: block; width: 100%; text-align: left; font: 500 0.9rem/1.35 var(--sans); color: #2a2400;
  background: var(--mark-soft); border: 1px solid #e0c321; border-radius: 9px; padding: 8px 10px; cursor: pointer; transition: background 120ms, transform 120ms;
}
.todo-btn:hover { background: var(--mark); transform: translateX(2px); }
.letter-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.rail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rail-actions .btn { width: 100%; }
.dirty { color: var(--soon-ink); font-weight: 650; font-size: var(--step--1); }

.template-text { font-family: var(--serif); font-size: 1rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
pre.template-text { background: var(--paper); color: var(--paper-ink); border: 1px solid var(--paper-line); border-radius: 10px; padding: 20px; }
textarea.template-text { background: var(--paper); color: var(--paper-ink); }
.template-editor { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 24px; align-items: start; }
.template-help { position: sticky; top: 16px; }
.template-help h3 { font-size: var(--step-0); margin: 0 0 8px; }
.template-help h3 + * { margin-bottom: 18px; }
.field-list { list-style: none; margin: 0; padding: 4px; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.field-list .btn { width: 100%; text-align: left; justify-content: flex-start; }

/* ---------- dialog ---------- */

dialog {
  border: 1px solid var(--line); border-radius: 20px; padding: 24px; width: min(520px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
  animation: pop 220ms cubic-bezier(.2, .9, .3, 1.15);
}
dialog::backdrop { background: rgba(12, 10, 40, 0.5); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes pop { from { transform: translateY(8px) scale(0.97); opacity: 0; } }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .block { animation: none; }
  .hero-card { animation: none; }
}

/* ---------- smaller screens ---------- */

@media (max-height: 860px) {
  .hero-scene { height: 170px; margin: 0 0 14px; }
  .hero-card { padding: 12px; width: 200px; }
  .hero-card b { font-size: 1.2rem; }
  .auth-hero { padding: 32px 40px; }
}
@media (max-height: 700px) {
  .hero-scene { display: none; }
}
@media (max-width: 1280px) {
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .letter-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
  .page { padding-left: 24px; padding-right: 24px; }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
  }
  .brand small, .side-label, .who-card { display: none; }
  .side-nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .side-link { padding: 8px 12px; white-space: nowrap; font-size: 0.9rem; }
  .side-link[aria-current="page"] { box-shadow: inset 0 -2px 0 #8fc8ff; }
  .side-foot { margin: 0 0 0 auto; }
  .side-btn { padding: 8px; }
  .side-btn .side-btn-text { display: none; }
  .page { padding: 24px 16px 64px; }
  .split, .detail-grid, .letter-layout, .template-editor, .report-grid { grid-template-columns: minmax(0, 1fr); }
  .source, .rail, .template-help { position: static; }
  .source-frame { height: 60vh; }
  .letter-layout .rail { order: -1; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: var(--step-2); }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 12px; }
  .risk { padding: 20px; }
  .risk-side { align-items: flex-start; width: 100%; flex-direction: row; justify-content: space-between; }
  .risk-won { text-align: left; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 10px; }
  .runway { padding: 16px 12px 12px; }
  .runway-stage { height: 220px; }
  .runway-floor { height: 210px; left: 0; right: 0; }
  .runway-labels { margin: 8px 0 0; }
  .runway-labels div { font-size: 0.68rem; }
  .runway-labels strong { font-size: 0.95rem; }
  .table th, .table td { padding: 12px 10px; }
}
