/* Lucee Malaysia — design system. No build step, no external fonts. */
:root {
	--brand: #0b7a75;
	--brand-strong: #075e5a;
	--brand-soft: #e3f4f2;
	--accent: #f2a900;
	--accent-soft: #fff4d6;
	--bg: #f6f7f9;
	--surface: #ffffff;
	--surface-2: #f0f2f5;
	--border: #e2e5ea;
	--text: #18202a;
	--text-2: #4a5563;
	--muted: #6b7684;
	--success: #16803c;
	--success-soft: #e6f6ea;
	--danger: #c62f2f;
	--danger-soft: #fdecec;
	--warn: #9a6400;
	--warn-soft: #fff5dc;
	--info-soft: #e8f1fd;
	--code-bg: #0f1720;
	--code-text: #e6edf3;
	--inline-code-bg: #eef1f4;
	--shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
	--shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
	--radius: 12px;
	--radius-sm: 8px;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--hl-keyword: #ff7b72;
	--hl-string: #a5d6ff;
	--hl-tag: #7ee787;
	--hl-attr: #79c0ff;
	--hl-comment: #8b949e;
	--hl-number: #ffa657;
	--hl-func: #d2a8ff;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--brand: #2bb3a9;
	--brand-strong: #4fd1c5;
	--brand-soft: #0f2e2c;
	--accent: #f5be2e;
	--accent-soft: #3a2f10;
	--bg: #0d1117;
	--surface: #151b23;
	--surface-2: #1c232d;
	--border: #2a323d;
	--text: #e6edf3;
	--text-2: #b4bdc8;
	--muted: #8b96a3;
	--success: #3fb950;
	--success-soft: #12261a;
	--danger: #f47067;
	--danger-soft: #2d1517;
	--warn: #e3b341;
	--warn-soft: #2b2310;
	--info-soft: #12213a;
	--code-bg: #0a0e13;
	--inline-code-bg: #222a35;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4);
	--shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); font-size: .9em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand); color: #fff; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.break { word-break: break-all; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-text strong { color: var(--brand); }
.main-nav { display: flex; gap: 2px; }
.main-nav .nav-community { position: relative; }
.main-nav .nav-community::after { content: ""; position: absolute; top: 7px; right: 5px; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.main-nav a { color: var(--text-2); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.main-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.main-nav a.active { background: var(--brand-soft); color: var(--brand-strong); }
.header-search { flex: 1; max-width: 300px; margin-left: auto; }
.header-search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7684' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center; color: var(--text); font: inherit; font-size: .95rem; }
.header-search input:focus { background-color: var(--surface); border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-switch { font-weight: 700; font-size: .8rem; color: var(--text-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.lang-switch:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.nav-toggle { display: none; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: inline; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; border-radius: 999px; }
.user-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(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel .linklike { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-align: left; width: 100%; }
.menu-panel a:hover, .menu-panel .linklike:hover { background: var(--surface-2); text-decoration: none; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head span { color: var(--muted); font-size: .85rem; }
.announcement { background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); padding: 8px 0; font-size: .92rem; }
.announcement.warn { background: var(--warn-soft); }

/* ---------- layout */
.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.main.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.main.with-sidebar .flash-stack { grid-column: 1 / -1; }
.content { min-width: 0; }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 88px; }
.sidebar h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.sidebar .card + .card { margin-top: 0; }
.card-cta { background: linear-gradient(135deg, var(--brand-soft), var(--surface)); }
.sidebar .card-cta h2 { font-size: 1.15rem; text-transform: none; letter-spacing: -.01em; color: var(--text); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-sm { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.row-end { display: flex; gap: 12px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.inline { display: inline; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.form-page { max-width: 1000px; margin: 0 auto; }
.form-page.narrow { max-width: 640px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); }
:root[data-theme="dark"] .btn-primary { color: #04201e; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { height: 34px; padding: 0 14px; font-size: .88rem; }
.btn-xs { height: 28px; padding: 0 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn-provider { height: 48px; width: 100%; background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-provider:hover { border-color: var(--text-2); }
.btn-github { background: #1f2328; color: #fff; border-color: #1f2328; }
:root[data-theme="dark"] .btn-github { background: #f0f3f6; color: #1f2328; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.linklike.danger, a.danger { color: var(--danger); }

/* ---------- forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; font-size: .92rem; }
.field small { color: var(--muted); font-size: .82rem; }
.field-inline { flex-direction: row; align-items: center; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
	width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 42px;
}
select { width: auto; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.checkbox, .radio { display: flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 18px; height: 18px; }
fieldset { border: 0; padding: 0; margin: 0; }

/* ---------- notices */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash, .notice { padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.flash-success, .notice-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.flash-error, .notice-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.flash-warning, .notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice-info { background: var(--info-soft); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice { margin-bottom: 16px; }
.inline-error { color: var(--danger); font-size: .8rem; }

/* ---------- badges, tags */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-solved { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-pin { background: var(--accent-soft); color: var(--warn); }
.badge-role { background: var(--brand-soft); color: var(--brand-strong); }
.type-badge { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.type-badge.type-question { background: var(--info-soft); color: #2563c9; }
.type-badge.type-article { background: var(--accent-soft); color: var(--warn); }
.type-badge.type-quick { background: var(--brand-soft); color: var(--brand-strong); }
:root[data-theme="dark"] .type-badge.type-question { color: #79b8ff; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-strong); white-space: nowrap; }
.tag:hover { text-decoration: none; filter: brightness(.96); }
.tag small { color: var(--muted); font-weight: 500; }
.tag-lg { font-size: 1.4rem; padding: 4px 16px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.more-link { font-size: .9rem; font-weight: 600; }

/* ---------- avatar */
.avatar { border-radius: 999px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.avatar-initials { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: .8em; }
.sz-20 { width: 20px; height: 20px; font-size: 9px; }
.sz-24 { width: 24px; height: 24px; font-size: 10px; }
.sz-28 { width: 28px; height: 28px; font-size: 11px; }
.sz-32 { width: 32px; height: 32px; font-size: 12px; }
.sz-36 { width: 36px; height: 36px; font-size: 13px; }
.sz-40 { width: 40px; height: 40px; font-size: 14px; }
.sz-48 { width: 48px; height: 48px; font-size: 17px; }
.sz-96 { width: 96px; height: 96px; font-size: 32px; }
.hue-0 { background: #0b7a75; } .hue-1 { background: #2563c9; } .hue-2 { background: #9333ea; } .hue-3 { background: #c2410c; }
.hue-4 { background: #be185d; } .hue-5 { background: #15803d; } .hue-6 { background: #4f46e5; } .hue-7 { background: #a16207; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 32px; border-radius: 20px; background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%), linear-gradient(135deg, var(--brand-soft), var(--surface)); border: 1px solid var(--border); margin-bottom: 8px; }
.hero h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-bottom: 12px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--brand); margin-bottom: 8px; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.hero-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.hero-stats dt { color: var(--muted); font-size: .82rem; }
.hero-stats dd { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--text); }

/* ---------- composer */
.composer-row { display: flex; gap: 12px; align-items: flex-start; }
.composer-row textarea { min-height: 52px; border-radius: var(--radius); background: var(--surface-2); }
.composer-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-left: 52px; }
.composer-foot input { flex: 1; min-width: 180px; }
.composer-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface-2); padding: 4px; border-radius: 999px; border: 1px solid var(--border); }
.tab { padding: 6px 14px; border-radius: 999px; color: var(--text-2); font-size: .88rem; font-weight: 600; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.admin-tabs { margin-bottom: 20px; border-radius: var(--radius); }

/* ---------- feed / post card */
.feed { display: flex; flex-direction: column; gap: 12px; }
.post-card { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); transition: border-color .15s; }
.post-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.post-card.pinned { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.post-card-stats { display: flex; flex-direction: column; gap: 8px; min-width: 64px; }
.stat { text-align: center; border-radius: var(--radius-sm); padding: 4px 6px; font-size: .75rem; color: var(--muted); }
.stat strong { display: block; font-size: 1.05rem; color: var(--text); }
.stat.answered { border: 1px solid var(--success); color: var(--success); }
.stat.answered strong { color: var(--success); }
.stat.solved { background: var(--success); color: #fff; }
.stat.solved strong { color: #fff; }
.post-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-card-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.post-card-title { margin: 0; font-size: 1.08rem; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--brand); }
.post-card-excerpt { margin: 0; color: var(--text-2); font-size: .94rem; overflow-wrap: anywhere; }
.post-card-quick { color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.post-card-quick:hover { text-decoration: none; color: var(--brand-strong); }
.post-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.byline { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--muted); flex-wrap: wrap; }
.byline-user { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 600; }
.rep { font-weight: 700; color: var(--muted); font-size: .8rem; }
.load-more { display: flex; justify-content: center; padding: 8px; }
.load-more.htmx-request .btn { opacity: .6; pointer-events: none; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- sidebar lists */
.top-list { margin: 0; padding: 0; list-style: none; counter-reset: top; display: flex; flex-direction: column; gap: 12px; }
.top-list li { counter-increment: top; display: grid; grid-template-columns: 24px 1fr; gap: 2px 8px; }
.top-list li::before { content: counter(top); grid-row: span 2; font-weight: 800; color: var(--brand); }
.top-list a { color: var(--text); font-weight: 600; font-size: .92rem; line-height: 1.35; }
.top-list .meta { font-size: .78rem; color: var(--muted); }

/* ---------- post full */
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.post-full { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.post-header { border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
.post-header h1 { margin: 10px 0 14px; overflow-wrap: anywhere; }
.post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .88rem; }
.post-meta .byline-user span { display: flex; flex-direction: column; line-height: 1.2; }
.post-meta .byline-user small { color: var(--muted); font-weight: 500; }
.meta-items { display: flex; gap: 6px; flex-wrap: wrap; }
.post-layout { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; }
.post-main { min-width: 0; }
.post-tags { margin: 20px 0 12px; }
.post-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.post-actions a, .post-actions .linklike { color: var(--muted); }
.post-actions a:hover, .post-actions .linklike:hover { color: var(--brand); }
.mod-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: .85rem; }
.mod-tags input { width: 220px; min-height: 28px; padding: 2px 8px; font-size: .85rem; }
.author-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.author-card p { margin: 4px 0 0; font-size: .9rem; color: var(--text-2); }
.toc { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: .92rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ul { margin: 8px 0 0; padding: 0; list-style: none; }
.toc li { margin: 4px 0; }
.toc .toc-3 { margin-left: 18px; font-size: .9em; }
.toc .toc-3::before { content: "– "; color: var(--muted); }

/* ---------- votes */
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote form { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote-btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.vote-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.vote-btn.on.up { background: var(--brand); border-color: var(--brand); color: #fff; }
.vote-btn.on.down { background: var(--danger); border-color: var(--danger); color: #fff; }
.vote-btn:disabled { opacity: .4; cursor: not-allowed; }
.vote-score { font-weight: 800; font-size: 1.1rem; min-width: 2ch; text-align: center; }
.vote-error { font-size: .72rem; color: var(--danger); max-width: 120px; text-align: center; line-height: 1.2; }
.htmx-request .vote-btn { opacity: .6; }

/* ---------- replies */
.replies { margin-top: 28px; }
.replies > h2 { margin-bottom: 16px; }
.reply { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; }
.reply.accepted { border: 2px solid var(--success); background: linear-gradient(0deg, var(--surface), var(--surface)) padding-box; }
.reply.is-hidden, .reply.is-pending, .reply.is-deleted { opacity: .7; border-style: dashed; }
.reply-main { min-width: 0; }
.accepted-label { display: inline-block; font-weight: 700; color: var(--success); font-size: .85rem; margin-bottom: 8px; }
.reply-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.reply-author { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.reply-form h2 { margin-bottom: 12px; }
.related ul { margin: 0; padding-left: 18px; }
.related li { margin-bottom: 6px; }
.related .meta { color: var(--muted); font-size: .8rem; }
.reply-summary { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.reply-summary a { flex: 1; color: var(--text); font-weight: 600; }

/* ---------- prose (rendered markdown) */
.prose { overflow-wrap: anywhere; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.12rem; margin-top: 1.4em; }
.prose h4, .prose h5, .prose h6 { font-size: 1rem; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose blockquote { margin: 0 0 1em; padding: 8px 16px; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); }
.prose img { border-radius: var(--radius-sm); border: 1px solid var(--border); height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose :not(pre) > code { background: var(--inline-code-bg); padding: .15em .4em; border-radius: 5px; font-size: .88em; }
.prose pre, .form-tips pre { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; line-height: 1.5; margin: 0 0 1em; font-size: .86rem; }
.prose pre code, .form-tips pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.table-wrap { overflow-x: auto; margin-bottom: 1em; }
.prose table, .table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.prose th, .prose td, .table th, .table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th, .table th { background: var(--surface-2); }
.copy-btn { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .75rem; padding: 4px 10px; border-radius: 6px; border: 1px solid #3b4450; background: #1c232d; color: #c9d1d9; cursor: pointer; opacity: 0; transition: opacity .15s; }
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.code-lang { position: absolute; top: 8px; right: 70px; font-size: .7rem; color: #8b949e; text-transform: uppercase; letter-spacing: .05em; }

/* syntax highlighting tokens (highlight.js) */
.hljs-keyword, .hljs-selector-tag, .hljs-built_in.cf-tag-keyword { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-meta .hljs-string { color: var(--hl-string); }
.hljs-name, .hljs-tag, .hljs-selector-id { color: var(--hl-tag); }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: var(--hl-attr); }
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-number, .hljs-literal, .hljs-symbol { color: var(--hl-number); }
.hljs-title, .hljs-title.function_, .hljs-built_in, .hljs-function .hljs-title { color: var(--hl-func); }
.hljs-subst { color: var(--code-text); }
.hljs-meta { color: var(--hl-comment); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ---------- editor */
.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.editor-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding: 6px; background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; flex-wrap: wrap; }
.editor-tabs { display: flex; gap: 4px; }
.editor-tab { font: inherit; font-size: .85rem; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.editor-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.editor-tools { display: flex; gap: 2px; flex-wrap: wrap; }
.tool { font: inherit; font-size: .82rem; min-width: 32px; height: 30px; border: 0; background: transparent; color: var(--text-2); border-radius: 6px; cursor: pointer; }
.tool:hover { background: var(--surface); color: var(--text); }
.tool-cfml { font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--brand); }
.editor-input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; font-family: var(--mono) !important; font-size: .9rem !important; min-height: 160px; }
.editor-preview { padding: 16px; min-height: 160px; }
.editor-help { margin: 0; padding: 6px 12px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); }
.type-switch { display: flex; gap: 6px; flex-wrap: wrap; }
.type-option { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: .9rem; }
.type-option:hover { text-decoration: none; border-color: var(--brand); }
.type-option.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.form-tips h2 { font-size: 1rem; }
.form-tips h3 { font-size: .9rem; margin-top: 1em; }
.form-tips p { font-size: .9rem; color: var(--text-2); }

/* ---------- tags/users/profile */
.tag-grid, .user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tag-grid .card + .card, .user-grid .card + .card { margin-top: 0; }
.tag-card { display: flex; flex-direction: column; gap: 8px; color: var(--text); padding: 16px; }
.tag-card:hover { text-decoration: none; border-color: var(--brand); }
.tag-card p { margin: 0; font-size: .88rem; color: var(--text-2); flex: 1; }
.user-card { display: flex; gap: 12px; align-items: center; color: var(--text); padding: 14px; }
.user-card:hover { text-decoration: none; border-color: var(--brand); }
.user-card > div { display: flex; flex-direction: column; min-width: 0; }
.user-card .muted { font-size: .82rem; }
.user-stats { font-size: .82rem; color: var(--text-2); }
.leaderboard { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.leaderboard li a { display: inline-flex; gap: 8px; align-items: center; color: var(--text); font-weight: 600; }
.rep-gain { margin-left: 8px; color: var(--success); font-weight: 700; font-size: .85rem; }
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: start; margin-bottom: 16px; }
.profile h1 { margin-bottom: 0; }
.profile-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; color: var(--text-2); }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(90px, 1fr)); gap: 8px; margin: 0; }
.profile-stats div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; text-align: center; }
.profile-stats dt { font-size: .75rem; color: var(--muted); }
.profile-stats dd { margin: 0; font-weight: 800; font-size: 1.2rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.search-big { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search-big input { flex: 1; min-width: 200px; }
.pagination { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 20px 0; font-size: .92rem; }

/* ---------- auth & admin */
.auth-page { display: flex; justify-content: center; padding: 32px 0; }
.auth-card { width: 100%; max-width: 420px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 32px; }
.auth-card .stack-sm, .auth-card .field { width: 100%; text-align: left; }
.fine-print { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-grid .card + .card { margin-top: 0; }
.stat-card { display: flex; flex-direction: column; gap: 4px; color: var(--text); }
.stat-card:hover { text-decoration: none; }
.stat-card span { color: var(--muted); font-size: .85rem; }
.stat-card strong { font-size: 1.8rem; }
.queue-item { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.queue-item > div:first-child { flex: 1; min-width: 240px; }
.queue-item p { margin: 6px 0; overflow-wrap: anywhere; }
.queue-item blockquote { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--warn); background: var(--surface-2); }
.tag-edit-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tag-edit-row input[name="name"] { width: 140px; }
.tag-edit-row input[name="description"] { flex: 1; min-width: 200px; }
.table td form { margin: 0; }
.secret { font-size: 1.05rem; letter-spacing: .1em; background: var(--surface-2); padding: 4px 8px; border-radius: 6px; }

/* ---------- static pages & errors */
.prose-page { max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
.error-page { max-width: 560px; margin: 40px auto; text-align: center; }
.error-page .row { justify-content: center; margin: 16px 0; }
.error-page input { max-width: 300px; }
.error-code { font-size: 4rem; font-weight: 900; color: var(--brand); margin: 0; line-height: 1; }
.error-detail { text-align: left; background: var(--code-bg); color: var(--code-text); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: .8rem; }

/* ---------- dialog */
.dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; max-width: 440px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 15, 20, .55); }

/* ---------- footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 24px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid nav { display: flex; flex-direction: column; gap: 6px; }
.footer-grid h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.footer-grid nav a { color: var(--text-2); font-size: .92rem; }
.footer-grid p { margin-top: 10px; font-size: .9rem; max-width: 340px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; font-size: .85rem; color: var(--muted); }
.founded { font-weight: 600; color: var(--text-2); }
.founded a { font-weight: 800; }

/* ---------- responsive */
@media (max-width: 1024px) {
	.main.with-sidebar { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: static; }
	.form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
	.header-search { max-width: 200px; }
}
@media (max-width: 960px) {
	.nav-toggle { display: inline-flex; order: 3; }
	.header-inner { flex-wrap: wrap; height: auto; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
	.main-nav { display: none; order: 10; width: 100%; flex-direction: column; padding-top: 8px; }
	.main-nav.open { display: flex; }
	.header-search { order: 11; max-width: none; width: 100%; flex-basis: 100%; }
	.header-actions { margin-left: auto; }
	.hero { grid-template-columns: minmax(0, 1fr); padding: 24px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.profile { grid-template-columns: auto minmax(0, 1fr); }
	.profile-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
	body { font-size: 15px; }
	.brand-text { display: none; }
	.post-card { padding: 14px; gap: 12px; }
	.post-card-stats { min-width: 48px; }
	.post-full { padding: 16px; }
	.post-layout, .reply { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
	.reply { padding: 14px; }
	.vote-btn { width: 34px; height: 34px; }
	.composer-foot { padding-left: 0; }
	.form-row { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.prose-page { padding: 20px; }
	.profile-stats { grid-template-columns: repeat(2, 1fr); }
	.card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .sidebar, .site-footer, .vote, .post-actions, .reply-form, .mod-bar { display: none !important; }
}

/* =====================================================================
   Portal (editorial home page, categories, article pages)
   ===================================================================== */
.cat-none { --cat: var(--brand); }
.mt { margin-top: 16px; }
.spacer { flex: 1; }
.h-sm { font-size: 1rem; }

/* category chip & team badge */
.cat-chip { display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--cat, var(--brand)); padding: 3px 9px; border-radius: 4px; line-height: 1.4; }
.cat-chip:hover { text-decoration: none; filter: brightness(1.08); }
.team-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--brand-strong); background: var(--brand-soft); padding: 2px 8px; border-radius: 4px; }
.team-badge::before { content: ""; width: 12px; height: 12px; background: url("/assets/img/logo.svg") center / contain no-repeat; }
.featured-label { font-size: .72rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.article-meta-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* thumbnails */
.thumb, .hero-img { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.thumb img, .hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
a:hover .thumb img, a:hover .hero-img img { transform: scale(1.04); }
.thumb-fallback { display: flex; align-items: flex-end; background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .25), transparent 40%), linear-gradient(135deg, var(--cat, var(--brand)), color-mix(in srgb, var(--cat, var(--brand)) 55%, #0d1117)); }
.thumb-fallback::after { content: ""; position: absolute; right: 10%; top: 50%; width: 28%; aspect-ratio: 1; transform: translateY(-50%); background: url("/assets/img/logo.svg") center / contain no-repeat; opacity: .22; filter: grayscale(1) brightness(3); }
.thumb-fallback span { position: relative; z-index: 1; margin: 10px 12px; color: #fff; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.thumb-sm { width: 88px; flex-shrink: 0; border-radius: 6px; }
.thumb-sm.thumb-fallback span { display: none; }
.thumb-xs { width: 72px; border-radius: 6px; }
.thumb-xs.thumb-fallback span { display: none; }
.cell-thumb { width: 88px; }

/* hero: big feature + side list */
.portal-hero { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; margin-bottom: 24px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 420px; background: var(--code-bg); box-shadow: var(--shadow); }
.hero-main-link { display: block; height: 100%; color: #fff; }
.hero-main-link:hover { text-decoration: none; }
.hero-main .hero-img { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; border-radius: 0; }
.hero-main .hero-img.thumb-fallback span { display: none; }
.hero-main-body { position: absolute; inset: auto 0 0 0; padding: 28px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(0deg, rgba(5, 10, 15, .92) 0%, rgba(5, 10, 15, .7) 55%, transparent 100%); }
.hero-kicker { display: flex; gap: 10px; align-items: center; }
.hero-title { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 800; line-height: 1.2; letter-spacing: -.015em; }
.hero-summary { color: rgba(255, 255, 255, .85); font-size: 1rem; max-width: 60ch; }
.hero-meta { color: rgba(255, 255, 255, .7); font-size: .82rem; }
.hero-side { display: grid; grid-template-rows: repeat(4, auto); gap: 12px; align-content: start; }
.hero-side-item a { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.hero-side-item a:hover { text-decoration: none; border-color: var(--cat, var(--brand)); }
.hero-side-item .thumb-fallback span { font-size: .65rem; }
.hero-side-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hero-side-title { font-weight: 700; line-height: 1.3; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side .hero-meta { color: var(--muted); }
.hero-h { font-size: clamp(1.6rem, 3.2vw, 2.4rem); margin-bottom: 12px; }
.hero-compact { margin-bottom: 16px; }

/* hero banners (admin managed) */
.hero-banners { margin-bottom: 20px; }
.hero-banner-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; border-radius: var(--radius); }
.banner-hero { position: relative; scroll-snap-align: start; min-height: 300px; border-radius: var(--radius); overflow: hidden; display: flex; align-items: flex-end; background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 45%), linear-gradient(135deg, #0b3d3a, #0d1117); color: #fff; }
.banner-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 10, 15, .85) 0%, rgba(5, 10, 15, .4) 60%, transparent 100%); }
.banner-hero-body { position: relative; z-index: 1; padding: 36px; max-width: 640px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.banner-hero-body h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); margin: 0; }
.banner-hero-body p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 1.05rem; }
.sponsored-label { display: inline-block; font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: 3px; background: var(--accent); color: #1f1600; }

/* banners: top strip, sidebar/inline cards */
.banner-top { background: var(--accent-soft); border-bottom: 1px solid var(--border); }
.banner-top-inner { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 8px; font-size: .92rem; }
.banner-top-img { border-radius: 6px; object-fit: cover; }
.banner-top-text { flex: 1; min-width: 0; }
.banner-top-text span { color: var(--text-2); }
.portal-strip { margin-bottom: 20px; }
.banner-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.banner-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.banner-card .sponsored-label { position: absolute; top: 10px; left: 10px; z-index: 1; }
.banner-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.banner-card-body p { margin: 0; color: var(--text-2); font-size: .9rem; }
.banner-inline { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); align-items: center; margin: 8px 0 24px; }
.banner-inline:not(:has(img)) { grid-template-columns: 1fr; }
.banner-inline .banner-card-body { padding: 18px 20px; }

/* portal grid */
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.portal-main { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 14px; padding-bottom: 10px; border-bottom: 3px solid var(--cat, var(--brand)); }
.section-title h2 { margin: 0; font-size: 1.2rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.section-title a { font-size: .88rem; font-weight: 700; }
.cat-section { margin-top: 20px; }

/* article rows (latest) */
.article-list { display: flex; flex-direction: column; }
.article-row { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.article-row:first-child { padding-top: 0; }
.article-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.article-row h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.article-row h3 a { color: var(--text); }
.article-row h3 a:hover { color: var(--brand); text-decoration: none; }
.article-row p { margin: 0; color: var(--text-2); font-size: .95rem; }

/* category blocks: 4 cards */
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.article-card { display: flex; flex-direction: column; gap: 8px; }
.article-card h3 { margin: 0; font-size: .98rem; line-height: 1.35; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--brand); text-decoration: none; }
.article-card-body { display: flex; flex-direction: column; gap: 4px; }

/* sidebar widgets */
.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: pop; display: flex; flex-direction: column; gap: 12px; }
.popular-list li { counter-increment: pop; }
.popular-list a { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; color: var(--text); position: relative; }
.popular-list a:hover { text-decoration: none; color: var(--brand); }
.popular-thumb { position: relative; }
.popular-thumb::before { content: counter(pop); position: absolute; z-index: 2; top: -6px; left: -6px; width: 22px; height: 22px; border-radius: 999px; background: var(--brand); color: #fff; font-size: .75rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.popular-title { font-weight: 700; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.q-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.q-list li { display: flex; flex-direction: column; gap: 2px; }
.q-list a { color: var(--text); font-weight: 600; font-size: .92rem; line-height: 1.35; }
.q-list .meta { font-size: .78rem; color: var(--muted); }
.q-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.community-teaser { margin-top: 24px; }
.community-teaser .section-title { margin-top: 0; }
.help-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.community-box .stack-sm { margin-top: 6px; }

/* category page head */
.category-head { padding: 24px; border-radius: var(--radius); margin-bottom: 20px; color: #fff; background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .2), transparent 45%), linear-gradient(135deg, var(--cat, var(--brand)), color-mix(in srgb, var(--cat, var(--brand)) 50%, #0d1117)); }
.category-head .eyebrow { color: rgba(255, 255, 255, .8); }
.category-head h1 { margin-bottom: 6px; }
.category-head .lead { color: rgba(255, 255, 255, .88); margin: 0; }

/* article page */
.post-lead { font-size: 1.15rem; color: var(--text-2); margin: -4px 0 14px; line-height: 1.5; }
.post-cover { margin: 0 0 24px; border-radius: var(--radius-sm); overflow: hidden; }
.post-cover img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; }
.with-sidebar .post-full + .replies, .with-sidebar .related { max-width: none; }

/* editorial form */
.editorial-box { border: 1px dashed color-mix(in srgb, var(--brand) 50%, var(--border)); background: var(--brand-soft); border-radius: var(--radius-sm); padding: 16px; }
.editorial-box legend { font-weight: 800; padding: 0 6px; color: var(--brand-strong); }
.cover-preview { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.cover-preview img { border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
input[type="file"] { font: inherit; font-size: .9rem; }
input[type="color"] { width: 64px; height: 42px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.category-form { display: flex; flex-direction: column; gap: 12px; }
.card.category-form + .card.category-form { margin-top: 0; }

@media (max-width: 1100px) {
	.card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.portal-grid { grid-template-columns: minmax(0, 1fr); }
	.portal-hero { grid-template-columns: minmax(0, 1fr); }
	.hero-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; }
}
@media (max-width: 720px) {
	.hero-main { min-height: 340px; }
	.hero-main-body { padding: 18px; }
	.hero-summary { display: none; }
	.hero-side { grid-template-columns: minmax(0, 1fr); }
	.hero-side-item a { grid-template-columns: 110px minmax(0, 1fr); }
	.article-row { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
	.article-row h3 { font-size: 1rem; }
	.article-row p { display: none; }
	.q-list-grid { grid-template-columns: minmax(0, 1fr); }
	.banner-inline { grid-template-columns: minmax(0, 1fr); }
	.banner-hero-body { padding: 22px; }
	.banner-top-img { display: none; }
}
@media (max-width: 480px) {
	.card-grid { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   Social: follow buttons, friends, notifications, TryCF
   ===================================================================== */
.follow-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-friend { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.follow-btn[data-unfollow]:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.follows-you { font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 4px; }
.profile-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.profile-title h1 { margin: 0; }
.profile-stats dt a, .profile-stats dd a { color: inherit; }
.profile-stats { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
.more-menu { position: relative; }
.more-menu summary { list-style: none; font-size: 1.2rem; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu .menu-panel { min-width: 200px; z-index: 20; }
.author-card-body { flex: 1; min-width: 0; }
.people-list { display: flex; flex-direction: column; }
.person-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.person-row:last-child { border-bottom: 0; }
.person-link { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.person-link:hover { text-decoration: none; }
.person-link > span { display: flex; flex-direction: column; min-width: 0; }
.person-link .muted { font-size: .82rem; }
.person-bio { font-size: .85rem; color: var(--text-2); }
.friends-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.friends-grid .card + .card { margin-top: 0; }
.feed-scope { margin-bottom: 4px; display: inline-flex; }
.suggest-strip .section-title { margin-top: 0; }
.suggest-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.suggest-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.suggest-card > a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); min-width: 0; max-width: 100%; }
.suggest-card > a:hover { text-decoration: none; }
.suggest-card strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.suggest-card .muted { font-size: .75rem; }
.sz-44 { width: 44px; height: 44px; font-size: 16px; }

.bell { position: relative; }
.notif-count { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.notif-list { padding: 6px; }
.notif { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); color: var(--text); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: var(--brand-soft); }
.notif-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .92rem; }
.notif-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-body time { font-size: .78rem; }
.notif-icon { font-size: 1.1rem; }

.trycf-btn { position: absolute; top: 8px; right: 68px; font: inherit; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; border: 1px solid #2bb3a9; background: #0b3d3a; color: #7ee7dc; cursor: pointer; }
.trycf-btn:hover { background: #0b7a75; color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 200; max-width: min(92vw, 520px); padding: 12px 18px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-size: .9rem; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
	.friends-grid { grid-template-columns: minmax(0, 1fr); }
	.suggest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.prose pre:has(.trycf-btn) { padding-top: 42px; }
.profile .profile-stats { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.profile-stats dt::first-letter { text-transform: uppercase; }
