:root {
  --bg: #0c0c0c;
  --surface: #141414;
  --surface-2: #1c1c1c;
  --border: #222;
  --border-2: #2e2e2e;
  --text: #ddd8cf;
  --text-muted: #6a6358;
  --text-dim: #50493f;
  --accent: #c03b28;
  --accent-h: #d04530;
  --accent-bg: rgba(192,59,40,0.12);
  --green: #3d7a50;
  --green-t: #6ab87c;
  --green-bg: rgba(61,122,80,0.14);
  --yellow: #806418;
  --yellow-t: #c4a838;
  --yellow-bg: rgba(128,100,24,0.14);
  --red: #8c3535;
  --red-t: #c45050;
  --red-bg: rgba(140,53,53,0.14);
  --font: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;
  --r: 3px;
  --w: 760px;
  --nav-h: 54px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font); }

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
}
.nav-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 18px;
  flex: 1;
}
.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-verdict {
  flex: 1;
  justify-content: center;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-survived { background: var(--green-bg); color: var(--green-t); border: 1px solid var(--green); }
.btn-survived:hover { background: rgba(61,122,80,0.24); }
.btn-modified { background: var(--yellow-bg); color: var(--yellow-t); border: 1px solid var(--yellow); }
.btn-modified:hover { background: rgba(128,100,24,0.24); }
.btn-abandoned { background: var(--red-bg); color: var(--red-t); border: 1px solid var(--red); }
.btn-abandoned:hover { background: rgba(140,53,53,0.24); }
.btn:disabled { opacity: 0.28; cursor: not-allowed; pointer-events: none; }

/* ── Badges ── */
.badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 2px;
}
.badge-dim { background: var(--surface-2); color: var(--text-muted); }
.badge-green { background: var(--green-bg); color: var(--green-t); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow-t); }
.badge-red { background: var(--red-bg); color: var(--red-t); }

/* ── Layout ── */
.main {
  max-width: var(--w);
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.main-wide {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

/* ── Empty state ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 88px 24px;
  gap: 14px;
}
.empty-icon { font-size: 36px; margin-bottom: 4px; }
.empty-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  max-width: 460px;
}
.empty-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.65;
}

/* ── Entry list ── */
.entries-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
}
.entries-header h1 { font-size: 20px; font-weight: 600; }
.entries-count { font-size: 13px; color: var(--text-muted); }
.entries-grid { display: flex; flex-direction: column; gap: 2px; }
.entry-card {
  display: block;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.entry-card:hover { background: var(--surface-2); border-color: var(--border-2); }
.entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.entry-date { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.entry-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.4; }
.entry-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.entry-footer { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* ── Write ── */
.write-container {
  max-width: 620px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
.write-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.write-title-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 22px;
  padding: 6px 0 12px;
  margin-bottom: 32px;
  outline: none;
  transition: border-color 0.15s;
}
.write-title-input:focus { border-bottom-color: var(--accent); }
.write-title-input::placeholder { color: var(--text-dim); }
.write-body-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.85;
  resize: none;
  outline: none;
  min-height: 260px;
  display: block;
}
.write-body-input::placeholder { color: var(--text-dim); }
.write-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.write-hint { font-size: 12px; color: var(--text-dim); font-style: italic; }
.char-count { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }

/* ── Review ── */
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.review-entry {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}
.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.review-entry-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.4;
}
.review-entry-body {
  font-size: 14px;
  line-height: 1.85;
  color: #b0a89f;
  white-space: pre-wrap;
  word-break: break-word;
}
.review-entry-meta {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.review-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Challenges ── */
.challenges-list { display: flex; flex-direction: column; gap: 16px; }
.challenge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  padding: 18px 18px 14px;
  opacity: 0;
  transform: translateY(6px);
  animation: fadeUp 0.3s ease forwards;
}
.challenge-card:nth-child(1) { animation-delay: 0.04s; }
.challenge-card:nth-child(2) { animation-delay: 0.12s; }
.challenge-card:nth-child(3) { animation-delay: 0.20s; }
.challenge-card:nth-child(4) { animation-delay: 0.28s; }
.challenge-card:nth-child(5) { animation-delay: 0.36s; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.challenge-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}
.challenge-icon { font-size: 13px; }
.challenge-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e0705c;
}
.challenge-question {
  font-size: 13px;
  color: #c0b8af;
  line-height: 1.75;
  margin-bottom: 12px;
  font-style: italic;
}
.challenge-response {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.65;
  padding: 9px 11px;
  resize: none;
  min-height: 68px;
  outline: none;
  transition: border-color 0.15s;
  display: block;
}
.challenge-response:focus { border-color: var(--border-2); }
.challenge-response::placeholder { color: var(--text-dim); }
.challenge-response:disabled { opacity: 0.65; cursor: default; resize: none; }

/* ── Verdict ── */
.verdict-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.verdict-prompt {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-align: center;
}
.verdict-buttons { display: flex; gap: 8px; }
.verdict-result {
  text-align: center;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
}
.verdict-result-label { font-size: 11px; color: var(--text-muted); margin-bottom: 7px; }
.verdict-result-value { font-size: 18px; font-weight: 600; }

/* ── Insights ── */
.page-header { margin-bottom: 32px; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 5px; }
.page-sub { font-size: 13px; color: var(--text-muted); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 44px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
}
.stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 5px;
}
.stat-label { font-size: 12px; color: var(--text-muted); }

.insights-section { margin-bottom: 44px; }
.insights-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}
.timeline-row:hover { opacity: 0.7; }
.t-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-null { background: var(--text-dim); }
.dot-survived { background: var(--green-t); }
.dot-modified { background: var(--yellow-t); }
.dot-abandoned { background: var(--red-t); }
.t-date { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); width: 72px; flex-shrink: 0; }
.t-title { font-size: 13px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.t-badge { flex-shrink: 0; }

.type-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.type-name { font-size: 12px; width: 100px; flex-shrink: 0; color: var(--text-muted); }
.type-track { flex: 1; height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.type-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }
.type-count { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); width: 20px; text-align: right; }

/* ── Misc ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

@media (max-width: 700px) {
  .review-grid { grid-template-columns: 1fr; }
  .review-entry { position: static; }
  .verdict-buttons { flex-direction: column; }
  .main, .main-wide { padding: 28px 16px 64px; }
  .write-container { padding: 28px 16px 64px; }
  .nav { padding: 0 16px; }
}
