:root {
  --bg: #14161a;
  --bg-2: #1b1e23;
  --card: #20242a;
  --card-2: #272c33;
  --line: #333941;
  --text: #ece8e1;
  --muted: #9aa0a8;
  --dim: #6c727a;
  --accent: #e8a24a;
  --accent-2: #f3c27d;
  --accent-ink: #1a1206;
  --green: #6fbf8a;
  --amber: #e2b653;
  --red: #e0706a;
  --blue: #7fa8d9;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a2118 0%, transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.55 Inter, system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
code, pre { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; }
pre { background: #0f1114; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
:not(pre) > code { background: #0f1114; padding: 1px 5px; border-radius: 4px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 80px; }
.loading { color: var(--muted); padding: 60px 0; text-align: center; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 20px; background: rgba(20,22,26,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: Fraunces, serif; font-weight: 700; font-size: 20px; color: var(--text); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 22px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--card); text-decoration: none; }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.me { display: flex; align-items: center; gap: 10px; }
.me-link { color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  .nav { order: 3; flex-basis: 100%; }
  .me { margin-left: auto; }
  .me-link span.name { display: none; }
}

.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: 600 14px Inter, sans-serif; padding: 9px 16px; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--card); }
.btn.danger { background: transparent; color: var(--red); border-color: #5a3432; }
.btn.small { padding: 5px 10px; font-size: 13px; }
label { display: block; font-weight: 500; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=url], textarea, select {
  width: 100%; background: var(--bg-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font: 15px Inter, sans-serif;
}
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
textarea.mono { font-family: "JetBrains Mono", monospace; font-size: 13px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; margin-top: 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { color: var(--dim); font-size: 13px; margin-top: 4px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 8px 0 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.cols { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
a.card { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
a.card:hover { border-color: #4d545d; text-decoration: none; transform: translateY(-1px); }
.card + .card { margin-top: 12px; }
.grid .card + .card { margin-top: 0; }
.card h3 { margin-bottom: 6px; }
.card .sum { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--dim); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.empty { color: var(--dim); border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.body-text { font-size: 15px; }
.body-text p:last-child { margin-bottom: 0; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.genre { color: var(--accent-2); border-color: #5a4326; background: #2b2217; }
.chip.shared { color: #bfe3cb; border-color: #2f5a3d; background: #1b2b21; }
.chip.s-idea { color: var(--blue); }
.chip.s-building { color: var(--accent-2); }
.chip.s-testing { color: var(--amber); }
.chip.s-shipped { color: var(--green); }
.chip.s-paused { color: var(--dim); }
.chip.open { color: var(--green); }
.chip.closed { color: var(--dim); }
.chip.works { color: var(--green); border-color: #2f5a3d; }
.chip.mixed { color: var(--amber); border-color: #5a4b26; }
.chip.broken { color: var(--red); border-color: #5a3432; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button { background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font: 500 13px Inter; cursor: pointer; }
.filters button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 11px Inter; color: #111; flex: none; }
.av.lg { width: 44px; height: 44px; font-size: 16px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; margin-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 18px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.ver { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--accent-2); background: #2b2217; padding: 2px 7px; border-radius: 5px; }
details.prompt summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 8px; }
details.prompt pre { margin-top: 8px; }

.vbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--card-2); margin-top: 6px; }
.vbar span:nth-child(1) { background: var(--green); }
.vbar span:nth-child(2) { background: var(--amber); }
.vbar span:nth-child(3) { background: var(--red); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.note-grid div { background: var(--bg-2); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.note-grid b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 4px; }
.verdict-pick { display: flex; gap: 8px; }
.verdict-pick label { margin: 0; flex: 1; }
.verdict-pick input { display: none; }
.verdict-pick span { display: block; text-align: center; padding: 9px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.verdict-pick input:checked + span.w { background: #1b2b21; color: var(--green); border-color: var(--green); }
.verdict-pick input:checked + span.m { background: #2b2717; color: var(--amber); border-color: var(--amber); }
.verdict-pick input:checked + span.b { background: #2b1b1a; color: var(--red); border-color: var(--red); }

.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment .c-body { flex: 1; min-width: 0; }
.comment .c-head { font-size: 13px; color: var(--dim); margin-bottom: 2px; }
.comment .c-head b { color: var(--text); font-weight: 600; }
.reactions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.reactions button { background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 3px 9px; font-size: 13px; cursor: pointer; }
.reactions button.on { border-color: var(--accent); color: var(--text); background: #2b2217; }

.feed-item { display: flex; gap: 12px; align-items: flex-start; }
.feed-item .fi-body { flex: 1; min-width: 0; }
.feed-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: #4d545d; }
.stat b { display: block; font: 700 26px Fraunces, serif; }
.stat span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }

.auth { max-width: 420px; margin: 10vh auto 0; text-align: center; }
.auth .brand-big { font-size: 64px; line-height: 1; }
.auth h1 { font-size: 40px; margin: 10px 0 6px; }
.auth p.lead { color: var(--muted); margin-bottom: 26px; }
.auth form { text-align: left; }
.auth .card { padding: 22px; }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 16px; width: min(600px, 100%); padding: 22px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal h2 { margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--card-2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { border-color: var(--red); color: #f3c0bc; }
.back { color: var(--muted); font-size: 14px; display: inline-block; margin-bottom: 10px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plain td { padding: 10px 6px; border-top: 1px solid var(--line); word-break: break-all; }
table.plain tr:first-child td { border-top: 0; }
