/* ===========================================================================
   SuperMush Ad Studio — clean / Linear-style design system
   Light surfaces · single indigo accent · thin borders · tight type
   (Class + variable names preserved from v1; values fully reworked.)
   =========================================================================== */

:root {
  /* surfaces */
  --paper:      #ffffff;   /* main content bg */
  --paper-2:    #f6f7f8;   /* subtle fills */
  --surface-2:  #fbfbfc;   /* sidebar */
  --card:       #ffffff;

  /* text */
  --ink:        #08090a;
  --ink-soft:   #5b5f66;
  --ink-faint:  #8a8f98;

  /* lines */
  --line:        rgba(8,9,10,0.09);
  --line-strong: rgba(8,9,10,0.15);

  /* accent + semantics (muted) */
  --accent:      #5e6ad2;
  --accent-2:    color-mix(in srgb, var(--accent) 52%, #ffffff);   /* light accent (on dark) */
  --accent-soft: color-mix(in srgb, var(--accent) 11%, #ffffff);
  --orange:      #5e6ad2;       /* legacy alias → accent */
  --gold:        #b07e1d;       /* amber */
  --gold-soft:   #faf2e0;
  --olive:       #3f9d6b;       /* green */
  --olive-soft:  #e9f6ef;
  --magenta:     #8257d6;       /* violet */
  --magenta-soft:#f0ebfb;
  --teal:        #2f72c4;       /* blue */
  --teal-soft:   #e8f0fb;
  --terra:       #c4554d;       /* red */
  --terra-soft:  #fbecea;

  /* type */
  --display: "Hanken Grotesk", system-ui, sans-serif;
  --sans:    "Hanken Grotesk", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  /* shape */
  --r-lg: 14px;
  --r-md: 11px;
  --r-sm: 8px;
  --bd: 1px;
  --shadow:    0 1px 2px rgba(8,9,10,0.05), 0 4px 14px rgba(8,9,10,0.05);
  --shadow-sm: 0 1px 2px rgba(8,9,10,0.05);
  --shadow-lg: 0 8px 30px rgba(8,9,10,0.10);

  --sidebar-w: 244px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
#root { min-height: 100vh; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--accent); }

.app-bg { min-height: 100vh; background: var(--paper); display: flex; }

/* ---- Sidebar ------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface-2);
  color: var(--ink);
  border-right: var(--bd) solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 18px 16px 16px; border-bottom: var(--bd) solid var(--line); }
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-spore { width: 30px; height: 30px; flex: 0 0 30px; }
.brand-name { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.brand-sub { font-size: 11px; letter-spacing: 0.2px; color: var(--ink-faint); margin-top: 1px; font-weight: 500; }

.nav { padding: 10px 10px; flex: 1; }
.nav-group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--ink-faint);
  margin: 16px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: transparent; border: none;
  color: var(--ink-soft);
  padding: 7px 9px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 500; text-align: left;
  transition: background 0.12s, color 0.12s; margin-bottom: 1px;
}
.nav-item:hover { background: rgba(8,9,10,0.04); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .nav-ico { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.85; }
.nav-item.active .nav-ico { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  color: var(--ink-faint); background: transparent; padding: 0;
}
.nav-item.active .nav-badge { color: var(--accent); }

.sidebar-foot {
  padding: 12px 14px; border-top: var(--bd) solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; flex: 0 0 30px;
}
.foot-name { font-size: 13px; font-weight: 600; }
.foot-role { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); }

/* ---- Main ---------------------------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(8px);
  border-bottom: var(--bd) solid var(--line);
  display: flex; align-items: center; gap: 14px;
  padding: 11px 26px;
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.crumbs .crumb-sep { opacity: 0.35; }
.crumbs .crumb-cur { font-weight: 600; }
.crumb-link { color: var(--ink-faint); }
.crumb-link:hover { color: var(--ink); }

.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: var(--paper-2); border: var(--bd) solid var(--line);
  border-radius: var(--r-sm); padding: 7px 12px; width: 280px;
  color: var(--ink-faint);
}
.search input {
  border: none; background: transparent; outline: none;
  font-family: var(--sans); font-size: 13px; color: var(--ink); width: 100%;
}
.search input::placeholder { color: var(--ink-faint); }

.content { padding: 28px 30px; max-width: 1280px; width: 100%; }

/* ---- Page header --------------------------------------------------------- */
.page-head { margin-bottom: 24px; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.1px;
  color: var(--accent); display: flex; align-items: center; gap: 7px;
}
.page-title {
  font-family: var(--display); font-weight: 700;
  font-size: 30px; line-height: 1.1; letter-spacing: -0.025em;
  margin: 9px 0 0;
}
.page-title.sm { font-size: 25px; }
.page-desc {
  font-size: 14.5px; color: var(--ink-soft); max-width: 700px;
  margin: 10px 0 0; line-height: 1.55;
}

/* ---- Generic card -------------------------------------------------------- */
.card {
  background: var(--card); border: var(--bd) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }

.section-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 8px; margin: 0 0 13px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Badges / chips ------------------------------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.1px;
  padding: 3px 9px; border-radius: 6px;
  border: var(--bd) solid var(--line); background: var(--paper-2); color: var(--ink-soft);
  white-space: nowrap;
}
.chip.gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.chip.orange { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip.olive { background: var(--olive-soft); color: var(--olive); border-color: transparent; }
.chip.magenta { background: var(--magenta-soft); color: var(--magenta); border-color: transparent; }
.chip.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.ghost { background: var(--paper-2); color: var(--ink-soft); }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }

.level-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 5px; border: none;
}
.level-high { background: var(--accent-soft); color: var(--accent); }
.level-mid { background: var(--gold-soft); color: var(--gold); }
.level-low { background: var(--paper-2); color: var(--ink-faint); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 600; font-size: 13.5px;
  padding: 8px 14px; border-radius: var(--r-sm);
  border: var(--bd) solid var(--line-strong); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(0.5px); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #515cc4; }
.btn.gold { background: var(--accent-soft); color: var(--accent); border-color: transparent; box-shadow: none; }
.btn.gold:hover { background: #e4e8fa; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--paper-2); color: var(--ink); }

/* ---- Stat tiles ---------------------------------------------------------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: var(--card); border: var(--bd) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 16px 17px; position: relative; overflow: hidden;
}
.stat .stat-ico { position: absolute; right: -6px; top: -6px; opacity: 0.05; }
.stat-num { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-top: 7px; }
.stat-delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.delta-up { color: var(--olive); }
.delta-down { color: var(--terra); }

/* ---- Sparkline ----------------------------------------------------------- */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.spark span { width: 4px; background: var(--accent); border-radius: 2px; opacity: 0.85; }

/* ---- Competitor cards ---------------------------------------------------- */
.comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.comp-card {
  background: var(--card); border: var(--bd) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  padding: 17px; transition: border-color 0.12s, box-shadow 0.12s, transform 0.08s;
  cursor: pointer; display: flex; flex-direction: column;
}
.comp-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.comp-top { display: flex; align-items: center; gap: 11px; }
.comp-logo {
  width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center;
  font-size: 17px; font-weight: 700; color: #fff; flex: 0 0 40px;
}
.comp-name { font-size: 15.5px; font-weight: 600; }
.comp-cat { font-size: 12px; color: var(--ink-faint); }
.comp-reason { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 12px 0; flex: 1; }
.comp-meta { display: flex; gap: 16px; padding-top: 12px; border-top: var(--bd) solid var(--line); }
.comp-meta .m-num { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.comp-meta .m-lab { font-size: 10.5px; color: var(--ink-faint); }
.match-ring { margin-left: auto; text-align: center; flex: 0 0 auto; }
.match-lab { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-faint); margin-top: 1px; }

/* ---- Hook cards ---------------------------------------------------------- */
.hook-card {
  background: var(--card); border: var(--bd) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden;
}
.hook-head { padding: 15px 17px; display: flex; align-items: flex-start; gap: 13px; border-bottom: var(--bd) solid var(--line); }
.hook-rank {
  font-family: var(--display); font-weight: 700; font-size: 16px;
  color: #fff; background: var(--ink); width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: 0 0 30px;
}
.hook-title { font-size: 15px; font-weight: 600; line-height: 1.25; }
.hook-quote { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink); padding: 15px 17px 4px; letter-spacing: -0.02em; }
.hook-body { padding: 0 17px 16px; }
.hook-lines { list-style: none; margin: 4px 0 13px; padding: 0; }
.hook-lines li {
  font-size: 12.5px; color: var(--ink-soft); padding: 7px 0 7px 16px; position: relative;
  border-bottom: var(--bd) solid var(--line); line-height: 1.45;
}
.hook-lines li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ai-note { background: var(--paper-2); border: var(--bd) solid var(--line); border-radius: var(--r-sm); padding: 12px 13px; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.ai-note .ai-tag { font-size: 10px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); font-weight: 700; display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.strength-bar { height: 6px; border-radius: 4px; background: rgba(8,9,10,0.08); overflow: hidden; }
.strength-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }

/* ---- Ad grid ------------------------------------------------------------- */
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ad-card {
  background: var(--card); border: var(--bd) solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden;
  cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.08s;
  display: flex; flex-direction: column;
}
.ad-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.ad-thumb { aspect-ratio: 1 / 1; position: relative; display: grid; place-items: center; border-bottom: var(--bd) solid var(--line); overflow: hidden; }
.ad-thumb .thumb-copy { font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1.25; text-align: center; padding: 18px; z-index: 2; letter-spacing: -0.01em; }
.ad-thumb .play-btn {
  position: absolute; z-index: 3; width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: var(--bd) solid var(--line);
  display: grid; place-items: center; bottom: 11px; left: 11px; box-shadow: var(--shadow-sm); color: var(--ink);
}
.ad-flags { position: absolute; top: 9px; left: 9px; z-index: 4; display: flex; gap: 5px; flex-wrap: wrap; }
.ad-days {
  position: absolute; top: 9px; right: 9px; z-index: 4;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  background: rgba(255,255,255,0.92); color: var(--ink); padding: 2px 7px; border-radius: 6px; border: var(--bd) solid var(--line);
}
.ad-foot { padding: 12px 13px; }
.ad-advertiser { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.ad-copy { font-size: 12px; color: var(--ink-soft); line-height: 1.45; margin-top: 7px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ad-cta { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); margin-top: 9px; }
.sponsor-ava { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex: 0 0 21px; }

/* ---- Angle / format rows ------------------------------------------------- */
.row-item { display: flex; gap: 13px; align-items: flex-start; padding: 14px 0; border-bottom: var(--bd) solid var(--line); }
.row-item:last-child { border-bottom: none; }
.row-title { font-weight: 600; font-size: 14px; }
.row-desc { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin-top: 4px; }
.share-track { width: 60px; flex: 0 0 60px; text-align: right; }
.share-bar { height: 6px; background: rgba(8,9,10,0.08); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.share-bar > span { display: block; height: 100%; background: var(--teal); }

/* ---- Best / feature card (dark accent panel) ----------------------------- */
.best-card {
  background: var(--ink); color: #fff;
  border: var(--bd) solid var(--ink);
  border-radius: var(--r-md); padding: 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.best-quote { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; color: #fff; margin: 13px 0 11px; letter-spacing: -0.02em; }
.best-why { font-size: 13px; line-height: 1.55; color: rgba(255,255,255,0.66); }
.best-card .section-label { color: rgba(255,255,255,0.5); }
.best-card .section-label::after { background: rgba(255,255,255,0.16); }

/* ---- Script cards -------------------------------------------------------- */
.script-card { background: var(--card); border: var(--bd) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; transition: border-color 0.12s; }
.script-card:hover { border-color: var(--line-strong); }
.script-head { display: flex; gap: 14px; align-items: center; padding: 14px 16px; cursor: pointer; }
.script-thumb { width: 54px; height: 54px; border-radius: 9px; flex: 0 0 54px; display: grid; place-items: center; position: relative; overflow: hidden; }
.script-thumb .gen-tag { position: absolute; bottom: 0; left: 0; right: 0; font-family: var(--mono); font-size: 7px; letter-spacing: 0.3px; background: rgba(8,9,10,0.55); color: #fff; text-align: center; padding: 2px 0; text-transform: uppercase; }
.script-name { font-family: var(--mono); font-weight: 600; font-size: 14px; }
.script-hook { font-size: 13px; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.script-body-wrap { border-top: var(--bd) solid var(--line); padding: 18px; display: none; }
.script-card.open .script-body-wrap { display: block; }
.beat { display: grid; grid-template-columns: 74px 1fr; gap: 14px; margin-bottom: 14px; }
.beat-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); font-weight: 700; padding-top: 2px; }
.beat-text { font-size: 13.5px; line-height: 1.55; }
.beat-text.script-quote { font-family: var(--display); font-weight: 600; color: var(--ink); font-size: 15px; line-height: 1.35; letter-spacing: -0.01em; }
.beat-dir { font-size: 12px; color: var(--ink-faint); font-style: italic; margin-top: 4px; }
.overlay-note { font-family: var(--mono); font-size: 11px; background: var(--paper-2); border: var(--bd) solid var(--line); border-radius: 6px; padding: 4px 8px; display: inline-block; margin-top: 6px; color: var(--ink-soft); }

/* ---- Creative detail ----------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 330px 1fr; gap: 26px; align-items: start; }
.detail-creative { border: var(--bd) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); overflow: hidden; position: sticky; top: 84px; }
.detail-creative .dc-media { aspect-ratio: 4 / 5; position: relative; display: grid; place-items: center; border-bottom: var(--bd) solid var(--line); }
.detail-creative .dc-copy { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; text-align: center; padding: 22px; letter-spacing: -0.01em; }
.detail-creative .dc-foot { padding: 14px 15px; background: var(--card); }
.analysis-block { margin-bottom: 22px; }

/* ---- Mushroom legend ----------------------------------------------------- */
.mush-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mush-pill { display: flex; align-items: center; gap: 7px; border: var(--bd) solid var(--line); border-radius: 20px; padding: 5px 11px 5px 6px; background: var(--card); font-size: 12.5px; font-weight: 500; }
.mush-cap { width: 18px; height: 18px; border-radius: 50%; flex: 0 0 18px; }
.mush-ben { font-family: var(--mono); font-size: 9.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.3px; }

/* ---- Feed ---------------------------------------------------------------- */
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: var(--bd) solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-ico { width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px; display: grid; place-items: center; color: #fff; }
.feed-text { font-size: 13px; line-height: 1.45; }
.feed-time { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); margin-top: 3px; }

/* ---- Layout helpers ------------------------------------------------------ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.col-main-side { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; }
.spacer-lg { height: 30px; }
.spacer-md { height: 22px; }
.spacer-sm { height: 12px; }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }
.wrap { flex-wrap: wrap; }

/* ---- Tabs ---------------------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: var(--bd) solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tab { background: transparent; border: none; padding: 9px 13px; font-weight: 500; font-size: 13.5px; color: var(--ink-faint); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* ---- Filter pills -------------------------------------------------------- */
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.filter { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 7px; border: var(--bd) solid var(--line); background: var(--card); color: var(--ink-soft); }
.filter:hover { background: var(--paper-2); }
.filter.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.var-note { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }

/* responsive */
@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .comp-grid, .grid-3 { grid-template-columns: repeat(2,1fr); }
  .col-main-side, .detail-grid { grid-template-columns: 1fr; }
  .detail-creative { position: static; }
}

/* ===========================================================================
   Wizard flow
   =========================================================================== */
.wiz { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.wiz-head {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px; border-bottom: var(--bd) solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.82); backdrop-filter: blur(8px);
}
.wiz-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.wiz-prog { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.wiz-prog-label { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.3px; }
.wiz-segs { display: flex; gap: 5px; }
.wiz-seg { height: 4px; width: 30px; border-radius: 3px; background: var(--line-strong); transition: background 0.25s; cursor: pointer; }
.wiz-seg.on { background: var(--accent); }

.wiz-stage { flex: 1; display: flex; justify-content: center; padding: 54px 24px 130px; }
.wiz-col { width: 100%; max-width: 660px; }
.wiz-anim { animation: wizUp 0.4s cubic-bezier(0.16,1,0.3,1); }
@keyframes wizUp { from { transform: translateY(9px); } to { transform: none; } }

.wiz-title { font-family: var(--display); font-weight: 700; font-size: 34px; letter-spacing: -0.03em; line-height: 1.08; margin: 11px 0 0; }
.wiz-sub { font-size: 16px; color: var(--ink-soft); line-height: 1.55; margin: 14px 0 0; max-width: 580px; }
.wiz-body { margin-top: 30px; }

.wiz-foot { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; border-top: var(--bd) solid var(--line); background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); }
.wiz-foot-inner { max-width: 708px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 15px 24px; }
.wiz-foot .grow { flex: 1; }

/* target options */
.opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: var(--bd) solid var(--line); border-radius: var(--r-md); background: var(--card); cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; margin-bottom: 10px; }
.opt:hover { border-color: var(--line-strong); }
.opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.opt.locked { opacity: 0.6; cursor: default; }
.opt.locked:hover { border-color: var(--line); }
.opt-check { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: 0 0 22px; color: #fff; }
.opt.sel .opt-check { background: var(--accent); border-color: var(--accent); }

/* proof ads */
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proof { border: var(--bd) solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--card); }
.proof .ad-thumb { aspect-ratio: 4/5; }
.proof .ad-thumb .thumb-copy { font-size: 13px; padding: 12px; }
.proof-cap { padding: 9px 11px; display: flex; align-items: center; justify-content: space-between; }
.proof-cap .pc-adv { font-size: 11.5px; font-weight: 600; }
.proof-cap .pc-days { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }

/* why rows */
.why-row { padding: 20px 0; border-bottom: var(--bd) solid var(--line); }
.why-row:last-child { border-bottom: none; }
.why-hook { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; line-height: 1.3; }
.why-text { font-size: 14.5px; color: var(--ink-soft); margin-top: 9px; line-height: 1.55; }
.why-meta { display: flex; align-items: center; gap: 8px; margin-top: 11px; }

/* gap */
.gap-primary { border: var(--bd) solid transparent; background: var(--accent-soft); border-radius: var(--r-md); padding: 20px; }
.gap-primary .gp-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); }
.gap-primary .gp-text { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; line-height: 1.3; margin-top: 9px; }
.gap-mini { display: flex; gap: 12px; padding: 14px 2px; border-bottom: var(--bd) solid var(--line); }
.gap-mini:last-child { border-bottom: none; }
.gap-mini .gm-ico { color: var(--ink-faint); flex: 0 0 auto; margin-top: 1px; }
.gap-mini .gm-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

/* make / final creative */
.make-grid { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.make-script { }
.make-beat { margin-bottom: 16px; }
.make-beat .mb-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent); font-weight: 700; margin-bottom: 5px; }
.make-beat .mb-hook { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.make-beat .mb-body { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.make-overlay { font-family: var(--mono); font-size: 11px; background: var(--paper-2); border: var(--bd) solid var(--line); border-radius: 6px; padding: 5px 9px; display: inline-block; color: var(--ink-soft); }

@media (max-width: 720px) {
  .proof-grid { grid-template-columns: 1fr 1fr; }
  .make-grid { grid-template-columns: 1fr; }
  .wiz-prog-label { display: none; }
}

/* ===========================================================================
   App shell — top nav, toast, library
   =========================================================================== */
.app2 { min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); }
.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 11px 22px; border-bottom: var(--bd) solid var(--line);
  background: rgba(255,255,255,0.82); backdrop-filter: blur(8px);
}
.tn-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; letter-spacing: -0.02em; cursor: pointer; flex: 0 0 auto; }
.tn-logo { height: 23px; width: auto; display: block; }
.tn-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.tn-nav { display: flex; gap: 3px; background: var(--paper-2); border: var(--bd) solid var(--line); border-radius: 9px; padding: 3px; flex: 0 0 auto; }
.tn-link { display: flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-soft); border: none; background: transparent; }
.tn-link:hover { color: var(--ink); }
.tn-link.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.tn-count { font-family: var(--mono); font-size: 10.5px; background: var(--accent); color: #fff; border-radius: 20px; padding: 1px 6px; min-width: 18px; text-align: center; }

/* progress (now lives in top nav center) */
.wiz-prog { display: flex; align-items: center; gap: 14px; }
.wiz-prog-label { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.3px; white-space: nowrap; }
.wiz-segs { display: flex; gap: 5px; }
.wiz-seg { height: 4px; width: 26px; border-radius: 3px; background: var(--line-strong); transition: background 0.25s; cursor: pointer; }
.wiz-seg.on { background: var(--accent); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 16px;
  background: var(--ink); color: #fff; padding: 11px 14px 11px 16px;
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.toast .tt-msg { font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 9px; }
.toast .tt-action { font-size: 13px; font-weight: 700; color: var(--accent-2); background: transparent; border: none; cursor: pointer; padding: 4px 6px; }
.toast .tt-action:hover { color: #fff; }
@keyframes toastIn { from { transform: translate(-50%, 12px); } to { transform: translate(-50%, 0); } }

/* library */
.lib { flex: 1; padding: 30px; max-width: 1060px; width: 100%; margin: 0 auto; }
.shot { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border: var(--bd) solid var(--line); border-radius: var(--r-md); background: var(--card); margin-bottom: 10px; transition: border-color 0.12s; }
.shot:hover { border-color: var(--line-strong); }
.shot-thumb { width: 44px; height: 56px; border-radius: 8px; overflow: hidden; flex: 0 0 44px; }
.shot-main { min-width: 0; flex: 1; }
.shot-name { font-family: var(--mono); font-weight: 600; font-size: 13.5px; }
.shot-hook { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.status-pill { font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 20px; cursor: pointer; border: var(--bd) solid transparent; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.status-todo { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }
.status-filming { background: var(--gold-soft); color: var(--gold); }
.status-filmed { background: var(--olive-soft); color: var(--olive); }
.shot-x { background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 5px; border-radius: 6px; display: grid; place-items: center; }
.shot-x:hover { color: var(--terra); background: var(--terra-soft); }

.angle { padding: 16px; border: var(--bd) solid var(--line); border-radius: var(--r-md); background: var(--card); margin-bottom: 10px; display: flex; gap: 14px; align-items: flex-start; }
.angle-title { font-weight: 600; font-size: 15px; }
.angle-note { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 6px; }

.gen-action { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between; }

.empty { text-align: center; padding: 64px 20px; }
.empty-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--paper-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--ink-faint); }
.empty h3 { font-size: 18px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.empty p { color: var(--ink-soft); font-size: 14px; margin: 0 auto 18px; max-width: 360px; line-height: 1.5; }

.lib-stat-row { display: flex; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; }
.lib-stat .ls-num { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.03em; }
.lib-stat .ls-lab { font-size: 12.5px; color: var(--ink-soft); }

/* ===========================================================================
   Dashboard + Analysis page
   =========================================================================== */
.dash { flex: 1; padding: 30px; max-width: 1060px; width: 100%; margin: 0 auto; }
.dash-section { margin-bottom: 38px; }

/* finished analysis card */
.an-card { display: flex; gap: 18px; align-items: center; padding: 20px; border: var(--bd) solid var(--line); border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.08s; }
.an-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.an-card .ac-logo { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; flex: 0 0 52px; }
.an-card .ac-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.an-card .ac-domain { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-top: 1px; }
.an-card .ac-sum { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin-top: 8px; max-width: 560px; }
.an-card .ac-meta { display: flex; gap: 16px; margin-top: 12px; }
.an-card .ac-meta .acm { font-size: 12px; color: var(--ink-soft); }
.an-card .ac-meta .acm b { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink); }
.an-card .ac-go { margin-left: auto; flex: 0 0 auto; color: var(--ink-faint); align-self: center; }

/* suggested competitor card */
.sug-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sug { display: flex; flex-direction: column; padding: 17px; border: var(--bd) solid var(--line); border-radius: var(--r-md); background: var(--card); box-shadow: var(--shadow-sm); }
.sug-top { display: flex; align-items: center; gap: 11px; }
.sug-logo { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: #fff; flex: 0 0 38px; }
.sug-name { font-size: 15px; font-weight: 600; }
.sug-domain { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.sug-why { font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; margin: 12px 0; flex: 1; }
.sug-foot { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: var(--bd) solid var(--line); }
.sug-match { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }

/* analysis detail page */
.an-page { flex: 1; padding: 0 0 130px; width: 100%; }
.an-hero { border-bottom: var(--bd) solid var(--line); background: var(--paper-2); padding: 26px 30px; }
.an-hero-inner { max-width: 1020px; margin: 0 auto; }
.an-vs { font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -0.03em; line-height: 1.05; }
.an-vs .vs { color: var(--ink-faint); font-weight: 500; }
.an-body { max-width: 1020px; margin: 0 auto; padding: 32px 30px 0; }
.an-tabs-wrap { position: sticky; top: 53px; z-index: 19; background: rgba(255,255,255,0.9); backdrop-filter: blur(8px); border-bottom: var(--bd) solid var(--line); }
.an-tabs-inner { max-width: 1020px; margin: 0 auto; padding: 0 30px; display: flex; gap: 2px; overflow-x: auto; }
.an-block { margin-bottom: 44px; }
.an-block-title { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 4px; }
.an-block-sub { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 20px; }
.an-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.an-note-block { font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); }
.an-note-block li { margin-bottom: 10px; }

@media (max-width: 860px) {
  .sug-grid { grid-template-columns: 1fr 1fr; }
  .an-cols { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sug-grid { grid-template-columns: 1fr; }
}
