/* SearchSignal design system — light, airy, Ubersuggest-inspired. */
:root {
  --bg: #f7f8fa; --card: #ffffff; --ink: #1a2733; --muted: #6b7a89;
  --brand: #e8590c; --brand-dark: #cf4f0b; --blue: #2f80ed; --green: #27ae60;
  --yellow: #e0a800; --red: #eb5757; --purple: #9b51e0; --line: #e6eaf0;
  --shadow: 0 1px 3px rgba(16,30,54,.08), 0 1px 2px rgba(16,30,54,.04);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 20px; }
h3 { font-size: 16px; margin-top: 1.2em; }
.muted { color: var(--muted); font-weight: 400; font-size: 13px; }
.error { color: var(--red); background: #fdeded; border: 1px solid #f5c6c6; padding: 8px 12px; border-radius: 8px; font-size: 14px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar .container { display: flex; align-items: center; gap: 18px; max-width: 1180px; margin: 0 auto; padding: 10px 20px; }
.logo { font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; white-space: nowrap; }
.logo b { color: var(--brand); }
.logo:hover { text-decoration: none; }
.search-form { display: flex; flex: 1; max-width: 560px; }
.search-form input[type="search"], .search-form input[type="text"] {
  flex: 1; border: 1.5px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px;
  padding: 10px 14px; font-size: 15px; outline: none; background: #fff; color: var(--ink); min-width: 0;
}
.search-form input:focus { border-color: var(--brand); }
.search-form button { border-radius: 0 8px 8px 0; }
.topnav { display: flex; align-items: center; gap: 14px; white-space: nowrap; margin-left: auto; }
.topnav a { color: var(--ink); font-size: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--brand); color: #fff; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 8px; font-size: 15px; font-weight: 600;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-ghost {
  display: inline-block; background: transparent; color: var(--blue); border: 1.5px solid var(--line);
  padding: 7px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--blue); text-decoration: none; }

/* ---------- Layout ---------- */
.sidebar {
  position: fixed; left: 0; top: 57px; bottom: 0; width: 210px; background: var(--card);
  border-right: 1px solid var(--line); padding: 18px 0;
}
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a { color: var(--ink); padding: 10px 22px; font-size: 14.5px; border-left: 3px solid transparent; }
.sidebar nav a:hover { background: var(--bg); border-left-color: var(--brand); text-decoration: none; }
main.app, main.dashboard, main.lists { margin-left: 210px; padding: 24px; max-width: 1180px; }
main.auth { max-width: 420px; margin: 48px auto; padding: 0 16px; }
main.landing { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }
main.not-found { max-width: 480px; margin: 60px auto; text-align: center; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.overview-strip { margin-bottom: 20px; }
.kw-title { font-size: 24px; margin: 4px 0 16px; }

/* ---------- Metric cards ---------- */
.metric-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.metric-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.metric-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.metric-value { font-size: 26px; font-weight: 700; }
.big-blue { color: var(--blue); }
.metric-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.info { display: inline-block; width: 15px; height: 15px; line-height: 15px; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 10px; cursor: help; }
.bar { height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; margin: 14px 0 4px; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), #6fcf97); border-radius: 4px; }

/* ---------- Donut gauge ---------- */
.donut { width: 84px; height: 84px; margin: 0 auto; display: block; }
.donut-num { font-size: 11px; font-weight: 700; fill: var(--ink); }
.donut-label { font-size: 13px; font-weight: 600; margin-top: 2px; }

/* ---------- Chips ---------- */
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.chip-lg { padding: 6px 16px; font-size: 14px; }
.chip-xs { padding: 1px 8px; font-size: 11.5px; font-weight: 500; }
.chip-blue { background: rgba(47,128,237,.12); color: var(--blue); }
.chip-green { background: rgba(39,174,96,.12); color: var(--green); }
.chip-yellow { background: rgba(224,168,0,.14); color: #9c7500; }
.chip-red { background: rgba(235,87,87,.12); color: var(--red); }
.chip-purple { background: rgba(155,81,224,.12); color: var(--purple); }
.chip-gray { background: #eef1f5; color: var(--muted); }
a.chip:hover { text-decoration: none; filter: brightness(.95); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Why card / demo banner ---------- */
.why-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-top: 14px; }
.why-card h3 { margin: 0 0 8px; font-size: 15px; }
.why-list { margin: 0; padding-left: 18px; font-size: 14px; }
.why-list li { margin: 4px 0; }
.why-up::marker { color: var(--red); }
.why-down::marker { color: var(--green); }
.demo-banner { margin-top: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; padding: 12px 16px; border-radius: 10px; font-size: 14.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted);
  padding: 10px 12px; border-bottom: 2px solid var(--line); position: sticky; top: 0; background: var(--card);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: #fafbfc; }
.data-table tbody tr:hover { background: #f2f6fb; }
.th-num { text-align: right; }
td.th-num { text-align: right; color: var(--muted); }
.th-check { width: 34px; }
.th-strength { width: 130px; }
.cell-title a { font-weight: 600; color: var(--ink); }
.cell-title a:hover { color: var(--blue); }
.snippet { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.cell-domain { color: var(--muted); font-size: 13px; word-break: break-all; }
.cell-kw a { color: var(--ink); font-weight: 500; }
.cell-kw a:hover { color: var(--blue); }
.strength-bar { height: 8px; background: #eef1f5; border-radius: 4px; overflow: hidden; min-width: 80px; margin-top: 6px; }
.strength-fill { height: 100%; border-radius: 4px; }
.strength-fill.shigh { background: var(--red); }
.strength-fill.smid { background: var(--yellow); }
.strength-fill.slow { background: var(--green); }
.table-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tab-btn {
  background: none; border: 0; padding: 10px 16px; font-size: 14.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2.5px solid transparent; margin-bottom: -2px; font-weight: 600; white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- PAA / brief ---------- */
.paa-list { padding-left: 20px; font-size: 14.5px; }
.paa-list li { margin: 4px 0; }
.quick-answer { background: #f0f7ff; border: 1px solid #cfe3fb; border-radius: 10px; padding: 12px 16px; margin: 12px 0; font-size: 14.5px; }
.outline { padding-left: 20px; }
.outline li { margin: 8px 0; }
.faqs dt { font-weight: 600; margin-top: 10px; }
.faqs dd { margin: 2px 0 0 0; color: var(--muted); font-size: 14px; }
.brief-meta { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.cluster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 10px; }
.cluster { background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.cluster h4 { margin: 0 0 8px; font-size: 14px; }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: 40px; letter-spacing: -1px; margin-bottom: 10px; }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 auto 26px; }
.hero .search-form { max-width: 560px; margin: 0 auto; }
.hero .search-form input { padding: 14px 18px; font-size: 16px; }
.hero .search-form button { padding: 14px 22px; font-size: 16px; }
.hero-sub { font-size: 14px !important; margin-top: 16px !important; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 30px 0; }
.features .card { margin: 0; }
.features h3 { margin-top: 0; }
.metrics { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-top: 30px; }
.metrics h2 { text-align: center; }
.metrics > p { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 18px; }
.metrics .metric { border-left: 3px solid var(--brand); padding: 4px 0 4px 16px; margin: 14px 0; }
.metrics .metric h3 { margin: 0 0 4px; }
.metrics .metric p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Auth ---------- */
.auth .card { padding: 28px; }
.auth label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.auth input { display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 8px; font-size: 15px; }
.auth input:focus { outline: none; border-color: var(--brand); }
.auth button[type="submit"] { width: 100%; margin-top: 6px; }
.auth p { font-size: 14px; }

/* ---------- Lists / dashboard ---------- */
.js-list-form { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; flex-wrap: wrap; }
.js-list-form label { flex: 1; font-size: 14px; font-weight: 600; }
.js-list-form input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; }
.lists ul, .dashboard ul { list-style: none; padding: 0; margin: 0; }
.lists li, .dashboard li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-name { font-weight: 600; }
.list-pick { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.or-sep { text-align: center; color: var(--muted); margin: 10px 0; font-size: 13px; }
#new-list-form { display: flex; gap: 8px; }
#new-list-form input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,30,54,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; padding: 24px; max-width: 420px; width: 100%; position: relative; box-shadow: 0 12px 40px rgba(16,30,54,.25); }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 24px; color: var(--muted); cursor: pointer; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 14px;
  z-index: 200; transition: all .25s ease; max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast-error { background: var(--red); }
.toast-warn { background: var(--yellow); color: #3a2f00; }

/* ---------- Skeleton ---------- */
.skeleton { min-height: 80px; }
.skel-line { height: 16px; border-radius: 6px; margin: 12px 0; background: linear-gradient(90deg, #eef1f5 25%, #f7f8fa 50%, #eef1f5 75%); background-size: 400% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--card); }
footer .container { max-width: 1180px; margin: 0 auto; padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
footer nav { display: flex; gap: 16px; }
main.app ~ footer, main.dashboard ~ footer, main.lists ~ footer { margin-left: 210px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  main.app, main.dashboard, main.lists { margin-left: 0; padding: 14px; }
  main.app ~ footer, main.dashboard ~ footer, main.lists ~ footer { margin-left: 0; }
  .topbar .container { flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; flex-basis: 100%; max-width: none; }
  .hero h1 { font-size: 28px; }
  .metric-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

/* ---------- Review-pass additions ---------- */
.verdict-banner { padding: 13px 18px; border-radius: 10px; font-size: 15.5px; margin: 0 0 16px; border: 1px solid; }
.verdict-go { background: #e6f4ea; color: #1e7e34; border-color: #b7dfb9; }
.verdict-stop { background: #fdecea; color: #c0392b; border-color: #f5c6c6; }
.verdict-caution { background: #fff8e6; color: #856404; border-color: #ffeeba; }
.demo-banner b { font-size: 15.5px; }
.demo-benefits { margin: 10px 0; padding: 0; list-style: none; }
.demo-benefits li { padding: 3px 0; font-size: 14.5px; }
.demo-sub { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.locked { border: 1.5px dashed var(--line); padding: 16px; border-radius: 10px; background: #fdfdfe; }
.locked p { margin: 0 0 12px; }
.loading-msg { font-size: 13.5px; margin-bottom: 4px; }
.strength-unknown { background: #f1f3f6; }
.meta-line { margin-top: 10px; font-size: 12.5px; }
.try-examples { max-width: 860px; margin: 0 auto 10px; text-align: center; }
.try-examples .btn-small, .try-examples .btn-ghost { margin: 0 4px 8px; }

/* ---------- v1.1 UI pass ---------- */
h2 { letter-spacing: -.2px; }
.card { padding: 22px 24px; }
.card > h2:first-child { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.kw-title { font-size: 26px; letter-spacing: -.5px; }
.metric-card { transition: box-shadow .15s ease, transform .15s ease; }
.metric-card:hover { box-shadow: 0 4px 14px rgba(16,30,54,.10); transform: translateY(-1px); }
.data-table td { padding: 11px 12px; }
.data-table tbody tr { transition: background .1s ease; }
.pos-chip { font-variant-numeric: tabular-nums; min-width: 38px; text-align: center; }
.tab-btn { border-radius: 8px 8px 0 0; }
.tab-btn:hover { background: #fafbfc; }
.btn, .btn-ghost { transition: background .12s ease, border-color .12s ease, transform .08s ease; }
.btn:active { transform: scale(.98); }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.search-form input[type="search"]:focus, .auth input:focus { box-shadow: 0 0 0 3px rgba(232,89,12,.12); }
.hero { padding: 64px 0 44px; }
.hero h1 { font-size: 42px; background: linear-gradient(120deg, var(--ink), #3d5266); -webkit-background-clip: text; background-clip: text; }
.features .card { transition: box-shadow .15s ease, transform .15s ease; }
.features .card:hover { box-shadow: 0 6px 18px rgba(16,30,54,.10); transform: translateY(-2px); }
.sidebar nav a.active, .sidebar nav a[aria-current] { border-left-color: var(--brand); background: var(--bg); font-weight: 600; }
.toast { box-shadow: 0 8px 24px rgba(16,30,54,.28); }
.why-card h3 { display: flex; align-items: center; gap: 6px; }
.verdict-banner { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.demo-banner .btn { margin-top: 4px; }
footer .container { padding: 24px 20px; }
@media (max-width: 640px) {
  .metric-cards { grid-template-columns: 1fr 1fr; }
  .kw-title { font-size: 20px; }
  .hero h1 { font-size: 26px; }
  .card { padding: 16px; }
}
