:root {
	color-scheme: dark;
	--bg: #0b0d10;
	--bg-elevated: rgba(21, 24, 30, .84);
	--bg-soft: rgba(255, 255, 255, .055);
	--surface: rgba(24, 28, 35, .72);
	--surface-2: rgba(255, 255, 255, .07);
	--surface-strong: rgba(32, 37, 46, .9);
	--text: #f4f0e8;
	--text-soft: #d8d0c5;
	--muted: #9c958c;
	--line: rgba(255, 255, 255, .115);
	--line-strong: rgba(255, 255, 255, .18);
	--accent: #c63a3d;
	--accent-strong: #ef5558;
	--accent-soft: rgba(198, 58, 61, .16);
	--focus: #f0b35a;
	--glass: rgba(255, 255, 255, .065);
	--glass-strong: rgba(255, 255, 255, .105);
	--shadow: 0 18px 52px rgba(0, 0, 0, .34);
	--shadow-soft: 0 10px 28px rgba(0, 0, 0, .22);
	--radius: 8px;
	--content-width: 780px;
	--reader-size: 1rem;
}

:root[data-theme="light"] {
	color-scheme: light;
	--bg: #f5f7fb;
	--bg-elevated: rgba(255, 255, 255, .86);
	--bg-soft: rgba(15, 23, 42, .045);
	--surface: rgba(255, 255, 255, .78);
	--surface-2: rgba(15, 23, 42, .055);
	--surface-strong: rgba(255, 255, 255, .94);
	--text: #141922;
	--text-soft: #303846;
	--muted: #697282;
	--line: rgba(15, 23, 42, .12);
	--line-strong: rgba(15, 23, 42, .18);
	--accent: #b8353a;
	--accent-strong: #d34147;
	--accent-soft: rgba(184, 53, 58, .12);
	--glass: rgba(255, 255, 255, .68);
	--glass-strong: rgba(255, 255, 255, .82);
	--shadow: 0 18px 46px rgba(30, 41, 59, .12);
	--shadow-soft: 0 10px 26px rgba(30, 41, 59, .08);
}
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.6;
	letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }

.sr-only,
.skip-link {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	z-index: 1000;
	left: 16px;
	top: 16px;
	width: auto;
	height: auto;
	padding: 10px 12px;
	clip: auto;
	background: var(--surface);
	border: 1px solid var(--focus);
	border-radius: var(--radius);
}

.page-shell { min-height: 100vh; /*padding-bottom: 68px;*/ }

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	display: grid;
	grid-template-columns: auto minmax(180px, 520px) auto;
	gap: 16px;
	align-items: center;
	padding: 12px clamp(14px, 3vw, 34px);
	background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
	border-bottom: 1px solid var(--line);
	backdrop-filter: blur(12px);
	will-change: transform;
	transition: transform .22s ease, background-color .18s ease;
}

.site-header.is-hidden {
	transform: translateY(-105%);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: white; }
.brand__text { font-size: 20px; }

.header-search { display: flex; min-width: 0; }
.header-search input {
	width: 100%;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	background: var(--bg-soft);
	color: var(--text);
}
.header-search button,
.icon-button {
	min-width: 42px;
	min-height: 40px;
	border: 1px solid var(--line);
	background: var(--surface-2);
	color: var(--text);
	border-radius: 0 8px 8px 0;
	cursor: pointer;
}

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.header-actions .icon-button { border-radius: 8px; }

.site-frame {
	display: grid;
	grid-template-columns: 86px minmax(0, 1fr);
	gap: 24px;
	width: min(1440px, 100%);
	margin: 0 auto;
	padding: 22px clamp(14px, 3vw, 34px) 48px;
}

.side-nav {
	position: sticky;
	top: 78px;
	display: grid;
	align-content: start;
	gap: 8px;
	height: calc(100vh - 100px);
}
.side-nav__item {
	display: grid;
	justify-items: center;
	gap: 4px;
	padding: 10px 6px;
	border-radius: var(--radius);
	color: var(--muted);
}
.side-nav__item span { font-size: 20px; line-height: 1; }
.side-nav__item b { font-size: 11px; font-weight: 600; }
.side-nav__item:hover { background: var(--surface); color: var(--text); }

.site-main { min-width: 0; }

.intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 20px;
	align-items: end;
	margin-bottom: 22px;
	padding: 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}
.intro__eyebrow { margin: 0 0 4px; color: var(--accent-strong); font-weight: 800; }
.intro h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 46px); line-height: 1.08; }
.intro p { margin: 0; color: var(--text-soft); max-width: 680px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text);
	font-weight: 700;
}
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--small { min-height: 34px; font-size: 14px; }
.button--wide { width: 100%; }

.content-layout { display: grid; grid-template-columns: minmax(0, var(--content-width)) minmax(270px, 340px); gap: 24px; align-items: start; }
.content-feed { min-width: 0; }

.story-card,
.story-full,
.side-block,
.comment,
.comment-form,
.search-result,
.profile,
.static-page,
.related-block,
.story-comments {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

[id^="comment-id-"] {
	scroll-margin-top: 88px;
}

.story-card { padding: 18px; margin-bottom: 16px; }
.story-card__meta,
.story-full__meta,
.story-card__footer,
.story-full__footer,
.story-card__actions,
.story-full__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	color: var(--muted);
	font-size: 14px;
}
.story-card h2 { margin: 8px 0 0; font-size: clamp(22px, 4vw, 30px); line-height: 1.18; }
.story-card__badges { margin: 12px 0; }
/* Story badges from legacy plash.tpl */
.story-card__badges,
.story-full__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	min-height: 34px;
}

.story-card__badges > span,
.story-full__badges > span {
	display: inline-flex;
}

.icon_archive abbr,
.icon_goldf abbr,
.icon_pobed abbr,
.icon_author abbr,
.icon_humor abbr,
.icon_zhest abbr,
.icon_bez abbr,
.icon_kl abbr,
.icon_specialfor abbr,
.icon_wtf abbr {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: transparent !important;
	text-decoration: none !important;
	border-bottom: 0 !important;
	cursor: help !important;
	transition: color .18s ease, background .18s ease, transform .18s ease;
}

.icon_archive abbr { color: #36b37e; }
.icon_goldf abbr,
.icon_pobed abbr { color: #c9a227; }
.icon_author abbr { color: #4c9aff; }
.icon_humor abbr { color: #e879b9; }
.icon_zhest abbr { color: #ef4444; }
.icon_bez abbr,
.icon_kl abbr { color: var(--muted); }
.icon_specialfor abbr { color: #60a5fa; }
.icon_wtf abbr { color: #a78bfa; }

.icon_archive abbr:hover,
.icon_goldf abbr:hover,
.icon_pobed abbr:hover,
.icon_author abbr:hover,
.icon_humor abbr:hover,
.icon_zhest abbr:hover,
.icon_bez abbr:hover,
.icon_kl abbr:hover,
.icon_specialfor abbr:hover,
.icon_wtf abbr:hover {
	background: transparent !important;
	transform: translateY(-1px);
}

.icon_archive i,
.icon_goldf i,
.icon_pobed i,
.icon_author i,
.icon_humor i,
.icon_zhest i,
.icon_bez i,
.icon_kl i,
.icon_specialfor i,
.icon_wtf i {
	font-size: 21px !important;
	line-height: 1;
}
.story-card__badges:empty { display: none; }
.story-card__body { color: var(--text-soft); }
.story-card__footer { justify-content: space-between; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.story-card__tags { min-width: 0; }

.top-selector {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.top-selector__link {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	min-height: 86px;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text);
	text-decoration: none;
	transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.top-selector__link:hover,
.top-selector__link:focus-visible {
	border-color: var(--accent-strong);
	background: var(--surface-strong);
	transform: translateY(-2px);
	outline: none;
}

.top-selector__icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--accent) 16%, transparent);
	color: var(--accent-strong);
	font-size: 18px;
}

.top-selector__title,
.top-selector__meta {
	display: block;
}

.top-selector__title {
	font-size: 16px;
	font-weight: 800;
}

.top-selector__meta {
	margin-top: 4px;
	color: var(--muted);
	font-size: 13px;
}

.ranking-page {
	padding: clamp(18px, 3vw, 30px);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}

.ranking-page__header {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--line);
}

.ranking-page__eyebrow {
	margin: 0 0 5px;
	color: var(--accent-strong);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.ranking-page__header h1 {
	margin: 0;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.1;
}

.ranking-page__header p:last-child {
	margin: 9px 0 0;
	color: var(--muted);
	line-height: 1.55;
}

.ranking-list {
	display: grid;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ranking;
}

.ranking-item {
	counter-increment: ranking;
}

.ranking-item + .ranking-item {
	border-top: 1px solid var(--line);
}

.ranking-item__link {
	display: grid;
	grid-template-columns: 42px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	min-width: 0;
	padding: 16px 12px;
	border: 1px solid transparent;
	border-radius: calc(var(--radius) - 3px);
	color: var(--text);
	text-decoration: none;
	transition: border-color .18s ease, background-color .18s ease;
}

.ranking-item__link:hover,
.ranking-item__link:focus-visible {
	border-color: var(--line);
	background: var(--surface-2);
	outline: none;
}

.ranking-item__number {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 10px;
	background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
	color: var(--accent-strong);
	font-size: 16px;
	font-weight: 850;
}

.ranking-item__number::before {
	content: counter(ranking, decimal-leading-zero);
}

.ranking-item__body {
	display: block;
	min-width: 0;
}

.ranking-item__title {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 17px;
}

.ranking-item__meta {
	display: block !important;
	margin-top: 14px;
	color: var(--muted);
	font-size: 12px;
}

.ranking-item__author-line {
	display: inline-flex !important;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px;
}

.ranking-item__author {
	display: inline;
	color: var(--text-soft);
	font-weight: 650;
}

.ranking-item__author-line a,
.ranking-item__meta > a {
	display: inline !important;
	margin: 0 !important;
	color: var(--text-soft);
	font-weight: 650;
	text-decoration: none;
}

.ranking-item__stats {
	display: flex !important;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 9px;
}

.ranking-item__stats-item {
	display: inline-block;
	padding: 5px 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--surface-2);
	white-space: nowrap;
}

.story-full { max-width: 900px; margin: 0 auto; padding: clamp(18px, 4vw, 38px); }
.story-full__topline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.story-full h1 { margin: 10px 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.08; }
.story-full__source { color: var(--muted); }
.story-full__content { margin-top: 24px; font-size: var(--reader-size); line-height: 1.82; color: var(--text-soft); }
.story-full__content p { margin: 0 0 1.1em; }
.story-full__footer { justify-content: space-between; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }

.random-story-nav {
	display: flex;
	justify-content: center;
}

.random-story-nav--top {
	margin: 0 0 22px;
}

.random-story-nav--bottom {
	margin: 28px 0 0;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}

.random-story-nav__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text);
	font-weight: 750;
	text-decoration: none;
	transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.random-story-nav__link:hover,
.random-story-nav__link:focus-visible {
	border-color: var(--accent-strong);
	background: var(--surface-strong);
	color: var(--accent-strong);
	text-decoration: none;
	transform: translateY(-1px);
}

.random-story-nav__link:focus-visible {
	outline: 2px solid var(--accent-soft);
	outline-offset: 3px;
}

.reader-tools { display: flex; gap: 6px; }
.reader-tools button {
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text);
	cursor: pointer;
}

.sidebar { display: grid; gap: 16px; }
.side-block { padding: 16px; }
.side-block--accent { background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.side-block h2 { margin: 0 0 10px; font-size: 18px; }
.side-block p { margin: 0 0 12px; color: var(--text-soft); }
.side-block__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.side-block__head a, .side-links a { color: var(--muted); font-size: 14px; }
.side-links { display: grid; gap: 8px; }

.category-menu { margin: 0; padding-left: 18px; color: var(--text-soft); }

.login-box__form,
.login-box__user { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.login-box__form label { font-size: 14px; color: var(--muted); }
.login-box__form input {
	width: 160px;
	min-height: 38px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-soft);
	color: var(--text);
	padding: 0 10px;
}
.login-box__links { display: flex; gap: 10px; width: 100%; font-size: 14px; color: var(--muted); }
.login-box__user { justify-content: flex-end; font-size: 14px; color: var(--muted); }
.login-box__user strong { color: var(--text); }

.related-block,
.story-comments { margin-top: 18px; padding: 18px; }
.related-block h2,
.story-comments h2 { margin-top: 0; font-size: 22px; }

.site-footer {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	padding: 24px clamp(14px, 3vw, 34px) 88px;
	border-top: 1px solid var(--line);
	color: var(--muted);
}
.site-footer p { margin: 0; font-weight: 800; color: var(--text); }
.site-footer nav { display: flex; gap: 14px; flex-wrap: wrap; }

.mobile-nav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60;
	display: none;
	grid-template-columns: repeat(5, 1fr);
	background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
	border-top: 1px solid var(--line);
	backdrop-filter: blur(12px);
}
.mobile-nav a,
.mobile-nav button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; border: 0; color: var(--muted); background: transparent; font: inherit; cursor: pointer; }
.mobile-nav span { font-size: 19px; line-height: 1; }
.mobile-nav b { font-size: 10px; font-weight: 600; }

@media (max-width: 1100px) {
	.content-layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
	.page-shell { padding-bottom: 64px; }
	.site-header { grid-template-columns: 1fr auto; gap: 10px; }
	.header-search { grid-column: 1 / -1; order: 3; }
	.header-actions { min-width: 0; }
	.site-frame { display: block; padding: 14px 12px 34px; }
	.side-nav { display: none; }
	.mobile-nav { display: grid; }
	.intro { grid-template-columns: 1fr; padding: 16px; }
	.quick-actions .button { flex: 1 1 calc(50% - 8px); }
	.sidebar { grid-template-columns: 1fr; }
	.story-card { padding: 16px; }
	.top-selector { grid-template-columns: 1fr; }
	.story-card__footer,
	.story-full__footer,
	.story-full__topline { align-items: stretch; flex-direction: column; }
	.login-box__form input,
	.login-box__form .button { width: 100%; }
	.site-footer { flex-direction: column; }
}

@media (max-width: 560px) {
	.ranking-page { padding: 16px; }
	.ranking-item__link { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
	.ranking-item__number { width: 36px; height: 36px; }
}




.tooltip {
	pointer-events: auto;
}

.tooltip a {
	color: #fff;
	font-weight: 800;
	text-decoration: underline;
	text-underline-offset: 2px;
}


.story-card__badges abbr,
.story-full__badges abbr {
	width: 42px !important;
	height: 42px !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

.story-card__badges abbr i,
.story-full__badges abbr i {
	font-size: 24px !important;
}
.kriper-tooltip {
	position: fixed;
	z-index: 1080;
	max-width: min(280px, calc(100vw - 16px));
	padding: 8px 10px;
	border-radius: 6px;
	background: #050507;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	text-align: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.08s ease;
}

.kriper-tooltip.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.kriper-tooltip a {
	color: #fff;
	font-weight: 900;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Login dialog */
.login-box { display: flex; justify-content: flex-end; }
.login-box > [data-login-open] { white-space: nowrap; }
.login-dialog {
	width: min(460px, calc(100vw - 28px));
	max-width: none;
	max-height: min(90vh, 760px);
	padding: 24px;
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	background: var(--surface-strong);
	color: var(--text);
	box-shadow: var(--shadow);
}
.login-dialog::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(3px); }
.login-dialog__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.login-dialog__header h2 { margin: 0; font-size: 22px; }
.login-dialog__header .icon-button { border-radius: 8px; }
.login-dialog__form { display: grid; gap: 9px; }
.login-dialog__form label { color: var(--text-soft); font-size: 14px; font-weight: 700; }
.login-dialog__form input:not([type="hidden"]) { width: 100%; min-height: 42px; }
.login-dialog__links { display: flex; justify-content: space-between; gap: 12px; margin: 3px 0 8px; color: var(--muted); font-size: 13px; }
.login-dialog__social { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-dialog__social p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.login-dialog__social > div { display: flex; flex-wrap: wrap; gap: 8px; }
.login-dialog__social .button { min-height: 38px; gap: 8px; }
.account-menu { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 14px; }

/* Old-style section hierarchy inside the slide-out navigation. */
.main-menu__panel {
	margin-top: 20px;
	padding: 14px 0 8px;
	border-radius: 14px;
	background: rgba(0, 0, 0, .34);
	overflow: hidden;
}
:root[data-theme="light"] .main-menu__panel { background: rgba(15, 23, 42, .055); }
.main-menu__panel-title { display: block; padding: 0 16px 8px; color: var(--muted); font-size: 14px; }
.main-menu__nav { display: grid; gap: 0; }
.main-menu__nav > a,
.main-menu__group > summary {
	position: relative;
	display: flex;
	min-height: 48px;
	align-items: center;
	gap: 10px;
	padding: 0 16px;
	color: var(--text-soft);
	font-size: 15px;
	cursor: pointer;
}
.main-menu__nav > a:hover,
.main-menu__group > summary:hover,
.main-menu__group[open] > summary { background: var(--surface-2); color: var(--accent-strong); }
.main-menu__nav > a > i:first-child,
.main-menu__group > summary > i:first-child { width: 18px; color: var(--muted); text-align: center; }
.main-menu__nav > a:hover > i:first-child,
.main-menu__group[open] > summary > i:first-child { color: var(--accent-strong); }
.main-menu__group { margin: 0; }
.main-menu__group > summary { list-style: none; }
.main-menu__group > summary::-webkit-details-marker { display: none; }
.main-menu__group > summary::marker { content: ""; }
.main-menu__group > summary > span { flex: 1; }
.main-menu__chevron { margin-left: auto; font-size: 11px; transition: transform .16s ease; }
.main-menu__group[open] .main-menu__chevron { transform: rotate(180deg); }
.main-menu__submenu { display: grid; padding: 2px 0 8px; }
.main-menu__submenu a {
	display: flex;
	min-height: 42px;
	align-items: center;
	gap: 10px;
	padding: 0 16px 0 34px;
	color: var(--muted);
	font-size: 14px;
}
.main-menu__submenu a > i { width: 16px; text-align: center; }
.main-menu__submenu a:hover { background: var(--surface-2); color: var(--text); }
.main-menu__publish { margin-top: 14px; border-radius: 999px; }

/* Story submission form */
.add-story {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: clamp(18px, 4vw, 34px);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.add-story__header { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.add-story__eyebrow { margin: 0 0 4px; color: var(--accent-strong); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.add-story__header h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.add-story__header > p:last-child { margin: 8px 0 0; color: var(--muted); }
.add-story__form { display: grid; gap: 12px; }
.add-story__field-label { display: block; margin: 0 0 6px; color: var(--text-soft); font-size: 14px; font-weight: 750; }
.add-story__input,
.add-story__textarea { width: 100%; }
.add-story__input { min-height: 44px; }
.add-story__category select { width: 100%; min-height: 44px; }
.add-story__editor { display: grid; }
.add-story__bbcode { margin-bottom: 8px; }
.add-story__textarea { min-height: 340px; resize: vertical; line-height: 1.65; }
.add-story__xfields { display: grid; gap: 12px; }
.add-story__xfields:empty { display: none; }
.add-story__field { display: grid; gap: 6px; }
.add-story__captcha { display: grid; gap: 8px; justify-items: start; }
.add-story__captcha img { max-width: 100%; }
.add-story__actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.add-story__actions p { margin: 0; color: var(--muted); font-size: 13px; }
.add-story__admin { margin-top: 12px; }

@media (max-width: 560px) {
	.login-dialog { padding: 18px; }
	.login-dialog__links { flex-direction: column; gap: 6px; }
	.login-dialog__social .button { flex: 1 1 calc(50% - 8px); }
	.add-story__actions { align-items: stretch; flex-direction: column; }
}
.story-card__header {
	display: grid;
	gap: 10px;
}

.story-card__topline {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: start;
}

.story-card__topline h2 {
	margin: 0;
}

.story-card__tools {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	color: var(--muted);
}

.story-card__tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.story-card__author {
	color: var(--text-soft);
	font-size: 14px;
}

.story-card__meta {
	padding-top: 10px;
	border-top: 1px solid var(--line);
}

.story-card__meta span,
.story-card__action,
.story-card__views,
.story-card__rating {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.story-card__meta i,
.story-card__actions i {
	color: var(--muted);
}

.story-card__badges {
	justify-content: center;
	padding: 8px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.story-card__body {
	font-size: var(--reader-size);
	line-height: 1.75;
}

.story-card__footer {
	align-items: flex-end;
	gap: 16px;
}

.story-card__tags {
	flex: 1 1 260px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.6;
}

.story-card__tags a {
	color: var(--muted);
}

.story-card__tags a:hover {
	color: var(--accent);
}

.story-card__actions {
	justify-content: flex-end;
	gap: 12px;
	font-size: 14px;
}

.story-card__action,
.story-card__views,
.story-card__favorite,
.story-card__rating-value {
	color: var(--text-soft);
}

.story-card__action a,
.story-card__favorite a {
	color: inherit;
}

.story-card__rating-value {
	font-weight: 800;
}

.story-card__read {
	margin-left: 4px;
}

@media (max-width: 640px) {
	.story-card__topline {
		grid-template-columns: 1fr;
	}

	.story-card__tools {
		order: -1;
		justify-content: flex-end;
	}

	.story-card__footer {
		align-items: stretch;
	}

	.story-card__actions {
		justify-content: flex-start;
	}

	.story-card__read {
		width: 100%;
		margin-left: 0;
	}
}
.story-card__favorite a,
.story-full__actions a {
	display: inline-flex;
	align-items: center;
	color: inherit;
}

.story-card__favorite img,
.story-full__actions img {
	display: none !important;
}

.story-card__action.is-active i,
.story-card__favorite .is-active i {
	color: #f5c451;
}

.story-full__header {
	display: grid;
	gap: 12px;
}

.story-full__titleline {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 14px;
	align-items: start;
}

.story-full__titleline h1 {
	margin: 0;
}

.story-full__meta {
	padding-top: 12px;
	border-top: 1px solid var(--line);
}

.story-full__meta span {
	display: inline-flex;
	gap: 6px;
	align-items: center;
}

.story-full__meta i,
.story-full__actions i {
	color: var(--muted);
}

.story-full__source {
	font-size: 15px;
}

.story-full__tags {
	flex: 1 1 280px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.6;
}

.story-full__tags a {
	color: var(--muted);
}

.story-full__tags a:hover {
	color: var(--accent);
}

.story-full__footer {
	align-items: flex-end;
	gap: 16px;
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
}

.story-full__actions {
	justify-content: flex-end;
	gap: 12px;
	font-size: 14px;
}

.story-card__comments,
.story-card__views {
	white-space: nowrap;
}

@media (max-width: 640px) {
	.random-story-nav__link {
		width: 100%;
		padding-inline: 14px;
		font-size: 14px;
	}

	.story-full__titleline {
		grid-template-columns: 1fr;
	}

	.story-full__footer {
		align-items: stretch;
	}

	.story-full__actions {
		justify-content: flex-start;
	}
}
/* Modern visual layer */
body {
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent) 0, transparent 360px),
		linear-gradient(135deg, color-mix(in srgb, var(--bg) 86%, #18202a) 0%, var(--bg) 58%, color-mix(in srgb, var(--bg) 82%, #151a21) 100%);
	font-feature-settings: "kern" 1;
	text-rendering: optimizeLegibility;
}

:root[data-theme="light"] body {
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent) 0, transparent 340px),
		linear-gradient(135deg, #f7f9fc 0%, var(--bg) 56%, #eef3f8 100%);
}

.site-header {
	grid-template-columns: auto minmax(220px, 560px) minmax(0, auto);
	margin: 10px clamp(10px, 2vw, 24px) 0;
	border: 1px solid var(--line);
	border-radius: 0 0 8px 8px;
	background: var(--bg-elevated);
	box-shadow: var(--shadow-soft);
	backdrop-filter: blur(18px) saturate(145%);
}

.brand {
	letter-spacing: .01em;
}

.brand__mark {
	background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-strong) 74%, #ff9a7b));
	box-shadow: 0 10px 24px var(--accent-soft);
}

.brand__text {
	font-size: 18px;
	letter-spacing: .04em;
}

.header-search input,
.header-search button,
.icon-button,
.reader-tools button {
	background: var(--glass);
	border-color: var(--line);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.header-search input:focus,
.header-search button:focus-visible,
.icon-button:focus-visible,
.reader-tools button:focus-visible,
.button:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--focus) 70%, transparent);
	outline-offset: 2px;
}

.header-search input::placeholder {
	color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.header-search button:hover,
.icon-button:hover,
.reader-tools button:hover {
	background: var(--glass-strong);
	color: var(--accent-strong);
}

#searchsuggestions {
	position: absolute !important;
	z-index: 2000 !important;
	width: min(380px, calc(100vw - 24px));
	max-height: min(420px, calc(100vh - 100px));
	overflow-y: auto;
	margin-top: 14px;
	padding: 6px;
	border: 1px solid var(--line-strong);
	border-radius: 12px;
	background: var(--surface-strong);
	box-shadow: var(--shadow);
	color: var(--text);
}

#searchsuggestions > a,
#searchsuggestions .seperator a {
	display: grid;
	gap: 4px;
	padding: 10px 12px;
	border-radius: 8px;
	color: var(--text);
	text-decoration: none;
	transition: background-color .16s ease, color .16s ease;
}

#searchsuggestions > a:hover,
#searchsuggestions > a:focus-visible,
#searchsuggestions .seperator a:hover,
#searchsuggestions .seperator a:focus-visible {
	background: var(--surface-2);
	color: var(--accent-strong);
	text-decoration: none;
	outline: none;
}

#searchsuggestions .searchheading,
#searchsuggestions .search-suggestion__title {
	display: block;
	color: inherit;
	font-weight: 800;
}

#searchsuggestions .search-suggestion__excerpt {
	display: block;
	overflow: hidden;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.45;
	text-overflow: ellipsis;
	white-space: nowrap;
}

#searchsuggestions .seperator {
	display: block;
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid var(--line);
}

#searchsuggestions .seperator a {
	color: var(--accent-strong);
	font-size: 13px;
	font-weight: 700;
}

#searchsuggestions .notfound {
	display: block;
	padding: 10px 12px;
	color: var(--muted);
	font-size: 14px;
}

.site-frame {
	grid-template-columns: 78px minmax(0, 1fr);
	padding-top: 24px;
}

.side-nav {
	top: 86px;
	gap: 10px;
}

.side-nav__item {
	min-height: 66px;
	border: 1px solid transparent;
	background: transparent;
	transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}

.side-nav__item span {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: var(--glass);
	border: 1px solid var(--line);
	font-size: 15px;
}

.side-nav__item:hover {
	background: var(--surface);
	border-color: var(--line);
	box-shadow: var(--shadow-soft);
	transform: translateY(-1px);
}

.intro {
	position: relative;
	overflow: hidden;
	padding: clamp(18px, 3vw, 28px);
	background: linear-gradient(135deg, var(--surface-strong), var(--surface));
	border-color: var(--line-strong);
	backdrop-filter: blur(18px) saturate(135%);
}

.intro::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, var(--accent-soft), transparent 42%);
	opacity: .72;
}

.intro__content,
.quick-actions {
	position: relative;
}

.intro__eyebrow {
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.intro h1 {
	max-width: 760px;
	font-weight: 850;
}

.button {
	background: var(--glass);
	border-color: var(--line);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
	transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.button:hover {
	background: var(--glass-strong);
	border-color: var(--line-strong);
	transform: translateY(-1px);
	box-shadow: var(--shadow-soft);
}

.button--primary {
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	border-color: transparent;
	box-shadow: 0 12px 28px var(--accent-soft);
}

.story-card,
.story-full,
.side-block,
.comment,
.comment-form,
.search-result,
.profile,
.static-page,
.related-block,
.story-comments {
	background: var(--surface);
	border-color: var(--line);
	box-shadow: var(--shadow-soft);
	backdrop-filter: blur(16px) saturate(130%);
}

.story-card,
.side-block {
	transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, background .16s ease;
}

.story-card:hover,
.side-block:hover {
	border-color: var(--line-strong);
	box-shadow: var(--shadow);
}

.story-card h2 a,
.story-full h1 {
	font-weight: 850;
}

.story-card__meta,
.story-full__meta,
.story-card__author,
.story-full__source {
	color: var(--muted);
}

.story-card__badges {
	background: color-mix(in srgb, var(--glass) 54%, transparent);
	border-radius: 8px;
}

.sidebar {
	gap: 16px;
}

.side-block {
	padding: 18px;
}

.side-block h2 {
	margin: 0 0 10px;
	font-size: 18px;
	font-weight: 820;
}

.side-block p {
	color: var(--text-soft);
}

.side-block--accent {
	background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface));
}

.side-block__head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
}

.side-list,
.side-links,
.category-menu {
	display: grid;
	gap: 8px;
}

.side-links a,
.category-menu a,
.mini-comment a {
	color: var(--text-soft);
}

.side-links a:hover,
.category-menu a:hover,
.mini-comment a:hover {
	color: var(--accent-strong);
}

.mobile-nav {
	background: var(--bg-elevated);
	border-top-color: var(--line);
	box-shadow: 0 -16px 34px rgba(0, 0, 0, .22);
	backdrop-filter: blur(18px) saturate(145%);
}

.mobile-nav a,
.mobile-nav button {
	transition: color .16s ease, background .16s ease;
}

.mobile-nav a:hover,
.mobile-nav button:hover,
.mobile-nav button:focus-visible {
	background: var(--glass);
	color: var(--accent-strong);
}

.side-nav__menu {
	width: 100%;
	border: 1px solid transparent;
	font: inherit;
	cursor: pointer;
}

@media (max-width: 860px) {
	.site-header {
		margin: 0;
		border-left: 0;
		border-right: 0;
		border-top: 0;
		border-radius: 0;
	}

	.site-frame {
		padding-top: 14px;
	}

	.intro {
		gap: 18px;
	}
}


/* Modern front page shell */
.site-header {
	grid-template-columns: 150px minmax(240px, 380px) minmax(0, 1fr);
	align-items: center;
	max-width: none;
	margin: 0;
	padding: 22px clamp(16px, 2vw, 28px);
	border: 0;
	border-radius: 0;
	background: rgba(15, 16, 18, .72);
	box-shadow: none;
	backdrop-filter: blur(18px) saturate(130%);
}

[data-theme="light"] .site-header {
	background: rgba(247, 248, 250, .78);
}

.brand {
	min-width: 0;
}

.brand__mark {
	display: none;
}

.brand__text {
	font-size: 28px;
	font-weight: 950;
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--text);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .08);
}

.header-search {
	max-width: 380px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .055);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.header-search input {
	height: 42px;
	border-radius: 999px 0 0 999px;
	background: transparent;
	border-color: transparent;
}

.header-search button {
	width: 48px;
	border-radius: 0 999px 999px 0;
	background: transparent;
	border-color: transparent;
}

.header-actions {
	justify-self: end;
}

.site-frame {
	width: min(1760px, 100%);
	grid-template-columns: 64px minmax(0, 1fr);
	gap: clamp(18px, 2.4vw, 36px);
	padding: clamp(26px, 3.2vw, 46px) clamp(14px, 2vw, 28px) 72px 12px;
}

.side-nav {
	top: 112px;
	justify-items: center;
	gap: 12px;
}

.side-nav__item {
	width: 46px;
	min-height: 46px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
}

.side-nav__item span {
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .055);
	font-size: 17px;
}

.side-nav__item b {
	display: none;
}

.side-nav__item:hover {
	background: transparent;
	box-shadow: none;
	transform: translateY(-1px);
}

.side-nav__item:hover span {
	background: rgba(255, 255, 255, .105);
	color: var(--text);
}

.site-main {
	min-width: 0;
}

.content-layout {
	grid-template-columns: minmax(0, 1fr) minmax(340px, 436px);
	gap: clamp(20px, 2vw, 30px);
	align-items: start;
}

.content-feed {
	min-width: 0;
}

.top-rail {
	display: grid;
	grid-template-columns: repeat(5, minmax(160px, 1fr));
	gap: 10px;
	margin: 0 0 30px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
}

.top-rail__item {
	position: relative;
	isolation: isolate;
	min-height: clamp(150px, 12vw, 205px);
	border-radius: 8px;
	overflow: hidden;
	background: linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .025));
	box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.top-rail__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-color: #1e2024;
	background-position: center;
	background-size: cover;
	transition: transform .22s ease, filter .22s ease;
}

.top-rail__item:hover .top-rail__media {
	transform: scale(1.035);
	filter: saturate(1.08) contrast(1.04);
}

.top-rail__title {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 14px;
	display: inline-flex;
	width: fit-content;
	max-width: calc(100% - 28px);
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(18, 19, 22, .72);
	color: #f5f5f5;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	box-shadow: 0 10px 22px rgba(0, 0, 0, .24);
	backdrop-filter: blur(10px);
}

.story-card {
	margin-bottom: 16px;
	padding: clamp(18px, 2vw, 24px);
	border-radius: 12px;
	background: rgba(28, 29, 32, .82);
	border-color: rgba(255, 255, 255, .08);
	box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

[data-theme="light"] .story-card {
	background: rgba(255, 255, 255, .82);
}

.story-card:hover {
	transform: none;
	border-color: rgba(255, 255, 255, .13);
}

.story-card h2 {
	font-size: clamp(29px, 3vw, 42px);
	line-height: 1.08;
	letter-spacing: -.02em;
}

.story-card__meta {
	gap: 10px 16px;
}

.story-card__text {
	font-size: 16px;
	line-height: 1.72;
}

.sidebar {
	position: sticky;
	top: 96px;
	gap: 16px;
}

.side-block {
	padding: 18px 20px;
	border-radius: 14px;
	background: rgba(28, 29, 32, .76);
	border-color: rgba(255, 255, 255, .075);
	box-shadow: 0 16px 38px rgba(0, 0, 0, .16);
}

[data-theme="light"] .side-block {
	background: rgba(255, 255, 255, .78);
}

.side-block:hover {
	transform: none;
}

.side-block__head {
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}

.side-block h2 {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 17px;
}

.side-block__head a {
	font-size: 13px;
	color: var(--text-soft);
}

.side-list--comments {
	gap: 12px;
	padding-top: 14px;
}

.side-block--random .button {
	margin-top: 8px;
}

.side-block--compact .side-links {
	gap: 10px;
}

.side-block--about {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	padding: 4px 4px 0;
	color: var(--muted);
}

.side-block--about:hover {
	border-color: transparent;
	box-shadow: none;
}

.side-links--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin-bottom: 10px;
}

.side-block--about p {
	font-size: 13px;
	line-height: 1.55;
}

@media (max-width: 1280px) {
	.content-layout {
		grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
	}

	.top-rail {
		grid-template-columns: repeat(5, minmax(180px, 1fr));
	}
}

@media (max-width: 1080px) {
	.site-header {
		grid-template-columns: 1fr auto;
		gap: 14px;
	}

	.header-search {
		grid-column: 1 / -1;
		grid-row: 2;
		max-width: none;
	}

	.content-layout {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: static;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		display: grid;
	}
}

@media (max-width: 860px) {
	.site-frame {
		display: block;
		padding: 16px 12px 84px;
	}

	.top-rail {
		display: flex;
		gap: 10px;
		margin-bottom: 18px;
		padding-bottom: 4px;
	}

	.top-rail__item {
		min-width: 235px;
		min-height: 142px;
	}

	.sidebar {
		display: grid;
		grid-template-columns: 1fr;
	}

	.story-card h2 {
		font-size: 28px;
	}
}

@media (max-width: 560px) {
	.site-header {
		padding: 16px 12px;
	}

	.brand__text {
		font-size: 24px;
	}

	.story-card {
		border-radius: 10px;
	}
}

/* Logo, side menu hints and pagination polish */
.brand__text {
	font-family: Impact, Haettenschweiler, "Arial Black", sans-serif;
	font-size: 30px;
	font-weight: 900;
	letter-spacing: -.045em;
	line-height: .95;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--text) 72%, var(--muted));
	text-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 12px 26px rgba(0, 0, 0, .28);
}

[data-theme="light"] .brand__text {
	color: color-mix(in srgb, var(--text) 84%, var(--muted));
	text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 12px 24px rgba(20, 24, 32, .14);
}

.side-nav__item {
	position: relative;
}

.side-nav__item b {
	position: absolute;
	left: calc(100% + 10px);
	top: 50%;
	z-index: 20;
	display: block;
	width: max-content;
	max-width: 190px;
	padding: 6px 9px;
	border-radius: 8px;
	background: rgba(10, 10, 12, .92);
	color: #f5f5f5;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.15;
	white-space: nowrap;
	box-shadow: 0 14px 30px rgba(0, 0, 0, .24);
	opacity: 0;
	pointer-events: none;
	transform: translate3d(-4px, -50%, 0);
	transition: opacity .12s ease, transform .12s ease;
}

.side-nav__item b::before {
	content: "";
	position: absolute;
	right: 100%;
	top: 50%;
	border: 5px solid transparent;
	border-right-color: rgba(10, 10, 12, .92);
	transform: translateY(-50%);
}

.side-nav__item:hover b,
.side-nav__item:focus-visible b {
	opacity: 1;
	transform: translate3d(0, -50%, 0);
}

.pagination {
	display: flex;
	justify-content: center;
	margin: 24px 0 10px;
	font-size: 0;
}

.pagination__pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	padding: 8px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .045);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 14px 34px rgba(0, 0, 0, .14);
}

.pagination__pages a,
.pagination__pages > span,
.pagination__pages > b,
.pagination__pages .pagination__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 750;
	line-height: 1;
	text-decoration: none;
	transition: color .14s ease, background .14s ease, border-color .14s ease, transform .14s ease;
}

.pagination__pages a:hover,
.pagination__pages a:focus-visible {
	background: rgba(255, 255, 255, .09);
	border-color: var(--line);
	color: var(--text);
	transform: translateY(-1px);
}

.pagination__pages > span:not(.pagination__arrow),
.pagination__pages > b,
.pagination__pages .current {
	background: var(--accent);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 10px 22px var(--accent-soft);
}

.pagination__arrow {
	gap: 7px;
	min-width: auto;
}

.pagination__arrow i {
	font-size: 12px;
}

[data-theme="light"] .pagination__pages {
	background: rgba(255, 255, 255, .74);
}

@media (max-width: 860px) {
	.side-nav__item b {
		display: none;
	}

	.pagination {
		margin-bottom: 18px;
	}

	.pagination__pages {
		border-radius: 18px;
		gap: 6px;
	}

	.pagination__pages a,
	.pagination__pages > span,
	.pagination__pages > b,
	.pagination__pages .pagination__arrow {
		min-width: 34px;
		height: 34px;
		padding: 0 10px;
		font-size: 13px;
	}
}

/* Exact prototype logo and fixed side menu tooltip layer */
@font-face {
	font-family: firenight;
	src: url('/Firenight.otf');
	font-display: swap;
}

.brand__text {
	font-family: firenight, "Arial Black", sans-serif;
	font-size: 28px;
	font-weight: 400;
	letter-spacing: 2px;
	line-height: 1;
	text-transform: none;
	color: color-mix(in srgb, var(--text) 78%, var(--muted));
	text-shadow: none;
}

[data-theme="light"] .brand__text {
	color: color-mix(in srgb, var(--text) 84%, var(--muted));
	text-shadow: none;
}

.site-frame,
.side-nav,
.side-nav__item {
	overflow: visible;
}

.side-nav {
	z-index: 2000;
}

.side-nav__item {
	z-index: 1;
}

.side-nav__item:hover,
.side-nav__item:focus-visible {
	z-index: 2100;
}

.side-nav__item b {
	z-index: 2200;
}

/* Restore square logo mark */
.site-header {
	grid-template-columns: 210px minmax(240px, 380px) minmax(0, 1fr);
}

.brand {
	gap: 10px;
	min-width: 210px;
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	color: #fff;
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	box-shadow: 0 10px 24px var(--accent-soft);
}

.brand__text {
	font-family: inherit;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: .04em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--text);
	text-shadow: none;
}

[data-theme="light"] .brand__text {
	color: var(--text);
}

@media (max-width: 1080px) {
	.site-header {
		grid-template-columns: minmax(210px, 1fr) auto;
	}
}

@media (max-width: 560px) {
	.site-header {
		grid-template-columns: 1fr auto;
	}

	.brand {
		min-width: 0;
	}

	.brand__text {
		font-size: 16px;
	}
}

/* Restore square logo mark */
.site-header {
	grid-template-columns: 210px minmax(240px, 380px) minmax(0, 1fr);
}

.brand {
	gap: 10px;
	min-width: 210px;
}

.brand__mark {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 8px;
	background: linear-gradient(135deg, var(--accent), var(--accent-strong));
	color: #fff;
	font-size: 18px;
	font-weight: 900;
	line-height: 1;
	box-shadow: 0 10px 24px var(--accent-soft);
}

.brand__text {
	font-family: inherit;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: .04em;
	line-height: 1;
	text-transform: uppercase;
	color: var(--text);
	text-shadow: none;
}

[data-theme="light"] .brand__text {
	color: var(--text);
}

.site-frame,
.side-nav,
.side-nav__item {
	overflow: visible;
}

.side-nav {
	z-index: 2000;
}

.side-nav__item {
	z-index: 1;
}

.side-nav__item:hover,
.side-nav__item:focus-visible {
	z-index: 2100;
}

.side-nav__item b {
	z-index: 2200;
}

@media (max-width: 1080px) {
	.site-header {
		grid-template-columns: minmax(210px, 1fr) auto;
	}
}

@media (max-width: 560px) {
	.site-header {
		grid-template-columns: 1fr auto;
	}

	.brand {
		min-width: 0;
	}

	.brand__text {
		font-size: 16px;
	}
}

/* Sweep pass: mobile front, cards, reader and secondary pages */
.page-shell {
	min-height: 100vh;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 1500;
}

.content-feed {
	display: grid;
	gap: 16px;
}

.story-card,
.story-full,
.search-result,
.static-page,
.profile,
.form-page,
.story-comments,
.related-block,
.comment {
	position: relative;
	overflow: hidden;
}

.story-card::before,
.story-full::before,
.search-result::before,
.static-page::before,
.profile::before,
.form-page::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .16), transparent);
	pointer-events: none;
}

.story-card {
	display: grid;
	gap: 14px;
}

.story-card__header,
.story-full__header {
	gap: 12px;
}

.story-card h2,
.story-card h2 a,
.story-full h1 {
	color: var(--text);
	text-wrap: balance;
}

.story-card h2 {
	font-size: clamp(27px, 2.5vw, 38px);
}

.story-card__author,
.story-full__source {
	font-size: 14px;
	line-height: 1.45;
}

.story-card__author a,
.story-full__source a {
	color: inherit;
	text-decoration: none;
}

.story-card__author a:hover,
.story-full__source a:hover {
	color: var(--accent-strong);
	text-decoration: underline;
}

.story-card__meta,
.story-full__meta {
	padding-top: 12px;
	gap: 8px 14px;
	font-size: 14px;
}

.story-card__meta span,
.story-full__meta span {
	min-width: 0;
}

.story-card__badges {
	justify-content: flex-start;
	padding: 2px 0;
	background: transparent;
}

.story-card__body {
	max-width: 82ch;
	color: var(--text-soft);
	font-size: 16px;
	line-height: 1.72;
}

.story-card__footer,
.story-full__footer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	gap: 14px 18px;
}

.story-card__tags,
.story-full__tags {
	font-size: 14px;
	line-height: 1.65;
}

.story-card__actions,
.story-full__actions {
	align-items: center;
	gap: 10px;
}

.story-card__action,
.story-card__views,
.story-card__rating,
.story-card__favorite,
.story-card__rating-value {
	min-height: 34px;
}

.story-card__action,
.story-card__views,
.story-card__rating {
	border-radius: 999px;
}

.story-card__read {
	min-width: 84px;
	justify-content: center;
}

.story-full {
	max-width: min(920px, 100%);
	border-radius: 16px;
}

.story-full__topline {
	position: sticky;
	top: 76px;
	z-index: 20;
	align-items: center;
	padding: 8px;
	margin: -8px -8px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: color-mix(in srgb, var(--surface) 84%, transparent);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
	backdrop-filter: blur(16px) saturate(130%);
}

.story-full__topline > .button {
	white-space: nowrap;
}

.reader-tools {
	margin-left: auto;
}

.reader-tools button {
	min-width: 40px;
	border-radius: 999px;
	font-weight: 800;
}

.story-full__content {
	max-width: 72ch;
	margin: 28px auto 0;
	font-size: var(--reader-size);
	line-height: 1.86;
	color: var(--text);
}

.story-full__content img,
.static-page__content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.story-full__content blockquote,
.static-page__content blockquote {
	margin: 1.4em 0;
	padding: 4px 0 4px 18px;
	border-left: 3px solid var(--accent);
	color: var(--text-soft);
}

.story-comments,
.related-block {
	padding: clamp(16px, 2vw, 22px);
	border-radius: 14px;
}

.story-comments h2,
.related-block h2 {
	margin-bottom: 16px;
}

.comment {
	padding: 14px 16px;
	border-radius: 12px;
}

.comment__header,
.comment__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.comment__header span,
.comment__footer {
	color: var(--muted);
	font-size: 13px;
}

.comment__body {
	margin-top: 10px;
	line-height: 1.65;
}

.comment__action {
	cursor: pointer;
}

.search-result,
.static-page,
.profile,
.form-page {
	padding: clamp(18px, 2.8vw, 30px);
	border-radius: 14px;
}

.search-result {
	display: grid;
	gap: 12px;
}

.content-feed > .search-result {
	margin-bottom: 16px;
}

.search-page {
	margin-bottom: 16px !important;
}

.content-feed > .search-result:last-child {
	margin-bottom: 0;
}

.search-result h2,
.static-page h1,
.profile h1,
.form-page h1 {
	margin: 0;
	font-size: clamp(28px, 3vw, 42px);
	line-height: 1.1;
	letter-spacing: -.02em;
}

.search-result__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	color: var(--muted);
	font-size: 14px;
}

.search-result__body,
.static-page__content,
.form-page__header p {
	color: var(--text-soft);
	line-height: 1.72;
}

.feedback-page {
	padding: clamp(22px, 4vw, 42px);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow-soft);
}

.feedback-page__header {
	max-width: 680px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--line);
}

.feedback-page__eyebrow {
	margin: 0 0 8px;
	color: var(--accent-strong);
	font-size: 12px;
	font-weight: 850;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.feedback-page h1 {
	margin: 0;
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.1;
}

.feedback-page__header > p:last-child {
	margin: 12px 0 0;
	color: var(--muted);
	line-height: 1.7;
}

.feedback-page__contacts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-top: 22px;
}

.feedback-page__contact {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text);
	text-decoration: none;
	transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}

.feedback-page__contact:hover,
.feedback-page__contact:focus-visible {
	border-color: var(--accent);
	background: var(--glass);
	transform: translateY(-1px);
}

.feedback-page__icon {
	display: grid;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	place-items: center;
	border-radius: 10px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: 20px;
}

.feedback-page__contact strong,
.feedback-page__contact small {
	display: block;
}

.feedback-page__contact strong {
	font-size: 15px;
}

.feedback-page__contact small {
	margin-top: 4px;
	color: var(--muted);
	font-size: 13px;
}

.search-page {
	display: grid;
	gap: 24px;
}

.search-page__header {
	max-width: 680px;
}

.search-page__eyebrow {
	margin: 0 0 8px;
	color: var(--accent-strong);
	font-size: 12px;
	font-weight: 850;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.search-page__header h1 {
	margin: 0;
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.1;
}

.search-page__header > p:last-child {
	margin: 12px 0 0;
	color: var(--muted);
	line-height: 1.7;
}

.search-page__table,
.search-page__extended {
	display: grid;
	gap: 16px;
}

.search-page__simple {
	display: grid;
	gap: 10px;
	max-width: 760px;
}

.search-page__label {
	color: var(--text-soft);
	font-size: 14px;
	font-weight: 750;
}

.search-page__query input,
.search-page__query textarea,
.search-page__select select,
.search-page__select input,
.search-page__fieldset input:not([type="checkbox"]):not([type="radio"]),
.search-page__fieldset select {
	width: 100%;
	min-height: 42px;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--glass);
	color: var(--text);
	font: inherit;
}

.search-page__query input:focus,
.search-page__select select:focus,
.search-page__fieldset input:focus,
.search-page__fieldset select:focus {
	border-color: var(--accent-strong);
	outline: none;
}

.search-page__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.search-page__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.search-page__fieldset {
	min-width: 0;
	margin: 0;
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: rgba(255, 255, 255, .02);
}

.search-page__fieldset--wide {
	width: 100%;
}

.search-page__fieldset legend {
	padding: 0 6px;
	color: var(--text);
	font-size: 15px;
	font-weight: 800;
}

.search-page__fieldset > * + * {
	display: block;
	margin-top: 10px;
}

.search-page__option {
	color: var(--muted);
	font-size: 13px;
}

.search-page__message {
	padding-top: 16px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 620px) {
	.feedback-page__contacts {
		grid-template-columns: minmax(0, 1fr);
	}

	.search-page__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.profile__header {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
}

.profile__avatar img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 999px;
	border: 1px solid var(--line);
}

.profile__summary p {
	margin: 6px 0 0;
	color: var(--muted);
}

.profile__body {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
	margin-top: 18px;
}

.profile__stat {
	padding: 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: rgba(255, 255, 255, .035);
}

.profile__stat span,
.profile__stat strong {
	display: block;
}

.profile__stat span {
	color: var(--muted);
	font-size: 12px;
}

.profile__stat strong {
	margin-top: 4px;
	font-size: 14px;
}

.form-page__body {
	margin-top: 18px;
}

.profile-page { display: grid; gap: 22px; min-width: 0; }
.profile-tabs {
	display: block;
}
.profile-tabs__nav { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }

.profile-tabs__input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.profile-tabs__label {
	min-height: 38px;
	padding: 8px 12px;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	cursor: pointer;
	font-weight: 700;
}

#profile-tab-main:checked ~ .profile-tabs__nav .profile-tabs__label[for="profile-tab-main"],
#profile-tab-edit:checked ~ .profile-tabs__nav .profile-tabs__label[for="profile-tab-edit"] {
	border-color: var(--accent-strong);
	color: var(--text);
}

#profile-tab-main:focus-visible ~ .profile-tabs__nav .profile-tabs__label[for="profile-tab-main"],
#profile-tab-edit:focus-visible ~ .profile-tabs__nav .profile-tabs__label[for="profile-tab-edit"] {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.profile-tabs__panels { min-width: 0; padding-top: 24px; }
.profile-tabs__panel { display: none; }
#profile-tab-main:checked ~ .profile-tabs__panels .profile-tabs__panel--main,
#profile-tab-edit:checked ~ .profile-tabs__panels .profile-tabs__panel--edit { display: block; }

.profile__verified { color: var(--accent-strong); font-size: .48em; vertical-align: middle; }
.profile__extra { margin-top: 6px; color: var(--muted); }
.profile__links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.profile__links a { color: var(--muted); font-size: 20px; }
.profile__links a:hover { color: var(--accent-strong); }
.profile__detail,
.profile__bio { margin-top: 18px; }
.profile__detail { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--text-soft); }
.profile__detail span { color: var(--muted); }
.profile__bio h2 { margin: 0 0 6px; font-size: 17px; }
.profile__bio > div { color: var(--text-soft); line-height: 1.65; overflow-wrap: anywhere; }
.profile-section { min-width: 0; padding-top: 4px; }
.profile-section__header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.profile-section__header h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.profile-section__header p { margin: 0; color: var(--muted); font-size: 14px; }
.profile-section__header a { color: var(--muted); font-size: 14px; font-weight: 650; }
.profile-section__header a:hover { color: var(--accent-strong); }
.profile-story-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-width: 0;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text-soft);
	font-weight: 700;
}
.profile-story-link span { min-width: 0; overflow-wrap: anywhere; }
.profile-story-link i { flex: 0 0 auto; color: var(--muted); }
.profile-story-link:hover { border-color: var(--accent-strong); color: var(--text); }
.profile-story-link:hover i { color: var(--accent-strong); }
.profile-empty { margin: 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.profile__awards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.profile-achievement { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.profile-achievement__icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; aspect-ratio: 1; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-size: 18px; }
.profile-achievement h3 { margin: 0 0 4px; font-size: 16px; }
.profile-achievement p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.profile-edit { display: grid; gap: 16px; }
.profile-edit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-edit__grid--password { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-edit__field,
.profile-edit__grid label { display: grid; align-content: start; gap: 7px; min-width: 0; color: var(--text-soft); font-weight: 650; }
.profile-edit input:not([type="checkbox"]):not([type="hidden"]),
.profile-edit select,
.profile-edit textarea { width: 100%; min-width: 0; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); color: var(--text); font: inherit; }
.profile-edit textarea { resize: vertical; }
.profile-edit input[type="file"] { padding: 6px; }
.profile-edit__option { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 500; }
.profile-edit__options { display: grid; gap: 10px; }
.profile-edit__author-fields,
.profile-edit__social-accounts { display: grid; gap: 12px; min-width: 0; }
.profile-edit__author-fields h3,
.profile-edit__social-accounts h3,
.profile-edit__option-field h3 { margin: 0; font-size: 16px; }
.profile-edit__social-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-edit__social-list:empty::before { color: var(--muted); content: "Нет привязанных аккаунтов"; }
.profile-edit__social-empty { display: none; }
.profile-edit__social-connect { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-edit__option-field { display: grid; justify-items: start; gap: 8px; }
.profile-edit__actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
	.profile-edit__grid,
	.profile-edit__grid--password { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.profile-edit__social-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
	.profile-tabs__nav { gap: 2px; }
	.profile-tabs__label { padding-inline: 8px; text-align: center; }
	.profile__awards-grid { grid-template-columns: minmax(0, 1fr); }
	.profile-edit__grid,
	.profile-edit__grid--password { grid-template-columns: minmax(0, 1fr); }
}

.form-page__header {
	display: grid;
	gap: 8px;
	margin-bottom: 18px;
}

.form-table,
.form-table table {
	width: 100%;
}

.form-table input,
.form-table select,
.form-table textarea,
.static-page input,
.static-page select,
.static-page textarea,
.story-comments input,
.story-comments textarea {
	max-width: 100%;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--glass);
	color: var(--text);
}

.comment-form {
	margin: 0 0 18px;
	padding: 18px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface-2);
}

.comment-form__header {
	display: grid;
	gap: 5px;
	margin-bottom: 16px;
}

.comment-form__header h3 {
	margin: 0;
	font-size: 18px;
}

.comment-form__header p {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
}

.comment-form__guest {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}

.comment-form__guest label,
.comment-form__question {
	display: grid;
	gap: 6px;
	color: var(--text-soft);
	font-size: 13px;
}

.comment-form__guest input,
.comment-form__question input,
.comment-form__captcha input {
	width: 100%;
	min-height: 42px;
	box-sizing: border-box;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--glass);
	color: var(--text);
}

.comment-form__guest input::placeholder,
.comment-form__question input::placeholder,
.comment-form__captcha input::placeholder {
	color: var(--muted);
}

.comment-form__editor {
	margin-top: 12px;
}

.comment-form__editor textarea {
	width: 100%;
	min-height: 140px;
	box-sizing: border-box;
	resize: vertical;
	line-height: 1.6;
}

.comment-form__subscribe {
	margin-top: 10px;
	color: var(--muted);
	font-size: 13px;
}

.comment-form__subscribe label {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.comment-form__subscribe input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--accent);
}

.comment-form__verification,
.comment-form__question {
	margin-top: 12px;
}

.comment-form__actions {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	margin-top: 14px;
}

.comment-form__captcha {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	max-width: 420px;
}

.comment-form__captcha img {
	max-width: 180px;
	height: auto;
	border-radius: 6px;
}

.comment-form__captcha input {
	min-width: 150px;
}

@media (max-width: 640px) {
	.comment-form__guest {
		grid-template-columns: minmax(0, 1fr);
	}

	.comment-form__actions,
	.comment-form__captcha {
		align-items: stretch;
		flex-direction: column;
	}

	.comment-form__captcha {
		max-width: none;
	}
}

@media (max-width: 1080px) {
	.site-header {
		position: sticky;
	}

	.content-feed {
		gap: 14px;
	}

	.top-rail {
		scroll-snap-type: x proximity;
	}

	.top-rail__item {
		scroll-snap-align: start;
	}
}

@media (max-width: 860px) {
	body {
		font-size: 15px;
	}

	.site-header {
		gap: 12px;
		padding: 10px 12px 11px;
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.brand {
		min-width: 0;
	}

	.brand__mark {
		width: 32px;
		height: 32px;
		border-radius: 8px;
		font-size: 16px;
	}

	.header-actions {
		min-width: 0;
		max-width: 52vw;
		gap: 8px;
	}

	.header-actions .login-box {
		min-width: 0;
		max-width: 100%;
	}

	.login-box__user {
		max-width: 100%;
		flex-wrap: nowrap;
		overflow-x: auto;
		white-space: nowrap;
		scrollbar-width: none;
	}

	.login-box__user::-webkit-scrollbar {
		display: none;
	}

	.login-box__form {
		justify-content: flex-end;
	}

	.login-box__form label,
	.login-box__form input,
	.login-box__links {
		display: none;
	}

	.login-box__form .button {
		min-height: 38px;
		padding-inline: 12px;
		white-space: nowrap;
	}

	.header-search {
		order: 3;
		grid-column: 1 / -1;
	}

	.header-search input {
		height: 40px;
	}

	.site-frame {
		padding-inline: 10px;
	}

	.top-rail {
		margin-inline: -10px;
		padding-inline: 10px;
	}

	.story-card,
	.story-full,
	.search-result,
	.static-page,
	.profile,
	.form-page {
		padding: 16px;
		border-radius: 12px;
	}

	.story-card h2 {
		font-size: clamp(25px, 8vw, 34px);
	}

	.story-card__topline,
	.story-full__titleline {
		grid-template-columns: minmax(0, 1fr);
	}

	.story-card__tools {
		justify-self: start;
	}

	.story-card__meta,
	.story-full__meta {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.story-card__body {
		font-size: 15.5px;
		line-height: 1.74;
	}

	.story-card__footer,
	.story-full__footer {
		grid-template-columns: 1fr;
		align-items: stretch;
	}

	.story-card__actions,
	.story-full__actions {
		justify-content: space-between;
		gap: 8px;
	}

	.story-card__read {
		min-width: 92px;
		margin-left: auto;
	}

	.story-full__topline {
		top: 128px;
		border-radius: 14px;
		align-items: stretch;
		flex-direction: column;
	}

	.reader-tools {
		width: 100%;
		margin-left: 0;
	}

	.reader-tools button {
		flex: 1 1 0;
	}

	.story-full h1,
	.static-page h1,
	.profile h1,
	.form-page h1,
	.search-result h2 {
		font-size: clamp(27px, 8vw, 38px);
	}

	.story-full__content {
		max-width: none;
		line-height: 1.82;
	}

	.profile__header {
		grid-template-columns: 1fr;
	}

	.profile__body {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.page-shell {
		padding-bottom: 58px;
	}

	.brand__text {
		font-size: 14px;
		letter-spacing: .03em;
	}

	.header-actions {
		max-width: 54vw;
	}

	.top-rail__item {
		min-width: min(78vw, 280px);
		min-height: 150px;
	}

	.top-rail__title {
		font-size: 14px;
	}

	.story-card__badges abbr,
	.story-full__badges abbr {
		width: 38px !important;
		height: 38px !important;
	}

	.story-card__badges abbr i,
	.story-full__badges abbr i {
		font-size: 22px !important;
	}

	.story-card__actions,
	.story-full__actions {
		justify-content: flex-start;
	}

	.story-card__read {
		width: 100%;
		margin-left: 0;
	}

	.pagination__pages {
		width: 100%;
	}

	.profile__body {
		grid-template-columns: 1fr;
	}

	.mobile-nav {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.mobile-nav b {
		font-size: 9px;
	}
}

/* Registration page surface */
.form-page {
	background: var(--surface);
	border: 1px solid var(--line);
	box-shadow: var(--shadow-soft);
	backdrop-filter: blur(16px) saturate(130%);
}

/* Roll back regressions from broad sweep */
.content-feed {
	display: block;
}

.story-card {
	display: block;
}

.story-card__body {
	max-width: none;
}

.story-card__badges,
.story-full__badges,
.story-card__badges--full {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 12px 0;
	padding: 8px 0;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	border-radius: 0;
	background: transparent;
}

.story-card__footer,
.story-full__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 16px;
}

.story-card__actions,
.story-full__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 12px;
}

.story-card__action,
.story-card__views,
.story-card__rating,
.story-card__favorite,
.story-card__rating-value {
	min-height: 0;
}

.story-card__action,
.story-card__views,
.story-card__rating {
	border-radius: 0;
}

.story-card__read {
	width: auto;
	min-width: 0;
	margin-left: 4px;
}

.story-full {
	max-width: min(1180px, 100%);
	margin: 0;
}

.story-full__topline {
	position: static;
	top: auto;
	z-index: auto;
	justify-content: flex-end;
	align-items: center;
	padding: 0;
	margin: 0 0 10px;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	backdrop-filter: none;
}

.reader-tools {
	margin-left: 0;
	padding: 3px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .035);
}

.reader-tools button {
	min-width: 34px;
	min-height: 30px;
	padding: 0 9px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--muted);
	font-size: 13px;
}

.reader-tools button:hover {
	background: rgba(255, 255, 255, .07);
	color: var(--text);
}

.story-full__content {
	max-width: none;
	margin: 24px 0 0;
}

@media (max-width: 860px) {
	.story-card__footer,
	.story-full__footer {
		display: flex;
		align-items: stretch;
	}

	.story-card__actions,
	.story-full__actions {
		justify-content: flex-start;
	}

	.story-card__read {
		width: 100%;
		margin-left: 0;
	}

	.story-full__topline {
		align-items: flex-end;
		flex-direction: row;
	}

	.reader-tools {
		width: auto;
		margin-left: auto;
	}

	.reader-tools button {
		flex: 0 0 auto;
	}
}

/* Sidebar compact random, inline badges and comment previews */
.side-block--random-compact {
	padding: 0;
}

.side-random-link {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 16px 20px;
	color: var(--text);
	font-size: 17px;
	font-weight: 850;
	line-height: 1.2;
	text-decoration: none;
}

.side-random-link:hover {
	color: var(--accent-strong);
}

.story-card__badges,
.story-full__badges,
.story-card__badges--full {
	display: none;
}

.story-meta__badges {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

.story-meta__badges:empty {
	display: none;
}

.story-meta__badges abbr {
	width: 32px !important;
	height: 32px !important;
	border: 0 !important;
	background: transparent !important;
}

.story-meta__badges abbr i {
	font-size: 21px !important;
}

.story-card__rating .fa-heart {
	color: #7fd66f;
}

.story-card__rating .fa-heart-crack {
	color: #d96a6a;
}

.side-list--comments {
	display: grid;
	gap: 14px;
}

.mini-comment {
	display: grid;
	gap: 5px;
	min-width: 0;
}

.mini-comment__head {
	display: grid;
	grid-template-columns: 22px minmax(0, 1fr);
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.mini-comment__avatar {
	width: 22px;
	height: 22px;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid var(--line);
}

.mini-comment__title {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mini-comment__title strong,
.mini-comment__title strong a {
	color: var(--text);
	font-weight: 850;
}

.mini-comment__title span {
	color: var(--muted);
}

.mini-comment__title > a {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-soft);
	font-style: italic;
}

.mini-comment__text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	padding-left: 30px;
	color: var(--text-soft);
	font-size: 13px;
	line-height: 1.45;
	text-decoration: none;
}

.mini-comment__text:hover,
.mini-comment__title a:hover {
	color: var(--accent-strong);
}

@media (max-width: 860px) {
	.story-meta__badges {
		padding-top: 2px;
	}
}

/* Restore badge color gradation and old-site comment structure */
.story-meta__badges .icon_archive abbr,
.story-meta__badges .icon_goldf abbr,
.story-meta__badges .icon_pobed abbr,
.story-meta__badges .icon_author abbr,
.story-meta__badges .icon_humor abbr,
.story-meta__badges .icon_zhest abbr,
.story-meta__badges .icon_bez abbr,
.story-meta__badges .icon_kl abbr,
.story-meta__badges .icon_specialfor abbr,
.story-meta__badges .icon_wtf abbr {
	width: 32px !important;
	height: 32px !important;
	border: 1px solid rgba(255, 255, 255, .08) !important;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 18px rgba(0, 0, 0, .16);
}

.story-meta__badges .icon_archive abbr {
	background: color-mix(in srgb, #36b37e 22%, var(--surface)) !important;
	color: #36d38e !important;
}

.story-meta__badges .icon_goldf abbr,
.story-meta__badges .icon_pobed abbr {
	background: color-mix(in srgb, #c9a227 24%, var(--surface)) !important;
	color: #e3bd3d !important;
}

.story-meta__badges .icon_author abbr {
	background: color-mix(in srgb, #4c9aff 24%, var(--surface)) !important;
	color: #66aaff !important;
}

.story-meta__badges .icon_humor abbr {
	background: color-mix(in srgb, #e879b9 24%, var(--surface)) !important;
	color: #f08bc6 !important;
}

.story-meta__badges .icon_zhest abbr {
	background: color-mix(in srgb, #ef4444 26%, var(--surface)) !important;
	color: #ff5a5a !important;
}

.story-meta__badges .icon_bez abbr,
.story-meta__badges .icon_kl abbr {
	background: color-mix(in srgb, var(--muted) 18%, var(--surface)) !important;
	color: var(--text-soft) !important;
}

.story-meta__badges .icon_specialfor abbr {
	background: color-mix(in srgb, #60a5fa 22%, var(--surface)) !important;
	color: #7bb8ff !important;
}

.story-meta__badges .icon_wtf abbr {
	background: color-mix(in srgb, #a78bfa 24%, var(--surface)) !important;
	color: #bca7ff !important;
}

.story-meta__badges .icon_archive abbr:hover,
.story-meta__badges .icon_goldf abbr:hover,
.story-meta__badges .icon_pobed abbr:hover,
.story-meta__badges .icon_author abbr:hover,
.story-meta__badges .icon_humor abbr:hover,
.story-meta__badges .icon_zhest abbr:hover,
.story-meta__badges .icon_bez abbr:hover,
.story-meta__badges .icon_kl abbr:hover,
.story-meta__badges .icon_specialfor abbr:hover,
.story-meta__badges .icon_wtf abbr:hover {
	transform: translateY(-1px);
	filter: brightness(1.08);
}

.side-block--comments .side-block__head {
	margin-bottom: 6px;
	padding-bottom: 8px;
}

.side-list--comments {
	gap: 10px;
	padding-top: 6px;
}

.mini-comment {
	display: block;
	min-width: 0;
}

.mini-comment + .mini-comment {
	margin-top: 9px;
}

.mini-comment__head {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	line-height: 1.2;
}

.mini-comment__avatar {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .12);
}

.mini-comment__title {
	display: flex;
	align-items: baseline;
	gap: 6px;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mini-comment__title strong,
.mini-comment__title strong a {
	flex: 0 0 auto;
	color: color-mix(in srgb, var(--text) 82%, #8fb4ff);
	font-size: 15px;
	font-weight: 850;
	text-decoration: none;
}

.mini-comment__title span {
	flex: 0 0 auto;
	color: var(--text-soft);
}

.mini-comment__title > a {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--text-soft);
	font-size: 14px;
	font-style: italic;
	text-decoration: none;
}

.mini-comment__text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 4px;
	padding-left: 30px;
	color: color-mix(in srgb, var(--text-soft) 92%, var(--text));
	font-size: 13px;
	line-height: 1.42;
	text-decoration: none;
}

.mini-comment__text:hover,
.mini-comment__title a:hover {
	color: var(--accent-strong);
}

/* Badge colors on icons, not backgrounds */
.story-meta__badges .icon_archive abbr,
.story-meta__badges .icon_goldf abbr,
.story-meta__badges .icon_pobed abbr,
.story-meta__badges .icon_author abbr,
.story-meta__badges .icon_humor abbr,
.story-meta__badges .icon_zhest abbr,
.story-meta__badges .icon_bez abbr,
.story-meta__badges .icon_kl abbr,
.story-meta__badges .icon_specialfor abbr,
.story-meta__badges .icon_wtf abbr {
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
}

.story-meta__badges .icon_archive i {
	color: #36b37e !important;
}

.story-meta__badges .icon_goldf i,
.story-meta__badges .icon_pobed i {
	color: #c9a227 !important;
}

.story-meta__badges .icon_author i {
	color: #4c9aff !important;
}

.story-meta__badges .icon_humor i {
	color: #e879b9 !important;
}

.story-meta__badges .icon_zhest i {
	color: #ef4444 !important;
}

.story-meta__badges .icon_bez i,
.story-meta__badges .icon_kl i {
	color: var(--muted) !important;
}

.story-meta__badges .icon_specialfor i {
	color: #60a5fa !important;
}

.story-meta__badges .icon_wtf i {
	color: #a78bfa !important;
}

/* Structured footer */
.site-footer {
	display: block;
	margin-top: 36px;
	padding: 30px clamp(16px, 4vw, 64px) 78px;
	border-top: 1px solid var(--line);
	background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
	color: var(--text-soft);
}

.site-footer__inner {
	display: grid;
	grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(160px, 1fr));
	gap: clamp(22px, 3vw, 44px);
	max-width: 1160px;
	margin: 0 auto;
}

.site-footer__brand {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
}

.site-footer__age {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 2px solid var(--muted);
	border-radius: 50%;
	color: var(--muted);
	font-size: 17px;
	font-weight: 900;
	line-height: 1;
}

.site-footer strong {
	display: block;
	margin-bottom: 8px;
	color: var(--text);
	font-size: 16px;
	font-weight: 900;
}

.site-footer p {
	max-width: 360px;
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.55;
}

.site-footer__section h2 {
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px dotted var(--line-strong);
	color: var(--text-soft);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.site-footer__links {
	display: grid;
	gap: 8px;
}

.site-footer__links--split {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 16px;
}

.site-footer a {
	color: var(--text-soft);
	font-size: 14px;
	text-decoration: none;
}

.site-footer a:hover {
	color: var(--accent-strong);
}

.site-footer__icons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.site-footer__icons a {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgba(255, 255, 255, .035);
	font-size: 17px;
}

.site-footer__bottom {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	max-width: 1160px;
	margin: 28px auto 0;
	padding-top: 14px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 13px;
}

@media (max-width: 980px) {
	.site-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.site-footer {
		padding: 24px 14px 82px;
	}

	.site-footer__inner {
		grid-template-columns: 1fr;
	}

	.site-footer__links--split {
		grid-template-columns: 1fr;
	}

	.site-footer__bottom {
		flex-direction: column;
	}
}

/* Keep footer tight to page bottom */
.site-footer {
	margin-bottom: 0;
}

@media (min-width: 861px) {
	.site-footer {
		padding-bottom: 34px;
	}
}

/* Main menu drawer */
body.menu-is-open {
	overflow: hidden;
}

.menu-overlay {
	position: fixed;
	inset: 0;
	z-index: 3000;
	background: rgba(3, 5, 8, .68);
	backdrop-filter: blur(4px);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .22s ease, visibility 0s linear .22s;
}

.menu-overlay.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition-delay: 0s;
}

.main-menu {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	z-index: 3010;
	display: flex;
	width: min(400px, calc(100vw - 18px));
	flex-direction: column;
	padding: 24px clamp(18px, 3vw, 30px);
	border-right: 1px solid var(--line-strong);
	background: #181c23;
	box-shadow: 18px 0 55px rgba(0, 0, 0, .3);
	overflow-y: auto;
	transform: translateX(-102%);
	transition: transform .26s cubic-bezier(.22, .75, .25, 1);
}

.main-menu.is-open {
	transform: translateX(0);
}

:root[data-theme="light"] .main-menu {
	background: #ffffff;
}

.main-menu__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.main-menu__brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-size: 20px;
	font-weight: 900;
	letter-spacing: .02em;
	text-decoration: none;
}

.main-menu__mark {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border-radius: 9px;
	background: var(--accent);
	color: #fff;
	font-size: 18px;
}

.main-menu__close {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: transparent;
	color: var(--muted);
	font-size: 19px;
	cursor: pointer;
	transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.main-menu__close:hover,
.main-menu__close:focus-visible {
	border-color: var(--accent);
	background: var(--glass);
	color: var(--text);
}

.main-menu__eyebrow {
	margin: 30px 0 14px;
	color: var(--muted);
	font-size: 13px;
}

.main-menu__nav,
.main-menu__section {
	display: grid;
	gap: 4px;
}

.main-menu__nav a,
.main-menu__section a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 46px;
	padding: 10px 12px;
	border: 1px solid transparent;
	border-radius: 11px;
	color: var(--text-soft);
	font-size: 15px;
	text-decoration: none;
	transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.main-menu__nav a:hover,
.main-menu__nav a:focus-visible,
.main-menu__section a:hover,
.main-menu__section a:focus-visible {
	border-color: var(--line);
	background: var(--glass);
	color: var(--accent-strong);
}

.main-menu__nav i,
.main-menu__section i {
	width: 20px;
	color: var(--muted);
	text-align: center;
}

.main-menu__label {
	margin: 26px 12px 7px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.main-menu__footer {
	margin-top: auto;
	padding-top: 34px;
	color: var(--muted);
}

.main-menu__footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-bottom: 12px;
}

.main-menu__footer a {
	color: var(--text-soft);
	font-size: 13px;
	text-decoration: none;
}

.main-menu__footer a:hover {
	color: var(--accent-strong);
}

.main-menu__footer small {
	font-size: 12px;
	line-height: 1.6;
}

@media (max-width: 560px) {
	.main-menu {
		width: min(380px, calc(100vw - 10px));
		padding: 18px 16px;
	}

	.main-menu__nav a,
	.main-menu__section a {
		min-height: 50px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.menu-overlay,
	.main-menu {
		transition: none;
	}
}

/* Automatically generated story table of contents. */
.story-toc {
	margin: 0 0 26px;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface-2);
}

.story-toc[hidden] {
	display: none;
}

.story-toc__title {
	display: block;
	margin-bottom: 8px;
	color: var(--text);
	font-size: 14px;
}

.story-toc__list {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.story-toc__item {
	margin: 0;
}

.story-toc__item--h3 {
	padding-left: 16px;
}

.story-toc__item--h4 {
	padding-left: 32px;
}

/* Related stories */
.related-block {
	display: grid;
	gap: 10px;
}

.related-block h2 {
	margin-bottom: 4px;
}

.related-story {
	margin: 0;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
	transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.related-story:hover {
	border-color: var(--line-strong);
	background: var(--glass);
	transform: translateY(-1px);
}

.related-story__link {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	padding: 12px 14px;
	color: var(--text);
	text-decoration: none;
}

.related-story__icon {
	display: grid;
	width: 30px;
	height: 30px;
	flex: 0 0 30px;
	place-items: center;
	border-radius: 8px;
	background: var(--accent-soft);
	color: var(--accent-strong);
	font-size: 12px;
}

.related-story__main {
	display: grid;
	min-width: 0;
	gap: 3px;
}

.related-story__title {
	overflow: hidden;
	font-size: 15px;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.related-story__meta {
	color: var(--muted);
	font-size: 12px;
}

.related-story__arrow {
	margin-left: auto;
	color: var(--muted);
	font-size: 12px;
}

/* Keep reader controls in the title row instead of reserving a full empty line. */
.story-full__topline {
	display: none;
}

.story-full__title-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	min-width: 0;
}

@media (max-width: 640px) {
	.story-full__title-actions {
		justify-content: flex-start;
		flex-wrap: wrap;
	}
}

.story-toc__list a {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.45;
	text-decoration: none;
}

.story-toc__list a:hover,
.story-toc__list a:focus-visible {
	color: var(--accent-strong);
}

.story-heading {
	scroll-margin-top: 96px;
}

/* Lift the sticky sidebar when the header is hidden while scrolling down. */
.sidebar {
	transition: top .22s ease;
}

.header-is-hidden .sidebar {
	top: 32px;
}

/* Compact left-aligned TOC, close to the old story layout. */
.story-toc {
	width: fit-content;
	max-width: 100%;
}

.story-toc__title {
	margin-bottom: 8px;
}

.story-toc__list {
	gap: 4px;
}

.story-toc__item {
	margin: 0;
}

.story-toc__item--h3 {
	padding-left: 16px;
}

.story-toc__item--h4 {
	padding-left: 32px;
}

/* Comments: flat cards by default; nested lists keep their indentation without numbers. */
.story-comments #dle-comments-list > ol,
.story-comments #dle-comments-list > ul,
.story-comments .comments-tree-list,
.story-comments .comments-tree-list ol,
.story-comments .comments-tree-list ul,
.story-comments #dle-comments-list ol,
.story-comments #dle-comments-list ul {
	margin: 0;
	padding: 0 !important;
	list-style: none !important;
}

.story-comments #dle-comments-list .comments-tree-list li,
.story-comments #dle-comments-list .comments-tree-list li::marker {
	list-style: none !important;
}

.story-comments #dle-comments-list .comments-tree-list li::marker {
	content: "";
}

.story-comments .comments-tree-list .comments-tree-list {
	margin: 12px 0 0 26px !important;
}

.story-comments #dle-comments-list .comments-tree-list > li {
	margin: 0 0 14px;
}

.story-comments #dle-comments-list .comments-tree-list > li:last-child {
	margin-bottom: 0;
}

.story-comments #dle-comments-list .comment,
.comment {
	margin: 0 !important;
	padding: 18px 20px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	box-shadow: var(--shadow-soft);
}

.comment__header {
	display: flex;
	align-items: center;
	gap: 10px;
}

.comment__avatar {
	display: block;
	width: 34px !important;
	height: 34px !important;
	max-width: 34px !important;
	max-height: 34px !important;
	flex: 0 0 34px;
	border-radius: 50%;
	object-fit: cover;
}

.comment__identity {
	display: flex;
	min-width: 0;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 7px 12px;
}

.comment__identity strong {
	color: var(--text);
	font-size: 15px;
}

.comment__verified {
	margin-left: 5px;
	color: var(--accent-strong);
	font-size: 13px;
	vertical-align: middle;
}

.comment__identity strong a {
	color: inherit;
}

.comment__identity > span {
	color: var(--muted);
	font-size: 12px;
}

.comment__reply-to {
	margin-top: 10px;
	color: var(--muted);
	font-size: 12px;
}

.comment__reply-to i {
	margin-right: 5px;
	color: var(--accent-strong);
}

.comment__reply-to a {
	color: var(--text-soft);
	font-weight: 750;
	text-decoration: none;
}

.comment__reply-to a:hover {
	color: var(--accent-strong);
}

.comment__body {
	margin-top: 14px;
	color: var(--text-soft);
	font-size: 15px;
	line-height: 1.7;
}

.comment__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}

.comment__action {
	color: var(--muted);
	font-size: 12px;
	text-decoration: none;
	transition: color .16s ease;
}

.comment__action:hover {
	color: var(--accent-strong);
}

.comment__action i {
	margin-right: 4px;
}

.comment__action--admin {
	color: var(--accent-strong);
}

.comment__mass {
	display: inline-flex;
	align-items: center;
	min-height: 18px;
}

.comment__mass input {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--accent);
}

.comment__rating {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-left: auto;
	color: var(--muted);
	font-size: 13px;
}

.comment__rating a {
	display: inline-flex;
	color: inherit;
	text-decoration: none;
}

.comment__rating-button {
	display: inline-grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border-radius: 7px;
	transition: color .16s ease, background .16s ease, transform .16s ease;
}

.comment__rating-button:hover,
.comment__rating-button:focus-visible {
	background: var(--surface-2);
	transform: translateY(-1px);
}

.comment__rating-button--like {
	color: #7fd66f;
}

.comment__rating-button--dislike {
	color: #d96a6a;
}

.comment__rating-value {
	min-width: 1.25em;
	color: var(--text-soft);
	font-weight: 750;
	text-align: center;
}

.comment__rating-value--like {
	color: #7fd66f;
}

.comment__rating-value--dislike {
	color: #d96a6a;
}

.comment__rating-stars .rating {
	display: inline-block;
}

.comment--lastcomments {
	margin-bottom: 14px !important;
}

[id^="comment-id-"]:last-child .comment--lastcomments {
	margin-bottom: 0 !important;
}

@media (max-width: 640px) {
	.comment__rating {
		width: 100%;
		margin-left: 0;
		padding-top: 2px;
	}
}

/* Keep the circular icon backgrounds visible in the light theme too. */
:root[data-theme="light"] .side-nav__item span {
	background: rgba(15, 23, 42, .08);
}

:root[data-theme="light"] .side-nav__item:hover span,
:root[data-theme="light"] .side-nav__item:focus-visible span {
	background: rgba(15, 23, 42, .13);
}

/* Keep the sticky header and sidebar on the same fixed vertical grid. */
:root {
	--site-header-height: 84px;
}

.site-header {
	height: var(--site-header-height);
	box-sizing: border-box;
	padding-top: 8px;
	padding-bottom: 8px;
}

.login-box__form {
	gap: 6px;
}

.login-box__links {
	gap: 8px;
	font-size: 12px;
}

.sidebar {
	top: calc(var(--site-header-height) + 16px);
}

.header-is-hidden .sidebar {
	top: 32px;
}

@media (max-width: 860px) {
	:root {
		--site-header-height: 118px;
	}
}

/* Owl Carousel: drag/swipe, arrows and pause-on-hover for the story rail. */
.top-rail.owl-carousel {
	display: block;
	gap: 0;
	overflow: hidden;
	padding: 0;
}

.top-rail.owl-carousel .owl-stage-outer {
	overflow: hidden;
}

.top-rail.owl-carousel .owl-stage {
	display: flex;
	align-items: stretch;
}

.top-rail.owl-carousel .owl-item {
	display: flex;
	min-width: 0;
}

.top-rail.owl-carousel .owl-item > .top-rail__item {
	width: 100%;
	min-width: 0;
	flex: 0 0 auto;
}

.top-rail.owl-carousel .owl-nav {
	margin: 0;
}

.top-rail.owl-carousel .owl-nav button.owl-prev,
.top-rail.owl-carousel .owl-nav button.owl-next {
	position: absolute;
	top: 50%;
	display: grid;
	width: 34px;
	height: 46px;
	place-items: center;
	margin: 0;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface-2);
	color: var(--text-soft);
	font-size: 14px;
	line-height: 1;
	transform: translateY(-50%);
	transition: background .16s ease, border-color .16s ease, color .16s ease;
}

/* DLE builds the article action menu outside the story card. */
#dropmenudiv {
	box-sizing: border-box;
	width: min(240px, calc(100vw - 24px)) !important;
	min-width: 220px;
	padding: 6px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	overflow: hidden;
	z-index: 2000 !important;
}

#dropmenudiv a {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 9px 11px;
	border-radius: calc(var(--radius) - 2px);
	color: var(--text-soft);
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	white-space: nowrap;
}

#dropmenudiv a:hover,
#dropmenudiv a:focus-visible {
	background: var(--surface-2);
	color: var(--text);
	outline: none;
}

.top-rail.owl-carousel .owl-nav button.owl-prev {
	left: 0;
}

.top-rail.owl-carousel .owl-nav button.owl-next {
	right: 0;
}

.top-rail.owl-carousel .owl-nav button:hover,
.top-rail.owl-carousel .owl-nav button:focus-visible {
	border-color: var(--accent);
	background: var(--glass-strong);
	color: var(--accent-strong);
}

.top-rail.owl-carousel .owl-nav button:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--focus) 70%, transparent);
	outline-offset: 2px;
}

@media (max-width: 1080px) {
	:root {
		--site-header-height: 116px;
	}
}

@media (max-width: 860px) {
	:root {
		--site-header-height: 118px;
	}

	.top-rail.owl-carousel {
		padding: 0;
	}
}

@media (max-width: 560px) {
	.top-rail.owl-carousel {
		padding: 0;
	}
}

/* Final menu overrides: preserve the nested indentation after legacy link rules. */
.main-menu__nav { gap: 0; }
.main-menu .main-menu__nav > a {
	min-height: 48px;
	padding: 0 16px;
	border: 0;
	border-radius: 0;
}
.main-menu .main-menu__group > summary {
	min-height: 48px;
	border-radius: 0;
}
.main-menu .main-menu__submenu a {
	min-height: 42px;
	padding: 0 16px 0 34px;
	border: 0;
	border-radius: 0;
}
.main-menu .main-menu__submenu a:hover,
.main-menu .main-menu__submenu a:focus-visible {
	background: var(--surface-2);
	color: var(--text);
}

/* Split login panel with responsive stacked layout. */
.login-dialog {
	width: min(860px, calc(100vw - 32px));
	max-height: min(90vh, 720px);
	padding: 0;
	overflow: hidden;
	border-radius: 14px;
}
.login-dialog[open] {
	display: grid;
	grid-template-columns: minmax(230px, .82fr) minmax(0, 1fr);
}
.login-dialog__visual {
	position: relative;
	display: flex;
	min-height: 500px;
	flex-direction: column;
	justify-content: space-between;
	padding: 28px;
	overflow: hidden;
	background: #13171d;
	color: #f4f0e8;
}
.login-dialog__brand {
	position: relative;
	z-index: 1;
	font-size: 15px;
	font-weight: 900;
	letter-spacing: .04em;
}
.login-dialog__monogram {
	position: absolute;
	top: 50%;
	left: 50%;
	color: rgba(255, 255, 255, .08);
	font-size: 210px;
	font-weight: 900;
	line-height: 1;
	transform: translate(-50%, -58%);
}
.login-dialog__visual p {
	position: relative;
	z-index: 1;
	max-width: 240px;
	margin: 0;
	color: #d8d0c5;
	font-size: 20px;
	font-weight: 750;
	line-height: 1.35;
}
.login-dialog__content { min-width: 0; padding: clamp(24px, 4vw, 42px); }
.login-dialog__header { margin: 0 0 26px; }
.login-dialog__header h2 { font-size: 24px; }
.login-dialog__form { gap: 12px; }
.login-dialog__form input:not([type="hidden"]) { min-height: 54px; padding: 0 14px; }
.login-dialog__links { justify-content: flex-start; margin: 2px 0 4px; }
.login-dialog__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.login-dialog__actions .button { min-width: 96px; }
.login-dialog__social { margin-top: 26px; padding-top: 20px; }
.login-dialog__social p { margin-bottom: 12px; }
.login-dialog__social > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.login-dialog__social .button { min-width: 0; gap: 8px; }

/* Native details stays usable without JavaScript; animation comes from app.js. */
.main-menu__submenu { overflow: hidden; will-change: height, opacity; }
.main-menu__group > summary { user-select: none; }

@media (max-width: 620px) {
	.login-dialog { max-height: 92vh; overflow-y: auto; }
	.login-dialog[open] { grid-template-columns: minmax(0, 1fr); }
	.login-dialog__visual { min-height: 132px; padding: 18px 20px; }
	.login-dialog__monogram { top: 45%; left: auto; right: 20px; font-size: 110px; transform: translateY(-50%); }
	.login-dialog__visual p { max-width: 220px; font-size: 16px; }
	.login-dialog__content { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
	.main-menu__chevron { transition: none; }
	.main-menu__submenu { will-change: auto; }
}

.dle-info {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	margin: 0 0 20px;
	padding: 18px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--accent-strong);
	border-radius: var(--radius);
	box-shadow: var(--shadow-soft);
}

.dle-info__icon {
	flex: 0 0 auto;
	padding-top: 2px;
	color: var(--accent-strong);
	font-size: 20px;
}

.dle-info__content { min-width: 0; }
.dle-info__title { margin: 0 0 5px; color: var(--text); font-size: 18px; line-height: 1.35; }
.dle-info__message { color: var(--text-soft); overflow-wrap: anywhere; }
.dle-info__message p:last-child { margin-bottom: 0; }

/* DLE complaint dialog generated by AddComplaint(). */
.ui-widget-overlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 8, 13, .72);
	backdrop-filter: blur(4px);
}

.ui-dialog.modalfixed.dle-popup-complaint {
	position: fixed !important;
	z-index: 10001 !important;
	max-width: calc(100vw - 24px);
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	box-shadow: var(--shadow);
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 18px;
	border: 0;
	border-bottom: 1px solid var(--line);
	border-radius: 0;
	background: var(--surface-2);
	color: var(--text);
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-title {
	margin: 0;
	color: var(--text);
	font-size: 18px;
	font-weight: 800;
	line-height: 1.3;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar-close:hover,
.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar-close:focus-visible {
	border-color: var(--line-strong);
	background: var(--surface-strong);
	color: var(--text);
	outline: none;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar-close .ui-icon {
	display: none;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-titlebar-close::before {
	content: "\f00d";
	font-family: "Font Awesome 6 Free";
	font-size: 14px;
	font-weight: 900;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-content {
	width: auto !important;
	padding: 18px;
	border: 0;
	background: var(--surface);
	color: var(--text-soft);
	font-size: 15px;
	line-height: 1.55;
}

.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-text,
.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-mail {
	display: block;
	width: 100% !important;
	box-sizing: border-box;
	margin-top: 12px;
	padding: 12px 13px;
	border: 1px solid var(--line);
	border-radius: 9px;
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	line-height: 1.5;
}

.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-text {
	min-height: 150px;
	resize: vertical;
}

.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-text::placeholder,
.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-mail::placeholder {
	color: var(--muted);
}

.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-text:focus,
.ui-dialog.modalfixed.dle-popup-complaint #dle-promt-mail:focus {
	border-color: var(--accent-strong);
	box-shadow: 0 0 0 3px var(--accent-soft);
	outline: none;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonpane {
	margin: 0;
	padding: 14px 18px 18px;
	border: 0;
	border-top: 1px solid var(--line);
	background: var(--surface);
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	float: none;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button {
	min-height: 40px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button:hover,
.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button:focus-visible {
	border-color: var(--line-strong);
	background: var(--surface-strong);
	outline: none;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button:last-child {
	border-color: var(--accent);
	background: var(--accent);
	color: #fff;
}

.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button:last-child:hover,
.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button:last-child:focus-visible {
	border-color: var(--accent-strong);
	background: var(--accent-strong);
}

@media (max-width: 620px) {
	.ui-dialog.modalfixed.dle-popup-complaint {
		width: calc(100vw - 24px) !important;
	}

	.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-content {
		padding: 16px;
	}

	.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonpane {
		padding: 12px 16px 16px;
	}

	.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset {
		justify-content: stretch;
	}

	.ui-dialog.modalfixed.dle-popup-complaint .ui-dialog-buttonset button {
		flex: 1 1 0;
	}
}

/* DLE spoiler blocks generated from <!--dle_spoiler ... -->. */
.title_spoiler {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 14px 0 0;
	padding: 14px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text);
	font-weight: 800;
	line-height: 1.4;
	transition: border-color .18s ease, background-color .18s ease;
}

.title_spoiler:hover,
.title_spoiler:focus-within {
	border-color: var(--line-strong);
	background: var(--surface-strong);
}

.title_spoiler > a:first-child {
	display: none;
}

.title_spoiler > a:last-child {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.title_spoiler > a:last-child::after {
	content: "\f078";
	display: inline-block;
	float: right;
	margin-left: 12px;
	color: var(--muted);
	font-family: "Font Awesome 6 Free";
	font-size: 12px;
	font-weight: 900;
	line-height: 1.4;
	transition: transform .18s ease, color .18s ease;
}

.title_spoiler:hover > a:last-child::after,
.title_spoiler:focus-within > a:last-child::after {
	color: var(--accent-strong);
}

.title_spoiler:has(+ .text_spoiler[style*="display: block"]),
.title_spoiler:has(+ .text_spoiler[style*="display:block"]) {
	border-bottom-right-radius: 0;
	border-bottom-left-radius: 0;
}

.title_spoiler:has(+ .text_spoiler[style*="display: block"]) > a:last-child::after,
.title_spoiler:has(+ .text_spoiler[style*="display:block"]) > a:last-child::after {
	transform: rotate(180deg);
}

.text_spoiler {
	margin: 0 0 14px;
	padding: 16px;
	border: 1px solid var(--line);
	border-top: 0;
	border-radius: 0 0 var(--radius) var(--radius);
	background: var(--surface-2);
	color: var(--text-soft);
	line-height: 1.72;
}

.text_spoiler p:last-child,
.text_spoiler ul:last-child,
.text_spoiler ol:last-child {
	margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
	.title_spoiler,
	.title_spoiler > a:last-child::after {
		transition: none;
	}
}

