/* LLM Results base stylesheet
   --------------------------------------------------------------- */
:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --surface: #161f3d;
  --text: #e8ecf6;
  --muted: #9aa6c4;
  --brand: #5b8cff;
  --brand-2: #7af0c8;
  --border: #243057;
  --radius: 14px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Avoid a flash of unincluded content: fade page in once partials load. */
html:not(.includes-ready) body { opacity: 0; }
body { opacity: 1; transition: opacity 0.2s ease; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, #1b2750 0%, transparent 60%), var(--bg);
  line-height: 1.6;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--text); }
.muted { color: var(--muted); }

/* Header / nav */
.site-header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(11, 16, 32, 0.7);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #06122b; font-weight: 800; font-size: 0.85rem;
}
.brand-name { font-size: 1.05rem; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.is-active { color: var(--text); }
.nav-cta {
  padding: 9px 16px; border-radius: 999px; color: #06122b !important;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-weight: 600;
}
.nav-cta:hover { text-decoration: none; opacity: 0.92; }

/* Layout blocks */
section { padding: 72px 0; }
.hero { padding: 96px 0 72px; }
.eyebrow { color: var(--brand-2); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.tagline { font-size: clamp(1.15rem, 2vw, 1.45rem); color: var(--muted); margin: 0.35em 0 1em; font-weight: 400; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 999px; font-weight: 600;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #06122b;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.card h3 { margin-top: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; padding: 40px 0 24px; flex-wrap: wrap; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.footer-brand .brand-mark { margin-bottom: 4px; }
.footer-tag { color: var(--muted); margin: 4px 0 0; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-nav a { color: var(--muted); }
.footer-bottom { padding: 16px 0 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

/* Readable article width + prose */
.container.narrow { max-width: 740px; }
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 1.6em; }
.prose p { color: #cdd6ee; }
.prose code {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 6px; font-size: 0.9em;
}
.chapters { list-style: none; padding: 0; margin: 0 0 1em; }
.chapters li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.chapters li a { font-weight: 600; }

/* Related cross-link block */
.related {
  margin-top: 2.4em; padding: 20px 22px;
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius); background: var(--bg-soft);
}
.related h3 { margin: 0 0 6px; font-size: 1rem; color: var(--brand-2); }
.related p { margin: 0; color: var(--muted); }

/* Home feed cards */
a.feed-card { display: block; }
a.feed-card:hover { text-decoration: none; border-color: var(--brand); }
a.feed-card h3 { margin: 8px 0 6px; }
.badge {
  display: inline-block; font-size: 0.66rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--brand-2);
  border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}

/* Ad slots */
.ad-slot {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  margin: 28px auto; padding: 12px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  text-align: center; min-height: 60px; justify-content: center;
}
.ad-slot .ad-label {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); opacity: 0.7;
}
.ad-slot ins { display: inline-block; }

/* Article figures / inline images */
.article-figure {
  margin: 2em 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure figcaption {
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
}

/* Callout / tip box */
.callout {
  margin: 1.8em 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-2);
  background: var(--bg-soft);
}
.callout strong {
  color: var(--brand-2);
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.callout p { margin: 0; color: var(--muted); }

/* Stat highlight */
.stat-row {
  display: flex; gap: 16px; margin: 1.8em 0; flex-wrap: wrap;
}
.stat-box {
  flex: 1; min-width: 130px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; text-align: center;
}
.stat-box .stat-num {
  display: block; font-size: 2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1; margin-bottom: 4px;
}
.stat-box .stat-label { color: var(--muted); font-size: 0.85rem; }

/* Prose improvements */
.prose h2 { margin-top: 2em; padding-top: 0.4em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.4em; color: var(--brand-2); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; color: #cdd6ee; }
.prose strong { color: var(--text); }
.prose blockquote {
  border-left: 3px solid var(--brand);
  margin: 1.5em 0; padding: 12px 20px;
  background: var(--bg-soft); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted); font-style: italic;
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.5em 0;
  font-size: 0.95rem;
}
.prose th {
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 14px; text-align: left; color: var(--brand-2);
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.prose td {
  border: 1px solid var(--border); padding: 10px 14px; color: #cdd6ee;
}
.prose tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field input, .field textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 13px; font: inherit;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand); border-color: transparent; }
.field label { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.field .hint { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
select {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 13px; font: inherit;
}
select:focus { outline: 2px solid var(--brand); border-color: transparent; }

/* ============================================================
   GEO Tools — shared interactive-tool styles
   ============================================================ */

/* Two-column tool layout: input on the left, output on the right.
   Collapses to a single column on narrow screens. */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }

.tool-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.tool-panel h2 { margin-top: 0; font-size: 1.15rem; }
.tool-panel + .tool-panel { margin-top: 0; }

textarea.tool-input { width: 100%; min-height: 220px; resize: vertical;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 12px 14px; font: inherit; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.5; }
textarea.tool-input:focus { outline: 2px solid var(--brand); border-color: transparent; }

/* Generic toolbar row of buttons */
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.btn-sm { padding: 8px 14px; font-size: 0.9rem; }

/* Output code blocks */
pre.tool-output {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; overflow-x: auto; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.85rem; line-height: 1.55; color: var(--brand-2); white-space: pre-wrap; word-break: break-word; margin: 0;
}

/* Score gauge */
.score-display { text-align: center; padding: 10px 0 4px; }
.score-number { font-size: 4rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.score-number .score-max { font-size: 1.6rem; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.score-label { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* Score ring (SVG) wrapper */
.score-ring { display: block; margin: 0 auto; }

/* Results table */
table.tool-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.tool-table th { background: var(--bg); border: 1px solid var(--border); padding: 9px 12px;
  text-align: left; color: var(--brand-2); font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }
table.tool-table td { border: 1px solid var(--border); padding: 9px 12px; color: #cdd6ee; }
.status-allowed { color: var(--brand-2); font-weight: 600; }
.status-blocked { color: #ff6b81; font-weight: 600; }
.status-unmentioned { color: #f5c451; font-weight: 600; }

/* Checklist (pass/fail) */
ul.check-list { list-style: none; padding: 0; margin: 0; }
ul.check-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); color: #cdd6ee; }
ul.check-list li:last-child { border-bottom: none; }
ul.check-list .ck { flex: 0 0 auto; font-weight: 700; }
ul.check-list .pass .ck { color: var(--brand-2); }
ul.check-list .fail .ck { color: #ff6b81; }

/* Signal highlighting */
.signal-strong { background: rgba(122,240,200,0.16); border-bottom: 2px solid var(--brand-2); border-radius: 3px; padding: 0 2px; }
.signal-vague { background: rgba(255,107,129,0.16); border-bottom: 2px solid #ff6b81; border-radius: 3px; padding: 0 2px; }
.highlight-output { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; line-height: 1.7; color: #cdd6ee; max-height: 360px; overflow-y: auto; }

/* Priority pills for fix lists */
.pill { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-right: 8px; vertical-align: middle; }
.pill-high { background: rgba(255,107,129,0.18); color: #ff8a9b; }
.pill-med { background: rgba(245,196,81,0.18); color: #f5c451; }
.pill-low { background: rgba(122,240,200,0.16); color: var(--brand-2); }

/* Section progress bars (CSS-only bar chart) */
.bar-row { margin: 12px 0; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--muted); margin-bottom: 5px; }
.bar-track { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width 0.5s ease; }

/* Quiz question rows */
.quiz-q { padding: 16px 0; border-bottom: 1px solid var(--border); }
.quiz-q:last-child { border-bottom: none; }
.quiz-q p { margin: 0 0 10px; color: var(--text); }
.quiz-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.quiz-opts label { cursor: pointer; }
.quiz-opts input { position: absolute; opacity: 0; }
.quiz-opts .opt { display: inline-block; padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.88rem; color: var(--muted); transition: all 0.15s; }
.quiz-opts input:checked + .opt { background: var(--brand); border-color: var(--brand); color: #06122b; font-weight: 600; }
.quiz-section-title { color: var(--brand-2); font-size: 0.95rem; letter-spacing: 0.04em; text-transform: uppercase; margin: 26px 0 4px; }

/* API-key panel */
.api-key-panel { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; }
.api-key-panel summary { cursor: pointer; font-weight: 600; color: var(--brand-2); }
.api-key-panel .key-body { margin-top: 14px; }
.api-key-panel .key-note { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }
.api-key-panel a { color: var(--brand); }
.key-status { font-size: 0.82rem; margin-left: 8px; }
.key-status.set { color: var(--brand-2); }
.key-status.unset { color: var(--muted); }

/* Dynamic rows (page lists, FAQ pairs) */
.row-list { display: flex; flex-direction: column; gap: 14px; }
.row-item { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px; position: relative; }
.row-item .row-remove { position: absolute; top: 10px; right: 10px; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.row-item .row-remove:hover { color: #ff6b81; }

/* Inline notices */
.notice { border-radius: 10px; padding: 11px 14px; font-size: 0.9rem; margin: 12px 0; }
.notice-err { background: rgba(255,107,129,0.12); border: 1px solid rgba(255,107,129,0.4); color: #ff8a9b; }
.notice-info { background: rgba(91,140,255,0.1); border: 1px solid rgba(91,140,255,0.35); color: #9db8ff; }
.notice-ok { background: rgba(122,240,200,0.1); border: 1px solid rgba(122,240,200,0.35); color: var(--brand-2); }

/* Spinner */
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.25); border-top-color: var(--brand-2); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tool card grid badges on the section index */
.card .tool-tag { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-2); margin-bottom: 8px; }
.card .tool-tag.ai::after { content: "AI"; }
