/* BusyBooks v6: official brand kit palette + single-conversation 5-tab UI */
:root {
  /* Official brand kit tokens */
  --forest: #1F3D2B;
  --forest-2: #2A523A;
  --lime: #C6F135;
  --lime-2: #B8E522;
  --lime-ink: #13261A;
  --bg: #F7F4EC;
  --bg-2: #EFECE2;
  --sage: #E8EFE9;
  --sage-2: #D2DFD4;
  --books-gray: #5C6B5E;

  /* Surfaces & accessible typography */
  --card: #FFFFFF;
  --ink: #13261A;
  --ink-2: #3A4B3E;
  --muted: #536255;
  --line: #DDE0D6;
  --green: #1F3D2B;
  --green-2: #2E6B47;
  --amber: #E5A93B;
  --serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(19, 38, 26, .05), 0 12px 32px -12px rgba(19, 38, 26, .12);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --step-0: 0.875rem; --step-1: 1rem; --step-2: 1.125rem; --step-3: 1.25rem;
  --prose: 68ch;
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Dark app window (anchored on forest #1F3D2B) */
  --w-bg: #112419;
  --w-side: #0D1C13;
  --w-line: rgba(247, 244, 236, .1);
  --w-text: #F7F4EC;
  --w-muted: #A9B8AC;
  --w-bubble: #1B3827;
  --w-card: #173022;
  --w-lime: #C6F135;
  --w-mention: #8FD3FF;

  /* Text roles and type scale (shared with the app shell) */
  --text: var(--ink);
  --text-muted: var(--muted);
  --text-secondary: var(--ink-2);
  --text-inverse: #F7F4EC;
  --text-inverse-muted: #D4E2D7;
  --text-on-lime: var(--lime-ink);
  --text-placeholder: #5C6B5E;
  --link: var(--forest);
  --link-hover: var(--forest-2);
  --danger: #B42318;
  --danger-on-dark: #FCA5A5;
  --fs-xs: 12.5px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;
}


/* Metric-matched fallbacks so swap does not shift the homepage */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 90.2%;
  descent-override: 22.48%;
  line-gap-override: 0%;
  size-adjust: 107.64%;
}
@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Georgia");
  ascent-override: 92%;
  descent-override: 27%;
  line-gap-override: 0%;
  size-adjust: 102%;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/inter/v20/UcCo3FwrK3iLTcviYwYZ8UA3.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/instrumentserif/v5/jizBRFtNs2ka5fXjeivQ4LroWlx-6zUTjnTLgNs.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("https://fonts.gstatic.com/s/instrumentserif/v5/jizHRFtNs2ka5fXjeivQ4LroWlx-6zAjjH7Motmp5g.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  padding-top: var(--safe-top);
}
input::placeholder, textarea::placeholder { color: var(--text-placeholder); opacity: 1; }
.tabular, .tx-amt, .dash-stat strong, .pl-metric b, .stat b, .money {
  font-variant-numeric: tabular-nums;
}
.prose { max-width: var(--prose); }
.legal-article p, .legal-article li, .section-sub, .hero-sub, .founder-note { max-width: var(--prose); }
img, svg { display: block; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
.btn, .btn:hover, .logo, .logo:hover, .site-nav a, .site-nav a:hover, .exc-chip, .win-tab { color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--green-2); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--forest); color: var(--text-inverse); padding: 10px 14px; border-radius: 10px; text-decoration: none; }
.skip-link:focus { top: 12px; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Official Brand Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -.02em; color: var(--forest); }
.logo-svg { width: 21px; height: 31px; flex: none; display: block; }
.logo-svg--sm { width: 17px; height: 25px; }
.logo-svg--xs { width: 14px; height: 20px; }
.logo-word { font-size: 18px; line-height: 1; color: var(--forest); font-weight: 700; }
.logo-word span { color: var(--books-gray); font-weight: 600; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 11px 20px; min-height: var(--tap); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease, border-color .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.btn-lime { background: var(--lime); color: var(--text-on-lime); box-shadow: 0 8px 20px -10px rgba(31, 61, 43, .45); }
.btn-lime:hover { background: var(--lime-2); }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--sage); border-color: var(--sage-2); }
.btn-forest { background: var(--forest); color: var(--text-inverse); }
.btn-forest:hover { background: var(--forest-2); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 244, 236, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.site-nav { display: flex; gap: 24px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.site-nav a { color: var(--text-secondary); text-decoration: none; white-space: nowrap; transition: color .15s; }
.site-nav a:hover { color: var(--link); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-login { display: none; font-size: 14px; font-weight: 600; color: var(--text-secondary); text-decoration: none; padding: 6px 8px; white-space: nowrap; }
.header-login:hover { color: var(--link); }

/* Hero */
.hero { padding: 40px 0 72px; position: relative; }
.section, .cta-inner { scroll-margin-top: 78px; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 740px; background: radial-gradient(62% 52% at 50% 24%, rgba(198, 241, 53, .16), rgba(232, 239, 233, .78) 45%, transparent 74%); pointer-events: none; z-index: -1; }
.hero-copy { text-align: center; max-width: 860px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--forest); background: var(--sage); border: 1px solid var(--sage-2); padding: 6px 14px; border-radius: 999px; }
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-2); box-shadow: 0 0 0 0 rgba(46, 107, 71, .5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 107, 71, .45); } 70% { box-shadow: 0 0 0 8px rgba(46, 107, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(46, 107, 71, 0); } }
.hero-title { font-family: var(--sans); font-weight: 600; font-size: clamp(40px, 6vw, 70px); line-height: 1.02; letter-spacing: -.035em; margin: 22px auto 0; color: var(--ink); min-height: calc(2.08 * clamp(40px, 6vw, 70px)); }
.hero-title em, .section-title em, .cta-title em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--forest); }
.hero-sub { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 650px; margin: 20px auto 0; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.trust-row { list-style: none; padding: 0; margin: 22px 0 0; display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.trust-row li { display: inline-flex; align-items: center; gap: 7px; }
.trust-row li::before { content: ""; width: 15px; height: 15px; border-radius: 50%; background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%231F3D2B' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; border: 1px solid var(--sage-2); }

/* Demo window: clean single-conversation + 5-tab layout */
.demo-container { max-width: 980px; margin-top: 40px; scroll-margin-top: 84px; }
.app-window {
  --win-h: 640px;
  --win-chrome: 90px;
  background: var(--w-bg); color: var(--w-text); border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(31, 61, 43, .32), 0 32px 84px -24px rgba(17, 36, 25, .58), 0 10px 24px -12px rgba(17, 36, 25, .36);
  font-size: 14px; position: relative; display: flex; flex-direction: column;
  height: calc(var(--win-chrome) + var(--win-h));
  min-height: calc(var(--win-chrome) + var(--win-h));
}
.win-titlebar { height: 42px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px; background: var(--w-side); border-bottom: 1px solid var(--w-line); }
.win-dots { display: flex; gap: 7px; flex: none; }
.win-dots i { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.win-dots i:nth-child(2) { background: #FEBC2E; }
.win-dots i:nth-child(3) { background: #28C840; }
.win-brand { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.win-title { font-size: 12.5px; color: var(--w-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-titlebar-right { display: flex; align-items: center; gap: 10px; flex: none; }
.sample-badge { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--w-lime); border: 1px solid rgba(198, 241, 53, .35); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--w-muted); white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(198, 241, 53, .6); animation: pulse 2s infinite; }
.app-window.is-paused .live-dot { background: var(--amber); animation: none; }
.app-window[data-mode="interactive"] .live-dot { background: #8FD3FF; animation: none; }

/* Top Tab Bar inside app window */
.win-tabs-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; min-height: 48px; flex: none; background: var(--w-side); border-bottom: 1px solid var(--w-line);
}
.win-tabs {
  display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; min-width: 0;
}
.win-tabs::-webkit-scrollbar { display: none; }
.win-tab {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; background: transparent; color: var(--w-muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .18s, color .18s, border-color .18s; white-space: nowrap;
}
.win-tab:hover { color: var(--w-text); background: rgba(247, 244, 236, .06); }
.win-tab[aria-selected="true"] { background: rgba(198, 241, 53, .14); color: var(--w-lime); border-color: rgba(198, 241, 53, .32); }
.win-tab.is-flash { animation: tabFlash .9s ease; }
@keyframes tabFlash {
  0% { box-shadow: 0 0 0 0 rgba(198, 241, 53, .65); background: rgba(198, 241, 53, .28); color: var(--w-lime); }
  100% { box-shadow: 0 0 0 8px rgba(198, 241, 53, 0); }
}
.tab-count {
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: rgba(247, 244, 236, .12); color: var(--w-text); font-variant-numeric: tabular-nums;
}
.win-tab[aria-selected="true"] .tab-count { background: var(--lime); color: var(--lime-ink); }
.win-user-pill { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 12px; color: var(--w-muted); }
.user-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--w-bubble); border: 1px solid var(--w-line); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--w-lime); }

/* Tab panels container */
.win-panels { height: var(--win-h); flex: none; display: flex; flex-direction: column; min-height: 0; position: relative; background: radial-gradient(85% 60% at 50% 0%, rgba(31, 61, 43, .42), transparent 72%); }
.win-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.win-panel[hidden] { display: none !important; }
.win-panel--scroll { overflow-y: auto; padding: 20px 22px 26px; gap: 18px; scrollbar-width: thin; scrollbar-color: rgba(247, 244, 236, .15) transparent; }

/* Home Panel: Header Summary + Live P&L + Exceptions Strip + Single Chat */
.home-summary {
  padding: 14px 20px 12px; background: rgba(13, 28, 19, .68); border-bottom: 1px solid var(--w-line);
  display: flex; flex-direction: column; gap: 10px;
}
.home-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.home-headline-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-headline { font-size: 14.5px; font-weight: 650; color: var(--w-text); letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; }
.pl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; }
.home-progress { width: 88px; height: 6px; border-radius: 999px; background: rgba(247, 244, 236, .12); overflow: hidden; }
.home-progress em { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), var(--lime)); border-radius: inherit; transition: width .4s ease; }
.live-pl-learn { font-size: 12px; color: var(--w-muted); }
.live-pl-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pl-metric { background: rgba(247, 244, 236, .04); border: 1px solid var(--w-line); border-radius: 10px; padding: 7px 11px; min-width: 0; }
.pl-metric span { display: block; font-size: 11px; color: var(--w-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-metric b { display: block; font-size: 15px; font-weight: 650; color: var(--text-inverse); font-variant-numeric: tabular-nums; letter-spacing: -.015em; margin-top: 2px; transition: color .3s; }
.pl-metric.is-flash b { color: var(--w-lime); }

/* Exceptions Strip */
.exc-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 20px; background: rgba(229, 169, 59, .08); border-bottom: 1px solid rgba(229, 169, 59, .22);
  transition: background .25s, border-color .25s;
}
.exc-strip.is-clear { background: rgba(198, 241, 53, .06); border-bottom-color: var(--w-line); }
.exc-left { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.live-pl-need { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(229, 169, 59, .2); color: #F7D186; border: 1px solid rgba(229, 169, 59, .4); white-space: nowrap; }
.live-pl-need.is-clear { background: rgba(198, 241, 53, .16); color: var(--w-lime); border-color: rgba(198, 241, 53, .38); }
.exc-sub { color: var(--w-muted); }
.exc-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.exc-chip {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(198, 241, 53, .36); background: rgba(198, 241, 53, .1);
  color: var(--w-lime); cursor: pointer; transition: background .15s, transform .12s; white-space: nowrap;
}
.exc-chip:hover { background: rgba(198, 241, 53, .2); }
.exc-chip:active { transform: scale(.97); }

/* Single Continuous Chat */
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(247, 244, 236, .16) transparent; }
.chat-inner { min-height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: 18px 22px 24px; }
.ts { text-align: center; font-size: 11.5px; color: var(--w-muted); margin: 4px 0; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: msgIn .26s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg--user { justify-content: flex-end; }
.msg--user .bubble { background: var(--w-bubble); border: 1px solid rgba(247, 244, 236, .11); border-radius: 16px 16px 4px 16px; padding: 10px 14px; max-width: 78%; color: var(--w-text); font-size: 14.5px; }
.mention { color: var(--w-mention); font-weight: 600; }
.msg-av-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--forest); border: 1px solid rgba(247, 244, 236, .14);
  display: grid; place-items: center; flex: none; margin-top: 2px;
}
.msg-av-mark.is-working { box-shadow: 0 0 0 3px rgba(198, 241, 53, .28); }
.msg-body { min-width: 0; flex: 1; max-width: 660px; }
.msg-head { font-size: 12px; color: var(--w-muted); font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.msg-head b { color: var(--w-text); }
.msg-head span { font-weight: 400; font-size: 11px; opacity: .78; }
.bubble { color: var(--w-text); font-size: 14.5px; line-height: 1.5; }
.bubble strong { color: var(--text-inverse); font-weight: 600; }
.caret::after { content: ""; display: inline-block; width: 2px; height: 1em; background: var(--lime); margin-left: 2px; vertical-align: text-bottom; animation: blink .8s infinite; }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 8px 12px; background: var(--w-card); border: 1px solid var(--w-line); border-radius: 12px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--w-muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.status-row { display: flex; align-items: center; gap: 8px; padding-left: 40px; font-size: 12.5px; color: var(--w-muted); animation: msgIn .25s ease both; }
.ring { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(198, 241, 53, .25); border-top-color: var(--lime); animation: spin .8s linear infinite; flex: none; }
.status-row.is-done .ring { border-color: var(--lime); background: var(--lime); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Rich inline cards inside chat */
.wcard { margin-top: 8px; background: var(--w-card); border: 1px solid var(--w-line); border-radius: 14px; padding: 14px; }
.wcard-head { display: flex; align-items: center; gap: 10px; }
.vmark { width: 32px; height: 32px; border-radius: 9px; background: rgba(198, 241, 53, .14); border: 1px solid rgba(198, 241, 53, .3); color: var(--w-lime); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.wcard-title { flex: 1; min-width: 0; }
.wcard-title b { display: block; font-size: 13.5px; color: var(--text-inverse); }
.wcard-title span { display: block; font-size: 12px; color: var(--w-muted); }
.wcard-amt { text-align: right; font-weight: 700; font-size: 15px; color: var(--text-inverse); font-variant-numeric: tabular-nums; }
.wcard-amt small { display: block; font-size: 11px; font-weight: 500; color: var(--w-muted); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pill { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(247, 244, 236, .08); color: var(--w-text); border: 1px solid var(--w-line); }
.pill--cat { background: rgba(143, 211, 255, .12); color: #B5E3FF; border-color: rgba(143, 211, 255, .28); }
.pill--ok { background: rgba(198, 241, 53, .16); color: var(--w-lime); border-color: rgba(198, 241, 53, .35); }
.pill--warn { background: rgba(229, 169, 59, .18); color: #F7D186; border-color: rgba(229, 169, 59, .35); }
.why-line { font-size: 12.5px; color: var(--w-muted); margin-top: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgba(247, 244, 236, .04); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 20px; font-weight: 650; color: var(--text-inverse); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--w-muted); }
.stat--warn b { color: #F7D186; }
.mini-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--w-text); padding: 7px 10px; border-radius: 8px; background: rgba(247, 244, 236, .04); }
.mini-list li span:last-child { color: var(--w-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-list li.more { justify-content: center; color: var(--w-muted); background: transparent; padding: 2px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wbtn { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--w-line); background: rgba(247, 244, 236, .06); color: var(--w-text); cursor: pointer; transition: background .2s, color .2s, border-color .2s; text-decoration: none; }
.wbtn--primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.wbtn.is-pressed { transform: scale(.96); }
.wbtn:disabled { cursor: default; opacity: .85; }
.wcard.is-done { border-color: rgba(198, 241, 53, .42); }
.receipt-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--w-line); }
.receipt-row:first-of-type { border-top: 0; padding-top: 0; }
.receipt-match { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #9DEAB8; margin-top: 3px; }
.receipt-thumb { width: 14px; height: 17px; border-radius: 2px; background: #E8EFE9; position: relative; flex: none; }
.receipt-thumb::after { content: ""; position: absolute; inset: 4px 3px auto; height: 7px; background: repeating-linear-gradient(#9AA79F 0 1px, transparent 1px 3px); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font-size: 12.5px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(198, 241, 53, .34); background: transparent; color: var(--w-lime); cursor: pointer; transition: background .2s; }
.chip:hover, .chip.is-picked { background: rgba(198, 241, 53, .16); }
.health-top { display: flex; justify-content: space-between; align-items: baseline; }
.health-pct { font-size: 34px; font-weight: 650; letter-spacing: -.03em; color: var(--text-inverse); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: rgba(247, 244, 236, .09); overflow: hidden; margin: 8px 0 12px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green-2), var(--lime)); border-radius: inherit; transition: width .3s linear; }
.health-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12.5px; color: var(--w-muted); }
.health-rows b { color: var(--w-text); font-weight: 600; }
.pl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.pl td { padding: 6px 0; border-top: 1px solid var(--w-line); color: var(--w-text); }
.pl td:last-child { text-align: right; }
.pl tr.total td { font-weight: 700; color: var(--w-lime); border-top-color: rgba(198, 241, 53, .32); }
.card-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--w-muted); font-weight: 600; }
.cap-grid, .wt-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 560px; }
.cap { background: var(--w-card); border: 1px solid var(--w-line); border-radius: 12px; padding: 10px 12px; }
.cap b { display: block; font-size: 13px; color: var(--text-inverse); }
.cap span { font-size: 12px; color: var(--w-muted); }
.wcard select { background: var(--w-bg); border: 1px solid var(--w-line); color: var(--w-text); border-radius: 8px; padding: 5px 8px; font-size: 12.5px; max-width: 170px; }
.wcard a { color: var(--w-mention); }

/* Tab subviews (dark inside demo window) */
.ws-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ws-head h3 { font-size: 19px; font-weight: 650; color: var(--text-inverse); letter-spacing: -.02em; }
.ws-head p { font-size: 13px; color: var(--w-muted); margin-top: 2px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.kpi-card { background: var(--w-card); border: 1px solid var(--w-line); border-radius: 14px; padding: 14px; }
.kpi-card span { display: block; font-size: 11.5px; color: var(--w-muted); font-weight: 500; }
.kpi-card strong { display: block; font-size: 24px; font-weight: 650; color: var(--text-inverse); letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi-card small { display: block; font-size: 11.5px; color: var(--w-lime); margin-top: 4px; font-weight: 600; }

.ws-card { background: var(--w-card); border: 1px solid var(--w-line); border-radius: 14px; padding: 16px; }
.ws-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ws-card-head h4 { font-size: 14px; font-weight: 650; color: var(--text-inverse); }

.cf-bars { display: flex; flex-direction: column; gap: 12px; }
.cf-row { display: grid; grid-template-columns: 56px 1fr 124px; align-items: center; gap: 12px; font-size: 12.5px; }
.cf-month { font-weight: 600; color: var(--w-muted); }
.cf-tracks { display: flex; flex-direction: column; gap: 4px; }
.cf-track { height: 8px; border-radius: 999px; background: rgba(247, 244, 236, .08); overflow: hidden; }
.cf-bar-in { display: block; height: 100%; border-radius: inherit; background: var(--lime); transition: width .4s ease; }
.cf-bar-out { display: block; height: 100%; border-radius: inherit; background: rgba(247, 244, 236, .38); transition: width .4s ease; }
.cf-nums { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--w-text); line-height: 1.3; }
.cf-nums span { display: block; color: var(--w-muted); }

.spark-wrap { width: 100%; height: 110px; margin-top: 8px; }
.spark-wrap svg { width: 100%; height: 100%; overflow: visible; }
.spark-labels { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--w-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

.rule-list { display: flex; flex-direction: column; gap: 8px; }
.rule-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 12px; background: rgba(247, 244, 236, .04); border: 1px solid var(--w-line);
}
.rule-main strong { display: block; font-size: 13.5px; color: var(--text-inverse); }
.rule-main span { display: block; font-size: 12px; color: var(--w-muted); margin-top: 2px; }
.rule-cat { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(198, 241, 53, .14); color: var(--w-lime); border: 1px solid rgba(198, 241, 53, .28); white-space: nowrap; }
.rule-toggle {
  width: 40px; height: 22px; border-radius: 999px; border: 1px solid var(--w-line);
  background: rgba(247, 244, 236, .14); position: relative; cursor: pointer; transition: background .2s, border-color .2s; flex: none;
}
.rule-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #F7F4EC; transition: transform .2s;
}
.rule-toggle[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); }
.rule-toggle[aria-pressed="true"]::after { background: var(--lime-ink); transform: translateX(18px); }

.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Toast */
.toast { position: absolute; left: 50%; top: 102px; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; display: inline-flex; align-items: center; gap: 8px; background: var(--lime); color: var(--lime-ink); font-weight: 650; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5); transition: opacity .3s, transform .35s cubic-bezier(.2, .9, .3, 1.2); white-space: nowrap; z-index: 4; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Composer */
.composer { margin: 0 18px 14px; display: flex; align-items: center; gap: 8px; background: rgba(247, 244, 236, .05); border: 1px solid var(--w-line); border-radius: 14px; padding: 6px 6px 6px 10px; transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(198, 241, 53, .55); box-shadow: 0 0 0 3px rgba(198, 241, 53, .14); }
.composer-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--w-text); font-size: 14.5px; padding: 8px 4px; }
.composer-input::placeholder { color: var(--w-muted); }
.app-window[data-mode="auto"] .composer-input { cursor: pointer; }
.comp-icon, .comp-send { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 0; background: rgba(247, 244, 236, .08); color: var(--w-text); cursor: pointer; flex: none; transition: background .2s, color .2s; }
.comp-send .ico-send { display: none; }
.composer.has-text .comp-send { background: var(--lime); color: var(--lime-ink); }
.composer.has-text .comp-send .ico-send { display: block; }
.composer.has-text .comp-send .ico-mic { display: none; }
.comp-send:disabled { opacity: .5; cursor: default; }
.takeover-hint { position: absolute; bottom: 64px; right: 24px; font-size: 11.5px; color: var(--w-muted); background: var(--w-side); border: 1px solid var(--w-line); padding: 5px 10px; border-radius: 8px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none; }
.app-window[data-mode="auto"] .composer:hover ~ .takeover-hint { opacity: 1; transform: none; }

/* Demo controls */
.demo-controls { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.ctrl-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.ctrl-btn:hover { border-color: var(--sage-2); background: var(--sage); }
.ctrl-btn .ico-play { display: none; }
.ctrl-btn.is-paused .ico-play { display: block; }
.ctrl-btn.is-paused .ico-pause { display: none; }
.scene-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.scene-dot { position: relative; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; color: var(--ink-2); cursor: pointer; overflow: hidden; transition: border-color .2s, color .2s, background .2s; }
.scene-dot .prog { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--green-2); }
.scene-dot[aria-current="true"] { border-color: var(--forest); background: var(--sage); color: var(--forest); font-weight: 600; }
.scene-dot:hover { border-color: var(--sage-2); }
.app-window[data-mode="interactive"] ~ .demo-controls .scene-dot[aria-current="true"] { border-color: var(--line); background: var(--card); font-weight: 400; color: var(--ink-2); }
.demo-note { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* Sections */
.section { padding: 84px 0; }
.section-kicker { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--forest); }
.section-title { font-size: clamp(30px, 4.2vw, 48px); font-weight: 600; letter-spacing: -.03em; line-height: 1.07; margin-top: 10px; max-width: 780px; color: var(--ink); }
.section-sub { color: var(--ink-2); font-size: 17px; max-width: 640px; margin-top: 14px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 16px; }

/* What you get */
.what { background: var(--sage); border-top: 1px solid var(--sage-2); border-bottom: 1px solid var(--sage-2); }
.benefits { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 38px; }
.benefit { background: var(--card); border: 1px solid var(--sage-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.benefit-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--forest); color: var(--lime); font-weight: 700; font-size: 12.5px; }
.benefit h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin-top: 16px; color: var(--ink); }
.benefit p { font-size: 14.5px; color: var(--ink-2); margin-top: 8px; }

/* Pricing */
.pricing-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.billing-toggle { display: inline-flex; background: var(--sage); border: 1px solid var(--sage-2); border-radius: 999px; padding: 4px; gap: 4px; }
.btog { border: 0; background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btog span { font-size: 11.5px; background: var(--lime); color: var(--lime-ink); padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.btog.is-active { background: var(--card); color: var(--forest); box-shadow: 0 1px 3px rgba(19, 38, 26, .1); }

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 36px; align-items: stretch; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.plan--pop { border-color: var(--forest); box-shadow: 0 0 0 1.5px var(--forest), 0 18px 40px -18px rgba(31, 61, 43, .24); }
.plan-badge { position: absolute; top: -12px; left: 24px; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(31, 61, 43, .16); }
.plan h3 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.plan-desc { font-size: 14px; color: var(--ink-2); margin-top: 6px; min-height: 42px; }
.plan-price { margin-top: 18px; display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.plan-price strong { font-size: 42px; font-weight: 650; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.plan-price span { font-size: 14px; color: var(--muted); }
.plan-list { list-style: none; padding: 18px 0 24px; margin: 18px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; color: var(--ink-2); flex: 1; }
.plan-list li { display: flex; align-items: flex-start; gap: 9px; }
.plan-list li::before { content: ""; width: 16px; height: 16px; flex: none; margin-top: 3px; border-radius: 50%; background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.8 7.2l2.1 2.1 4.3-4.5' fill='none' stroke='%231F3D2B' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; border: 1px solid var(--sage-2); }
.plan-cta { width: 100%; }

/* Refer & Partner */
.refer-partner { background: var(--sage); border-top: 1px solid var(--sage-2); border-bottom: 1px solid var(--sage-2); }
.rp-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 20px; margin-top: 36px; align-items: stretch; }
.rp-card { background: var(--card); border: 1px solid var(--sage-2); border-radius: var(--radius); padding: 28px 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.rp-card--ref { background: var(--forest); color: var(--text-inverse); border-color: rgba(31, 61, 43, .35); }
.rp-tag { display: inline-block; align-self: flex-start; font-size: 12px; font-weight: 650; padding: 4px 11px; border-radius: 999px; background: rgba(247, 244, 236, .12); color: var(--lime); }
.rp-tag--lime { background: var(--lime); color: var(--lime-ink); }
.rp-card h3 { font-size: 22px; font-weight: 650; letter-spacing: -.015em; margin-top: 14px; line-height: 1.2; }
.rp-card > p { font-size: 15px; margin-top: 10px; color: var(--ink-2); }
.rp-card--ref > p { color: var(--text-inverse-muted); }
.rp-perks { list-style: none; padding: 0; margin: 20px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.rp-perks li { background: rgba(247, 244, 236, .08); border: 1px solid rgba(247, 244, 236, .12); border-radius: 12px; padding: 11px 14px; font-size: 14.5px; color: var(--text-inverse); }
.rp-perks b { color: var(--lime); }
.rp-actions { margin-top: auto; }

/* Partner form */
.partner-form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-row--submit { align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field input, .field select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 14.5px; color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--forest); background: #fff; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"],
.wl-field input[aria-invalid="true"], .wl-field select[aria-invalid="true"] { border-color: #D9534F; }
.form-msg { font-size: 13.5px; min-height: 20px; color: var(--forest); }
.form-msg.is-error { color: var(--danger); }

.partner-success { margin-top: 18px; background: var(--sage); border: 1px solid var(--sage-2); border-radius: 14px; padding: 18px; }
.ps-badge { display: inline-block; font-size: 12px; font-weight: 700; color: var(--forest); background: rgba(198, 241, 53, .4); padding: 3px 10px; border-radius: 999px; }
.ps-copy { font-size: 14.5px; color: var(--ink); margin-top: 10px; }

/* Waitlist CTA band */
.cta-band { padding: 84px 0; }
.cta-inner { background: var(--forest); color: var(--text-inverse); border-radius: 28px; padding: 56px 36px; text-align: center; position: relative; overflow: hidden; scroll-margin-top: 80px; border: 1px solid rgba(31, 61, 43, .45); box-shadow: 0 24px 64px -24px rgba(17, 36, 25, .45); }
.cta-inner::before { content: ""; position: absolute; inset: auto -10% -60% -10%; height: 120%; background: radial-gradient(50% 50% at 50% 50%, rgba(198, 241, 53, .16), transparent 70%); pointer-events: none; }
.cta-kicker { position: relative; font-size: 12.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: var(--lime); }
.cta-title { font-size: clamp(32px, 4.6vw, 52px); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; max-width: 820px; margin: 10px auto 0; position: relative; }
.cta-title em { color: var(--lime); }
.cta-sub { color: var(--text-inverse-muted); font-size: var(--fs-lg); margin: 14px auto 0; max-width: 580px; position: relative; }

.waitlist-grid { position: relative; max-width: 680px; margin: 30px auto 0; text-align: left; }
.wl-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wl-field { display: flex; flex-direction: column; gap: 5px; }
.wl-field label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-inverse-muted); }
.wl-field input, .wl-field select, .wl-field textarea {
  width: 100%; background: rgba(247, 244, 236, .08); border: 1px solid rgba(247, 244, 236, .22);
  border-radius: 12px; padding: 11px 14px; font-size: 15px; color: var(--text-inverse); font-family: inherit;
}
.wl-field textarea { min-height: 88px; resize: vertical; }
.wl-field select option { background: var(--forest); color: var(--text-inverse); }
.wl-field input::placeholder, .wl-field textarea::placeholder { color: var(--text-inverse-muted); }
.wl-field input:focus, .wl-field select:focus, .wl-field textarea:focus { outline: none; border-color: var(--lime); background: rgba(247, 244, 236, .13); }
.wl-field .optional { font-weight: 500; color: var(--text-inverse-muted); }
.wl-check { display: inline-flex; align-items: center; gap: 9px; margin-top: 14px; font-size: var(--fs-sm); color: var(--text-inverse-muted); cursor: pointer; }
.wl-check input { width: 16px; height: 16px; accent-color: var(--lime); }
.wl-submit-row { margin-top: 18px; display: flex; justify-content: center; }
.wl-submit-row .btn { min-width: 240px; }
.waitlist-msg { min-height: 22px; margin-top: 12px; font-size: 14px; color: var(--lime); text-align: center; }
.waitlist-msg.is-error { color: var(--danger-on-dark); }

/* Waitlist success state */
.waitlist-success { position: relative; max-width: 760px; margin: 28px auto 0; display: grid; grid-template-columns: 0.68fr 1.32fr; gap: 16px; text-align: left; align-items: stretch; }
.waitlist-success[hidden] { display: none !important; }
.spot-card { background: rgba(247, 244, 236, .08); border: 1px solid rgba(198, 241, 53, .42); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; justify-content: center; }
.spot-label { font-size: 12px; font-weight: 600; color: var(--text-inverse-muted); text-transform: uppercase; letter-spacing: .06em; }
.spot-label small { text-transform: none; font-weight: 400; letter-spacing: 0; opacity: .85; }
.spot-num { font-size: 42px; font-weight: 700; color: var(--lime); letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.spot-hint { font-size: 13px; color: var(--text-inverse-muted); margin-top: 8px; }
.share-panel { background: rgba(247, 244, 236, .06); border: 1px solid rgba(247, 244, 236, .16); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.share-heading { font-size: 14.5px; font-weight: 600; color: var(--text-inverse); }
.ref-box { display: flex; gap: 8px; align-items: center; background: rgba(0, 0, 0, .26); border: 1px solid rgba(247, 244, 236, .16); border-radius: 12px; padding: 5px 5px 5px 12px; }
.ref-box input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text-inverse); font-size: var(--fs-xs); }
.ref-box--light { margin-top: 12px; background: #fff; border-color: var(--line); }
.ref-box--light input { color: var(--ink); }
.share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.share-pill { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: rgba(247, 244, 236, .1); border: 1px solid rgba(247, 244, 236, .16); color: var(--text-inverse); text-decoration: none; }
.share-pill:hover { background: rgba(247, 244, 236, .18); }
.link-reset { align-self: flex-start; margin-top: 10px; background: transparent; border: 0; padding: 0; font-size: 13px; color: var(--forest); text-decoration: underline; cursor: pointer; }
.link-reset--dark { color: var(--text-inverse-muted); margin-top: 2px; }

/* FAQ */
.faq { padding-top: 0; }
.faq-container { max-width: 820px; }
.faq-list { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; box-shadow: 0 1px 2px rgba(19, 38, 26, .04); }
.faq-item summary { font-weight: 650; font-size: 16px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; font-weight: 400; color: var(--forest); flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; font-size: var(--fs-sm); color: var(--text-secondary); }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--link); text-decoration: underline; }
.footer-copy { font-size: 13px; color: var(--muted); }

/* App page (/app.html): light workspace matching the same 5 tabs */
.app-page { min-height: 100vh; display: flex; flex-direction: column; }
.app-main { flex: 1; padding: 32px 0 72px; }
html:has(body.is-auth) { height: 100%; height: 100dvh; overflow: hidden; }
.app-page.is-auth { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; margin: 0; }
.app-page.is-auth .site-header,
.app-page.is-auth .site-footer { display: none; }
.app-page.is-auth .app-main {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  overflow: hidden;
}
.app-page.is-auth .app-main > .container { width: 100%; max-width: 400px; margin: 0; padding: 0; }
.auth-wrap {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 16px;
  box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: inherit; }
.auth-logo .logo-svg { width: 22px; height: auto; }
.auth-line { font-family: var(--sans); font-style: normal; font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.35; color: var(--ink-2); margin: 12px 0 0; text-align: center; overflow-wrap: anywhere; }
.auth-wrap h1.auth-line { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.auth-sub { color: var(--ink-2); font-size: 15px; margin-top: 10px; }
.auth-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.auth-submit { width: 100%; }
.auth-wrap .role-switch { margin: 14px 0 0; padding: 3px; border-radius: 999px; gap: 3px; }
.auth-wrap .role-opt { padding: 7px 8px; font-size: 13px; border-radius: 999px; }
.auth-foot { margin-top: 4px; font-size: 12.5px; color: var(--muted); text-align: center; display: flex; flex-direction: column; gap: 6px; }
.auth-foot-links { display: flex; justify-content: center; gap: 14px; }
.auth-foot a { color: var(--ink-2); text-decoration: none; }
.auth-foot a:hover { color: var(--forest); text-decoration: underline; }
.auth-wrap .invite-banner { margin: 12px 0 0; padding: 8px 10px; justify-content: center; text-align: center; }
.auth-wrap .invite-banner img { width: 32px; height: 32px; }
.auth-wrap .invite-banner strong { font-size: 15px; }
.auth-wrap .invite-banner span { font-size: 12.5px; }
.auth-code-links { margin-top: 2px; }
#auth-title[hidden], #auth-step-email[hidden], #auth-step-code[hidden], #auth-view[hidden] { display: none !important; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.dash-head h1 { font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -.025em; color: var(--ink); }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.app-tabs {
  display: flex; align-items: center; gap: 6px; margin-top: 22px; padding: 6px;
  background: var(--sage); border: 1px solid var(--sage-2); border-radius: 999px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tab {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 7px 16px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap;
}
.app-tab:hover { color: var(--forest); }
.app-tab[aria-selected="true"] { background: var(--card); color: var(--forest); border-color: var(--sage-2); box-shadow: 0 1px 3px rgba(19, 38, 26, .08); }
.app-tab .tab-count { background: var(--sage-2); color: var(--forest); }
.app-tab[aria-selected="true"] .tab-count { background: var(--lime); color: var(--lime-ink); }

.app-panel { margin-top: 20px; }
.app-panel[hidden] { display: none !important; }

.app-notice { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: 12px; padding: 14px 18px; font-size: 14.5px; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-notice.is-ok { border-left-color: var(--green-2); background: var(--sage); border-color: var(--sage-2); }

.app-exc-strip {
  margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.app-exc-strip.is-clear { background: var(--sage); border-color: var(--sage-2); }
.app-exc-badge { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(229, 169, 59, .2); color: #7C4D00; border: 1px solid rgba(229, 169, 59, .4); }
.app-exc-strip.is-clear .app-exc-badge { background: var(--lime); color: var(--lime-ink); border-color: rgba(31, 61, 43, .16); }
.app-exc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.app-exc-chip { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--sage-2); background: var(--sage); color: var(--forest); cursor: pointer; }
.app-exc-chip:hover { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }

.dash-pl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.dash-stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.dash-stat span { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dash-stat strong { display: block; font-size: 28px; font-weight: 650; letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.dash-stat small { display: block; font-size: 12px; color: var(--forest); margin-top: 4px; font-weight: 600; }

.tx-card { margin-top: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tx-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tx-card-head h2 { font-size: 18px; font-weight: 650; color: var(--ink); }
.tx-table-wrap { overflow-x: auto; }
.tx-table { width: 100%; border-collapse: collapse; min-width: 680px; font-size: 14px; }
.tx-table th, .tx-table td { text-align: left; padding: 12px 18px; border-top: 1px solid var(--line); vertical-align: middle; }
.tx-table thead th { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); background: var(--sage); }
.tx-table select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; color: var(--ink); }
.tx-amt { text-align: right !important; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amt.is-in { color: var(--forest); }
.tx-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--sage); color: var(--forest); border: 1px solid var(--sage-2); }
.tx-badge--warn { background: rgba(229, 169, 59, .2); color: #7C4D00; border-color: rgba(229, 169, 59, .4); }
.tx-empty { padding: 40px 24px; text-align: center; color: var(--ink-2); }

/* Light-surface overrides for app.html sub-tabs */
.app-panel { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.app-panel[hidden] { display: none; }
.app-panel .ws-head h3 { color: var(--ink); font-size: 20px; }
.app-panel .ws-head p { color: var(--muted); }
.app-panel .kpi-card { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.app-panel .kpi-card span { color: var(--muted); }
.app-panel .kpi-card strong { color: var(--ink); }
.app-panel .kpi-card small { color: var(--forest); }
.app-panel .ws-card { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.app-panel .ws-card-head h4 { color: var(--ink); }
.app-panel .spark-labels { color: var(--muted); }
.app-panel .pill { background: var(--sage); color: var(--forest); border-color: var(--sage-2); }
.app-panel .pill--ok { background: var(--lime); color: var(--lime-ink); border-color: rgba(31, 61, 43, .16); }
.app-panel .wbtn { background: var(--bg); color: var(--ink); border-color: var(--line); }
.app-panel .wbtn:hover { background: var(--sage); border-color: var(--sage-2); }
.app-panel .wbtn--primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.app-panel .wbtn--primary:hover { background: var(--lime-2); }
.app-light-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.app-light-card h3 { font-size: 16px; font-weight: 650; color: var(--ink); }
.app-light-card .cf-month { color: var(--ink-2); }
.app-light-card .cf-track { background: var(--sage); }
.app-light-card .cf-bar-in { background: var(--forest); }
.app-light-card .cf-bar-out { background: #8FA193; }
.app-light-card .cf-nums { color: var(--ink); }
.app-light-card .cf-nums span { color: var(--muted); }
.app-light-card .rule-row { background: var(--bg); border-color: var(--line); }
.app-light-card .rule-main strong { color: var(--ink); }
.app-light-card .rule-main span { color: var(--muted); }
.app-light-card .rule-cat { background: var(--sage); color: var(--forest); border-color: var(--sage-2); }
.app-light-card .rule-toggle { background: var(--line); border-color: var(--sage-2); }
.app-light-card .rule-toggle[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); }
.app-light-card .rule-toggle[aria-pressed="true"]::after { background: var(--lime); }
.app-light-card .pl td { color: var(--ink); border-top-color: var(--line); }
.app-light-card .pl tr.total td { color: var(--forest); border-top-color: var(--forest); }

/* Auth code step & single bookkeeper chat card in app.html */
.auth-code-input { font-size: 20px !important; font-weight: 700; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.auth-code-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.link-btn { border: 0; background: transparent; color: var(--forest); font-weight: 600; font-size: 13.5px; cursor: pointer; padding: 4px 0; text-decoration: underline; }
.link-btn:hover { color: var(--ink); }

.app-chat-card { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.app-chat-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--sage); }
.app-chat-title { display: flex; align-items: center; gap: 10px; }
.app-chat-title strong { display: block; font-size: 14.5px; color: var(--ink); }
.app-chat-title span { display: block; font-size: 12px; color: var(--muted); }
.app-chat-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--forest); display: grid; place-items: center; flex: none; }
.app-chat-starters { display: flex; gap: 6px; flex-wrap: wrap; }
.app-chat-log { max-height: 260px; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.app-chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.app-chat-msg--bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.app-chat-msg--user { align-self: flex-end; background: var(--forest); color: var(--text-inverse); }
.app-chat-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--card); }
.app-chat-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 12px; font-size: 14px; color: var(--ink); outline: none; }
.app-chat-form input:focus { border-color: var(--forest); }

/* Responsive */

.hero-tagline { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2.2vw, 26px); color: var(--forest); margin: 14px auto 0; letter-spacing: -.01em; line-height: 1.3; max-width: 36em; }
.how-steps { margin-top: 36px; }
.ex-grid { display: grid; gap: 22px; margin-top: 28px; max-width: 680px; }
.ex-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ex-card .loop-msg { animation: none; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.demo-note { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.narrow-copy { max-width: 680px; }
.sec-list { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; }
.sec-list li { padding-left: 28px; position: relative; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.sec-list li::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 7.2l2 2 4-4.4' fill='none' stroke='%231F3D2B' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; border: 1px solid var(--sage-2); }
.founder-note { font-family: var(--serif); font-style: italic; font-size: clamp(18px, 2vw, 22px); line-height: 1.45; margin-top: 18px; color: var(--ink); max-width: 36em; }
.wl-partner-line { margin: 16px 0 0; font-size: 14.5px; color: var(--text-inverse-muted); position: relative; }
.wl-partner-line a { color: var(--lime); font-weight: 600; }
.waitlist-success { grid-template-columns: 1fr; max-width: 560px; }
.spot-card[hidden] { display: none !important; }
#partner { scroll-margin-top: 88px; }
.partner-apply-card { max-width: 720px; margin-top: 28px; }
.partner-apply .field { min-width: 0; }
.partner-apply input, .partner-apply select { max-width: 100%; }
@media (max-width: 960px) {
  .benefits { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 520px; }
  .rp-grid { grid-template-columns: 1fr; }
  .dash-pl, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { padding-top: 32px; }
  .hero-title { min-height: calc(3.2 * clamp(40px, 6vw, 70px)); }
  .demo-container { padding: 0 12px; margin-top: 32px; }
  .app-window { --win-h: 610px; border-radius: 14px; }
  .win-title { font-size: 11.5px; }
  .win-user-pill { display: none; }
  .win-tabs-bar { padding: 8px 8px; flex-wrap: wrap; min-width: 0; }
  .win-tabs { flex-wrap: wrap; overflow-x: hidden; width: 100%; }
  .win-tab { padding: 5px 8px; font-size: 11px; }

  .home-summary { padding: 10px 12px; }
  .live-pl-learn { display: none; }
  .live-pl-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .pl-metric b { font-size: 13.5px; }
  .exc-strip { padding: 8px 12px; }
  .chat-inner { padding: 14px 12px 20px; }
  .msg--user .bubble { max-width: 100%; }
  .status-row { padding-left: 40px; }
  .stat b { font-size: 17px; }
  .composer { margin: 0 10px 10px; }
  .takeover-hint { display: none; }
  .toast { top: 96px; }
  .win-title .wt-long { display: none; }
  .cap-grid, .wt-steps { grid-template-columns: 1fr; }
  .demo-controls { gap: 10px; }
  .scene-dot { padding: 5px 10px; font-size: 12.5px; }
  .section { padding: 64px 0; }
  .benefits, .pf-row, .wl-fields, .waitlist-success { grid-template-columns: 1fr; }
  .cta-band { padding: 64px 0; }
  .cta-inner { padding: 40px 20px; border-radius: 22px; }
  .header-inner { height: 58px; }
  .cf-row { grid-template-columns: 44px 1fr 96px; gap: 8px; }
  .rule-row { grid-template-columns: 1fr auto; }
  .rule-cat { justify-self: start; }
}
@media (max-width: 390px) {
  .container { padding: 0 16px; }
  .hero-ctas .btn { width: 100%; }
  .live-tag #live-label { display: none; }
  .header-actions { gap: 6px; }
  .header-actions .btn-sm { padding: 7px 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Legal pages (privacy / security / terms) */
.legal-page { background: var(--bg); }
.topbar--legal { display: flex; align-items: center; justify-content: space-between; max-width: 1120px; margin: 0 auto; padding: 16px 24px; }
.legal-main { padding: 32px 24px 80px; }
.legal-article { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow); }
.legal-back { font-size: var(--fs-sm); color: var(--link); text-decoration: none; font-weight: 600; }
.legal-back:hover { color: var(--link-hover); text-decoration: underline; }
.legal-article a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.legal-article a:hover { color: var(--link-hover); }
.legal-kicker { margin-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 650; }
.legal-article h1 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 48px; line-height: 1.1; margin-top: 6px; color: var(--ink); }
.legal-article h2 { font-size: 18px; margin-top: 28px; color: var(--ink); }
.legal-article p, .legal-article li { color: var(--ink-2); margin-top: 10px; }
.legal-article ul { padding-left: 20px; }
.legal-footer { border-top: 1px solid var(--line); padding: 24px; }
.legal-footer-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.micro-links { display: flex; gap: 18px; font-size: 14px; }
.micro-links a { text-decoration: none; color: var(--ink-2); }
.micro-links a[aria-current="page"] { color: var(--forest); font-weight: 600; }
.legal-copy { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .legal-article { padding: 26px 20px; } .legal-article h1 { font-size: 38px; } }

/* ===== v8: roles, firm dashboard, escalations ===== */
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--sage); padding: 4px; border-radius: 12px; margin: 4px 0 16px; }
.role-opt { border: 0; background: transparent; padding: 10px 8px; border-radius: 9px; font: 600 13.5px var(--sans); color: var(--muted); cursor: pointer; }
.role-opt[aria-checked="true"] { background: var(--card); color: var(--forest); box-shadow: 0 1px 3px rgba(19,38,26,.12); }
.invite-banner { display: flex; gap: 12px; align-items: center; background: var(--sage); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 10px 0 14px; }
.invite-banner img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.invite-banner strong { display: block; color: var(--forest); font-size: 14.5px; }
.invite-banner span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.notif-wrap { position: relative; }
.notif-btn { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.notif-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.notif-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(340px, 86vw); background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.notif-pop-head { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.notif-list { max-height: 360px; overflow: auto; }
.notif-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; line-height: 1.4; }
.notif-item.is-unread { background: #FBFDF3; }
.notif-item small { display: block; color: var(--muted); margin-top: 3px; font-size: 11.5px; }
.back-btn { display: inline-block; margin-bottom: 6px; }
.brand-chip { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 5px 12px; border-radius: 999px; background: var(--sage); color: var(--forest); font-size: 13px; }
.brand-chip img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }
#firm-view { min-width: 0; }
.firm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.firm-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.firm-main { display: grid; gap: 16px; min-width: 0; }
.firm-view-card h4, #firm-view .ws-card-head h4, .acct-panel .ws-card-head h4 { margin: 0; font-size: 15px; color: var(--ink); }
#firm-view .ws-card-head, .acct-panel .ws-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
#firm-view .pill, .acct-panel .pill, .brand-form .pill { background: var(--sage); color: var(--forest); border-color: transparent; }
#firm-view .pill--warn, .acct-panel .pill--warn { background: #FBEFD6; color: #8A5A07; }
#firm-view .pill--ok { background: #EAF6D0; color: var(--forest); }
.client-grid { display: grid; gap: 10px; }
.client-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: #FCFBF7; transition: border-color .15s, transform .15s; max-width: 100%; min-width: 0; overflow: hidden; }
.client-card:hover { border-color: var(--forest); transform: translateY(-1px); }
.client-main { flex: 1 1 0; min-width: 0; max-width: 100%; display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.client-copy { min-width: 0; flex: 1; }
.client-main strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.client-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; min-width: 0; }
.client-main .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-metrics { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); min-width: 0; }
#firm-kicker { overflow-wrap: anywhere; }
.client-grid, .firm-main, .firm-grid, .firm-alerts { min-width: 0; max-width: 100%; }
.score-ring { width: 46px; height: 46px; flex: none; }
.score-ring circle { fill: none; stroke-width: 4.5; }
.score-ring .track { stroke: var(--sage); }
.score-ring .val { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 22px 22px; }
.score-ring text { font: 700 13px var(--sans); fill: var(--ink); }
.score-good .val { stroke: #4E9A2F; } .score-watch .val { stroke: var(--amber); } .score-risk .val { stroke: #C2412D; }
.sev-pill { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.sev-pill.sev-high { background: #FBE3DE; color: #A3301C; } .sev-pill.sev-medium { background: #FBEFD6; color: #8A5A07; } .sev-pill.sev-low { background: var(--sage); color: var(--forest); }
.alert-list { display: grid; gap: 10px; }
.alert-row { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #FCFBF7; }
.alert-row.sev-high { border-left-color: #C2412D; } .alert-row.sev-medium { border-left-color: var(--amber); } .alert-row.sev-low { border-left-color: var(--forest); }
.alert-row.is-done { opacity: .62; }
.alert-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; }
.alert-type { font-weight: 650; color: var(--ink); }
.alert-client { color: var(--forest); font-weight: 600; }
.alert-top small { margin-left: auto; color: var(--muted); }
.alert-sum { margin: 8px 0 4px; font-size: 14px; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.alert-rec { margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.alert-status { margin: 4px 0 0; font-size: 12.5px; color: var(--forest); font-weight: 600; text-transform: capitalize; }
.alert-actions, .rec-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.override-form { display: flex; gap: 6px; margin-top: 8px; }
.override-form input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: 14px var(--sans); }
.acct-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.rec-list { display: grid; gap: 10px; }
.rec-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #FCFBF7; }
.rec-row p { margin: 6px 0; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.rec-row.is-done { opacity: .6; }
.rec-row small { font-size: 12px; color: var(--forest); font-weight: 600; text-transform: capitalize; }
.rec-src { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); }
.invite-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.invite-form .field { margin: 0; }
.inv-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; min-width: 0; }
.inv-link input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: 13px var(--sans); background: var(--sage); }
.integration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.integ-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.integ-card strong { display: block; font-size: 14.5px; color: var(--ink); }
.integ-card span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.brand-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 14px; }
.brand-form .field { margin: 0; }
.brand-form .form-msg { grid-column: 1 / -1; margin: 0; }
.app-chat-msg--acct { align-self: flex-start; background: #EAF6D0; border: 1px solid #CFE6A0; color: var(--ink); }
.msg-author { display: block; font-size: 11.5px; font-weight: 700; color: var(--forest); margin-bottom: 3px; }
.app-chat-msg--user .msg-author { color: inherit; opacity: .8; }
.esc-flag { display: inline-block; font-size: 11px; font-weight: 700; color: #8A5A07; background: #FBEFD6; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.tx-reason { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .firm-grid, .acct-panel { grid-template-columns: 1fr; }
  .firm-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .invite-form, .brand-form, .integration-grid { grid-template-columns: 1fr; }
  .integ-card { flex-direction: column; align-items: flex-start; }
  .firm-stats .dash-stat strong { font-size: 22px; }
  .client-card { align-items: flex-start; }
  .header-actions .btn-ghost[href="index.html"] { display: none; }
}
/* audience switch & landers */
.aud-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(31,61,43,.08); margin-bottom: 18px; }
.aud-switch a { padding: 8px 16px; border-radius: 999px; font: 600 13.5px var(--sans); color: var(--forest); text-decoration: none; }
.aud-switch a.is-active { background: var(--forest); color: var(--lime); }
.aud-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aud-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.aud-card:hover { transform: translateY(-2px); border-color: var(--forest); }
.aud-card h3 { margin: 6px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 30px; color: var(--forest); }
.aud-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.aud-card .go { font-weight: 700; color: var(--forest); }
@media (max-width: 700px) { .aud-cards { grid-template-columns: 1fr; } }
.loop-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.loop-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; min-height: 330px; display: flex; flex-direction: column; }
.loop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--sage); font-size: 13.5px; }
.loop-head span { color: var(--muted); }
.loop-log { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.loop-msg { max-width: 88%; padding: 9px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.45; animation: loopIn .35s ease both; }
.loop-msg.user { align-self: flex-end; background: var(--forest); color: var(--bg); }
.loop-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.loop-msg.acct { align-self: flex-start; background: #EAF6D0; border: 1px solid #CFE6A0; }
.loop-msg b { display: block; font-size: 11px; color: var(--forest); margin-bottom: 2px; }
.loop-msg.user b { color: var(--lime); }
.loop-alert { border: 1px solid var(--line); border-left: 4px solid #C2412D; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; background: #FCFBF7; animation: loopIn .35s ease both; }
.loop-alert .tag { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; background: #FBE3DE; color: #A3301C; border-radius: 999px; padding: 2px 8px; margin-bottom: 4px; }
.loop-alert .btns { display: flex; gap: 6px; margin-top: 8px; }
.loop-alert .btns span { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); }
.loop-alert .btns .ok { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.loop-alert .btns .ok.pressed { outline: 3px solid rgba(31,61,43,.35); }
.loop-alert.done { border-left-color: #4E9A2F; opacity: .75; }
@keyframes loopIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.health-demo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.health-card { display: flex; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.health-card strong { display: block; font-size: 15px; } .health-card small { color: var(--muted); font-size: 12.5px; }
.hs { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; border: 4px solid; }
.hs-risk { border-color: #C2412D; color: #A3301C; } .hs-watch { border-color: var(--amber); color: #8A5A07; } .hs-good { border-color: #4E9A2F; color: var(--forest); }
@media (max-width: 800px) { .loop-demo, .health-demo { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .firm-grid { grid-template-columns: minmax(0, 1fr); } .firm-main > * { min-width: 0; } }
@media (max-width: 600px) {
  .dash-pl, .firm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-stat { padding: 14px; min-width: 0; }
  .dash-stat strong { font-size: 20px; overflow-wrap: anywhere; }
}
.brand-form[hidden], .override-form[hidden], .notif-count[hidden], .inv-link[hidden], .notif-pop[hidden], .acct-panel[hidden], .invite-banner[hidden], .role-switch[hidden] { display: none !important; }
.esc-flag { display: table; }

/* ===== v9: accountant lander demo, calculator, QBO, firm tour ===== */
.try-demo { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 14px; margin-top: 18px; align-items: stretch; }
.try-clients, .try-pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.try-col-head { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--sage); font-size: 13px; font-weight: 650; color: var(--forest); }
.try-client { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #FCFBF7; padding: 12px 14px; cursor: pointer; color: var(--ink); }
.try-client.is-active { background: #EAF6D0; }
.try-client-copy { display: grid; gap: 2px; min-width: 0; }
.try-client-copy strong { font-size: 13.5px; }
.try-client-copy small { font-size: 12px; color: var(--muted); }
.try-open { color: #A3301C !important; font-weight: 650; }
.try-clear { color: var(--forest) !important; font-weight: 650; }
.try-main { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; min-width: 0; }
.try-alerts { padding: 10px; display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.try-alert { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; background: #FCFBF7; overflow: hidden; }
.try-alert.sev-high { border-left-color: #C2412D; }
.try-alert.is-done { opacity: .7; border-left-color: #4E9A2F; }
.try-alert-btn { display: grid; gap: 4px; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.try-alert-btn strong { font-size: 13.5px; }
.try-alert-sum { font-size: 13px; color: var(--muted); line-height: 1.4; }
.try-alert-body { padding: 0 12px 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.try-alert-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.try-chat { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; max-height: 360px; overflow: auto; }
.try-reply { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.try-reply input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: 14px var(--sans); }
.try-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 12px; }
.try-empty { padding: 16px; margin: 0; }
.ba-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(31,61,43,.08); margin: 8px 0 16px; }
.ba-btn { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font: 600 13.5px var(--sans); color: var(--forest); cursor: pointer; }
.ba-btn.is-active { background: var(--forest); color: var(--lime); }
.ba-board { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px 8px 8px 0; }
.ba-list { margin: 8px 20px 8px 36px; padding: 0; }
.ba-list li { margin: 0 0 12px; line-height: 1.5; color: var(--ink); }
.ba-list li:last-child { margin-bottom: 4px; }
.calc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calc-form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.calc-out { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.calc-revenue { margin: 16px 0 0; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.calc-revenue strong { font-weight: 650; }
.firm-pricing { grid-template-columns: repeat(3, 1fr); max-width: 1100px; }
.plan-fine { margin-top: 12px; font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); }
.plan-cta { margin-top: 18px; }
.benefits-3 { grid-template-columns: repeat(3, 1fr); }
.firm-lead-success { grid-template-columns: 1fr; max-width: 580px; text-align: left; }
.calc-stat { background: var(--sage); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.calc-stat span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.calc-stat strong { display: block; margin-top: 6px; font-size: 22px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.calc-assume { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.scenario { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.scenario h3 { margin: 6px 0 8px; font-size: 18px; line-height: 1.3; color: var(--ink); }
.scenario p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 14.5px; }
.scenario-tag { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--forest); }
.scenario-span { grid-column: 1 / -1; }
.close-list { margin: 8px 0 0; padding-left: 18px; color: var(--ink); line-height: 1.55; }
.week-table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.week-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
.week-table th, .week-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.week-table thead th { background: var(--sage); font-size: 13px; color: var(--forest); }
.week-table tbody th { font-weight: 650; width: 22%; color: var(--ink); }
.week-table tbody tr:last-child th, .week-table tbody tr:last-child td { border-bottom: 0; }
.client-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.client-card .client-actions .btn { font-size: 12px; padding: 5px 9px; }
.reviewed-pill { background: #EAF6D0; color: var(--forest); }
.tour-overlay { position: fixed; inset: 0; background: rgba(19,38,26,.45); z-index: 80; display: grid; place-items: end center; padding: 20px 16px 28px; }
.tour-card { width: min(420px, 100%); background: var(--card); border-radius: 16px; padding: 20px 20px 16px; box-shadow: var(--shadow); color: var(--ink); }
.tour-card h3 { margin: 0 0 6px; font-size: 18px; }
.tour-card p { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.tour-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tour-step { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 600; }
#firm-view .empty-state, .empty-state { padding: 18px 4px; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 1100px) {
  .firm-pricing { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 1024px) {
  .calc-form-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .try-demo, .try-main, .scenario-grid, .calc-form, .calc-form-4, .calc-out, .firm-pricing, .benefits-3 { grid-template-columns: 1fr; }
  .try-chat, .try-alerts { max-height: 280px; }
}
@media (max-width: 600px) {
  .calc-stat strong { font-size: 18px; }
  .week-table { font-size: 13px; }
}
.tour-overlay[hidden] { display: none !important; }
.client-card { flex-wrap: wrap; }
.client-card > .client-main { flex: 1; min-width: 0; }
.client-actions { width: 100%; padding-left: 60px; }
@media (max-width: 600px) { .client-actions { padding-left: 0; } }
.try-chat .loop-msg { color: var(--ink); opacity: 1; }
.try-chat .loop-msg b { color: var(--forest); }
.try-chat .loop-msg.user b { color: var(--lime); }
.try-alert .alert-status { text-transform: none; color: var(--forest); font-weight: 650; }
.try-chat .loop-msg { animation: none; opacity: 1 !important; color: var(--ink); }


/* v11 conversation-first home */
.home-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 12px; }
.home-toolbar-note { margin: 0; font-size: 13px; color: var(--muted); }
.view-switch { display: inline-flex; background: var(--sage); border: 1px solid var(--sage-2); border-radius: 999px; padding: 3px; gap: 2px; }
.view-switch-btn { border: 0; background: transparent; color: var(--muted); font: 600 13.5px var(--sans); padding: 7px 16px; border-radius: 999px; cursor: pointer; }
.view-switch-btn.is-active { background: var(--card); color: var(--forest); box-shadow: 0 1px 3px rgba(19,38,26,.12); }
.home-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 16px; align-items: stretch; }
.home-chat-card { margin-top: 0; display: flex; flex-direction: column; min-height: 420px; max-height: calc(100dvh - 240px); }
.home-chat-card .app-chat-log { flex: 1; max-height: none; min-height: 240px; overflow-y: auto; overflow-x: hidden; }
.pl-dock { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pl-toggle { display: none; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.pl-toggle span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.pl-toggle strong { display: block; font-size: 16px; font-weight: 650; margin-top: 2px; }
.home-chat-layout .dash-pl { display: flex; flex-direction: column; gap: 8px; margin-top: 0; }
.home-chat-layout .dash-stat { padding: 12px 14px; border-radius: 14px; min-width: 0; }
.home-chat-layout .dash-stat strong { font-size: 20px; overflow-wrap: anywhere; }
.app-chat-msg { overflow-wrap: anywhere; word-break: break-word; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-actions .btn { white-space: normal; text-align: center; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chat-chip { font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--sage-2); background: var(--sage); color: var(--forest); cursor: pointer; }
.chat-chip:hover, .chat-chip:focus { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.chat-chip:disabled { opacity: .6; cursor: default; }
.sort-summary { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.sort-summary > summary { cursor: pointer; padding: 8px 10px; font-size: 13px; font-weight: 600; color: var(--forest); list-style: none; }
.sort-summary > summary::-webkit-details-marker { display: none; }
.sort-groups { list-style: none; padding: 0 10px 10px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.sort-groups li { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 4px; }
.plaid-hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.home-ledger-view .tx-card { margin-top: 0; }
.ledger-group { border-top: 1px solid var(--line); }
.ledger-group:first-child { border-top: 0; }
.ledger-group-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 12px 16px; }
.ledger-group-head strong { display: block; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.ledger-group-head span { display: block; font-size: 12.5px; color: var(--muted); }
.ledger-group-head select { max-width: 100%; min-width: 0; }
.ledger-toggle { border: 0; background: transparent; color: var(--forest); font: 600 13px var(--sans); cursor: pointer; text-decoration: underline; }
.ledger-rows { display: none; padding: 0 16px 12px; }
.ledger-group.is-open .ledger-rows { display: block; }
.ledger-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.ledger-row .tx-amt { text-align: right; }
@media (max-width: 900px) {
  .home-chat-layout { grid-template-columns: 1fr; }
  .pl-dock { order: -1; }
  .pl-toggle { display: block; }
  .home-chat-layout .dash-pl { display: none; margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pl-dock.is-open .dash-pl { display: grid; }
  .home-chat-card { min-height: 360px; max-height: calc(100dvh - 220px); }
  .ledger-group-head { grid-template-columns: minmax(0, 1fr); }
}

/* v11 visibility + shell fixes */
.app-page:not(.is-auth) { height: 100dvh; overflow: hidden; }
.app-page:not(.is-auth) .site-footer { display: none; }
.app-page:not(.is-auth) .site-header { flex: none; }
.app-page:not(.is-auth) .app-main {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; padding: 10px 0 12px;
}
.app-page:not(.is-auth) .app-main > .container {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; width: 100%;
}
#connect-bank-btn[hidden], #load-sample-btn[hidden], #back-to-firm[hidden],
#app-exc-strip[hidden], #home-chat-view[hidden], #home-ledger-view[hidden],
#auth-view[hidden], #firm-view[hidden], #dash-view[hidden],
#app-notice[hidden], #brand-chip[hidden],
.acct-panel[hidden], .dash-actions:not(:has(> :not([hidden]))) { display: none !important; }
#dash-view:not([hidden]) {
  display: flex !important; flex-direction: column;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
#dash-view .dash-head { flex: none; }
#dash-view .app-tabs { flex: none; margin-top: 12px; max-width: 100%; }
#dash-view .app-notice { flex: none; }
#apanel-home:not([hidden]),
#apanel-cashflow:not([hidden]),
#apanel-metrics:not([hidden]),
#apanel-rulebook:not([hidden]),
#apanel-reports:not([hidden]) {
  display: flex !important; flex-direction: column;
  flex: 1 1 auto; min-height: 0; overflow: hidden; margin-top: 12px;
}
#apanel-cashflow:not([hidden]),
#apanel-metrics:not([hidden]),
#apanel-rulebook:not([hidden]),
#apanel-reports:not([hidden]) { overflow: auto; }
.home-toolbar { flex: none; }
#home-chat-view:not([hidden]) {
  display: grid !important; flex: 1 1 auto; min-height: 0; overflow: hidden;
}
#home-ledger-view:not([hidden]) {
  display: flex !important; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden;
}
.home-chat-card {
  overflow: hidden; min-height: 0; height: auto !important; max-height: none !important;
  display: flex; flex-direction: column;
}
.home-chat-card .app-chat-head, .home-chat-card .app-chat-form { flex: none; position: relative; z-index: 1; }
.home-chat-card .app-chat-log { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
@media (max-width: 700px) {
  .dash-head { min-width: 0; }
  .dash-head > div { min-width: 0; max-width: 100%; }
  .dash-head h1 { font-size: 22px; }
  #dash-user { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-page:not(.is-auth) .app-main { padding: 8px 0 10px; }
}

/* v12 ledger */
.led-shell {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; min-height: 0; flex: 1 1 auto;
  display: flex; flex-direction: column;
}
.led-toolbar { flex: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--card); }
.led-search { flex: 1 1 220px; min-width: 0; }
.led-search input {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 999px;
  padding: 8px 14px; font-size: 14px;
}
.led-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.led-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.led-chip[aria-pressed="true"] { background: var(--forest); color: var(--text-inverse); border-color: var(--forest); }
.led-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.led-date input, .led-filters select {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 8px; font-size: 13px;
}
.led-bulk {
  flex: none; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 8px 14px; background: var(--sage); border-bottom: 1px solid var(--sage-2); font-size: 13.5px;
}
.led-table { flex: 1 1 auto; min-height: 0; overflow: auto; }
.led-head, .led-row {
  display: grid;
  grid-template-columns: 36px 92px minmax(0, 1.5fr) 108px minmax(120px, 1.1fr) 112px 78px;
  gap: 8px; align-items: center; padding: 0 14px;
}
.led-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg-2); border-bottom: 1px solid var(--line);
  min-height: 36px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.led-amt-h, .led-row .tx-amt { text-align: right; }
.led-group { border-bottom: 1px solid var(--line); }
.led-group-h {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto auto;
  gap: 8px; align-items: center; padding: 10px 14px; background: #fbfaf6; cursor: pointer;
}
.led-group-h:hover { background: var(--sage); }
.led-group-h strong { display: block; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.led-group-h span { font-size: 12.5px; color: var(--muted); }
.led-group-meta { text-align: right; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.led-rows { display: none; }
.led-group.is-open .led-rows { display: block; }
.led-row { min-height: 52px; border-top: 1px solid var(--line); font-size: 13.5px; }
.led-row:hover { background: var(--bg); }
.led-row.is-open { background: var(--sage); }
.led-row.is-flash { animation: ledFlash 1.4s ease; }
@keyframes ledFlash { from { background: #eef8c9; } to { background: transparent; } }
.led-row .tx-amt { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.led-row .tx-amt.is-in { color: var(--green-2); }
.led-merchant { min-width: 0; }
.led-merchant strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-merchant small { display: block; color: var(--muted); font-size: 12px; }
.led-raw { display: block; color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-group-more { grid-column: auto; justify-self: end; font-size: 18px; line-height: 1; color: var(--ink-2); }
.led-merge-btn { grid-column: 2; justify-self: start; font-size: 12px; padding: 0; }
.cat-pill {
  display: inline-flex; align-items: center; max-width: 100%;
  border: 1px solid var(--sage-2); background: var(--sage); color: var(--forest);
  border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 650; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-pill.is-mixed, .cat-pill.is-uncat { background: #F8EFD9; border-color: rgba(229, 169, 59, .45); color: #7C4D00; }
.led-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 650; color: var(--ink-2);
}
.led-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-2); flex: none; }
.led-dot.is-auto { background: var(--green-2); }
.led-dot.is-needs { background: var(--amber); }
.led-dot.is-reviewed { background: var(--forest); }
.led-dot.is-escalated { background: #B42318; }
.led-icons { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.led-icon {
  width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.led-icon.is-on { color: var(--forest); background: var(--sage); }
.led-icon:hover { background: var(--sage); color: var(--forest); }
.led-drawer {
  display: none; grid-column: 1 / -1; padding: 0 14px 14px;
  border-top: 0;
}
.led-row.is-open + .led-drawer, .led-row.is-open .led-drawer { display: block; }
.led-drawer-inner {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.led-detail dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 13.5px; }
.led-detail dt { color: var(--muted); }
.led-detail dd { margin: 0; overflow-wrap: anywhere; }
.led-thread { display: flex; flex-direction: column; min-height: 0; }
.led-thread h4, .led-attach h4, .led-audit h4 { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.mini-log { max-height: 180px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.mini-msg { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; }
.mini-msg.is-user { align-self: flex-end; background: var(--forest); color: var(--text-inverse); border-color: var(--forest); }
.mini-msg.is-bot, .mini-audit { color: var(--ink-2); font-size: 12.5px; }
.led-reply { display: flex; gap: 8px; margin-top: 8px; }
.led-reply input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13.5px; background: var(--card); }
.led-attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.led-thumb, .led-thumb-link {
  width: 72px; height: 72px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); text-decoration: none;
}
.led-thumb img { width: 100%; height: 100%; object-fit: cover; }
.led-suggest { font-size: 12.5px; color: var(--ink-2); background: #F8EFD9; border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.cat-pop {
  position: absolute; z-index: 20; width: min(280px, calc(100vw - 24px));
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
  padding: 10px; display: none;
}
.cat-pop.is-open { display: block; }
.cat-pop input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; margin-bottom: 8px; }
.cat-pop-list { max-height: 220px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.cat-pop-list button {
  text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; font-size: 13.5px; cursor: pointer;
}
.cat-pop-list button:hover, .cat-pop-list button.is-on { background: var(--sage); color: var(--forest); }
.cat-pop-caption { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.cat-pop-rule { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.cat-pop-rule[hidden] { display: none !important; }
.cat-pop-rule label { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
#merch-pop { display: none; max-height: 280px; overflow: auto; }
#merch-pop.is-open { display: flex; flex-direction: column; gap: 2px; }
#merch-pop button {
  text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; font-size: 13.5px; cursor: pointer;
}
#merch-pop button:hover { background: var(--sage); color: var(--forest); }
.led-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; z-index: 40;
  background: var(--forest); color: var(--text-inverse); border-radius: 999px; padding: 10px 16px;
  box-shadow: var(--shadow); font-size: 14px; max-width: calc(100% - 24px);
}
.led-toast[hidden] { display: none !important; }
.led-toast .link-btn { color: var(--lime); }
.chat-attach-btn {
  flex: none; width: 36px; height: 36px; border: 1px solid var(--line); background: var(--card);
  border-radius: 50%; color: var(--forest); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.chat-attach-btn:hover { background: var(--sage); }
.chat-att-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; }
.tx-link { border: 0; background: transparent; color: var(--forest); font: 600 13px var(--sans); text-decoration: underline; cursor: pointer; padding: 0; }
.led-row .led-drawer { flex: 1 1 100%; width: 100%; }
@media (max-width: 800px) {
  .led-head { display: none; }
  .led-row {
    display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; align-items: flex-start;
  }
  .led-row .led-check { order: 0; }
  .led-row .led-date { display: block; width: auto; font-size: 12px; color: var(--muted); order: 2; }
  .led-merchant { flex: 1 1 calc(100% - 80px); order: 1; }
  .led-row .tx-amt { margin-left: auto; order: 3; }
  .led-row .cat-pill { order: 4; }
  .led-status { order: 5; }
  .led-icons { margin-left: auto; order: 6; }
  .led-drawer-inner { grid-template-columns: 1fr; }
  .led-group-h { grid-template-columns: 36px minmax(0, 1fr) auto auto; }
  .led-group-h .cat-pill { grid-column: 3; grid-row: 1; }
  .led-group-more { grid-column: 4; grid-row: 1; }
  .led-group-meta { grid-column: 2; text-align: left; }
  .led-merge-btn { grid-column: 2; }
}

#led-bulk[hidden] { display: none !important; }
.led-toast { flex-wrap: wrap; line-height: 1.35; }
@media (max-width: 700px) { .led-toast { border-radius: 16px; bottom: 12px; font-size: 13px; } }

/* ===== v14 launch polish: nav, app shell, settings, 404, motion ===== */
.nav-toggle {
  display: none; width: var(--tap); height: var(--tap); padding: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px;
}
.nav-toggle-bar { display: block; width: 18px; height: 2px; background: var(--forest); border-radius: 2px; }
.nav-drawer {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(19, 38, 26, .45);
}
.nav-drawer.is-open { display: block; }
.nav-drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; height: 100dvh;
  width: min(360px, 92vw); background: var(--bg); box-shadow: var(--shadow);
  padding: calc(16px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 8px; overflow: auto;
}
.nav-drawer-panel a, .nav-drawer-panel .btn {
  min-height: var(--tap); display: flex; align-items: center;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 16px;
  padding: 8px 4px; border-radius: 12px;
}
.nav-drawer-panel .btn { justify-content: center; margin-top: 8px; }
.nav-drawer-close {
  align-self: flex-end; width: var(--tap); height: var(--tap);
  border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--ink);
}
body.nav-lock { overflow: hidden; }

@media (max-width: 768px) {
  .site-nav { display: none; }
  .header-login { display: none; }
  .nav-toggle { display: inline-flex; }
  .legal-article h1 { font-size: 36px; }
  .legal-article { padding: 24px 18px; }
  .header-inner { height: 58px; }
}

/* Inputs and chips: usable touch targets */
input[type="text"], input[type="email"], input[type="search"], input[type="password"], input[type="date"], select, textarea {
  min-height: 44px;
}
.led-chip, .view-switch-btn, .role-opt, .app-tab {
  min-height: 44px;
}
.led-icon, .notif-btn { min-width: var(--tap); min-height: var(--tap); }
.link-btn, .led-merge-btn { min-height: 32px; }

/* Skeletons */
.skel {
  background: linear-gradient(90deg, var(--bg-2) 0%, var(--sage) 50%, var(--bg-2) 100%);
  background-size: 200% 100%; animation: skel 1.2s ease infinite;
  border-radius: 10px; color: transparent !important;
}
@keyframes skel { to { background-position: -200% 0; } }
.skel-line { height: 14px; margin: 8px 0; }
.skel-card { height: 72px; margin: 10px 0; }

/* Settings panel */
.settings-overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(19, 38, 26, .4);
  display: none; align-items: flex-end; justify-content: center;
}
.settings-overlay.is-open { display: flex; }
.settings-panel {
  width: min(480px, 100%); max-height: min(92dvh, 720px); overflow: auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 12px 20px calc(20px + var(--safe-bottom));
  box-shadow: var(--shadow);
}
.settings-panel h2 { font-size: 20px; margin: 8px 0 16px; }
.settings-panel .field { margin: 0 0 14px; }
.settings-panel .field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.settings-panel .field input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg);
}
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.settings-danger { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.settings-danger h3 { font-size: 15px; margin-bottom: 8px; }
.settings-handle {
  width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 4px auto 10px;
}
@media (min-width: 769px) {
  .settings-overlay { align-items: center; }
  .settings-panel { border-radius: 20px; padding: 24px; }
  .settings-handle { display: none; }
}

/* 404 */
.page-404 { min-height: 100dvh; display: flex; flex-direction: column; }
.page-404-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px 80px; text-align: center; }
.page-404-main h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(48px, 8vw, 88px); line-height: 1; }
.page-404-main p { margin: 16px auto 0; color: var(--ink-2); max-width: 36em; }
.page-404-main .hero-ctas { margin-top: 24px; }

/* App signed-in mobile: bottom tabs, sheet drawer, safe composer */
@media (max-width: 768px) {
  .app-page:not(.is-auth) .site-header .header-actions .btn[href],
  .app-page:not(.is-auth) #signout-btn { display: none; }
  .app-page:not(.is-auth) { padding-bottom: calc(58px + var(--safe-bottom)); }
  .app-page:not(.is-auth) #app-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
    padding: 6px 8px calc(6px + var(--safe-bottom));
    justify-content: space-between; background: rgba(247, 244, 236, .96);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .app-page:not(.is-auth) .app-tab {
    flex: 1 1 0; justify-content: center; padding: 6px 2px; font-size: 11px;
    min-height: 48px; border-radius: 12px; flex-direction: column; gap: 0;
    line-height: 1.15; white-space: normal; text-align: center;
  }
  .app-page:not(.is-auth) .app-tab .tab-count { margin: 0; padding: 0 5px; font-size: 10px; }
  .app-page:not(.is-auth) #dash-view:not([hidden]) { padding-bottom: 8px; }
  .app-page:not(.is-auth) .home-chat-card { max-height: none; }
  .app-page:not(.is-auth) .home-chat-card .app-chat-form,
  .app-page:not(.is-auth) #app-chat-form {
    padding-bottom: 4px;
  }
  .app-chat-form { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .led-row.is-open .led-drawer {
    position: fixed; inset: 0; z-index: 80; display: flex !important;
    flex-direction: column; background: var(--bg);
    padding: calc(12px + var(--safe-top)) 14px calc(16px + var(--safe-bottom));
    overflow: auto; grid-column: auto; width: 100%; border-top: 0;
  }
  .led-drawer-inner { grid-template-columns: 1fr; flex: 1; }
  .led-sheet-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .led-sheet-close { min-width: var(--tap); min-height: var(--tap); border: 1px solid var(--line); background: var(--card); border-radius: 12px; cursor: pointer; font-size: 18px; }
  #led-toast { bottom: calc(72px + var(--safe-bottom)); }
}
.led-sheet-bar { display: none; }
@media (max-width: 768px) {
  .led-row.is-open .led-sheet-bar { display: flex; }
}

/* Consistent toast + empty/error */
.app-empty, .app-error {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 22px; text-align: center;
}
.app-empty h3, .app-error h3 { font-size: 18px; margin-bottom: 8px; }
.app-empty p, .app-error p { color: var(--ink-2); margin: 0 auto; max-width: 36em; }
.app-error { border-left: 4px solid var(--amber); text-align: left; }

#led-toast[hidden], #auth-view[hidden], .settings-overlay[hidden], .nav-drawer[hidden] { display: none !important; }

/* Auth session banner */
.auth-banner {
  background: var(--sage); border: 1px solid var(--sage-2); border-radius: 12px;
  padding: 10px 14px; margin: 0 0 14px; font-size: 14px; color: var(--ink-2);
}
.auth-banner[hidden] { display: none !important; }

/* Chat retry */
.chat-retry { margin-top: 8px; }

/* Header settings btn */
#settings-btn { min-width: var(--tap); }

/* Tablet two-column already used; tighten 768-1024 */
@media (min-width: 769px) and (max-width: 1024px) {
  .home-chat-layout { grid-template-columns: minmax(0, 1fr) 200px; }
  .container { padding: 0 20px; }
}

/* Prevent sticky bars covering content on marketing */
.hero, .section { scroll-margin-top: 72px; }

/* Money in ledger stays right-aligned */
.led-row .tx-amt, .led-amt-h { text-align: right; font-variant-numeric: tabular-nums; }

/* Contrast: muted text on bg */
:root { --muted: #4E5D50; }

/* Firm branding in settings lives in accountant settings too */
#firm-view .dash-actions { flex-wrap: wrap; }

#firm-title { overflow-wrap: anywhere; }
#firm-view .invite-form input { min-width: 0; width: 100%; }
.notif-pop { max-width: calc(100vw - 24px); }
.merch-pop .cat-pop-list { max-height: 240px; overflow: auto; }


/* ===== v16 Grok-style mobile-first chat & unified message cards ===== */
#m-topbar[hidden],
#m-back-chat[hidden],
#m-menu-drawer[hidden],
#m-menu-firm[hidden],
#m-connect-btn[hidden],
#m-sample-btn[hidden],
#m-notif-count[hidden],
#m-menu-needs[hidden],
#m-menu-rules[hidden],
#chat-suggestions[hidden],
#pl-toggle[hidden] {
  display: none !important;
}

.m-topbar, .led-sheet-top { display: none; }
.pl-toggle { display: none; }

/* Unified Grok-style chat stream (desktop + mobile) */
.home-chat-card .app-chat-log {
  background: var(--bg);
  padding: 18px 20px;
  gap: 16px;
}
.chat-turn {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}
.chat-turn--bot {
  align-items: flex-start;
  gap: 6px;
}
.chat-bot-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.chat-bot-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--forest);
  display: grid;
  place-items: center;
  flex: none;
}
.chat-bot-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--forest);
  letter-spacing: -.01em;
}
.chat-bot-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding-left: 32px;
  min-width: 0;
}
.chat-msg {
  position: relative;
  min-width: 0;
  max-width: 100%;
  touch-action: manipulation;
}
.chat-msg--bot {
  background: transparent;
  border: 0;
  padding: 0;
  max-width: min(100%, 66ch);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.56;
  overflow-wrap: anywhere;
}
.chat-prose {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-turn--user {
  align-items: flex-end;
}
.chat-bubble--user {
  align-self: flex-end;
  max-width: min(82%, 520px);
  background: var(--forest);
  color: var(--text-inverse);
  padding: 10px 15px;
  border-radius: 20px 20px 6px 20px;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(19, 38, 26, .08);
}
.chat-bubble--user .msg-author {
  color: rgba(247, 244, 236, .78);
  font-size: 11px;
  display: block;
  margin-bottom: 2px;
}
.chat-bubble--user .tx-link {
  color: var(--lime);
  border-color: rgba(198, 241, 53, .35);
}
.chat-turn--acct {
  align-items: flex-start;
}
.chat-bubble--acct {
  max-width: min(88%, 560px);
  background: var(--sage);
  border: 1px solid var(--sage-2);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 16px 16px 16px 6px;
  font-size: 14.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.chat-bubble--acct .msg-author {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--forest);
  display: block;
  margin-bottom: 2px;
}

/* Inline tappable decision cards */
.chat-decision-card {
  width: 100%;
  max-width: min(100%, 460px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 15px;
  box-shadow: 0 2px 10px rgba(19, 38, 26, .05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.decision-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.decision-head strong {
  font-size: 14.5px;
  color: var(--ink);
}
.decision-head span {
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.decision-q {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink-2);
}
.decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.decision-primary {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13.5px;
}
.chat-decision-card .chat-chip {
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
}
.decision-foot {
  margin-top: 2px;
}
.chat-decision-done {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sage);
  border: 1px solid var(--sage-2);
  font-size: 13px;
  color: var(--ink-2);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chat-done-ico {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.chat-undo-pill {
  min-height: 36px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--forest);
  font: 600 13px var(--sans);
  cursor: pointer;
}
.chat-undo-pill:hover { background: var(--sage); }

/* Typing / working indicator */
.chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13.5px;
  padding: 2px 0;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.typing-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--forest);
  opacity: .35;
  animation: bbPulse 1.1s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes bbPulse {
  0%, 80%, 100% { opacity: .28; transform: scale(.88); }
  40% { opacity: 1; transform: scale(1.08); }
}

/* Message quick-action popover + reaction pill */
.msg-action-pop {
  position: fixed;
  z-index: 95;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--forest);
  color: var(--text-inverse);
  box-shadow: 0 10px 26px rgba(19, 38, 26, .28);
}
.msg-action-pop button {
  border: 0;
  background: transparent;
  color: var(--text-inverse);
  font: 600 13px var(--sans);
  padding: 7px 12px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
}
.msg-action-pop button:hover { background: rgba(255, 255, 255, .14); }
.msg-react-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--sage);
  border: 1px solid var(--sage-2);
  font-size: 12px;
  color: var(--forest);
}

/* Composer dock + suggested-prompt chips */
.chat-composer-dock {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 14px 12px;
  background: var(--card);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.chat-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}
.chat-suggestions::-webkit-scrollbar { display: none; }
.suggest-chip {
  flex: none;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--sage-2);
  background: var(--bg);
  color: var(--forest);
  font: 600 13px var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.suggest-chip:hover {
  background: var(--sage);
  border-color: var(--forest);
}
.home-chat-card .app-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(19, 38, 26, .04);
}
.home-chat-card .app-chat-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  max-height: 120px;
  border: 0;
  background: transparent;
  padding: 8px 6px;
  font: 15px/1.38 var(--sans);
  color: var(--ink);
  resize: none;
  outline: none;
}
.chat-attach-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--forest);
  display: grid;
  place-items: center;
  flex: none;
}
.chat-send-btn {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  flex: none;
}
.chat-send-btn .send-ico { display: none; }

/* Mobile <= 768px: Full-screen Grok-style chat home */
@media (max-width: 768px) {
  body.is-biz:not(.is-auth) {
    height: var(--app-h, 100dvh);
    padding-bottom: 0 !important;
  }
  body.is-biz:not(.is-auth) .site-header,
  body.is-biz:not(.is-auth) .dash-head,
  body.is-biz:not(.is-auth) .home-toolbar,
  body.is-biz:not(.is-auth) #app-tabs {
    display: none !important;
  }
  body.is-biz:not(.is-auth) .app-main {
    padding: 0 !important;
  }
  body.is-biz:not(.is-auth) .app-main > .container {
    padding: 0 !important;
    max-width: 100%;
  }
  body.is-biz:not(.is-auth) #dash-view:not([hidden]) {
    padding-bottom: 0 !important;
  }
  body.is-biz:not(.is-auth) #apanel-home:not([hidden]) {
    margin-top: 0 !important;
  }
  body.is-biz:not(.is-auth) #apanel-cashflow:not([hidden]),
  body.is-biz:not(.is-auth) #apanel-metrics:not([hidden]),
  body.is-biz:not(.is-auth) #apanel-rulebook:not([hidden]),
  body.is-biz:not(.is-auth) #apanel-reports:not([hidden]) {
    margin-top: 0 !important;
    padding: 12px 14px calc(24px + var(--safe-bottom));
  }
  body.is-biz:not(.is-auth) #app-notice {
    margin: 8px 12px 0;
  }
  body.is-biz:not(.is-auth) .app-exc-strip {
    margin: 8px 12px 0;
  }

  /* Slim mobile top bar */
  .m-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 54px;
    flex: none;
    padding: calc(4px + var(--safe-top)) 8px 4px 12px;
    background: rgba(247, 244, 236, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .m-biz-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--forest);
    color: var(--lime);
    font: 700 13px var(--sans);
    display: grid;
    place-items: center;
    flex: none;
  }
  .m-topbar-copy {
    min-width: 0;
    flex: 1 1 auto;
  }
  .m-topbar-copy strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-topbar-copy span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .m-topbar-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
  }
  .m-icon-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--forest);
    display: grid;
    place-items: center;
    cursor: pointer;
    position: relative;
  }
  .m-icon-btn:active { background: var(--sage); }
  .m-icon-btn .notif-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    font-size: 10px;
    display: grid;
    place-items: center;
  }

  /* Compact collapsible P&L summary card */
  .home-chat-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
  }
  .pl-dock {
    order: -1;
    padding: 8px 12px 2px;
    background: var(--bg);
    gap: 8px;
  }
  .pl-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(19, 38, 26, .04);
    text-align: left;
  }
  .pl-toggle-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }
  .pl-toggle-kicker {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
  }
  .pl-toggle-left strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    white-space: nowrap;
  }
  .pl-toggle-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
    flex: none;
    white-space: nowrap;
  }
  .pl-chev { transition: transform .2s ease; }
  .pl-dock.is-open .pl-chev { transform: rotate(180deg); }
  .pl-dock.is-open .dash-pl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 4px;
  }

  /* Edge-to-edge full-screen chat */
  .home-chat-card {
    background: var(--bg);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .home-chat-card .app-chat-head { display: none; }
  .home-chat-card .app-chat-log {
    padding: 12px 14px 10px;
    gap: 15px;
  }
  .chat-bot-stack { padding-left: 0; }
  .chat-bubble--user { max-width: 86%; }
  .chat-composer-dock {
    padding: 8px 12px calc(10px + var(--safe-bottom));
    background: var(--bg);
  }
  body.kbd-open .chat-composer-dock {
    padding-bottom: 8px;
  }
  .chat-send-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
  }
  .chat-send-btn .send-ico { display: block; }
  .chat-send-btn .send-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* Full-screen Ledger sheet on mobile */
  .led-sheet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: calc(8px + var(--safe-top)) 14px 8px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex: none;
  }
  .led-sheet-top > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
  }
  .led-sheet-top strong { font-size: 17px; color: var(--ink); }
  .led-sheet-top span { font-size: 12.5px; color: var(--muted); }
  body.is-biz:not(.is-auth) #home-ledger-view:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: var(--bg);
    display: flex !important;
    flex-direction: column;
    padding-bottom: var(--safe-bottom);
  }
  body.is-biz:not(.is-auth) #home-ledger-view .led-shell {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .led-row.is-open .led-drawer { z-index: 85; }
  #led-toast { bottom: calc(84px + var(--safe-bottom)); z-index: 95; }

  /* Mobile slide-over menu drawer */
  .m-menu-drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(19, 38, 26, .42);
    display: none;
    justify-content: flex-end;
  }
  .m-menu-drawer.is-open { display: flex; }
  .m-menu-panel {
    width: min(320px, 88vw);
    height: 100%;
    background: var(--bg);
    box-shadow: var(--shadow);
    padding: calc(14px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
  }
  .m-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }
  .m-menu-head strong { display: block; font-size: 16px; color: var(--ink); }
  .m-menu-head span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
  .m-menu-cta { display: flex; flex-direction: column; gap: 8px; }
  .m-menu-nav { display: flex; flex-direction: column; gap: 4px; }
  .m-menu-item {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--ink);
    font: 600 15px var(--sans);
    text-align: left;
    cursor: pointer;
  }
  .m-menu-item:hover, .m-menu-item.is-active {
    background: var(--sage);
    color: var(--forest);
  }
  .m-menu-foot {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .m-menu-danger { color: #8C2D2D; }
  .notif-pop.is-mobile-pop {
    position: fixed;
    top: calc(56px + var(--safe-top));
    right: 12px;
    z-index: 92;
  }
}

/* v23: Help shape BusyBooks + Changelog */
.shape-section { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.shape-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: start; margin-top: 24px; }
.shape-shipped { display: grid; gap: 12px; }
.shape-shipped article { background: var(--card); border: 1px solid var(--sage-2); border-radius: var(--radius-sm); padding: 14px 16px; }
.shape-shipped h3 { margin: 0 0 4px; font-size: 15.5px; color: var(--ink); }
.shape-shipped p { margin: 0; font-size: 14px; color: var(--ink-2); }
.shape-box { background: var(--forest); color: var(--text-inverse); border-radius: var(--radius); padding: 22px; }
.shape-box h2, .shape-box h3 { margin: 0 0 6px; color: var(--text-inverse); font-size: 20px; }
.shape-box p { margin: 0 0 12px; color: var(--text-inverse-muted); font-size: 14.5px; }
.fb-inline { display: grid; gap: 10px; }
.fb-kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-kinds label { position: relative; cursor: pointer; }
.fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds span { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid rgba(247,244,236,.28); color: var(--text-inverse); }
.fb-kinds input:checked + span { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.fb-inline textarea, .fb-inline input[type=email] { width: 100%; border-radius: 10px; border: 1px solid rgba(247,244,236,.25); background: rgba(17,36,25,.65); color: var(--text-inverse); padding: 10px 12px; font: inherit; font-size: 14.5px; }
.fb-inline textarea::placeholder, .fb-inline input[type=email]::placeholder { color: var(--text-inverse-muted); opacity: .85; }
.fb-inline-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.shape-box .form-msg { margin: 0; font-size: 13.5px; color: var(--lime); min-height: 18px; }
.shape-more { margin-top: 14px; font-size: 14px; }
.cl-page { max-width: 760px; }
.cl-list { display: grid; gap: 16px; margin: 24px 0; }
.cl-entry { background: var(--card); border: 1px solid var(--sage-2); border-radius: var(--radius); padding: 20px 22px; }
.cl-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.cl-ver { background: var(--sage); color: var(--forest); font-weight: 700; padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.cl-entry h2 { margin: 4px 0 8px; font-size: 19px; }
.cl-entry ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.cl-planned { background: var(--sage); border: 1px solid var(--sage-2); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 24px; }
.cl-planned h2 { margin: 0 0 8px; font-size: 17px; }
.cl-planned ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.cl-ask { margin-top: 24px; }
@media (max-width: 780px) { .shape-grid, .fb-inline-row { grid-template-columns: 1fr; } }
