:root {
  --bg: #f7f5f0;
  --card: #ffffff;
  --ink: #1b2420;
  --ink-2: #4b5752;
  --ink-3: #7a8580;
  --line: #e4e0d6;
  --accent: #0d6b52;
  --accent-soft: #e3f1ec;
  --warn: #b4462b;
  --warn-soft: #fbe9e3;
  --gold: #c98a12;
  --gold-soft: #fbf1db;
  --blue-soft: #e7eefb;
  --wa-head: #075e54;
  --wa-bg: #ece5dd;
  --wa-me: #dcf8c6;
  --wa-bot: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.06), 0 4px 16px rgba(20, 30, 25, 0.05);
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121614; --card: #1a201d; --ink: #e8ece9; --ink-2: #b4bdb8; --ink-3: #8a948f; --line: #2b332f;
    --accent: #4cc39b; --accent-soft: #1b3129; --warn: #ef8a6e; --warn-soft: #3a2420; --gold: #e2b04a; --gold-soft: #33291a; --blue-soft: #1d2533;
    --wa-head: #1f2c34; --wa-bg: #0b141a; --wa-me: #005c4b; --wa-bot: #202c33;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121614; --card: #1a201d; --ink: #e8ece9; --ink-2: #b4bdb8; --ink-3: #8a948f; --line: #2b332f;
  --accent: #4cc39b; --accent-soft: #1b3129; --warn: #ef8a6e; --warn-soft: #3a2420; --gold: #e2b04a; --gold-soft: #33291a; --blue-soft: #1d2533;
  --wa-head: #1f2c34; --wa-bg: #0b141a; --wa-me: #005c4b; --wa-bot: #202c33;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 5vw, 46px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }

/* header */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { font: 700 20px Fraunces, serif; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); position: relative; }
.logo-mark::after { content: ""; position: absolute; inset: 6px 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: skewX(-15deg); }
/* Row 1: categories (the main menu) */
.cats { display: flex; gap: 4px; align-self: stretch; }
.cats a { display: flex; align-items: center; padding: 0 14px; color: var(--ink-2); font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.cats a:hover { color: var(--ink); text-decoration: none; }
.cats a.on { color: var(--accent); border-bottom-color: var(--accent); }
/* Row 2: sections of the current category */
.sub { background: var(--bg); border-top: 1px solid var(--line); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 6px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--card); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 760px) {
  .top-in { gap: 12px; height: auto; padding-top: 10px; flex-wrap: wrap; }
  .logo { font-size: 18px; }
  .cats { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; gap: 0; }
  .cats a { flex: none; padding: 10px 12px 8px; font-size: 14px; }
  .cats a:first-child { padding-left: 0; }
}

/* Footer stays at the bottom on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main, main.wrap { padding: 28px 16px 96px; flex: 1 0 auto; width: 100%; }

/* hero */
.hero { padding: 36px 0 20px; text-align: center; }
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 640px; margin: 0 auto 24px; }
.search { position: relative; max-width: 620px; margin: 0 auto; }
.search input { width: 100%; font: inherit; font-size: 17px; padding: 16px 18px 16px 48px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.search input:focus { outline: none; border-color: var(--accent); }
.search::before { content: "⌕"; position: absolute; left: 18px; top: 50%; transform: translateY(-52%); font-size: 22px; color: var(--ink-3); }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); text-align: left; z-index: 10; overflow: hidden; }
.results a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; color: var(--ink); border-top: 1px solid var(--line); }
.results a:first-child { border-top: 0; }
.results a:hover, .results a.sel { background: var(--accent-soft); text-decoration: none; }
.results .kind { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.hint { margin-top: 12px; color: var(--ink-3); font-size: 14px; }
.hint a { margin: 0 4px; }

/* cards + grid */
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g2 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h3 { margin-bottom: 12px; }
.section { margin-top: 36px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.kpi .v { font: 700 32px Fraunces, serif; }
.kpi .l { color: var(--ink-2); font-size: 14px; }

/* bars */
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.bar a, .bar span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.bar .track { height: 12px; background: var(--accent-soft); border-radius: 6px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar .c { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
tr:hover td { background: color-mix(in srgb, var(--accent-soft) 40%, transparent); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input, .filters select { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.filters input { flex: 1; min-width: 180px; }

/* badges */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.badge.reported { background: var(--gold-soft); color: var(--gold); }
.badge.unclear, .badge.closed { background: var(--warn-soft); color: var(--warn); }
.badge.grey { background: var(--line); color: var(--ink-2); }
.badge.blue { background: var(--blue-soft); color: #3b64b0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ownership chain */
.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 18px 0; }
.node { background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 160px; max-width: 280px; }
.node .t { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.node .n { font-weight: 600; margin-top: 2px; }
.node .s { font-size: 13px; color: var(--ink-2); }
.node.top { border-color: var(--accent); background: var(--accent-soft); }
.arrow { align-self: center; padding: 0 8px; color: var(--ink-3); font-size: 20px; }
@media (max-width: 640px) { .chain { flex-direction: column; } .arrow { transform: rotate(90deg); padding: 4px 0; align-self: flex-start; margin-left: 24px; } .node { max-width: none; } }

.page-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.sources { font-size: 13px; }
.sources li { word-break: break-all; }
.alert { padding: 12px 16px; border-radius: 10px; background: var(--gold-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); font-size: 14px; }
.alert.bad { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* sister chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip .r { color: var(--gold); font-size: 12px; }

/* reviews */
.score-big { font: 700 44px Fraunces, serif; line-height: 1; }
.stars { color: var(--gold); letter-spacing: 1px; }
.dist { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.dist .bar { grid-template-columns: 34px 1fr 30px; }
.dist .fill { background: var(--gold); }
.dist .track { background: var(--gold-soft); }
.review { border-top: 1px solid var(--line); padding: 16px 0; }
.review:first-child { border-top: 0; }
.review .meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.review .body { white-space: pre-wrap; margin: 8px 0; }
.review .title { font-weight: 600; }
.helpful { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.helpful:hover { border-color: var(--accent); color: var(--accent); }

form.stack { display: flex; flex-direction: column; gap: 12px; }
form.stack label { font-weight: 600; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
form.stack input, form.stack textarea, form.stack select { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
form.stack textarea { min-height: 120px; resize: vertical; }
.star-pick { display: flex; gap: 4px; }
.star-pick button { background: none; border: 0; font-size: 30px; color: var(--line); cursor: pointer; padding: 0 2px; }
.star-pick button.on { color: var(--gold); }
.tag-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-pick button { font: inherit; font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; }
.tag-pick button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.btn { font: inherit; font-weight: 600; padding: 11px 18px; border-radius: 10px; border: 0; background: var(--accent); color: #fff; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: .6; cursor: default; }
.form-msg { font-size: 14px; }
.form-msg.err { color: var(--warn); }
.form-msg.ok { color: var(--accent); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

.empty { padding: 28px; text-align: center; color: var(--ink-3); }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }

.foot { border-top: 1px solid var(--line); background: var(--card); padding: 12px 0 64px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.foot p { margin: 2px 0; }
.foot a { color: var(--ink-2); }
@media (min-width: 900px) { .foot { padding-bottom: 14px; } .foot-in { padding-right: 230px; } }
.foot .rg { color: var(--ink-3); }

/* chat (WhatsApp-style phone) */
.chat-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 8px; background: #25d366; color: #fff; border: 0; border-radius: 999px; padding: 12px 18px 12px 14px; font: 600 15px Inter, sans-serif; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; }
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 370px; height: min(640px, calc(100vh - 40px)); display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: var(--wa-bg); box-shadow: 0 0 0 8px #111, 0 18px 50px rgba(0,0,0,.35); }
.chat[hidden] { display: none; }
@media (max-width: 480px) { .chat { right: 0; bottom: 0; width: 100%; height: 100%; border-radius: 0; box-shadow: none; } .chat-fab span { display: none; } }
.chat-head { background: var(--wa-head); color: #fff; display: flex; align-items: center; gap: 10px; padding: 18px 14px 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #25d366; display: grid; place-items: center; font: 700 17px Fraunces, serif; }
.chat-name { font-weight: 600; }
.chat-sub { font-size: 12px; opacity: .8; }
.chat-x { margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 8px 11px; border-radius: 10px; font-size: 14px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere; color: var(--ink); }
.msg.bot { background: var(--wa-bot); align-self: flex-start; border-top-left-radius: 2px; }
.msg.me { background: var(--wa-me); align-self: flex-end; border-top-right-radius: 2px; }
.msg p { margin: 0 0 6px; } .msg p:last-child { margin: 0; }
.msg ul { margin: 4px 0 6px; padding-left: 18px; }
.msg .time { display: block; text-align: right; font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.typing { display: inline-flex; gap: 3px; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat-chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px 8px; }
.chat-chips button { flex: none; font: inherit; font-size: 13px; padding: 6px 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--wa-bot); color: var(--accent); cursor: pointer; }
.chat-form { display: flex; gap: 8px; padding: 8px 10px 14px; }
.chat-form input { flex: 1; font: inherit; padding: 11px 15px; border-radius: 999px; border: 0; background: var(--wa-bot); color: var(--ink); }
.chat-form input:focus { outline: 2px solid #25d366; }
.chat-form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #00a884; color: #fff; font-size: 17px; cursor: pointer; }

.chip a { color: var(--ink-3); }

.partner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.partner .btn { text-decoration: none; }

/* server-built review pages */
.review-page { max-width: 860px; margin: 0 auto; }
.review-page h1 { font-size: clamp(30px, 5vw, 44px); }
.review-page h2 { margin-top: 34px; }
.answer { font-size: 18px; line-height: 1.6; color: var(--ink); margin: 6px 0 18px; }
.facts { padding: 6px 18px; margin: 18px 0; }
.facts th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink-2); cursor: default; }
.facts td { font-size: 14px; }
.prose p { font-size: 16px; line-height: 1.65; }
.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 8px 0 2px; color: var(--ink-2); }
.offers { margin: 18px 0; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.offer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.offer:first-of-type { border-top: 0; }
.offer p { margin: 4px 0; }
.offer .btn { flex: none; text-decoration: none; }
@media (max-width: 640px) { .offer { flex-direction: column; align-items: stretch; } }

.elsewhere ul { list-style: none; margin: 0; padding: 0; }
.elsewhere li { padding: 8px 0; border-top: 1px solid var(--line); }
.elsewhere li:first-child { border-top: 0; }

.tabs { display: flex; gap: 6px; margin: 4px 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.tabs a:hover { text-decoration: none; }

/* server-built hub pages */
.hub-page { max-width: 1040px; margin: 0 auto; }
.hub-page h1 { font-size: clamp(28px, 4.5vw, 40px); }
.hub-page h2 { margin-top: 30px; }
.rank { margin: 0; padding-left: 22px; columns: 2; column-gap: 28px; }
.rank li { padding: 3px 0; break-inside: avoid; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 7px 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.az { line-height: 2.2; font-size: 17px; }
.az a, .az strong { padding: 2px 6px; }
.az sub { color: var(--ink-3); font-size: 11px; margin-right: 4px; }
@media (max-width: 640px) { .rank { columns: 1; } }

/* site lists (sister sites, partner sites) */
.sites { list-style: none; padding: 0; margin: 10px 0 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 6px; }
.sites a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); min-width: 0; }
.sites a:hover { border-color: var(--accent); text-decoration: none; }
.site-icon { flex: none; width: 24px; height: 24px; border-radius: 6px; object-fit: contain; background: #fff; }
.site-letter { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.site-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-url { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* computed key facts on brand pages */
.keyfacts { padding: 14px 18px; margin: 14px 0 18px; }
.keyfacts h2 { font-size: 17px; margin: 0 0 6px; }
.keyfacts ul { margin: 0; padding-left: 18px; }
.keyfacts li { margin: 3px 0; }
.owner-link { margin: 4px 0 22px; }
.owner-link .btn { text-decoration: none; }
