/*
 * AI Growth System — Commercial Notion theme layer.
 * Design source: DESIGN-notion.md
 * Loaded AFTER dashboard.css on every user-facing surface so these rules are the
 * final word. Adds the marketing/auth vocabulary, app-shell auth gate, in-page
 * tabs, master-detail conversations and quiet Notion component chrome.
 * Vanilla CSS only. Keep every selector additive and reversible.
 */

/* ------------------------------------------------------------------ tokens */
:root {
  --paper: #f6f5f4;          /* Notion warm canvas  */
  --card: #ffffff;           /* surface             */
  --ink-hi: #191918;         /* near-black type     */
  --ink-lo: #37352f;         /* secondary           */
  --ink-dim: #615d59;        /* muted               */
  --ink-faint: #9a948d;      /* captions, placeholders */
  --line: #e6e6e6;           /* hairline            */
  --line-strong: #d3d1cb;
  --accent: #0075de;         /* Notion blue (CTA / links only) */
  --accent-deep: #005bab;
  --accent-soft: rgba(0, 117, 222, 0.09);
  --hover: rgba(0, 0, 0, 0.045);
  --sticker-sky: #62aef0;
  --sticker-purple: #d6b6f6;
  --sticker-pink: #ff64c8;
  --sticker-orange: #dd5b00;
  --sticker-teal: #2a9d99;
  --sticker-green: #1aae39;
  --sticker-blue: #0075de;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --shadow-l1: 0 0 0 1px rgba(0, 0, 0, 0.01), 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.05);
  --shadow-l2: 0 0 0 1px rgba(0, 0, 0, 0.015), 0 8px 22px rgba(0, 0, 0, 0.07), 0 22px 48px rgba(0, 0, 0, 0.08);

  --r-xs: 4px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
}

html { background: var(--paper); }
body {
  font-family: var(--font);
  color: var(--ink-lo);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a.btn, a.btn:hover { text-decoration: none; }

/* Type helpers */
.t-display { color: var(--ink-hi); font-weight: 700; letter-spacing: -0.04em; }
.t-title { color: var(--ink-hi); font-weight: 700; letter-spacing: -0.025em; }
.t-num { font-variant-numeric: tabular-nums; }
.t-cap { text-transform: uppercase; letter-spacing: 0.06em; }

/* ------------------------------------------------------------------ buttons
   Marketing pill (`.cta`) vs utility (`.btn`, 8px). All anchors styled too. */
a.btn, a.cta { display: inline-flex; align-items: center; justify-content: center; }
.btn, button.btn,
a.btn {
  min-height: 36px;
  padding: 7px 15px;
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 0.12s ease, border-color 0.12s ease, transform 0.08s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.btn:hover, button.btn:hover { background: #0069c9; border-color: #0069c9; }
.btn:active, button.btn:active { transform: scale(0.985); }
.btn:focus-visible, button.btn:focus-visible,
a.btn:focus-visible, .tab:focus-visible { outline: 2px solid rgba(0, 117, 222, 0.35); outline-offset: 2px; }

.btn.secondary, button.btn.secondary,
a.btn.secondary {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink-lo);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.btn.secondary:hover { background: #fafaf9; border-color: #bfbdb8; }

.btn.ghost, a.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-lo);
  box-shadow: none;
  font-weight: 550;
}
.btn.ghost:hover { background: var(--hover); }

a.btn.cta, .btn.cta, button.btn.cta {
  border-radius: 999px;
  padding: 9px 20px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 117, 222, 0.18);
}
a.btn.cta:hover { background: #0069c9; }
.btn.cta.secondary, a.btn.cta.secondary {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink-lo);
  box-shadow: var(--shadow-l1);
}
.btn.cta.secondary:hover { background: #fafaf9; }

.btn.lg { padding: 12px 24px; font-size: 15px; }
.btn.full { width: 100%; }

/* Inputs */
input, select, textarea {
  border-radius: var(--r-xs);
  border-color: var(--line-strong);
  background: var(--card);
}
input:hover, select:hover, textarea:hover { border-color: #b8b6b0; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.12);
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.02);
}
.card h2 { letter-spacing: -0.02em; }
.card h3 { font-weight: 600; }

/* ------------------------------------------------------------------ marketing
   landing.html  (daylight paper look) */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-nav .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-hi); }
.brand .brand-mark {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--ink-hi); color: #fff;
  font-weight: 700; font-size: 14px; letter-spacing: -0.03em;
}
.brand .brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; color: var(--ink-hi); }
.brand:hover { text-decoration: none; }

.site-links { display: flex; gap: 26px; }
.site-links a { color: var(--ink-dim); font-size: 14px; font-weight: 500; }
.site-links a:hover { color: var(--ink-hi); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 6px; }

.hero {
  position: relative;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 520px at 15% -10%, rgba(0, 117, 222, 0.06), transparent 60%),
    radial-gradient(1000px 500px at 95% 0%, rgba(214, 182, 246, 0.22), transparent 55%),
    linear-gradient(180deg, #fbfaf9 0%, var(--paper) 100%);
}
.hero .inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 88px 24px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}
.hero-copy { position: relative; z-index: 1; }
.badge-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-dim);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.badge-pill .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }
.badge-pill .dot.purple { background: #9b6bcf; }
.badge-pill .dot.green { background: #1aae39; }
.hero h1 {
  margin: 22px 0 0;
  color: var(--ink-hi);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
}
.hero .lede {
  margin: 22px 0 0;
  max-width: 560px;
  color: var(--ink-dim);
  font-size: 18px;
  line-height: 1.55;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 32px; }
.hero .note { margin-top: 16px; color: var(--ink-faint); font-size: 13px; }

.hero-art {
  position: relative;
  min-height: 460px;
  display: grid;
  place-items: center;
}
.mock-stack { position: relative; width: min(420px, 100%); }
.mock-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-l2);
  padding: 18px;
}
.mock-card.front { z-index: 2; transform: rotate(-1deg); }
.mock-card.back {
  position: absolute; inset: 18px -14px auto auto; z-index: 1;
  transform: rotate(2.5deg) scale(0.97);
  opacity: 0.7;
  border-radius: var(--r-xl);
  min-height: 220px;
}
.mock-chat { display: grid; gap: 10px; }
.mock-bubble {
  padding: 10px 14px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.5; width: fit-content; max-width: 80%;
}
.mock-bubble.in { background: var(--paper); color: var(--ink-lo); border-bottom-left-radius: 4px; }
.mock-bubble.out {
  justify-self: end; background: var(--ink-hi); color: #fff; border-bottom-right-radius: 4px;
}
.mock-meta { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 11.5px; }
.sticker-dot {
  position: absolute; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: var(--shadow-l1);
}
.sticker-dot.s1 { top: 2%; right: 4%; background: var(--sticker-purple); transform: rotate(6deg); }
.sticker-dot.s2 { bottom: 6%; left: -4%; background: var(--sticker-orange); transform: rotate(-8deg); }
.sticker-dot.s3 { top: 44%; right: -3%; background: var(--sticker-teal); width: 26px; height: 26px; font-size: 11px; transform: rotate(10deg); }
.float-pill {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-l2);
  font-size: 13px; font-weight: 600; color: var(--ink-hi);
}
.float-pill.f1 { bottom: 6%; right: -2%; }
.float-pill.f2 { top: 2%; left: -6%; color: var(--ink-dim); font-weight: 500; }
.float-pill .tick { width: 18px; height: 18px; border-radius: 999px; background: var(--sticker-green); color: #fff; display: grid; place-items: center; font-size: 11px; }

.band { padding: 78px 24px; }
.band > .inner { max-width: 1180px; margin: 0 auto; }
.band.soft { background: var(--paper); }
.band-head { max-width: 720px; margin: 0 auto 46px; text-align: center; }
.band-head .kicker { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; }
.band-head h2 { margin: 12px 0 0; color: var(--ink-hi); font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.12; }
.band-head p { margin: 16px auto 0; color: var(--ink-dim); font-size: 16px; line-height: 1.6; max-width: 620px; }

.channel-strip {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-lo); font-size: 13.5px; font-weight: 550;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.chip i { width: 9px; height: 9px; border-radius: 3px; background: var(--sticker-sky); display: inline-block; }
.chip i.g { background: var(--sticker-green); }
.chip i.o { background: var(--sticker-orange); }
.chip i.p { background: var(--sticker-purple); }
.chip i.t { background: var(--sticker-teal); }
.chip i.b { background: var(--accent); }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 28px 26px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-l1); }
.feature .ico {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 18px; margin-bottom: 18px;
}
.feature h3 { margin: 0 0 8px; color: var(--ink-hi); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.feature p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.6; }
.ico.sky { background: rgba(98, 174, 240, 0.16); }
.ico.purple { background: rgba(214, 182, 246, 0.28); }
.ico.pink { background: rgba(255, 100, 200, 0.12); }
.ico.orange { background: rgba(221, 91, 0, 0.1); }
.ico.teal { background: rgba(42, 157, 153, 0.14); }
.ico.green { background: rgba(26, 174, 57, 0.12); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: step; }
.step { position: relative; padding-top: 8px; }
.step .num {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
  background: var(--ink-hi); color: #fff; font-size: 13px; font-weight: 700;
  margin-bottom: 18px;
}
.step h3 { margin: 0 0 8px; color: var(--ink-hi); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.step p { margin: 0; color: var(--ink-dim); font-size: 14px; line-height: 1.6; }
.step::after {
  content: ""; position: absolute; top: 22px; left: 38px; right: 8px; height: 1px; background: var(--line);
}
.step:last-child::after { display: none; }

.stat-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 30px 28px;
}
.stat b { display: block; color: var(--ink-hi); font-size: 40px; font-weight: 700; letter-spacing: -0.04em; }
.stat span { display: block; margin-top: 8px; color: var(--ink-dim); font-size: 14px; line-height: 1.5; }

.cta-band { background: var(--ink-hi); border-radius: 20px; max-width: 1180px; margin: 0 auto; padding: 56px 40px; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -0.03em; margin: 0 0 10px; }
.cta-band p { color: rgba(255, 255, 255, 0.72); font-size: 16px; margin: 0 auto 26px; max-width: 520px; line-height: 1.6; }
.cta-band .btn.cta { background: #fff; color: var(--ink-hi); border-color: #fff; }
.cta-band .btn.cta:hover { background: #f2f1ef; }
.cta-band .btn.cta.secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.3); box-shadow: none; }
.cta-band .btn.cta.secondary:hover { background: rgba(255, 255, 255, 0.08); }

.site-footer { background: var(--paper); border-top: 1px solid var(--line); margin-top: 84px; }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 44px 24px 30px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer .col .brand-name { display: inline-block; margin: 10px 0 6px; }
.site-footer .col p { color: var(--ink-dim); font-size: 13px; line-height: 1.6; max-width: 300px; margin: 0; }
.site-footer h5 { margin: 0 0 12px; color: var(--ink-hi); font-size: 13px; font-weight: 700; }
.site-footer .col a { display: block; color: var(--ink-dim); font-size: 13.5px; padding: 3px 0; }
.site-footer .col a:hover { color: var(--ink-hi); text-decoration: none; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .inner { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; gap: 12px; color: var(--ink-faint); font-size: 12.5px; }

/* ------------------------------------------------------------------ auth pages
   signup / onboarding / activate / recover / verify-email */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.auth-top {
  padding: 20px 26px; max-width: 1160px; margin: 0 auto; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 12px 20px 48px; width: 100%; }
.auth-card {
  width: 100%; max-width: 560px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-l1);
  padding: 36px 38px;
}
.auth-card.wide { max-width: 760px; }
.auth-card.slim { max-width: 440px; }
.auth-head h1 { margin: 0; color: var(--ink-hi); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.auth-head .auth-sub { margin: 8px 0 0; color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12px; margin: 20px 0; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.auth-alt { text-align: center; color: var(--ink-dim); font-size: 13.5px; margin: 18px 0 0; }
.auth-foot { padding: 18px; text-align: center; color: var(--ink-faint); font-size: 12px; }
.auth-check { width: 52px; height: 52px; border-radius: 14px; background: rgba(26, 174, 57, 0.14); color: #1a8a32; display: grid; place-items: center; font-size: 24px; margin-bottom: 18px; }
.auth-head .desc, .auth-card .desc { margin: 8px 0 0; color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; }
.auth-card .inline-note { color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; }

/* Setup (onboarding) */
.setup-page { min-height: 100vh; background: var(--paper); }
.setup-top {
  max-width: 1060px; margin: 0 auto; padding: 20px 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.setup-main { max-width: 1060px; margin: 0 auto; padding: 28px 24px 90px; }
.setup-title { margin: 6px 0 4px; color: var(--ink-hi); font-size: 32px; font-weight: 700; letter-spacing: -0.04em; }
.setup-title small { display: block; margin-top: 8px; color: var(--ink-dim); font-size: 15px; font-weight: 400; letter-spacing: 0; }

.setup-steps { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 26px 0 30px; }
.setup-steps .ss {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink-faint); font-size: 13px; font-weight: 600;
}
.setup-steps .ss .n {
  width: 20px; height: 20px; border-radius: 999px; background: var(--paper);
  display: grid; place-items: center; font-size: 11px; color: var(--ink-dim);
}
.setup-steps .ss.done { color: var(--ink-dim); }
.setup-steps .ss.done .n { background: rgba(26, 174, 57, 0.16); color: #1a8a32; }
.setup-steps .ss.now { border-color: rgba(0, 117, 222, 0.45); color: var(--accent-deep); box-shadow: 0 0 0 3px var(--accent-soft); }
.setup-steps .ss.now .n { background: var(--accent); color: #fff; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 30px; margin-bottom: 20px; box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, 0.02);
}
.panel h2 { margin: 0 0 6px; color: var(--ink-hi); font-size: 20px; font-weight: 700; letter-spacing: -0.025em; }
.panel h3 { margin: 0 0 14px; color: var(--ink-lo); font-size: 14px; font-weight: 600; }
.panel > .desc, .panel .desc { color: var(--ink-dim); font-size: 14px; line-height: 1.6; }
.panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.field small { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 12px; line-height: 1.45; }
.form-status { display: block; font-size: 13px; min-height: 18px; margin: 10px 0 0; color: var(--ink-dim); }
.form-status[data-state="success"] { color: #1a8a32; }
.form-status[data-state="error"] { color: #b42318; }

/* compact centered card (activate / recover / verify) */
.center-panel {
  width: 100%; max-width: 460px; margin: 0 auto;
}
.verify-ok { display: flex; align-items: center; gap: 10px; color: #1a8a32; font-size: 14px; font-weight: 600; }

/* ------------------------------------------------------------------ console gate
   shown until session is restored on /client and /platform */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 480px at 12% -6%, rgba(0, 117, 222, 0.06), transparent 55%),
    radial-gradient(760px 420px at 98% 0%, rgba(214, 182, 246, 0.2), transparent 55%),
    var(--paper);
  overflow: auto;
}
.gate-card { width: min(420px, calc(100vw - 40px)); padding: 32px 34px; }
.gate-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; color: var(--ink-hi); }
.gate-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--ink-hi); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.gate-brand b { font-size: 16px; letter-spacing: -0.02em; }
.gate-card h1 { margin: 0 0 6px; color: var(--ink-hi); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.gate-card .sub { color: var(--ink-dim); font-size: 14px; margin: 0 0 22px; line-height: 1.5; }
.gate .field { margin-bottom: 14px; }
.gate .gate-actions { margin-top: 18px; display: grid; gap: 8px; }
.gate-note { text-align: center; color: var(--ink-faint); font-size: 12.5px; margin: 14px 0 0; }
.gate-note a { color: var(--accent); }
.gate-error { color: #b42318; font-size: 13px; min-height: 18px; margin-top: 10px; text-align: center; }
.gate-pill { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; color: var(--ink-hi); width: fit-content; }
.gate-pill .s { width: 8px; height: 8px; border-radius: 999px; background: #1aae39; }

/* When authenticated, hide the gate and reveal the app */
body.client-dashboard .gate, body.platform-dashboard .gate { display: grid; }
body.client-dashboard.authed .gate, body.platform-dashboard.authed .gate { display: none; }
body.client-dashboard:not(.authed) .app, body.platform-dashboard:not(.authed) .app { display: none; }

/* hide the hard-coded "Workspace" ::before when explicit nav-group labels exist */
.nav::before { content: none; }
@media (max-width: 820px) { .nav-group { display: none; } }

/* ------------------------------------------------------------------ console chrome */
.sidebar { background: var(--paper); border-right: 1px solid var(--line); }
.nav { gap: 2px; padding: 8px; }
.nav-group {
  padding: 14px 9px 4px;
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 650;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.nav button { border-radius: var(--r-md); }
.nav button:hover { background: var(--hover); }
.nav button.active {
  background: var(--card);
  color: var(--ink-hi);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03), inset 2px 0 0 var(--accent);
}
.nav button.active::before { color: var(--accent); }
.nav .tag { border-color: var(--line-strong); background: var(--card); color: var(--ink-faint); }

.topbar {
  background: rgba(246, 245, 244, 0.85);
  border-bottom: 1px solid rgba(230, 230, 230, 0.9);
  backdrop-filter: blur(12px);
}
.topbar h1 { font-weight: 700; letter-spacing: -0.025em; }
.topbar .right select { width: auto; max-width: 240px; min-height: 34px; }
.topbar .right { gap: 10px; }

/* Account chip replacing the inline credential bar after auth */
.account-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.account-chip .ava {
  width: 26px; height: 26px; border-radius: 999px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.account-chip .who { line-height: 1.15; }
.account-chip .who b { display: block; color: var(--ink-lo); font-size: 12.5px; font-weight: 600; }
.account-chip .who span { display: block; color: var(--ink-faint); font-size: 10.5px; }
.account-chip button { border: 0; background: transparent; color: var(--ink-dim); cursor: pointer; font-size: 12px; padding: 6px 9px; border-radius: 999px; }
.account-chip button:hover { background: var(--hover); color: var(--ink-hi); }

/* content */
.content { max-width: 1320px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title-row h2 { margin: 0; color: var(--ink-hi); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.section-title-row .desc { margin: 4px 0 0; max-width: 640px; color: var(--ink-dim); font-size: 13.5px; }

/* ------------------------------------------------------------------ in-page tabs
   Segmented Notion control for Connections / Catalog / Knowledge */
.tabbar { margin-bottom: 20px; }
.tabs {
  display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap;
  padding: 4px;
  background: rgba(0, 0, 0, 0.045);
  border-radius: 999px;
  width: fit-content; max-width: 100%;
}
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 15px; border-radius: 999px;
  color: var(--ink-dim); font-size: 13px; font-weight: 600;
  transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.tab:hover { color: var(--ink-hi); }
.tab.active { background: var(--card); color: var(--ink-hi); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08); }
.tab[data-count]::after { content: attr(data-count); margin-left: 6px; color: var(--ink-faint); font-weight: 600; font-size: 11px; }
.tabpanel[hidden] { display: none !important; }
.tabpanel { animation: themeFade 0.18s ease-out; }
@keyframes themeFade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------------------ data tables & lists */
table.data thead th {
  background: var(--paper);
  color: var(--ink-faint);
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.08em;
}
table.data th:first-child { border-left: 1px solid var(--line); }
table.data th:last-child { border-right: 1px solid var(--line); }
table.data td { border-bottom: 1px solid #efeeec; }
table.data tbody tr:hover:not(.section-head) { background: #faf9f8; }
select.status {
  width: auto; min-width: 150px; min-height: 30px; padding: 4px 26px 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line-strong);
}
.kpi { border-radius: var(--r-lg); }
.kpis { grid-auto-rows: 1fr; }
.kpi .value { letter-spacing: -0.02em; }

/* conversations inbox */
.conv-pane { display: grid; gap: 16px; align-items: start; }
.conv-pane.cols { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
.conv-pane.cols .conv-list { max-height: calc(100vh - 250px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #d8d6d3 transparent; }
.conv-pane .conv-list::-webkit-scrollbar { width: 8px; }
.conv-pane .conv-list::-webkit-scrollbar-thumb { background: #d8d6d3; border-radius: 999px; }
.conv-pane.cols .list-card .desc { margin-bottom: 14px; }
.conv-pane .list-card { min-width: 0; }
.conv-list { display: grid; gap: 8px; max-height: min(70vh, 720px); overflow: auto; padding-right: 2px; }
.conversation-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line) !important;
  background: var(--card) !important;
  padding: 14px 15px !important;
  border-radius: 12px !important;
  transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.conversation-item:hover { background: #fafaf9 !important; border-color: var(--line-strong) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }
.conversation-item .c-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.conversation-item .c-top strong { color: var(--ink-hi); font-size: 14px; letter-spacing: -0.01em; }
.conversation-item .c-top time { color: var(--ink-faint); font-size: 11px; white-space: nowrap; }
.conversation-item .c-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 7px; }
.conversation-item .c-preview { margin-top: 9px; color: var(--ink-dim); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.conversation-item .c-foot { margin-top: 8px; color: var(--ink-faint); font-size: 11.5px; }

.transcript-card { min-width: 0; position: sticky; top: 88px; }
.transcript-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.chat { display: grid; gap: 6px; padding: 6px 0 2px; }
.chat-row { display: flex; }
.chat-row.visitor { justify-content: flex-start; }
.chat-row.agent { justify-content: flex-end; }
.chat-bubble {
  max-width: min(78%, 720px);
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  color: var(--ink-lo);
}
.chat-row.visitor .chat-bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.chat-row.agent .chat-bubble {
  background: var(--ink-hi);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.chat-role { display: block; margin-bottom: 5px; font-size: 11px; font-weight: 600; color: var(--ink-faint); }
.chat-row.agent .chat-role { color: rgba(255, 255, 255, 0.7); }
.chat-bubble .hint { font-size: 12px; margin-top: 6px; }
.chat-row.agent .chat-bubble .hint { color: rgba(255, 255, 255, 0.75); }
.chat-row.agent .chat-bubble a { color: #bfdbf5; }
.outcome-box { margin-bottom: 12px; }
.outcome-box .label { color: var(--ink-faint); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }
.outcome-box .body { margin-top: 6px; font-size: 13px; color: var(--ink-lo); line-height: 1.55; }

/* ------------------------------------------------------------------ catalog cards */
.catalog-list { display: grid; gap: 12px; }
.catalog-live-card { border-radius: var(--r-lg) !important; min-height: 0 !important; overflow: hidden; }
.catalog-top { display: flex; gap: 14px; align-items: flex-start; }
.catalog-top img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.catalog-thumb { width: 76px; height: 76px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; color: var(--ink-faint); font-size: 22px; flex: 0 0 auto; }
.catalog-main { flex: 1; min-width: 0; }
.catalog-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.catalog-title strong { color: var(--ink-hi); font-size: 15px; letter-spacing: -0.01em; }
.catalog-sub { margin-top: 6px; color: var(--ink-dim); font-size: 13px; line-height: 1.5; }
.catalog-price { margin-top: 7px; font-size: 13px; color: var(--ink-lo); }
.catalog-price b { color: var(--ink-hi); }
.catalog-sku { color: var(--ink-faint); font-size: 11.5px; margin-top: 4px; }
.catalog-live-facts { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.catalog-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.variant-block { margin-top: 14px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.variant-block .v-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.variant-block .v-row:last-child { border-bottom: 0; }
.variant-block .v-row small { color: var(--ink-faint); }

/* rich list used for insight / knowledge candidates / signal lines */
.signal-line { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.signal-line + .signal-line { margin-top: 8px; }
.signal-line .s-label { color: var(--ink-dim); font-size: 13px; font-weight: 550; }
.signal-line .s-val { color: var(--ink-hi); font-size: 13.5px; font-weight: 600; white-space: nowrap; }

/* misc component polish */
.reply-composer { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
details.guide-block { border-radius: 10px; }
pre.snippet { border-radius: 10px; }
.badge { font-weight: 600; }
.toast { border-radius: 12px; }

/* knowledge review two-col refinement */
.review-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* empty / hint clarifiers */
.empty { color: var(--ink-faint); }
.hint { color: var(--ink-dim); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .hero .inner { grid-template-columns: 1fr; padding-top: 60px; gap: 40px; }
  .hero-art { min-height: 340px; }
  .mock-stack { width: min(360px, 100%); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: 24px; }
}

@media (max-width: 860px) {
  .site-links { display: none; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .step::after { display: none; }
  .site-footer .inner { grid-template-columns: 1fr 1fr; }
  .panel-grid, .panel-grid.three, .review-cols, .catalog-live-facts { grid-template-columns: 1fr; }
  .transcript-card { position: static; }
  .conv-pane.cols { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .hero .inner { padding: 44px 18px 40px; }
  .band { padding: 48px 18px; }
  .stat-band { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 22px; }
  .site-footer .inner { grid-template-columns: 1fr; }
  .setup-top, .auth-top { padding: 16px 18px 0; }
  .cta-band { padding: 40px 22px; }
  .catalog-actions { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .tabpanel { animation: none; }
  .feature:hover { transform: none; }
}
