:root {
	--font-heading: 'Space Grotesk', 'Segoe UI', sans-serif;
	--font-body: 'Manrope', 'Segoe UI', sans-serif;
	--bg: #f3f4f8;
	--surface: #ffffff;
	--surface-alt: #eef0f7;
	--text: #141625;
	--muted: #6b7280;
	--primary: #ff4d6d;
	--primary-dark: #d93a59;
	--accent: #5b8cff;
	--border: #e2e8f0;
	--shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
	--radius: 18px;
}

html[data-theme='dark'] {
	--bg: #0c101b;
	--surface: #121828;
	--surface-alt: #1b2336;
	--text: #e5e7eb;
	--muted: #9aa4b2;
	--primary: #ff6b81;
	--primary-dark: #f04563;
	--accent: #8ab4ff;
	--border: #1f2937;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font-body);
	background: var(--bg);
	color: var(--text);
	line-height: 1.6;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	display: block;
}

.ast-site {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.ast-main {
	flex: 1 1 auto;
	padding-bottom: 60px;
}

.ast-container {
	width: min(1200px, 92%);
	margin: 0 auto;
}

.ast-section {
	padding: 40px 0;
}

.ast-section-title {
	font-family: var(--font-heading);
	font-size: 32px;
	margin: 0 0 24px;
}

.ast-block {
	margin-bottom: 32px;
}

.ast-block-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.ast-block-title {
	font-family: var(--font-heading);
	font-size: 24px;
	margin: 0;
}

.ast-muted {
	color: var(--muted);
}

.ast-link {
	color: var(--accent);
	font-weight: 600;
}

.ast-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 20px;
}

.ast-grid-layout {
	display: grid;
	grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr);
	gap: 32px;
}

.ast-sidebar {
	position: sticky;
	top: 96px;
	align-self: start;
}

.ast-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}

.ast-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	gap: 16px;
}

.ast-logo {
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 700;
	color: var(--text);
}

.ast-nav {
	flex: 1 1 auto;
}

.ast-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 16px;
	justify-content: center;
}

.ast-nav-link {
	color: var(--muted);
	font-weight: 600;
}

.ast-header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ast-menu-toggle {
	display: none;
	background: var(--surface-alt);
	border: none;
	border-radius: 10px;
	padding: 8px;
}

.ast-menu-toggle span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--text);
	margin: 4px 0;
}

.ast-search {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--surface-alt);
	padding: 6px 10px;
	border-radius: 999px;
}

.ast-search input {
	background: transparent;
	border: none;
	outline: none;
	color: var(--text);
	width: 160px;
}

.ast-btn {
	background: var(--primary);
	color: #fff;
	border: none;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.ast-btn:hover {
	background: var(--primary-dark);
}

.ast-btn-ghost {
	background: var(--surface-alt);
	color: var(--text);
}

.ast-user-pill {
	background: var(--surface-alt);
	padding: 8px 12px;
	border-radius: 999px;
	font-weight: 600;
}

.ast-mode-toggle {
	background: var(--surface-alt);
	border: none;
	padding: 8px 12px;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
}

.ast-card {
	background: var(--surface);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.ast-card-media {
	position: relative;
	padding-top: 140%;
	background-size: cover;
	background-position: center;
}

.ast-card-body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ast-card-title {
	font-family: var(--font-heading);
	font-size: 18px;
	margin: 0;
}

.ast-card-meta {
	display: flex;
	gap: 10px;
	color: var(--muted);
	font-size: 13px;
}

.ast-card-actions {
	margin-top: auto;
}

.ast-tag {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 4px 8px;
	border-radius: 999px;
	font-size: 12px;
}

.ast-tag-vip {
	background: linear-gradient(120deg, #f97316, #ec4899);
}

.ast-tag-fast {
	background: linear-gradient(120deg, #8b5cf6, #3b82f6);
}

.ast-tag-pin {
	background: var(--accent);
	position: static;
	margin-left: auto;
}

.ast-footer {
	background: var(--surface);
	border-top: 1px solid var(--border);
	padding: 40px 0;
}

.ast-footer-inner {
	display: grid;
	grid-template-columns: 1.5fr 1fr 1fr;
	gap: 24px;
}

.ast-footer-menu {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 8px;
}

.ast-hero {
	padding: 48px 0 24px;
}

.ast-hero-card {
	position: relative;
	border-radius: 28px;
	overflow: hidden;
	background: var(--surface-alt);
	min-height: 340px;
	box-shadow: var(--shadow);
}

.ast-hero-media {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: brightness(0.6);
}

.ast-hero-content {
	position: relative;
	z-index: 1;
	padding: 48px;
	max-width: 520px;
}

.ast-hero-title {
	font-family: var(--font-heading);
	font-size: 40px;
	margin: 10px 0;
}

.ast-hero-actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 20px;
}

.ast-notice {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	padding: 12px 16px;
	border-radius: 12px;
	margin: 20px auto;
	max-width: 1200px;
}

.ast-notice-warning {
	color: #9a3412;
}

.ast-pagination {
	display: flex;
	gap: 8px;
	margin-top: 20px;
}

.ast-pagination-item a,
.ast-pagination-item span {
	padding: 8px 12px;
	background: var(--surface);
	border-radius: 8px;
	border: 1px solid var(--border);
}

.ast-filter {
	margin: 16px 0;
}

.ast-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.ast-filter select {
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid var(--border);
	background: var(--surface);
	color: var(--text);
}

.ast-section-header {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}

.ast-empty-state {
	text-align: center;
	padding: 60px 0;
}

html {
	background: var(--bg);
	color-scheme: light;
}

html[data-theme='dark'] {
	color-scheme: dark;
}

.ast-meta-desc {
	max-width: 520px;
	margin: 12px 0 0;
}

.ast-progress {
	position: relative;
	height: 6px;
	background: var(--surface-alt);
	border-radius: 999px;
	overflow: hidden;
	margin-top: 8px;
}

.ast-progress-bar {
	display: block;
	height: 100%;
	background: var(--accent);
}

.ast-comment-tools {
	display: flex;
	gap: 8px;
}

.ast-pwa-btn {
	white-space: nowrap;
}

.ast-nav.is-open {
	background: var(--surface);
	padding: 12px 0;
	border-radius: 16px;
	box-shadow: var(--shadow);
}

.ast-meta-line {
	margin: 4px 0;
}

.ast-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: var(--surface-alt);
	color: var(--text);
	margin-top: 6px;
}

.ast-pill-vip {
	background: linear-gradient(120deg, #f97316, #ec4899);
	color: #fff;
}

.ast-history-date {
	margin: 6px 0 0;
	font-size: 13px;
}

.ast-bookmark-toggle.is-active {
	background: var(--primary);
	color: #fff;
}


/* === QA polish & accessibility === */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible,
.ast-source-item:focus-visible,
.ast-subtitle-item:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.ast-btn,
.ast-btn-ghost,
.ast-source-item,
.ast-subtitle-item,
.ast-reaction-btn {
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ast-btn:active,
.ast-btn-ghost:active,
.ast-source-item:active,
.ast-subtitle-item:active {
	transform: translateY(1px);
}

.ast-page-title {
	font-family: var(--font-heading);
	font-size: 32px;
	margin: 0;
}

.ast-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--surface);
	color: var(--text);
	padding: 6px 12px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 12px;
}

.ast-hero-meta {
	color: rgba(255, 255, 255, 0.85);
	margin: 6px 0 0;
}

.ast-hero-empty {
	padding: 32px;
	text-align: center;
}

.ast-card {
	border: 1px solid var(--border);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ast-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.14);
}

.ast-card-media {
	aspect-ratio: 2 / 3;
	background-color: var(--surface-alt);
}

.ast-card-title a {
	display: inline-block;
}

.ast-card-meta {
	flex-wrap: wrap;
	align-items: center;
}

.ast-card-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ast-history-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ast-history-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.ast-filter-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	margin-bottom: 4px;
}

.ast-meta-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.ast-footer-title {
	font-weight: 700;
	font-family: var(--font-heading);
	font-size: 18px;
}

.ast-empty-state {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 40px;
	box-shadow: var(--shadow);
}

.ast-search input {
	min-width: 140px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.ast-modal {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 40;
}

.ast-modal.is-open {
	display: flex;
}

.ast-modal-inner {
	background: var(--surface);
	border-radius: var(--radius);
	padding: 24px;
	max-width: 420px;
	width: 90%;
	box-shadow: var(--shadow);
}

.ast-modal-close {
	background: transparent;
	border: none;
	font-size: 20px;
	cursor: pointer;
	position: absolute;
	right: 20px;
	top: 16px;
}

.ast-modal-inner {
	position: relative;
}


.ast-nav-link:hover,
.ast-link:hover {
	color: var(--primary);
}


@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}


body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}


html[data-theme='dark'] .ast-notice {
	background: #1f2937;
	border-color: #374151;
	color: #f9fafb;
}


.ast-search:focus-within {
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}


.ast-grid {
	align-items: stretch;
}


.ast-header-actions {
	flex-wrap: wrap;
}


.ast-btn:disabled,
.ast-btn-ghost:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}


.ast-history-meta {
	flex-wrap: wrap;
}


.ast-filter select {
	cursor: pointer;
}

