:root {
	--bg: #0a0a0a;
	--bg-paper: #0c0c0c;
	--ink: #e8e8e8;
	--ink-dim: #aaa;
	--ink-mute: #777;
	--ink-faint: #555;
	--line: #1c1c1c;
	--line-soft: #181818;
	--line-strong: #2a2a2a;
	--serif: "Cardo", "EB Garamond", Georgia, serif;
	--sans: "Inter", system-ui, -apple-system, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, monospace;
	--paper: #f5f1e8;
	--paper-line: rgba(120, 100, 60, 0.08);
	--paper-border: #e8dfc8;
}

html,
body {
	width: 100%;
	min-height: 100vh;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--serif);
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

button {
	font-family: inherit;
	color: inherit;
}
input {
	font-family: inherit;
	color: inherit;
}

/* ─── Layout ─── */
.letter-root {
	width: 100vw;
	height: 100vh;
	display: block;
	background: var(--bg-paper);
	color: var(--ink);
	overflow: hidden;
}

/* ─── Sidebar ─── */
.letter-side {
	border-right: 1px solid var(--line);
	padding: 36px 28px;
	display: flex;
	flex-direction: column;
	text-align: center;
	overflow-y: auto;
	background: var(--bg);
}
.letter-side::-webkit-scrollbar {
	width: 0;
}

.side-flourish {
	font-size: 26px;
	color: var(--ink-faint);
	letter-spacing: 0.3em;
	margin-bottom: 16px;
}
.side-mark {
	font-style: italic;
	font-size: 15px;
	color: var(--ink-mute);
	letter-spacing: 0.4em;
	margin-bottom: 12px;
}
.side-name {
	font-size: 30px;
	font-weight: 400;
	color: #fff;
	letter-spacing: -0.01em;
	margin-bottom: 4px;
}
.side-tag {
	font-style: italic;
	font-size: 14px;
	color: var(--ink-mute);
	margin-bottom: 26px;
}

.side-rule {
	height: 1px;
	background: linear-gradient(to right, transparent, var(--line-strong) 25%, var(--line-strong) 75%, transparent);
	margin: 0 -10px 22px;
}

.side-list {
	text-align: left;
	margin-bottom: 22px;
}
.side-label {
	font-family: var(--mono);
	font-size: 10px;
	color: var(--ink-mute);
	letter-spacing: 0.2em;
	margin-bottom: 12px;
	text-transform: uppercase;
}

.side-row {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 8px 0;
	font-size: 15px;
	color: #ccc;
	cursor: pointer;
	border: none;
	background: none;
	transition:
		color 0.2s,
		padding-left 0.2s;
}
.side-row:hover {
	color: #fff;
	padding-left: 4px;
}
.side-row span {
	font-style: italic;
	color: var(--ink-mute);
	min-width: 22px;
	font-size: 14px;
}
.side-row em {
	font-style: italic;
	color: #ddd;
}

.side-discog {
	display: flex;
	flex-direction: column;
}
.side-disc {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 7px 0;
	border-bottom: 1px solid var(--line-soft);
	font-size: 14px;
	text-decoration: none;
	color: inherit;
	transition: color 0.2s;
}
.side-disc:hover em {
	color: #fff;
}
.side-disc em {
	font-style: italic;
	color: #ccc;
	transition: color 0.2s;
}
.side-disc span {
	font-size: 12px;
	color: var(--ink-mute);
	font-family: var(--mono);
}

/* ─── Main / paper ─── */
.letter-main {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.025), transparent 60%);
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 0;
}
.letter-paper {
	flex: 1;
	width: 100%;
	max-width: 720px;
	margin: 0 auto;
	padding: 0 32px;
	display: flex;
	flex-direction: column;
	background: transparent;
	position: relative;
	min-height: 0;
}

.letter-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 28px;
	border-bottom: 1px solid var(--line-strong);
	flex-shrink: 0;
	gap: 16px;
	background: rgba(10, 10, 10, 0.85);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}
.head-left {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.head-avatar {
	position: relative;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: linear-gradient(135deg, #2a2a2a, #111);
	border: 1px solid #3a3a3a;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.head-avatar-letter {
	font-family: var(--serif);
	font-style: italic;
	font-size: 22px;
	color: #f0f0f0;
	line-height: 1;
}
.head-avatar-dot {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #c8e6a0;
	border: 2px solid var(--bg-paper);
	box-shadow: 0 0 6px rgba(200, 230, 160, 0.6);
}
.head-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.head-title {
	font-family: var(--serif);
	font-size: 20px;
	font-weight: 400;
	color: #fff;
	line-height: 1.15;
	letter-spacing: -0.01em;
}
.head-title em {
	font-style: italic;
	color: var(--ink-dim);
	font-size: 0.72em;
	font-weight: 400;
	margin-left: 6px;
}
.head-sub {
	display: inline-flex;
	align-items: center;
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.18em;
	color: #9aa890;
	text-transform: lowercase;
}
.head-status {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.head-avatar[data-state="limited"] .head-avatar-dot {
	background: #f5d089;
	box-shadow: 0 0 6px rgba(245, 208, 137, 0.6);
	animation: dot-blink 1.8s ease-in-out infinite;
}
.head-avatar[data-state="degraded"] .head-avatar-dot,
.head-avatar[data-state="offline"] .head-avatar-dot {
	background: #b87a7a;
	box-shadow: 0 0 6px rgba(184, 122, 122, 0.5);
}
@keyframes dot-blink {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.4;
	}
}

.head-clear {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #141414;
	border: 1px solid #3a3a3a;
	border-radius: 999px;
	color: #e8e8e8;
	font-family: var(--serif);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	padding: 7px 14px 7px 11px;
	transition: all 0.2s;
}
.head-clear svg {
	opacity: 0.85;
}
.head-clear:hover {
	background: #f0f0f0;
	border-color: #f0f0f0;
	color: #0a0a0a;
}
.head-clear:hover svg {
	opacity: 1;
}

/* ─── Scroll area ─── */
.letter-scroll {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 28px 0;
	position: relative;
	min-height: 0;
}
.letter-scroll::-webkit-scrollbar {
	width: 0;
}

.letter-inner {
	max-width: 580px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* ─── Empty state ─── */
.empty-state {
	display: block;
}
.flourish-big {
	font-size: 22px;
	color: var(--ink-faint);
	text-align: center;
	margin-bottom: 18px;
	letter-spacing: 0.3em;
}
.flourish-big.small {
	font-size: 18px;
	margin-bottom: 14px;
}

.greet {
	font-size: 18px;
	font-style: italic;
	color: #f0f0f0;
	margin-bottom: 14px;
}
.greet-body {
	font-size: 19px;
	line-height: 1.75;
	color: #d4d4d4;
	margin-bottom: 18px;
	text-wrap: pretty;
}
.greet-body em {
	font-style: italic;
	color: #fff;
}
.greet-sign {
	font-size: 18px;
	color: var(--ink-dim);
	font-style: italic;
	text-align: right;
	margin-bottom: 36px;
}

.empty-state.topic-active > .flourish-big,
.empty-state.topic-active > .greet,
.empty-state.topic-active > .greet-body,
.empty-state.topic-active > .greet-sign {
	display: none;
}

.divider {
	position: relative;
	display: flex;
	justify-content: center;
	margin: 36px 0 28px;
	background: none;
	height: auto;
}
.divider span {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 8px 20px;
	background: linear-gradient(135deg, rgba(240, 240, 240, 0.08), rgba(240, 240, 240, 0.02));
	border: 1px solid rgba(240, 240, 240, 0.14);
	border-radius: 999px;
	font-family: var(--mono);
	font-size: 11px;
	font-weight: 500;
	color: #f0f0f0;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	position: static;
	transform: none;
	left: auto;
	top: auto;
}
.divider span::before,
.divider span::after {
	content: "";
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #c8e6a0;
	box-shadow: 0 0 6px rgba(200, 230, 160, 0.55);
	flex-shrink: 0;
}

/* ─── Topic list (chương) ─── */
.topic-list {
	display: flex;
	flex-direction: column;
}
.topic-row {
	display: grid;
	grid-template-columns: 40px 1fr 1.4fr;
	gap: 16px;
	align-items: center;
	padding: 16px 4px;
	background: none;
	border: none;
	border-bottom: 1px solid var(--line);
	text-align: left;
	cursor: pointer;
	transition:
		padding-left 0.2s ease,
		background 0.2s ease;
}
.topic-row:first-child {
	border-top: 1px solid var(--line);
}
.topic-row:hover {
	padding-left: 10px;
	background: #0f0f0f;
}
.topic-rom {
	font-style: italic;
	font-size: 19px;
	color: var(--ink-mute);
	text-align: center;
}
.topic-tn {
	font-size: 18px;
	color: #f0f0f0;
}
.topic-th {
	font-style: italic;
	font-size: 14px;
	color: var(--ink-mute);
}

/* Topic detail */
.topic-detail {
	text-align: center;
}
.topic-detail .topic-back {
	float: left;
}
.topic-detail .topic-back + * {
	clear: both;
}
.topic-back {
	background: none;
	border: none;
	color: var(--ink-mute);
	font-family: var(--serif);
	font-style: italic;
	font-size: 14px;
	cursor: pointer;
	margin-bottom: 18px;
	display: inline-block;
	padding: 0;
	transition: color 0.2s;
}
.topic-back:hover {
	color: #fff;
}
.topic-name {
	font-size: 30px;
	font-weight: 400;
	font-style: italic;
	color: #fff;
	margin-bottom: 6px;
}
.topic-line {
	font-size: 14px;
	color: var(--ink-mute);
	font-style: italic;
	margin-bottom: 18px;
}
.topic-sep {
	height: 1px;
	background: #1f1f1f;
	width: 30%;
	margin: 0 auto 18px;
}

.q-list {
	display: flex;
	flex-direction: column;
	text-align: left;
}
.q-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	background: none;
	border: none;
	border-bottom: 1px solid var(--line-soft);
	padding: 14px 0;
	cursor: pointer;
}
.q-item:hover .q-text {
	color: #fff;
}
.q-quote {
	font-size: 24px;
	color: var(--ink-faint);
	line-height: 1;
	font-style: italic;
	flex-shrink: 0;
}
.q-text {
	font-size: 17px;
	line-height: 1.55;
	color: #ccc;
	transition: color 0.2s;
	text-align: left;
}

/* ─── Messages ─── */
.msg {
	display: flex;
	flex-direction: column;
	animation: msg-fade 0.35s ease;
}
@keyframes msg-fade {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.meta {
	font-family: var(--mono);
	font-size: 10px;
	color: #666;
	letter-spacing: 0.15em;
	margin-bottom: 6px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.speaker-dot {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
}

.msg.fan {
	align-self: flex-end;
	max-width: 82%;
	align-items: flex-end;
}
.msg.fan .meta {
	justify-content: flex-end;
}

.msg.fan .msg-text {
	background: #1a1a1a;
	border: 1px solid var(--line-strong);
	border-radius: 14px 14px 4px 14px;
	padding: 8px 13px;
	font-size: 17px;
	line-height: 1.6;
	color: #ececec;
	font-family: var(--serif);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.msg.tao {
	align-self: flex-start;
	max-width: 88%;
}
.msg.tao .msg-text {
	background: var(--paper);
	color: #1a1a1a;
	border: 1px solid var(--paper-border);
	border-radius: 14px 14px 14px 4px;
	padding: 10px 14px;
	font-size: 19px;
	line-height: 1.65;
	font-style: italic;
	font-family: var(--serif);
	font-weight: 400;
	text-wrap: pretty;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	position: relative;
}
.msg.tao .msg-text::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 14px 14px 14px 4px;
	background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 26px, var(--paper-line) 26px, var(--paper-line) 27px);
	pointer-events: none;
	opacity: 0.5;
}
.msg.tao .msg-text > * {
	position: relative;
}
.msg.tao .msg-text p {
	margin-bottom: 0.6em;
}
.msg.tao .msg-text p:last-child {
	margin-bottom: 0;
}
.msg.tao .msg-text strong {
	color: #000;
	font-weight: 600;
}
.msg.tao .msg-text a {
	color: #1a1a1a;
	text-decoration: underline;
	text-decoration-color: rgba(120, 100, 60, 0.4);
	text-underline-offset: 2px;
}
.msg.tao .msg-text a:hover {
	text-decoration-color: #1a1a1a;
}
.msg.tao .msg-text blockquote {
	border-left: 2px solid rgba(120, 100, 60, 0.35);
	padding-left: 12px;
	margin: 6px 0;
	color: #2a2a2a;
}
.msg.tao .msg-text ul,
.msg.tao .msg-text ol {
	padding-left: 1.2em;
	margin: 6px 0;
}
.msg.tao .msg-text code {
	font-family: var(--mono);
	font-style: normal;
	font-size: 0.9em;
	background: rgba(0, 0, 0, 0.06);
	padding: 1px 5px;
	border-radius: 3px;
}
.msg.tao .msg-text pre {
	font-family: var(--mono);
	font-style: normal;
	background: rgba(0, 0, 0, 0.08);
	padding: 10px 12px;
	border-radius: 6px;
	overflow-x: auto;
	margin: 8px 0;
	font-size: 13px;
}

.msg.fan .msg-text p {
	margin-bottom: 0.4em;
}
.msg.fan .msg-text p:last-child {
	margin-bottom: 0;
}

.msg-img {
	display: inline-block;
	max-width: 180px;
	width: auto;
	height: auto;
	margin: 6px 6px 6px 0;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
	vertical-align: top;
}

/* Error message */
.msg.error .msg-text {
	background: #2a1a1a;
	border-color: #5c2e2e;
	color: #f0c8c8;
	font-style: normal;
	font-family: var(--serif);
}
.msg.error .msg-text::before {
	display: none;
}
.retry-btn {
	align-self: flex-start;
	margin-top: 6px;
	background: none;
	border: 1px solid var(--line-strong);
	color: #ccc;
	font-family: var(--serif);
	font-style: italic;
	font-size: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.2s;
}
.retry-btn:hover {
	background: #f0f0f0;
	color: var(--bg-paper);
	border-color: #f0f0f0;
}

/* Typing */
.typing {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.typing-bubble {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	background: #1a1a1a;
	border: 1px solid #2e2e2e;
	border-radius: 18px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
	animation: typing-pulse 2.4s ease-in-out infinite;
}
.typing-text {
	font-family: var(--serif);
	font-style: italic;
	font-size: 14px;
	color: #d8d8d8;
	letter-spacing: 0.01em;
}
.typing-dots {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}
.typing-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #c8e6a0;
	box-shadow: 0 0 6px rgba(200, 230, 160, 0.5);
	animation: typing-dot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) {
	animation-delay: 0.18s;
}
.typing-dots span:nth-child(3) {
	animation-delay: 0.36s;
}
@keyframes typing-dot {
	0%,
	80%,
	100% {
		opacity: 0.25;
		transform: translateY(0);
	}
	40% {
		opacity: 1;
		transform: translateY(-3px);
	}
}
@keyframes typing-pulse {
	0%,
	100% {
		box-shadow:
			0 4px 16px rgba(0, 0, 0, 0.35),
			0 0 0 0 rgba(200, 230, 160, 0);
	}
	50% {
		box-shadow:
			0 4px 18px rgba(0, 0, 0, 0.4),
			0 0 0 4px rgba(200, 230, 160, 0.06);
	}
}

/* ─── Input ─── */
.input-wrap {
	padding: 16px 0 22px;
	flex-shrink: 0;
	max-width: 720px;
	margin: 0 auto;
	width: 100%;
}
.input-line {
	display: none;
}
.input-outer {
	display: flex;
	align-items: center;
	gap: 10px;
}
.input-outer .input-row {
	flex: 1;
	min-width: 0;
}
.input-row {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #141414;
	border: 1px solid #2a2a2a;
	border-radius: 16px;
	padding: 6px 6px 6px 18px;
	box-shadow:
		0 8px 30px rgba(0, 0, 0, 0.5),
		0 1px 0 rgba(255, 255, 255, 0.03) inset;
	transition:
		border-color 0.2s,
		box-shadow 0.2s;
}
.input-row:focus-within {
	border-color: #4a4a4a;
	box-shadow:
		0 8px 36px rgba(0, 0, 0, 0.6),
		0 0 0 3px rgba(240, 240, 240, 0.06);
}
.input-prompt {
	font-style: italic;
	font-size: 20px;
	color: var(--ink-faint);
	flex-shrink: 0;
	line-height: 1;
}
.letter-info {
	background: transparent;
	border: 1px solid #2a2a2a;
	padding: 0;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #888;
	cursor: pointer;
	flex-shrink: 0;
	border-radius: 50%;
	transition:
		color 0.2s,
		background 0.2s,
		border-color 0.2s;
}
.letter-info:hover {
	color: #f0f0f0;
	background: rgba(255, 255, 255, 0.04);
	border-color: #4a4a4a;
}
.letter-info:focus-visible {
	outline: 2px solid rgba(240, 240, 240, 0.35);
	outline-offset: 2px;
}
.letter-info svg {
	display: block;
}
.letter-input {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #f5f5f5;
	font-family: var(--serif);
	font-size: 17px;
	font-style: normal;
	padding: 12px 0;
	min-width: 0;
}
.letter-input::placeholder {
	color: #666;
	font-style: italic;
}
.letter-send {
	background: #f0f0f0;
	border: 1px solid #f0f0f0;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #0a0a0a;
	cursor: pointer;
	transition: all 0.2s;
	flex-shrink: 0;
}
.letter-send svg {
	display: block;
	transform: translateX(-1px);
}
.letter-send:disabled {
	background: #1f1f1f;
	color: #555;
	border-color: #1f1f1f;
	cursor: not-allowed;
}
.letter-send:hover:not(:disabled) {
	background: #fff;
	border-color: #fff;
	transform: translateY(-1px);
}
.letter-send:active:not(:disabled) {
	transform: translateY(0);
}

/* ─── Scroll button ─── */
#scroll-btn {
	position: absolute;
	right: 24px;
	bottom: 90px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(20, 20, 20, 0.85);
	border: 1px solid var(--line-strong);
	color: #ccc;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition:
		opacity 0.2s,
		transform 0.2s,
		visibility 0.2s;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 5;
}
#scroll-btn.visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
#scroll-btn:hover {
	background: #f0f0f0;
	color: var(--bg-paper);
	border-color: #f0f0f0;
}

/* ─── Stream chapter header ─── */
.stream-head {
	text-align: center;
	margin: 4px 0 6px;
}
.stream-chap {
	font-size: 16px;
	font-style: italic;
	color: var(--ink-mute);
}
.stream-chap em {
	color: #f0f0f0;
}
.stream-date {
	font-family: var(--mono);
	font-size: 10px;
	color: var(--ink-faint);
	letter-spacing: 0.15em;
	margin-top: 4px;
	text-transform: lowercase;
}

/* ─── Responsive: mobile ─── */
@media (max-width: 700px) {
	.letter-paper {
		max-width: 100%;
		padding: 0;
	}
	.letter-head {
		align-items: center;
		padding: 12px 0;
	}
	.head-title {
		font-size: 22px;
	}
	.head-kicker {
		font-size: 9px;
		letter-spacing: 0.2em;
	}
	.head-status {
		gap: 10px;
	}
	.letter-scroll {
		padding: 22px 0 12px;
	}
	.letter-inner {
		padding: 0;
	}
	.greet-body {
		font-size: 18px;
		line-height: 1.7;
	}
	.greet {
		font-size: 17px;
	}
	.greet-sign {
		font-size: 17px;
	}
	.topic-name {
		font-size: 28px;
	}
	.q-text {
		font-size: 16px;
	}
	.msg.tao .msg-text {
		font-size: 18px;
		padding: 10px 14px;
		line-height: 1.65;
	}
	.msg.tao .msg-text::before {
		background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 25px, var(--paper-line) 25px, var(--paper-line) 26px);
	}
	.msg.fan {
		max-width: 86%;
	}
	.msg.fan .msg-text {
		font-size: 16px;
		padding: 8px 13px;
	}
	.input-wrap {
		padding: 16px 0 14px;
	}
	.letter-input {
		font-size: 17px;
		padding: 9px 0;
	}
	.letter-send {
		width: 36px;
		height: 36px;
	}
	#scroll-btn {
		right: 14px;
		bottom: 84px;
	}
}

/* ─── Session ended CTA ─── */
.session-end {
	text-align: center;
	margin: 22px auto 8px;
	padding: 22px 16px 10px;
	border-top: 1px solid var(--line);
	animation: msg-fade 0.35s ease;
}
.session-end-line {
	font-family: var(--serif);
	font-size: 18px;
	font-style: italic;
	color: #f0f0f0;
	margin-top: 4px;
	margin-bottom: 6px;
}
.session-end-sub {
	font-family: var(--serif);
	font-size: 15px;
	font-style: italic;
	color: var(--ink-mute);
	margin-bottom: 18px;
}
.session-end-btn {
	margin-bottom: 12px;
	background: none;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	padding: 10px 24px;
	color: #ddd;
	font-family: var(--serif);
	font-style: italic;
	font-size: 15px;
	cursor: pointer;
	transition: all 0.2s;
}
.session-end-btn:hover {
	background: #f0f0f0;
	color: var(--bg-paper);
	border-color: #f0f0f0;
}

/* ─── Typing caret ─── */
.type-caret {
	display: inline-block;
	width: 2px;
	height: 1em;
	vertical-align: -0.15em;
	background: #d4d4d4;
	margin-left: 1px;
	animation: caret-blink 0.9s steps(1) infinite;
}
@keyframes caret-blink {
	50% {
		opacity: 0;
	}
}

/* ─── Modal ─── */
.modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(6, 6, 6, 0.78);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	animation: modal-fade 0.2s ease;
}
@keyframes modal-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
.modal-card {
	background: var(--bg-paper);
	border: 1px solid var(--line-strong);
	border-radius: 4px;
	max-width: 380px;
	width: calc(100% - 40px);
	padding: 28px 28px 22px;
	text-align: center;
	position: relative;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: modal-rise 0.25s ease;
}
@keyframes modal-rise {
	from {
		transform: translateY(8px);
		opacity: 0;
	}
	to {
		transform: none;
		opacity: 1;
	}
}
.modal-flourish {
	font-size: 18px;
	color: var(--ink-faint);
	letter-spacing: 0.3em;
	margin-bottom: 14px;
}
.modal-title {
	font-family: var(--serif);
	font-size: 22px;
	font-style: italic;
	color: #fff;
	margin-bottom: 8px;
	font-weight: 400;
}
.modal-body {
	font-family: var(--serif);
	font-size: 15px;
	color: var(--ink-dim);
	margin-bottom: 22px;
	line-height: 1.6;
}
.modal-rule {
	width: 30%;
	height: 1px;
	background: var(--line-strong);
	margin: 0 auto 18px;
}
.modal-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
}
.modal-btn {
	background: none;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	padding: 8px 20px;
	color: #ccc;
	font-family: var(--serif);
	font-style: italic;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s;
}
.modal-btn:hover {
	color: #fff;
	border-color: #f0f0f0;
}
.modal-btn.primary {
	background: #f0f0f0;
	color: var(--bg-paper);
	border-color: #f0f0f0;
}
.modal-btn.primary:hover {
	background: #fff;
	color: #000;
}

/* ─── House rules variant ─── */
.modal-subtitle {
	font-family: var(--serif);
	font-size: 13.5px;
	font-style: italic;
	color: var(--ink-faint);
	margin: -2px 0 16px;
	text-align: center;
	letter-spacing: 0.01em;
}
.modal-card.modal-card-wide {
	max-width: 440px;
	text-align: left;
	padding: 26px 28px 20px;
}
.modal-card.modal-card-wide .modal-flourish {
	text-align: center;
	margin-bottom: 10px;
}
.modal-card.modal-card-wide .modal-title {
	text-align: center;
	font-size: 19px;
	line-height: 1.35;
	margin-bottom: 4px;
}
.modal-card.modal-card-wide .modal-rule {
	width: 28px;
	margin: 14px auto 16px;
}
.modal-card.modal-card-wide .modal-actions {
	justify-content: center;
	margin-top: 4px;
}
.modal-card.modal-card-wide .modal-body {
	margin-bottom: 0;
}
.house-rules-lede {
	font-family: var(--serif);
	font-size: 14px;
	color: var(--ink-dim);
	line-height: 1.6;
	margin: 0 0 16px;
	text-align: center;
}
.house-rules-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.house-rules-list li {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 10px;
	align-items: start;
	padding: 10px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.house-rules-list li:last-child {
	border-bottom: none;
}
.house-rules-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.14);
	color: var(--ink-faint);
	font-size: 10px;
	font-family: var(--sans, sans-serif);
	font-style: normal;
	line-height: 1;
	margin-top: 1px;
	flex-shrink: 0;
}
.house-rules-list strong {
	display: block;
	font-family: var(--serif);
	font-style: normal;
	font-weight: 500;
	font-size: 14px;
	color: #f0f0f0;
	margin-bottom: 2px;
	letter-spacing: 0.005em;
}
.house-rules-list div > span {
	display: block;
	font-family: var(--serif);
	font-style: italic;
	font-size: 13px;
	color: var(--ink-dim);
	line-height: 1.55;
}
.house-rules-outro {
	font-family: var(--serif);
	font-size: 14px;
	color: var(--ink-dim);
	line-height: 1.65;
	text-align: center;
	margin: 16px 0 4px;
}
.house-rules-outro em {
	color: #ddd;
	font-style: italic;
}
.house-rules-sign {
	font-family: var(--serif);
	font-style: italic;
	font-size: 13px;
	color: var(--ink-faint);
	text-align: center;
	margin: 8px 0 0;
	letter-spacing: 0.02em;
}

/* ─── Reduce motion ─── */
@media (prefers-reduced-motion: reduce) {
	.msg,
	.typing-dots span,
	.live-indicator[data-state="limited"] .live-dot {
		animation: none !important;
	}
}
