:root {
  --bg: #f4f0e6;
  --bg-elev: #fffdf8;
  --ink: #1c1915;
  --muted: #6f675e;
  --line: #e3dace;
  --accent: #6d28d9;
  --accent-ink: #fff;
  --mark: #efe7ff;
  --warn: #9f1239;
  --ok: #166534;
  --shadow: 0 10px 30px rgba(48, 32, 8, .05);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Manrope", "Segoe UI", sans-serif;
  --radius: 18px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12110f;
  --bg-elev: #1d1b17;
  --ink: #f4f0e6;
  --muted: #b7aea2;
  --line: #322e28;
  --accent: #d6c7ff;
  --accent-ink: #1c1915;
  --mark: #2a2438;
  --warn: #fda4af;
  --ok: #86efac;
  --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(2.2rem, 4vw, 3.6rem); margin: 0 0 .4rem; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(740px, calc(100% - 32px)); }
.skip {
  position: absolute; left: 12px; top: -40px; background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.logo { display: flex; gap: 10px; align-items: center; text-decoration: none; margin-right: auto; }
.logo strong { display: block; font-size: 1.05rem; }
.logo small { display: block; color: var(--muted); font-size: .72rem; letter-spacing: .04em; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.nav { display: flex; align-items: center; gap: 16px; }
.nav > a, .nav summary { text-decoration: none; color: var(--muted); cursor: pointer; }
.nav > a:hover, .nav summary:hover { color: var(--ink); }
.nav-details { position: relative; }
.nav-details summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.nav-details summary::-webkit-details-marker { display: none; }
.nav-details summary::after {
  content: ""; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-details[open] summary { color: var(--ink); }
.nav-details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.nav-panel {
  position: absolute; top: calc(100% + 10px); left: 0; width: 260px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow); display: grid;
}
.nav-panel a { text-decoration: none; padding: 8px 10px; border-radius: 8px; }
.nav-panel a:hover { background: var(--mark); }
.tabbar, .sheet, .sheet-backdrop { display: none; }
.search { position: relative; width: 210px; }
.search .icon { position: absolute; left: 12px; top: 11px; color: var(--muted); pointer-events: none; }
.search input, .form input, .form textarea, .form select, .filters input, .filters select, .share input {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.search input { padding-left: 36px; }
.search input:focus, .seek-field input:focus { outline: none; border-color: var(--accent); }
.search-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(420px, 72vw);
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(28, 25, 21, .12); padding: 6px; display: grid;
}
.search-pop[hidden] { display: none; }
[data-theme="dark"] .search-pop { box-shadow: none; }
.search-hit {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 8px; border-radius: 12px; text-decoration: none;
}
.search-hit:hover, .search-hit.is-on { background: var(--mark); }
.search-hit-thumb {
  width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--mark);
  display: grid; place-items: center; font-family: var(--serif); font-size: 1.2rem;
}
.search-hit-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-hit strong { display: block; font-family: var(--serif); font-size: 1rem; line-height: 1.25; }
.search-hit small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.search-hit-age { margin-left: 6px; }
.search-pop-all {
  display: block; margin: 4px 8px 6px; color: var(--accent); font-weight: 700; font-size: .9rem; text-decoration: none;
}
.seek { padding: 28px 0 56px; }
.seek-field { position: relative; display: block; }
.seek-field .icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.seek-field input {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 16px 16px 48px; font-size: 1.12rem;
}
.seek-count { margin: 12px 0 0; color: var(--muted); }
.seek-count[hidden] { display: none; }
.seek-list { display: grid; gap: 14px; margin-top: 18px; }
.seek-hint { margin: 0; color: var(--muted); }
.theme-toggle, .btn {
  border: 0; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 16px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}
.btn-small { padding: 8px 12px; }
.btn-danger { background: var(--warn); color: #fff; }
.theme-toggle { width: 40px; height: 40px; padding: 0; justify-content: center; align-items: center; background: var(--bg-elev); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.theme-toggle .when-light,
.theme-toggle .when-dark { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.theme-toggle .when-dark { display: none; }
[data-theme="dark"] .theme-toggle .when-light { display: none; }
[data-theme="dark"] .theme-toggle .when-dark { display: inline-flex; }
.icon { width: 18px; height: 18px; flex: none; display: block; }
.meta { align-items: center; }
.meta .icon, .feature-label .icon, .sidebar h2 .icon, .comments h2 .icon, .btn .icon { width: 16px; height: 16px; }
.sidebar h2, .comments h2, .feature-label, .meta span, .meta time { display: inline-flex; align-items: center; gap: 6px; }
.sidebar h2, .comments h2 { display: flex; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; padding: 36px 0 64px; }
.page-head { margin-bottom: 22px; }
.page-head p, .lead { color: var(--muted); max-width: 62ch; }
.stack { display: grid; gap: 14px; }
.card {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
}
.thumb { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--mark); }
.thumb img, .thumb-fallback { width: 100%; height: 100%; object-fit: cover; }
.thumb-fallback {
  display: grid; place-items: center; font-family: var(--serif); font-size: 2rem;
}
.card h2 { font-size: 1.35rem; margin: 0 0 6px; }
.card h2 a { text-decoration: none; }
.kicker, .meta, .hint, .muted { color: var(--muted); font-size: .92rem; }
.kicker a { color: var(--accent); text-decoration: none; }
.excerpt { margin: 8px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; }
.age { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.sidebar section { margin-bottom: 28px; }
.sidebar h2 { font-size: 1.3rem; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rank a {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "n title hits" "n meter meter";
  gap: 2px 8px; align-items: center; text-decoration: none; padding: 8px; border-radius: 12px;
}
.rank a:hover { background: var(--mark); }
.rank-n { grid-area: n; font-family: var(--serif); color: var(--muted); text-align: center; }
.rank li:nth-child(-n+3) .rank-n { color: var(--accent); }
.rank-title { grid-area: title; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-hits { grid-area: hits; color: var(--muted); font-size: .78rem; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.rank-hits .icon { width: 13px; height: 13px; }
.rank-meter { grid-area: meter; height: 3px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.rank-meter::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--heat); background: var(--accent); border-radius: inherit; }
.rank-lead { margin-bottom: 6px; }
.rank-lead a {
  background: var(--bg-elev); border: 1px solid var(--line); padding: 12px;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-areas: "n title" "n hits" "meter meter";
}
.rank-lead .rank-n { font-size: 1.7rem; align-self: start; line-height: 1; }
.rank-lead .rank-title { font-family: var(--serif); font-size: 1.12rem; -webkit-line-clamp: 3; }
.rank-lead .rank-hits { justify-self: start; }
.rank-lead .rank-meter { height: 4px; margin-top: 6px; }
.fresh { display: grid; gap: 10px; }
.fresh-card {
  position: relative; display: grid; gap: 10px; padding: 14px 14px 12px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; overflow: hidden;
}
.fresh-card:hover { border-color: var(--accent); }
.fresh-card::before {
  content: "“"; position: absolute; top: 2px; right: 12px; font-family: var(--serif);
  font-size: 2.6rem; line-height: 1; color: var(--accent); opacity: .35; pointer-events: none;
}
.fresh-quote {
  margin: 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.fresh-foot { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.fresh-label { color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fresh-title { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fresh-foot time { color: var(--muted); font-size: .78rem; }
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 22px; }
.pager a, .pager-current, .pager-step {
  min-width: 40px; height: 40px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); text-decoration: none;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager-current { background: var(--ink); color: var(--bg); border-color: transparent; font-weight: 700; }
.pager-off { color: var(--muted); opacity: .4; }
.pager-gap { min-width: 24px; text-align: center; color: var(--muted); }
.pager-prev .icon { transform: scaleX(-1); }
.story h1 { font-size: clamp(2rem, 4vw, 3.2rem); margin-top: 0; }
.story-figure { width: 100%; margin: 0 0 14px; }
.story-figure img, .story-placeholder {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: center; border-radius: 22px;
}
.prose { font-family: var(--serif); font-size: 1.16rem; line-height: 1.7; }
.prose p { margin: 0 0 1em; }
.prose strong, .prose b { font-weight: 700; }
.prose em, .prose i { font-style: italic; }
.prose blockquote { margin: 0 0 1em; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.3em; }
.prose li { margin: .2em 0; }
.prose li p { margin: 0; }
.page-copy { padding: 36px 0 64px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { text-decoration: none; background: var(--mark); border-radius: 999px; padding: 4px 10px; }
.like-form button {
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: 999px; padding: 10px 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.like-form button.is-on { background: var(--mark); border-color: transparent; }
.like-form button.is-on .icon { fill: currentColor; }
.feature {
  margin: 0 0 28px; border-radius: 28px; overflow: hidden;
  background:
    radial-gradient(90% 80% at 100% 0%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%),
    var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.feature-label { font-weight: 700; color: var(--accent); letter-spacing: .01em; }
.feature-link {
  display: grid; grid-template-columns: minmax(168px, 232px) minmax(0, 1fr);
  gap: 18px; text-decoration: none; align-items: center; padding: 14px;
}
.feature .thumb { min-width: 0; width: 100%; align-self: start; }
.feature .thumb img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.feature-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 6px 8px 6px 0; }
.feature-link strong { display: block; font-family: var(--serif); font-size: clamp(1.7rem, 2.5vw, 2.3rem); line-height: 1.12; margin: 8px 0 6px; }
.feature .excerpt { color: var(--muted); margin: 8px 0 0; }
.feature .meta { margin-top: 12px; }
.feature-cta {
  margin-top: 16px; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--bg); border-radius: 999px; padding: 9px 14px; font-weight: 700;
}
.feature-link:hover strong { color: var(--accent); }
.feature-link:hover .feature-cta { background: var(--accent); color: var(--accent-ink); }
.feature .thumb { border-radius: 18px; }
.feature-compact {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 0 0 18px; margin: 0;
}
.feature-compact .feature-link { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 0; align-items: center; }
.feature-compact .feature-copy { padding: 0; }
.feature-compact .feature-link strong { font-size: 1.02rem; margin: 4px 0; }
.feature-compact .meta { margin-top: 6px; font-size: .82rem; }
.story-placeholder {
  display: grid; place-items: center; background: var(--mark); border: 1px dashed var(--line); color: var(--muted);
}
.story-placeholder .icon { width: 56px; height: 56px; }
.story-figure figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.share { display: grid; gap: 10px; margin: 8px 0 4px; }
.share-label { margin: 0; font-weight: 700; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg-elev);
  color: inherit; border-radius: 999px; padding: 8px 12px; text-decoration: none; cursor: pointer;
}
.share-btn[hidden] { display: none; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-glyph { width: 18px; text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: -.03em; }
.share-link { color: var(--muted); font-size: .85rem; }
.share input {
  border: 0; background: transparent; padding: 0; color: var(--muted); font-size: .92rem;
}
.neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 8px; }
.neighbor {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; text-decoration: none;
  padding: 14px 16px; border-radius: 16px; background: var(--bg-elev); border: 1px solid var(--line);
}
.neighbor:hover { border-color: var(--accent); }
.neighbor-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-size: .78rem; font-weight: 700; }
.neighbor-prev .icon { transform: scaleX(-1); }
.neighbor-title {
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.neighbor-next { grid-column: 2; align-items: flex-end; text-align: right; }
.comments { margin-top: 10px; }
.comments-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.7em; margin-left: 8px;
  padding: 0 8px; border-radius: 999px; background: var(--mark); color: var(--accent);
  font-family: var(--sans); font-size: .85rem; font-weight: 700; vertical-align: 4px;
}
.thread-list { display: grid; gap: 12px; margin: 16px 0 22px; }
.thread {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  scroll-margin-top: 88px;
}
.thread:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--mark); }
.comment-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: hsl(var(--hue), 42%, 90%); color: hsl(var(--hue), 35%, 28%);
}
[data-theme="dark"] .comment-avatar { background: hsl(var(--hue), 24%, 24%); color: hsl(var(--hue), 55%, 84%); }
.comment-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.comment-head strong { font-size: .95rem; }
.comment-head time { color: var(--muted); font-size: .8rem; }
.comment-text { margin: 4px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-reply, .composer-reply button, .emoji-toggle {
  border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; font-weight: 700; font-size: .88rem;
}
.emoji-toggle { height: auto; padding: 6px 10px; border-radius: 10px; line-height: 1.2; }
.emoji-toggle:hover, .emoji-toggle[aria-expanded="true"] { background: var(--mark); }
.replies { display: grid; gap: 12px; margin-top: 12px; margin-left: 52px; padding-left: 12px; border-left: 2px solid var(--line); }
.thread.is-reply { background: transparent; border: 0; border-radius: 12px; padding: 0; box-shadow: none; }
.thread.is-reply:target { background: var(--mark); padding: 8px; }
.composer { display: grid; gap: 8px; }
.composer-reply { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); font-size: .9rem; }
.composer-reply[hidden], .emoji-panel[hidden] { display: none; }
.composer-box { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px 8px; }
.composer-box:focus-within { border-color: var(--accent); }
.composer-box textarea { width: 100%; border: 0; outline: none; resize: vertical; min-height: 96px; padding: 4px 2px; background: transparent; }
.composer-bar { display: flex; align-items: center; gap: 10px; }
.composer-count { margin-left: auto; color: var(--muted); font-size: .8rem; }
.emoji-panel { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; padding: 4px 0 8px; }
.emoji-panel button { border: 0; background: transparent; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 6px; border-radius: 10px; }
.emoji-panel button:hover { background: var(--mark); }
.comment-slot:not(:empty) { margin-top: 10px; }
.comment { border-top: 1px solid var(--line); padding: 14px 0; }
.comment.is-new { background: var(--mark); border-radius: 12px; padding: 14px; }
.editor-page { padding: 28px 0 48px; }
.editor { display: grid; gap: 14px; }
.editor-sheet { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 14px; }
.editor-title, .editor-text, .editor-tags { width: 100%; border: 0; background: transparent; outline: none; }
.editor-title {
  display: block; resize: none; overflow: hidden; field-sizing: content;
  font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; padding: 4px 2px 8px;
}
.editor-title::placeholder, .editor-text::placeholder, .editor-tags::placeholder { color: var(--muted); }
.editor-text {
  display: block; resize: none; overflow: hidden; min-height: 280px; padding: 14px 2px 8px;
  border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.12rem; line-height: 1.7;
}
.editor-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.write-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: .92rem; }
.write-notes li { position: relative; padding-left: 16px; }
.write-notes li::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.editor-bar .is-short { color: var(--warn); font-weight: 700; }
.editor-extra { display: grid; gap: 16px; }
.editor-section { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.editor-label { font-weight: 700; font-size: .95rem; }
.tag-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick {
  border: 1px solid var(--line); background: var(--bg); color: inherit; border-radius: 999px;
  padding: 8px 12px; cursor: pointer; font: inherit;
}
.tag-pick:hover { border-color: var(--accent); }
.tag-pick.is-on { background: var(--ink); color: var(--bg); border-color: transparent; }
.tag-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.editor-tags { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.pill input:checked + span { background: var(--ink); color: var(--bg); border-color: transparent; }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.age-line { display: flex; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.editor-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.editor-clear { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; padding: 8px 0; }
.form { display: grid; gap: 8px; margin: 18px 0 28px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; }
.check-line { display: flex; gap: 8px; align-items: center; }
.hp { position: absolute; left: -9999px; }
.flash { border-radius: 12px; padding: 12px 14px; background: var(--mark); }
.flash-bad { background: color-mix(in srgb, var(--warn) 16%, var(--bg-elev)); }
.flash-ok { background: color-mix(in srgb, var(--ok) 16%, var(--bg-elev)); }
.empty { padding: 24px; border: 1px dashed var(--line); border-radius: 16px; }
.crumbs { display: flex; gap: 8px; color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-row nav { display: flex; gap: 14px; }
.footer-row a { color: var(--muted); }
.admin-body { background: var(--bg); }
.admin-main { padding: 28px 0 60px; }
.admin-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.stats a { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-decoration: none; display: grid; }
.stats strong { font-family: var(--serif); font-size: 2rem; }
.inbox { display: grid; gap: 16px; }
.inbox-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.inbox-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.inbox-tabs a { text-decoration: none; border: 1px solid var(--line); background: var(--bg-elev); border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: .92rem; }
.inbox-tabs a.is-on { background: var(--ink); color: var(--bg); border-color: transparent; }
.inbox-tabs b { font-weight: 700; margin-left: 4px; }
.inbox-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; min-width: min(100%, 240px); max-width: 360px; }
.inbox-search button { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); padding: 0; cursor: pointer; display: flex; }
.inbox-search input { flex: 1; min-width: 0; width: auto; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 36px; }
.inbox-search a { color: var(--muted); font-weight: 700; font-size: .88rem; text-decoration: none; white-space: nowrap; }
.queue { display: grid; gap: 10px; }
.queue-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.queue-row:hover { border-color: var(--accent); }
.queue-main { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; text-decoration: none; color: inherit; }
.queue-thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; background: var(--mark); display: grid; place-items: center; }
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }
.queue-thumb span { font-family: var(--serif); font-size: 1.7rem; color: var(--accent); }
.queue-copy { display: grid; gap: 4px; min-width: 0; }
.queue-title { font-size: 1.05rem; line-height: 1.3; }
.queue-excerpt { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.queue-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: .8rem; }
.queue-meta span { display: inline-flex; align-items: center; gap: 4px; }
.queue-meta .icon { width: 14px; height: 14px; }
.queue-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.queue-open { color: var(--accent); font-weight: 700; text-decoration: none; font-size: .9rem; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-live { background: color-mix(in srgb, var(--ok) 18%, var(--bg-elev)); color: var(--ok); }
.badge-wait { background: var(--mark); color: var(--accent); }
.mod-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.mod-parent { margin: 0 0 8px; padding-left: 12px; border-left: 2px solid var(--line); color: var(--muted); font-size: .9rem; }
.mod-parent span { margin-left: 6px; color: var(--accent); font-weight: 700; font-size: .75rem; }
.mod-story { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); text-decoration: none; }
.mod-story small { color: var(--accent); font-weight: 700; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
.mod-story span { color: var(--ink); font-weight: 700; line-height: 1.35; }
.mod-gone { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.mod-side { display: grid; justify-items: end; gap: 10px; align-content: start; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.mod-actions form { display: flex; }
.mod-delete { border: 0; background: transparent; color: var(--warn); font-weight: 700; cursor: pointer; padding: 8px 2px; }
.admin-head, .filters { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-preview { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; display: block; }
.desk { display: grid; gap: 16px; }
.desk-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.desk-head h1 { font-size: 1.7rem; margin: 0; }
.desk-kicker { margin: 0 0 4px; }
.desk-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.desk-sheet, .desk-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 22px; }
.desk-sheet { padding: 22px 22px 18px; display: grid; gap: 14px; min-width: 0; }
.desk-title { display: block; width: 100%; min-width: 0; resize: none; overflow: hidden; field-sizing: content; border: 0; background: transparent; outline: none; font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; padding: 0; }
.desk-title::placeholder { color: var(--muted); }
.desk-slug { display: flex; flex-wrap: wrap; align-items: baseline; color: var(--muted); font-size: .92rem; }
.desk-slug input { flex: 0 1 auto; width: auto; min-width: 8ch; max-width: 100%; field-sizing: content; border: 0; background: transparent; outline: none; color: var(--ink); padding: 0; }
.rte { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); border-radius: 17px 17px 0 0; background: var(--bg-elev); position: sticky; top: 73px; z-index: 15; }
.rte-bar button { border: 0; background: transparent; color: var(--ink); border-radius: 10px; padding: 6px 10px; cursor: pointer; font-weight: 700; font-size: .88rem; }
.rte-bar button:hover, .rte-bar button.is-on { background: var(--mark); }
.rte-count { margin-left: auto; color: var(--muted); font-size: .8rem; font-weight: 600; }
.rte-body { min-height: 360px; padding: 16px 18px 24px; outline: none; }
.rte-body[data-empty="1"]:not(:focus)::before { content: attr(data-placeholder); color: var(--muted); }
.desk-side { display: grid; gap: 12px; align-content: start; }
.desk-card { padding: 14px 16px 16px; display: grid; gap: 12px; border-radius: 20px; }
.desk-card h2 { margin: 0; font-size: 1.05rem; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch + .switch { padding-top: 12px; border-top: 1px solid var(--line); }
.switch strong { display: block; font-size: .95rem; }
.switch small { display: block; color: var(--muted); font-size: .8rem; font-weight: 500; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.desk-input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.desk-file { display: grid; gap: 2px; background: var(--bg); border: 1px dashed var(--line); border-radius: 14px; padding: 14px; cursor: pointer; }
.desk-file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.desk-file span { font-weight: 700; }
.desk-file small, .desk-card .hint { color: var(--muted); font-size: .82rem; }
.desk-save { width: 100%; justify-content: center; }
.desk-delete { border: 0; background: transparent; color: var(--warn); font-weight: 700; cursor: pointer; padding: 4px 0; text-align: left; }
.flash[hidden] { display: none; }
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cat-row { display: grid; gap: 10px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.cat-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cat-name { display: block; font-size: 1.08rem; line-height: 1.3; }
.cat-address { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.cat-side { display: grid; justify-items: end; gap: 6px; }
.cat-desc { margin: 0; color: var(--muted); font-size: .92rem; }
.cat-edit { border-top: 1px solid var(--line); padding-top: 10px; }
.cat-edit summary { cursor: pointer; font-weight: 700; color: var(--accent); list-style: none; }
.cat-edit summary::-webkit-details-marker { display: none; }
.cat-fields, .cat-new { display: grid; gap: 10px; }
.cat-fields { margin-top: 12px; }
.cat-fields label, .cat-new label { display: grid; gap: 4px; font-weight: 700; font-size: .88rem; }
.cat-fields textarea, .cat-new textarea { min-height: 88px; resize: vertical; }
.cat-new { position: sticky; top: 88px; align-content: start; }
.cat-new h2 { margin: 0; }
@media (max-width: 880px) {
  .layout, .stats, .checks, .neighbors, .card, .feature-link, .desk-grid, .queue-row, .mod-row, .cat-layout { grid-template-columns: 1fr; }
  .cat-new { order: -1; position: static; }
  .cat-side { justify-items: start; }
  .queue-actions, .mod-actions { flex-direction: row; align-items: center; justify-content: flex-start; }
  .mod-side { justify-items: start; }
  .story-figure { width: calc(100% + 32px); margin-left: -16px; margin-right: -16px; }
  .story-figure img, .story-placeholder { aspect-ratio: 4 / 5; border-radius: 0 0 22px 22px; }
  .story-figure figcaption { padding: 0 16px; }
  .neighbor-next { grid-column: auto; align-items: flex-start; text-align: left; }
  .feature-compact .feature-link { grid-template-columns: 72px minmax(0, 1fr); }
  .feature-copy { padding: 0 4px 8px; }
  .feature-compact .feature-copy { padding: 0; }
  body:not(.admin-body) { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body:not(.admin-body) .header-row { flex-wrap: nowrap; min-height: 56px; }
  body:not(.admin-body) .header-row > .nav,
  body:not(.admin-body) .header-row > .search,
  body:not(.admin-body) .header-row > .btn { display: none; }
  .search { display: none; }
  .admin-body .header-row { flex-wrap: wrap; row-gap: 8px; }
  .admin-body .header-row > form { margin-left: auto; }
  .admin-body .nav { display: flex; position: static; width: 100%; order: 3; padding: 0; border: 0; background: transparent; flex-direction: row; }
  .rte-bar { position: static; }
  .replies { margin-left: 12px; }
  .emoji-panel { grid-template-columns: repeat(8, 1fr); }
  .admin-nav { display: flex; }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 32;
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 48px; border: 0; background: transparent; color: var(--muted);
    text-decoration: none; font-size: .68rem; font-weight: 700; cursor: pointer; border-radius: 12px;
  }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar .is-on { color: var(--accent); }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: color-mix(in srgb, #000 45%, transparent); }
  .sheet-backdrop[hidden] { display: none; }
  .sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 31;
    max-height: min(70vh, 520px); overflow: auto; background: var(--bg-elev);
    border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 8px 8px 12px;
  }
  .sheet[hidden] { display: none; }
  .sheet-title { margin: 10px 14px 6px; font-weight: 700; }
  .sheet-list a { display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none; }
  .sheet-list a:hover, .sheet-list a[aria-current="page"] { background: var(--mark); color: var(--accent); }
}
