/* omnicoder community */
:root {
  --bg: #f5f7f7; --panel: #fff; --panel-2: #f9fbfb; --ink: #0b1220; --ink-2: #273141; --muted: #5d6877;
  --line: #e3e8eb; --line-2: #eef2f4; --brand: #0f766e; --brand-ink: #0b5a54; --brand-2: #14b8a6; --mint: #5eead4;
  --tint: #ecfaf6; --danger: #c2410c; --warn-bg: #fff7ed; --code-bg: #0b1418; --code-ink: #d7e3e8;
  --k-discussion: #0f766e; --k-question: #be123c; --k-show: #b45309; --k-news: #2563eb;
  --shadow: 0 1px 2px rgb(11 18 32 / .05), 0 4px 16px rgb(11 18 32 / .04);
  --radius: 12px; --radius-s: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081013; --panel: #0e191d; --panel-2: #111f24; --ink: #e5eef0; --ink-2: #c3d0d4; --muted: #8b9ca4;
    --line: #1c2c32; --line-2: #16252a; --brand: #2dd4bf; --brand-ink: #5eead4; --brand-2: #14b8a6; --tint: #0d2a29;
    --warn-bg: #2a1a0e; --code-bg: #050b0d; --shadow: none; color-scheme: dark;
    --k-discussion: #2dd4bf; --k-question: #fb7185; --k-show: #f59e0b; --k-news: #60a5fa;
  }
}
:root[data-theme="dark"] {
  --bg: #081013; --panel: #0e191d; --panel-2: #111f24; --ink: #e5eef0; --ink-2: #c3d0d4; --muted: #8b9ca4;
  --line: #1c2c32; --line-2: #16252a; --brand: #2dd4bf; --brand-ink: #5eead4; --brand-2: #14b8a6; --tint: #0d2a29;
  --warn-bg: #2a1a0e; --code-bg: #050b0d; --shadow: none; color-scheme: dark;
  --k-discussion: #2dd4bf; --k-question: #fb7185; --k-show: #f59e0b; --k-news: #60a5fa;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
main.wrap { flex: 1; width: 100%; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.dot { color: var(--muted); opacity: .6; margin: 0 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #04201d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #04201d; } }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; stroke-width: 2.2; }
.btn[disabled] { opacity: .55; cursor: progress; }
.link { color: var(--brand); font-weight: 600; font-size: 14px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.icon-btn svg { width: 18px; height: 18px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--panel) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand-name { font: 700 18px/1 var(--mono); letter-spacing: -.02em; }
.brand-by { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 7px; }
.mainnav { display: flex; gap: 2px; }
.mainnav a { padding: 7px 11px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 14px; }
.mainnav a:hover { background: var(--line-2); color: var(--ink); }
.mainnav a[aria-current] { color: var(--brand); background: var(--tint); }
.search { flex: 1; max-width: 380px; margin-left: auto; position: relative; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; color: var(--muted); width: 16px; height: 16px; }
.search input { width: 100%; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 0 34px; font: 14px var(--font); }
.search input:focus { outline: none; border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search kbd { position: absolute; right: 9px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; line-height: 18px; }
.actions { display: flex; align-items: center; gap: 8px; }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; border-radius: 99px; display: block; }
.account summary::-webkit-details-marker { display: none; }
.account .menu { position: absolute; right: 0; top: 44px; width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgb(0 0 0 / .14); padding: 6px; }
.account .menu a, .account .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; border: 0; background: none; color: var(--ink); font: 14px var(--font); cursor: pointer; }
.account .menu a:hover, .account .menu button:hover { background: var(--line-2); }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.menu-head span { color: var(--muted); font-size: 13px; }

/* avatars, people */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; flex: none; }
.avatar-letter { display: inline-grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, hsl(var(--h) 62% 48%), hsl(calc(var(--h) + 40) 62% 38%)); }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); }
.who:hover .who-name { color: var(--brand); }
.role-badge, .op-badge { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--tint); color: var(--brand-ink); margin-left: 4px; }
.op-badge { background: color-mix(in srgb, var(--k-news) 12%, transparent); color: var(--k-news); }

/* hero */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; margin: 26px 0 8px; padding: 34px 36px; border-radius: 18px;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 55%), var(--panel); border: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--brand); }
.hero h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.2; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 34em; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-code { margin: 0; background: var(--code-bg); border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px rgb(4 18 20 / .25); border: 1px solid #13252b; }
.hero-code figcaption { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #7f959c; font: 12px var(--mono); border-bottom: 1px solid #13252b; }
.dots { display: inline-flex; gap: 5px; } .dots i { width: 9px; height: 9px; border-radius: 50%; background: #23363c; display: block; }
.hero-code pre { margin: 0; padding: 16px 18px; color: var(--code-ink); font-size: 12.5px; line-height: 1.7; overflow-x: auto; }
.hero-code .c { color: #6b8a8f; } .hero-code .s { color: var(--mint); }

/* layout */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 24px; margin: 24px 0 48px; align-items: start; }
.layout-topic { grid-template-columns: minmax(0, 1fr) 300px; }
.rail { position: sticky; top: 84px; display: grid; gap: 16px; }
.rail-left nav { display: grid; gap: 1px; }
.rail-left h4 { margin: 14px 10px 6px; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rail-left a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.rail-left a:hover { background: var(--line-2); color: var(--ink); }
.rail-left a[aria-current] { background: var(--tint); color: var(--brand); font-weight: 600; }
.rail-left svg { width: 17px; height: 17px; }
.rail-kinds a { gap: 8px; } .rail-kinds .kind { min-width: 34px; text-align: center; }
.rail-tags i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); display: block; }
.rail-tags a span { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-tags .more { color: var(--brand); font-size: 13px; }
.feed { min-width: 0; }
.feed.solo { max-width: none; margin-bottom: 48px; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.feed-title { margin: 0; font-size: 20px; letter-spacing: -.01em; }

/* tabs */
.tabs { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs a { padding: 5px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { background: var(--ink); color: var(--panel); }
.tabs-line { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; margin: 18px 0 12px; }
.tabs-line a { border-radius: 0; padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-line a[aria-current] { background: none; color: var(--brand); border-color: var(--brand); }

/* topic list */
.topic-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.topic-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 58px; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); align-items: start; }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: var(--panel-2); }
.tr-title { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tr-title > a { color: var(--ink); }
.tr-title > a:hover { color: var(--brand); }
.tr-title > a:visited { color: color-mix(in srgb, var(--ink) 72%, var(--muted)); }
.domain { font-size: 12px; color: var(--muted); font-weight: 400; font-family: var(--mono); }
.tr-excerpt { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-meta { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; color: var(--muted); }
.tr-meta .who { font-weight: 500; font-size: 13px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.chip { font-size: 12px; padding: 1px 7px; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); font-weight: 500; }
.chip:hover { color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.tr-replies { display: grid; justify-items: center; align-content: center; height: 44px; border-radius: 9px; color: var(--muted); font-size: 11px; line-height: 1.1; }
.tr-replies b { font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tr-replies.is-hot b { color: var(--danger); }
.tr-replies:hover { background: var(--tint); }
.kind { display: inline-block; font: 600 11px/18px var(--font); padding: 0 6px; border-radius: 5px; color: var(--kc); background: color-mix(in srgb, var(--kc) 11%, transparent); white-space: nowrap; vertical-align: 2px; }
.k-discussion { --kc: var(--k-discussion); } .k-question { --kc: var(--k-question); } .k-show { --kc: var(--k-show); } .k-news { --kc: var(--k-news); }
.flag { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.flag svg { width: 13px; height: 13px; }
.flag-pin { color: var(--brand); }
.flag-solved { color: #15803d; background: color-mix(in srgb, #16a34a 12%, transparent); padding: 0 6px; border-radius: 5px; line-height: 18px; }

/* votes */
.vote { display: grid; justify-items: center; gap: 2px; align-content: start; }
.vote button { width: 34px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); cursor: pointer; }
.vote button svg { width: 18px; height: 18px; stroke-width: 2.4; }
.vote button:hover:not([disabled]) { color: var(--brand); border-color: var(--brand); }
.vote .v-up.is-on { color: #fff; background: var(--brand); border-color: var(--brand); }
.vote .v-down.is-on { color: #fff; background: var(--danger); border-color: var(--danger); }
.vote button[disabled] { opacity: .45; cursor: default; }
.v-score { font-size: 15px; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: center; }
.vote-compact { gap: 0; } .vote-compact button { height: 26px; border: 0; background: none; } .vote-compact .v-score { font-size: 14px; color: var(--ink-2); }
.vote-compact .v-up.is-on { background: var(--tint); color: var(--brand); }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 10px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 14px 10px; text-align: center; }
.stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.dev-card { background: linear-gradient(160deg, var(--tint), var(--panel) 60%); }
.dev-card h3 { font-size: 16px; margin-bottom: 12px; }
.dev-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.dev-list li { display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.dev-list b { color: var(--ink); font-size: 13.5px; }
.dev-list code { font-size: 12px; background: var(--line-2); padding: 0 4px; border-radius: 4px; }
.dev-links { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.leaders { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: l; }
.leaders li { display: flex; align-items: center; gap: 8px; font-size: 13px; counter-increment: l; }
.leaders li::before { content: counter(l); width: 18px; color: var(--muted); font: 600 12px var(--mono); }
.leaders b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--brand); }
.related { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.related li { display: grid; font-size: 13.5px; line-height: 1.45; }
.related span { font-size: 12px; color: var(--muted); }
.author-top { display: flex; gap: 12px; align-items: center; }
.author-top span { display: grid; } .author-top small { color: var(--muted); }

/* topic page */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.topic { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 26px 16px; box-shadow: var(--shadow); }
.topic-head { padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.topic-badges { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.topic-head h1 { margin: 0 0 12px; font-size: 27px; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: anywhere; }
.topic-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13.5px; color: var(--muted); }
.topic-head .chips { margin: 12px 0 0; }
.post-grid { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 18px; }
.post-main { min-width: 0; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 14px; }
.act { border: 0; background: none; color: var(--muted); font: 500 13px var(--font); padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.act:hover { color: var(--brand); background: var(--line-2); }
.act-danger:hover { color: var(--danger); }
.act-accept { color: #15803d; }
.mod-tools { display: inline-flex; gap: 2px; margin-left: auto; padding-left: 8px; border-left: 1px solid var(--line); }
.link-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); margin-bottom: 16px; }
.link-card svg { width: 20px; height: 20px; color: var(--brand); }
.link-card span { display: grid; min-width: 0; } .link-card small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; }

.replies { margin-top: 22px; }
.replies > h2 { font-size: 17px; margin: 0 0 12px; }
.reply { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 10px; margin-bottom: 10px; scroll-margin-top: 80px; }
.reply:target { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.reply.is-accepted { border-color: #16a34a; background: linear-gradient(180deg, color-mix(in srgb, #16a34a 6%, var(--panel)), var(--panel) 120px); }
.reply.is-deleted { opacity: .6; }
.reply-main { min-width: 0; }
.reply-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.reply-head .floor { margin-left: auto; font: 600 12px var(--mono); color: var(--muted); }
.reply-to { font-size: 12px; color: var(--brand); background: var(--tint); padding: 0 6px; border-radius: 5px; margin-left: 4px; }
.accepted-badge { color: #15803d; font-weight: 700; font-size: 12px; margin-left: 4px; }
.reply .vote button { width: 30px; height: 26px; }
.empty-replies { padding: 8px 2px; }

/* prose */
.prose { font-size: 15.5px; line-height: 1.75; overflow-wrap: anywhere; color: var(--ink-2); }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 .9em; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.35; margin: 1.4em 0 .5em; }
.prose h2 { font-size: 1.3em; } .prose h3 { font-size: 1.15em; } .prose h4 { font-size: 1.02em; }
.prose a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; }
.prose a.mention { text-decoration: none; font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 .9em; }
.prose blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--brand-2); color: var(--muted); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.prose :not(pre) > code { font-size: .86em; background: var(--line-2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; }
.code { margin: 0 0 1em; border-radius: 10px; overflow: hidden; background: var(--code-bg); border: 1px solid #13252b; }
.code figcaption { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; font: 12px var(--mono); color: #7f959c; border-bottom: 1px solid #13252b; }
.code .copy { border: 1px solid #23363c; background: none; color: #a3b8bf; font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.code .copy:hover { color: #fff; border-color: var(--brand-2); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--code-ink); font-size: 13px; line-height: 1.65; }

/* composer, editor, forms */
.composer-wrap { margin-top: 18px; }
.composer, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.composer-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.reply-target { background: var(--tint); color: var(--brand); padding: 1px 8px; border-radius: 6px; cursor: pointer; }
.composer-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); }
.hint code { font-size: 11px; background: var(--line-2); padding: 0 4px; border-radius: 4px; }
.editor { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); overflow: hidden; }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--panel); }
.editor-bar [role=tab] { border: 0; background: none; font: 500 13px var(--font); color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.editor-bar [role=tab][aria-selected=true] { background: var(--line-2); color: var(--ink); }
.editor-tools { margin-left: auto; display: flex; gap: 1px; }
.editor-tools button { border: 0; background: none; color: var(--muted); min-width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font: 12px var(--mono); }
.editor-tools button:hover { background: var(--line-2); color: var(--ink); }
.editor textarea { display: block; width: 100%; border: 0; background: transparent; color: var(--ink); padding: 12px 14px; font: 14px/1.65 var(--mono); resize: vertical; min-height: 120px; }
.editor textarea:focus { outline: none; }
.editor-preview { padding: 12px 14px; min-height: 120px; background: var(--panel); }
.login-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; background: linear-gradient(135deg, var(--tint), var(--panel)); }
.login-card h3 { margin: 0 0 4px; } .login-card p { margin: 0; color: var(--muted); font-size: 14px; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.notice-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }

.page-head { margin: 28px 0 18px; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.015em; }
.page-head p { margin: 0; color: var(--muted); }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; margin-bottom: 48px; align-items: start; }
.compose .page-head { grid-column: 1 / -1; margin-bottom: 0; }
.compose-form > *, .compose > * { min-width: 0; }
.editor-preview { overflow-x: auto; }
.compose-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: grid; gap: 18px; box-shadow: var(--shadow); }
.compose-tips { position: sticky; top: 84px; } .compose-tips ul { padding-left: 1.1em; margin: 0 0 12px; font-size: 13.5px; color: var(--muted); display: grid; gap: 6px; }
.compose-tips code { font-size: 12px; background: var(--line-2); padding: 0 4px; border-radius: 4px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .field > span, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
legend small, .field small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.field input { width: 100%; height: 42px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 0 12px; font: 15px var(--font); }
.field input:focus { outline: none; border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kinds legend { grid-column: 1 / -1; }
.kind-opt, .tag-opt { position: relative; }
.kind-opt input, .tag-opt input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.kind-opt > span { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; height: 100%; }
.kind-opt > span > .kind { justify-self: start; }
.kind-opt b { font-size: 14px; } .kind-opt small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.kind-opt input:checked + span { border-color: var(--brand); background: var(--tint); box-shadow: inset 0 0 0 1px var(--brand); }
.kind-opt input:disabled + span { opacity: .45; cursor: not-allowed; }
.kind-opt input:focus-visible + span { outline: 2px solid var(--brand-2); }
.tag-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-opt span { display: inline-block; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; color: var(--ink-2); }
.tag-opt input:checked + span { color: var(--c); border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); font-weight: 600; }
.tag-opt input:focus-visible + span { outline: 2px solid var(--brand-2); }
.compose-foot { display: flex; justify-content: flex-end; gap: 10px; }
.search-big { display: flex; gap: 10px; margin-top: 14px; max-width: 720px; }
.search-big input { flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0 14px; font: 15px var(--font); }
.search-big .btn { height: 44px; }
.result-count { color: var(--muted); font-size: 14px; }

/* tags page */
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 48px; }
.tag-card { display: grid; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tag-card:hover { border-color: var(--c); color: inherit; }
.tag-name { font: 700 16px var(--mono); color: var(--c); }
.tag-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.tag-count { font-size: 12px; color: var(--muted); }
.tag-head { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.tag-head h1 { margin: 0 0 4px; font: 700 22px var(--mono); color: var(--c); }
.tag-head p { margin: 0 0 4px; color: var(--muted); } .tag-head span { font-size: 12px; color: var(--muted); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 22px; margin: 28px 0 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 220px; }
.profile-id h1 { margin: 0 0 4px; font-size: 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-id p { margin: 0; font-size: 14px; } .profile-id .bio { margin-top: 8px; color: var(--ink-2); }
.profile-stats { display: flex; gap: 26px; margin: 0; }
.profile-stats div { text-align: center; } .profile-stats dt { font-size: 12px; color: var(--muted); } .profile-stats dd { margin: 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mod-user { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.mod-user input { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--ink); padding: 0 8px; }
.mod-user input[type=number] { width: 70px; } .mod-user input[name=reason] { flex: 1; min-width: 160px; }
.reply-list { display: grid; gap: 10px; }
.reply-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.reply-item-title { font-weight: 600; } .reply-item p { margin: 4px 0; color: var(--ink-2); font-size: 14px; } .reply-item .muted { font-size: 12.5px; }

/* moderation */
.mod-grid { display: grid; gap: 16px; margin-bottom: 48px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table td:first-child { max-width: 460px; } .table .kind { margin-right: 6px; }
.row-acts { white-space: nowrap; text-align: right; }

/* developers, docs */
.dev-hero { margin: 34px 0 22px; padding: 38px 40px; border-radius: 18px; color: #e6f4f1; background: radial-gradient(120% 120% at 100% 0%, rgb(20 184 166 / .35), transparent 50%), linear-gradient(135deg, #0a161c, #0b2a29); }
.dev-hero .eyebrow { color: var(--mint); }
.dev-hero h1 { margin: 0 0 10px; font-size: 34px; letter-spacing: -.02em; line-height: 1.2; }
.dev-hero p { margin: 0; max-width: 46em; color: #a9c4c2; font-size: 16px; }
.dev-hero .btn { background: transparent; color: #e6f4f1; border-color: rgb(255 255 255 / .22); }
.dev-hero .btn:hover { border-color: var(--mint); color: var(--mint); }
.dev-hero .btn-primary { background: #14b8a6; border-color: #14b8a6; color: #04201d; }
.dev-hero .btn-primary:hover { background: var(--mint); color: #04201d; }
.dev-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.dev-feature h2 { margin: 10px 0 6px; font-size: 18px; }
.dev-feature p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.dev-feature ul { margin: 0 0 12px; padding-left: 1.1em; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.dev-feature code, .dev-code code { font-size: .88em; background: var(--line-2); padding: 0 4px; border-radius: 4px; }
.dev-icon { display: inline-grid; place-items: center; min-width: 42px; height: 30px; padding: 0 8px; border-radius: 8px; background: var(--tint); color: var(--brand); font: 700 13px var(--mono); }
.dev-code { margin: 16px 0 48px; }
.dev-code h2 { margin: 0 0 14px; font-size: 18px; }
.dev-code pre code { background: none; padding: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { counter-increment: s; display: grid; gap: 4px; padding: 12px 14px 12px 46px; position: relative; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 12px var(--mono); }
.steps b { color: var(--ink); }
.doc { max-width: 760px; margin: 30px auto 60px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 36px; line-height: 1.8; }
.doc h1 { margin-top: 0; } .doc h2 { font-size: 18px; margin-top: 1.6em; } .doc .lead { font-size: 16.5px; color: var(--muted); }
.doc a { color: var(--brand); }
.message { max-width: 560px; margin: 80px auto; text-align: center; }
.message h1 { font-size: 26px; } .message p { color: var(--muted); }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; color: var(--brand-2); stroke-width: 1.5; }
.empty h3 { margin: 10px 0 4px; color: var(--ink); } .empty p { margin: 0 0 16px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 18px 0; font-size: 14px; color: var(--muted); }
.pager a { color: var(--brand); font-weight: 600; }

/* footer, toast */
.foot { border-top: 1px solid var(--line); background: var(--panel); }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 20px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-brand { display: flex; align-items: center; gap: 8px; } .foot-brand b { font-family: var(--mono); color: var(--ink); }
.foot-brand a { color: var(--brand); }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 10px 30px rgb(0 0 0 / .2); z-index: 60; max-width: calc(100% - 32px); }
.toast.is-error { background: var(--danger); color: #fff; }

/* responsive */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr); }
  .layout .rail-right { display: none; }
  .layout-topic { grid-template-columns: minmax(0, 1fr) 280px; }
  .layout-topic .rail-right { display: grid; }
}
@media (max-width: 900px) {
  .layout, .layout-topic, .compose { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .rail-left { display: none; }
  .layout-topic .rail-right { display: none; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero h1 { font-size: 26px; }
  .mainnav { display: none; }
  .dev-grid, .steps { grid-template-columns: 1fr; }
  .kinds { grid-template-columns: repeat(2, 1fr); }
  .compose-tips { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar-in { gap: 10px; }
  .brand-by, .search kbd { display: none; }
  .search { max-width: none; }
  .actions .btn-primary { padding: 0 10px; font-size: 13px; }
  .topic-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .tr-replies { display: none; }
  .topic { padding: 18px 16px 12px; }
  .topic-head h1 { font-size: 22px; }
  .post-grid, .reply { grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .reply { padding: 14px 12px 8px; }
  .vote button { width: 30px; }
  .login-card { flex-direction: column; align-items: flex-start; }
  .profile-stats { gap: 18px; }
  .dev-hero { padding: 26px 20px; } .dev-hero h1 { font-size: 26px; }
  .doc { padding: 22px 18px; }
  .mod-tools { margin-left: 0; border-left: 0; padding-left: 0; }
}
@media (max-width: 520px) {
  .search { display: none; }
  .actions { margin-left: auto; }
  .brand-name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
