:root {
  --hq-safe-top: env(safe-area-inset-top, 0px);
  --hq-safe-right: env(safe-area-inset-right, 0px);
  --hq-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hq-safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
  --blue-950: #041338;
  --blue-900: #09245d;
  --blue-800: #0f388e;
  --blue-700: #174fc4;
  --blue-500: #3978ef;
  --gold-600: #b98720;
  --gold-500: #e2b64d;
  --gold-300: #ffe39a;
  --ink: #f7fbff;
  --muted: #aebee0;
  --canvas: #06183f;
  --surface: rgba(11, 42, 109, 0.64);
  --surface-solid: #0a2a6c;
  --surface-soft: rgba(255, 255, 255, 0.07);
  --line: rgba(214, 229, 255, 0.18);
  --line-strong: rgba(255, 227, 154, 0.48);
  --success: #7ae0bc;
  --warning: #ffd36d;
  --danger: #ff9b8f;
  --shadow: 0 28px 90px rgba(0, 8, 30, 0.28);
  --radius-lg: 24px;
  --radius-md: 17px;
  --hq-rail-width: 248px;
  --hq-rail-collapsed: 78px;
  --hq-bottom-nav-height: 72px;
}

html[data-ee-theme="white"] {
  color-scheme: light;
  --ink: #102b68;
  --muted: #5871a5;
  --canvas: #eff5ff;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-solid: #fff;
  --surface-soft: rgba(18, 63, 167, 0.06);
  --line: rgba(18, 63, 167, 0.14);
  --line-strong: rgba(185, 135, 32, 0.34);
  --success: #087b59;
  --warning: #896009;
  --danger: #b43a2f;
  --shadow: 0 28px 80px rgba(18, 63, 167, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 255, 255, 0.16), transparent 25rem),
    radial-gradient(circle at 88% 22%, rgba(57, 120, 239, 0.35), transparent 34rem),
    linear-gradient(160deg, var(--blue-950), var(--canvas) 48%, #0d3a99 135%);
  font-family: var(--hq-font-ui);
  -webkit-font-smoothing: antialiased;
}

html[data-ee-theme="white"] body {
  background:
    radial-gradient(circle at 13% 0%, #fff 0 9rem, transparent 25rem),
    radial-gradient(circle at 90% 18%, rgba(229, 185, 79, 0.18), transparent 30rem),
    linear-gradient(160deg, #fff, var(--canvas) 52%, #d9e7ff);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 42rem;
  height: 16rem;
  content: "";
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.11);
  filter: blur(38px);
  pointer-events: none;
}

body::before {
  top: -9rem;
  right: -9rem;
}

body::after {
  bottom: -10rem;
  left: -10rem;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

html[data-auth-state="checking"] .hq-app,
html[data-auth-state="denied"] .hq-app {
  visibility: hidden;
}

.auth-check {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 18px;
  color: var(--muted);
  text-align: center;
}

html[data-auth-state="allowed"] .auth-check {
  display: none;
}

.auth-check p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.ee-mark {
  display: block;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-900);
  box-shadow: 0 0 0 7px rgba(226, 182, 77, 0.08), 0 0 30px rgba(226, 182, 77, 0.27);
  animation: mark-pulse 2.7s ease-in-out infinite;
}

.auth-check .ee-mark,
.auth-check .ee-auth-loader {
  width: 68px;
  height: 68px;
  margin: 0 auto;
}

@keyframes mark-pulse {
  0%, 100% { opacity: 0.7; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1.04); box-shadow: 0 0 0 10px rgba(226, 182, 77, 0.1), 0 0 38px rgba(226, 182, 77, 0.42); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  width: 100%;
  min-height: calc(68px + var(--hq-safe-top));
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--hq-safe-top) max(18px, var(--hq-safe-right)) 0 max(18px, var(--hq-safe-left));
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  backdrop-filter: blur(22px);
}

.hq-app {
  min-height: 100dvh;
  padding-left: var(--hq-rail-width);
  transition: padding-left 220ms ease;
}

.hq-app[data-rail-collapsed="true"] {
  padding-left: var(--hq-rail-collapsed);
}

.hq-rail {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--hq-rail-width);
  flex-direction: column;
  gap: 28px;
  padding: calc(24px + var(--hq-safe-top)) 16px calc(20px + var(--hq-safe-bottom));
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--blue-950) 88%, transparent);
  box-shadow: 20px 0 70px rgba(0, 8, 30, 0.2);
  backdrop-filter: blur(26px);
  transition: width 220ms ease;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  text-decoration: none;
}

.rail-back-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  fill: none;
  stroke: var(--gold-300);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  background: var(--surface-soft);
}

.rail-brand:hover .rail-back-icon,
.rail-brand:focus-visible .rail-back-icon {
  color: var(--blue-950);
  stroke: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
}

.rail-brand > span { min-width: 0; }

.rail-brand span,
.rail-brand strong,
.rail-brand small { display: block; }
.rail-brand strong { font: 650 16px/1.1 var(--hq-font-display); }
.rail-brand small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.rail-nav { display: grid; gap: 7px; }
.rail-nav p { margin: 0 10px 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.rail-nav a,
.rail-secondary button {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 13px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
}
.rail-nav a > span,
.rail-secondary button > span { display: grid; width: 24px; flex: 0 0 24px; place-items: center; color: var(--gold-300); font-size: 18px; }
.rail-nav a b,
.rail-secondary button b { font-size: 11px; font-weight: 650; white-space: nowrap; }
.rail-nav a:hover,
.rail-nav a:focus-visible,
.rail-secondary button:hover,
.rail-secondary button:focus-visible { border-color: var(--line); color: var(--ink); background: var(--surface-soft); }
.rail-nav a[aria-current="page"] { border-color: var(--line-strong); color: var(--blue-950); background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); box-shadow: 0 13px 36px rgba(226,182,77,.14); }
.rail-nav a[aria-current="page"] > span { color: var(--blue-950); }
.rail-secondary { display: grid; gap: 7px; margin-top: auto; }
.hq-app[data-rail-collapsed="true"] .hq-rail { width: var(--hq-rail-collapsed); }
.hq-app[data-rail-collapsed="true"] .rail-brand span,
.hq-app[data-rail-collapsed="true"] .rail-nav p,
.hq-app[data-rail-collapsed="true"] .rail-nav b,
.hq-app[data-rail-collapsed="true"] .rail-secondary b { display: none; }
.hq-app[data-rail-collapsed="true"] .rail-nav a,
.hq-app[data-rail-collapsed="true"] .rail-secondary button { justify-content: center; padding: 0; }
.hq-app[data-rail-collapsed="true"] .rail-brand { justify-content: center; }

.topbar { margin-left: 0; }
.hq-content { scroll-behavior: smooth; }
.dashboard-section { scroll-margin-top: 88px; }

.hq-bottom-nav,
.more-sheet { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.session-label {
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quiet-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.quiet-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.quiet-icon,
.quiet-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.quiet-icon {
  flex: 0 0 16px;
}

.quiet-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.quiet-button:hover,
.quiet-button:focus-visible {
  border-color: var(--gold-500);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold-500) 55%, transparent);
  outline-offset: 3px;
}

main,
footer {
  width: min(1320px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: clamp(32px, 7vw, 100px);
  align-items: start;
  padding: clamp(40px, 7vh, 76px) 0 34px;
}

.overview-metrics { grid-column: 1 / -1; margin-top: -6px; }

.tax-season-card {
  max-width: 820px;
  margin-top: 30px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.tax-season-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tax-season-heading h2 {
  margin: 0;
  font: 650 clamp(26px, 3vw, 40px)/.98 var(--hq-font-display);
}

.irs-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  color: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.tax-season-range {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.tax-deadline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.tax-deadline {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.tax-deadline span,
.tax-deadline strong,
.tax-deadline small { display: block; }
.tax-deadline span { min-height: 30px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.4; }
.tax-deadline strong { margin-top: 9px; font-size: 12px; }
.tax-deadline small { margin-top: 4px; color: var(--gold-300); font-size: 9px; font-weight: 800; }
.tax-deadline.is-near { border-color: var(--gold-500); }

.money-command-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr 1fr;
  gap: 12px;
  margin: 16px 0 12px;
}

.cashflow-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.cashflow-row span,
.cashflow-row strong { display: block; }
.cashflow-row span { color: var(--muted); font-size: 10px; }
.cashflow-row strong { margin-top: 5px; font-size: 19px; }

.cashflow-track {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.cashflow-track i {
  display: block;
  width: 0;
  height: 7px;
  border-radius: 999px;
  transition: width .35s ease;
}

#cashflowIncomeBar { background: var(--success); }
#cashflowExpenseBar { background: var(--warning); }
.cashflow-net { margin: 14px 0 0; color: var(--muted); font-size: 10px; }

.account-summary-list { display: grid; gap: 8px; margin-top: 18px; }
.account-summary-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.account-summary-item span,
.account-summary-item strong { display: block; }
.account-summary-item span { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: capitalize; }
.account-summary-item > strong { font-size: 12px; white-space: nowrap; }

.ai-ready-badge { padding: 6px 9px; border-radius: 999px; color: var(--blue-950); background: var(--gold-300); font-size: 9px; font-weight: 800; }
.ai-finance-brief { display: grid; gap: 9px; margin: 18px 0 0; padding: 0; list-style: none; }
.ai-finance-brief li { position: relative; padding: 11px 12px 11px 29px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10px; line-height: 1.45; }
.ai-finance-brief li::before { position: absolute; top: 11px; left: 11px; color: var(--gold-300); content: "✦"; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-300);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

html[data-ee-theme="white"] .eyebrow {
  color: #7d580d;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--hq-font-display);
  font-weight: 650;
  letter-spacing: -0.055em;
}

.hero h1 {
  font-size: clamp(50px, 7.2vw, 96px);
  line-height: 0.9;
}

.hero h1 em {
  color: var(--gold-300);
  font-weight: 400;
}

html[data-ee-theme="white"] .hero h1 em {
  color: #8b6314;
}

.hero-lede {
  max-width: 720px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.8vw, 19px);
  line-height: 1.7;
}

.identity-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.identity-row span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
}

.identity-row .pending {
  color: var(--gold-300);
  border-color: var(--line-strong);
}

html[data-ee-theme="white"] .identity-row .pending {
  color: #7d580d;
}

.mode-console {
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.mode-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0 24px;
}

.mode-status strong,
.mode-status small {
  display: block;
}

.mode-status strong {
  font-size: 14px;
  line-height: 1.35;
}

.mode-status small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.mode-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 12px color-mix(in srgb, var(--warning) 70%, transparent);
}

.mode-dot.demo {
  background: var(--gold-500);
}

.gold-button {
  width: 100%;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  color: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 8px 22px rgba(226, 182, 77, 0.14);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

/* the same control once demo is on: an outline pill, so it never reads as the primary action */
.gold-button.is-active {
  color: var(--gold-300);
  background: transparent;
  box-shadow: none;
}
.gold-button.is-active:hover { background: rgba(226, 182, 77, 0.12); }

.gold-button:hover {
  filter: brightness(1.05);
}

.text-button {
  display: block;
  margin: 14px auto 0;
  padding: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-ribbon,
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(226, 182, 77, 0.12);
  font-size: 12px;
}

.demo-ribbon strong {
  color: var(--gold-300);
  letter-spacing: 0.12em;
}

html[data-ee-theme="white"] .demo-ribbon strong {
  color: #74500a;
}

.demo-ribbon span {
  flex: 1;
  color: var(--muted);
}

.demo-ribbon button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.demo-ribbon button:hover { background: rgba(255, 255, 255, 0.08); }

.notice {
  border-color: var(--line);
  background: var(--surface);
}

.finance-office,
.inbox-office,
.company-health,
.activity-section {
  padding: clamp(26px, 4vw, 50px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: color-mix(in srgb, var(--surface-solid) 58%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.inbox-office,
.company-health,
.activity-section {
  margin-top: 28px;
}

.section-heading,
.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.95;
}

.section-heading > p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.freshness,
.panel-note {
  color: var(--muted);
  font-size: 11px;
}

.inbox-heading-copy {
  display: grid;
  justify-items: end;
  gap: 10px;
  max-width: 480px;
}

.inbox-heading-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: right;
}

.inbox-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
}

.inbox-heading-actions .inbox-map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--gold-500);
  border-radius: 999px;
  color: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  box-shadow: 0 10px 28px rgba(226, 182, 77, .24);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
}

.inbox-heading-actions .inbox-map-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inbox-heading-actions .inbox-map-button:hover,
.inbox-heading-actions .inbox-map-button:focus-visible {
  background: linear-gradient(135deg, var(--gold-500), #c99624);
  box-shadow: 0 13px 34px rgba(226, 182, 77, .34);
  outline: 3px solid color-mix(in srgb, var(--gold-300) 34%, transparent);
  outline-offset: 3px;
}

.inbox-heading-actions .inbox-map-button span {
  color: var(--blue-950);
}

.inbox-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.inbox-stat {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.inbox-stat::after {
  position: absolute;
  right: -14px;
  bottom: -28px;
  width: 72px;
  height: 72px;
  content: "";
  border-radius: 50%;
  background: var(--stat-glow, var(--blue-500));
  filter: blur(24px);
  opacity: 0.22;
}

.inbox-stat span,
.inbox-stat strong {
  position: relative;
  z-index: 1;
  display: block;
}

.inbox-stat span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inbox-stat strong {
  margin-top: 8px;
  font: 650 34px/.98 var(--hq-font-display);
}

.inbox-stat.urgent {
  --stat-glow: var(--danger);
}

.inbox-stat.reply,
.inbox-stat.waiting {
  --stat-glow: var(--gold-500);
}

.inbox-stat.fyi {
  --stat-glow: var(--blue-500);
}

.inbox-stat.filtered {
  --stat-glow: var(--muted);
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
}

.inbox-slots-panel,
.inbox-queue-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.inbox-slots-panel h3,
.inbox-queue-panel h3 {
  margin: 0;
  font-family: var(--hq-font-display);
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.inbox-slots {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.inbox-slot {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  min-height: 88px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.inbox-slot.is-connected {
  border-color: color-mix(in srgb, var(--success) 50%, var(--line));
}

.inbox-slot.is-pending {
  border-color: color-mix(in srgb, var(--gold-500) 55%, var(--line));
}

.inbox-slot.has-error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
}

.inbox-slot-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-300);
  font: 650 14px/1 var(--hq-font-display);
}

html[data-ee-theme="white"] .inbox-slot-index {
  color: #74500a;
}

.inbox-slot-copy strong,
.inbox-slot-copy span,
.inbox-slot-copy small {
  display: block;
}

.inbox-slot-copy strong {
  padding-right: 92px;
  font-size: 12px;
}

.inbox-slot-copy span {
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-slot-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.inbox-slot-action {
  grid-column: 2;
  width: fit-content;
  min-height: 32px;
  margin-top: 2px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-solid);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-slot-action[data-gmail-action="connect"] {
  color: var(--blue-950);
  border-color: var(--gold-500);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
}

.inbox-slot-action:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-soft);
  cursor: wait;
}

.inbox-slot-status {
  position: absolute;
  top: 14px;
  right: 14px;
  max-width: 104px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inbox-slot.is-connected .inbox-slot-status {
  color: var(--success);
}

.inbox-slot.is-pending .inbox-slot-status {
  color: var(--gold-300);
}

.inbox-slot.has-error .inbox-slot-status {
  color: var(--danger);
}

.inbox-privacy-note {
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.notice[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success) 55%, var(--line));
}

.notice[data-tone="error"] {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
}

.inbox-toolbar,
.inbox-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inbox-check-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--gold-500);
  border-radius: 11px;
  color: var(--blue-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-filter-row {
  margin: 22px 0 13px;
}

.inbox-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inbox-filters button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-filters button[aria-pressed="true"] {
  color: var(--blue-950);
  border-color: var(--gold-500);
  background: var(--gold-300);
}

.inbox-queue {
  display: grid;
  gap: 9px;
}

.inbox-message {
  display: grid;
  grid-template-columns: 5px minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.inbox-message-signal {
  width: 5px;
  height: 52px;
  border-radius: 999px;
  background: var(--blue-500);
}

.inbox-message-signal.urgent {
  background: var(--danger);
  box-shadow: 0 0 18px color-mix(in srgb, var(--danger) 45%, transparent);
}

.inbox-message-signal.important {
  background: var(--gold-500);
}

.inbox-message-copy {
  min-width: 0;
}

.inbox-message-copy > strong,
.inbox-message-copy > small {
  display: block;
}

.inbox-message-copy > strong {
  margin-top: 6px;
  font-size: 12px;
}

.inbox-message-copy p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.inbox-message-copy > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.inbox-message-meta time {
  white-space: nowrap;
}

.inbox-message-action {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.message-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.message-status.needs-reply,
.message-status.unreviewed {
  color: var(--gold-300);
  border: 1px solid var(--line-strong);
}

html[data-ee-theme="white"] .message-status.needs-reply,
html[data-ee-theme="white"] .message-status.unreviewed {
  color: #74500a;
}

.inbox-message-action button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.inbox-empty {
  display: grid;
  min-height: 238px;
  place-content: center;
  justify-items: center;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
}

.inbox-empty > span {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold-300);
}

.inbox-empty strong {
  color: var(--ink);
  font: 650 23px/1.05 var(--hq-font-display);
}

.inbox-empty p {
  max-width: 390px;
  margin: 9px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric {
  min-height: 128px;
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  container-type: inline-size;
  overflow: hidden;
}

.metric span,
.metric strong,
.metric small {
  display: block;
}

.metric span {
  min-height: 31px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
}

.metric strong {
  margin-top: 10px;
  font-family: var(--hq-font-display);
  /* sized by the card itself, so a ten-character figure always fits inside its bubble */
  font-size: clamp(20px, 10.5cqi, 38px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.metric small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.metric.is-warning strong {
  color: var(--warning);
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
}

.lower-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  margin-top: 18px;
}

.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.panel h3,
.health-grid h3 {
  margin: 0;
  font-family: var(--hq-font-display);
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.readiness-score,
.attention-count {
  color: var(--gold-300);
  font-size: 13px;
}

html[data-ee-theme="white"] .readiness-score,
html[data-ee-theme="white"] .attention-count {
  color: #74500a;
}

.readiness-list {
  display: grid;
  gap: 0;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.readiness-item {
  position: relative;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  gap: 12px;
  min-height: 66px;
}

.readiness-item:not(:last-child)::after {
  position: absolute;
  top: 28px;
  bottom: 0;
  left: 13px;
  width: 1px;
  content: "";
  background: var(--line);
}

.stage-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-solid);
  font-size: 11px;
  font-weight: 800;
}

.readiness-item.complete .stage-dot {
  color: var(--blue-950);
  border-color: var(--success);
  background: var(--success);
}

.stage-copy strong,
.stage-copy small {
  display: block;
}

.stage-copy strong {
  font-size: 13px;
}

.stage-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.attention-list {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.attention-item,
.empty-message {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.attention-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.attention-item strong,
.attention-item small {
  display: block;
}

.attention-item strong {
  font-size: 12px;
}

.attention-item small,
.empty-message {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.attention-item button {
  min-height: 35px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--gold-300);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

html[data-ee-theme="white"] .attention-item button {
  color: #74500a;
}

.table-wrap {
  margin: 18px -8px -6px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  font-size: 11px;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.money {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.money.expense {
  color: var(--danger);
}

.money.income {
  color: var(--success);
}

.record-status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
}

.record-status.open {
  color: var(--warning);
}

.empty-ledger td {
  padding: 40px 10px;
  color: var(--muted);
  text-align: center;
}

.estimate-amount {
  margin: 22px 0 12px;
  color: var(--gold-300);
  font-family: var(--hq-font-display);
  font-size: clamp(48px, 6vw, 74px);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

html[data-ee-theme="white"] .estimate-amount {
  color: #74500a;
}

.estimate-panel > p:not(.eyebrow, .disclaimer),
.export-panel > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.mini-definition {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.mini-definition div {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.mini-definition dt,
.mini-definition dd {
  margin: 0;
  font-size: 10px;
}

.mini-definition dt {
  color: var(--muted);
}

.mini-definition dd {
  text-align: right;
}

.disclaimer {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  line-height: 1.55;
}

.cadence-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.cadence-columns h4 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.checklist span {
  color: var(--gold-300);
  font-weight: 800;
}

html[data-ee-theme="white"] .checklist span {
  color: #74500a;
}

.export-panel .gold-button {
  margin-top: 13px;
}

.export-review {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.export-review p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.export-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.export-actions button {
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.health-grid article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.office-code {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--gold-300);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

html[data-ee-theme="white"] .office-code {
  color: #74500a;
}

.health-grid h3 {
  margin-top: 26px;
}

.health-grid p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.health-grid strong,
.health-grid a {
  font-size: 10px;
}

.health-grid a {
  color: var(--gold-300);
}

html[data-ee-theme="white"] .health-grid a {
  color: #74500a;
}

.chart-frame { position: relative; min-height: 260px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(155deg, rgba(57,120,239,.16), rgba(226,182,77,.06)); background-size: 100% 52px, 95px 100%, auto; }
.cashflow-chart { display: block; width: 100%; height: 260px; overflow: visible; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; font-size: 11px; }
.chart-line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line--income { stroke: var(--gold-300); }
.chart-line--expense { stroke: #74d5ff; }
.chart-point { stroke: var(--canvas); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-point--income { fill: var(--gold-300); }
.chart-point--expense { fill: #74d5ff; }
.chart-area--income { fill: url(#incomeAreaGradient); }
.category-visual { display: grid; grid-template-columns: minmax(150px, 200px) 1fr; align-items: center; gap: 24px; margin-top: 18px; }
.category-chart { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
.category-ring-track { fill: none; stroke: var(--surface-soft); stroke-width: 22; }
.category-segment { fill: none; stroke-width: 22; transition: stroke-dasharray 350ms ease; }
.category-legend { display: grid; gap: 10px; }
.category-key { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 8px; font-size: 10px; }
.category-key i { width: 9px; height: 9px; border-radius: 50%; }
.category-key span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.category-key strong { font-variant-numeric: tabular-nums; }
.sr-chart-summary { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.more-sheet { width: min(520px, 100%); max-width: none; padding: 12px 16px calc(20px + var(--hq-safe-bottom)); border: 1px solid var(--line-strong); border-radius: 28px 28px 0 0; color: var(--ink); background: color-mix(in srgb, var(--surface-solid) 95%, transparent); box-shadow: 0 -30px 90px rgba(0,8,30,.55); }
.more-sheet[open] { display: block; position: fixed; inset: auto 0 0; margin: auto; }
.more-sheet::backdrop { background: rgba(0,8,30,.72); backdrop-filter: blur(8px); }
.sheet-handle { width: 44px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: var(--line-strong); }
.sheet-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 6px 4px 14px; }
.sheet-heading h2 { margin: 0; font: 650 29px/1 var(--hq-font-display); }
.sheet-heading button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-soft); cursor: pointer; }
.more-sheet nav { display: grid; gap: 8px; }
.more-sheet nav a, .more-sheet nav button { display: grid; min-height: 58px; gap: 3px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface-soft); text-align: left; text-decoration: none; cursor: pointer; }
.more-sheet nav span { font-size: 12px; font-weight: 700; }
.more-sheet nav small { color: var(--muted); font-size: 9px; }

.cloud-error-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(1320px, calc(100% - 36px)); margin: 0 auto 16px; padding: 14px 16px; border: 1px solid var(--danger); border-radius: 15px; background: color-mix(in srgb, var(--danger) 12%, var(--surface-solid)); }
.cloud-error-banner div { display: grid; gap: 3px; }
.cloud-error-banner strong { font-size: 11px; }
.cloud-error-banner span { color: var(--muted); font-size: 9px; }
.cloud-error-banner button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--blue-950); background: var(--gold-300); font-weight: 800; cursor: pointer; }
