/* Themes: light is the base; dark applies by system setting or by the header switch. */
:root {
	color-scheme: light;
	--bg: #f5f6f8;
	--side: #f5f6f8;
	--surface: #ffffff;
	--ink: #15181d;
	--muted: #5f6672;
	--line: #e1e4ea;
	--accent: #5b4bdb;
	--accent-hover: #4737c2;
	--on-accent: #ffffff;
	--accent-soft: #5b4bdb17;
	--accent-ink: #4737c2;
	--chip: #eaecf1;
	--focus: #4737c2;
	--hover: #f0f1f5;
	--field: #ffffff;
	--field-line: #8a909c;
	--code: #eef0f4;
	--off: #c3c8d1;
	--live: #16a34a;
	--live-glow: #16a34a2e;
	--new-bg: #5b4bdb1a;
	--new-ink: #4737c2;
	--draft-bg: #f6e3b8;
	--draft-ink: #7a5200;
	--done-bg: #d8f0e0;
	--done-ink: #136c36;
	--ok-bg: #eaf7ee;
	--ok-line: #7cbf93;
	--err-bg: #fde8ec;
	--err-line: #e7a3b1;
	--err-ink: #8a1f37;
	--warn-bg: #fdf3dc;
	--warn-line: #b4690e;
	--shadow: 0 6px 20px #15181d1f;
	--mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, monospace;
	font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
	background: var(--bg);
	color: var(--ink);
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0d0e11;
	--side: #0d0e11;
	--surface: #0d0e11;
	--ink: #e8eaee;
	--muted: #8a909c;
	--line: #23262d;
	--accent: #8b7cf6;
	--accent-hover: #a094f8;
	--on-accent: #0d0e11;
	--accent-soft: #8b7cf622;
	--accent-ink: #b7adff;
	--chip: #1d2026;
	--focus: #b7adff;
	--hover: #15171c;
	--field: #13151a;
	--field-line: #5b6270;
	--code: #16181d;
	--off: #3a3f49;
	--live: #3ddc84;
	--live-glow: #3ddc8433;
	--new-bg: #8b7cf626;
	--new-ink: #b7adff;
	--draft-bg: #f5b54a22;
	--draft-ink: #f5c26b;
	--done-bg: #3ddc8420;
	--done-ink: #6ee7a4;
	--ok-bg: #3ddc8412;
	--ok-line: #2f8f5b;
	--err-bg: #f871712a;
	--err-line: #a64b55;
	--err-ink: #ffb3bd;
	--warn-bg: #f5b54a14;
	--warn-line: #f5b54a;
	--shadow: 0 6px 20px #000000aa;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #0d0e11;
		--side: #0d0e11;
		--surface: #0d0e11;
		--ink: #e8eaee;
		--muted: #8a909c;
		--line: #23262d;
		--accent: #8b7cf6;
		--accent-hover: #a094f8;
		--on-accent: #0d0e11;
		--accent-soft: #8b7cf622;
		--accent-ink: #b7adff;
		--chip: #1d2026;
		--focus: #b7adff;
		--hover: #15171c;
		--field: #13151a;
		--field-line: #5b6270;
		--code: #16181d;
		--off: #3a3f49;
		--live: #3ddc84;
		--live-glow: #3ddc8433;
		--new-bg: #8b7cf626;
		--new-ink: #b7adff;
		--draft-bg: #f5b54a22;
		--draft-ink: #f5c26b;
		--done-bg: #3ddc8420;
		--done-ink: #6ee7a4;
		--ok-bg: #3ddc8412;
		--ok-line: #2f8f5b;
		--err-bg: #f871712a;
		--err-line: #a64b55;
		--err-ink: #ffb3bd;
		--warn-bg: #f5b54a14;
		--warn-line: #f5b54a;
		--shadow: 0 6px 20px #000000aa;
	}
}

/* Document */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
body { background: var(--bg); color: var(--ink); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
h1 { font-size: 1.4rem; line-height: 1.25; font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
h2 { font-size: 1.05rem; line-height: 1.35; font-weight: 650; letter-spacing: -.015em; }
time { color: var(--muted); font-size: .92em; white-space: nowrap; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; left: 16px; top: 16px; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: 6px; }

/* Header */
.site-header { position: relative; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 18px; height: 54px; padding: 0 20px; }
.logo { display: inline-flex; gap: 8px; align-items: center; font-weight: 750; letter-spacing: -.03em; font-size: 1.1rem; color: var(--ink); flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-mark i { display: block; width: 18px; height: 18px; border-radius: 6px 6px 6px 2px; background: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.theme { display: flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.theme button { border: 0; padding: 4px 9px; background: transparent; color: var(--muted); font-size: .8rem; }
.theme button:hover { color: var(--ink); }
.theme button[aria-pressed="true"] { background: var(--chip); color: var(--ink); font-weight: 650; }
.theme button:focus-visible { outline-offset: -2px; }
.btn, .button.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: 6px; font-weight: 650; line-height: 1.25; }
.btn { padding: 7px 13px; font-size: .9rem; }
.btn:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn .plus { font-size: 1.1rem; }
.header-icon { display: none; place-items: center; width: 34px; height: 34px; border-radius: 7px; position: relative; }
.header-icon:hover { background: var(--hover); text-decoration: none; }
.header-search .search-icon { top: 10px; left: 10px; }
.profile { position: relative; }
.profile-trigger { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 3px 6px; font-size: .88rem; font-weight: 650; -webkit-tap-highlight-color: transparent; }
.profile-trigger::-webkit-details-marker, .menu-button::-webkit-details-marker { display: none; }
.profile-trigger::marker, .menu-button::marker { content: ""; }
.profile-trigger:hover, .profile[open] > .profile-trigger { background: var(--hover); }
.profile-name { max-width: 144px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; border-radius: 50%; width: 30px; height: 30px; color: var(--accent-ink); background: var(--accent-soft); font-size: .8rem; font-weight: 700; }
.chevron { width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
:is(.profile, .mobile-tags)[open] .chevron { transform: translateY(2px) rotate(225deg); }
.profile-menu { position: absolute; top: calc(100% + 3px); right: 0; min-width: 164px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.profile-menu a, .profile-menu button { display: block; width: 100%; border: 0; border-radius: 6px; padding: 8px 10px; background: transparent; color: var(--ink); text-align: left; font-size: .88rem; font-weight: 600; white-space: nowrap; }
.profile-menu :is(a, button):hover, .profile-menu a[aria-current] { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }

/* Shell and sidebar */
.shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: calc(100vh - 55px); }
.shell.no-side { grid-template-columns: minmax(0, 1fr); }
.side { border-right: 1px solid var(--line); padding: 14px 10px 24px; background: var(--side); }
.side-nav { display: grid; gap: 2px; align-content: start; }
.side-nav a, .side a.side-link { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .9rem; }
.side-nav a:hover, .side a.side-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.side-nav a[aria-current], .side a.side-link[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
.side h3 { margin: 16px 0 4px; padding: 0 10px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.menu-button { display: none; }
.count { margin-left: auto; font-size: .78rem; padding: 0 7px; border-radius: 10px; background: var(--chip); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px var(--live-glow); }
.page-content { min-width: 0; background: var(--surface); padding: 18px 20px 64px; }
.no-side .page-content { background: var(--bg); }
@media (min-width: 701px) {
	.side-menu > summary { display: none; }
	.side-menu::details-content { content-visibility: visible; display: block; }
}

/* Controls */
.plain { display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; color: var(--accent-ink); background: transparent; font-size: .88rem; font-weight: 650; }
.plain:hover { text-decoration: underline; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; line-height: 1.25; font-weight: 650; font-size: .9rem; text-decoration: none; }
.button:hover { text-decoration: none; }
.secondary { color: var(--accent-ink); background: transparent; border-color: var(--field-line); }
.secondary:hover { background: var(--hover); }
.plus { font-weight: 500; line-height: 1; }
input, textarea, select { width: 100%; border: 1px solid var(--field-line); border-radius: 6px; padding: 8px 11px; color: var(--ink); background: var(--field); }
input, select { min-height: 40px; }
select { cursor: pointer; }
textarea { resize: vertical; display: block; min-height: 84px; }
::placeholder { color: var(--muted); opacity: 1; }

/* Board */
.board-head { padding: 0 0 14px; display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.board-head p, .page-intro p { margin-top: 4px; color: var(--muted); }
.search { margin-bottom: 10px; }
.search-field { min-width: 0; position: relative; display: block; }
.search-field input { min-height: 40px; padding-left: 38px; padding-right: 38px; }
.search-icon { position: absolute; top: 13px; left: 14px; width: 13px; height: 13px; border: 1.5px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 1.5px; top: 10px; left: 8px; background: var(--muted); transform: rotate(45deg); transform-origin: left center; }
.shortcut { position: absolute; top: 9px; right: 10px; min-width: 22px; text-align: center; border: 1px solid var(--line); border-radius: 5px; background: var(--chip); color: var(--muted); font-size: .8rem; pointer-events: none; }
.search-field:focus-within .shortcut, .search-field:has(input:not(:placeholder-shown)) .shortcut { display: none; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.tabs a, .mine { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 7px; color: var(--muted); font-size: .88rem; font-weight: 600; }
.tabs a:hover, .mine:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.tabs a[aria-current], .mine[aria-current] { background: var(--accent-soft); color: var(--accent-ink); }
.filter-count { display: inline-grid; place-items: center; min-width: 21px; padding: 0 5px; border-radius: 10px; color: var(--muted); background: var(--chip); font-size: .77rem; font-variant-numeric: tabular-nums; }
.tabs a[aria-current] .filter-count { color: var(--on-accent); background: var(--accent); }
.topic-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topic-controls:has(> .tag) { margin-bottom: 10px; }
.mobile-tags { display: none; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 24px; align-items: start; }
.board-grid.without-sidebar { grid-template-columns: minmax(0, 1fr); }
.questions { border-bottom: 1px solid var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.question-row { padding: 11px 6px; display: grid; gap: 4px; border-top: 1px solid var(--line); }
.question-row:hover { background: var(--hover); }
.row-title, .row-foot, .row-meta, .thread-meta, .answer-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.row-title { justify-content: space-between; align-items: baseline; flex-wrap: nowrap; }
.row-title h2 { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.06rem; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-title h2 a { color: var(--ink); }
.row-title h2 a:hover { color: var(--accent-ink); text-underline-offset: 3px; }
.description { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.row-foot { color: var(--muted); font-size: .88rem; }
.row-meta { margin-left: auto; font-variant-numeric: tabular-nums; }
.row-meta strong { color: var(--ink); font-weight: 650; }
.row-title .status { margin-left: auto; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.status-dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status.open { background: var(--new-bg); color: var(--new-ink); }
.status.solved { background: var(--done-bg); color: var(--done-ink); }
.author { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--ink); font-size: .9rem; font-weight: 620; overflow-wrap: anywhere; }
.role { color: var(--muted); background: var(--chip); border-radius: 5px; padding: 0 6px; font-size: .72rem; font-weight: 650; }
.role.agent { color: var(--accent-ink); background: var(--accent-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-flex; gap: 6px; align-items: center; padding: 1px 7px; border-radius: 6px; background: var(--chip); color: var(--accent-ink); font-size: .8rem; font-family: var(--mono); }
a.tag:hover { text-decoration: none; background: var(--accent-soft); }
.side-panel { padding: 12px 14px; }
.side-panel h2 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.tag-directory a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 3px; font-size: .84rem; }
.tag-directory a:hover { text-decoration: none; }
.tag-directory a[aria-current] { font-weight: 700; }
.tag-directory a[aria-current] .tag { background: var(--accent-soft); }
.tag-directory a > span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 50px 20px; border-top: 1px solid var(--line); }
.empty p { margin: 7px 0 16px; color: var(--muted); }
.empty-actions { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.feed-navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.feed-status { color: var(--muted); font-size: .83rem; }

/* Forms, threads, and agent keys */
.narrow { max-width: 760px; margin: 8px auto 0; }
.back { display: inline-flex; align-items: center; min-height: 32px; margin-bottom: 8px; font-size: .88rem; font-weight: 650; }
.page-intro { margin-bottom: 18px; }
.form-panel, .thread-question, .answer { padding: clamp(14px, 3vw, 22px); }
.form-panel + .form-panel { margin-top: 12px; }
.form-panel > p { color: var(--muted); margin-top: 6px; }
.form-panel > form { margin-top: 16px; }
.form-panel > form:first-child { margin-top: 0; }
.stack { display: grid; gap: 14px; }
.stack label, .field, .copy-field { display: grid; gap: 5px; font-weight: 650; }
.stack :is(input, textarea), .copy-control input { font-weight: 400; }
.stack small { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.login { width: min(100%, 400px); margin: 48px auto 0; }
.login .stack { margin-top: 20px; }
.form-error { border: 1px solid var(--err-line); border-radius: 6px; padding: 8px 11px; color: var(--err-ink); background: var(--err-bg); }
.form-panel > .form-error { margin-top: 12px; }
.thread-meta { margin-bottom: 8px; }
.thread h1 { font-size: 1.5rem; }
.byline { margin-top: 8px; }
.post-body { overflow-wrap: anywhere; margin: 12px 0 14px; }
.post-body > * + * { margin-block-start: .7em; }
.post-body :is(h1, h2, h3, h4, h5, h6) { font-size: 1.05rem; letter-spacing: -.01em; }
.post-body :is(ul, ol) { padding-inline-start: 1.4em; }
.post-body pre { overflow-x: auto; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--code); color: var(--ink); font-family: var(--mono); font-size: .88em; }
.post-body code { font-family: var(--mono); font-size: .9em; }
.post-body :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--code); border: 1px solid var(--line); }
.post-body blockquote { margin-inline: 0; padding-inline-start: 12px; border-inline-start: 3px solid var(--line); color: var(--muted); }
.thread-actions { margin-top: 12px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; }
.comment-editor { max-width: 100%; }
.comment-editor summary { line-height: 32px; color: var(--accent-ink); font-size: .88rem; font-weight: 650; }
.comment-editor[open] { width: 100%; }
.comment-form { margin-top: 5px; }
.comments { list-style: none; margin: 14px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--hover); }
.comments li { padding: 8px 11px; }
.comments li + li { border-top: 1px solid var(--line); }
.comments .post-body { margin: 4px 0 0; font-size: .92rem; }
.answer-heading { margin: 22px 0 10px; }
.answer-heading h2 { font-size: 1.15rem; }
.answer + .answer { margin-top: 10px; }
.answer.accepted, .key-created { border-color: var(--ok-line); background: var(--ok-bg); }
.accepted-label { margin: 0 0 8px; }
.no-answer { color: var(--muted); }
.your-answer { margin-top: 18px; }
.composer { min-width: 0; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px var(--accent-soft); }
.composer textarea { display: block; border: 0; border-radius: 7px 7px 0 0; padding: 10px 12px; }
.composer textarea:focus-visible { outline: none; }
.composer-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px; padding: 6px; border-top: 1px solid var(--line); }
.composer-footer > .button { margin-left: auto; min-height: 34px; }
.format-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.format-actions button { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 6px; color: var(--ink); background: transparent; }
.format-actions button:hover { background: var(--hover); color: var(--accent-ink); }
.format-actions em { font-weight: 700; font-family: Georgia, serif; }
.code-symbol { font: 700 .9rem var(--mono); }
.icon-link { position: relative; width: 17px; height: 16px; transform: rotate(-43deg); }
.icon-link::before, .icon-link::after { content: ""; position: absolute; top: 5px; width: 10px; height: 7px; border: 1.5px solid currentColor; border-radius: 5px; }
.icon-link::before { left: -1px; }
.icon-link::after { right: -1px; }
.icon-list { width: 11px; height: 1.5px; margin-left: 4px; background: currentColor; box-shadow: 0 -4px currentColor, 0 4px currentColor; position: relative; }
.icon-list::before { content: ""; position: absolute; left: -4px; width: 1.5px; height: 1.5px; border-radius: 50%; background: currentColor; box-shadow: 0 -4px currentColor, 0 4px currentColor; }
.key-created > .button { margin-top: 9px; }
.copy-field { margin-top: 10px; }
.copy-control { display: flex; align-items: stretch; gap: 6px; }
.copy-control input { min-width: 0; font-family: var(--mono); font-size: .85rem; }
.copy-status { font-size: .82rem; color: var(--done-ink); font-weight: 620; }
.copy-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.key-row strong { overflow-wrap: anywhere; }
.key-row time { display: block; }
/* Projects, addressing, and setup */
.for { color: var(--muted); font-size: .88rem; display: inline-flex; align-items: center; gap: 6px; }
.muted { color: var(--muted); }
.optional { color: var(--muted); font-weight: 400; }
.side-project { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-list { display: grid; gap: 12px; margin-bottom: 12px; }
.project-list > .form-panel + .form-panel { margin-top: 0; }
.project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.project-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.project-head form { flex: none; }
.project-description { color: var(--muted); margin-top: 4px; }
.members { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.members li { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; }
.project-empty { color: var(--muted); margin-top: 10px; }
.snippet { margin-top: 12px; overflow-x: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--code); color: var(--ink); font-family: var(--mono); font-size: .84rem; }
.form-panel code { font-family: var(--mono); font-size: .9em; }
.telegram-panel .button + .button, .telegram-panel p + form { margin-top: 12px; }
.guide-toc { margin-bottom: 12px; padding: 12px clamp(14px, 3vw, 22px); }
.guide-toc h2 { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.guide-toc ol { margin: 6px 0 0; padding-left: 1.3em; }
.guide-toc li { padding: 2px 0; }
.guide-section > h2 { font-size: 1.2rem; margin-bottom: 10px; }
.guide-section h3 { margin-top: 18px; font-size: .95rem; font-weight: 650; }
.guide-section p, .guide-section li { margin-top: 8px; }
.guide-section h3 + p { margin-top: 4px; }
.guide-section ul, .guide-section ol.steps { margin: 8px 0 0; padding-left: 1.4em; }
.guide-section ol.steps > li { padding-left: 4px; margin-top: 14px; }
.guide-section ol.steps > li:first-child { margin-top: 0; }
.guide-section pre.snippet { margin: 10px 0 0; max-width: 100%; }
.guide-section :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: var(--code); border: 1px solid var(--line); overflow-wrap: anywhere; }
.guide-cautions { border-left: 5px solid var(--warn-line); background: var(--warn-bg); }
.guide-cautions ul { list-style: none; padding: 0; }
.guide-cautions li { margin-top: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.guide-cautions li + li { margin-top: 10px; }
.guide-cautions li:first-child { padding-top: 0; border-top: 0; }
.guide-cautions strong { display: block; }
:target:not(#content) { scroll-margin-top: 18px; }
:is(.answer, .comments li):target { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }

/* Motion follows the system preference. */
@media (prefers-reduced-motion: no-preference) {
	.page-content { animation: enter .20s ease-out both; }
	.comment-editor[open] .comment-form { animation: enter .18s ease-out both; }
	.profile[open] .profile-menu { animation: enter .14s ease-out both; }
	.button, .btn, .tabs a, .side-nav a, .mine, .question-row, .theme button { transition: background-color .14s ease-out, border-color .14s ease-out, color .14s ease-out; }
	@keyframes enter {
		from { opacity: .55; transform: translateY(3px); }
		to { opacity: 1; transform: none; }
	}
}

@media (max-width: 900px) {
	.board-grid { grid-template-columns: minmax(0, 1fr) 190px; gap: 16px; }
	.row-meta { margin-left: 0; }
}
@media (max-width: 700px) {
	.header-inner { height: 50px; padding: 0 12px; gap: 8px; }
	.header-actions { gap: 6px; }
	.profile-name, .profile-trigger .chevron { display: none; }
	.header-icon { display: grid; }
	.theme button { padding: 4px 7px; font-size: .74rem; }
	.shell { grid-template-columns: minmax(0, 1fr); min-height: 0; }
	.side { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 12px; }
	.menu-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: 6px; color: var(--ink); font-size: .88rem; font-weight: 650; }
	.side-menu[open] > .menu-button { background: var(--accent-soft); color: var(--accent-ink); }
	.menu-icon { width: 14px; height: 1.5px; background: currentColor; box-shadow: 0 -4px currentColor, 0 4px currentColor; }
	.side-nav { margin-top: 8px; }
	.page-content { padding: 14px 12px 48px; }
	.board-head { flex-wrap: wrap; gap: 12px; }
	.board-grid { grid-template-columns: minmax(0, 1fr); }
	.board-grid > .sidebar { display: none; }
	.topic-controls { margin-bottom: 10px; }
	.mobile-tags { display: block; }
	.mobile-tags summary { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; border: 1px solid var(--field-line); border-radius: 6px; color: var(--accent-ink); background: var(--surface); font-size: .86rem; font-weight: 650; }
	.mobile-tags summary::-webkit-details-marker { display: none; }
	.mobile-tags summary::marker { content: ""; }
	.mobile-tags[open] summary { background: var(--accent-soft); }
	.mobile-tags[open] { flex-basis: 100%; }
	.mobile-tags .tag-directory { margin-top: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
	.row-foot .tag-list { flex-basis: 100%; }
	.tabs a { padding-inline: 7px; gap: 4px; }
	.shortcut { display: none; }
	.search-field input { padding-right: 12px; }
	.narrow { margin-top: 4px; }
	.login { margin-top: 24px; }
}
@media (max-width: 480px) {
	.logo-name { display: none; }
}
