:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #16151a;
  --muted: #6b6873;
  --line: #e7e4dd;
  --soft: #f2efe8;
  --brand: #e2412b;
  --brand-ink: #ffffff;
  --gold: #c58a16;
  --ok: #157a4a;
  --warn: #a15c00;
  --danger: #b42318;
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(20, 18, 26, .05), 0 8px 24px rgba(20, 18, 26, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 1rem; }
.mt { margin-top: 2rem; } .mb { margin-bottom: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 64px; }
.logo { display: flex; align-items: center; flex: none; }
.logo img { height: 26px; width: auto; display: block; }
.logo:hover { opacity: .85; }
.main-nav { display: flex; gap: 1.25rem; font-size: .93rem; font-weight: 500; }
.main-nav a { color: var(--muted); }
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.search { flex: 1; max-width: 340px; margin-left: auto; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .5rem .95rem; font: inherit; font-size: .9rem; }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.dot { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: .55rem .75rem; border-radius: 8px; font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; color: var(--ink); }
.menu-panel a:hover, .menu-panel button:hover { background: var(--soft); color: var(--ink); }
.menu-panel .sep { height: 1px; background: var(--line); margin: .35rem 0; }
.nav-toggle { display: none; }
.subnav { border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav .container { display: flex; gap: 1.4rem; height: 42px; align-items: center; font-size: .86rem; white-space: nowrap; }
.subnav a { color: var(--muted); }
.subnav a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .main-nav, .search { display: none; }
  .nav-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  body.nav-open .main-nav { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 1rem 16px; gap: .9rem; }
  body.nav-open .search { display: block; position: absolute; top: 250px; left: 16px; right: 16px; max-width: none; }
  body.nav-open .main-nav { padding-bottom: 4.5rem; }
}
@media (max-width: 520px) {
  .site-header .bar { gap: .5rem; }
  .logo img { height: 20px; }
  .header-actions { gap: .3rem; }
  .header-actions .btn-brand span { display: none; }
  .header-actions .btn-brand { padding: .45rem .55rem; }
  .header-actions .btn-ghost { display: none; }
}

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: .55rem 1.1rem; border-radius: 999px; font: 600 .9rem/1.2 var(--sans); cursor: pointer; white-space: nowrap; transition: transform .08s ease, background .15s; }
.btn:hover { color: #fff; background: #000; }
.btn:active { transform: translateY(1px); }
.btn-brand { background: var(--brand); border-color: var(--brand); }
.btn-brand:hover { background: #c7351f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); color: var(--ink); }
.btn-danger { background: transparent; color: var(--danger); border-color: #f1c4bf; }
.btn-danger:hover { background: #fdecea; color: var(--danger); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn.on { background: var(--soft); color: var(--ink); border-color: var(--line); }
.btn svg { width: 18px; height: 18px; }

.field { margin-bottom: 1.1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field input[type=datetime-local], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .65rem .8rem; font: inherit; color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.req { color: var(--danger); }
.hint {font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.error { font-size: .82rem; color: var(--danger); margin-top: .3rem; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .9rem; }

.alert { padding: .8rem 1rem; border-radius: 10px; margin: 1rem 0; font-size: .92rem; border: 1px solid; }
.alert-ok { background: #ecf8f1; border-color: #bfe6cf; color: #0e5a36; }
.alert-err { background: #fdecea; border-color: #f4c7c1; color: #8a1c12; }
.alert ul { margin: 0; padding-left: 1.1rem; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 1.5rem; }
.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; } }

.story-card { display: flex; flex-direction: column; gap: .7rem; }
.story-card .thumb { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--soft); position: relative; }
.story-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.story-card:hover .thumb img { transform: scale(1.03); }
.thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; padding: 1.2rem; font-family: var(--serif); font-size: 1.2rem; color: #fff; text-align: center; line-height: 1.25; }
.story-card h3 { font-size: 1.18rem; margin: 0; }
.story-card .excerpt { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c, var(--ink)); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ink)); }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .7rem; font-weight: 700; padding: .18rem .5rem; border-radius: 999px; background: var(--soft); color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.badge svg { width: 12px; height: 12px; stroke-width: 2.4; }
.section-head h2 svg { width: 22px; height: 22px; vertical-align: -3px; margin-right: .3rem; }
.badge-gold {background: #fdf3dc; color: #7a5200; }
.badge-brand { background: #fde7e3; color: #a52a17; }
.badge-ok { background: #e3f5ea; color: var(--ok); }
.badge-warn { background: #fff1d6; color: var(--warn); }
.badge-danger { background: #fdecea; color: var(--danger); }
.on-thumb { position: absolute; top: .6rem; left: .6rem; }
.byline { display: flex; align-items: center; gap: .55rem; font-size: .84rem; color: var(--muted); }
.byline strong { color: var(--ink); font-weight: 600; }
.avatar { border-radius: 50%; object-fit: cover; background: var(--soft); flex: none; }
.av-24 { width: 24px; height: 24px; } .av-32 { width: 32px; height: 32px; } .av-44 { width: 44px; height: 44px; } .av-96 { width: 96px; height: 96px; }
.meta { display: flex; gap: .9rem; font-size: .8rem; color: var(--muted); align-items: center; }
.meta span { display: inline-flex; align-items: center; gap: .25rem; }
.meta svg { width: 14px; height: 14px; }

/* ---------- Home ---------- */
.hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 2rem; padding: 2.2rem 0 1rem; }
.hero-main .thumb { aspect-ratio: 16 / 9; }
.hero-main h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.hero-side { display: flex; flex-direction: column; gap: 1.2rem; }
.hero-side .mini { display: grid; grid-template-columns: 1fr 110px; gap: 1rem; align-items: start; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.hero-side .mini:last-child { border-bottom: 0; }
.hero-side .mini .thumb { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); }
.hero-side .mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.hero-side .mini h3 { font-size: 1.02rem; margin: .25rem 0 .35rem; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.section { padding: 2.5rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; border-bottom: 2px solid var(--ink); padding-bottom: .6rem; }
.section-head h2 { margin: 0; font-size: 1.45rem; }
.section-head a { font-size: .88rem; font-weight: 600; }

.join-banner { background: var(--ink); color: #fff; border-radius: 20px; padding: clamp(1.8rem, 4vw, 3.2rem); display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; align-items: center; }
.join-banner h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); color: #fff; }
.join-banner p { color: #cfcbd6; }
.join-banner ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .7rem; }
.join-banner li { display: flex; gap: .6rem; color: #e9e6ee; }
.join-banner li::before { content: "✓"; color: var(--brand); font-weight: 800; }
@media (max-width: 760px) { .join-banner { grid-template-columns: 1fr; } }

.community-tile { display: flex; flex-direction: column; justify-content: space-between; gap: .6rem; padding: 1.2rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--c); min-height: 150px; transition: box-shadow .2s, transform .2s; }
.community-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.c-icon { display: inline-grid; place-items: center; flex: none; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.c-icon svg { width: 55%; height: 55%; }
.c-icon-sm { width: 30px; height: 30px; border-radius: 8px; }
.c-icon-md { width: 44px; height: 44px; }
.c-icon-lg { width: 64px; height: 64px; border-radius: 16px; margin-bottom: .8rem; }
.community-tile .c-icon { margin-bottom: .6rem; }
.tag-list a.with-icon { display: inline-flex; align-items: center; gap: .4rem; }
.tag-list a.with-icon svg { width: 15px; height: 15px; color: var(--c); }
.icon-picker { display: flex; flex-wrap: wrap; gap: .45rem; }
.icon-picker input { position: absolute; opacity: 0; }
.icon-picker label { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); margin: 0; }
.icon-picker label svg { width: 22px; height: 22px; }
.icon-picker input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }
.icon-picker input:focus-visible + label { outline: 2px solid var(--brand); }
.community-tile h3 { margin: 0; }

.challenge-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.challenge-card .cover { aspect-ratio: 16/8; background: linear-gradient(135deg, var(--c, #2b2a33), #000); display: flex; align-items: flex-end; padding: 1rem; color: #fff; position: relative; }
.challenge-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.challenge-card .cover > * { position: relative; }
.challenge-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.prize { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }

.creator-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.creator-row:last-child { border-bottom: 0; }
.rank { font-family: var(--serif); font-size: 1.5rem; color: var(--line); width: 1.6rem; font-weight: 700; }

.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; }
@media (max-width: 960px) { .layout-side { grid-template-columns: 1fr; } }

/* ---------- Page header ---------- */
.page-head { padding: 2.6rem 0 1.6rem; }
.page-head p { color: var(--muted); max-width: 640px; font-size: 1.05rem; }
.community-head { padding: 3rem 0 2rem; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, transparent), transparent); }
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; overflow-x: auto; }
.tabs a { padding: .75rem 0; font-weight: 600; font-size: .92rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--ink); }

/* ---------- Story page ---------- */
.story-head { padding: 3rem 0 1.5rem; }
.story-head h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); margin-bottom: .4em; }
.story-head .subtitle { font-size: 1.25rem; color: var(--muted); font-family: var(--serif); font-weight: 400; }
.story-cover { width: min(1000px, 100% - 32px); margin: 0 auto 2.5rem; border-radius: 16px; overflow: hidden; }
.story-cover img { width: 100%; max-height: 560px; object-fit: cover; }
.prose { font-family: var(--serif); font-size: 1.2rem; line-height: 1.75; color: #24222a; overflow-wrap: break-word; }
.prose p { margin: 0 0 1.35em; }
.prose h2 { font-size: 1.7rem; margin: 1.8em 0 .6em; }
.prose h3 { font-size: 1.35rem; margin: 1.6em 0 .5em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.2em; border-left: 3px solid var(--brand); font-style: italic; color: #46434d; }
.prose img { border-radius: 10px; margin: 1.6em auto; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.35em; }
.prose li { margin-bottom: .4em; }
.prose pre { background: #17161b; color: #f2f0f5; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .95rem; margin: 0 0 1.35em; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--soft); }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-family: var(--sans); font-size: .85rem; color: var(--muted); text-align: center; margin-top: -.8em; }
.prose hr {margin: 2.5em auto; width: 80px; border-top: 2px solid var(--line); }
.author-box { display: flex; gap: 1rem; align-items: flex-start; padding: 1.5rem; }
.action-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; justify-content: center; margin: 2.5rem 0; pointer-events: none; }
.action-bar .inner { pointer-events: auto; display: flex; gap: .3rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .35rem; box-shadow: var(--shadow); }
.action-bar button, .action-bar a { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: none; padding: .5rem .85rem; border-radius: 999px; font: 600 .88rem var(--sans); color: var(--ink); cursor: pointer; }
.action-bar button:hover, .action-bar a:hover { background: var(--soft); color: var(--ink); }
.action-bar svg { width: 20px; height: 20px; }
.action-bar .liked svg { fill: var(--brand); stroke: var(--brand); }
.action-bar .saved svg { fill: var(--ink); }
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-list a { background: var(--soft); padding: .3rem .8rem; border-radius: 999px; font-size: .85rem; }


.comment { display: flex; gap: .8rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment .body { flex: 1; min-width: 0; }
.comment p { margin: .2rem 0 0; white-space: pre-line; overflow-wrap: break-word; }

/* ---------- Editor ---------- */
.editor-wrap { padding: 2rem 0 5rem; }
.editor-title { width: 100%; border: 0; background: transparent; font: 600 clamp(1.9rem, 4vw, 2.8rem)/1.2 var(--serif); padding: 0; outline: none; color: var(--ink); }
.editor-sub { width: 100%; border: 0; background: transparent; font: 400 1.25rem var(--serif); color: var(--muted); outline: none; margin-top: .5rem; padding: 0; }
.cover-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 1.2rem; text-align: center; color: var(--muted); font-size: .9rem; cursor: pointer; display: block; }
.cover-drop img { max-height: 300px; margin: 0 auto 1rem; border-radius: 10px; }
#editor { min-height: 420px; font-family: var(--serif); font-size: 1.15rem; background: var(--surface); }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--line) !important; }
.ql-toolbar.ql-snow { border-radius: 12px 12px 0 0; position: sticky; top: 64px; z-index: 5; background: var(--surface); }
.ql-container.ql-snow { border-radius: 0 0 12px 12px; }
.ql-editor { line-height: 1.75; padding: 1.4rem 1.6rem; }
.editor-footer { position: sticky; bottom: 0; background: rgba(251, 250, 247, .95); border-top: 1px solid var(--line); padding: .8rem 0; z-index: 10; }
.word-count { font-size: .85rem; color: var(--muted); }

/* ---------- Dashboard / tables ---------- */
.dash { display: grid; grid-template-columns: 220px 1fr; gap: 2.4rem; padding: 2rem 0 4rem; }
.dash-nav { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 90px; align-self: start; }
.dash-nav a { padding: .55rem .8rem; border-radius: 9px; font-weight: 500; font-size: .93rem; color: var(--muted); }
.dash-nav a.active, .dash-nav a:hover { background: var(--soft); color: var(--ink); }
.dash-nav .label { margin: 1rem 0 .3rem .8rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 820px) { .dash { grid-template-columns: 1fr; } .dash-nav { position: static; flex-direction: row; flex-wrap: wrap; } .dash-nav .label { display: none; } }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; }
.stat .n { font: 700 1.8rem/1.1 var(--serif); }
.stat .l { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #fcfbf9; }
tr:last-child td { border-bottom: 0; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; padding: 1rem; }
.chart .b { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; position: relative; }
.chart .b:hover { opacity: 1; }
.chart .b:hover::after { content: attr(data-t); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .7rem; padding: .2rem .45rem; border-radius: 5px; white-space: nowrap; }

.queue-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.queue { display: flex; align-items: baseline; gap: .6rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; color: var(--muted); }
.queue strong { font: 700 1.3rem var(--serif); color: var(--ink); }
.queue-hot { border-color: #f3c98b; background: #fff8ec; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.bar-row { display: flex; align-items: center; gap: .8rem; padding: .35rem 0; }
.meter { flex: 1; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 4px; }
.notif {display: flex; gap: .9rem; align-items: center; padding: .95rem 1rem; border-bottom: 1px solid var(--line); }
.notif.unread { background: #fff8f6; }
.notif:last-child { border-bottom: 0; }

/* ---------- Profile ---------- */
.profile-head { padding: 3rem 0 1.6rem; display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.profile-head .counts { display: flex; gap: 1.4rem; font-size: .92rem; margin: .6rem 0; flex-wrap: wrap; }
.profile-head .counts strong { font-size: 1.05rem; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 4rem 0 1rem; max-width: 640px; margin: 0 auto; }
.nf-code { font: 700 clamp(5rem, 16vw, 9rem)/1 var(--sans); letter-spacing: -.06em; color: var(--ink); margin-bottom: 1rem; }
.nf-code span { color: var(--brand); display: inline-block; transform: rotate(-12deg); }
.not-found p { font-size: 1.08rem; margin: 0 auto 1.6rem; }
.nf-search { display: flex; gap: .5rem; max-width: 460px; margin: 0 auto 1.4rem; }
.nf-search .input { flex: 1; min-width: 0; }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 3rem 16px; }
.auth .card { width: min(440px, 100%); padding: 2.2rem; }


/* ---------- Pagination / footer ---------- */
.pager { display: flex; justify-content: center; gap: .4rem; margin: 2.5rem 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 .7rem; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-size: .88rem; background: var(--surface); }
.pager .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager .disabled { opacity: .4; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.site-footer { background: #111014; color: #bdb9c4; margin-top: 4rem; padding: 3.5rem 0 1.6rem; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 2rem; }
.footer-grid h4 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: .8rem; }
.footer-grid a { display: block; padding: .2rem 0; color: #bdb9c4; }
.footer-grid a:hover { color: #fff; }
.site-footer .logo:hover { opacity: .8; }
.socials { display: flex; gap: .6rem; margin-top: 1.2rem; }
.footer-grid .socials a { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 50%; background: #24222a; color: #fff; transition: background .15s, transform .15s; }
.footer-grid .socials a:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { margin: 2.6rem 0 0; padding-top: 1.4rem; border-top: 1px solid #2a2830; color: #8f8a98; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.menu-rows { display: grid; gap: .5rem; margin-bottom: .8rem; }
.menu-row { display: grid; grid-template-columns: 1fr 1.6fr auto auto; gap: .5rem; align-items: center; }
@media (max-width: 700px) { .menu-row { grid-template-columns: 1fr 1fr; } }
textarea.code { font: .82rem/1.5 ui-monospace, Consolas, monospace; white-space: pre; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; }
.switch .slider { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; transition: background .15s; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-label { font-weight: 600; font-size: .9rem; }
.inline-menu .menu-panel { position: static; margin-top: .4rem; box-shadow: none; }
.footer-grid a.footer-more { color: #fff; font-weight: 600; margin-top: .3rem; }
.seo-box { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; background: var(--surface); }
.seo-box summary { cursor: pointer; }
.subscribe-panel { width: 280px; padding: 1rem; left: 0; right: auto; z-index: 30; }
.profile-head .subscribe-panel { left: auto; right: 0; }
