:root {
  --bg: #f6f1ea;
  --surface: #fffdf9;
  --surface-2: #f0e8dd;
  --ink: #1f1b17;
  --muted: #6d6359;
  --line: #e4d9cb;
  --accent: #d9482b;
  --accent-ink: #fff;
  --accent-soft: #fbe3db;
  --teal: #1f7466;
  --teal-soft: #dcefeb;
  --gold: #b7791f;
  --li: #0a66c2;
  --ig: #c13584;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 27, 23, .06), 0 8px 24px rgba(31, 27, 23, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --surface: #1e1a16; --surface-2: #2a241e; --ink: #f3ece3; --muted: #a99d90; --line: #3a322a;
    --accent: #ef6a4c; --accent-soft: #3d2019; --teal: #5cc2ad; --teal-soft: #173430; --gold: #e0a84a;
    --li: #5aa2f0; --ig: #e46aae; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15120f; --surface: #1e1a16; --surface-2: #2a241e; --ink: #f3ece3; --muted: #a99d90; --line: #3a322a;
  --accent: #ef6a4c; --accent-soft: #3d2019; --teal: #5cc2ad; --teal-soft: #173430; --gold: #e0a84a;
  --li: #5aa2f0; --ig: #e46aae; --shadow: none; 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; }
a { color: inherit; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 52px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-family: Fraunces, serif; font-weight: 700; font-size: 20px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; }
nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
nav a:hover, nav a.active { color: var(--ink); }
main { max-width: 1160px; margin: 0 auto; padding: 28px 24px 60px; min-height: 70vh; }
.foot { max-width: 1160px; margin: 0 auto; padding: 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink) !important; border: 0; border-radius: 10px; padding: 11px 18px; font: 600 15px Inter, sans-serif; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.small { padding: 7px 13px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink) !important; border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } main { padding: 20px 16px 48px; } .top { padding: 10px 16px; } nav { gap: 12px; font-size: 14px; } }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: inline-grid; place-items: center; font-weight: 700; color: var(--muted); }
.avatar.lg { width: 112px; height: 112px; font-size: 36px; }
.avatar.md { width: 64px; height: 64px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; margin: 0 6px 6px 0; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.src { display: inline-block; align-self: flex-start; flex: none; line-height: 1.5; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 1px 7px; border-radius: 5px; color: #fff; vertical-align: 1px; }
.src.li { background: var(--li); }
.src.ig { background: var(--ig); }
.quote { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; margin-top: 6px; font-style: italic; }

/* Home */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 20px 0 36px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.mosaic { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.mosaic img, .mosaic .avatar { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 20px 0 0; }
.stat b { display: block; font-family: Fraunces, serif; font-size: 30px; }
.stat span { color: var(--muted); font-size: 13px; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s; }
.flow .card { position: relative; }
.flow .card::before { counter-increment: s; content: counter(s); position: absolute; top: 14px; right: 16px; font-family: Fraunces, serif; font-size: 28px; color: var(--line); }
@media (max-width: 820px) { .flow { grid-template-columns: 1fr 1fr; } }
section { margin: 36px 0; }

/* People */
.person { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: transform .15s; }
.person:hover { transform: translateY(-2px); }
.person .head { display: flex; gap: 12px; align-items: center; }
.person .name { font-weight: 700; }
.person .one { font-size: 13.5px; color: var(--muted); }
.badge-new { font-size: 11px; background: var(--teal); color: #fff; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }

/* Profile */
.phero { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.phero .links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.phero .links a { font-size: 13px; text-decoration: none; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; }
.readlog { list-style: none; margin: 0; padding: 0; }
.readlog li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); opacity: 0; transform: translateY(4px); animation: in .35s forwards; }
.readlog li:last-child { border: 0; }
@keyframes in { to { opacity: 1; transform: none; } }
.need { border-left: 4px solid var(--accent); }
.bars .row { display: grid; grid-template-columns: 150px 1fr 36px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13.5px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details.raw summary { cursor: pointer; font-weight: 600; }
details.raw pre { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, Menlo, monospace; background: var(--surface-2); padding: 12px; border-radius: 10px; max-height: 360px; overflow: auto; }

/* Rankings */
.rank { display: grid; grid-template-columns: 34px 40px 1fr 120px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.rank .n { font-family: Fraunces, serif; font-size: 20px; color: var(--muted); text-align: center; }
.rank .why { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank .score { text-align: right; }
.rank .score b { font-family: Fraunces, serif; font-size: 22px; }
.rank:first-of-type .n { color: var(--accent); }
@media (max-width: 620px) { .rank { grid-template-columns: 26px 32px 1fr 60px; } }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--surface-2); color: var(--muted); margin-left: 6px; white-space: nowrap; }
.tag.met { background: var(--teal-soft); color: var(--teal); }
.tag.hot { background: var(--accent-soft); color: var(--accent); }
.board { width: 100%; border-collapse: collapse; font-size: 14px; }
.board td, .board th { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.board th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.who { display: flex; gap: 8px; align-items: center; text-decoration: none; }
.tablewrap { overflow-x: auto; }
select, input[type=text], input[type=url] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }

/* Date theater */
.scene { background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 18px 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.scene .couple { display: flex; align-items: center; gap: 10px; }
.scene .heart { color: var(--accent); font-size: 20px; }
.chat { display: flex; flex-direction: column; gap: 14px; padding: 20px 0; }
.msg { display: flex; gap: 10px; max-width: 78%; animation: in .35s forwards; opacity: 0; }
.msg.right { align-self: flex-end; flex-direction: row-reverse; text-align: left; }
.bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); }
.msg.right .bubble { background: var(--accent-soft); border-color: transparent; }
.bubble .who-name { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.bubble em { color: var(--muted); }
.thought { font-size: 12.5px; color: var(--teal); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.thought::before { content: "Private thought · "; font-weight: 700; }
.hide-thoughts .thought { display: none; }
.typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 6px 2px; }
.typing.right { align-self: flex-end; }
.dots::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.vibe { font-size: 11px; margin-left: 6px; }
.verdict { font-weight: 700; text-transform: capitalize; }
.verdict.second-date { color: var(--teal); }
.verdict.pass { color: var(--accent); }
.verdict.friends { color: var(--gold); }
.controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.datecard { text-decoration: none; display: flex; flex-direction: column; gap: 10px; }
.pair { display: flex; align-items: center; gap: 6px; }
.pair .avatar + .avatar { margin-left: -12px; border: 2px solid var(--surface); }

/* Live run */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 14px; }
.step .dot { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface); }
.step.run .dot { border-color: var(--accent); color: var(--accent); animation: blink 1s infinite; }
.step.done .dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.step.err .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step .body { flex: 1; min-width: 0; }
.err { color: var(--accent); }
.note { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.tabs button { font: 600 13px Inter, sans-serif; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pipeline { font-size: 14px; }
.pipeline code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
