/* ══════════════════════════════════════════════════════════════════════════
   Midwest Title — Commercial Portal design system  (v6.1 visual refresh)
   Deep Harbor #104E7D · Midwest Mist #C0CFDE · Foundation Gray #969696
   Clearline White #FDFDFD · Ledger Black #141414 · Cream #F5F2EC
   Headings: Century Gothic family. Logo never recolored.
   ────────────────────────────────────────────────────────────────────────
   On-brand refresh: layered gradients, glassy header, elevated hover cards,
   gradient stat tiles, refined chips/buttons, decorative motifs, motion.
   Every legacy class name is preserved so existing file-detail tabs are
   unchanged; new classes power the dashboard, Welcome Tour, What's New and
   Product Roadmap.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --navy: #134a74;
  --navy-700: #0e426c;
  --navy-800: #0a3252;
  --navy-400: #2f6e9e;
  --navy-050: #eaf1f7;
  --steel: #194a72;
  --ink: #0b1620;
  --mist: #c0cfde;
  --gray: #6b7280;
  --gray-soft: #969696;
  --black: #141414;
  --white: #fdfdfd;
  --bg: #f4f1f1;
  --cream: #f6f3f3;
  --surface: #ffffff;
  --surface-2: #faf9f8;
  --line: #e3e1dc;
  --line-soft: #ecebe6;
  --ok: #1e8e5a;
  --warn: #c07a12;
  --danger: #b00020;
  --head: "Manrope", "Century Gothic", "Avenir Next", "Futura", "Trebuchet MS", sans-serif;
  --body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 20px;
  --radius: 15px;
  --radius-sm: 11px;

  --grad-navy: linear-gradient(135deg, #1a5488 0%, #0e426c 55%, #0a3355 100%);
  --grad-navy-soft: linear-gradient(135deg, #eef4fa 0%, #e2ecf5 100%);
  --grad-hero: linear-gradient(155deg, #15385a 0%, #0d2740 58%, #0a1723 100%);
  --grad-sheen: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,0) 58%);

  --shadow-sm: 0 1px 2px rgba(20,20,20,.05), 0 2px 8px rgba(16,78,125,.05);
  --shadow: 0 1px 2px rgba(20,20,20,.05), 0 8px 24px rgba(16,78,125,.08);
  --shadow-lg: 0 18px 48px rgba(12,60,97,.18), 0 4px 12px rgba(12,60,97,.10);
  --ring: 0 0 0 4px rgba(16,78,125,.14);

  --c-green-bg: #e5f4ec; --c-green-fg: #1e6f47;
  --c-orange-bg: #fbeddb; --c-orange-fg: #9a5a08;
  --c-red-bg: #fbe3e6; --c-red-fg: #97001b;
  --c-gray-bg: #eceae4; --c-gray-fg: #55606b;
  --c-yellow-bg: #fbf3d3; --c-yellow-fg: #856404;
  --c-navy-bg: var(--navy-050); --c-navy-fg: var(--navy);
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #4a90c8;
    --navy-700: #6aa6d4;
    --navy-800: #7db6e4;
    --navy-400: #3f7fb4;
    --navy-050: #16283a;
    --gray: #9aa5b1;
    --gray-soft: #8b95a1;
    --black: #f2f4f7;
    --white: #0f1620;
    --bg: #0a0e13;
    --cream: #121922;
    --surface: #161d26;
    --surface-2: #131a22;
    --line: #263341;
    --line-soft: #1e2731;

    --grad-navy: linear-gradient(135deg, #1c4c74 0%, #123b5c 55%, #0c2740 100%);
    --grad-navy-soft: linear-gradient(135deg, #16232f 0%, #12202c 100%);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 3px 10px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.45), 0 10px 26px rgba(0,0,0,.4);
    --shadow-lg: 0 22px 54px rgba(0,0,0,.55), 0 6px 16px rgba(0,0,0,.4);
    --ring: 0 0 0 4px rgba(74,144,200,.22);

    --c-green-bg: #12301f; --c-green-fg: #5fce93;
    --c-orange-bg: #34240f; --c-orange-fg: #eba851;
    --c-red-bg: #351319; --c-red-fg: #f28497;
    --c-gray-bg: #1f2833; --c-gray-fg: #9aa5b1;
    --c-yellow-bg: #33290d; --c-yellow-fg: #e6c65a;
    --c-navy-bg: #16283a; --c-navy-fg: #7db6e4;
  }
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  color: var(--black);
  font: 15px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 88% -8%, rgba(16,78,125,.10), transparent 60%),
    radial-gradient(760px 520px at -6% 4%, rgba(192,207,222,.28), transparent 55%);
  background-attachment: fixed;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--black); margin: 0; line-height: 1.18; letter-spacing: -.012em; font-weight: 700; }
button { font-family: var(--body); cursor: pointer; }
input, select, textarea { font-family: var(--body); }
::selection { background: rgba(16,78,125,.16); }

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.app-shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar { height: 4px; background: linear-gradient(90deg, var(--navy-800), var(--navy) 45%, var(--navy-400)); }

.header {
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.header-inner { max-width: 1160px; margin: 0 auto; padding: 12px 22px; display: flex; align-items: center; gap: 16px; }
.header img.logo { height: 42px; width: auto; display: block; }
.header .brand-name { font-family: var(--head); color: var(--navy); font-weight: 700; font-size: 15px; letter-spacing: .3px; }
.header .brand-sub { color: var(--gray); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; }
.header nav { display: flex; gap: 4px; margin-left: 10px; }
.header nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--gray); font-weight: 600; font-size: 13.5px;
  transition: background .16s ease, color .16s ease;
}
.header nav a:hover { background: var(--navy-050); text-decoration: none; color: var(--navy); }
.header nav a.active { background: var(--grad-navy); color: #fff; box-shadow: 0 4px 12px rgba(16,78,125,.28); }
.header .spacer { flex: 1; }
.header .who { text-align: right; line-height: 1.2; }
.header .who .name { font-weight: 600; font-size: 13px; }
.header .who .role { font-size: 11px; color: var(--gray); }

.main { max-width: 1160px; margin: 0 auto; padding: 26px 22px 72px; width: 100%; flex: 1; }
.page-enter { animation: rise .32s cubic-bezier(.22,.61,.36,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card.pad { padding: 18px; }
.card + .card { margin-top: 16px; }
a.card, .card.link { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.card:hover, .card.link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--navy) 30%, var(--line)); text-decoration: none; }
.card.raise { box-shadow: var(--shadow); }
.section-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--gray); margin: 0 0 10px; font-family: var(--body); font-weight: 700; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 17px; border: 0; border-radius: 999px; background: var(--grad-navy); color: #fff;
  font-weight: 600; font-size: 14px; box-shadow: 0 3px 10px rgba(16,78,125,.22);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, opacity .14s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(16,78,125,.30); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring), 0 3px 10px rgba(16,78,125,.22); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { background: var(--navy-050); border-color: color-mix(in srgb, var(--navy) 32%, var(--line)); }
.btn.subtle { background: var(--navy-050); color: var(--navy); box-shadow: none; }
.btn.subtle:hover { background: color-mix(in srgb, var(--navy-050) 70%, var(--navy) 12%); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.lg { padding: 13px 22px; font-size: 15px; }
.btn.link { background: none; color: var(--navy); text-decoration: underline; padding: 4px; font-weight: 500; box-shadow: none; }
.btn.link:hover { transform: none; box-shadow: none; }
.btn.primary { background: var(--grad-navy); color: #fff; }
.btn.primary:hover { background: var(--grad-navy); }
/* Editorial CTA — uppercase + tracked, echoing mwtmi.com's primary buttons. */
.btn.cta { text-transform: uppercase; letter-spacing: .11em; font-size: 12.5px; font-weight: 700; padding: 13px 24px; }
.btn.cta.sm { padding: 9px 16px; font-size: 11.5px; }
.btn.white { background: #fdfdfd; color: var(--navy-700); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.btn.white:hover { background: #fff; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
label.field { display: block; font-size: 12px; color: var(--gray); margin: 0 0 5px; font-weight: 600; }
.input, input.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--surface); color: var(--black); transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus { outline: none; border-color: var(--navy); box-shadow: var(--ring); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-group { margin-bottom: 12px; }

/* ── Chips / pills ────────────────────────────────────────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3.5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--c-gray-bg); color: var(--c-gray-fg); white-space: nowrap; line-height: 1.35; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; flex: none; }
.chip.plain::before { display: none; }
.chip.green { background: var(--c-green-bg); color: var(--c-green-fg); }
.chip.orange { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.chip.red { background: var(--c-red-bg); color: var(--c-red-fg); }
.chip.gray { background: var(--c-gray-bg); color: var(--c-gray-fg); }
.chip.yellow { background: var(--c-yellow-bg); color: var(--c-yellow-fg); }
.chip.navy { background: var(--c-navy-bg); color: var(--c-navy-fg); }

/* ── Key/value rows ───────────────────────────────────────────────────────── */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.kv:first-child { border-top: 0; }
.kv .k { color: var(--gray); font-size: 13px; }
.kv .v { text-align: right; font-weight: 600; font-size: 14px; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.muted { color: var(--gray); }
.small { font-size: 12.5px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.rowflex { display: flex; align-items: center; gap: 10px; }
.wrapflex { display: flex; flex-wrap: wrap; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.hr { height: 1px; background: var(--line-soft); border: 0; margin: 14px 0; }
.center { text-align: center; }
.err-text { color: var(--danger); font-size: 13px; }
.quote-grid { display: grid; grid-template-columns: minmax(280px,1fr) minmax(260px,1fr); gap: 16px; align-items: start; }
@media (max-width: 720px) { .quote-grid { grid-template-columns: 1fr; } }

/* ── Dashboard hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--grad-hero); color: #fff; padding: 34px 36px 40px; margin-bottom: 22px;
  box-shadow: var(--shadow-lg); isolation: isolate;
}
.hero::before { content: ""; position: absolute; inset: 0; background: var(--grad-sheen); pointer-events: none; z-index: 0; }
.hero .skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; z-index: 0; pointer-events: none; }
.hero .hero-art { position: absolute; right: -10px; top: -20px; opacity: .9; pointer-events: none; z-index: 0; }
.hero .hero-art svg { display: block; }
.hero .eyebrow { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.72); font-weight: 700; }
.hero h1 { color: #fff; font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 9px 0 6px; line-height: 1.08; }
.hero .hero-sub { color: rgba(255,255,255,.82); font-size: 14.5px; max-width: 52ch; }
.hero-inner { position: relative; z-index: 1; }
.hero-search { position: relative; z-index: 1; margin-top: 20px; max-width: 400px; }
.hero-search .input { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; padding-left: 40px; }
.hero-search .input::placeholder { color: rgba(255,255,255,.72); }
.hero-search .input:focus { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.6); box-shadow: 0 0 0 4px rgba(255,255,255,.14); }
.hero-search .search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.8); pointer-events: none; }

/* Compact hero — a shorter branded band for working pages (Rate Quote, Compass). */
.hero.compact { padding: 22px 28px; margin-bottom: 18px; }
.hero.compact h1 { font-size: 25px; margin: 6px 0 4px; }
.hero.compact .hero-sub { font-size: 13.5px; }
.hero .hero-inner .btn.white { flex: none; }

/* ── Metric / stat tiles ──────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.tile .num { font-family: var(--head); font-size: 22px; font-weight: 700; color: var(--navy); }
.tile .lbl { font-size: 11.5px; color: var(--gray); text-transform: uppercase; letter-spacing: .06em; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 15px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-navy); }
.stat.is-green::after { background: linear-gradient(180deg, #29a56a, #1e6f47); }
.stat.is-orange::after { background: linear-gradient(180deg, #e0912f, #9a5a08); }
.stat.is-red::after { background: linear-gradient(180deg, #d24a5c, #97001b); }
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.stat .stat-ic {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--navy-050); color: var(--navy);
}
.stat.is-green .stat-ic { background: var(--c-green-bg); color: var(--c-green-fg); }
.stat.is-orange .stat-ic { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.stat.is-red .stat-ic { background: var(--c-red-bg); color: var(--c-red-fg); }
.stat .stat-num { font-family: var(--head); font-size: 30px; font-weight: 700; color: var(--black); line-height: 1; }
.stat .stat-lbl { font-size: 12px; color: var(--gray); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin-top: 6px; }
.stat .stat-hint { font-size: 12px; color: var(--gray); margin-top: 3px; }

/* ── File cards ───────────────────────────────────────────────────────────── */
.file-card { position: relative; overflow: hidden; }
.file-card .accent { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad-navy); opacity: .9; }
.file-card .accent.green { background: linear-gradient(90deg,#29a56a,#1e6f47); }
.file-card .accent.orange { background: linear-gradient(90deg,#e0912f,#9a5a08); }
.file-card .accent.red { background: linear-gradient(90deg,#d24a5c,#97001b); }
.file-card .accent.yellow { background: linear-gradient(90deg,#e6c65a,#856404); }
.file-card .accent.gray { background: linear-gradient(90deg,#aab2bd,#6b7280); }
.file-card .addr { font-family: var(--head); font-weight: 700; font-size: 16.5px; margin-bottom: 3px; }
.progress { height: 6px; border-radius: 999px; background: var(--line-soft); overflow: hidden; margin-top: 12px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-navy); transition: width .4s ease; }
.progress.done > span { background: linear-gradient(90deg,#29a56a,#1e6f47); }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: thin; }
.tabs button { background: none; border: 0; padding: 10px 15px; font-weight: 600; font-size: 14px; color: var(--gray); border-bottom: 2px solid transparent; white-space: nowrap; transition: color .14s ease, border-color .14s ease; }
.tabs button.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs button:hover { color: var(--navy); }
.tabs.sm { border-bottom: 0; margin-bottom: 0; }
.tabs.sm button { padding: 6px 12px; font-size: 13px; border-bottom: 2px solid transparent; }
.tabs.sm button.active { color: var(--navy); border-bottom-color: var(--navy); }

/* Two-tier file navigation: primary category headers + nested sub-tabs. */
.tabs.tabs-primary { gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tabs.tabs-primary.with-sub { margin-bottom: 0; }
.tabs.tabs-primary button { font-size: 15px; font-weight: 700; padding: 12px 18px; letter-spacing: -0.01em; border-bottom-width: 3px; margin-bottom: -2px; }
.tabs.tabs-primary button.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs.tabs-sub {
  gap: 2px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px;
  padding: 7px 8px 0; background: color-mix(in srgb, var(--navy) 4%, transparent);
  border-radius: 0 0 10px 10px;
}
.tabs.tabs-sub button { font-size: 13px; font-weight: 600; padding: 7px 13px; color: var(--gray); }
.tabs.tabs-sub button.active { color: var(--navy); border-bottom-color: var(--navy); }
.pillbar { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.pillbar button { border: 0; background: none; padding: 7px 15px; border-radius: 999px; font-weight: 600; font-size: 13.5px; color: var(--gray); transition: all .15s ease; }
.pillbar button.active { background: var(--grad-navy); color: #fff; box-shadow: 0 3px 9px rgba(16,78,125,.26); }
.pillbar button:hover:not(.active) { color: var(--navy); background: var(--navy-050); }

/* ── Auth ─────────────────────────────────────────────────────────────────── */
.auth-wrap { max-width: 430px; margin: 6vh auto; padding: 0 18px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.auth-logo img { height: 64px; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-brandside { position: relative; overflow: hidden; background: var(--grad-hero); color: #fff; padding: 56px 52px; display: flex; flex-direction: column; }
.auth-brandside .bs-skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; z-index: 0; pointer-events: none; }
.auth-brandside::before { content: ""; position: absolute; inset: 0; background: var(--grad-sheen); }
.auth-brandside .bs-art { position: absolute; inset: 0; pointer-events: none; opacity: .95; }
.auth-brandside .bs-inner { position: relative; z-index: 1; margin-top: auto; }
.auth-brandside .bs-logo { position: relative; z-index: 1; background: var(--white); border-radius: 14px; padding: 14px 16px; align-self: flex-start; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.auth-brandside .bs-logo img { height: 40px; display: block; }
.auth-brandside h2 { color: #fff; font-size: 35px; font-weight: 700; letter-spacing: -.02em; line-height: 1.08; margin-bottom: 14px; max-width: 15ch; }
.auth-brandside .bs-lead { color: rgba(255,255,255,.85); font-size: 15px; max-width: 40ch; }
.auth-brandside .bs-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.auth-brandside .bs-points li { display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.94); font-size: 14px; font-weight: 500; }
.auth-brandside .bs-points .bs-ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none; }
.auth-formside { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-formside .auth-card { width: 100%; max-width: 400px; }
@media (max-width: 860px) { .auth-split { grid-template-columns: 1fr; } .auth-brandside { display: none; } }

/* ── Spinner ──────────────────────────────────────────────────────────────── */
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.center { margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Banner ───────────────────────────────────────────────────────────────── */
.banner { border-radius: var(--radius-sm); padding: 12px 15px; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.banner.warn { background: var(--c-orange-bg); color: var(--c-orange-fg); }
.banner.info { background: var(--c-navy-bg); color: var(--c-navy-fg); }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty { display: grid; place-items: center; text-align: center; padding: 40px 24px; }
.empty .empty-art { margin-bottom: 14px; opacity: .95; }
.empty .empty-title { font-weight: 700; font-family: var(--head); font-size: 16px; color: var(--black); }
.empty .empty-hint { color: var(--gray); font-size: 13px; margin-top: 5px; max-width: 40ch; }

/* ── Table ────────────────────────────────────────────────────────────────── */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th { text-align: left; color: var(--gray); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10,20,32,.5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .18s ease both; }
.modal { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 540px; box-shadow: var(--shadow-lg); animation: pop .24s cubic-bezier(.22,.61,.36,1) both; overflow: hidden; }
.modal .modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal .modal-body { padding: 20px; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.icon-btn { background: none; border: 0; color: var(--gray); font-size: 20px; line-height: 1; padding: 6px; border-radius: 8px; transition: background .14s ease, color .14s ease; }
.icon-btn:hover { background: var(--navy-050); color: var(--navy); }

/* Branded modal header band — cinematic navy + skyline, for What's New / Roadmap. */
.modal .modal-head.brand { position: relative; overflow: hidden; background: var(--grad-hero); border-bottom: 0; padding: 20px; }
.modal-head.brand > * { position: relative; z-index: 1; }
.modal-head.brand .mh-skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; z-index: 0; opacity: .55; pointer-events: none; }
.modal-head.brand h3 { color: #fff; }
.modal-head.brand .mh-sub { color: rgba(255,255,255,.76); font-size: 12.5px; margin-top: 1px; }
.modal-head.brand .icon-btn { color: rgba(255,255,255,.82); }
.modal-head.brand .icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* ── Header dropdown menu (Help) ──────────────────────────────────────────── */
.menu-wrap { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 268px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; animation: pop .16s ease both; overflow: hidden;
}
.menu-pop .menu-item {
  display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left;
  background: none; border: 0; padding: 10px 11px; border-radius: 10px; color: var(--black);
  transition: background .13s ease;
}
.menu-pop .menu-item:hover { background: var(--navy-050); }
.menu-pop .menu-item .mi-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--navy-050); color: var(--navy); display: grid; place-items: center; flex: none; }
.menu-pop .menu-item .mi-t { font-weight: 600; font-size: 13.5px; }
.menu-pop .menu-item .mi-d { font-size: 11.5px; color: var(--gray); margin-top: 1px; }
.menu-pop .menu-sep { height: 1px; background: var(--line-soft); margin: 5px 8px; }
.badge-dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #e0912f; box-shadow: 0 0 0 2px var(--cream); }

/* Brand chip — the commercial logo on a fixed white field, for modal headers
   (reads in both light and dark mode against the navy lettering). */
.brand-chip { background: #fdfdfd; border-radius: 10px; padding: 6px 9px; display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; }
.brand-chip img { display: block; width: auto; }

/* ── Welcome Tour ─────────────────────────────────────────────────────────── */
.tour-backdrop { position: fixed; inset: 0; background: rgba(10,20,32,.62); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); z-index: 200; display: grid; place-items: center; padding: 4vh 16px; animation: fade .2s ease both; }
.tour { width: 100%; max-width: 560px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 92vh; animation: pop .28s cubic-bezier(.22,.61,.36,1) both; }
.tour-top { display: flex; justify-content: flex-end; padding: 12px 14px 0; }
.tour-skip { background: none; border: 0; color: var(--gray); font-size: 13.5px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.tour-skip:hover { color: var(--navy); background: var(--navy-050); }
.tour-stage { flex: 1; overflow-y: auto; padding: 4px 30px 8px; text-align: center; }
.tour-hero { border-radius: 26px; overflow: hidden; margin: 6px auto 22px; max-width: 460px; box-shadow: 0 14px 34px rgba(12,60,97,.22); }
.tour-hero svg { display: block; width: 100%; height: auto; }
/* Welcome slide: real commercial logo on a fixed white field over the cinematic
   hero gradient, with the Detroit skyline motif for continuity with the app. */
.tour-hero-logo { position: relative; overflow: hidden; background: var(--grad-hero); display: grid; place-items: center; min-height: 236px; padding: 32px; }
.tour-hero-logo .tour-skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; z-index: 0; pointer-events: none; }
.tour-hero-logo .logo-field { position: relative; z-index: 1; background: #fdfdfd; border-radius: 18px; padding: 24px 30px; box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.tour-hero-logo .logo-field img { display: block; width: 210px; max-width: 58vw; height: auto; }
.tour h2 { font-size: 23px; color: var(--navy); margin-bottom: 10px; }
.tour-body { font-size: 15px; color: var(--black); line-height: 1.6; max-width: 44ch; margin: 0 auto; }
.tour-dots { display: flex; gap: 7px; justify-content: center; padding: 16px 0 6px; flex-wrap: wrap; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); border: 0; padding: 0; transition: all .2s ease; }
.tour-dot.on { width: 22px; border-radius: 999px; background: var(--navy); }
.tour-foot { display: flex; align-items: center; gap: 12px; padding: 8px 24px 22px; }
.tour-foot .count { font-size: 12.5px; color: var(--gray); font-weight: 600; min-width: 44px; }
.tour-foot .grow { flex: 1; }
@media (max-width: 560px) { .tour-stage { padding: 4px 20px 8px; } .tour h2 { font-size: 21px; } }

/* ── What's New ───────────────────────────────────────────────────────────── */
.wn-list { display: flex; flex-direction: column; gap: 18px; }
.wn-item { position: relative; padding-left: 20px; }
.wn-item::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: -18px; width: 2px; background: var(--line); }
.wn-item:last-child::before { display: none; }
.wn-item::after { content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--grad-navy); box-shadow: 0 0 0 3px var(--surface); }
.wn-item.latest::after { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px rgba(16,78,125,.16); }
.wn-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.wn-ver { font-family: var(--head); font-weight: 700; color: var(--navy); font-size: 12px; letter-spacing: .04em; background: var(--navy-050); padding: 2px 9px; border-radius: 999px; }
.wn-title { font-family: var(--head); font-weight: 700; font-size: 16px; color: var(--black); }
.wn-hl { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.wn-hl li { display: flex; gap: 9px; font-size: 13.5px; color: var(--black); line-height: 1.5; }
.wn-hl li .wn-check { color: var(--navy); flex: none; margin-top: 2px; }
.wn-staff { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; }
.wn-staff .wn-staff-h { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--gray); font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.wn-staff li .wn-check { color: var(--gray); }

/* ── Roadmap ──────────────────────────────────────────────────────────────── */
.rm-intro { color: var(--gray); font-size: 14px; margin-bottom: 6px; }
.rm-group-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--gray); font-weight: 700; margin: 20px 0 12px; }
.rm-card { display: flex; gap: 14px; align-items: flex-start; padding: 15px 16px; }
.rm-card .rm-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-navy-soft); color: var(--navy); display: grid; place-items: center; flex: none; }
.rm-ver { font-family: var(--head); font-weight: 700; font-size: 11px; color: var(--navy); background: var(--navy-050); padding: 2px 8px; border-radius: 999px; letter-spacing: .04em; }
.rm-title { font-family: var(--head); font-weight: 700; font-size: 15.5px; color: var(--black); margin: 2px 0 4px; }
.rm-detail { font-size: 13.5px; color: var(--gray); line-height: 1.55; }
.rm-cta { margin-top: 20px; }

/* ── App footer — small Detroit skyline band ──────────────────────────────── */
.app-footer { position: relative; overflow: hidden; margin-top: 44px; background: var(--grad-hero); color: rgba(255,255,255,.86); isolation: isolate; }
.app-footer .footer-skyline { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; opacity: .5; z-index: 0; pointer-events: none; }
.footer-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; padding: 22px 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner .f-brand { font-family: var(--head); font-weight: 700; letter-spacing: .01em; font-size: 13.5px; }
.footer-inner .f-meta { color: rgba(255,255,255,.62); font-size: 12px; letter-spacing: .04em; }
@media (max-width: 640px) { .footer-inner { padding: 18px 14px 22px; } }

/* ── Print (settlement statement) ─────────────────────────────────────────── */
.draft-wrap { position: relative; }
.draft-watermark {
  position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--head); font-weight: 800; letter-spacing: 12px;
  font-size: clamp(64px, 14vw, 220px); color: var(--gray);
  opacity: 0.10; transform: rotate(-30deg); user-select: none; white-space: nowrap;
}
.settlement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .settlement-grid { grid-template-columns: 1fr; } }
.settlement-side { position: relative; z-index: 1; }
.settlement-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.settlement-table th { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--gray); font-size: 12px; }
.settlement-table th:first-child { text-align: left; }
.settlement-table td { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); text-align: right; vertical-align: top; }
.settlement-table td:first-child { text-align: left; }
.settlement-table tr.settlement-section td { font-weight: 700; color: var(--navy); background: var(--navy-050); padding-top: 8px; }
.settlement-table tr.settlement-subtotal td { font-weight: 700; border-top: 2px solid var(--line); }
.settlement-table tr.settlement-due td { font-size: 15px; border-top: 0; }
.settlement-sig { margin-top: 14px; color: var(--gray); }
.settlement-sig .small { color: var(--gray); margin-top: 2px; }
.settlement-sig-entity { margin-top: 14px; }
.settlement-sig-entity > div:first-child { margin-bottom: 6px; }
.settlement-sig-by { margin: 8px 0; color: var(--gray); }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  .header nav { display: none; }
  .header-inner { padding: 10px 14px; }
  .main { padding: 18px 14px 56px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 23px; }
  .hero .hero-art { display: none; }
}

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

@media print {
  .header, .tabs, .btn, .staff-only, .hero-search, .menu-wrap { display: none !important; }
  body { background: #fff; }
  .draft-watermark { position: fixed; opacity: 0.12; }
  .settlement-grid { grid-template-columns: 1fr 1fr; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ── Messaging (7.17) ─────────────────────────────────────────────────────── */
.banner.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }

/* Nav unread badge */
.nav-msg { position: relative; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 17px; height: 17px;
  padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1; vertical-align: middle;
}

/* Two-pane shell */
.msg-shell { display: grid; grid-template-columns: 310px 1fr; gap: 14px; height: min(72vh, 720px); }
.msg-rail { display: flex; flex-direction: column; overflow: hidden; }
.msg-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.msg-rail-list { overflow-y: auto; flex: 1; }
.msg-rail-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 11px 14px; background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background .12s ease;
}
.msg-rail-item:hover { background: color-mix(in srgb, var(--navy) 5%, transparent); }
.msg-rail-item.active { background: color-mix(in srgb, var(--navy) 9%, transparent); }
.msg-rail-icon { color: var(--navy); margin-top: 1px; flex-shrink: 0; }
.msg-rail-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.msg-rail-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.msg-rail-preview, .msg-rail-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.msg-rail-time { flex-shrink: 0; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); display: inline-block; flex-shrink: 0; }

/* Conversation pane */
.msg-pane { display: flex; flex-direction: column; overflow: hidden; }
.msg-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
.msg-scroll { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-bubble {
  max-width: 78%; padding: 9px 13px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.msg-bubble.mine { background: var(--grad-navy); color: #fff; border-color: transparent; }
.msg-bubble.event { border-color: color-mix(in srgb, var(--navy) 45%, var(--line)); background: var(--grad-navy-soft); }
.msg-bubble.mine.event { background: var(--grad-navy); }
.msg-sender { font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.msg-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.msg-cd { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.msg-time { margin-top: 4px; opacity: .62; font-size: 11px; }
.msg-composer { display: flex; gap: 10px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.msg-composer textarea { resize: none; flex: 1; }

/* New-conversation picker rows */
.picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 12px; margin-top: 6px; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.picker-row:hover:not(:disabled) { border-color: var(--navy); background: color-mix(in srgb, var(--navy) 5%, transparent); }
.picker-row:disabled { opacity: .55; cursor: default; }
.picker-icon { color: var(--navy); flex-shrink: 0; }

/* Cross-file inbox rows */
.inbox-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.inbox-row.unread { border-color: color-mix(in srgb, var(--navy) 32%, var(--line)); }
.inbox-icon { color: var(--navy); flex-shrink: 0; }
.inbox-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.inbox-line1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inbox-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inbox-time { flex-shrink: 0; }

@media (max-width: 800px) {
  .msg-shell { grid-template-columns: 1fr; height: auto; }
  .msg-rail { max-height: 40vh; }
  .msg-pane { height: 60vh; }
}

/* ── Sworn Statement ↔ Waiver reconciliation (7.21) ───────────────────────── */
.chip-file {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; background: var(--surface);
}
.chip-x { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--gray); padding: 0 3px; }
.chip-x:hover { color: var(--danger); }
.flag-list { margin: 6px 0 0; padding-left: 18px; color: var(--gray); }
.flag-list li { margin: 2px 0; }
.verdict-green { border-left: 4px solid #1f9d57; }
.verdict-yellow { border-left: 4px solid #c98a12; }
.verdict-red { border-left: 4px solid var(--danger); }

/* ── Exam Agent (7.22) ────────────────────────────────────────────────────── */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; }
.kv-row { display: flex; flex-direction: column; gap: 1px; padding: 3px 0; }
.kv-k { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.kv-v { font-weight: 600; font-size: 14px; word-break: break-word; }
.subhead { font-weight: 800; font-size: 13px; letter-spacing: .02em; color: var(--navy); text-transform: uppercase; }
.legal-desc {
  white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 12px; line-height: 1.5;
}
.commit-list { margin: 6px 0 0; padding-left: 22px; }
.commit-list li { margin: 7px 0; line-height: 1.5; }
.commit-list li .chip { margin-right: 4px; }

/* Screen-toggle utility used by the vanilla portals (React app hides via render). */
.hide { display: none !important; }
