/* ============================================================================
   TikTok Launch Engine — STYLES
   Modern dark UI, TikTok-adjacent accent palette. Self-contained.
   ============================================================================ */

:root {
  --bg: #0b0b0f;
  --bg-2: #14141b;
  --panel: #16161f;
  --panel-2: #1d1d28;
  --line: #2a2a38;
  --text: #f2f2f7;
  --muted: #9a9aab;
  --dim: #6b6b7b;
  --accent: #25f4ee;      /* TikTok cyan */
  --accent-2: #fe2c55;    /* TikTok red  */
  --go: #2ecc71;
  --test: #f5c542;
  --risky: #f08a24;
  --avoid: #fe2c55;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 40px rgba(0,0,0,.4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(37,244,238,.08), transparent 60%),
              radial-gradient(1000px 500px at 0% 110%, rgba(254,44,85,.07), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
button { font-family: var(--font); cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(11,11,15,.82); backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.logo {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 9px; color: #001; font-size: 15px; transform: rotate(0deg);
}
.brand-name { font-size: 17px; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 8px; }
.ghost {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  transition: .15s;
}
.ghost:hover { color: var(--text); border-color: var(--accent); }

/* ---------- layout ---------- */
.layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 22px;
  max-width: 1280px; margin: 26px auto; padding: 0 24px; align-items: start;
}
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.input-panel { padding: 26px; position: sticky; top: 88px; }
.results-panel { padding: 0; min-height: 60vh; position: relative; overflow: hidden; }

/* ---------- input ---------- */
.input-panel h1 { font-size: 24px; line-height: 1.15; }
.lede { color: var(--muted); font-size: 14px; margin: 10px 0 22px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=number], select {
  width: 100%; padding: 11px 12px; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px;
  transition: .15s; outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,244,238,.12); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239a9aab' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }
.check-field { display: flex; align-items: flex-end; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); font-weight: 500; margin-bottom: 11px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.adv { margin: 6px 0 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.adv summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; list-style: none; }
.adv summary::-webkit-details-marker { display: none; }
.adv summary::before { content: "＋ "; color: var(--accent); }
.adv[open] summary::before { content: "－ "; }
.adv[open] summary { margin-bottom: 12px; }

.primary {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #19d3cd); color: #00171a;
  font-size: 15px; font-weight: 800; letter-spacing: -.01em; transition: .15s;
}
.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary:active { transform: translateY(0); }
.form-error { color: var(--accent-2); font-size: 13px; margin-top: 10px; min-height: 1px; opacity: 0; transition: .2s; font-weight: 600; }
.form-error.show { opacity: 1; }
.micro { color: var(--dim); font-size: 11.5px; margin: 16px 0 0; text-align: center; }

/* ---------- empty state ---------- */
.empty-state { display: grid; place-content: center; text-align: center; min-height: 60vh; padding: 40px; }
.empty-art { font-size: 54px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 16px; opacity: .8; }
.empty-state p { color: var(--muted); font-size: 16px; }
.empty-state span { color: var(--dim); font-size: 14px; }

/* ---------- results ---------- */
.results { display: none; }
.results.show { display: block; }
.result-header { padding: 22px 26px 0; }
.result-header h2 { font-size: 22px; }
.result-sub { color: var(--muted); font-size: 13px; margin-top: 4px; text-transform: capitalize; }

.tabs { display: flex; gap: 4px; padding: 16px 26px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: none; color: var(--muted); font-size: 13.5px;
  font-weight: 700; padding: 10px 14px; border-radius: 8px 8px 0 0; position: relative; transition: .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--text); }
.tab-btn.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px; }
.tab-panel { display: none; padding: 22px 26px 28px; }
.tab-panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- score ---------- */
.score-hero { display: flex; align-items: center; gap: 22px; padding: 20px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 18px; }
.score-num { font-size: 54px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-num span { font-size: 18px; color: var(--dim); font-weight: 600; }
.score-verdict { flex: 1; }
.verdict-badge { display: inline-block; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; letter-spacing: .05em; }
.verdict-blurb { color: var(--muted); font-size: 13.5px; margin: 8px 0 0; }
.tone-go .score-num, .verdict-badge.tone-go { color: var(--go); } .verdict-badge.tone-go { background: rgba(46,204,113,.14); }
.tone-test .score-num, .verdict-badge.tone-test { color: var(--test); } .verdict-badge.tone-test { background: rgba(245,197,66,.14); }
.tone-risky .score-num, .verdict-badge.tone-risky { color: var(--risky); } .verdict-badge.tone-risky { background: rgba(240,138,36,.14); }
.tone-avoid .score-num, .verdict-badge.tone-avoid { color: var(--avoid); } .verdict-badge.tone-avoid { background: rgba(254,44,85,.14); }

.econ-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.econ-cell { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.econ-v { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.econ-k { font-size: 11px; color: var(--muted); margin-top: 4px; }

.bars { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.bar-row { display: grid; grid-template-columns: 200px 1fr 34px; align-items: center; gap: 12px; }
.bar-label { font-size: 13px; font-weight: 600; }
.bar-label span { color: var(--dim); font-weight: 500; font-size: 12px; display: block; }
.bar-track { height: 9px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.b-go { background: var(--go); } .b-test { background: var(--test); } .b-risky { background: var(--risky); } .b-avoid { background: var(--avoid); }
.bar-score { font-size: 13px; font-weight: 800; text-align: right; color: var(--muted); }

.callout { background: linear-gradient(135deg, rgba(37,244,238,.08), rgba(254,44,85,.06)); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; color: var(--text); }
.callout strong { color: var(--accent); }

/* ---------- section bars / copy ---------- */
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-bar h3 { font-size: 16px; } .section-bar h4 { font-size: 14px; }
.hint, .foot-dim { color: var(--dim); font-size: 11.5px; }
.copy { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 7px; transition: .15s; white-space: nowrap; }
.copy:hover { color: var(--text); border-color: var(--accent); }
.copy.ok { color: var(--go); border-color: var(--go); }

/* ---------- calendar ---------- */
.week-theme { font-size: 12.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.week-theme:first-child { margin-top: 0; }
.day-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; }
.day-head { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.day-num { font-weight: 800; font-size: 13px; color: var(--accent); min-width: 52px; }
.day-arch { font-weight: 700; font-size: 13.5px; }
.day-hook { font-size: 14px; color: var(--text); font-style: italic; margin-bottom: 8px; }
.day-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(37,244,238,.12); color: var(--accent); }
.day-meta .goal, .day-meta .cta { font-size: 11.5px; color: var(--muted); }
.day-meta .cta { color: var(--dim); }

/* ---------- hooks + scripts ---------- */
.hook-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 26px; }
.hook-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hook-text { font-size: 13.5px; flex: 1; }
.hook-card .copy { align-self: flex-start; }
.scripts-h { margin: 8px 0 14px; font-size: 16px; }
.script-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; }
.beat { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.beat:first-of-type { border-top: none; }
.beat-t { font-size: 11.5px; font-weight: 800; color: var(--accent); letter-spacing: .02em; }
.beat-line { font-size: 13.5px; color: var(--text); }

/* ---------- outreach ---------- */
.calc-card, .list-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.calc-card h3, .list-card h3 { font-size: 15px; margin-bottom: 14px; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calc-cell { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 8px; }
.calc-v { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.calc-k { font-size: 11px; color: var(--muted); margin-top: 3px; }
.warn { color: var(--risky); font-size: 13px; margin: 12px 0 0; font-weight: 600; }
.check-list { margin: 0; padding-left: 0; list-style: none; }
.check-list li { font-size: 13.5px; padding: 7px 0 7px 26px; position: relative; border-top: 1px solid var(--line); }
.check-list li:first-child { border-top: none; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--go); font-weight: 800; }
.dm-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.dm-text { font-size: 13.5px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 4px; }

/* ---------- footer ---------- */
.foot { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 28px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); margin-top: 30px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .input-panel { position: static; }
  .bar-row { grid-template-columns: 130px 1fr 30px; }
  .econ-strip { grid-template-columns: repeat(2, 1fr); }
  .beat { grid-template-columns: 90px 1fr; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .input-panel, .top-actions, .copy, .tabs, .foot, .empty-state, .micro, .form-error { display: none !important; }
  .layout { display: block; max-width: none; margin: 0; padding: 0; }
  .results-panel { box-shadow: none; border: none; }
  .results { display: block !important; }
  .tab-panel { display: block !important; page-break-inside: avoid; border-top: 2px solid #000; margin-top: 18px; padding-top: 12px; }
  .tab-panel::before { font-weight: 800; font-size: 16px; display: block; margin-bottom: 10px; }
  #tab-score::before { content: "① Product Score"; }
  #tab-calendar::before { content: "② 30-Day Content Calendar"; }
  #tab-hooks::before { content: "③ Hooks & Scripts"; }
  #tab-outreach::before { content: "④ Creator Outreach"; }
  .day-card, .hook-card, .script-card, .dm-card { page-break-inside: avoid; }
  * { color: #000 !important; background: #fff !important; }
  .pill, .verdict-badge { border: 1px solid #000; }
}
