/* ══ Games ══════════════════════════════════════════════════════ */
.games-page {
	position: relative;
}

.gm-top {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 12;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem var(--gutter);
	flex-wrap: wrap;
	border-bottom: 1px solid transparent;
	transition:
		background 0.35s var(--ease),
		border-color 0.35s var(--ease);
}

/* Only earns a backdrop once rows have scrolled up behind it. */
.gm-top.is-stuck {
	background: rgb(8 9 12 / 0.94);
	border-color: var(--line);
}

.gm-top .media-search-btn {
	margin-left: auto;
}

.gm-brand {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}

.gm-brand > .lucide {
	width: 26px;
	height: 26px;
	color: var(--accent);
}

.gm-brand h1 {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 750;
	letter-spacing: -0.01em;
}

.gm-brand p {
	margin: 0.1rem 0 0;
	font-size: 0.7rem;
	color: var(--text-mute);
	font-variant-numeric: tabular-nums;
}

.gm-body {
	padding: 4.6rem 0 calc(var(--taskbar-h) + 2.5rem);
	overscroll-behavior-y: contain;
}

/* ── Rows ── */
.gm-home {
	display: flex;
	flex-direction: column;
	gap: 1.7rem;
}

.gm-row__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0 var(--gutter);
	margin-bottom: 0.6rem;
}

.gm-row__head h2 {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 780;
	letter-spacing: -0.02em;
}

.gm-row__all {
	display: inline-flex;
	align-items: center;
	gap: 0.15rem;
	padding: 0.3rem 0.5rem;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--text-mute);
	font: inherit;
	font-size: 0.76rem;
	font-weight: 650;
	cursor: pointer;
	transition:
		color 0.2s var(--ease),
		background 0.2s var(--ease);
}

.gm-row__all .lucide {
	width: 13px;
	height: 13px;
}

.gm-row__all:hover {
	background: rgb(255 255 255 / 0.06);
	color: var(--accent);
}

/*
 * The gutter lives on the rail, not the track: padding inside a scroller
 * scrolls away (and snap points ignore it), which left the first tile flush
 * to the edge instead of under the heading.
 */
.gm-rail {
	position: relative;
	margin: 0 var(--gutter);
}

/*
 * `overflow-x: auto` forces overflow-y to clip, so the hover lift and its
 * shadow need real room inside the scroller - the negative margin keeps the
 * row's visual spacing unchanged.
 */
.gm-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 186px;
	gap: 0.75rem;
	padding: 0.85rem 0 1.2rem;
	margin: -0.55rem 0 -0.6rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.gm-track::-webkit-scrollbar {
	display: none;
}

.gm-track > * {
	scroll-snap-align: start;
}

.gm-arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	transform: translateY(-50%);
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	/* No backdrop blur: at this size it smears the artwork behind it. */
	background: rgb(12 14 16 / 0.94);
	color: var(--text);
	cursor: pointer;
	opacity: 0;
	/* Invisible arrows must not swallow clicks aimed at the row beside them. */
	pointer-events: none;
	box-shadow: 0 10px 24px rgb(0 0 0 / 0.5);
	transition:
		opacity 0.22s var(--ease),
		background 0.2s var(--ease),
		transform 0.28s var(--spring);
}

.gm-arrow .lucide {
	width: 17px;
	height: 17px;
}

.gm-arrow--prev {
	left: -19px;
}

.gm-arrow--next {
	right: -19px;
}

/* focus-within keeps them reachable when you tab through a row. */
.gm-rail:hover .gm-arrow,
.gm-rail:focus-within .gm-arrow {
	opacity: 1;
	pointer-events: auto;
}

.gm-arrow:hover {
	background: var(--accent);
	color: var(--accent-ink);
	border-color: transparent;
	transform: translateY(-50%) scale(1.08);
}

/*
 * Nothing left to scroll that way, so it stays hidden even while the rail is
 * hovered. Spelled out rather than `!important` so the hover rule above can
 * still be overridden normally.
 */
.gm-arrow.is-off,
.gm-rail:hover .gm-arrow.is-off,
.gm-rail:focus-within .gm-arrow.is-off {
	opacity: 0;
	pointer-events: none;
}

/* ── Feature block ── */
.gm-feature {
	display: grid;
	grid-template-columns: minmax(300px, 1.4fr) 2fr;
	gap: 0.75rem;
	padding: 0 var(--gutter);
}

/*
 * Rows size to the tiles (`1fr` stretched them and left a gap between the two
 * rows); the hero then matches whatever height the grid works out to.
 */
.gm-feature__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(2, auto);
	align-content: start;
	gap: 0.75rem;
}

/* ── Tile ── */
.gm-tile {
	cursor: pointer;
	outline: none;
}

.gm-tile__art {
	position: relative;
	/* Artwork ships at 800x450. */
	aspect-ratio: 16 / 9;
	display: grid;
	place-items: center;
	border-radius: var(--r);
	overflow: hidden;
	background: var(--surface-2);
	transition:
		transform 0.32s var(--spring),
		box-shadow 0.3s var(--ease);
}

.gm-tile:hover .gm-tile__art,
.gm-tile:focus-visible .gm-tile__art {
	transform: translateY(-4px) scale(1.02);
	box-shadow: 0 18px 36px rgb(0 0 0 / 0.5);
}

.gm-tile__art img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.35s var(--ease);
}

.gm-tile__art img.is-loaded {
	opacity: 1;
}

/* A tile keeps shimmering until its own artwork decodes. */
.gm-tile__art.is-loading::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		100deg,
		transparent 20%,
		rgb(255 255 255 / 0.07) 50%,
		transparent 80%
	);
	transform: translateX(-100%);
	animation: shimmer 1.5s infinite;
}

.gm-tile--big .gm-tile__art {
	aspect-ratio: auto;
	height: 100%;
}

/* House placeholder, same treatment as the movie fallbacks. */
.gm-tile__ph {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 0.9rem;
	text-align: center;
}

.gm-tile__ph span {
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: rgb(255 255 255 / 0.92);
	text-shadow: 0 2px 14px rgb(0 0 0 / 0.45);
}

.gm-tile--big .gm-tile__ph span {
	font-size: 1.5rem;
}

/* When a thumbnail 404s there's no art to caption - centre the name instead. */
.gm-tile__art.is-blank .gm-tile__cap {
	inset: 0;
	display: grid;
	place-items: center;
	text-align: center;
	opacity: 1;
	transform: none;
}

.gm-tile__fade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / 0.5));
	opacity: 0;
	transition: opacity 0.25s var(--ease);
}

.gm-tile:hover .gm-tile__fade {
	opacity: 1;
}

.gm-tile__play {
	position: absolute;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: var(--r);
	background: linear-gradient(140deg, var(--accent-hi), var(--accent));
	color: var(--accent-ink);
	opacity: 0;
	transform: scale(0.6);
	box-shadow: 0 12px 26px rgb(0 0 0 / 0.45);
	transition:
		opacity 0.24s var(--ease),
		transform 0.4s var(--spring);
}

.gm-tile__play .lucide {
	width: 18px;
	height: 18px;
	margin-left: 2px;
}

.gm-tile:hover .gm-tile__play,
.gm-tile:focus-visible .gm-tile__play {
	opacity: 1;
	transform: scale(1);
	box-shadow: 0 18px 36px rgb(0 0 0 / 0.5);
	border-radius: var(--r)
}

.gm-tile__fav {
	position: absolute;
	top: 7px;
	right: 7px;
	display: grid;
	place-items: center;
	width: 27px;
	height: 27px;
	border: 1px solid rgb(255 255 255 / 0.18);
	border-radius: 999px;
	background: rgb(0 0 0 / 0.62);
	color: rgb(255 255 255 / 0.85);
	cursor: pointer;
	opacity: 0;
	transform: scale(0.8);
	transition:
		opacity 0.22s var(--ease),
		transform 0.32s var(--spring),
		color 0.2s var(--ease);
}

.gm-tile__fav .lucide {
	width: 13px;
	height: 13px;
}

.gm-tile:hover .gm-tile__fav,
.gm-tile__fav.on {
	opacity: 1;
	transform: scale(1);
}

.gm-tile__fav.on {
	color: var(--accent);
	border-color: rgb(var(--accent-rgb) / 0.5);
}

.gm-tile__fav.on .lucide {
	fill: currentColor;
}

/* Title rides over the art and only shows on hover, same as the movie cards. */
.gm-tile__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0.7rem 0.75rem 0.75rem;
	opacity: 0;
	transform: translateY(10px);
	transition:
		opacity 0.35s var(--ease),
		transform 0.45s var(--ease);
}

.gm-tile__cap h3 {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	text-shadow: 0 2px 10px rgb(0 0 0 / 0.6);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gm-tile:hover .gm-tile__cap,
.gm-tile:focus-visible .gm-tile__cap {
	opacity: 1;
	transform: translateY(0);
}

.gm-tile--big .gm-tile__cap {
	padding: 1rem 1.1rem 1.05rem;
}

.gm-tile--big .gm-tile__cap h3 {
	font-size: 1.05rem;
	font-weight: 780;
	letter-spacing: -0.01em;
}

/* ── Skeletons ── */
.gm-tile--skeleton {
	pointer-events: none;
}

.gm-tile--skeleton .gm-tile__art {
	background: rgb(255 255 255 / 0.045);
	transform: none;
	box-shadow: none;
}

/*
 * Poster rows (Rise Originals): a movie-cover shape sized off the Top-picks
 * tile - --col has to be measured, since that grid is fr-based.
 */
.gm-row--posters .gm-track {
	grid-auto-columns: calc(var(--col, 186px) * 0.95);
}

.gm-row--posters .gm-tile__art {
	aspect-ratio: 2 / 3;
}

/* ── Browse ── */
.gm-browse {
	padding: 0 var(--gutter);
}

.gm-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1.1rem;
}

.gm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 0.95rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: rgb(255 255 255 / 0.05);
	color: var(--text-dim);
	font: inherit;
	font-size: 0.78rem;
	font-weight: 640;
	line-height: 1.1;
	white-space: nowrap;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease),
		border-color 0.2s var(--ease);
}

.gm-chip .lucide {
	width: 13px;
	height: 13px;
}

.gm-chip em {
	font-style: normal;
	font-size: 0.68rem;
	opacity: 0.6;
}

.gm-chip:hover {
	background: rgb(255 255 255 / 0.09);
	color: var(--text);
}

.gm-chip.on {
	background: linear-gradient(140deg, var(--accent-hi), var(--accent));
	border-color: transparent;
	color: var(--accent-ink);
}

.gm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(186px, 1fr));
	gap: 1rem 0.75rem;
}

.gm-grid--search {
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	padding-bottom: 0.4rem;
}

.gm-more {
	display: flex;
	justify-content: center;
	margin-top: 1.6rem;
}

/* ── Player ── */
.gm-player {
	position: absolute;
	inset: 0;
	display: flex;
	background: #000;
}

.gm-player .game-stage {
	position: relative;
	flex: 1;
	display: flex;
	min-height: 0;
}

.gm-player iframe {
	flex: 1;
	width: 100%;
	height: 100%;
	border: none;
	background: #000;
}
/* ── Rail volume ──
 * Slides out of the rail on hover; the button's own tooltip steps aside.
 */
.rail-vol {
	position: relative;
	display: flex;
}

.rail-vol__pop {
	position: absolute;
	left: 100%;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.7rem;
	/* The left padding doubles as the bridge across the gap, so the pointer
	   never leaves .rail-vol on its way from the button to the slider. */
	padding: 0.45rem 0.8rem 0.45rem 0.9rem;
	margin-left: 12px;
	border: 1px solid var(--line-2);
	border-radius: var(--r-sm);
	background: rgb(14 16 18 / 0.98);
	box-shadow: 0 14px 32px rgb(0 0 0 / 0.5);
	opacity: 0;
	transform: translate(-6px, -50%);
	pointer-events: none;
	transition:
		opacity 0.18s var(--ease),
		transform 0.28s var(--spring);
}

/* Covers the margin so the hover never breaks mid-travel. */
.rail-vol__pop::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: -16px;
	width: 20px;
}

.rail-vol:hover .rail-vol__pop,
.rail-vol:focus-within .rail-vol__pop {
	opacity: 1;
	transform: translate(0, -50%);
	pointer-events: auto;
}

/* The label would sit exactly where the slider lands. */
.rail-vol:hover .rail-btn::after,
.rail-vol:focus-within .rail-btn::after {
	opacity: 0;
}

.rail-vol__pop span {
	min-width: 2ch;
	font-size: 0.7rem;
	font-weight: 650;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

/* Track fills up to the current level rather than reading as a bare line. */
.rail-vol__pop input[type="range"] {
	--pct: 100%;
	width: 108px;
	height: 5px;
	appearance: none;
	-webkit-appearance: none;
	border-radius: 99px;
	background: linear-gradient(
		90deg,
		var(--accent) 0 var(--pct),
		rgb(255 255 255 / 0.15) var(--pct) 100%
	);
	outline: none;
	cursor: pointer;
}

.rail-vol__pop input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 999px;
	background: #fff;
	border: none;
	box-shadow:
		0 2px 6px rgb(0 0 0 / 0.5),
		0 0 0 0 rgb(var(--accent-rgb) / 0.25);
	transition:
		box-shadow 0.2s var(--ease),
		transform 0.2s var(--spring);
}

.rail-vol__pop input[type="range"]:hover::-webkit-slider-thumb,
.rail-vol__pop input[type="range"]:focus-visible::-webkit-slider-thumb {
	transform: scale(1.12);
	box-shadow:
		0 2px 6px rgb(0 0 0 / 0.5),
		0 0 0 5px rgb(var(--accent-rgb) / 0.22);
}

.rail-vol__pop input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: none;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 2px 6px rgb(0 0 0 / 0.5);
}

.rail-btn.is-muted {
	color: var(--accent);
}

/* ── Asset loader ──
 * A loading screen, not a dialog: content sits bottom-left over the stage and
 * the asset log fills upward as the game pulls its files down.
 */
.gm-load {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: flex-end;
	padding: clamp(1.25rem, 4vw, 3rem);
	background: var(--bg);
	opacity: 0;
	transition: opacity 0.3s var(--ease);
}

.gm-load.is-open {
	opacity: 1;
}

.gm-load__inner {
	width: min(520px, 100%);
	animation: gm-load-in 0.5s var(--ease) both;
}

@keyframes gm-load-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

.gm-load__head {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin-bottom: 1.3rem;
}

.gm-load__art {
	position: relative;
	flex-shrink: 0;
	width: 64px;
	height: 64px;
	border-radius: var(--r);
	background: var(--surface-2);
	overflow: hidden;
}

.gm-load__art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gm-load__id h2 {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 760;
	letter-spacing: -0.02em;
}

.gm-load__id p {
	margin: 0.15rem 0 0;
	font-size: 0.75rem;
	color: var(--text-mute);
}

.gm-load__bar {
	position: relative;
	height: 3px;
	border-radius: 99px;
	background: rgb(255 255 255 / 0.08);
	overflow: hidden;
}

.gm-load__fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
	transform-origin: left center;
	transition: width 0.28s var(--ease);
}

/* The asset phase has no total to divide by - show activity, not a number. */
.gm-load__bar.is-working .gm-load__fill {
	width: 40%;
	transition: none;
	animation: gm-load-sweep 1.1s var(--ease) infinite;
}

@keyframes gm-load-sweep {
	from {
		transform: translateX(-120%);
	}
	to {
		transform: translateX(280%);
	}
}

/* Keep rail/crumb tucked away until the loader finishes. */
.game-stage.is-loading .player-rail,
.game-stage.is-loading .player-crumb,
.game-stage.is-loading .rail-hide {
	opacity: 0 !important;
	pointer-events: none !important;
}

.game-stage.is-loading .player-rail {
	transform: translate(-12px, -50%) !important;
}

.game-stage.is-loading .player-crumb {
	transform: translateY(-8px) !important;
}

.game-stage.chrome-reveal .player-rail {
	animation: gm-chrome-rail 0.48s var(--spring) both;
}

.game-stage.chrome-reveal .player-crumb {
	animation: gm-chrome-crumb 0.42s var(--ease) both;
}

@keyframes gm-chrome-rail {
	from {
		opacity: 0;
		transform: translate(-14px, -50%);
	}
	to {
		opacity: 1;
		transform: translateY(-50%);
	}
}

@keyframes gm-chrome-crumb {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.gm-load__meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 0.6rem;
	font-size: 0.74rem;
	color: var(--text-mute);
	font-variant-numeric: tabular-nums;
}

.gm-load__meta b {
	color: var(--text-dim);
	font-weight: 650;
}

/* Live list of the files the game actually pulled down. */
.gm-load__log {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	max-height: 132px;
	margin: 1.1rem 0 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.68rem;
	line-height: 1.4;
	color: var(--text-mute);
	mask-image: linear-gradient(180deg, transparent, #000 30%);
	-webkit-mask-image: linear-gradient(180deg, transparent, #000 30%);
}

.gm-load__log li {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	animation: gm-log-in 0.28s var(--ease) both;
}

@keyframes gm-log-in {
	from {
		opacity: 0;
		transform: translateY(5px);
	}
}

.gm-load__log li span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gm-load__log li em {
	margin-left: auto;
	flex-shrink: 0;
	font-style: normal;
	color: var(--text-dim);
	font-variant-numeric: tabular-nums;
}

.gm-load__err {
	margin: 1.1rem 0 0;
	font-size: 0.78rem;
	line-height: 1.5;
	color: #ff9d86;
}

.gm-load__acts {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1.2rem;
}

.gm-load__retry,
.gm-load__cancel {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	height: 34px;
	padding: 0 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--line-2);
	background: transparent;
	color: var(--text-mute);
	font: inherit;
	font-size: 0.76rem;
	font-weight: 620;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease);
}

.gm-load__retry .lucide {
	width: 13px;
	height: 13px;
}

.gm-load__retry {
	background: var(--accent);
	border-color: transparent;
	color: var(--accent-ink);
}

.gm-load__cancel:hover {
	background: rgb(255 255 255 / 0.06);
	color: var(--text);
}

.gm-load__retry:hover {
	filter: brightness(1.07);
}

/* The log is the first thing to go when there's no room for it. */
@media (max-height: 560px) {
	.gm-load__log {
		max-height: 66px;
	}
}

.gm-blank {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 2rem;
	text-align: center;
	background: var(--bg);
}

.gm-blank__icon {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: 0.3rem;
	border-radius: var(--r-lg);
	background: var(--accent-low);
	border: 1px solid var(--accent-mid);
	color: var(--accent);
}

.gm-blank__icon .lucide {
	width: 26px;
	height: 26px;
}

.gm-blank h2 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 760;
	letter-spacing: -0.02em;
}

.gm-blank p {
	margin: 0;
	max-width: 380px;
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--text-mute);
}

.gm-blank code {
	padding: 0.1rem 0.35rem;
	border-radius: 5px;
	background: rgb(255 255 255 / 0.08);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
	color: var(--text-dim);
}

/* ── Responsive ──
 * Poster rows stop deriving from --col below 900px: once the feature block
 * stacks, its columns get much wider than the rails and the sizes diverge.
 */
@media (min-width: 1500px) {
	.gm-track {
		grid-auto-columns: 214px;
	}

	.gm-grid {
		grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
	}
}

@media (max-width: 1100px) {
	.gm-track {
		grid-auto-columns: 172px;
	}
}

@media (max-width: 900px) {
	.gm-feature {
		grid-template-columns: 1fr;
	}

	/* Stacked, the hero has no grid to match - give it a banner ratio. */
	.gm-tile--big .gm-tile__art {
		aspect-ratio: 16 / 9;
		height: auto;
	}

	.gm-row--posters .gm-track {
		grid-auto-columns: 168px;
	}
}

@media (max-width: 700px) {
	.gm-feature__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.gm-track {
		grid-auto-columns: 152px;
	}

	.gm-row--posters .gm-track {
		grid-auto-columns: 144px;
	}

	.gm-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.gm-grid--search {
		grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
	}

	/* The arrows would hang off the viewport once the gutter shrinks. */
	.gm-arrow {
		display: none;
	}
}

@media (max-width: 520px) {
	.gm-feature__grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.gm-track {
		grid-auto-columns: 136px;
	}

	.gm-row--posters .gm-track {
		grid-auto-columns: 124px;
	}

	.gm-grid {
		grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
	}

	.gm-row__head h2 {
		font-size: 0.95rem;
	}

	.gm-brand h1 {
		font-size: 0.94rem;
	}

	.gm-tile--big .gm-tile__cap h3 {
		font-size: 0.9rem;
	}
}

/* Touch devices scroll the rails directly - the arrows are dead weight. */
@media (hover: none) {
	.gm-arrow {
		display: none;
	}

	.gm-tile__cap,
	.gm-tile__fav {
		opacity: 1;
		transform: none;
	}
}

/* ══ Custom dropdowns ═══════════════════════════════════════════ */
.dd {
	position: relative;
	display: inline-block;
}

.dd__trigger {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	height: 38px;
	padding: 0 0.7rem 0 0.85rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
	font: inherit;
	font-size: 0.84rem;
	font-weight: 640;
	cursor: pointer;
	transition:
		background 0.22s var(--ease),
		border-color 0.22s var(--ease);
}

.dd__trigger:hover {
	background: rgb(255 255 255 / 0.09);
}

.dd.is-open .dd__trigger {
	border-color: rgb(var(--accent-rgb) / 0.45);
	background: var(--accent-low);
}

.dd__icon {
	display: grid;
	place-items: center;
	color: var(--accent);
}

.dd__icon .lucide {
	width: 15px;
	height: 15px;
}

.dd__icon--tile {
	width: 30px;
	height: 30px;
	border-radius: 9px;
	background: var(--accent-low);
	border: 1px solid var(--accent-mid);
	flex-shrink: 0;
}

.dd__value {
	white-space: nowrap;
}

.dd__caret {
	display: grid;
	place-items: center;
	color: var(--text-mute);
	transition: transform 0.32s var(--spring);
}

.dd__caret .lucide {
	width: 13px;
	height: 13px;
	transform: rotate(90deg);
}

.dd.is-open .dd__caret {
	transform: rotate(-180deg);
}

.dd__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 70;
	min-width: 250px;
	padding: 0.35rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-lg);
	background: rgb(17 19 21 / 0.98);
	box-shadow: 0 26px 60px rgb(0 0 0 / 0.6);
	opacity: 0;
	transform: translateY(-8px) scale(0.97);
	transform-origin: top left;
	transition:
		opacity 0.2s var(--ease),
		transform 0.34s var(--spring);
}

.dd__panel--right {
	left: auto;
	right: 0;
	transform-origin: top right;
}

.dd__panel--up {
	top: auto;
	bottom: calc(100% + 10px);
	transform-origin: bottom left;
	transform: translateY(8px) scale(0.97);
}

.dd__panel.is-in {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.dd__search {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: 0.3rem;
}

.dd__search .lucide {
	position: absolute;
	left: 0.65rem;
	width: 14px;
	height: 14px;
	color: var(--text-mute);
	pointer-events: none;
}

.dd__search input {
	width: 100%;
	height: 34px;
	padding: 0 0.6rem 0 2rem;
	border: 1px solid transparent;
	border-radius: var(--r-xs);
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
	font: inherit;
	font-size: 0.82rem;
	outline: none;
}

.dd__search input:focus {
	border-color: rgb(var(--accent-rgb) / 0.4);
}

.dd__group {
	margin: 0.3rem 0 0.25rem 0.55rem;
	font-size: 0.62rem;
	font-weight: 750;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-mute);
}

.dd__list {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	max-height: 320px;
	overflow-y: auto;
}

.dd__item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	padding: 0.55rem 0.6rem;
	border: none;
	border-radius: var(--r-xs);
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition: background 0.18s var(--ease);
}

.dd__item:hover {
	background: rgb(255 255 255 / 0.07);
}

.dd__item.is-on {
	background: rgb(255 255 255 / 0.06);
}

.dd__text {
	flex: 1;
	min-width: 0;
}

.dd__text strong {
	display: block;
	font-size: 0.84rem;
	font-weight: 650;
}

.dd__text span {
	display: block;
	font-size: 0.72rem;
	color: var(--text-mute);
	line-height: 1.35;
}

.dd__check {
	display: grid;
	place-items: center;
	color: var(--accent);
}

.dd__check .lucide {
	width: 15px;
	height: 15px;
}

.dd__empty {
	margin: 0;
	padding: 1rem;
	text-align: center;
	font-size: 0.78rem;
	color: var(--text-mute);
}

.dd__switch {
	position: relative;
	width: 30px;
	height: 18px;
	flex-shrink: 0;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.12);
	transition: background 0.25s var(--ease);
}

.dd__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #d5dadd;
	transition: transform 0.32s var(--spring);
}

.dd__switch[data-state="on"] {
	background: rgb(var(--accent-rgb) / 0.4);
}

.dd__switch[data-state="on"]::after {
	transform: translateX(12px);
	background: var(--accent);
}

.action-menu {
	left: 0;
	bottom: calc(100% + 14px);
	min-width: 258px;
}

/* ══ AI page ════════════════════════════════════════════════════ */
.ai-page {
	flex-direction: row;
	background: var(--bg);
}

.ai-side {
	width: 250px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	padding: 1rem 0.7rem calc(var(--taskbar-h) + 1rem);
	border-right: 1px solid var(--line);
	background: rgb(255 255 255 / 0.018);
	transition:
		width 0.32s var(--ease),
		opacity 0.25s var(--ease);
	overflow: hidden;
}

.ai-side.is-hidden {
	width: 0;
	padding-left: 0;
	padding-right: 0;
	opacity: 0;
	border-right-color: transparent;
}

.ai-side__brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0 0.35rem;
	height: 26px;
	color: var(--accent);
}

.ai-side__brand .rise-logo {
	height: 18px;
}

.ai-side__brand span {
	font-size: 0.86rem;
	font-weight: 750;
	letter-spacing: -0.01em;
	color: var(--text);
}

.ai-new {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	height: 40px;
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
	font: inherit;
	font-size: 0.84rem;
	font-weight: 650;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		border-color 0.2s var(--ease),
		transform 0.3s var(--spring);
}

.ai-new:hover {
	background: var(--accent-low);
	border-color: rgb(var(--accent-rgb) / 0.4);
	color: var(--accent);
	transform: translateY(-1px);
}

.ai-new .lucide {
	width: 15px;
	height: 15px;
}

.ai-side__search {
	position: relative;
	display: flex;
	align-items: center;
}

.ai-side__search .lucide {
	position: absolute;
	left: 0.65rem;
	width: 14px;
	height: 14px;
	color: var(--text-mute);
	pointer-events: none;
}

.ai-side__search input {
	width: 100%;
	height: 34px;
	padding: 0 0.6rem 0 2rem;
	border: 1px solid transparent;
	border-radius: var(--r-xs);
	background: rgb(255 255 255 / 0.04);
	color: var(--text);
	font: inherit;
	font-size: 0.8rem;
	outline: none;
}

.ai-side__search input:focus {
	border-color: rgb(var(--accent-rgb) / 0.35);
}

.ai-side__list {
	flex: 1;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.ai-side__label {
	margin: 0.6rem 0 0.2rem 0.5rem;
	font-size: 0.6rem;
	font-weight: 750;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--text-mute);
}

.ai-side__empty {
	margin: 1.5rem 0;
	text-align: center;
	font-size: 0.78rem;
	color: var(--text-mute);
}

.ai-chat-row {
	display: flex;
	align-items: center;
	padding: 0.55rem 0.6rem;
	border: 1px solid transparent;
	border-radius: var(--r-xs);
	background: transparent;
	color: var(--text-dim);
	font: inherit;
	font-size: 0.82rem;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.18s var(--ease),
		color 0.18s var(--ease);
}

.ai-chat-row span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ai-chat-row:hover {
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
}

.ai-chat-row.is-on {
	background: rgb(255 255 255 / 0.08);
	border-color: var(--line);
	color: var(--text);
	font-weight: 620;
}

.ai-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.ai-top {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.9rem var(--gutter) 0.5rem;
}

.ai-icon-btn {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--line);
	border-radius: var(--r-xs);
	background: rgb(255 255 255 / 0.04);
	color: var(--text-dim);
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease);
}

.ai-icon-btn:hover {
	background: rgb(255 255 255 / 0.09);
	color: var(--text);
}

.ai-icon-btn .lucide {
	width: 15px;
	height: 15px;
}

.ai-share {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	height: 38px;
	margin-left: auto;
	padding: 0 0.9rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
	font: inherit;
	font-size: 0.83rem;
	font-weight: 640;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		border-color 0.2s var(--ease),
		color 0.2s var(--ease);
}

.ai-share .lucide {
	width: 15px;
	height: 15px;
}

.ai-share:hover {
	background: rgb(255 255 255 / 0.09);
}

.ai-share.is-live {
	background: var(--accent-low);
	border-color: rgb(var(--accent-rgb) / 0.45);
	color: var(--accent);
}

.ai-thread {
	flex: 1;
	overflow-y: auto;
	padding: 0.5rem var(--gutter) 1rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ai-msg {
	display: flex;
	gap: 0.7rem;
	max-width: 780px;
	width: 100%;
	margin: 0 auto;
	animation: set-in 0.35s var(--ease) both;
}

.ai-msg--me {
	justify-content: flex-end;
}

.ai-avatar {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border-radius: 10px;
	background: var(--accent-low);
	border: 1px solid var(--accent-mid);
	color: var(--accent);
}

.ai-avatar .lucide {
	width: 15px;
	height: 15px;
}

.ai-bubble {
	max-width: 78%;
	padding: 0.8rem 1rem;
	border-radius: 16px 16px 4px 16px;
	background: linear-gradient(140deg, var(--accent-hi), var(--accent));
	color: var(--accent-ink);
	font-size: 0.89rem;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ai-bubble__img {
	display: block;
	width: 100%;
	max-width: 240px;
	margin: 0;
	border-radius: 10px;
	transition: filter 0.2s var(--ease);
}

.ai-bubble__img-btn {
	position: relative;
	display: inline-block;
	max-width: 240px;
	margin-bottom: 0.5rem;
	padding: 0;
	border: none;
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	overflow: hidden;
	line-height: 0;
	vertical-align: top;
}

.ai-bubble__img-btn .ai-bubble__img {
	display: block;
	width: 100%;
	max-width: 240px;
	height: auto;
	min-height: 0;
	object-fit: contain;
	aspect-ratio: auto;
}

.ai-bubble__img-hover {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: rgb(0 0 0 / 0.28);
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s var(--ease);
}

.ai-bubble__img-hover .lucide {
	width: 22px;
	height: 22px;
}

.ai-bubble__img-btn:hover .ai-bubble__img {
	filter: blur(1.5px) brightness(0.75);
}

.ai-bubble__img-btn:hover .ai-bubble__img-hover {
	opacity: 1;
}

.ai-msg__bundle {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.45rem;
	max-width: 78%;
}

.ai-msg__bundle .ai-bubble {
	max-width: 100%;
}

.ai-bubble__atts {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	height: 92px;
	padding: 0 0.2rem 0.1rem;
	isolation: isolate;
}

.ai-bubble__card {
	position: relative;
	width: 76px;
	height: 76px;
	margin-left: -34px;
	padding: 0;
	border: 2px solid rgb(255 255 255 / 0.18);
	border-radius: 14px;
	overflow: hidden;
	background: rgb(12 14 20 / 0.9);
	cursor: pointer;
	flex-shrink: 0;
	box-shadow:
		0 10px 28px rgb(0 0 0 / 0.45),
		0 0 0 1px rgb(0 0 0 / 0.2);
	transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg))
		translateY(calc(var(--i) * 1.5px));
	transform-origin: 50% 110%;
	transition:
		transform 0.4s var(--spring),
		margin 0.4s var(--spring),
		box-shadow 0.25s var(--ease),
		border-color 0.2s var(--ease);
	z-index: calc(var(--i) + 1);
	animation: ai-attach-in 0.42s var(--spring) both;
	animation-delay: calc(var(--i) * 45ms);
}

.ai-bubble__atts .ai-bubble__card:first-child {
	margin-left: 0;
}

.ai-bubble__card img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.ai-bubble__atts:hover .ai-bubble__card,
.ai-bubble__atts:focus-within .ai-bubble__card {
	margin-left: 8px;
	transform: rotate(0deg) translateY(0) scale(1.02);
	z-index: calc(10 + var(--i));
}

.ai-bubble__atts:hover .ai-bubble__card:first-child,
.ai-bubble__atts:focus-within .ai-bubble__card:first-child {
	margin-left: 0;
}

.ai-bubble__card:hover {
	border-color: rgb(var(--accent-rgb) / 0.55);
	box-shadow:
		0 14px 34px rgb(0 0 0 / 0.55),
		0 0 0 1px rgb(var(--accent-rgb) / 0.25);
	z-index: 40;
}

.ai-bubble__notes {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 0.4rem;
}

.ai-bubble__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	align-self: flex-start;
	padding: 0.35rem 0.65rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-xs);
	background: rgb(255 255 255 / 0.06);
	color: var(--text);
	font: inherit;
	font-size: 0.75rem;
	cursor: pointer;
}

.ai-bubble__chip .lucide {
	width: 14px;
	height: 14px;
}

.ai-bubble--ai {
	max-width: 100%;
	border-radius: 4px 16px 16px 16px;
	background: rgb(255 255 255 / 0.045);
	border: 1px solid var(--line);
	color: var(--text);
	white-space: normal;
}

.ai-bubble--ai p {
	margin: 0 0 0.7rem;
}

.ai-bubble--ai p:last-child {
	margin-bottom: 0;
}

.ai-bubble--ai ul {
	margin: 0.4rem 0;
	padding-left: 1.1rem;
}

.ai-bubble--ai code {
	padding: 0.1rem 0.35rem;
	border-radius: 5px;
	background: rgb(255 255 255 / 0.08);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
}

.ai-code {
	margin: 0.6rem 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(0 0 0 / 0.4);
	overflow-x: auto;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.8rem;
	line-height: 1.55;
}

.ai-typing {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 20px;
}

.ai-typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	animation: ai-typing 1.2s ease-in-out infinite;
}

.ai-typing i:nth-child(2) {
	animation-delay: 0.16s;
}

.ai-typing i:nth-child(3) {
	animation-delay: 0.32s;
}

@keyframes ai-typing {
	0%,
	60%,
	100% {
		opacity: 0.25;
		transform: translateY(0);
	}
	30% {
		opacity: 1;
		transform: translateY(-4px);
	}
}

.ai-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	text-align: center;
	padding: 2rem 0;
}

.ai-empty__logo {
	display: block;
	height: 32px;
	margin-bottom: 0.3rem;
	color: var(--accent);
	filter: drop-shadow(0 0 20px var(--accent-glow));
}

.ai-empty__logo .rise-logo {
	height: 32px;
}

.ai-empty h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 780;
	letter-spacing: -0.035em;
}

.ai-empty p {
	margin: 0;
	font-size: 0.82rem;
	color: var(--text-mute);
}

.ai-starters {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-top: 1.2rem;
	width: min(280px, 80%);
}

.ai-starter {
	padding: 0.7rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.03);
	color: var(--text-dim);
	font: inherit;
	font-size: 0.82rem;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease),
		transform 0.3s var(--spring),
		border-color 0.2s var(--ease);
}

.ai-starter:hover {
	background: rgb(255 255 255 / 0.07);
	border-color: rgb(var(--accent-rgb) / 0.3);
	color: var(--text);
	transform: translateX(3px);
}

.ai-composer {
	flex-shrink: 0;
	padding: 0.4rem var(--gutter) calc(var(--taskbar-h) + 1rem);
}

.ai-composer__field {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 0.4rem;
	max-width: 780px;
	margin: 0 auto;
	padding: 0.4rem 0.4rem 0.4rem 0.45rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-lg);
	background: rgb(255 255 255 / 0.045);
	transition:
		border-color 0.25s var(--ease),
		box-shadow 0.3s var(--ease);
}

.ai-composer__field:focus-within {
	border-color: rgb(var(--accent-rgb) / 0.45);
	box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.09);
}

.ai-plus {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: 1px solid transparent;
	border-radius: var(--r-sm);
	background: rgb(255 255 255 / 0.05);
	color: var(--text-dim);
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease),
		transform 0.35s var(--spring);
}

.ai-plus:hover {
	background: rgb(255 255 255 / 0.1);
	color: var(--text);
}

.ai-plus.is-on {
	background: var(--accent-low);
	border-color: rgb(var(--accent-rgb) / 0.35);
	color: var(--accent);
}

.ai-plus .lucide {
	width: 16px;
	height: 16px;
	transition: transform 0.35s var(--spring);
}

.ai-composer textarea {
	flex: 1;
	min-height: 36px;
	max-height: 190px;
	padding: 0.5rem 0;
	border: none;
	background: none;
	color: var(--text);
	font: inherit;
	font-size: 0.9rem;
	line-height: 1.5;
	resize: none;
	outline: none;
}

.ai-send {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: none;
	border-radius: var(--r-sm);
	background: linear-gradient(140deg, var(--accent-hi), var(--accent));
	color: var(--accent-ink);
	cursor: pointer;
	transition:
		filter 0.2s var(--ease),
		transform 0.3s var(--spring);
}

.ai-send:hover {
	filter: brightness(1.06);
	transform: scale(1.05);
}

.ai-send .lucide {
	width: 16px;
	height: 16px;
	/* The paper plane reads as off-centre when it's optically centred. */
	margin: 1px 1px 0 0;
}

.ai-send.is-busy .lucide {
	animation: tab-spin 0.9s linear infinite;
}

.ai-hint {
	max-width: 780px;
	margin: 0.45rem auto 0;
	text-align: center;
	font-size: 0.68rem;
	color: var(--text-mute);
}

@media (max-width: 820px) {
	.ai-side {
		position: absolute;
		inset: 0 auto 0 0;
		z-index: 20;
		height: 100%;
	}
}

/* ══ Screen share bar ═══════════════════════════════════════════ */
.ss {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	height: 100%;
	padding: 0.7rem;
}

.ss__bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.5rem 0.45rem 0.7rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-lg);
	background: rgb(16 18 20 / 0.96);
	flex-shrink: 0;
}

.ss__live {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.64rem;
	font-weight: 800;
	letter-spacing: 0.1em;
	color: var(--accent);
	flex-shrink: 0;
}

.ss__live i {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 10px var(--accent);
	animation: ss-pulse 1.6s ease-in-out infinite;
}

@keyframes ss-pulse {
	50% {
		opacity: 0.35;
		transform: scale(0.8);
	}
}

.ss__cam {
	display: grid;
	place-items: center;
	color: var(--text-mute);
	flex-shrink: 0;
}

.ss__cam .lucide {
	width: 15px;
	height: 15px;
}

.ss__input {
	flex: 1;
	min-width: 0;
	height: 34px;
	padding: 0 0.7rem;
	border: 1px solid transparent;
	border-radius: var(--r-sm);
	background: rgb(255 255 255 / 0.05);
	color: var(--text);
	font: inherit;
	font-size: 0.83rem;
	outline: none;
}

.ss__input:focus {
	border-color: rgb(var(--accent-rgb) / 0.4);
}

.ss__btn {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border: none;
	border-radius: var(--r-xs);
	background: transparent;
	color: var(--text-dim);
	cursor: pointer;
	transition:
		background 0.2s ease,
		color 0.2s ease,
		transform 0.3s ease;
}

.ss__btn:hover {
	background: rgb(255 255 255 / 0.09);
	color: var(--text);
}

.ss__btn .lucide {
	width: 14px;
	height: 14px;
}

.ss__btn.is-flipped .lucide {
	transform: rotate(180deg);
}

.ss__send {
	background: var(--accent);
	color: var(--accent-ink);
}

.ss__send:hover {
	background: var(--accent-hi);
	color: var(--accent-ink);
}

.ss__close:hover {
	background: rgb(255 90 70 / 0.18);
	color: #ff9d86;
}

.ss__feed {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	overflow-y: auto;
	min-height: 0;
}

.ss.is-min .ss__feed {
	display: none;
}

.ss__card {
	display: grid;
	grid-template-columns: 1fr 112px;
	gap: 0.65rem;
	padding: 0.55rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.035);
	animation: set-in 0.3s ease both;
}

.ss__main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	grid-column: 1;
}

.ss__shot {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	width: 112px;
}

.ss__shot img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 8px;
	display: block;
	border: 1px solid var(--line);
}

.ss__q {
	margin: 0;
	font-size: 0.78rem;
	font-weight: 700;
}

.ss__think {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	align-self: flex-start;
	padding: 0.22rem 0.55rem 0.22rem 0.4rem;
	border-radius: 999px;
	border: 1px solid rgb(var(--accent-rgb) / 0.28);
	background: rgb(var(--accent-rgb) / 0.08);
	color: var(--accent);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	animation: ai-think-in 0.35s var(--ease) both;
}

.ss__think-orb {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 10px var(--accent-glow);
}

.ss__think.is-live .ss__think-orb {
	animation: ai-think-pulse 1.1s ease-in-out infinite;
}

.ss__think.is-done {
	color: var(--text-dim);
	border-color: var(--line-2);
	background: rgb(255 255 255 / 0.04);
}

.ss__think.is-done .ss__think-orb {
	background: var(--text-mute);
	box-shadow: none;
}

.ss__a {
	margin: 0;
	font-size: 0.79rem;
	line-height: 1.5;
	color: var(--text-dim);
}

.ss__a p {
	margin: 0 0 0.35rem;
}

.ss__a p:last-child {
	margin-bottom: 0;
}

.ss__a ul,
.ss__a ol {
	margin: 0.2rem 0 0.35rem;
	padding-left: 1.15rem;
}

.ss__a.is-in {
	animation: ai-answer-in 0.45s var(--ease) both;
	color: var(--text);
}

.ss__a.is-error,
.ss__a .is-error {
	color: #ff9d86;
}

.ai-math {
	font-family: "Cambria Math", "Times New Roman", serif;
	font-style: italic;
	color: var(--accent-hi);
	padding: 0 0.15em;
}

.ai-math--block {
	display: block;
	margin: 0.45rem 0;
	padding: 0.45rem 0.6rem;
	border-radius: 8px;
	background: rgb(255 255 255 / 0.04);
	border: 1px solid var(--line);
	text-align: center;
	overflow-x: auto;
	font-style: italic;
}

.ss__dots {
	display: inline-flex;
	gap: 4px;
}

.ss__dots i {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--accent);
	animation: ai-typing 1.2s ease-in-out infinite;
}

.ss__dots i:nth-child(2) {
	animation-delay: 0.16s;
}

.ss__dots i:nth-child(3) {
	animation-delay: 0.32s;
}

.ss-inline {
	position: fixed;
	left: 50%;
	bottom: calc(var(--taskbar-h) + 26px);
	transform: translateX(-50%);
	z-index: 85;
	width: min(640px, calc(100vw - 32px));
	max-height: 300px;
	border-radius: var(--r-xl);
	background: rgb(12 14 16 / 0.97);
	border: 1px solid var(--line-2);
	box-shadow: 0 30px 70px rgb(0 0 0 / 0.6);
}

/* Dot lattice behind the AI thread, same as the rest of the app. */
.ai-page {
	position: relative;
	isolation: isolate;
}

.ai-main::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: radial-gradient(
		circle,
		rgb(255 255 255 / 0.035) 1px,
		transparent 1px
	);
	background-size: 22px 22px;
	mask-image: radial-gradient(90% 70% at 50% 30%, #000, transparent 100%);
	pointer-events: none;
}

html.no-grid .ai-main::before {
	display: none;
}

/* ── Code blocks ── */
.ai-codewrap {
	position: relative;
	margin: 0.7rem 0;
}

.ai-codelang {
	position: absolute;
	top: 0.55rem;
	left: 0.85rem;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-mute);
	pointer-events: none;
}

.ai-copy {
	position: absolute;
	top: 0.4rem;
	right: 0.45rem;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.3rem 0.55rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-xs);
	background: rgb(255 255 255 / 0.06);
	color: var(--text-dim);
	font: inherit;
	font-size: 0.68rem;
	font-weight: 640;
	cursor: pointer;
	opacity: 0;
	transition:
		opacity 0.2s var(--ease),
		background 0.2s var(--ease),
		color 0.2s var(--ease);
}

.ai-codewrap:hover .ai-copy,
.ai-copy:focus-visible {
	opacity: 1;
}

.ai-copy:hover {
	background: rgb(255 255 255 / 0.12);
	color: var(--text);
}

.ai-copy.is-done {
	color: var(--accent);
	border-color: rgb(var(--accent-rgb) / 0.4);
}

.ai-copy .lucide {
	width: 12px;
	height: 12px;
}

.ai-code {
	margin: 0;
	padding: 2rem 1rem 0.9rem;
}

.ai-code code {
	background: none;
	padding: 0;
}

.ai-code ::selection {
	background: rgb(var(--accent-rgb) / 0.3);
	color: inherit;
}

.tk-key {
	color: #c792ea;
}

.tk-str {
	color: #a5e887;
}

.tk-num {
	color: #f6c177;
}

.tk-com {
	color: rgb(255 255 255 / 0.35);
	font-style: italic;
}

.tk-fn {
	color: #82aaff;
}

/* ── Attachment stack (above prompt) ── */
.ai-attach {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.55rem;
	max-width: 780px;
	margin: 0 auto 0.55rem;
	min-height: 0;
}

.ai-attach__stack {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	height: 96px;
	padding: 0 0.35rem 0.15rem;
	isolation: isolate;
}

.ai-attach__card {
	position: relative;
	width: 78px;
	height: 78px;
	margin-left: -36px;
	padding: 0;
	border: 2px solid rgb(255 255 255 / 0.14);
	border-radius: 14px;
	overflow: hidden;
	background: rgb(12 14 20 / 0.9);
	cursor: pointer;
	flex-shrink: 0;
	box-shadow:
		0 10px 28px rgb(0 0 0 / 0.45),
		0 0 0 1px rgb(0 0 0 / 0.25);
	transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg))
		translateY(calc(var(--i) * 1.5px));
	transform-origin: 50% 110%;
	transition:
		transform 0.4s var(--spring),
		margin 0.4s var(--spring),
		box-shadow 0.25s var(--ease),
		border-color 0.2s var(--ease);
	z-index: calc(var(--i) + 1);
	animation: ai-attach-in 0.42s var(--spring) both;
	animation-delay: calc(var(--i) * 45ms);
}

.ai-attach__stack .ai-attach__card:first-child {
	margin-left: 0;
}

.ai-attach__card img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.ai-attach__stack:hover .ai-attach__card,
.ai-attach__stack:focus-within .ai-attach__card {
	margin-left: 8px;
	transform: rotate(0deg) translateY(0) scale(1.02);
	z-index: calc(10 + var(--i));
}

.ai-attach__stack:hover .ai-attach__card:first-child,
.ai-attach__stack:focus-within .ai-attach__card:first-child {
	margin-left: 0;
}

.ai-attach__card:hover {
	border-color: rgb(var(--accent-rgb) / 0.55);
	box-shadow:
		0 14px 34px rgb(0 0 0 / 0.55),
		0 0 0 1px rgb(var(--accent-rgb) / 0.25);
	z-index: 40;
}

.ai-attach__card-x {
	position: absolute;
	top: 5px;
	right: 5px;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: rgb(0 0 0 / 0.55);
	color: #fff;
	opacity: 0;
	transform: scale(0.85);
	transition:
		opacity 0.2s var(--ease),
		transform 0.2s var(--ease),
		background 0.2s var(--ease);
}

.ai-attach__card:hover .ai-attach__card-x,
.ai-attach__card:focus-visible .ai-attach__card-x {
	opacity: 1;
	transform: scale(1);
}

.ai-attach__card-x:hover {
	background: rgb(220 60 60 / 0.9);
}

.ai-attach__card-x .lucide {
	width: 12px;
	height: 12px;
}

@keyframes ai-attach-in {
	from {
		opacity: 0;
		transform: rotate(calc((var(--i) - (var(--n) - 1) / 2) * 5deg))
			translateY(14px) scale(0.88);
	}
	to {
		opacity: 1;
	}
}

.ai-attach__notes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.ai-attach__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.3rem 0.35rem 0.3rem 0.3rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.05);
	cursor: pointer;
	font: inherit;
	font-size: 0.76rem;
	color: var(--text-dim);
	transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.ai-attach__chip:hover {
	background: rgb(255 255 255 / 0.09);
	color: var(--text);
}

.ai-attach__name {
	max-width: 140px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-attach__doc {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 7px;
	background: var(--accent-low);
	color: var(--accent);
	flex-shrink: 0;
}

.ai-attach__doc .lucide {
	width: 15px;
	height: 15px;
}

.ai-attach__x {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: none;
	border-radius: 7px;
	background: transparent;
	color: var(--text-mute);
	cursor: pointer;
	flex-shrink: 0;
}

.ai-attach__x:hover {
	background: rgb(255 255 255 / 0.1);
	color: var(--text);
}

.ai-attach__x .lucide {
	width: 13px;
	height: 13px;
}

/* ── Image lightbox ── */
.ai-lb {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: grid;
	place-items: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s var(--ease);
}

.ai-lb.is-open {
	opacity: 1;
	pointer-events: auto;
}

.ai-lb.is-closing {
	opacity: 0;
}

.ai-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(4 6 12 / 0.78);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

.ai-lb__stage {
	position: relative;
	z-index: 1;
	margin: 0;
	max-width: min(920px, calc(100vw - 7rem));
	max-height: calc(100vh - 5.5rem);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.7rem;
}

.ai-lb__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 7.5rem);
	border-radius: 16px;
	box-shadow: 0 28px 80px rgb(0 0 0 / 0.55);
	object-fit: contain;
	background: rgb(0 0 0 / 0.25);
}

.ai-lb__img.is-swap {
	animation: ai-lb-swap 0.28s var(--ease);
}

@keyframes ai-lb-swap {
	from {
		opacity: 0.35;
		transform: scale(0.985);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ai-lb__cap {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: rgb(255 255 255 / 0.72);
	text-shadow: 0 1px 8px rgb(0 0 0 / 0.5);
}

.ai-lb__x,
.ai-lb__nav {
	position: absolute;
	z-index: 2;
	display: grid;
	place-items: center;
	border: 1px solid rgb(255 255 255 / 0.12);
	background: rgb(28 30 36 / 0.82);
	color: #fff;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		transform 0.25s var(--spring),
		opacity 0.2s var(--ease);
}

.ai-lb__x {
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	border-radius: 12px;
}

.ai-lb__nav {
	top: 50%;
	width: 46px;
	height: 46px;
	border-radius: 999px;
	transform: translateY(-50%);
}

.ai-lb__nav--prev {
	left: 1rem;
}

.ai-lb__nav--next {
	right: 1rem;
}

.ai-lb__x:hover,
.ai-lb__nav:hover {
	background: rgb(255 255 255 / 0.16);
}

.ai-lb__nav:hover {
	transform: translateY(-50%) scale(1.06);
}

.ai-lb__nav.is-dim {
	opacity: 0.35;
}

.ai-lb__x .lucide,
.ai-lb__nav .lucide {
	width: 20px;
	height: 20px;
}

@media (max-width: 640px) {
	.ai-lb__nav {
		display: none;
	}

	.ai-lb__stage {
		max-width: calc(100vw - 1.5rem);
	}
}

/* ── Thinking (Claude-style) ── */
.ai-msg--ai {
	flex-direction: column;
	align-items: stretch;
	gap: 0.45rem;
}

.ai-msg__lead {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	min-width: 0;
}

.ai-think {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	min-width: 0;
	animation: ai-think-in 0.4s var(--ease) both;
}

.ai-think.is-empty .ai-think__chev {
	display: none;
}

.ai-think__tab {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.28rem 0.65rem 0.28rem 0.4rem;
	border: 1px solid rgb(var(--accent-rgb) / 0.3);
	border-radius: 999px;
	background: linear-gradient(
		120deg,
		rgb(var(--accent-rgb) / 0.14),
		rgb(255 255 255 / 0.04) 55%,
		rgb(var(--accent-rgb) / 0.1)
	);
	background-size: 200% 100%;
	color: var(--accent);
	font: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition:
		border-color 0.2s var(--ease),
		color 0.2s var(--ease),
		background 0.2s var(--ease);
}

.ai-think.is-live .ai-think__tab {
	animation: ai-think-shimmer 2.2s linear infinite;
}

.ai-think.is-done .ai-think__tab {
	color: var(--text-dim);
	border-color: var(--line-2);
	background: rgb(255 255 255 / 0.04);
	animation: none;
}

.ai-think__orb {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--accent);
	box-shadow: 0 0 12px var(--accent-glow);
	flex-shrink: 0;
}

.ai-think.is-live .ai-think__orb {
	animation: ai-think-pulse 1.1s ease-in-out infinite;
}

.ai-think.is-done .ai-think__orb {
	background: var(--text-mute);
	box-shadow: none;
	animation: none;
}

.ai-think__chev {
	width: 6px;
	height: 6px;
	margin-left: 0.1rem;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.7;
	transition: transform 0.25s var(--ease);
}

.ai-think.is-open .ai-think__chev {
	transform: rotate(225deg);
}

.ai-think__panel {
	max-width: min(520px, 100%);
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	background: rgb(255 255 255 / 0.03);
	animation: ai-answer-in 0.3s var(--ease) both;
}

.ai-think__panel pre {
	margin: 0;
	font: inherit;
	font-size: 0.74rem;
	line-height: 1.45;
	color: var(--text-mute);
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ai-bubble--ai.is-in {
	animation: ai-answer-in 0.45s var(--ease) both;
}

@keyframes ai-think-in {
	from {
		opacity: 0;
		transform: translateX(-6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes ai-answer-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes ai-think-pulse {
	0%,
	100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.35);
		opacity: 0.55;
	}
}

@keyframes ai-think-shimmer {
	0% {
		background-position: 100% 0;
	}
	100% {
		background-position: -100% 0;
	}
}

/* ── Assistant message actions ── */
.ai-msg__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
	flex: 1;
	max-width: 100%;
	padding-left: calc(30px + 0.7rem);
}

.ai-msg__actions {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	padding-left: 0.15rem;
}

.ai-msg__btn {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--text-mute);
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease);
}

.ai-msg__btn:hover {
	background: rgb(255 255 255 / 0.08);
	color: var(--text);
}

.ai-msg__btn.is-on {
	background: var(--accent-low);
	color: var(--accent);
}

.ai-msg__btn .lucide {
	width: 14px;
	height: 14px;
}

.ai-msg--me .ai-bubble__chip {
	border: 1px solid rgb(0 0 0 / 0.12);
	border-radius: 8px;
	background: rgb(0 0 0 / 0.12);
	color: inherit;
	padding: 0.28rem 0.55rem 0.28rem 0.4rem;
	gap: 0.35rem;
}

.ai-bubble__chip .lucide {
	width: 13px;
	height: 13px;
}

/* ── Rich text ── */
.ai-h {
	margin: 0.9rem 0 0.4rem;
	font-weight: 760;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

h2.ai-h {
	font-size: 1.12rem;
}

h3.ai-h {
	font-size: 1rem;
}

h4.ai-h {
	font-size: 0.9rem;
	color: var(--accent);
}

.ai-bubble--ai > *:first-child {
	margin-top: 0;
}

.ai-hr {
	margin: 0.9rem 0;
	border: none;
	border-top: 1px solid var(--line);
}

.ai-quote {
	margin: 0.6rem 0;
	padding: 0.15rem 0 0.15rem 0.85rem;
	border-left: 2px solid rgb(var(--accent-rgb) / 0.5);
	color: var(--text-dim);
}

.ai-bubble--ai ol {
	margin: 0.4rem 0;
	padding-left: 1.2rem;
}

.ai-bubble--ai li {
	margin: 0.2rem 0;
}

.ai-bubble--ai a {
	color: var(--accent);
	text-underline-offset: 2px;
}

.ai-md-img {
	display: block;
	max-width: min(100%, 420px);
	margin: 0.55rem 0;
	border-radius: 12px;
	border: 1px solid var(--line);
}

.ai-bubble__text {
	display: block;
}

/* ── Screen share: quieter, less chrome ─────────────────────────── */
.ss-inline {
	padding: 0;
	overflow: hidden;
}

.ss-inline .ss {
	padding: 0.6rem;
}

.ss__bar {
	background: rgb(255 255 255 / 0.035);
	border-color: var(--line);
}

.ss__live {
	padding-right: 0.15rem;
}

.ss__card {
	background: rgb(255 255 255 / 0.025);
}

.ss__q {
	color: var(--text);
}

.ss__feed {
	padding-right: 0.15rem;
}

/* ── Row arrows ─────────────────────────────────────────────────── */
.grow__rail {
	position: relative;
}

.grow__rail .row__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	transform: translateY(-50%);
	border: 1px solid var(--line-2);
	border-radius: 999px;
	background: rgb(12 14 16 / 0.94);
	color: var(--text);
	cursor: pointer;
	opacity: 0;
	transition:
		opacity 0.24s var(--ease),
		background 0.2s var(--ease),
		transform 0.3s var(--spring);
	box-shadow: 0 10px 24px rgb(0 0 0 / 0.45);
}

.grow__rail .row__arrow .lucide {
	width: 16px;
	height: 16px;
}

.grow__rail .row__arrow--prev {
	left: calc(var(--gutter) - 18px);
}

.grow__rail .row__arrow--next {
	right: calc(var(--gutter) - 18px);
}

.grow__rail:hover .row__arrow {
	opacity: 1;
}

.grow__rail .row__arrow:hover {
	background: var(--accent);
	color: var(--accent-ink);
	border-color: transparent;
	transform: translateY(-50%) scale(1.08);
}

.grow__rail .row__arrow.is-off {
	opacity: 0 !important;
	pointer-events: none;
}

/* Titles stay readable without hovering. */
.gtile__name {
	opacity: 1;
	transform: translateY(0);
}

.gtile__glow {
	opacity: 0.75;
}

/* ══ Inline maths ═══════════════════════════════════════════════ */
.math {
	display: inline-flex;
	align-items: center;
	gap: 0.12em;
	flex-wrap: wrap;
	font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
	font-size: 1.06em;
	line-height: 1.5;
	vertical-align: middle;
}

.math--block {
	display: flex;
	justify-content: flex-start;
	width: 100%;
	margin: 0.7rem 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.03);
	overflow-x: auto;
	font-size: 1.12em;
}

.mvar {
	font-style: italic;
	font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
	padding-right: 0.02em;
}

.mword,
.mfn {
	font-style: normal;
}

.mfn {
	margin-right: 0.15em;
	color: var(--text-dim);
}

.mtext {
	font-family: inherit;
	font-style: normal;
	font-size: 0.92em;
}

.mop {
	margin: 0 0.18em;
	font-style: normal;
}

/* Stacked fraction with a real rule between the parts. */
.mfrac {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	vertical-align: middle;
	margin: 0 0.18em;
	text-align: center;
}

.mfrac__n {
	display: block;
	padding: 0 0.3em 0.1em;
	border-bottom: 1.5px solid currentColor;
	line-height: 1.25;
}

.mfrac__d {
	display: block;
	padding: 0.1em 0.3em 0;
	line-height: 1.25;
}

/* Radical with an overline stretching across the body. */
.msqrt {
	display: inline-flex;
	align-items: stretch;
	margin: 0 0.1em;
}

.msqrt__i {
	align-self: flex-start;
	font-size: 0.62em;
	margin-right: -0.35em;
	transform: translateY(-0.1em);
}

.msqrt__r {
	font-size: 1.15em;
	line-height: 1;
	transform: scaleY(1.15);
	transform-origin: bottom;
}

.msqrt__b {
	padding: 0.1em 0.2em 0 0.15em;
	border-top: 1.5px solid currentColor;
	margin-top: 0.12em;
}

.math sup,
.math sub {
	font-size: 0.72em;
	line-height: 0;
}

.math sup {
	vertical-align: super;
}

.math sub {
	vertical-align: sub;
}

/* Streaming: no layout thrash while tokens land. */
.ai-bubble--ai.is-streaming {
	contain: layout paint style;
}
