:root {
  --bg: #f3efe6;
  --paper: #fffaf3;
  --ink: #221c16;
  --text: #3d342c;
  --muted: #6e6258;
  --line: #e3d6c4;
  --red: #8d2e2a;
  --red-soft: #f8e8e2;
  --green: #245443;
  --green-soft: #e5f0ea;
  --mark: #f3df6a;
  --hover: #c9b49a;
  --shadow: 0 1px 0 rgba(34, 28, 22, 0.04);
  color-scheme: light;
  color: var(--ink);
  background: var(--bg);
  font-family: "Segoe UI", "Nirmala UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

html[data-theme="dark"] {
  --bg: #161311;
  --paper: #241f1b;
  --ink: #f4efe6;
  --text: #e4dbd0;
  --muted: #b3a598;
  --line: #3c332c;
  --red: #f0a097;
  --red-soft: #3c2624;
  --green: #9ed4b8;
  --green-soft: #1c3329;
  --mark: #6d5820;
  --hover: #6a5746;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 980px; padding: 28px 20px 64px; }
h1, h2, h3 { font-family: inherit; font-weight: 600; line-height: 1.35; }
h1 { margin: 0; font-size: 32px; line-height: 1.2; }
a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
code { font-family: Consolas, monospace; font-size: 0.92em; }

.top { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 22px; }
.brand { display: flex; gap: 14px; align-items: center; }
.logo { width: 54px; height: 42px; display: block; flex: none; }
.kicker { margin: 0 0 2px; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.lead { margin: 0; max-width: 360px; color: var(--muted); font-size: 14px; text-align: right; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.tabs { display: flex; gap: 6px; }
.tab {
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.theme {
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
}
.search { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.search label, .size { font-size: 13px; color: var(--muted); }
.search input, .size select {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
}
.search input { width: 100%; }
.size { display: flex; flex-direction: column; gap: 4px; }

.meta { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: var(--shadow); color: inherit; text-decoration: none;
}
.card:hover { border-color: var(--hover); }
.card-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.card h2 { margin: 2px 0 4px; font-size: 20px; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--red); }
.card h2 span { font-size: 14px; color: var(--muted); font-weight: 500; }
.desc { margin: 0; color: var(--text); }
.card .desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deps { margin: 8px 0 0; font-size: 14px; color: var(--green); }
.card mark, .step mark {
  background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px;
}

.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 16px; }
.pager button {
  min-width: 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
}
.pager button[aria-current="page"] { background: var(--red); color: white; border-color: var(--red); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.gap { border: none; background: transparent; min-width: 16px; }

.crumb { margin: 0 0 10px; font-size: 14px; }
.detail { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 8px; }
.detail h2 { margin: 0 0 8px; font-size: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { font-size: 13px; padding: 3px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--red-soft); color: var(--red); }
.block { margin: 14px 0; }
.block h3 { margin: 0 0 6px; font-size: 16px; }
.links { margin: 0; padding-left: 18px; }
.step { border-top: 1px solid var(--line); padding: 10px 0; }
.step p { margin: 4px 0; }
.talk { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--line); }
.nav-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.empty { padding: 28px 8px; color: var(--muted); }

@media (max-width: 720px) {
  .top { flex-direction: column; align-items: start; }
  .lead { text-align: left; }
}
