:root {
	--bg-ink: #0d0a09;
	--bg-brown: #21140f;
	--bg-panel: rgba(24, 16, 12, 0.86);
	--bg-panel-soft: rgba(38, 27, 20, 0.72);
	--green-deep: #1f3a2f;
	--green-moss: #395845;
	--burgundy: #5d1f28;
	--gold: #c8a96b;
	--gold-soft: #e6d1a1;
	--text-main: #f1e6cf;
	--text-soft: #ccbda3;
	--border-dark: rgba(111, 84, 51, 0.9);
	--shadow-heavy: 0 24px 60px rgba(0, 0, 0, 0.5);
	--paper: rgba(235, 222, 191, 0.08);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0px;
	min-height: 100vh;
	font-family: "Cormorant Garamond", serif;
	color: var(--text-main);
	background:
		linear-gradient(rgba(8, 7, 6, 0.38), rgba(8, 7, 6, 0.72)),
		radial-gradient(circle at top, rgba(198, 160, 87, 0.16), transparent 28%),
		url("../Hogwarts Castle, USA.jpeg") center top / cover no-repeat,
		#100b09;
	letter-spacing: 0.01em;
}

body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(rgba(93, 31, 40, 0.09), rgba(31, 58, 47, 0.06)),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
	mix-blend-mode: screen;
	opacity: 0.35;
}

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

button,
input,
select,
textarea {
	font: inherit;
}

.page-shell {
	width: min(1260px, calc(100% - 32px));
	margin: 0 auto;
	padding: 24px 0 48px;
}

body[data-current-route="home"] .page-shell {
	width: 100%;
	min-height: 100vh;
	padding: 0;
}

.home-only-landing {
	display: none;
	min-height: 100vh;
}

body[data-current-route="home"] .home-only-landing {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 0;
}

body[data-current-route="home"] .site-header,
body[data-current-route="home"] .content-stack {
	display: none;
}

.home-hero-card {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	width: 100%;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.6rem;
	padding: clamp(28px, 7vw, 96px) 24px;
	text-align: center;
}

.home-hero-card::before {
	content: "";
	position: absolute;
	inset: 0;
	background: url("../HogwartsCastle.jpg") center top / cover no-repeat;
	opacity: 0.4;
	z-index: 0;
}

.home-hero-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% -8%, rgba(33, 20, 15, 0.15) 0%, rgba(13, 10, 9, 0.6) 45%, rgba(13, 10, 9, 0.9) 100%);
	z-index: 0;
}

.home-hero-card > * {
	position: relative;
	z-index: 1;
}

.home-kicker {
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 0.85rem;
	color: var(--gold-soft);
}

.home-site-title {
	margin: 0;
	font-family: "Manufacturing Consent", "Grenze Gotisch", serif;
	font-size: clamp(3.5rem, 12vw, 7.5rem);
	line-height: 0.95;
	letter-spacing: 0.06em;
	color: #f8e9c1;
	text-shadow: 0 6px 24px rgba(0, 0, 0, 0.75);
}

.home-site-title::after {
	content: "";
	display: block;
	width: 90px;
	height: 3px;
	margin: 1.15rem auto 0;
	background: var(--gold);
}

.home-subtitle {
	max-width: 620px;
	margin: 0;
	font-family: "Lora", "Georgia", serif;
	font-style: italic;
	font-size: clamp(1rem, 2vw, 1.15rem);
	line-height: 1.6;
	color: var(--text-soft);
}

.home-only-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.85rem;
	margin-top: 0.4rem;
	max-width: 640px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.home-only-links .hero-detail-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: "Grenze Gotisch", serif;
	font-size: 1rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--gold-soft);
	background: transparent;
	border: 1px solid rgba(200, 169, 107, 0.4);
	border-radius: 999px;
	padding: 0.85rem 1.75rem;
	box-shadow: none;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.home-only-links .hero-detail-link:hover {
	background: rgba(230, 209, 161, 0.1);
	border-color: var(--gold-soft);
}

.home-only-links .hero-detail-link--accent {
	background: var(--burgundy);
	border-color: var(--burgundy);
	color: var(--gold-soft);
}

.home-only-links .hero-detail-link--accent:hover {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--bg-ink);
}

.site-header {
	position: relative;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: 28px;
	padding: 22px;
	background: transparent;
	box-shadow: none;
}

.site-header::before,
.site-header::after,
.ornate-card::before,
.ornate-card::after {
	content: "";
	position: absolute;
	width: 58px;
	height: 58px;
	/* border: 1px solid rgba(230, 209, 161, 0.45); */
	pointer-events: none;
}

.site-header::before,
.ornate-card::before {
	top: 14px;
	left: 14px;
	border-right: 0;
	border-bottom: 0;
}

.site-header::after,
.ornate-card::after {
	right: 14px;
	bottom: 14px;
	border-left: 0;
	border-top: 0;
}

.main-nav {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 18px;
}

/* ── Status indicator ──────────────────────────────────────────────────────── */

.status-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	flex-shrink: 0;
	vertical-align: middle;
	transition: background 250ms ease, box-shadow 250ms ease;
}

.status-dot--active {
	background: #4A8C5C;
	box-shadow: 0 0 5px rgba(74, 140, 92, 0.7);
}

.status-dot--looking {
	background: #C8921A;
	box-shadow: 0 0 5px rgba(200, 146, 26, 0.65);
	animation: status-pulse 2s ease-in-out infinite;
}

.status-dot--offline {
	background: rgba(160, 140, 110, 0.28);
	box-shadow: none;
}

@keyframes status-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.45; }
}

.status-picker-wrap {
	position: relative;
}

.status-picker-btn {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 10px 16px;
	border: 1px solid rgba(230, 209, 161, 0.24);
	border-radius: 999px;
	background: rgba(33, 20, 15, 0.7);
	color: var(--gold-soft);
	font-size: 0.96rem;
	font-family: inherit;
	cursor: pointer;
	transition: background 180ms ease, border-color 180ms ease;
	white-space: nowrap;
}

.status-picker-btn:hover {
	background: rgba(93, 31, 40, 0.6);
	border-color: rgba(230, 209, 161, 0.44);
}

.status-picker-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 300;
	min-width: 168px;
	background: rgba(14, 9, 6, 0.97);
	border: 1px solid rgba(200, 169, 107, 0.28);
	border-radius: 14px;
	padding: 8px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.status-option {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 13px;
	border-radius: 8px;
	background: transparent;
	border: none;
	color: var(--text-soft);
	font-size: 1rem;
	font-family: inherit;
	cursor: pointer;
	text-align: left;
	transition: background 140ms ease, color 140ms ease;
}

.status-option:hover {
	background: rgba(200, 169, 107, 0.1);
	color: var(--text-main);
}

.roster-item .status-dot {
	margin-top: 5px;
	grid-row: 1;
}

.nav-link,
.nav-button {
	padding: 10px 18px;
	border: 1px solid rgba(230, 209, 161, 0.24);
	border-radius: 999px;
	background: rgba(33, 20, 15, 0.7);
	color: var(--gold-soft);
	font-size: 1.02rem;
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.nav-button {
	appearance: none;
	cursor: pointer;
}

.nav-link:hover,
.nav-link.is-current,
.nav-button:hover {
	transform: translateY(-1px);
	background: rgba(93, 31, 40, 0.72);
	border-color: rgba(230, 209, 161, 0.45);
}

.is-hidden {
	display: none;
}

.nav-toggle {
	display: none;
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 110;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: rgba(33, 20, 15, 0.82);
	border: 1px solid rgba(230, 209, 161, 0.28);
	border-radius: 10px;
	cursor: pointer;
}

.nav-toggle-bar {
	display: block;
	width: 100%;
	height: 2px;
	background: var(--gold-soft);
	border-radius: 2px;
	transition: transform 220ms ease, opacity 220ms ease;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(2) {
	opacity: 0;
}

.nav-toggle.is-open .nav-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.hero-panel {
	position: relative;
	z-index: 1;
	min-height: 520px;
	display: grid;
	align-content: end;
	gap: 16px;
	padding: 88px 28px 28px;
	overflow: hidden;
	transition: max-height 500ms cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 400ms ease,
	            min-height 500ms ease,
	            padding 500ms ease,
	            margin 500ms ease;
}

body:not([data-current-route="home"]) .hero-panel {
	max-height: 0;
	min-height: 0;
	opacity: 0;
	padding-top: 0;
	padding-bottom: 0;
	margin-top: 0;
	pointer-events: none;
}

.hero-kicker,
.panel-kicker {
	margin: 0;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: var(--gold-soft);
	font-size: 0.88rem;
}

.site-title {
	margin: 0;
	font-family: "Manufacturing Consent", "Grenze Gotisch", serif;
	font-size: clamp(4rem, 10vw, 8rem);
	line-height: 0.92;
	color: #f7e8bf;
	text-shadow: 0 6px 24px rgba(0, 0, 0, 0.78);
}

.hero-copy {
	max-width: 720px;
	margin: 0;
	font-size: clamp(1.2rem, 2vw, 1.5rem);
	line-height: 1.45;
	color: var(--text-main);
}

.hero-details {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hero-details span,
.hero-details .hero-detail-link,
.location-chip {
	padding: 10px 16px;
	border-radius: 999px;
	background: rgba(20, 24, 18, 0.68);
	border: 1px solid rgba(200, 169, 107, 0.28);
	color: var(--gold-soft);
}

.hero-detail-link {
	text-decoration: none;
	cursor: pointer;
	transition: background 200ms ease, border-color 200ms ease;
}

.hero-detail-link:hover {
	background: rgba(93, 31, 40, 0.52);
	border-color: rgba(200, 169, 107, 0.5);
}

.content-stack {
	display: grid;
	gap: 22px;
	margin-top: 22px;
}

.content-panel {
	position: relative;
	border: 1px solid rgba(200, 169, 107, 0.3);
	border-radius: 24px;
	padding: 28px;
	background:
		linear-gradient(180deg, rgba(28, 20, 14, 0.92), rgba(16, 11, 9, 0.92)),
		var(--bg-panel);
	box-shadow: var(--shadow-heavy);
}

#locations.content-panel {
	padding: 16px 10px;
}

.route-panel {
	display: none;
}

.route-panel.is-active {
	display: block;
	animation: fadePanel 320ms ease;
}

@keyframes fadePanel {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.panel-heading {
	display: grid;
	gap: 8px;
	margin-bottom: 22px;
}

.panel-heading h2,
.ornate-card h3,
.location-details h3 {
	margin: 0;
	font-family: "Grenze Gotisch", serif;
	letter-spacing: 0.02em;
	color: var(--gold-soft);
}

.panel-heading h2 {
	font-size: clamp(2rem, 4vw, 3.4rem);
}

.register-layout,
.profile-layout,
.locations-layout {
	display: grid;
	gap: 18px;
}

.home-stage {
	min-height: 300px;
	border-radius: 22px;
	border: 1px solid rgba(200, 169, 107, 0.16);
	background:
		radial-gradient(circle at center, rgba(200, 169, 107, 0.16), transparent 32%),
		linear-gradient(180deg, rgba(31, 58, 47, 0.2), rgba(93, 31, 40, 0.16)),
		rgba(10, 10, 9, 0.18);
	box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.38);
}

.home-welcome {
	display: grid;
	gap: 16px;
	align-content: center;
	min-height: 260px;
	padding: 32px;
	border-radius: 22px;
	border: 1px solid rgba(200, 169, 107, 0.22);
	background: linear-gradient(135deg, rgba(33, 20, 15, 0.9), rgba(16, 11, 9, 0.84));
	box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.28);
}

.home-welcome-title {
	margin: 0;
	font-family: "Grenze Gotisch", serif;
	font-size: clamp(2.1rem, 4.5vw, 3.2rem);
	line-height: 0.98;
	letter-spacing: 0.04em;
	color: var(--gold-soft);
}

.home-welcome .muted-copy {
	max-width: 720px;
	font-size: 1.08rem;
	line-height: 1.6;
}

.home-links-only {
	justify-content: center;
	padding: 18px 10px;
}

.house-window-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.house-window {
	position: relative;
	overflow: hidden;
	display: grid;
	gap: 12px;
	align-content: end;
	min-height: 260px;
	padding: 22px;
	border-radius: 20px;
	border: 1px solid rgba(200, 169, 107, 0.36);
	background: rgba(19, 13, 10, 0.74);
	cursor: pointer;
	transition: transform 180ms ease, border-color 180ms ease, filter 180ms ease;
}

.house-window:hover,
.house-window:focus-visible {
	transform: translateY(-2px);
	filter: brightness(1.04);
	border-color: rgba(230, 209, 161, 0.55);
	outline: none;
}

.house-window-backdrop {
	position: absolute;
	inset: 0;
	opacity: 0.18;
	pointer-events: none;
}

.house-window-backdrop::before {
	content: "";
	position: absolute;
	right: -12px;
	bottom: -34px;
	font-size: clamp(6.8rem, 9vw, 9.2rem);
	font-family: "Grenze Gotisch", serif;
	line-height: 1;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.62);
	transform: rotate(-8deg);
	letter-spacing: 0.04em;
}


.house-window > * {
	position: relative;
	z-index: 1;
}

.house-frame-gryffindor {
	background:
		linear-gradient(145deg, rgba(20, 6, 10, 0.72), rgba(82, 16, 30, 0.55), rgba(123, 27, 38, 0.3)),
		url("../Gryffindor.jpeg") center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(214, 174, 80, 0.4);
}

.house-frame-slytherin {
	background:
		linear-gradient(145deg, rgba(3, 8, 6, 0.74), rgba(7, 20, 14, 0.58), rgba(17, 61, 42, 0.32)),
		url("../slytherin.jpeg") center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(162, 178, 188, 0.38);
}

.house-frame-hufflepuff {
	background:
		linear-gradient(145deg, rgba(10, 8, 4, 0.74), rgba(29, 24, 15, 0.58), rgba(149, 116, 25, 0.3)),
		url("../Hufflepuff.jpeg") center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(228, 197, 106, 0.5);
}

.house-frame-ravenclaw {
	background:
		linear-gradient(145deg, rgba(3, 7, 16, 0.76), rgba(7, 18, 39, 0.58), rgba(19, 55, 122, 0.3)),
		url("../Ravenclaw.jpeg") center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(100, 132, 204, 0.48);
}

.house-frame-teachers {
	background:
		linear-gradient(145deg, rgba(8, 7, 4, 0.76), rgba(22, 18, 10, 0.6), rgba(90, 70, 22, 0.32)),
		url("../teachers.jpeg") center / cover no-repeat;
	box-shadow: inset 0 0 0 1px rgba(210, 180, 90, 0.52);
}

.house-window--span {
	grid-column: 1 / -1;
	min-height: 180px;
	align-content: center;
}

.house-teachers {
	box-shadow: inset 0 0 0 1px rgba(200, 169, 107, 0.48);
}

.roster-role {
	display: block;
	font-size: 0.88rem;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--gold-soft);
	opacity: 0.72;
	margin-bottom: 2px;
}

.house-cta {
	margin: 0;
	font-size: 1.02rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(247, 236, 210, 0.9);
}

.house-list-page {
	display: grid;
	gap: 16px;
}

.house-list-head {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	align-items: center;
	flex-wrap: wrap;
}

.house-back-button {
	appearance: none;
	border: 1px solid rgba(230, 209, 161, 0.45);
	background: rgba(24, 16, 12, 0.6);
	color: var(--gold-soft);
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
}

.house-title {
	margin: 0;
	font-family: "Grenze Gotisch", serif;
	font-size: clamp(2.2rem, 4vw, 3.4rem);
	line-height: 0.95;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.house-description {
	margin: 0;
	color: var(--text-soft);
	font-size: 1.08rem;
	line-height: 1.5;
}

.roster-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}

.roster-item {
	display: grid;
	grid-template-columns: 14px 1fr;
	column-gap: 8px;
	row-gap: 2px;
	align-items: start;
	padding: 12px 14px;
	border-radius: 16px;
	border: 1px solid rgba(200, 169, 107, 0.18);
	background: rgba(235, 222, 191, 0.04);
}

.roster-name-link,
.roster-name-text {
	font-size: 1.18rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.roster-name-link {
	color: var(--gold-soft);
	text-decoration: underline;
	text-decoration-color: rgba(230, 209, 161, 0.32);
	text-underline-offset: 4px;
}

.roster-name-link.is-current-profile {
	color: #fff2c8;
	text-shadow: 0 0 18px rgba(200, 169, 107, 0.3);
}

.roster-state {
	grid-column: 2;
	color: var(--text-soft);
	font-size: 0.96rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.roster-name-link,
.roster-name-text {
	grid-column: 2;
}

.roster-role {
	grid-column: 2;
}

.house-gryffindor {
	box-shadow: inset 0 0 0 1px rgba(93, 31, 40, 0.42);
}

.house-slytherin {
	box-shadow: inset 0 0 0 1px rgba(57, 88, 69, 0.42);
}

.house-ravenclaw {
	box-shadow: inset 0 0 0 1px rgba(56, 75, 120, 0.42);
}

.house-hufflepuff {
	box-shadow: inset 0 0 0 1px rgba(200, 169, 107, 0.36);
}

.ornate-card p,
.muted-copy,
.gated-message,
.feed-meta,
.location-story,
.profile-note,
.empty-state {
	margin: 0;
	color: var(--text-soft);
}

.ornate-card {
	position: relative;
	padding: 22px;
	border-radius: 22px;
	border: 1px solid rgba(200, 169, 107, 0.22);
	background:
		linear-gradient(180deg, rgba(235, 222, 191, 0.08), rgba(235, 222, 191, 0.03)),
		var(--bg-panel-soft);
	overflow: hidden;
}

.accent-emerald {
	box-shadow: inset 0 0 0 1px rgba(57, 88, 69, 0.35);
}

.accent-burgundy {
	box-shadow: inset 0 0 0 1px rgba(93, 31, 40, 0.35);
}

.accent-gold {
	box-shadow: inset 0 0 0 1px rgba(200, 169, 107, 0.28);
}

.register-layout {
	grid-template-columns: 1.2fr 0.8fr;
	align-items: start;
}

.registration-form,
.profile-fields,
.profile-main-card,
.profile-text-card,
.location-details,
.post-feed {
	display: grid;
	gap: 16px;
}

.registration-form label,
.profile-main-card label,
.profile-text-card label,
.file-input-label,
.accent-gold label {
	display: grid;
	gap: 8px;
}

label span,
.accent-gold h3 {
	color: var(--gold-soft);
	font-size: 1.12rem;
}

input,
select,
textarea {
	width: 100%;
	border: 1px solid rgba(200, 169, 107, 0.24);
	border-radius: 14px;
	padding: 12px 14px;
	background: rgba(11, 10, 9, 0.55);
	color: var(--text-main);
	outline: none;
	transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
	border-color: rgba(230, 209, 161, 0.58);
	box-shadow: 0 0 0 3px rgba(200, 169, 107, 0.12);
	background: rgba(18, 16, 14, 0.7);
}

textarea {
	resize: vertical;
}

.action-button,
.territory-tab,
.location-tab {
	cursor: pointer;
}

.action-button {
	width: fit-content;
	min-width: 220px;
	padding: 12px 22px;
	border: 1px solid rgba(200, 169, 107, 0.35);
	border-radius: 999px;
	background: linear-gradient(135deg, rgba(93, 31, 40, 0.88), rgba(44, 67, 53, 0.88));
	color: #f7ecd2;
	transition: transform 180ms ease, filter 180ms ease;
}

.action-button:hover {
	transform: translateY(-1px);
	filter: brightness(1.08);
}

.form-status {
	min-height: 1.2em;
	color: var(--gold-soft);
}

.auth-letter-popup {
	position: fixed;
	inset: 0;
	background: rgba(12, 8, 6, 0.72);
	display: grid;
	place-items: center;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 180ms ease;
	z-index: 90;
}

.auth-letter-popup.is-visible {
	opacity: 1;
	pointer-events: auto;
}

.auth-letter-card {
	width: min(560px, 100%);
	padding: 22px;
	border-radius: 14px;
	border: 1px solid rgba(117, 72, 38, 0.52);
	background:
		linear-gradient(180deg, rgba(245, 224, 189, 0.95), rgba(225, 201, 161, 0.94)),
		rgba(235, 218, 184, 0.95);
	color: #472e1f;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	position: relative;
	overflow: hidden;
}

.auth-letter-card::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(circle at 12% 10%, rgba(255, 252, 238, 0.58), transparent 28%),
		radial-gradient(circle at 86% 80%, rgba(143, 97, 50, 0.14), transparent 32%);
}

.auth-letter-card > * {
	position: relative;
	z-index: 1;
}

.auth-letter-card h3 {
	margin: 6px 0 12px;
	font-family: "Grenze Gotisch", serif;
	font-style: normal;
	font-size: clamp(1.8rem, 5vw, 2.4rem);
	color: #593421;
}

.auth-letter-message {
	margin: 0;
	font-size: 1.42rem;
	line-height: 1.45;
	letter-spacing: 0.01em;
	color: #4c2f1e;
}

.auth-letter-close {
	margin-top: 18px;
	appearance: none;
	border: 1px solid rgba(93, 61, 35, 0.52);
	background: rgba(91, 54, 32, 0.12);
	color: #4b2e1d;
	padding: 10px 16px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 1.04rem;
	font-style: italic;
}

.auth-letter-close:hover {
	background: rgba(91, 54, 32, 0.2);
}

.wax-list {
	margin: 16px 0 0;
	padding-left: 20px;
	display: grid;
	gap: 10px;
	color: var(--text-soft);
}

.gated-message {
	display: none;
	padding: 16px 18px;
	border-radius: 16px;
	border: 1px dashed rgba(200, 169, 107, 0.36);
	background: rgba(33, 20, 15, 0.56);
}

.gated-panel.is-locked .gated-message {
	display: block;
}

.gated-panel.is-locked .post-feed,
.gated-panel.is-locked .profile-layout,
.gated-panel.is-locked .locations-layout {
	display: none;
}

.gated-panel.is-locked#profile .profile-layout {
	display: none;
}

.post-card {
	padding: 18px;
	border-radius: 18px;
	border: 1px solid rgba(200, 169, 107, 0.18);
	background: rgba(235, 222, 191, 0.05);
}

.post-card header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.post-card h3,
.location-title {
	margin: 0;
	color: var(--gold-soft);
	font-size: 1.45rem;
}

.post-card p {
	margin: 0;
	font-size: 1.08rem;
	line-height: 1.5;
}

.empty-state {
	padding: 18px;
	border-radius: 18px;
	border: 1px dashed rgba(200, 169, 107, 0.28);
	background: rgba(235, 222, 191, 0.04);
}

.profile-layout {
	grid-template-columns: minmax(230px, 260px) minmax(0, 1fr);
	align-items: start;
}

.avatar-card {
	position: sticky;
	top: 24px;
}

.avatar-preview {
	aspect-ratio: 1;
	border-radius: 22px;
	border: 1px solid rgba(200, 169, 107, 0.28);
	background:
		linear-gradient(180deg, rgba(31, 58, 47, 0.38), rgba(93, 31, 40, 0.34)),
		rgba(17, 12, 10, 0.9);
	display: grid;
	place-items: center;
	overflow: hidden;
	color: var(--text-soft);
	font-size: 1.1rem;
	text-align: center;
}

.avatar-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.file-input-label input {
	padding: 10px 0 0;
	border: 0;
	background: transparent;
}

.locations-layout {
	grid-template-columns: 1fr;
	align-items: start;
}

.location-territories {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 4px;
}

.folder-tabs {
	display: grid;
	gap: 10px;
}

.territory-tab {
	width: auto;
	border: 1px solid rgba(200, 169, 107, 0.22);
	background: rgba(31, 22, 17, 0.72);
	color: var(--text-main);
	padding: 10px 22px;
	text-align: left;
	border-radius: 999px;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.territory-tab:hover,
.territory-tab.is-active {
	background: rgba(93, 31, 40, 0.55);
	border-color: rgba(230, 209, 161, 0.45);
	transform: translateY(-1px);
}

.location-tab {
	width: 100%;
	border: 1px solid rgba(200, 169, 107, 0.18);
	background: rgba(31, 22, 17, 0.72);
	color: var(--text-main);
	padding: 14px 16px;
	text-align: left;
	border-radius: 18px;
	transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.location-tab:hover,
.location-tab.is-active {
	background: rgba(57, 88, 69, 0.5);
	border-color: rgba(230, 209, 161, 0.36);
	transform: translateX(2px);
}

.world-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
}

.world-tab {
	padding: 10px 22px;
	border: 1px solid rgba(200, 169, 107, 0.22);
	border-radius: 999px;
	background: rgba(31, 22, 17, 0.72);
	color: var(--text-main);
	font-family: "Cormorant Garamond", serif;
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.world-tab:hover,
.world-tab.is-active {
	background: rgba(93, 31, 40, 0.55);
	border-color: rgba(230, 209, 161, 0.45);
	transform: translateY(-1px);
}

.location-folder {
	display: grid;
	gap: 14px;
}

.folder-tabs {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.location-details {
	padding: 22px;
}

.location-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.location-story {
	font-size: 1.08rem;
	line-height: 1.6;
}

.location-posts {
	display: grid;
	gap: 12px;
}

.location-post {
	padding: 14px 16px;
	border-left: 3px solid rgba(200, 169, 107, 0.4);
	background: rgba(235, 222, 191, 0.04);
}

.location-post strong {
	display: block;
	margin-bottom: 4px;
	color: var(--gold-soft);
}

.location-empty {
	color: var(--text-soft);
}

.location-preview-gate {
	margin-top: 8px;
	display: grid;
	gap: 14px;
	text-align: center;
	padding: 32px 22px;
}

.location-preview-gate h3 {
	margin: 0;
	font-family: "Grenze Gotisch", serif;
	font-size: clamp(1.8rem, 3vw, 2.4rem);
	color: var(--gold-soft);
}

.location-preview-gate p {
	margin: 0;
	color: var(--text-soft);
	font-size: 1.08rem;
	line-height: 1.5;
}

.location-preview-gate .action-button {
	margin: 0 auto;
}

.location-chat {
	margin-top: 0;
	display: grid;
	gap: 0;
}

.chat-heading {
	padding: 4px 4px 14px;
	border-bottom: 1px solid rgba(200, 169, 107, 0.14);
	margin-bottom: 4px;
	text-align: center;
}

.chat-location-name {
	margin: 0 0 5px;
	font-size: 1.22rem;
	color: var(--gold-soft);
	text-align: center;
}

.chat-location-desc {
	margin: 0;
	font-size: 0.96rem;
	color: var(--text-soft);
	line-height: 1.5;
}

.chat-thread {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 520px;
	overflow-y: auto;
	padding: 10px 2px;
	scrollbar-width: thin;
	scrollbar-color: rgba(200, 169, 107, 0.2) transparent;
}

.chat-row {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}

.chat-row.is-own {
	flex-direction: row-reverse;
}

.chat-avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.82rem;
	font-weight: 700;
	color: rgba(230, 209, 161, 0.9);
	flex-shrink: 0;
	margin-bottom: 2px;
}

.chat-bubble {
	max-width: min(72%, 560px);
	padding: 9px 13px 7px;
	border-radius: 18px 18px 18px 4px;
	background: rgba(235, 222, 191, 0.07);
	border: 1px solid rgba(200, 169, 107, 0.12);
	display: grid;
	gap: 5px;
}

.chat-row.is-own .chat-bubble {
	border-radius: 18px 18px 4px 18px;
	background: linear-gradient(145deg, rgba(72, 22, 18, 0.65), rgba(93, 31, 40, 0.5));
	border-color: rgba(200, 169, 107, 0.2);
}

.chat-author {
	font-size: 0.84rem;
	font-weight: 600;
	color: var(--gold);
	letter-spacing: 0.02em;
}

.chat-bubble p {
	margin: 0;
	font-family: "Lora", "Georgia", serif;
	font-size: 1.13rem;
	line-height: 1.62;
	white-space: pre-wrap;
}

.chat-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	min-height: 18px;
}

.chat-row.is-own .chat-meta {
	justify-content: flex-end;
}

.chat-time {
	font-size: 0.78rem;
	color: var(--text-soft);
	opacity: 0.65;
}

.chat-edited-mark {
	font-size: 0.78rem;
	color: var(--text-soft);
	opacity: 0.55;
	font-style: italic;
}

.chat-bubble-tools {
	display: flex;
	gap: 5px;
	opacity: 0;
	transition: opacity 150ms ease;
	margin-left: auto;
}

.chat-bubble:hover .chat-bubble-tools {
	opacity: 1;
}

.chat-empty {
	color: var(--text-soft);
	font-size: 0.98rem;
	text-align: center;
	padding: 20px 0;
}

.chat-delete-button {
	appearance: none;
	border: 1px solid rgba(200, 169, 107, 0.24);
	background: rgba(93, 31, 40, 0.25);
	color: var(--gold-soft);
	border-radius: 999px;
	padding: 2px 9px;
	font-size: 0.82rem;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.chat-edit-button,
.chat-edit-save,
.chat-edit-cancel {
	appearance: none;
	border: 1px solid rgba(200, 169, 107, 0.24);
	background: rgba(31, 58, 47, 0.26);
	color: var(--gold-soft);
	border-radius: 999px;
	padding: 2px 9px;
	font-size: 0.82rem;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.chat-edit-button:hover,
.chat-edit-save:hover { background: rgba(31, 58, 47, 0.48); }
.chat-edit-cancel:hover,
.chat-delete-button:hover { background: rgba(93, 31, 40, 0.48); }

.chat-attachment {
	margin: 0;
	padding: 0;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(200, 169, 107, 0.18);
	background: rgba(11, 10, 9, 0.45);
}

.chat-attachment img {
	display: block;
	max-width: 280px;
	width: 100%;
	height: auto;
}

.chat-edit-box {
	display: grid;
	gap: 8px;
	padding-top: 4px;
}

.chat-edit-input {
	min-height: 72px;
	border-radius: 10px;
}

.chat-edit-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
}

.chat-form {
	display: grid;
	gap: 6px;
	padding-top: 10px;
	border-top: 1px solid rgba(200, 169, 107, 0.1);
}

.chat-input-row {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	background: rgba(16, 10, 8, 0.55);
	border: 1px solid rgba(200, 169, 107, 0.2);
	border-radius: 22px;
	padding: 6px 6px 6px 12px;
}

.chat-attach-btn {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--text-soft);
	cursor: pointer;
	transition: color 150ms ease;
	margin-bottom: 1px;
}

.chat-attach-btn:hover {
	color: var(--gold);
}

.chat-attach-btn input {
	display: none;
}

.chat-input {
	flex: 1;
	border: none;
	background: none;
	color: var(--text-main);
	font-family: "Lora", "Georgia", serif;
	font-size: 1.08rem;
	resize: none;
	padding: 6px 0;
	line-height: 1.5;
	max-height: 140px;
	overflow-y: auto;
}

.chat-input:focus {
	outline: none;
}

.chat-input::placeholder {
	color: var(--text-soft);
	opacity: 0.6;
}

.chat-send-btn {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(93, 31, 40, 0.7);
	border: 1px solid rgba(200, 169, 107, 0.28);
	color: var(--gold-soft);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 150ms ease;
	margin-bottom: 1px;
}

.chat-send-btn:hover {
	background: rgba(93, 31, 40, 1);
}

.chat-file-status {
	margin: 0;
	font-size: 0.86rem;
	color: var(--text-soft);
	padding: 0 4px;
	min-height: 1em;
}

@media (max-width: 980px) {
	.register-layout,
	.profile-layout {
		grid-template-columns: 1fr;
	}

	.house-window-grid {
		grid-template-columns: 1fr;
	}

	.avatar-card {
		position: static;
	}

	.hero-panel {
		min-height: 420px;
		padding-top: 74px;
	}
}

.events-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 22px;
	align-items: start;
}

.event-card {
	display: grid;
	gap: 16px;
}

.event-card-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 14px;
	flex-wrap: wrap;
	padding:20px;
}

.event-title {
	margin: 0;
	font-family: "Grenze Gotisch", serif;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	color: var(--gold-soft);
	letter-spacing: 0.04em;
}

.event-description {
	margin: 0;
	color: var(--text-soft);
	font-size: 1.08rem;
	line-height: 1.6;
	white-space: pre-wrap;
}

#events .panel-heading {
	margin-bottom: 18px;
}

.event-materials {
	display: grid;
	gap: 14px;
	padding-top: 12px;
	border-top: 1px solid rgba(200, 169, 107, 0.16);
}

.material-item {
	display: grid;
	gap: 10px;
	padding: 14px;
	border-radius: 16px;
	border: 1px solid rgba(200, 169, 107, 0.14);
	background: rgba(235, 222, 191, 0.04);
}

.material-item-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.material-type-badge {
	font-size: 0.88rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--gold-soft);
	opacity: 0.72;
}

.material-image {
	margin: 0;
}

.material-image img {
	display: block;
	max-width: 480px;
	width: 100%;
	height: auto;
	border-radius: 12px;
	cursor: zoom-in;
}

.material-image img.is-expanded {
	max-width: 100%;
	cursor: zoom-out;
}

.material-link {
	display: inline-block;
	padding: 10px 20px;
	border: 1px solid rgba(200, 169, 107, 0.32);
	border-radius: 999px;
	color: var(--gold-soft);
	font-size: 1.05rem;
	transition: background-color 180ms ease;
}

.material-link:hover {
	background: rgba(93, 31, 40, 0.35);
}

.material-text {
	margin: 0;
	color: var(--text-main);
	font-size: 1.05rem;
	line-height: 1.6;
	white-space: pre-wrap;
}

.event-admin-bar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.event-create-form {
	display: grid;
	gap: 14px;
	margin-bottom: 24px;
}

.event-create-form h3 {
	margin: 0;
}

.event-admin-buttons {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

.action-button--ghost {
	background: transparent;
	border-color: rgba(200, 169, 107, 0.3);
	color: var(--text-soft);
}

.action-button--ghost:hover {
	background: rgba(200, 169, 107, 0.1);
}

.action-button--small {
	padding: 6px 14px;
	font-size: 0.92rem;
	min-height: unset;
}

.event-edit-form {
	display: grid;
	gap: 14px;
	margin-top: 4px;
}

.event-edit-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.material-add-form {
	display: grid;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px dashed rgba(200, 169, 107, 0.22);
	margin-top: 6px;
}

.material-form-row {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 10px;
	align-items: center;
}

.event-gate {
	display: grid;
	gap: 12px;
	padding: 20px;
	border-radius: 16px;
	border: 1px dashed rgba(200, 169, 107, 0.28);
	background: rgba(33, 20, 15, 0.4);
	text-align: center;
}

.event-gate p {
	margin: 0;
	color: var(--text-soft);
}

.event-gate .action-button {
	margin: 0 auto;
}

/* ── Daily Prophet newspaper styling for news/events ─────────────────────── */

.prophet-masthead {
	position: relative;
	overflow: hidden;
	text-align: center;
	padding: 30px 20px 20px;
	margin-bottom: 24px;
	background: linear-gradient(180deg, #f1e6ca, #e2d3ab);
	border: 1px solid rgba(33, 26, 18, 0.35);
	border-radius: 10px;
	color: #211a12;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.prophet-masthead::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.5;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
}

.prophet-eyebrow {
	position: relative;
	margin: 0;
	font-family: "Cormorant Garamond", serif;
	text-transform: uppercase;
	letter-spacing: 0.24em;
	font-size: 0.78rem;
	color: #4a3b28;
}

.prophet-title {
	position: relative;
	margin: 6px 0 0;
	font-family: "Grenze Gotisch", serif;
	font-size: clamp(2.6rem, 7vw, 4.6rem);
	letter-spacing: 0.02em;
	line-height: 1;
	color: #211a12;
}

.prophet-tagline {
	position: relative;
	margin: 8px 0 0;
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: 0.95rem;
	color: #4a3b28;
}

.prophet-rule {
	position: relative;
	height: 2px;
	margin: 16px 0 10px;
	background: repeating-linear-gradient(90deg, #211a12 0 7px, transparent 7px 11px);
	opacity: 0.6;
}

.prophet-meta-row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(33, 26, 18, 0.35);
	font-family: "Cormorant Garamond", serif;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #4a3b28;
}

.prophet-article {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #f1e6ca, #e4d5ac);
	color: #211a12;
	border: 1px solid rgba(33, 26, 18, 0.28);
	border-radius: 6px;
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

.prophet-article::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.4;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.prophet-article > * {
	position: relative;
}

.prophet-article .event-card-head {
	padding: 20px 20px 12px;
	border-bottom: 2px solid #211a12;
	margin-bottom: 4px;
}

.prophet-article .panel-kicker {
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	letter-spacing: 0.1em;
	color: #6b4a1f;
}

.prophet-article .event-title {
	font-family: "Grenze Gotisch", serif;
	color: #211a12;
	text-shadow: none;
}

.prophet-byline {
	margin: 4px 0 0;
	font-family: "Cormorant Garamond", serif;
	font-style: italic;
	font-size: 0.85rem;
	color: #6b4a1f;
}

.prophet-article .event-description {
	padding: 4px 20px 20px;
	color: #2c2116;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.12rem;
	line-height: 1.65;
	text-align: justify;
	hyphens: auto;
}

.prophet-article .event-description.has-drop-cap::first-letter {
	font-family: "Grenze Gotisch", serif;
	font-size: 3.2rem;
	line-height: 0.75;
	float: left;
	padding: 4px 8px 0 0;
	color: #211a12;
}

.prophet-article .event-materials {
	margin: 0 20px 20px;
	padding-top: 14px;
	border-top: 1px solid rgba(33, 26, 18, 0.25);
}

.prophet-article .material-item {
	background: rgba(33, 26, 18, 0.05);
	border-color: rgba(33, 26, 18, 0.22);
}

.prophet-article .material-type-badge {
	color: #6b4a1f;
}

.prophet-article .material-image img {
	filter: sepia(0.4) contrast(1.05) brightness(0.97);
	border: 6px solid #f1e6ca;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.prophet-article .material-link {
	border-color: rgba(33, 26, 18, 0.4);
	color: #211a12;
}

.prophet-article .material-link:hover {
	background: rgba(33, 26, 18, 0.08);
}

.prophet-article .material-text {
	color: #2c2116;
	font-family: "Cormorant Garamond", serif;
}

.prophet-article .event-gate {
	margin: 0 20px 20px;
	border-color: rgba(33, 26, 18, 0.32);
	background: rgba(33, 26, 18, 0.06);
}

.prophet-article .event-gate p {
	color: #4a3b28;
}

.prophet-article .action-button--ghost,
.prophet-article .chat-delete-button {
	color: #211a12;
	border-color: rgba(33, 26, 18, 0.4);
}

.prophet-article .action-button--ghost:hover,
.prophet-article .chat-delete-button:hover {
	background: rgba(33, 26, 18, 0.08);
}

.prophet-article .event-admin-buttons {
	padding-right: 20px;
	padding-top: 4px;
}

@media (max-width: 640px) {
	.prophet-article .event-description {
		text-align: left;
	}
}

@media (max-width: 720px) {
	.page-shell {
		width: min(100% - 20px, 1000px);
		padding-top: 10px;
	}

	.site-header,
	.content-panel,
	.ornate-card {
		border-radius: 20px;
	}

	.site-header {
		max-height: 80vh;
		transition: max-height 420ms cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 320ms ease,
		            padding 420ms ease,
		            margin 420ms ease;
	}

	.site-header,
	.content-panel {
		padding: 18px;
	}

	#locations.content-panel {
		padding: 12px 8px;
	}

	.hero-panel {
		min-height: 360px;
		max-height: 600px;
		padding: 58px 12px 12px;
		overflow: hidden;
		transition: max-height 500ms cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 400ms ease,
		            min-height 500ms ease,
		            padding 500ms ease,
		            margin 500ms ease;
	}

	/* Сворачиваем hero при переходе на любой раздел кроме главной */
	body:not([data-current-route="home"]) .hero-panel {
		max-height: 0;
		min-height: 0;
		opacity: 0;
		padding-top: 0;
		padding-bottom: 0;
		margin-top: 0;
		pointer-events: none;
	}

	.site-title {
		font-size: clamp(2.8rem, 18vw, 4.6rem);
	}

	.hero-copy {
		font-size: 1.08rem;
	}

	.nav-toggle {
		display: flex;
		position: fixed;
		z-index: 200;
	}

	.main-nav {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 100;
		flex-direction: column;
		gap: 8px;
		padding: 70px 20px 24px;
		background: rgba(10, 7, 6, 0.97);
		border-bottom: 1px solid rgba(200, 169, 107, 0.22);
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
	}

	.main-nav.is-open {
		display: flex;
	}

	.nav-link,
	.nav-button,
	.action-button {
		width: 100%;
		text-align: center;
		min-height: 46px;
	}

	.ornate-card,
	.location-details {
		padding: 5px;
	}

	.home-stage {
		min-height: 220px;
	}

	.house-window {
		min-height: 220px;
		padding: 18px;
	}

	.house-title {
		font-size: clamp(1.8rem, 10vw, 2.7rem);
	}

	.house-list-head {
		align-items: flex-start;
	}

	.roster-item {
		padding: 10px 12px;
	}

	.chat-thread {
		max-height: 52vh;
	}

	.chat-bubble {
		max-width: min(82%, 480px);
	}

	.chat-bubble-tools {
		opacity: 1;
	}

	.chat-edit-button,
	.chat-delete-button,
	.chat-edit-save,
	.chat-edit-cancel {
		min-height: 32px;
		padding: 4px 10px;
	}

	.chat-edit-input {
		min-height: 80px;
	}

	.auth-letter-card {
		padding: 18px;
	}

	.auth-letter-message {
		font-size: 1.24rem;
	}

	textarea {
		font-size: 16px;
	}

	.folder-tabs {
		grid-template-columns: 1fr;
	}

	/* ── Chat full-screen mode ────────────────────────────────────────────────── */

	body.chat-is-open .site-header {
		max-height: 0;
		padding-top: 0;
		padding-bottom: 0;
		margin-top: 0;
		margin-bottom: 0;
		pointer-events: none;
	}

	/* Panel heading and gated message hidden in full-screen chat */
	body.chat-is-open .panel-heading,
	body.chat-is-open .gated-message {
		display: none;
	}

	/* Entire content stack should not block nav-toggle in chat mode */
	body.chat-is-open .content-stack,
	body.chat-is-open #locations.tab-chat {
		pointer-events: none;
	}

	/* Re-enable interactions on fixed interactive elements */
	body.chat-is-open .location-mobile-tabs,
	body.chat-is-open .location-chat,
	body.chat-is-open .nav-toggle,
	body.chat-is-open .main-nav.is-open {
		pointer-events: auto;
	}

	/* Mobile tabs: fixed at top, leave right gap for burger (nav-toggle at right:14px, 40px wide) */
	body.chat-is-open .location-mobile-tabs {
		position: fixed;
		top: 8px;
		left: 10px;
		right: 62px;
		z-index: 60;
		margin: 0;
	}

	/* Chat fills viewport below tabs */
	body.chat-is-open .location-chat {
		position: fixed;
		top: 62px;
		left: 10px;
		right: 10px;
		bottom: 10px;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		z-index: 55;
		border-radius: 16px;
	}

	body.chat-is-open .chat-heading {
		flex-shrink: 0;
	}

	body.chat-is-open .chat-thread {
		flex: 1;
		max-height: none;
		overflow-y: auto;
	}

	body.chat-is-open .chat-form {
		flex-shrink: 0;
	}

}

/* ── Unread badge on location tabs ──────────────────────────────────────────── */

.location-unread-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	border-radius: 999px;
	background: rgba(93, 31, 40, 0.9);
	border: 1px solid rgba(200, 169, 107, 0.35);
	color: var(--gold-soft);
	font-size: 0.72rem;
	font-weight: 700;
	margin-left: 6px;
	vertical-align: middle;
	flex-shrink: 0;
}

.nav-link.has-unread::after {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(210, 80, 80, 0.9);
	margin-left: 5px;
	vertical-align: middle;
}

/* ── Typing indicator ────────────────────────────────────────────────────────── */

.chat-typing-indicator {
	min-height: 20px;
	padding: 2px 6px;
	font-size: 0.86rem;
	color: var(--text-soft);
	font-style: italic;
	opacity: 0;
	transition: opacity 200ms ease;
}

.chat-typing-indicator.is-visible {
	opacity: 1;
}

/* ── New message highlight ───────────────────────────────────────────────────── */

@keyframes newMessageGlow {
	0% { box-shadow: 0 0 0 2px rgba(200, 169, 107, 0.5), inset 0 0 14px rgba(200, 169, 107, 0.14); }
	100% { box-shadow: none; }
}

.chat-row.is-new-message .chat-bubble {
	animation: newMessageGlow 3s ease forwards;
}

/* ── Mobile location tabs ────────────────────────────────────────────────────── */

.location-mobile-tabs {
	display: none;
}

@media (max-width: 720px) {
	.location-mobile-tabs {
		display: flex;
		position: sticky;
		top: 8px;
		z-index: 10;
		border-radius: 16px;
		overflow: hidden;
		border: 1px solid rgba(200, 169, 107, 0.22);
		margin-bottom: 14px;
		backdrop-filter: blur(8px);
		-webkit-backdrop-filter: blur(8px);
	}

	.location-mobile-tab {
		flex: 1;
		padding: 12px 8px;
		text-align: center;
		background: rgba(31, 22, 17, 0.72);
		border: none;
		color: var(--text-soft);
		cursor: pointer;
		font-family: "Cormorant Garamond", serif;
		font-size: 1.02rem;
		transition: background 180ms ease, color 180ms ease;
	}

	.location-mobile-tab.is-active {
		background: rgba(93, 31, 40, 0.6);
		color: var(--gold-soft);
	}

	#locations.tab-nav .location-details {
		display: none !important;
	}

	#locations.tab-chat #world-tabs,
	#locations.tab-chat .location-territories,
	#locations.tab-chat .folder-tabs {
		display: none !important;
	}

	.gated-panel.is-locked .location-mobile-tabs {
		display: none;
	}
}

/* ── Unread badge ────────────────────────────────────────────────────────────── */

.location-unread-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--accent-burgundy, #8b2331);
	color: #fff;
	font-size: 0.7rem;
	font-family: system-ui, sans-serif;
	font-weight: 600;
	line-height: 1;
	margin-left: 6px;
	vertical-align: middle;
}

/* ── Chronicle / Магическая хроника ─────────────────────────────────────────── */

.chronicle-timeline {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 16px;
	margin-bottom: 24px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	border-bottom: 1px solid rgba(200, 169, 107, 0.1);
}

.chronicle-timeline::-webkit-scrollbar {
	display: none;
}

.chronicle-pill {
	flex-shrink: 0;
	padding: 7px 16px;
	border-radius: 999px;
	background: rgba(20, 14, 10, 0.55);
	border: 1px solid rgba(200, 169, 107, 0.18);
	color: var(--text-soft);
	font-family: "Cormorant Garamond", serif;
	font-size: 0.95rem;
	cursor: pointer;
	transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
	white-space: nowrap;
}

.chronicle-pill:hover {
	background: rgba(200, 169, 107, 0.1);
	color: var(--gold-soft);
}

.chronicle-pill.is-active {
	background: rgba(93, 31, 40, 0.55);
	border-color: rgba(200, 169, 107, 0.38);
	color: var(--gold);
}

.chronicle-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.chronicle-entry {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 0 16px;
	padding: 16px 0;
	border-bottom: 1px solid rgba(200, 169, 107, 0.1);
	position: relative;
}

.chronicle-entry:last-child {
	border-bottom: none;
}

.chronicle-entry::before {
	content: "";
	position: absolute;
	left: 20px;
	top: 0;
	bottom: 0;
	width: 1px;
	background: rgba(200, 169, 107, 0.18);
}

.chronicle-entry:first-child::before {
	top: 50%;
}

.chronicle-entry:last-child::before {
	bottom: 50%;
}

.chronicle-day {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(31, 22, 17, 0.72);
	border: 1px solid rgba(200, 169, 107, 0.28);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--gold-soft);
	position: relative;
	z-index: 1;
	flex-shrink: 0;
	align-self: start;
	margin-top: 0;
}

.chronicle-content {
	padding-top: 8px;
}

.chronicle-title {
	display: block;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.18rem;
	font-weight: 600;
	color: var(--text-main);
	line-height: 1.3;
	margin-bottom: 6px;
}

.chronicle-desc {
	margin: 0;
	font-family: "Lora", "Georgia", serif;
	font-size: 0.96rem;
	line-height: 1.6;
	color: var(--text-soft);
}


/* ─── Plot lines ─────────────────────────────────────────────────────────── */

.plot-empty {
	text-align: center;
	padding: 48px 24px;
}

.plot-add-root-btn {
	margin-bottom: 24px;
}

.plot-tree-scroll {
	overflow-x: auto;
	overflow-y: visible;
	padding-bottom: 32px;
}

.plot-tree-wrap {
	position: relative;
	min-width: 100%;
}

.plot-tree-svg {
	position: absolute;
	top: 0;
	left: 0;
	pointer-events: none;
}

.plot-node {
	position: absolute;
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba(16, 12, 8, 0.82);
	border: 1px solid rgba(200, 169, 107, 0.18);
	backdrop-filter: blur(4px);
	transition: border-color 180ms, box-shadow 180ms;
}

.plot-node:hover {
	border-color: rgba(200, 169, 107, 0.42);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.plot-node--active {
	border-color: rgba(200, 169, 107, 0.42);
	box-shadow: 0 0 18px rgba(200, 169, 107, 0.07);
}

.plot-node--completed {
	border-color: rgba(90, 160, 110, 0.38);
}

.plot-node--abandoned {
	opacity: 0.5;
}

.plot-node-status {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.13em;
	color: var(--text-soft);
	margin-bottom: 5px;
}

.plot-node--active   .plot-node-status { color: var(--gold-soft); }
.plot-node--completed .plot-node-status { color: #7bbf90; }

.plot-node-title {
	display: block;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--text-main);
	line-height: 1.3;
}

.plot-node-desc {
	margin: 7px 0 0;
	font-family: "Lora", "Georgia", serif;
	font-size: 0.82rem;
	line-height: 1.52;
	color: var(--text-soft);
}

.plot-node-actions {
	display: flex;
	gap: 6px;
	margin-top: 10px;
	opacity: 0;
	transition: opacity 150ms;
}

.plot-node:hover .plot-node-actions {
	opacity: 1;
}

.plot-btn {
	padding: 3px 9px;
	border-radius: 6px;
	border: 1px solid rgba(200, 169, 107, 0.2);
	background: transparent;
	color: var(--text-soft);
	font-size: 0.88rem;
	cursor: pointer;
	transition: background 140ms, color 140ms, border-color 140ms;
}

.plot-btn--add:hover  { background: rgba(93, 31, 40, 0.35); color: var(--gold-soft); border-color: rgba(200,169,107,0.4); }
.plot-btn--edit:hover { background: rgba(40, 80, 50, 0.4); color: #8aba98; border-color: rgba(90,160,110,0.4); }
.plot-btn--del:hover  { background: rgba(120, 30, 30, 0.5); color: #e07070; border-color: rgba(200,80,80,0.4); }

/* Modal */

.plot-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 600;
	align-items: center;
	justify-content: center;
}

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

.plot-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(6, 5, 3, 0.72);
}

.plot-modal-card {
	position: relative;
	width: min(460px, 92vw);
	z-index: 1;
	padding: 28px 28px 24px;
}

.plot-modal-card h3 {
	margin: 0 0 22px;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.55rem;
	font-weight: 600;
	color: var(--text-main);
}

.plot-modal-card label {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-bottom: 16px;
}

.plot-modal-card label span {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-soft);
}

.plot-modal-footer {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 22px;
}

#plot-modal-cancel {
	background: transparent;
	border: 1px solid rgba(200, 169, 107, 0.22);
	color: var(--text-soft);
	border-radius: 8px;
	padding: 10px 20px;
	cursor: pointer;
	font-size: 0.95rem;
	transition: background 150ms;
}

#plot-modal-cancel:hover {
	background: rgba(200, 169, 107, 0.08);
}

/* ─── Audio player ───────────────────────────────────────────────────────── */

.audio-player {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 300;
	background: rgba(7, 5, 3, 0.97);
	backdrop-filter: blur(12px);
	border-top: 1px solid rgba(200, 169, 107, 0.3);
	box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.6);
}

.audio-player::before {
	content: "";
	position: absolute;
	top: 0;
	left: 10%;
	right: 10%;
	height: 1px;
	background: linear-gradient(to right, transparent, rgba(200, 169, 107, 0.55), transparent);
}

.audio-player-inner {
	display: grid;
	grid-template-columns: 1fr auto auto auto;
	align-items: center;
	gap: 16px;
	padding: 10px 20px;
	max-width: 1260px;
	margin: 0 auto;
}

.audio-track-info {
	min-width: 0;
}

.audio-track-name {
	display: block;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.05rem;
	font-style: italic;
	color: var(--gold-soft);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.audio-controls {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.audio-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid rgba(200, 169, 107, 0.22);
	background: transparent;
	color: var(--gold-soft);
	font-size: 0.9rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 150ms, border-color 150ms, transform 100ms;
	flex-shrink: 0;
}

.audio-btn:hover {
	background: rgba(200, 169, 107, 0.1);
	border-color: rgba(200, 169, 107, 0.5);
}

.audio-btn--play {
	width: 42px;
	height: 42px;
	font-size: 1.05rem;
	border-color: rgba(200, 169, 107, 0.4);
	background: rgba(200, 169, 107, 0.06);
}

.audio-btn--play:hover {
	background: rgba(200, 169, 107, 0.15);
	transform: scale(1.05);
}

.audio-progress-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 120px;
}

.audio-time {
	font-size: 0.72rem;
	color: var(--text-soft);
	font-variant-numeric: tabular-nums;
	flex-shrink: 0;
	min-width: 30px;
}

.audio-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.audio-vol-icon {
	color: var(--text-soft);
	font-size: 0.85rem;
}

/* Range inputs */
.audio-range {
	-webkit-appearance: none;
	appearance: none;
	height: 3px;
	border-radius: 2px;
	background: rgba(200, 169, 107, 0.15);
	outline: none;
	cursor: pointer;
}

.audio-progress { flex: 1; }
.audio-volume { width: 80px; }

.audio-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--gold);
	border: none;
	box-shadow: 0 0 6px rgba(200, 169, 107, 0.4);
	cursor: pointer;
	transition: transform 120ms;
}

.audio-range::-webkit-slider-thumb:hover { transform: scale(1.3); }
.audio-range::-moz-range-thumb {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--gold);
	border: none;
	cursor: pointer;
}

.audio-btn--manage {
	font-size: 0.85rem;
	border-radius: 8px;
}

/* Add bottom padding to page-shell so content isn't hidden behind player */
.audio-player:not([hidden]) ~ * .page-shell,
body:has(.audio-player:not([hidden])) .page-shell {
	padding-bottom: 72px;
}

/* Audio manage modal */
.audio-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 600;
	align-items: center;
	justify-content: center;
}

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

.audio-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(5, 4, 2, 0.75);
}

.audio-modal-card {
	position: relative;
	width: min(500px, 92vw);
	max-height: 80vh;
	overflow-y: auto;
	z-index: 1;
	padding: 28px;
}

.audio-modal-card h3 {
	margin: 0 0 20px;
	font-family: "Cormorant Garamond", serif;
	font-size: 1.55rem;
	font-weight: 600;
	color: var(--gold-soft);
}

.audio-upload-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 14px;
}

.audio-upload-form label span {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--text-soft);
}

.audio-upload-status {
	font-size: 0.88rem;
	color: var(--gold-soft);
	margin: 4px 0 10px;
	min-height: 1.2em;
}

.audio-track-list {
	margin-top: 20px;
	border-top: 1px solid rgba(200, 169, 107, 0.15);
	padding-top: 16px;
}

.audio-list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(200, 169, 107, 0.08);
}

.audio-list-item.is-current .audio-list-title {
	color: var(--gold-soft);
}

.audio-list-title {
	font-family: "Cormorant Garamond", serif;
	font-size: 1rem;
	color: var(--text-main);
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.audio-list-actions {
	display: flex;
	gap: 6px;
	flex-shrink: 0;
}

.audio-list-btn {
	padding: 3px 10px;
	border-radius: 6px;
	border: 1px solid rgba(200, 169, 107, 0.2);
	background: transparent;
	color: var(--text-soft);
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 140ms, color 140ms;
}

.audio-list-btn:hover { background: rgba(200, 169, 107, 0.1); color: var(--gold-soft); }
.audio-list-btn--del:hover { background: rgba(140, 30, 30, 0.4); color: #e07070; border-color: rgba(200,80,80,0.35); }

.audio-modal-close {
	margin-top: 20px;
	background: transparent;
	border: 1px solid rgba(200, 169, 107, 0.22);
	color: var(--text-soft);
	border-radius: 8px;
	padding: 9px 20px;
	cursor: pointer;
	font-size: 0.95rem;
	transition: background 150ms;
	width: 100%;
}

.audio-modal-close:hover { background: rgba(200, 169, 107, 0.08); }

@media (max-width: 720px) {
	.audio-player-inner {
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
		gap: 8px;
		padding: 8px 14px;
	}

	.audio-track-info { grid-column: 1; grid-row: 1; }
	.audio-controls { grid-column: 2; grid-row: 1; }
	.audio-progress-wrap { grid-column: 1 / -1; grid-row: 2; }
	.audio-right { display: none; }
}

/* ── Admin panel ── */
.admin-pw-table-block {
	margin-bottom: 24px;
	padding: 20px 24px;
}

.admin-pw-table-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	color: inherit;
	text-align: left;
}
.admin-pw-table-toggle:hover .admin-pw-table-toggle-title {
	color: var(--accent-gold, #c8a96a);
}

.admin-pw-table-toggle-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-primary);
	transition: color 150ms;
}

.admin-pw-table-arrow {
	font-size: 0.7rem;
	color: var(--text-soft);
	transition: color 150ms;
}

.admin-pw-table-body {
	margin-top: 16px;
}

.admin-pw-table-actions {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 10px;
}

.admin-pw-table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-body);
}

.admin-pw-table th {
	text-align: left;
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-soft);
	padding: 6px 14px;
	border-bottom: 1px solid rgba(200, 169, 107, 0.2);
}

.admin-pw-table td {
	padding: 7px 14px;
	font-size: 1rem;
	color: var(--text-primary);
	border-bottom: 1px solid rgba(200, 169, 107, 0.07);
}

.admin-pw-table tbody tr:last-child td {
	border-bottom: none;
}

.admin-pw-table tbody tr:hover td {
	background: rgba(255, 255, 255, 0.03);
}

.admin-pw-table-pw {
	font-family: monospace;
	font-size: 1rem;
	color: #c8b97a;
	user-select: all;
}

.admin-pw-table-none {
	color: rgba(200, 169, 107, 0.3);
	font-style: italic;
	font-size: 0.88rem;
}

.admin-pw-table-row--empty td {
	opacity: 0.45;
}

.admin-gen-block {
	margin-bottom: 24px;
	padding: 20px 24px;
}

.admin-gen-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.admin-gen-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 16px 0 12px;
}

.admin-gen-progress {
	font-size: 0.85rem;
	color: var(--text-soft);
	font-family: var(--font-body);
}

.admin-genlist {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-height: 360px;
	overflow-y: auto;
	border: 1px solid rgba(200, 169, 107, 0.12);
	border-radius: 8px;
	padding: 8px;
	background: rgba(0,0,0,0.18);
}

.admin-genlist-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.admin-genlist-name {
	flex: 0 0 240px;
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--text-primary);
}

.admin-genlist-pw {
	flex: 1;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(200, 169, 107, 0.18);
	border-radius: 5px;
	color: #c8b97a;
	font-family: monospace;
	font-size: 1rem;
	padding: 5px 10px;
	outline: none;
	cursor: text;
	user-select: all;
}

.admin-roster {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.admin-roster-item {
	display: grid;
	grid-template-columns: 220px 110px 160px auto auto;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: rgba(255,255,255,0.03);
	border: 1px solid rgba(200, 169, 107, 0.12);
	border-radius: 8px;
}

.admin-roster-name {
	font-family: var(--font-body);
	color: var(--text-primary);
	font-size: 1.05rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.admin-pw-badge {
	font-size: 0.85rem;
	padding: 3px 10px;
	border-radius: 20px;
	font-family: var(--font-body);
	letter-spacing: 0.02em;
	text-align: center;
}
.admin-pw-badge.is-set {
	background: rgba(60, 120, 60, 0.2);
	color: #8fc98f;
	border: 1px solid rgba(60, 150, 60, 0.25);
}
.admin-pw-badge.is-unset {
	background: rgba(120, 60, 60, 0.18);
	color: #c98f8f;
	border: 1px solid rgba(150, 60, 60, 0.22);
}

.admin-pw-current {
	font-family: monospace;
	font-size: 1rem;
	color: #c8b97a;
	background: rgba(0,0,0,0.2);
	border: 1px solid rgba(200, 169, 107, 0.15);
	border-radius: 5px;
	padding: 3px 8px;
	user-select: all;
	cursor: text;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.admin-pw-current--empty {
	color: rgba(200, 169, 107, 0.25);
	border-color: transparent;
	background: transparent;
}

.action-button--danger {
	background: rgba(100, 20, 20, 0.5);
	border-color: rgba(180, 60, 60, 0.35);
	color: #d08080;
}
.action-button--danger:hover {
	background: rgba(140, 30, 30, 0.6);
}

.admin-set-pw-form {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	padding-top: 8px;
	border-top: 1px solid rgba(200, 169, 107, 0.08);
	margin-top: 2px;
}

.admin-pw-input {
	flex: 1 1 220px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(200, 169, 107, 0.25);
	border-radius: 6px;
	color: var(--text-primary);
	font-family: var(--font-body);
	font-size: 1rem;
	padding: 7px 12px;
	outline: none;
}
.admin-pw-input:focus {
	border-color: rgba(200, 169, 107, 0.55);
}

.admin-pw-status {
	font-size: 0.92rem;
	color: var(--text-soft);
	font-family: var(--font-body);
}

@media (max-width: 900px) {
	.admin-roster-item {
		grid-template-columns: 1fr auto auto;
	}
	.admin-pw-current { display: none; }
}

@media (max-width: 720px) {
	.admin-roster-item {
		grid-template-columns: 1fr auto;
		padding: 10px 12px;
	}
	.admin-pw-badge { display: none; }
}

/* ── Admin: Faculty Tabs ──────────────────────────────────── */

.ahl-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ahl-tab {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(200, 169, 107, 0.2);
    border-radius: 20px;
    color: var(--text-soft);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 7px 18px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.ahl-tab:hover {
    background: rgba(200, 169, 107, 0.1);
    color: var(--text-primary);
}
.ahl-tab.is-active {
    background: rgba(200, 169, 107, 0.18);
    border-color: rgba(200, 169, 107, 0.55);
    color: var(--text-primary);
    font-weight: 600;
}

.ahl-panel {
    padding: 0;
    overflow: hidden;
}

.ahl-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px 14px;
    border-bottom: 1px solid rgba(200, 169, 107, 0.12);
}

.ahl-panel-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text-primary);
}

.ahl-add-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(200, 169, 107, 0.4);
    background: transparent;
    color: var(--color-gold);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s;
}
.ahl-add-btn:hover {
    background: rgba(200, 169, 107, 0.15);
    border-color: var(--color-gold);
}

.ahl-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 22px;
    background: rgba(200, 169, 107, 0.06);
    border-bottom: 1px solid rgba(200, 169, 107, 0.12);
}

.ahl-role-input {
    flex: 1 1 180px;
}

.ahl-list {
    display: flex;
    flex-direction: column;
}

.ahl-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-bottom: 1px solid rgba(200, 169, 107, 0.08);
    transition: background 0.15s;
}
.ahl-item:last-child { border-bottom: none; }
.ahl-item:hover { background: rgba(255,255,255,0.025); }

.ahl-name {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-primary);
}

.ahl-admin-star {
    color: var(--color-gold);
    font-size: 0.85em;
    margin-left: 4px;
}

.ahl-pw-plain {
    font-family: monospace;
    font-size: 0.95rem;
    color: var(--color-gold);
    opacity: 0.85;
    grid-column: 1 / -1;
    padding-left: 2px;
    margin-top: -6px;
    margin-bottom: 2px;
}
.ahl-pw-plain--empty {
    color: var(--text-muted);
    opacity: 0.5;
}

.ahl-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.ahl-pw-form {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(200, 169, 107, 0.08);
    margin-top: 4px;
}

@media (min-width: 640px) {
    .ahl-item {
        grid-template-columns: 220px 1fr auto;
    }
    .ahl-pw-plain {
        grid-column: auto;
        margin-top: 0;
        margin-bottom: 0;
        padding-left: 0;
    }
    .ahl-actions {
        grid-column: auto;
    }
    .ahl-pw-form {
        grid-column: 1 / -1;
    }
}

.character-list-subtitle {
    max-width: 620px;
    margin-bottom: 24px;
}

.char-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.filter-pill {
    font-family: "Grenze Gotisch", serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-soft);
    background: transparent;
    border: 1px solid rgba(200, 169, 107, 0.3);
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.filter-pill:hover {
    color: var(--gold-soft);
    border-color: var(--gold-soft);
}

.filter-pill--active {
    color: var(--bg-ink);
    background: var(--gold);
    border-color: var(--gold);
}

.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}

.char-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid rgba(200, 169, 107, 0.24);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(28, 20, 14, 0.85), rgba(16, 11, 9, 0.85));
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.char-card:hover {
    border-color: var(--gold-soft);
    transform: translateY(-3px);
}

.char-card__photo {
    position: relative;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(200, 169, 107, 0.2);
}

.char-card__photo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-card__initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: "Grenze Gotisch", serif;
    font-size: 2.2rem;
    color: var(--gold-soft);
}

.char-card__body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-card__name {
    margin: 0;
    font-family: "Grenze Gotisch", serif;
    letter-spacing: 0.02em;
    font-size: 1.05rem;
    color: var(--gold-soft);
}

.char-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.char-card__tag {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-soft);
    border: 1px solid rgba(200, 169, 107, 0.3);
    border-radius: 999px;
    padding: 3px 9px;
}

.char-card__status {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.char-card__status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.char-card__status--filled {
    color: var(--gold-soft);
}

.char-card__status--filled::before {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(200, 169, 107, 0.7);
}

.char-card__status--empty {
    color: var(--text-soft);
}

.char-card__status--empty::before {
    background: var(--text-soft);
}

.char-card__role {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--text-soft);
}

.char-grid--empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-soft);
    padding: 40px 0;
}
