/* Tiny MSP — overlay UI. Muted winter palette; day / dusk / night variants keyed off html[data-sky].
   The model owns the screen: one compact glass card, everything else one tap away. */

:root {
	--font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

	/* type scale */
	--t-xs: 11px;
	--t-sm: 12px;
	--t-md: 13px;
	--t-lg: 15px;

	--haze: #dfe6ea;
	--haze-2: #c9d5dc;
	--glass: rgba(248, 250, 251, 0.72);
	--glass-strong: rgba(250, 251, 252, 0.94);
	--sheen: rgba(255, 255, 255, 0.65);
	--ink: #1c262e;
	--muted: #5b6a75;
	--faint: #8796a0;
	--line: rgba(28, 38, 46, 0.09);
	--line-strong: rgba(28, 38, 46, 0.14);
	--chip: rgba(28, 38, 46, 0.05);
	--hover: rgba(28, 38, 46, 0.045);
	--accent: #3f6f82;       /* lake blue */
	--accent-ink: #ffffff;
	--warm: #a8694c;         /* brick */
	--good: #4f8a60;
	--rare: #a5822a;
	--shadow: 0 12px 32px -8px rgba(28, 38, 46, 0.22), 0 2px 6px -2px rgba(28, 38, 46, 0.10);
	--focus: #2f86a6;
	--radius: 14px;
	--blur: saturate(1.6) blur(18px);

	color-scheme: light;
}

:root[data-sky="dusk"] {
	--haze: #c9c4d0;
	--haze-2: #a9a8bb;
	--glass: rgba(246, 242, 246, 0.72);
	--glass-strong: rgba(248, 245, 248, 0.94);
	--ink: #28232f;
	--muted: #625a6c;
	--faint: #8f8898;
	--line: rgba(40, 35, 47, 0.10);
	--line-strong: rgba(40, 35, 47, 0.15);
	--chip: rgba(40, 35, 47, 0.05);
	--hover: rgba(40, 35, 47, 0.045);
	--accent: #5d5f8a;
	--warm: #b0705a;
}

:root[data-sky="night"] {
	--haze: #1b2430;
	--haze-2: #121923;
	--glass: rgba(20, 27, 36, 0.70);
	--glass-strong: rgba(24, 32, 43, 0.95);
	--sheen: rgba(255, 255, 255, 0.06);
	--ink: #e6ecef;
	--muted: #a0adb7;
	--faint: #6d7b86;
	--line: rgba(230, 236, 239, 0.09);
	--line-strong: rgba(230, 236, 239, 0.15);
	--chip: rgba(230, 236, 239, 0.06);
	--hover: rgba(230, 236, 239, 0.05);
	--accent: #7fb2c4;
	--accent-ink: #0f1820;
	--warm: #d39a7d;
	--good: #8fcf9f;
	--rare: #dcbd6a;
	--shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55), 0 2px 6px -2px rgba(0, 0, 0, 0.35);
	--focus: #9fd3e6;
	color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: var(--haze);
	color: var(--ink);
	font: var(--t-md)/1.4 var(--font);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
	transition: background-color 1.2s ease;
}

#map {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	touch-action: none;
}

/* The overlay never eats pointer events itself; only its panels do. */
#ui {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 10;
}
#ui > * { pointer-events: auto; }
#ui > .toasts, #ui > .tv-caption { pointer-events: none; }

a { color: var(--accent); text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2.5px; }
a:hover { text-decoration-color: currentColor; }

button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
abbr[title] { text-decoration: none; }

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
	border-radius: 6px;
}

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

.noscript {
	position: fixed; inset: auto 0 40% 0; text-align: center; color: var(--muted);
}

/* Shared glass surface */
.panel, .ac-panel, .toast, .tv-exit {
	background: var(--glass);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
	border: 1px solid var(--line-strong);
	box-shadow: inset 0 1px 0 var(--sheen), var(--shadow);
}

/* ---------- Buttons ---------- */

.btn {
	appearance: none;
	border: 1px solid var(--line-strong);
	background: var(--chip);
	border-radius: 999px;
	padding: 7px 14px;
	cursor: pointer;
	line-height: 1.2;
	font-size: var(--t-md);
	transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn-primary {
	background: var(--ink);
	border-color: transparent;
	color: var(--haze);
	font-weight: 600;
	padding: 12px 30px;
	font-size: var(--t-lg);
	min-height: 44px;
	letter-spacing: -0.005em;
	box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--ink) 50%, transparent);
}
.btn-primary:hover { background: var(--ink); filter: brightness(1.15); }

.icon-btn {
	appearance: none;
	border: 0;
	background: transparent;
	width: 32px; height: 32px;
	display: inline-grid; place-items: center;
	border-radius: 8px;
	cursor: pointer;
	color: var(--muted);
	flex: none;
	transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

.kbd {
	display: inline-grid; place-items: center;
	min-width: 18px; height: 18px; padding: 0 4px;
	font: 500 10.5px/1 var(--mono);
	color: var(--faint);
	border: 1px solid var(--line-strong);
	border-bottom-width: 2px;
	border-radius: 5px;
}
@media (hover: none) { .hide-touch { display: none !important; } }

/* ---------- Splash ---------- */

.splash {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
	padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
	background:
		radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--haze) 55%, transparent) 0%, var(--haze) 72%),
		var(--haze);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	z-index: 50;
	overflow-y: auto;
	transition: opacity .8s ease, visibility 0s linear .8s;
}
.splash.leaving { opacity: 0; visibility: hidden; }
.welcomed .splash { display: none; }

.splash-card {
	width: 100%;
	max-width: 400px;
	text-align: center;
	animation: rise .8s cubic-bezier(.2, .8, .2, 1) both;
}
.splash-mark { width: 64px; height: 64px; margin: 0 auto 14px; display: block; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .12)); }
.splash-eyebrow {
	margin: 0 0 6px;
	font-size: var(--t-xs);
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--faint);
}
.splash h1 {
	margin: 0 0 14px;
	font-size: clamp(28px, 7vw, 36px);
	line-height: 1.1;
	font-weight: 680;
	letter-spacing: -0.025em;
}
.splash p { margin: 0 0 12px; color: var(--muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.splash .splash-hint { font-size: var(--t-md); color: var(--faint); margin-bottom: 24px; }
.splash .credit { margin: 24px 0 0; font-size: var(--t-md); color: var(--faint); }
.splash .credit a { display: inline-block; padding: 12px 0; margin: -12px 0; }

@keyframes rise {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Main card ---------- */

.panel {
	position: fixed;
	top: 12px;
	left: 12px;
	width: 288px;
	max-height: min(680px, calc(100vh - 24px));
	max-height: min(680px, calc(100dvh - 24px));
	display: flex;
	flex-direction: column;
	border-radius: var(--radius);
	overflow: hidden;
	transition: opacity .3s ease, transform .3s ease, width .26s cubic-bezier(.2, .8, .2, 1);
}
.panel:has(#view-sub:not([hidden]) .pane[data-pane="collection"]:not([hidden])) { width: 324px; }

.panel-head { padding: 10px 10px 10px 12px; flex: none; }
.head-btn {
	appearance: none;
	display: flex; align-items: center; gap: 10px;
	width: 100%;
	padding: 0; margin: 0;
	background: none; border: 0;
	text-align: left;
	cursor: pointer;
	border-radius: 8px;
}
.mark { width: 24px; height: 24px; flex: none; }
.head-text { min-width: 0; flex: 1; display: block; }
.title {
	display: flex; align-items: center; gap: 7px;
	font-size: var(--t-lg);
	font-weight: 650;
	letter-spacing: -0.015em;
	line-height: 1.25;
}
.summary {
	display: block;
	margin-top: 1px;
	font-size: var(--t-sm);
	color: var(--muted);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	font-variant-numeric: tabular-nums;
}
.fold {
	width: 28px; height: 28px; flex: none;
	display: grid; place-items: center;
	color: var(--faint);
	border-radius: 7px;
	transition: transform .26s cubic-bezier(.2, .8, .2, 1), background-color .15s ease, color .15s ease;
}
.fold svg { width: 14px; height: 14px; }
.head-btn:hover .fold { background: var(--hover); color: var(--ink); }
.panel.collapsed .fold { transform: rotate(180deg); }

.byline {
	margin: 6px 0 0 34px;
	font-size: var(--t-sm);
	color: var(--faint);
}
.panel.collapsed .byline { display: none; }

.live-dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--good);
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent);
	animation: pulse 2.4s ease-out infinite;
	flex: none;
}
.live-dot.stale { background: var(--faint); animation: none; }
@keyframes pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
	70%, 100% { box-shadow: 0 0 0 5px transparent; }
}

.panel-body {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
	overflow: hidden;
	border-top: 1px solid var(--line);
}
.panel-body[hidden] { display: none; }
.view { min-height: 0; display: flex; flex-direction: column; }
.view[hidden] { display: none; }

/* rows */
.rows { list-style: none; margin: 0; padding: 4px; }
.row {
	appearance: none;
	width: 100%;
	display: flex; align-items: center; gap: 8px;
	min-height: 32px;
	padding: 6px 8px;
	background: none; border: 0; border-radius: 8px;
	cursor: pointer;
	text-align: left;
	font-size: var(--t-md);
	transition: background-color .12s ease;
}
.row:hover { background: var(--hover); }
.row:active { background: var(--chip); }
.row-label { flex: 1; min-width: 0; font-weight: 500; }
.row .chev { width: 14px; height: 14px; color: var(--faint); flex: none; margin-right: -2px; transition: transform .15s ease, color .15s ease; }
.row:hover .chev { color: var(--muted); transform: translateX(1px); }
.hint {
	display: inline-flex; align-items: center; gap: 4px;
	color: var(--faint);
	font-size: var(--t-sm);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.hint:empty { display: none; }
.hint .letter {
	display: inline-grid; place-items: center;
	min-width: 18px; height: 18px; padding: 0 4px;
	border-radius: 5px;
	background: var(--chip);
	border: 1px solid var(--line);
	color: var(--ink);
	font: 650 11px/1 var(--mono);
}

/* TV switch */
.switch {
	position: relative;
	width: 28px; height: 16px; flex: none;
	border-radius: 999px;
	background: var(--line-strong);
	transition: background-color .2s ease;
}
.switch span {
	position: absolute; top: 2px; left: 2px;
	width: 12px; height: 12px; border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
	transition: transform .2s cubic-bezier(.2, .8, .2, 1);
}
.row[aria-checked="true"] .switch { background: var(--accent); }
.row[aria-checked="true"] .switch span { transform: translateX(12px); }

/* sub-view */
.sub-head {
	display: flex; align-items: center; gap: 4px;
	padding: 4px 12px 4px 4px;
	border-bottom: 1px solid var(--line);
	flex: none;
}
.sub-head h2 { margin: 0; font-size: var(--t-md); font-weight: 650; letter-spacing: -0.005em; flex: 1; }
.sub-extra { font-size: var(--t-sm); color: var(--faint); font-variant-numeric: tabular-nums; }
.sub-scroll {
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--line-strong) transparent;
	padding: 10px 12px 12px;
	min-height: 0;
}
.pane[hidden] { display: none; }

/* key / value rows */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: var(--t-md); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kv .strong { font-weight: 600; }
.flow { font-weight: 550; }
.flow span { display: block; }
.flow small { display: block; font-weight: 400; color: var(--faint); font-size: var(--t-sm); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.chip {
	appearance: none;
	border: 1px solid var(--line-strong);
	background: transparent;
	border-radius: 999px;
	padding: 5px 11px;
	font-size: var(--t-sm);
	cursor: pointer;
	transition: background-color .15s ease;
}
.chip:hover { background: var(--hover); }

.muted { color: var(--muted); }
.empty { color: var(--faint); font-size: var(--t-sm); margin: 2px 0; }

/* ATIS */
.atis + .atis { margin-top: 14px; }
.atis-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.atis-letter {
	display: inline-grid; place-items: center;
	min-width: 24px; height: 24px; padding: 0 6px;
	border-radius: 7px;
	background: var(--ink); color: var(--haze);
	font: 700 13px/1 var(--mono);
}
.atis-title { font-weight: 600; }
.atis-time { margin-left: auto; color: var(--faint); font: var(--t-sm) var(--mono); }
.atis-text {
	margin: 0;
	font: 11px/1.55 var(--mono);
	color: var(--muted);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: var(--chip);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px 10px;
}

/* Live feed */
.feed { list-style: none; margin: -4px -6px; padding: 0; }
.feed-item {
	appearance: none;
	width: 100%;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 10px;
	padding: 6px;
	background: none; border: 0; border-radius: 8px;
	cursor: pointer;
	text-align: left;
}
.feed-item:hover { background: var(--hover); }
.feed-item.gone { opacity: .5; }
.tag {
	font: 650 9.5px/1 var(--font);
	letter-spacing: .07em;
	padding: 4px 0;
	border-radius: 5px;
	text-transform: uppercase;
	width: 32px; text-align: center;
}
.tag.arr { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tag.dep { background: color-mix(in srgb, var(--warm) 16%, transparent); color: var(--warm); }
.feed-main { min-width: 0; }
.feed-call { display: block; font-weight: 600; font-variant-numeric: tabular-nums; }
.feed-meta { display: block; font-size: var(--t-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-time { font-size: var(--t-sm); color: var(--faint); font-variant-numeric: tabular-nums; }

/* ---------- Collection: trading-card album ---------- */

.album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.album-count { margin: 0; color: var(--muted); font-size: var(--t-sm); }
.album-count strong { color: var(--ink); font-size: 22px; font-weight: 680; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-right: 1px; }
.album-count span { color: var(--muted); }
.album-rare { margin: 0; font-size: var(--t-sm); color: var(--rare); font-weight: 600; }
.album-rare:not(:empty)::before { content: "★ "; }
.album-bar { height: 4px; border-radius: 4px; background: var(--chip); overflow: hidden; margin-bottom: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.album-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--good))); border-radius: inherit; transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.album {
	list-style: none; margin: 0; padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
	gap: 8px;
}
.card {
	--tail: #9aa8b2;
	position: relative;
	display: flex; flex-direction: column;
	min-width: 0;
	padding: 5px 5px 7px;
	border-radius: 10px;
	background: linear-gradient(180deg, color-mix(in srgb, var(--glass-strong) 92%, var(--tail)) 0%, var(--glass-strong) 100%);
	border: 1px solid var(--line-strong);
	box-shadow: inset 0 1px 0 var(--sheen), 0 1px 2px rgba(0, 0, 0, .06);
	transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
}
.card:not(.locked):hover { transform: translateY(-2px) rotate(-.6deg); box-shadow: inset 0 1px 0 var(--sheen), 0 8px 18px -6px rgba(0, 0, 0, .22); }
.card-art {
	position: relative;
	display: grid; place-items: center;
	aspect-ratio: 16 / 10;
	border-radius: 6px;
	background:
		radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, .55), transparent 60%),
		linear-gradient(160deg, color-mix(in srgb, var(--tail) 28%, #eef2f4), color-mix(in srgb, var(--tail) 50%, #c9d3d9));
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
	overflow: hidden;
}
.card-art svg { width: 88%; height: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .15)); }
.card-no {
	position: absolute; top: 8px; left: 9px;
	font: 600 8.5px/1 var(--mono);
	letter-spacing: .04em;
	color: rgba(20, 30, 40, .45);
	z-index: 1;
}
.card-rare {
	position: absolute; top: 6px; right: 8px; z-index: 1;
	font-size: 10px; line-height: 1;
	color: var(--rare);
	text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.card-name {
	margin: 6px 2px 0;
	font-size: var(--t-xs);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.005em;
	overflow-wrap: anywhere;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
	display: flex; align-items: center; gap: 3px;
	margin: 3px 2px 0;
	font-size: 10px;
	color: var(--faint);
	font-variant-numeric: tabular-nums;
}
.card-meta .code { font: 600 9.5px/1 var(--mono); letter-spacing: .03em; color: var(--muted); }
.card-meta svg { width: 10px; height: 10px; }

.card.rare:not(.locked) {
	border-color: color-mix(in srgb, var(--rare) 55%, transparent);
	box-shadow: inset 0 1px 0 var(--sheen), 0 0 0 1px color-mix(in srgb, var(--rare) 22%, transparent), 0 1px 2px rgba(0, 0, 0, .06);
}
.card.rare:not(.locked) .card-art::after {
	content: "";
	position: absolute; inset: 0;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
	pointer-events: none;
}

.card.locked {
	background: transparent;
	border: 1px dashed var(--line-strong);
	box-shadow: none;
}
.card.locked .card-art {
	background: var(--chip);
	box-shadow: none;
	color: var(--ink);
}
.card.locked .card-art svg { opacity: .13; filter: none; }
.card.locked .card-no { color: var(--faint); }
.card.locked .card-name { color: var(--faint); font-weight: 500; letter-spacing: .2em; }
.card.locked .card-meta { color: var(--faint); opacity: .7; }
.card-lock { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.card-lock svg { width: 14px !important; height: 14px; opacity: .8 !important; filter: none !important; }
.card.locked.rare .card-no::after { content: " ★"; color: var(--rare); opacity: .8; }

.card.fresh { animation: pop .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pop {
	0% { transform: scale(.85) rotate(-3deg); box-shadow: 0 0 0 3px var(--accent); }
	45% { transform: scale(1.05) rotate(1deg); }
	100% { transform: none; }
}

/* Attribution */
.attrib { margin: 0; padding: 0; list-style: none; font-size: var(--t-md); color: var(--muted); }
.attrib li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.attrib li:first-child { padding-top: 0; }
.attrib-credit { margin: 12px 0 0; font-size: var(--t-md); }
.attrib-note { margin: 6px 0 0; font-size: var(--t-sm); color: var(--faint); }

/* ---------- Swatch ---------- */
.swatch { display: inline-block; flex: none; }
.swatch svg { display: block; }

/* ---------- Aircraft panel ---------- */

.ac-panel {
	position: fixed;
	top: 12px;
	right: 12px;
	width: 272px;
	border-radius: var(--radius);
	padding: 12px;
	animation: rise .25s cubic-bezier(.2, .8, .2, 1) both;
}
.ac-panel[hidden] { display: none; }
.ac-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.ac-head .swatch svg { width: 56px; height: 26px; }
.ac-title { flex: 1; min-width: 0; }
.ac-airline { font-size: var(--t-sm); color: var(--muted); overflow-wrap: anywhere; }
.ac-call { font-size: 18px; font-weight: 680; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ac-panel .kv dd { font-weight: 500; }
.trend { display: inline-block; width: 1.1em; text-align: center; font-weight: 700; }
.trend.up { color: var(--warm); }
.trend.down { color: var(--accent); }
.ac-status { margin: 10px 0 0; font-size: var(--t-sm); color: var(--faint); }

/* ---------- Toasts ---------- */

.toasts {
	position: fixed;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: max-content;
	max-width: calc(100vw - 32px);
	z-index: 40;
}
.toast {
	background: var(--glass-strong);
	border-radius: 999px;
	padding: 8px 16px;
	font-size: var(--t-md);
	animation: toast-in .3s cubic-bezier(.2, .8, .2, 1) both;
	transition: opacity .4s ease, transform .4s ease;
	text-align: center;
	text-wrap: balance;
}
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to { opacity: 1; transform: none; }
}

/* ---------- TV mode ---------- */

#ui.tv .panel,
#ui.tv .ac-panel { opacity: 0; transform: translateY(-6px); pointer-events: none; visibility: hidden; transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }

.tv-exit {
	position: fixed;
	top: 12px; right: 12px;
	min-height: 36px;
	opacity: 0;
	transition: opacity .4s ease;
	background: var(--glass-strong);
}
.tv-exit[hidden] { display: none; }
#ui.tv.awake .tv-exit, .tv-exit:focus-visible { opacity: 1; }

.tv-caption {
	position: fixed;
	left: 22px; bottom: 18px;
	font-size: var(--t-md);
	color: var(--muted);
	letter-spacing: .01em;
	font-variant-numeric: tabular-nums;
	text-shadow: 0 1px 0 color-mix(in srgb, var(--haze) 80%, transparent);
}
.tv-caption strong { color: var(--ink); font-weight: 650; margin-right: 8px; }
.tv-caption[hidden] { display: none; }

/* og:image capture (?og=1): a quiet wordmark, nothing else */
.og .panel, .og .tv-exit, .og .toasts, .og .ac-panel { display: none !important; }
.og .tv-caption {
	left: 40px; bottom: 34px;
	display: flex; align-items: center; gap: 12px;
	padding: 12px 20px 13px 14px;
	border-radius: 14px;
	background: color-mix(in srgb, var(--glass-strong) 78%, transparent);
	-webkit-backdrop-filter: var(--blur);
	backdrop-filter: var(--blur);
	border: 1px solid var(--line-strong);
	box-shadow: inset 0 1px 0 var(--sheen), var(--shadow);
	text-shadow: none;
}
.og .wm-mark { width: 44px; height: 44px; display: block; }
.og .wm-text { display: flex; flex-direction: column; gap: 2px; }
.og .wm-title { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); line-height: 1.1; }
.og .wm-sub { font-size: 14px; color: var(--muted); letter-spacing: 0; }

/* ---------- Phones: compact bottom sheet ---------- */

@media (max-width: 600px) {
	.panel {
		top: auto;
		left: 8px; right: 8px;
		bottom: max(8px, env(safe-area-inset-bottom));
		width: auto;
		max-height: 62vh;
		max-height: 62dvh;
		border-radius: 18px;
	}
	.panel:has(#view-sub:not([hidden]) .pane[data-pane="collection"]:not([hidden])) { width: auto; }
	.panel-head { padding: 12px 12px 10px 14px; position: relative; }
	.panel-head::before {
		content: "";
		position: absolute; top: 5px; left: 50%;
		width: 32px; height: 4px; margin-left: -16px;
		border-radius: 4px; background: var(--line-strong);
	}
	.head-btn { min-height: 44px; }
	.fold { transform: rotate(180deg); }
	.panel.collapsed .fold { transform: none; }
	.fold { width: 32px; height: 32px; }
	.byline { margin-top: 2px; }
	.byline a { display: inline-block; padding: 14px 2px; margin: -14px -2px; }
	.rows { padding: 4px 6px 6px; }
	.row { min-height: 44px; font-size: 14px; padding: 8px 10px; }
	.icon-btn { width: 44px; height: 44px; }
	.sub-head { padding: 0 12px 0 0; }
	.chip { min-height: 44px; padding: 8px 16px; font-size: var(--t-md); }
	.feed-item { min-height: 48px; }
	.album { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
	.attrib li { padding: 10px 0; }
	.attrib a, .attrib-credit a { display: inline-block; padding: 13px 2px; margin: -13px -2px; }
	.attrib-credit { margin-top: 16px; }
	.ac-panel {
		top: max(8px, env(safe-area-inset-top));
		left: 8px; right: 8px;
		width: auto;
	}
	.toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
	.tv-exit { top: max(10px, env(safe-area-inset-top)); right: 10px; min-height: 44px; }
	.tv-caption { left: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
	.hide-phone { display: none; }
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
	.live-dot { animation: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.panel, .ac-panel { background: var(--glass-strong); }
}
