/* ==========================================================================
   Dashi — dark premium UI
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #08090c;
  --bg-2: #0c0e13;
  --surface: #111319;
  --surface-2: #161922;
  --surface-3: #1c202b;
  --border: #232734;
  --border-2: #2e3342;
  --text: #eef0f6;
  --text-2: #a6acbd;
  --muted: #6e7589;

  --accent: #8b7bff;
  --accent-2: #9d8fff;
  --accent-soft: rgba(139, 123, 255, .14);
  --accent-ring: rgba(139, 123, 255, .45);
  --grad: #8b7bff;

  --sales: #f4b73f;
  --sales-soft: rgba(244, 183, 63, .13);

  --good: #3ccf91;
  --good-soft: rgba(60, 207, 145, .12);
  --warn: #f4b73f;
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .12);

  /* charts (dark steps from the validated reference palette) */
  --viz-1: #3987e5;
  --viz-under: #d95926;
  --viz-grid: #232734;
  --viz-axis: #6e7589;

  --tiktok: #25f4ee;
  --instagram: #e1306c;
  --facebook: #1877f2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -12px rgba(0,0,0,.6);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar: 248px;
  --tabbar-bg: rgba(12, 14, 19, .9);
  --tabbar-h: 62px;
}

*, *::before, *::after { box-sizing: border-box; }
/* iOS Safari zooms the page when a field under 16px gets focus. Every
   input, everywhere (onboarding, settings, login, search, ideas…). */
input, textarea, select { font-size: 16px !important; }
[hidden] { display: none !important; }

/* PWA safe area — iPhone notch/dynamic island */
@supports (padding-top: env(safe-area-inset-top)) {
  .topbar { padding-top: calc(env(safe-area-inset-top) + 14px) !important; top: 0 !important; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .sidebar { padding-top: calc(env(safe-area-inset-top) + 16px) !important; }
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 var(--font); font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
.num, .stat-value, td.n { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ti { font-size: 1.15em; vertical-align: -0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 17px;
  box-shadow: 0 6px 20px -6px rgba(200,107,255,.6);
}
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav a .ti { font-size: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.nav a.active .ti { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text-2); border: 1px solid var(--border-2); flex: none; }
.user-chip .who { min-width: 0; }
.user-chip .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 14px 32px;
  background: rgba(8, 9, 12, .78); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .page-title { font-weight: 650; font-size: 15px; }
.topbar .spacer { flex: 1; }
.topbar .menu-btn { display: none; }
.content { padding: 28px 32px 64px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--text-2); margin-top: 6px; max-width: 640px; }

/* ------------------------------------------------------------ mode switch */
.mode-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.mode-switch button {
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.mode-switch button.on.growth { background: var(--accent-soft); color: #c9c1ff; box-shadow: inset 0 0 0 1px var(--accent-ring); }
.mode-switch button.on.sales { background: var(--sales-soft); color: #ffd98a; box-shadow: inset 0 0 0 1px rgba(244,183,63,.4); }
.mode-switch button.on.combined { background: linear-gradient(90deg, var(--accent-soft), var(--sales-soft)); color: #f0e2ff; box-shadow: inset 0 0 0 1px var(--accent-ring); }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head .ti { color: var(--muted); }
.card.glow { position: relative; overflow: hidden; }
.card.glow::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(139,123,255,.5), rgba(200,107,255,.15) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mt-l { margin-top: 28px; }

/* ------------------------------------------------------------------ stats */
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.stat-sub { margin-top: 6px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delta { font-weight: 600; font-size: 12.5px; display: inline-flex; align-items: center; gap: 2px; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--muted); }

/* --------------------------------------------------------------- platform */
.pf-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; vertical-align: middle; place-items: center; font-size: 19px; background: var(--surface-3); border: 1px solid var(--border-2); flex: none; }
.pf-icon.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 14px; }
.pf-tiktok { color: var(--tiktok); } .pf-instagram { color: var(--instagram); } .pf-facebook { color: var(--facebook); }
.platform-card { display: flex; flex-direction: column; gap: 14px; }
.platform-card .top { display: flex; align-items: center; gap: 12px; }
.platform-card .handle { font-weight: 600; }
.platform-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.platform-card .metrics div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.platform-card .metrics b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.platform-card .metrics span { font-size: 11.5px; color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 13.5px; line-height: 1;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s, transform .05s, opacity .15s;
}
.btn:hover { background: var(--surface-3); border-color: #3a4052; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 4px 12px -4px rgba(139,123,255,.5); }
.btn-primary:hover { background: #9d8fff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { background: var(--bad-soft); border-color: rgba(255,107,107,.35); color: #ffb0b0; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn .spin { display: none; }
.btn.is-busy .spin { display: inline-block; animation: spin 1s linear infinite; }
.btn.is-busy .ti:not(.spin) { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: #bdb3ff; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12.5px; color: var(--bad); }
.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border-2); border-radius: 10px; padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 84px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.has-error { border-color: rgba(255,107,107,.6); }
.input-icon { position: relative; }
.input-icon .ti { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 18px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* choice cards (mode picker) */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .box {
  height: 100%; border: 1px solid var(--border-2); background: var(--surface-2); border-radius: 14px; padding: 18px;
  display: grid; gap: 8px; transition: border-color .15s, background .15s, box-shadow .15s;
}
.choice .box .ti { font-size: 24px; }
.choice:hover .box { border-color: #3d4356; }
.choice input:checked + .box { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.choice.sales input:checked + .box { border-color: var(--sales); background: var(--sales-soft); box-shadow: 0 0 0 3px var(--sales-soft); }
.choice input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ flash */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 20px; border: 1px solid; font-weight: 500; }
.flash.success { background: var(--good-soft); border-color: rgba(60,207,145,.3); color: #a6f0cf; }
.flash.error { background: var(--bad-soft); border-color: rgba(255,107,107,.3); color: #ffc0c0; }
.flash.info { background: var(--accent-soft); border-color: var(--accent-ring); color: #d5cfff; }
.toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast-host .flash { margin: 0; box-shadow: 0 16px 40px -12px rgba(0,0,0,.7); background-color: var(--surface-2); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ------------------------------------------------------------------ pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-2); white-space: nowrap; }
.pill.top { background: rgba(255,122,92,.14); color: #ffb49c; border-color: rgba(255,122,92,.35); }
.pill.good { background: var(--good-soft); color: #93e8c3; border-color: rgba(60,207,145,.3); }
.pill.ok { color: var(--text-2); }
.pill.low { background: transparent; color: var(--muted); }
.pill.ai { background: var(--accent-soft); color: #cbc3ff; border-color: var(--accent-ring); }
.pill.sales { background: var(--sales-soft); color: #ffd98a; border-color: rgba(244,183,63,.35); }
.pill.err { background: var(--bad-soft); color: #ffb0b0; border-color: rgba(255,107,107,.3); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.ok { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot.pending { background: var(--warn); }
.dot.error { background: var(--bad); }

/* ------------------------------------------------------------------ posts */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.post-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.post-thumb { position: relative; aspect-ratio: 9 / 14; background: var(--surface-3); overflow: hidden; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 28px; }
.post-thumb .shade { position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.post-thumb .corner { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; }
.post-thumb .corner .pill { backdrop-filter: blur(6px); background: rgba(10,11,15,.65); }
.post-thumb .corner .pill.top { background: rgba(60,20,10,.7); }
.post-thumb .views { position: absolute; left: 10px; bottom: 9px; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 5px; }
.post-thumb .score { position: absolute; right: 10px; bottom: 9px; font-weight: 700; font-size: 13px; }
.post-body { padding: 10px 12px 12px; display: grid; gap: 6px; }
.post-body .hook { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.post-body .meta { display: flex; flex-wrap: nowrap; gap: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; white-space: nowrap; }
.post-body .meta span { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }

.post-row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.post-row:last-child { border-bottom: 0; }
.post-row .thumb { width: 52px; height: 70px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.post-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-row .title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-row .mult { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
.post-row:hover .title { color: #fff; }

/* -------------------------------------------------------------- filters */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover { color: var(--text); background: var(--surface-2); }
.seg a.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 24px; align-items: center; }

/* ------------------------------------------------------------- insights */
.insight { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.insight:last-child { border-bottom: 0; padding-bottom: 0; }
.insight:first-child { padding-top: 0; }
.insight .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: #c3b9ff; font-size: 20px; }
.insight.warning .ico { background: var(--bad-soft); color: #ffa3a3; }
.insight .title { font-weight: 650; }
.insight .text { color: var(--text-2); margin-top: 2px; }
.insight .tip { margin-top: 6px; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }

.lift-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 56px; gap: 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.lift-row:last-child { border-bottom: 0; }
.lift-row .what { font-weight: 550; }
.lift-row .n { font-size: 12px; color: var(--muted); }
.lift-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.lift-row .val.up { color: #8fc0ff; } .lift-row .val.down { color: #ffa27a; }
.lift-meter { position: relative; height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.lift-meter .lift-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--muted); transform: translateX(-1px); }
.lift-meter .lift-fill { position: absolute; top: 0; bottom: 0; }
.lift-meter .lift-fill.up { background: var(--viz-1); border-radius: 0 999px 999px 0; }
.lift-meter .lift-fill.down { background: var(--viz-under); border-radius: 999px 0 0 999px; }

.combo { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.combo .chip { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); font-weight: 600; }
.combo .chip small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

.banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--border-2); }
.banner .ti { font-size: 22px; color: var(--accent); }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2); }
.empty .ti { font-size: 36px; color: var(--muted); display: block; margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }

/* ----------------------------------------------------------------- ideas */
.idea { display: grid; gap: 12px; align-content: start; }
.idea .hook { font-size: 17px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; }
.idea .why { font-size: 13px; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.idea ol { margin: 0; padding-left: 20px; color: var(--text-2); display: grid; gap: 4px; }
.idea .foot { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.idea.saved { border-color: var(--accent-ring); }
.idea.used { opacity: .6; }
.idea .foot .btn { flex: 1; justify-content: center; }
.idea .foot .btn-icon { flex: none; }
.btn-filmed { background: #1f7a57; border-color: transparent; color: #eafff5; }
.btn-filmed:hover { background: #238a62; border-color: transparent; color: #fff; }
.btn-cancel { background: transparent; border-color: transparent; color: var(--muted); }
.btn-cancel:hover { background: var(--surface-2); border-color: transparent; color: var(--text-2); }
.idea.is-busy { pointer-events: none; opacity: .7; }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { margin-bottom: 8px; }

/* -------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; }

/* -------------------------------------------------------------- charts */
.viz { width: 100%; height: auto; display: block; overflow: visible; }
.viz-line { height: 250px; }
.card .viz-line.compact { height: 150px; }
.viz-stroke { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.viz-area { fill: var(--viz-1); opacity: .1; }
.viz-dot { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; }
.viz-cursor { fill: var(--viz-1); stroke: var(--surface); stroke-width: 2; opacity: 0; pointer-events: none; }
/* Line charts: round dots whatever the stretch; axis text as HTML around the drawing (never distorted). */
path.viz-dot, path.viz-cursor { fill: none; stroke: var(--viz-1); stroke-width: 9; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.viz-wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; row-gap: 4px; }
.viz-wrap .viz-y { position: relative; min-width: 2.6em; font-size: 11px; line-height: 1; color: var(--viz-axis); font-variant-numeric: tabular-nums; }
.viz-wrap .viz-y span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.viz-ticks { grid-column: 2; position: relative; height: 14px; font-size: 11px; line-height: 1; color: var(--viz-axis); font-variant-numeric: tabular-nums; }
.viz-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.viz-ticks-dates span:last-child { transform: translateX(-100%); }
.viz-wrap .viz-x { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--viz-axis); }
@media (max-width: 520px) { .viz-wrap .viz-line { height: 180px; } }
.viz.hovering .viz-cursor { opacity: 1; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-axis-line { stroke: var(--border-2); stroke-width: 1; }
.viz-baseline { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-axis { fill: var(--viz-axis); font-size: 11px; font-family: var(--font); }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-bar { fill: var(--viz-1); transition: filter .1s; }
.viz-bar-under { fill: var(--viz-under); }
.viz-bar-partial { opacity: .5; }
.viz-mark:hover .viz-bar, .viz-mark:focus .viz-bar { filter: brightness(1.25); }
.viz-mark { outline: none; }
.viz-spark { width: 120px; height: 32px; }
.tooltip {
  position: fixed; z-index: 200; pointer-events: none; padding: 8px 11px; border-radius: 9px;
  background: #1f2330; border: 1px solid var(--border-2); box-shadow: 0 10px 30px -10px rgba(0,0,0,.8);
  font-size: 12px; color: var(--text-2); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
}
.tooltip strong { display: block; color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

/* ------------------------------------------------------------ progress */
.meter { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.fit { display: grid; grid-template-columns: 36px 1fr 60px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fit:last-child { border-bottom: 0; }
.fit .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); font-size: 18px; }
.fit .score { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.stage-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.stage-track div { padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.stage-track div b { display: block; color: var(--text-2); font-size: 13px; }
.stage-track div.on { border-color: var(--sales); background: var(--sales-soft); }
.stage-track div.on b { color: #ffd98a; }
.stage-track div.done b { color: var(--text); }

.weeks { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.week { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.week h4 { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.week .focus { font-weight: 650; margin: 4px 0 8px; }
.week ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }

/* ------------------------------------------------------------ post page */
.post-layout { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.post-media { border-radius: 16px; overflow: hidden; background: var(--surface-3); aspect-ratio: 9 / 16; border: 1px solid var(--border); position: sticky; top: 84px; }
.post-media img { width: 100%; height: 100%; object-fit: cover; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.kv span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kv b { font-weight: 600; font-size: 13.5px; }
.quote { font-size: 15px; font-weight: 550; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--accent); }
.bullets { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }
.transcript { max-height: 220px; overflow: auto; color: var(--text-2); font-size: 13px; white-space: pre-wrap; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }

/* ------------------------------------------------------------- auth / public */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% -10%, rgba(139,123,255,.28), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255,122,182,.18), transparent 60%), var(--bg-2); border-right: 1px solid var(--border); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h2 { font-size: 34px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; max-width: 460px; }
.auth-art .points { display: grid; gap: 14px; max-width: 420px; }
.auth-art .points div { display: flex; gap: 12px; color: var(--text-2); }
.auth-art .points .ti { color: #c3b9ff; font-size: 20px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .inner { width: 100%; max-width: 380px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .sub { color: var(--text-2); margin-bottom: 26px; }

.landing { background: radial-gradient(1400px 700px at 50% -20%, rgba(139,123,255,.22), transparent 60%), var(--bg); }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; max-width: 1200px; margin: 0 auto; }
.hero { text-align: center; padding: 72px 24px 40px; max-width: 900px; margin: 0 auto; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; margin-bottom: 22px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); letter-spacing: -.045em; line-height: 1.02; font-weight: 750; }
.hero p { font-size: 18px; color: var(--text-2); margin: 20px auto 0; max-width: 640px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.features { max-width: 1200px; margin: 40px auto 0; padding: 0 24px 80px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: #c3b9ff; font-size: 22px; margin-bottom: 14px; }
.feature p { color: var(--text-2); margin-top: 6px; }
.mock { max-width: 1000px; margin: 0 auto; padding: 0 24px; }
.mock .card { padding: 24px; }
.footer { text-align: center; color: var(--muted); padding: 30px; border-top: 1px solid var(--border); font-size: 12.5px; }

.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.error-page .code { font-size: 72px; font-weight: 800; letter-spacing: -.05em; }

/* --------------------------------------------------------------- mobile */
.scrim { display: none; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .weeks { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open { overflow: hidden; }
  body.nav-open .sidebar { transform: none; overscroll-behavior: contain; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; touch-action: pan-y; }
  body.nav-open .scrim { display: block; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .post-layout, .auth, .choices, .form-row { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .post-media { position: static; max-width: 320px; margin: 0 auto; width: 100%; }
  .auth-art { display: none; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .features { grid-template-columns: 1fr; }
  .lift-row { grid-template-columns: minmax(0, 1fr) 80px 48px; }
  .stage-track { grid-template-columns: 1fr 1fr; }
  .landing-nav { padding: 16px; }
  h1 { font-size: 22px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-value { font-size: 22px; }
  .weeks { grid-template-columns: 1fr; }
  .platform-card .metrics { grid-template-columns: 1fr 1fr 1fr; }
  .topbar .sync-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.btn.on { border-color: var(--accent-ring); background: var(--accent-soft); color: #d5cfff; }

/* ==========================================================================
   Dashi — brand, mascot, onboarding, bio builder
   ========================================================================== */
.brand-logo { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(255,255,255,.12)); }
.brand:hover .brand-logo { animation: dashi-hop .5s ease; }

/* ---- mascot animations (all respect prefers-reduced-motion below) */
.dashi { display: block; overflow: visible; }
.dashi .dashi-body { transform-origin: 100px 186px; }
.dashi-anim-bob .dashi-body { animation: dashi-bob 2.6s ease-in-out infinite; }
.dashi-anim-bounce .dashi-body { animation: dashi-bounce 1.2s cubic-bezier(.3,.7,.4,1) infinite; }
.dashi-anim-breathe .dashi-body { animation: dashi-breathe 3.2s ease-in-out infinite; }
.dashi-wave { transform-origin: 150px 104px; animation: dashi-wave 1.1s ease-in-out infinite; }
.dashi-float { animation: dashi-float 2.2s ease-in-out infinite; }
.dashi-twinkle path { animation: dashi-twinkle 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.dashi-twinkle path:nth-child(2) { animation-delay: .4s; } .dashi-twinkle path:nth-child(3) { animation-delay: .8s; }
.dashi-glow { animation: dashi-glow 1.8s ease-in-out infinite; }
.dashi-scan { animation: dashi-scan 2.8s ease-in-out infinite; }
.dashi-write { animation: dashi-write .9s ease-in-out infinite; transform-box: fill-box; }
.dashi-confetti > * { animation: dashi-fall 2.4s ease-in infinite; transform-box: fill-box; }
.dashi-confetti > *:nth-child(2n) { animation-delay: .6s; } .dashi-confetti > *:nth-child(3n) { animation-delay: 1.1s; }
.dashi-dots > * { animation: dashi-dot 1.2s ease-in-out infinite; }
.dashi-dots > *:nth-child(2) { animation-delay: .2s; } .dashi-dots > *:nth-child(3) { animation-delay: .4s; }
.dashi-blink { animation: dashi-blink 1s steps(1) infinite; }
@keyframes dashi-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes dashi-bounce { 0%,100% { transform: translateY(0) scale(1,1); } 15% { transform: translateY(0) scale(1.06,.94); } 45% { transform: translateY(-14px) scale(.97,1.03); } 70% { transform: translateY(0) scale(1.03,.97); } }
@keyframes dashi-breathe { 0%,100% { transform: scale(1,1); } 50% { transform: scale(1.03,.97); } }
@keyframes dashi-hop { 50% { transform: translateY(-4px) rotate(-6deg); } }
@keyframes dashi-wave { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-28deg); } }
@keyframes dashi-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes dashi-twinkle { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .5; } }
@keyframes dashi-glow { 0%,100% { opacity: 1; } 50% { opacity: .75; } }
@keyframes dashi-scan { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-26px); } }
@keyframes dashi-write { 0%,100% { transform: translate(120px,118px) rotate(40deg); } 50% { transform: translate(112px,122px) rotate(34deg); } }
@keyframes dashi-fall { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(30px) rotate(160deg); opacity: 0; } }
@keyframes dashi-dot { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
@keyframes dashi-blink { 50% { opacity: .2; } }

/* ---- speech bubble */
.bubble { position: relative; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 16px; padding: 12px 16px; color: var(--text); font-weight: 500; line-height: 1.5; }
.bubble::before { content: ''; position: absolute; left: -8px; top: 22px; width: 14px; height: 14px; background: var(--surface-2); border-left: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); transform: rotate(45deg); }

/* ---- empty / hero states with Dashi */
.dashi-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 36px 20px; color: var(--text-2); }
.dashi-empty h3 { color: var(--text); font-size: 17px; }
.dashi-empty p { max-width: 440px; }
.dashi-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.dashi-hero .bubble { max-width: 560px; }
.page-head .dashi-head { display: flex; align-items: center; gap: 14px; }
.page-head .dashi-head .dashi { flex: none; margin: -12px 0 -10px -6px; }

/* ---- loading overlay */
.loading-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(8,9,12,.78); backdrop-filter: blur(6px); animation: toast-in .2s ease-out; }
.loading-overlay .inner { display: grid; justify-items: center; gap: 12px; text-align: center; }
.loading-overlay .loading-msg { font-weight: 600; font-size: 16px; color: var(--text); min-height: 1.5em; }
.loading-overlay .tiny { color: var(--muted); }

/* ---- success banner */
.celebrate { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; border-radius: 16px; margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(139,123,255,.16), rgba(255,122,182,.10)); border: 1px solid var(--accent-ring); }
.celebrate h3 { font-size: 16px; }
.flash.success.with-dashi { align-items: center; padding: 6px 14px 6px 6px; }
.flash.with-dashi .dashi { flex: none; margin: -6px 0; }

/* ---- chips (radio / checkbox pills) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt { position: relative; cursor: pointer; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); font-weight: 550; transition: all .15s; user-select: none; }
.chip-opt span .ti { font-size: 17px; }
.chip-opt:hover span { border-color: #3d4356; color: var(--text); }
.chip-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #e2ddff; box-shadow: 0 0 0 3px var(--accent-soft); }
.chip-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.input-lg { font-size: 18px; padding: 14px 16px; }

/* ---- onboarding */
body.onboard { background: radial-gradient(1200px 600px at 20% -10%, rgba(139,123,255,.18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(255,122,182,.10), transparent 60%), var(--bg); min-height: 100vh; }
.ob-top { display: flex; align-items: center; gap: 18px; padding: 18px 28px; max-width: 1120px; margin: 0 auto; }
.ob-top .brand { padding: 0; }
.ob-progress { flex: 1; height: 6px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.ob-progress span { display: block; height: 100%; background: var(--grad); border-radius: 999px; transition: width .45s cubic-bezier(.3,.7,.3,1); }
.ob-shell { max-width: 1120px; margin: 0 auto; padding: 12px 28px 60px; }
html.js .ob-step:not(.active) { display: none; }
.ob-step { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 24px; }
html.js .ob-step.active { animation: ob-in .42s cubic-bezier(.2,.8,.3,1) both; }
html.js .ob-step.active.from-left { animation-name: ob-in-left; }
.ob-step.shake .ob-panel { animation: ob-shake .35s; }
@keyframes ob-in { from { opacity: 0; transform: translateX(28px); } }
@keyframes ob-in-left { from { opacity: 0; transform: translateX(-28px); } }
@keyframes ob-shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.ob-guide { position: sticky; top: 24px; display: grid; justify-items: center; gap: 4px; }
.ob-dashi { filter: drop-shadow(0 20px 40px rgba(139,123,255,.18)); }
.ob-bubble { position: relative; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 18px; padding: 14px 18px; font-weight: 500; font-size: 15px; line-height: 1.5; }
.ob-bubble::before { content: ''; position: absolute; left: 50%; top: -8px; width: 14px; height: 14px; margin-left: -7px; background: var(--surface-2); border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2); transform: rotate(45deg); }
.ob-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.ob-panel h1 { font-size: 30px; letter-spacing: -.03em; }
.ob-count { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #bdb3ff; margin-bottom: 8px; }
.ob-nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
/* Skip button: fixed top-right, outside the card */
.ob-skip-fixed { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 16px); right: calc(env(safe-area-inset-right, 0px) + 18px); z-index: 10; }
.ob-skip-btn { background: none; border: 0; padding: 8px 12px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.ob-skip-btn:hover, .ob-skip-btn:focus-visible { color: var(--text); background: rgba(255,255,255,.06); }
.ob-panel .error { margin-top: 8px; font-size: 13px; color: var(--bad); }
.ob-panel .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice .box .ti { color: #c3b9ff; }
.choice.sales .box .ti { color: #ffd98a; }
.ob-summary { display: grid; grid-template-columns: 140px 1fr; gap: 0; margin: 0; }
.ob-summary dt, .ob-summary dd { padding: 11px 0; border-bottom: 1px solid var(--border); margin: 0; }
.ob-summary dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.ob-summary dd .link { background: none; border: 0; cursor: pointer; font: inherit; font-size: 12.5px; margin-left: 6px; }
@media (max-width: 860px) {
  .ob-step { grid-template-columns: 1fr; gap: 12px; padding-top: 4px; }
  .ob-guide { position: static; grid-template-columns: 84px 1fr; align-items: center; justify-items: start; gap: 10px; }
  .ob-dashi .dashi { width: 84px; height: 84px; }
  .ob-bubble { font-size: 14px; padding: 10px 14px; }
  .ob-bubble::before { left: -8px; top: 50%; margin: -7px 0 0; border-top: 0; border-bottom: 1px solid var(--border-2); }
  .ob-panel { padding: 22px 18px; border-radius: 16px; }
  .ob-panel h1 { font-size: 24px; }
  .ob-panel .choices { grid-template-columns: 1fr; }
  .ob-top { padding: 14px 16px; gap: 12px; }
  .ob-shell { padding: 8px 16px 40px; }
  .ob-summary { grid-template-columns: 110px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .dashi *, .dashi-body { animation: none !important; }
}

/* ---- bio builder */
.bio-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.bio-preview-col { position: sticky; top: 84px; display: grid; gap: 10px; }
.pv-meta { text-align: center; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.phone { position: relative; border-radius: 34px; border: 8px solid #1f2230; background: #000; color: #fff; overflow: hidden; min-height: 520px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.8), 0 0 0 1px #2c3040; font-family: -apple-system, 'Inter', system-ui, sans-serif; }
.phone.flash-in .pv-bio { animation: pv-flash .6s ease; }
@keyframes pv-flash { from { background: rgba(139,123,255,.35); } }
.phone-notch { width: 90px; height: 20px; background: #1f2230; border-radius: 0 0 14px 14px; margin: 0 auto 12px; }
.pv-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: #1c202b; border: 2px solid #2c3040; flex: none; }
.pv-avatar.lg { width: 72px; height: 72px; }
.pv-name { font-weight: 700; font-size: 15px; }
.pv-handle { color: #a8a8a8; font-size: 12.5px; }
.pv-bio { white-space: pre-wrap; font-size: 13px; line-height: 1.4; margin-top: 8px; border-radius: 6px; word-break: break-word; }
.pv-link { color: #e0f1ff; font-size: 13px; font-weight: 600; margin-top: 6px; display: flex; gap: 4px; align-items: center; }
.pv-stats { display: flex; gap: 14px; }
.pv-stats div { text-align: center; } .pv-stats b { display: block; font-size: 15px; } .pv-stats span { font-size: 11px; color: #a8a8a8; }
.pv-buttons { display: flex; gap: 6px; margin-top: 12px; }
.pv-btn { flex: 1; text-align: center; padding: 7px 0; border-radius: 8px; background: #262626; font-size: 12.5px; font-weight: 600; }
.pv-btn.primary { background: #0095f6; }
.pv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 14px; }
.pv-grid span { aspect-ratio: 3/4; background: linear-gradient(160deg, #1c202b, #11131a); }
.pv-body { padding: 0 14px; }
.pv-head { padding: 0 14px; display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
/* TikTok: centred */
.pv-tiktok .pv-head, .pv-tiktok .pv-body { text-align: center; justify-content: center; }
.pv-tiktok .pv-stats { justify-content: center; margin-top: 10px; }
.pv-tiktok .pv-btn.primary { background: #fe2c55; }
.pv-tiktok .pv-link { justify-content: center; }
.pv-tiktok .pv-grid span { aspect-ratio: 9/14; }
/* Instagram: avatar left + stats */
.pv-instagram .pv-stats { flex: 1; justify-content: space-around; }
/* Facebook & YouTube: banner + overlapping avatar */
.pv-banner { height: 92px; margin: -32px 0 0; background: linear-gradient(135deg, #3a2f7a, #7a2f5c 60%, #b0476d); }
.pv-facebook .pv-head, .pv-youtube .pv-head { margin-top: -38px; }
.pv-facebook .pv-avatar, .pv-youtube .pv-avatar { border: 4px solid #000; }
.pv-facebook .pv-btn.primary { background: #1877f2; }
.pv-youtube .pv-btn.primary { background: #fff; color: #000; border-radius: 999px; }
.pv-youtube .pv-bio { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #cfcfcf; }
.pv-youtube .pv-grid { grid-template-columns: 1fr 1fr; } .pv-youtube .pv-grid span { aspect-ratio: 16/10; }

.bio-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; word-break: break-word; }
.bio-text.small { font-size: 13px; padding: 8px 10px; }
.bio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.bio-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: grid; gap: 10px; align-content: start; }
.bio-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.bio-actions form { margin: 0; }
.bio-editor { font-size: 15px; line-height: 1.5; }
.over { color: var(--bad) !important; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist li { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.checklist li.ok .ti { color: var(--good); }
.checklist li.miss { color: var(--text-2); } .checklist li.miss .ti { color: var(--muted); }
.chip-static { font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); cursor: pointer; }
.chip-static:hover { border-color: var(--accent); background: var(--accent-soft); }
.ab-test { border: 1px solid var(--border); border-radius: 14px; padding: 14px; background: var(--bg-2); }
.ab-side { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--surface); display: grid; gap: 8px; align-content: start; }
.ab-side.win { border-color: rgba(60,207,145,.5); box-shadow: 0 0 0 3px var(--good-soft); }
@media (max-width: 1100px) {
  .bio-layout { grid-template-columns: 1fr; }
  .bio-preview-col { position: static; max-width: 340px; margin: 0 auto; width: 100%; }
}

/* ---- dashboard next steps */
.next-steps { margin-bottom: 20px; }
.next-head { margin-bottom: 10px; list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.next-head::-webkit-details-marker { display: none; }
.next-chevron { color: var(--muted); transition: transform .2s; }
.next-steps:not([open]) .next-chevron { transform: rotate(-90deg); }
.next-steps:not([open]) .next-head { margin-bottom: 0; }
.next-step { display: grid; grid-template-columns: 30px 1fr; gap: 4px 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, transform .15s; }
.next-step:hover { border-color: var(--accent-ring); transform: translateY(-2px); }
.next-step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: #cbc3ff; font-weight: 700; font-size: 13px; grid-row: span 2; }
.next-step .title { font-weight: 650; display: flex; gap: 6px; align-items: center; }
.next-step .title .ti { color: var(--muted); }
.next-step .go { grid-column: 2; font-size: 12.5px; font-weight: 600; color: #bdb3ff; margin-top: 6px; }
.banner .dashi { flex: none; margin: -8px 0; }
.dashi.center { margin: 0 auto 8px; }
.auth-dashi { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 18px; }
.auth-dashi .bubble { margin-bottom: 70px; max-width: 220px; }
.auth-dashi .bubble::before { left: -8px; top: auto; bottom: 18px; }
.hero-dashi { display: flex; justify-content: center; margin-bottom: 6px; filter: drop-shadow(0 20px 50px rgba(139,123,255,.25)); }
.landing-cta { display: grid; justify-items: center; gap: 14px; text-align: center; padding: 20px 24px 80px; }
.landing-cta h2 { font-size: 28px; letter-spacing: -.03em; }


.audience-read { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 10px; background: var(--bg-2); border: 1px dashed var(--border-2); color: var(--text); }
.audience-read .ti { color: #c3b9ff; }

/* Generated content can be in a right-to-left language (Arabic) inside the
   English UI: each paragraph takes its direction from its own text. */
.content :is(p, li, h1, h3, dd, .hook, .why, .title, .text, .tip, .what, .quote, .focus),
[data-gen], [data-gen] :is(h3, p), .ob-bubble { unicode-bidi: plaintext; }

/* ------------------------------------------------------ content strategy */
.purpose-views { --p: #8fa4ff; --p-soft: rgba(143,164,255,.12); --p-ring: rgba(143,164,255,.35); }
.purpose-engagement { --p: #ff8ccf; --p-soft: rgba(255,140,207,.12); --p-ring: rgba(255,140,207,.35); }
.purpose-sales { --p: #ffd166; --p-soft: rgba(255,209,102,.12); --p-ring: rgba(255,209,102,.38); }
.pill.purpose, .funnel-legend .pill { background: var(--p-soft); color: var(--p); border-color: var(--p-ring); font-weight: 650; }
.funnel-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.idea { border-top: 3px solid var(--p, var(--border)); }
.idea .step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--p); color: #10121a; flex: none; }
.idea .next-up { font-size: 13px; font-weight: 600; color: var(--p); }
.idea-plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 14px; }
.idea-plan .sequence { grid-column: 1 / -1; border: 1px solid var(--border-2); border-radius: 18px; padding: 16px; background: var(--bg-2); display: grid; gap: 14px; }
.sequence-head { display: flex; gap: 12px; align-items: flex-start; }
.sequence-head p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.sequence-head .pill { flex: none; }
.sequence-steps { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: stretch; }
.sequence-arrow { display: grid; place-items: center; color: var(--muted); font-size: 22px; }
@media (max-width: 860px) {
  .idea-plan { grid-template-columns: 1fr; }
  .sequence-steps { grid-template-columns: 1fr; }
  .sequence-arrow { transform: rotate(90deg); }
  .sequence-head { flex-direction: column; gap: 8px; }
}

/* ideas: collapsed by default, tap to expand */
.idea { padding: 0; }
.idea-toggle > summary { list-style: none; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 16px 18px; border-radius: inherit; }
.idea-toggle > summary::-webkit-details-marker { display: none; }
.idea-toggle > summary:hover h3 { color: #fff; }
.idea-summary { display: grid; gap: 8px; min-width: 0; }
.idea-summary h3 { margin: 0; font-size: 16px; line-height: 1.35; }
.idea-chevron { color: var(--muted); font-size: 20px; transition: transform .2s; flex: none; margin-top: 2px; }
.idea-toggle[open] .idea-chevron { transform: rotate(180deg); }
.idea-body { display: grid; gap: 12px; padding: 0 18px 16px; }
.idea .caption-text { font-size: 13.5px; color: var(--text-2); white-space: pre-line; }
.idea .copy-inline { padding: 4px 8px; min-height: 0; }
.idea .foot { border-top: 1px solid var(--border); padding-top: 12px; }
.idea-plan .sequence .sequence-steps { align-items: start; }

/* Dashi, alive: mood-driven pose + speech bubble next to the greeting */
.dashi-live { align-items: center; }
.dashi-mood { flex: none; }
.dashi-say {
  position: relative; display: inline-block; margin-top: 8px; padding: 9px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--border-2); font-size: 14px; font-weight: 550; line-height: 1.45;
  max-width: 560px; animation: dashi-say-in .5s cubic-bezier(.2,.9,.3,1.3) both .15s;
}
.dashi-say::before { content: ''; position: absolute; left: -7px; top: 14px; width: 12px; height: 12px; background: var(--surface-2); border-left: 1px solid var(--border-2); border-bottom: 1px solid var(--border-2); transform: rotate(45deg); }
.tone-celebrate + div .dashi-say, .is-celebrating .dashi-say { border-color: rgba(244,183,63,.5); background: linear-gradient(90deg, rgba(244,183,63,.14), rgba(200,107,255,.12)); }
.is-celebrating .dashi-mood { animation: dashi-party 1s ease-in-out 3; }
@keyframes dashi-say-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dashi-party { 0%,100% { transform: rotate(0) translateY(0); } 25% { transform: rotate(-8deg) translateY(-10px); } 75% { transform: rotate(8deg) translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .dashi-say, .is-celebrating .dashi-mood { animation: none; } }
@media (max-width: 520px) { .dashi-live .dashi-mood svg { width: 76px; height: 76px; } .dashi-say { font-size: 13px; } }
.revenue-card { margin-bottom: 18px; }
.revenue-headline { font-size: 17px; font-weight: 600; margin: 0; }
.revenue-stat .stat-value { color: #ffd98a; }
.idea-input-row { display: flex; gap: 10px; align-items: stretch; }
.idea-input-row .input { flex: 1; min-width: 0; }
.idea-filters { gap: 10px; flex-wrap: wrap; }
.idea-filters select.input { width: auto; }
.seg .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); font-size: 11.5px; margin-left: 4px; }
@media (max-width: 520px) { .idea-input-row { flex-direction: column; } }

/* Dashboard hero: just Dashi, big and centred, greeting underneath */
.dash-hero { display: grid; justify-items: center; text-align: center; gap: 6px; margin: 4px 0 22px; }
.dash-hero .dashi-mood svg { width: 200px; height: 200px; }
.dash-hero h1 { margin-top: 2px; }
.dash-hero.is-celebrating .dashi-mood { animation: dashi-party 1s ease-in-out 3; }
@media (max-width: 520px) { .dash-hero .dashi-mood svg { width: 150px; height: 150px; } }

/* Filmed, ready to post */
.ready-to-post { margin-bottom: 18px; }
.ready-list { display: grid; gap: 8px; }
.ready-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border-left: 3px solid var(--p, var(--border-2)); }
.ready-main { min-width: 0; }
.ready-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ready-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.ready-row.is-busy { opacity: .6; pointer-events: none; }
.btn-posted { background: #5b4fd1; border-color: transparent; color: #f3f1ff; }
.btn-posted:hover { background: #6a5ee0; border-color: transparent; color: #fff; }
.idea-search { margin-left: auto; min-width: 200px; max-width: 320px; flex: 1; }
@media (max-width: 520px) { .ready-row { flex-wrap: wrap; } .ready-actions { width: 100%; justify-content: flex-end; } .idea-search { max-width: none; } }

/* Fast in-app navigation: the new page swaps straight in (no loading bar) */
.main { will-change: transform; }
.main.fade-in .content { animation: page-in .22s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: .12s ease-out both vt-out; }
::view-transition-new(root) { animation: .2s ease-out both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 860px) {
  .sidebar { transition: transform .28s cubic-bezier(.2,.8,.2,1); touch-action: pan-y; }
  body.nav-open .scrim { animation: scrim-in .2s ease both; }
}
@keyframes scrim-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .main.fade-in .content { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* Idea blueprint */
.lifecycle { border-top: 1px solid var(--border); padding-top: 14px; }
.checkpoints b { font-size: 16px; }
.sleeper-badge { position: absolute; left: 8px; bottom: 34px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(60,207,145,.9); color: #0b0c10; }
.learned-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.learned-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
.learned-list li .ti { color: var(--accent); font-size: 18px; flex: none; margin-top: 1px; }
.learned-list li.hot { background: rgba(60,207,145,.1); border: 1px solid rgba(60,207,145,.3); }
.learned-list li.hot .ti { color: var(--good); }
.learned-list li.low .ti { color: var(--muted); }
.taking-off { margin-bottom: 18px; border-color: rgba(60,207,145,.35); }
.taking-off .ready-row { border-left-color: var(--good); margin-top: 6px; }
.learned-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.learned-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
.learned-list li .ti { color: var(--accent); font-size: 18px; flex: none; margin-top: 1px; }
.learned-list li.hot { background: rgba(60,207,145,.1); border: 1px solid rgba(60,207,145,.3); }
.learned-list li.hot .ti { color: var(--good); }
.learned-list li.low .ti { color: var(--muted); }
.taking-off { margin-bottom: 18px; border-color: rgba(60,207,145,.35); }
.taking-off .ready-row { border-left-color: var(--good); margin-top: 6px; }

/* ---- focus: rings only for keyboard users, never on headings the app focuses for screen readers */
*:focus:not(:focus-visible) { outline: none; }
[tabindex="-1"]:focus { outline: none; }

/* ---- ideas: Dashi writing in the background */
.ideas-writing { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ideas-writing .dashi { flex: none; margin: -8px 0; }
.ideas-writing h3 { font-size: 16px; margin-bottom: 2px; }
.ideas-writing [data-writing-msg] { animation: loading-msg-in .4s ease-out; }

/* ---- ideas: keep doing / stop doing */
.keep-stop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.keep-stop .card { margin: 0; border-left: 3px solid; }
.keep-stop .keep { border-left-color: var(--good); background: linear-gradient(90deg, var(--good-soft), transparent 60%), var(--surface); }
.keep-stop .stop { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-soft), transparent 60%), var(--surface); }
.keep-stop .keep h2 i { color: var(--good); }
.keep-stop .stop h2 i { color: var(--bad); }
.keep-stop li { overflow-wrap: anywhere; }
@media (max-width: 720px) { .keep-stop { grid-template-columns: 1fr; } }
.idea-input { margin-top: 0; margin-bottom: 16px; }

/* ---- ideas filter dropdown */
.idea-filter-drop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; padding: 10px; min-width: 260px; box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.dot-badge { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }

/* ---- ideas add modal */
.idea-add-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; }
.idea-add-modal-backdrop { position: absolute; inset: 0; background: rgba(8,9,12,.65); backdrop-filter: blur(4px); }
.idea-add-modal-body { position: relative; width: 90%; max-width: 480px; padding: 20px; }

/* ---- never wider than the screen (whole app) ----
   Root cause of past overflow: grid/flex children default to min-width:auto, so one long
   word, URL or nowrap pill forces a column wider than the phone. Let everything shrink and
   wrap instead, then clip as a last resort (clip, not hidden, so sticky headers still stick). */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
.shell, .main, .content { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
.content :where(*) { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.content :where(img, video, canvas, iframe, table, pre) { max-width: 100%; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.table-wrap table { max-width: none; }
@media (max-width: 480px) {
  .pill { white-space: normal; height: auto; min-height: 24px; text-align: left; }
  .dashi-hero { grid-template-columns: 1fr; justify-items: start; }
}

/* ---- idea brief: written like a person's notes, not a report (no boxes, no icon headers) */
.idea-body.brief { gap: 12px; font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.brief p { margin: 0; }
.brief b { color: var(--text); font-weight: 600; }
.brief .brief-lead { color: var(--text); font-size: 15px; }
.brief .brief-quote { color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; }
.brief .brief-steps { margin: 2px 0; padding-left: 22px; display: grid; gap: 6px; color: var(--text-2); }
.brief .brief-steps li::marker { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.brief .brief-soft { font-size: 14px; }
.brief .brief-note { font-size: 13px; color: var(--muted); display: block; }
.brief .brief-caption { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.brief .brief-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.brief .caption-text { color: var(--text); white-space: pre-line; }
.brief .copy-inline { padding: 4px 8px; min-height: 0; flex: none; }

/* Idea card actions: quiet text links at the bottom (Linear/Notion style), never the focal point */
.idea .foot { justify-content: flex-end; gap: 2px; border-top: 0; padding-top: 2px; }
.idea .foot .btn { flex: none; padding: 4px 8px; min-height: 0; font-size: 12.5px; font-weight: 500; border-radius: 6px; background: transparent; border-color: transparent; box-shadow: none; gap: 4px; }
.idea .foot .btn .ti { font-size: 14px; }
.idea .foot .btn-filmed, .idea .foot .btn-posted { color: var(--text-2); }
.idea .foot .btn-filmed .ti { color: var(--good); }
.idea .foot .btn-posted .ti { color: var(--accent); }
.idea .foot .btn-cancel { color: var(--muted); }
.idea .foot .btn:hover { background: var(--surface-2); color: var(--text); }

/* Idea brief sections: plain bold headings, nothing else */
.idea-body.brief { gap: 16px; }
.brief section { display: grid; gap: 4px; }
.brief h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.005em; }

/* ---- public mode: income hidden (screen recordings). Figures show as *** */
.privacy-toggle .ti-eye-off { display: none; }
.public-mode .privacy-toggle { color: var(--accent); background: var(--accent-soft); }
.public-mode .privacy-toggle .ti-eye { display: none; }
.public-mode .privacy-toggle .ti-eye-off { display: inline-block; }
.public-mode [data-private]:not(.masked) { color: transparent !important; }
.public-mode [data-private].masked { letter-spacing: .08em; }
.public-mode [data-private-block] { filter: blur(9px); user-select: none; pointer-events: none; }

/* ---- "why cancel?" one-tap sheet on idea cards */
.why-sheet { display: grid; gap: 6px; margin-top: 4px; padding: 10px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface-2); animation: loading-msg-in .18s ease-out; }
.why-sheet .why-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 2px 2px; }
.why-sheet .why-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; font-size: 15px; line-height: 1; }
.why-sheet [data-why] { text-align: left; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; cursor: pointer; }
.why-sheet [data-why]:hover { border-color: var(--border-2); background: var(--surface-3); }
.why-sheet [data-why="bad"] { color: #ffb0b0; }

/* ---- onboarding: starting-point screenshots */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.shot-card { display: grid; gap: 6px; }
.shot-card[hidden] { display: none; }
.shot-head { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.shot-drop { position: relative; display: grid; place-items: center; height: 160px; border: 1px dashed var(--border-2); border-radius: 12px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.shot-drop:hover { border-color: var(--accent-ring); }
.shot-drop img { width: 100%; height: 100%; object-fit: cover; }
.shot-empty { display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.shot-empty .ti { font-size: 26px; }
.shot-drop:focus-within { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

.admin-shots { display: grid; gap: 16px; }
.admin-shots-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.admin-shot { display: grid; gap: 4px; width: 120px; color: var(--text-2); }
.admin-shot img { width: 120px; height: 170px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); }

.pay-currency { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-currency .input { width: auto; min-width: 220px; }


/* ---- ideas: divider between Dashi's five and their own */
.ideas-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 4px; color: var(--muted); font-size: 13px; font-weight: 600; }
.ideas-divider::before, .ideas-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-2); }
.ideas-divider span { display: inline-flex; align-items: center; gap: 6px; }
.idea-planning { padding: 16px 18px; }
.idea-planning-body { display: flex; gap: 12px; align-items: center; }
.idea-planning-body h3 { margin: 0 0 2px; font-size: 15px; }

.loading-overlay { cursor: pointer; }
.loading-overlay .loading-x { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text-2); font-size: 18px; display: grid; place-items: center; cursor: pointer; }

/* Icons never get squeezed inside flex rows (the global min-width:0 would let them shrink off-centre). */
.content :where(i.ti) { flex-shrink: 0; }
/* The banner's leading icon (e.g. the trophy on "Your winning combination"): centred in its circle. */
.banner > .ti:first-child { flex: none; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); line-height: 1; }
.banner > .ti:first-child::before { display: block; line-height: 1; }

.deep-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.deep-item { display: grid; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.deep-item h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.deep-item p { margin: 0; }
@media (max-width: 720px) { .deep-list { grid-template-columns: 1fr; } }

/* ---- monetise: offers stack full width (a price column used to squeeze the text to one word per line) */
.offer { display: grid; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.offer:last-child { border-bottom: 0; }
.offer-name { font-weight: 600; line-height: 1.35; }
.offer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.offer-tags .pill { white-space: normal; height: auto; max-width: 100%; }
.offer p { margin: 0; }

/* Admin: AI spend per day */
.ai-days { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 6px 0; border-bottom: 1px solid var(--line, rgba(128,128,128,.25)); }
.ai-day { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.ai-day span { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--accent, #6c8cff); }
.ai-days-legend { display: flex; justify-content: space-between; margin-top: 4px; }
.ai-over { color: var(--bad); }

/* Settings: theme picker */
.theme-pick { display: flex; flex-wrap: wrap; gap: 8px; }

/* First-run walkthrough */
.tour { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 9, .72); backdrop-filter: blur(8px); animation: toast-in .25s ease-out; }
[data-theme="light"] .tour { background: rgba(18, 20, 27, .45); }
.tour-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); overflow: hidden; }
.tour-skip { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); right: calc(env(safe-area-inset-right, 0px) + 16px); z-index: 3; }
.tour-skip-btn { background: none; border: 0; padding: 8px 10px; font: inherit; font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, .62); cursor: pointer; border-radius: 8px; }
.tour-skip-btn:hover, .tour-skip-btn:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); }
.tour-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.tour-track::-webkit-scrollbar { display: none; }
.tour-slide { flex: 0 0 100%; scroll-snap-align: center; padding: 28px 26px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; }
.tour-slide h2 { font-size: 22px; }
.tour-slide p { max-width: 400px; }
.tour-art { position: relative; width: 100%; height: 200px; display: grid; place-items: center; border-radius: 16px; background: radial-gradient(400px 200px at 50% 0%, var(--accent-soft), transparent 70%), var(--surface-2); overflow: hidden; }
.tour-dashi { position: relative; z-index: 1; }
.tour-art-ideas .tour-dashi, .tour-art-trends .tour-dashi, .tour-art-numbers .tour-dashi, .tour-art-money .tour-dashi { position: absolute; right: 8px; bottom: -4px; }
.ta-card { position: absolute; left: 16px; width: 64%; text-align: left; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow); display: grid; gap: 2px; opacity: 0; animation: ta-in .5s ease-out forwards; }
.ta-card b { font-size: 13px; } .ta-card span { font-size: 11.5px; color: var(--muted); }
.ta-card:nth-child(1) { top: 18px; animation-delay: .15s; } .ta-card:nth-child(2) { top: 76px; animation-delay: .35s; } .ta-card:nth-child(3) { top: 134px; animation-delay: .55s; }
.ta-chip { position: absolute; left: 18px; display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--accent-ring); opacity: 0; animation: ta-in .5s ease-out forwards; }
.ta-chip:nth-child(1) { top: 26px; animation-delay: .15s; } .ta-chip:nth-child(2) { top: 82px; animation-delay: .35s; } .ta-chip:nth-child(3) { top: 138px; animation-delay: .55s; }
.ta-bars { position: absolute; left: 22px; bottom: 22px; width: 58%; height: 130px; display: flex; align-items: flex-end; gap: 8px; }
.ta-bars i { flex: 1; height: var(--h); border-radius: 6px 6px 2px 2px; background: var(--grad); transform-origin: bottom; transform: scaleY(0); animation: ta-grow .7s cubic-bezier(.2,.8,.2,1) forwards; }
.ta-bars i:nth-child(2) { animation-delay: .08s; } .ta-bars i:nth-child(3) { animation-delay: .16s; } .ta-bars i:nth-child(4) { animation-delay: .24s; } .ta-bars i:nth-child(5) { animation-delay: .32s; } .ta-bars i:nth-child(6) { animation-delay: .4s; }
.ta-badge { position: absolute; left: 22px; top: 16px; display: inline-flex; gap: 6px; align-items: center; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--good); background: var(--good-soft); opacity: 0; animation: ta-in .5s .6s ease-out forwards; }
.ta-money { position: absolute; left: 22px; top: 40px; display: grid; text-align: left; gap: 2px; opacity: 0; animation: ta-in .5s .15s ease-out forwards; }
.ta-money span { font-size: 12px; color: var(--muted); } .ta-money b { font-size: 34px; letter-spacing: -.03em; } .ta-money em { font-style: normal; color: var(--good); font-weight: 700; }
@keyframes ta-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ta-grow { to { transform: scaleY(1); } }
.tour-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px 18px; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 999px; background: var(--border-2); transition: width .2s, background .2s; }
.tour-dots span.on { width: 20px; background: var(--accent); }
.tour [data-tour-prev][disabled] { visibility: hidden; }
@media (max-width: 480px) { .tour-slide { padding: 24px 18px 6px; } .tour-art { height: 180px; } .ta-card { width: 72%; } }
@media (prefers-reduced-motion: reduce) { .ta-card, .ta-chip, .ta-badge, .ta-money { animation: none; opacity: 1; } .ta-bars i { animation: none; transform: none; } }

/* Insights: your numbers */
.num-tile { min-width: 0; }
.num-tile .stat-value small { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.num-tile .stat-sub { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.good-text { color: var(--good); }
.period-table td.n, .period-table th.n { white-space: nowrap; }
.best-time { font-size: 18px; letter-spacing: -.01em; margin-bottom: 4px; }
.len-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.len-list li { display: grid; grid-template-columns: 80px 1fr 44px auto; gap: 10px; align-items: center; font-size: 13px; }
.mb-s { margin-bottom: 6px; }
@media (max-width: 560px) { .len-list li { grid-template-columns: 70px 1fr 40px; } .len-list li .tiny { display: none; } }

/* An idea that rides a trend */
.trend-pill { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-color: var(--accent-ring); color: var(--text); }

/* Monetise: opportunities, potential, CTAs */
.opps { margin-bottom: 18px; }
.opp-list { display: grid; gap: 10px; }
.opp { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.opp h3 { font-size: 15px; margin-bottom: 2px; }
.opp-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; background: var(--sales-soft); color: var(--sales); }
.opp-warn .opp-ico { background: var(--bad-soft); color: var(--bad); }
.opp-good .opp-ico { background: var(--good-soft); color: var(--good); }
.opp-info .opp-ico { background: var(--accent-soft); color: var(--accent); }
.opp-body { min-width: 0; display: grid; gap: 4px; }
.price-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.price-list li { display: flex; justify-content: space-between; gap: 10px; }
.cta-rows { display: grid; gap: 8px; margin-top: 8px; }
.cta-row { display: grid; grid-template-columns: 1fr minmax(0, 240px); gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.cta-cap { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.input-sm { padding: 7px 10px; }
@media (max-width: 560px) { .cta-row { grid-template-columns: 1fr; gap: 6px; } }
.opp-dash { margin-bottom: 18px; align-items: center; }
.period-table td:first-child { min-width: 108px; }
@media (max-width: 560px) {
  .period-table { font-size: 12.5px; }
  .period-table th, .period-table td { padding-left: 8px; padding-right: 8px; }
  .period-table td:first-child .tiny { display: none; }
  .num-tiles { grid-template-columns: 1fr 1fr; gap: 14px; }
  .num-tile .stat-value { font-size: 22px; }

  /* Monetise: prevent text stacking in stat grid and offer cards */
  .revenue-card .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .revenue-card .stat-value { font-size: 17px !important; }
  .potential-grid { grid-template-columns: 1fr !important; }
  .offer-name { font-size: 15px; }
  .offer-tags { gap: 4px; }
  .offer-tags .pill { font-size: 10.5px; padding: 2px 7px; }
  .price-list li { flex-wrap: wrap; gap: 4px; }
  .fit { grid-template-columns: 28px 1fr 48px; gap: 8px; }
  .fit .ico { width: 28px; height: 28px; font-size: 14px; }

  /* Charts: axis labels are HTML outside the SVG, so they keep their size; thin the dates */
  .viz-ticks-dates span:nth-last-child(2n) { display: none; }

  /* Text never squeezes to one word per line: side notes wrap under headings,
     flex/grid text columns may shrink, and long words break instead of overflowing. */
  .card-head { flex-wrap: wrap; row-gap: 4px; }
  .card-head h2 { flex: 1 1 220px; min-width: 0; }
  .card-head > .tiny, .card-head > .muted { flex: 0 1 auto; }
  .row > div, .banner > div, .fit > div, .opp-body, .grid > * { min-width: 0; }
  .row[style*="nowrap"] > :first-child { flex: none; }
  .row[style*="nowrap"] > div:last-child { flex: 1 1 auto; }
  .main p, .main li, .main h2, .main h3, .main td { overflow-wrap: break-word; }
  .table td:first-child { min-width: 110px; }
  .legend { font-size: 10.5px; gap: 8px; }
}

/* ==========================================================================
   Phones: bottom tab bar + "More" sheet (the sidebar stays on desktop)
   ========================================================================== */
.tabbar, .more-sheet, .sheet-scrim { display: none; }
@media (max-width: 860px) {
  .topbar .menu-btn { display: none !important; }
  .content { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px); }
  .toast-host { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); right: 16px; left: 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 6px 4px calc(env(safe-area-inset-bottom, 0px) + 6px);
    background: var(--tabbar-bg); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-top: 1px solid var(--border);
    transition: transform .25s cubic-bezier(.2,.8,.2,1);
  }
  body.tabbar-hidden .tabbar { transform: translateY(calc(100% + 2px)); }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 50px; padding: 0; border: 0; background: none; font: inherit; color: var(--muted);
    -webkit-tap-highlight-color: transparent; cursor: pointer;
  }
  .tab-ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; font-size: 22px; transition: background .15s, color .15s; }
  .tab-label { font-size: 10.5px; font-weight: 600; letter-spacing: .01em; }
  .tab.active { color: var(--text); }
  .tab.active .tab-ico { background: var(--accent-soft); color: var(--accent); }
  .tab:active .tab-ico { transform: scale(.92); }

  .sheet-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
  body.more-open .sheet-scrim { display: block; animation: scrim-in .2s ease both; }
  .more-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain;
    padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
    background: var(--surface); border-top: 1px solid var(--border-2); border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .6);
    transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  }
  .more-sheet[hidden] { display: none; }
  body.more-open .more-sheet { transform: none; }
  body.more-open { overflow: hidden; }
  .sheet-handle { width: 38px; height: 5px; border-radius: 999px; background: var(--border-2); margin: 2px auto 12px; }
  .more-user { display: flex; gap: 12px; align-items: center; padding: 4px 4px 14px; border-bottom: 1px solid var(--border); }
  .more-user .who { min-width: 0; } .more-user .who div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .more-list { display: grid; padding: 8px 0; }
  .more-list a { display: flex; align-items: center; gap: 14px; padding: 13px 6px; border-radius: 12px; font-size: 15.5px; font-weight: 550; }
  .more-list a > .ti:first-child { font-size: 21px; color: var(--text-2); width: 24px; text-align: center; }
  .more-list a.active { background: var(--accent-soft); }
  .more-list a.active > .ti:first-child { color: var(--accent); }
  .more-chev { margin-left: auto; color: var(--muted); }
  .more-out { border-top: 1px solid var(--border); padding-top: 10px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .tabbar, .more-sheet { transition: none; } }
