:root {
  --bg: #0b0b12;
  --bg2: #11111b;
  --card: #161622;
  --line: #262636;
  --text: #ececf3;
  --muted: #9a9ab0;
  --accent: #8b5cf6;
  --accent2: #c084fc;
  --green: #34d399;
  --red: #f87171;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.08rem; }
code { background: #1f1f2e; padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; font-weight: 400; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 10px; }
.wrap-row { flex-wrap: wrap; gap: 10px; }
.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; border: 0;
  padding: 10px 18px; border-radius: 10px; font: 600 .95rem Inter, sans-serif; cursor: pointer;
  transition: transform .1s, filter .15s; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); filter: none; }
.btn-sm { padding: 7px 12px; font-size: .85rem; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.full { width: 100%; }
.file-btn { cursor: pointer; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(11,11,18,.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { color: var(--text); font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 6px; text-decoration: none !important; }
.logo { color: var(--accent2); font-size: 1.3rem; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { color: var(--muted); font-size: .92rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); border: 1px solid rgba(52,211,153,.4); padding: 2px 8px; border-radius: 99px; }
.badge:empty { display: none; }

/* Hero */
.hero { padding: 88px 0 56px; text-align: center; background: radial-gradient(60% 50% at 50% 0%, rgba(139,92,246,.22), transparent 70%); }
.eyebrow { color: var(--accent2); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 14px; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; }
.grad { background: linear-gradient(90deg, var(--accent2), #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.micro { font-size: .82rem; color: var(--muted); margin-top: 14px; }

/* Panels */
.tool { padding: 24px 0 40px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel.highlight { border-color: rgba(139,92,246,.5); background: linear-gradient(180deg, rgba(139,92,246,.09), var(--card)); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: 1.2rem; margin: 0; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid2 > .panel { margin-bottom: 18px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.field em { font-style: normal; opacity: .7; }
input[type=text], textarea {
  width: 100%; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font: 15px/1.5 Inter, sans-serif; outline: none; transition: border-color .15s;
}
textarea { font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); }
.note { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(139,92,246,.12); border: 1px solid rgba(139,92,246,.35); font-size: .92rem; }

/* Report */
#report { margin-top: 28px; }
.report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.report-head h2 { margin: 0; }
.report-head p { margin: 4px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .82rem; }
.insights { margin: 0; padding-left: 20px; }
.insights li { margin-bottom: 8px; }
.insights b { color: #fff; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 200px) 1fr 74px; gap: 12px; align-items: center; }
.bar-label { font-weight: 600; font-size: .92rem; }
.bar-label small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; line-height: 1.3; }
.bar-track { height: 26px; background: var(--bg2); border-radius: 7px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--accent), var(--accent2)); min-width: 3px; transition: width .6s ease; }
.bar-fill.low { background: linear-gradient(90deg, #4b4b63, #6b6b85); }
.bar-in { position: absolute; left: 10px; top: 0; line-height: 26px; font-size: .78rem; color: #fff; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bar-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-val.up { color: var(--green); }
.bar-val.down { color: var(--red); }
.median-line { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.55); }

.table { display: flex; flex-direction: column; }
.trow { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.trow:last-child { border-bottom: 0; }
.trow .muted { white-space: nowrap; font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--bg2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: .88rem; }
.chip span { color: var(--muted); margin-left: 4px; font-size: .78rem; }

.breakouts { margin: 0; padding-left: 22px; }
.breakouts li { margin-bottom: 8px; }
.breakouts .v { color: var(--green); font-weight: 700; margin-left: 6px; white-space: nowrap; }
.tagmini { display: inline-block; font-size: .7rem; color: var(--accent2); border: 1px solid rgba(192,132,252,.35); border-radius: 99px; padding: 0 7px; margin-left: 5px; }

.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.tpl-group h4 { margin: 0 0 8px; font-size: .8rem; color: var(--accent2); text-transform: uppercase; letter-spacing: .08em; }
.tpl { display: block; width: 100%; text-align: left; background: var(--bg2); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 9px; margin-bottom: 7px; font: 500 .93rem Inter, sans-serif; cursor: pointer; }
.tpl:hover { border-color: var(--accent); }

.saved { display: flex; flex-direction: column; gap: 8px; }
.saved-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg2); border-radius: 9px; border: 1px solid var(--line); }
.saved-item button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.saved-item button:hover { color: var(--text); }
.saved-item .open { color: var(--text); font-weight: 600; text-align: left; }

/* Sections */
.section { padding: 72px 0; border-top: 1px solid var(--line); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 32px 0; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step p { color: var(--muted); margin: 0; font-size: .95rem; }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(139,92,246,.18); color: var(--accent2); font-weight: 800; margin-bottom: 12px; }
.sources ul { margin: 0; padding-left: 20px; color: var(--muted); }
.sources li { margin-bottom: 8px; }
.sources b { color: var(--text); }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 36px 0 18px; align-items: stretch; }
.price-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 20px 60px -20px rgba(139,92,246,.5); }
.price-card .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 12px; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; }
.price { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; margin: 4px 0 14px; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 24px; flex: 1; }
.price-card li { padding: 6px 0 6px 24px; position: relative; font-size: .94rem; color: #cfcfe0; }
.price-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }

details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; float: right; color: var(--muted); font-size: 1.2rem; }
details[open] summary::after { content: "–"; }
details p { color: var(--muted); margin: 0 0 14px; }

.cta-band { padding: 72px 0; background: radial-gradient(50% 80% at 50% 100%, rgba(139,92,246,.22), transparent 70%); border-top: 1px solid var(--line); }
.cta-band h2 { margin-bottom: 22px; }
.footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: .88rem; }
.footer a { color: var(--muted); }

/* Modal + toast */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; max-width: 520px; width: 100%; position: relative; max-height: 92vh; overflow: auto; }
.modal-box img { width: 100%; border-radius: 10px; display: block; margin: 12px 0 16px; }
.modal-x { position: absolute; top: 10px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); background: #fff; color: #111; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: .9rem; opacity: 0; transition: .25s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .grid2, .steps, .pricing { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .price-card.featured { order: -1; }
}
@media (max-width: 520px) {
  .hero { padding: 56px 0 36px; }
  .panel { padding: 16px; }
  .bar-row { grid-template-columns: 1fr 60px; }
  .bar-row .bar-label { grid-column: 1 / -1; }
  .stat b { font-size: 1.3rem; }
}

.steps-list { padding-left: 20px; margin: 14px 0 18px; }
.steps-list li { margin-bottom: 14px; color: var(--muted); }
.steps-list b { color: var(--text); }

/* ── Free toolkit (v4) ─────────────────────────────────── */
.free-pill { font-size: .75rem; font-weight: 700; color: var(--green); border: 1px solid rgba(52,211,153,.4); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.section > .wrap > h2 { margin-bottom: 6px; }
.section > .wrap > p.muted { margin: 0 0 22px; }
.tool { padding-top: 72px; }

.scorer { max-width: 760px; margin: 30px auto 0; text-align: left; padding: 20px; }
.hook-input { font-size: 1.15rem !important; padding: 16px 18px !important; border-radius: 12px !important; }
.try-row { margin-top: 10px; line-height: 1.9; }
.link { background: none; border: 0; padding: 0; color: var(--accent2); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }

.score-out { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: start; margin-top: 22px; }
.ring-wrap { position: relative; width: 150px; height: 150px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--bg2); stroke-width: 11; }
.ring-fg { fill: none; stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .5s ease, stroke .3s; }
.ring-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num b { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.ring-num span { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checks li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; font-size: .9rem; align-items: start; }
.checks .ck { font-weight: 800; }
.checks li.ok .ck { color: var(--green); }
.checks li.no .ck { color: var(--red); }
.checks li.no b { color: var(--muted); font-weight: 600; }
.checks small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; margin-top: 2px; }
.checks .pts { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }

.rewrites { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.rewrites h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline-input { width: auto !important; min-width: 120px; max-width: 220px; padding: 4px 10px !important; font: 600 1rem Inter, sans-serif !important; border-radius: 8px !important; color: var(--accent2) !important; }

.hook-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.hook-item { display: flex; align-items: stretch; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; transition: border-color .15s; }
.hook-item:hover { border-color: var(--accent); }
.hook-text { flex: 1; text-align: left; background: none; border: 0; color: var(--text); padding: 10px 12px; font: 500 .93rem Inter, sans-serif; cursor: pointer; }
.hook-text .tagmini { vertical-align: 1px; }
.star { background: none; border: 0; border-left: 1px solid var(--line); color: var(--muted); padding: 0 12px; font-size: 1.05rem; cursor: pointer; }
.star:hover, .star.on { color: #fbbf24; }
.tpl-group .hook-item { margin-bottom: 7px; }

.gen-bar { display: flex; gap: 10px; }
.gen-bar input { flex: 1; }
.filters { margin-top: 14px; }
.filters .chip { cursor: pointer; color: var(--muted); font: 500 .82rem Inter, sans-serif; }
.filters .chip.on { color: #fff; border-color: var(--accent); background: rgba(139,92,246,.18); }

.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.lib-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; }
.lib-card h3 { margin-bottom: 2px; }
.lib-card p { margin: 0 0 10px; font-size: .92rem; }
.lib-card p.muted { margin-bottom: 10px; }
.lib-card ul { margin: 0 0 14px; padding-left: 18px; color: #cfcfe0; font-size: .88rem; flex: 1; }
.lib-card .btn { align-self: flex-start; }

@media (max-width: 600px) {
  .score-out { grid-template-columns: 1fr; justify-items: center; }
  .checks { width: 100%; }
  .grid-list, .lib-grid { grid-template-columns: 1fr; }
  .gen-bar { flex-direction: column; }
  .free-pill { display: none; }
}
