/* onAI for iPhone: design prototype.
   Tokens are derived from src/onai-theme.css and src/tailwind.css (web app).
   Names map 1:1 to the asset-catalog colours the native app should define (see README). */

@font-face {
	font-family: 'Geist';
	src: url('fonts/Geist-Latin.woff2') format('woff2');
	font-weight: 100 900;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: 'Geist';
	src: url('fonts/Geist-LatinExt.woff2') format('woff2');
	font-weight: 100 900;
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: 'Geist Mono';
	src: url('fonts/GeistMono-Latin.woff2') format('woff2');
	font-weight: 100 900;
}

/* ---------- Tokens ---------- */
:root {
	--font: 'Geist', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
	--font-sys: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Geist', system-ui, sans-serif;
	--mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

	/* Type ramp (iOS text styles, Large / default Dynamic Type size) */
	--t-large: 700 32px/1.12 var(--font);
	--t-title2: 650 22px/1.2 var(--font);
	--t-title3: 600 20px/1.25 var(--font);
	--t-headline: 600 17px/1.3 var(--font);
	--t-body: 400 17px/1.42 var(--font);
	--t-callout: 400 16px/1.38 var(--font);
	--t-sub: 400 15px/1.34 var(--font);
	--t-foot: 400 13px/1.3 var(--font);
	--t-cap: 500 12px/1.25 var(--font);

	--ease: cubic-bezier(0.32, 0.72, 0, 1); /* web --onai-ease-drawer, ~ iOS spring */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);
	--spring: cubic-bezier(0.34, 1.32, 0.5, 1);
}

.theme-light {
	color-scheme: light;
	--bg: #fbfbf9; /* --onai-panel */
	--bg-grouped: #f2f3ef;
	--canvas: #edefea; /* --onai-canvas = gray-100: sidebar */
	--surface: #ffffff;
	--surface-2: #f5f6f3; /* gray-50 */
	--fill: rgba(98, 104, 95, 0.12);
	--fill-2: rgba(98, 104, 95, 0.08);
	--ink: #262a25;
	--ink-2: #62685f;
	--ink-3: #868a82;
	--ink-4: #b3b8ae;
	--line: rgba(30, 40, 30, 0.1);
	--line-strong: rgba(30, 40, 30, 0.16);
	--accent: #22302a;
	--accent-fg: #f1f6ef;
	--bubble: #e6ece3;
	--chip: #f0f2ee;
	--green: #2f7148;
	--green-bg: #e3efe5;
	--warn: #b07a1e;
	--warn-ink: #7f5a12;
	--warn-bg: #fbf3e2;
	--warn-line: #ecd6a6;
	--stop: #b4492f;
	--navy: #163a65; /* logo */
	--glass: rgba(251, 251, 249, 0.72);
	--glass-strong: rgba(255, 255, 255, 0.86);
	--glass-line: rgba(255, 255, 255, 0.75);
	--glass-shadow: 0 8px 28px rgba(28, 36, 26, 0.12), 0 1px 3px rgba(28, 36, 26, 0.08);
	--raise: 0 1px 2px rgba(20, 30, 20, 0.06), 0 0 0 0.5px rgba(30, 40, 30, 0.08);
	--scrim: rgba(17, 22, 16, 0.3);
	--code-bg: #f3f4f0;
	--sage-bg: #dae4cd; --sage-fg: #3d5b30;
	--blue-bg: #dde8f2; --blue-fg: #476c85;
	--clay-bg: #f0e0d6; --clay-fg: #986947;
	--violet-bg: #e9e0f4; --violet-fg: #785b99;
}

.theme-dark {
	color-scheme: dark;
	--bg: #151714;
	--bg-grouped: #0f110e;
	--canvas: #0f110e;
	--surface: #1d201b;
	--surface-2: #232722; /* gray-850 */
	--fill: rgba(165, 174, 160, 0.16);
	--fill-2: rgba(165, 174, 160, 0.1);
	--ink: #eef1ec;
	--ink-2: #a5aea0;
	--ink-3: #7d8579;
	--ink-4: #555b52;
	--line: rgba(220, 235, 220, 0.1);
	--line-strong: rgba(220, 235, 220, 0.16);
	--accent: #dbe8d8;
	--accent-fg: #1a241f;
	--bubble: #2a3128;
	--chip: #232722;
	--green: #7cc395;
	--green-bg: #1f3326;
	--warn: #e0b058;
	--warn-ink: #ecc985;
	--warn-bg: #33291a;
	--warn-line: #5d4a26;
	--stop: #e5826b;
	--navy: #9fc0e8;
	--glass: rgba(30, 33, 28, 0.66);
	--glass-strong: rgba(36, 40, 34, 0.86);
	--glass-line: rgba(255, 255, 255, 0.1);
	--glass-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.4);
	--raise: 0 0 0 0.5px rgba(220, 235, 220, 0.1);
	--scrim: rgba(0, 0, 0, 0.5);
	--code-bg: #1a1d19;
	--sage-bg: #2b3825; --sage-fg: #b6cfa5;
	--blue-bg: #22313f; --blue-fg: #a6c4dc;
	--clay-bg: #3a2a21; --clay-fg: #e2b896;
	--violet-bg: #30283d; --violet-fg: #c9b3e6;
}

/* ---------- Stage (outside the device) ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body.stage {
	font: 400 14px/1.5 var(--font);
	background: #e4e7e1;
	color: #262a25;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 48px;
	min-height: 100vh;
	padding: 24px;
}
body.stage.stage-dark { background: #0b0c0a; color: #dfe4dc; }
body.embed { background: transparent; padding: 0; display: block; min-height: 0; }
body.embed .controls { display: none; }

.controls {
	width: 300px;
	align-self: stretch;
	max-height: calc(100vh - 48px);
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 8px 4px;
}
.controls h1 { font: 650 20px/1.2 var(--font); margin: 0; letter-spacing: -0.01em; }
.controls p { margin: 0; color: #6b7166; font-size: 13px; }
.stage-dark .controls p { color: #8f978b; }
.controls .seg { display: flex; background: rgba(0, 0, 0, 0.06); border-radius: 10px; padding: 3px; }
.stage-dark .controls .seg { background: rgba(255, 255, 255, 0.08); }
.controls .seg button { flex: 1; border: 0; background: none; font: 500 13px var(--font); padding: 7px; border-radius: 8px; color: inherit; cursor: pointer; }
.controls .seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.stage-dark .controls .seg button.on { background: #2a2e28; }
.controls h2 { font: 600 11px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: #868a82; margin: 6px 0 6px; }
.controls .jump { display: flex; flex-direction: column; gap: 1px; }
.controls .jump button { text-align: left; border: 0; background: none; font: 400 13.5px var(--font); color: inherit; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.controls .jump button:hover { background: rgba(0, 0, 0, 0.05); }
.stage-dark .controls .jump button:hover { background: rgba(255, 255, 255, 0.06); }
.controls .jump button.on { background: #22302a; color: #f1f6ef; }
.controls a { color: inherit; font-weight: 550; }
.controls kbd { font: 500 11px var(--mono); background: rgba(0, 0, 0, 0.06); padding: 1px 5px; border-radius: 4px; }

/* ---------- Device frame (iPhone 17 Pro: 402 × 874 pt) ---------- */
.device {
	position: relative;
	width: 426px;
	height: 898px;
	border-radius: 70px;
	padding: 12px;
	background: linear-gradient(145deg, #4a4d4a, #1f211f 30%, #2c2e2c 70%, #535653);
	box-shadow:
		0 0 0 1.5px #77797a inset,
		0 0 0 4px #121312 inset,
		0 30px 80px rgba(0, 0, 0, 0.28),
		0 6px 18px rgba(0, 0, 0, 0.18);
	flex-shrink: 0;
}
body.embed .device { box-shadow: 0 0 0 1.5px #77797a inset, 0 0 0 4px #121312 inset; }
.device::before, .device::after { /* side buttons */
	content: '';
	position: absolute;
	width: 4px;
	border-radius: 2px;
	background: #3a3c3a;
}
.device::before { left: -3px; top: 190px; height: 64px; box-shadow: 0 84px 0 #3a3c3a; }
.device::after { right: -3px; top: 240px; height: 100px; }

.screen {
	position: relative;
	width: 402px;
	height: 874px;
	border-radius: 58px;
	overflow: hidden;
	background: var(--canvas);
	color: var(--ink);
	font: var(--t-body);
	letter-spacing: -0.005em;
	-webkit-font-smoothing: antialiased;
	isolation: isolate;
	user-select: none;
	-webkit-user-select: none;
}
:where(.screen) button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
:where(.screen) input, :where(.screen) textarea { font: inherit; color: inherit; border: 0; background: none; outline: none; padding: 0; resize: none; }
.screen ::-webkit-scrollbar { display: none; }

/* Status bar + Dynamic Island + home indicator */
.statusbar {
	position: absolute;
	inset: 0 0 auto 0;
	height: 54px;
	z-index: 90;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 34px 0 52px;
	font: 600 17px/1 var(--font-sys);
	letter-spacing: -0.01em;
	pointer-events: none;
	color: var(--ink);
	transition: color 0.3s;
}
.statusbar.light-content { color: #fff; }
.statusbar .right { display: flex; gap: 6px; align-items: center; }
.statusbar svg { display: block; }
.island {
	position: absolute;
	top: 11px;
	left: 50%;
	width: 126px;
	height: 37px;
	margin-left: -63px;
	border-radius: 20px;
	background: #000;
	z-index: 95;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 8px;
	transition: width 0.45s var(--spring), margin-left 0.45s var(--spring);
	pointer-events: auto;
	cursor: pointer;
}
.island .la { opacity: 0; transition: opacity 0.2s; display: flex; align-items: center; gap: 6px; }
.island.live { width: 196px; margin-left: -98px; }
.island.live .la { opacity: 1; transition-delay: 0.18s; }
.island .la-avatar { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; }
.island .la-text { font: 600 12px/1 var(--font); color: #b6cfa5; }
.island .ring { width: 22px; height: 22px; }
.home-ind {
	position: absolute;
	bottom: 8px;
	left: 50%;
	width: 140px;
	height: 5px;
	margin-left: -70px;
	border-radius: 3px;
	background: var(--ink);
	z-index: 96;
	pointer-events: none;
	opacity: 0.9;
}
.home-ind.light { background: #fff; }

/* ---------- App shell ---------- */
.sidebar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 330px;
	background: var(--canvas);
	z-index: 1;
	display: flex;
	flex-direction: column;
	padding-top: 58px;
	transform: translateX(calc(-30% * (1 - var(--p, 0))));
	opacity: calc(0.4 + 0.6 * var(--p, 0));
}
.app {
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--bg);
	transform: translateX(calc(330px * var(--p, 0)));
	border-radius: calc(58px * min(1, var(--p, 0) * 8));
	overflow: hidden;
	box-shadow: -1px 0 0 var(--line), -12px 0 40px rgba(0, 0, 0, calc(0.12 * var(--p, 0)));
}
.screen.animating .app, .screen.animating .sidebar, .screen.animating .app-dim { transition: transform 0.42s var(--ease), opacity 0.42s var(--ease), border-radius 0.42s var(--ease), box-shadow 0.42s var(--ease); }
.app-dim {
	position: absolute;
	inset: 0;
	z-index: 80;
	background: var(--scrim);
	opacity: var(--p, 0);
	pointer-events: none;
}
.screen.sidebar-open .app-dim { pointer-events: auto; }
.screen.sheet-big .app { transform: scale(0.92) translateY(14px); border-radius: 40px; transition: transform 0.45s var(--ease), border-radius 0.45s var(--ease); }
.screen .app { transition: transform 0.45s var(--ease), border-radius 0.45s var(--ease); }
.screen.dragging .app, .screen.dragging .sidebar { transition: none !important; }

.edge-zone { position: absolute; left: 0; top: 60px; bottom: 90px; width: 22px; z-index: 70; }

.tabs { position: absolute; inset: 0; }
.tab { position: absolute; inset: 0; display: none; overflow: hidden; background: var(--bg); }
.tab.active { display: block; }
.page {
	position: absolute;
	inset: 0;
	background: var(--bg);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	will-change: transform;
}
.page.under { transform: translateX(-30%); }
.page.under::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.08); }
.page.offright { transform: translateX(100%); }
.page.slide { transition: transform 0.45s var(--ease); }
.page.pushed { box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12); }

.scroll {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	position: relative;
}
.scroll.pad-top { padding-top: 104px; }
.scroll.pad-bottom { padding-bottom: 120px; }

/* ---------- Glass ---------- */
.glass {
	background: var(--glass);
	-webkit-backdrop-filter: blur(22px) saturate(180%);
	backdrop-filter: blur(22px) saturate(180%);
	box-shadow: var(--glass-shadow), inset 0 0 0 0.5px var(--glass-line), inset 0 1px 0 var(--glass-line);
}

/* Navigation bar */
.navbar {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 20;
	padding: 56px 16px 8px;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 104px;
	pointer-events: none;
}
.navbar > * { pointer-events: auto; }
.navbar.fade::before {
	content: '';
	position: absolute;
	inset: 0 0 -28px 0;
	background: linear-gradient(var(--bg) 40%, color-mix(in srgb, var(--bg) 70%, transparent) 75%, color-mix(in srgb, var(--bg) 0%, transparent));
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	-webkit-mask-image: linear-gradient(#000 70%, transparent);
	mask-image: linear-gradient(#000 70%, transparent);
	z-index: -1;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s;
}
.navbar.fade.scrolled::before { opacity: 1; }
/* Bottom scroll-edge effect under the floating tab bar (iOS 26) */
.bottom-edge {
	position: absolute;
	inset: auto 0 0 0;
	height: 130px;
	z-index: 30;
	pointer-events: none;
	background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), color-mix(in srgb, var(--bg) 85%, transparent) 60%, var(--bg));
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	-webkit-mask-image: linear-gradient(transparent, #000 45%);
	mask-image: linear-gradient(transparent, #000 45%);
	transition: opacity 0.3s;
}
.bottom-edge.off { opacity: 0; }
.navbar .title { flex: 1; text-align: center; font: var(--t-headline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar .title small { display: block; font: 500 12px/1.2 var(--font); color: var(--ink-2); }
.navbar .spacer { flex: 1; }
.gbtn { /* circular glass button (iOS 26 bar button) */
	width: 44px;
	height: 44px;
	border-radius: 22px;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	color: var(--ink);
}
.gbtn.glass, .gpill.glass { background: var(--glass-strong); }
.gpill { height: 44px; border-radius: 22px; display: flex; align-items: center; gap: 2px; padding: 0 4px; }
.gpill .gbtn { width: 40px; }
.gbtn svg, .gpill svg { width: 22px; height: 22px; }
.gbtn.accent { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.gtext { height: 44px; padding: 0 16px; border-radius: 22px; font: 600 16px var(--font); display: flex; align-items: center; gap: 6px; }
.gtext.accent { background: var(--accent); color: var(--accent-fg); }

.largetitle { padding: 104px 20px 6px; font: var(--t-large); letter-spacing: -0.02em; }
.largetitle small { display: block; font: 500 14px/1.3 var(--font); color: var(--ink-2); letter-spacing: 0; margin-top: 4px; }

/* ---------- Tab bar (Liquid Glass, floating) ---------- */
.tabbar {
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 26px;
	height: 64px;
	border-radius: 32px;
	z-index: 40;
	display: flex;
	padding: 4px;
	transition: left 0.42s var(--ease), right 0.42s var(--ease), transform 0.4s var(--ease), opacity 0.3s;
}
.tabbar button {
	flex: 1;
	border-radius: 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	font: 600 10.5px/1 var(--font);
	color: var(--ink);
	position: relative;
	transition: color 0.2s;
}
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.on { background: var(--fill-2); color: var(--green); }
.theme-dark .tabbar button.on { background: rgba(255, 255, 255, 0.1); }
.tabbar .badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--stop); color: #fff; font: 700 11px/17px var(--font); padding: 0 5px; }
.tabbar.min { right: calc(100% - 18px - 64px); }
.tabbar.min button:not(.on) { display: none; }
.tabbar.min button.on { background: none; }
.tabbar.min button span { display: none; }
.tabbar.hidden { transform: translateY(130px); }

/* Bottom accessory (composer) sitting above / beside the tab bar */
.accessory {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 98px;
	z-index: 41;
	transition: left 0.42s var(--ease), bottom 0.42s var(--ease);
}
.accessory.inline { left: 92px; bottom: 26px; }
.fade-bottom {
	position: absolute;
	inset: auto 0 0 0;
	height: 190px;
	background: linear-gradient(color-mix(in srgb, var(--bg) 0%, transparent), var(--bg) 70%);
	pointer-events: none;
	z-index: 30;
}

/* ---------- Common atoms ---------- */
.ico { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.ico.s { width: 18px; height: 18px; }
.ico.xs { width: 15px; height: 15px; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-h { font: 600 13px/1.2 var(--font); color: var(--ink-2); padding: 22px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.section-h button { font: 500 14px var(--font); color: var(--green); }
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 13px;
	border-radius: 17px;
	background: var(--surface);
	box-shadow: var(--raise);
	font: 500 14px/1 var(--font);
	white-space: nowrap;
	flex-shrink: 0;
}
.chip.on { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.chip.soft { background: var(--chip); box-shadow: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px; scrollbar-width: none; }
.badge-s { font: 600 11px/1 var(--font); padding: 4px 7px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.badge-s .ico { width: 12px; height: 12px; }
.badge-s.green { background: var(--green-bg); color: var(--green); }
.badge-s.warn { background: var(--warn-bg); color: var(--warn-ink); }
.price { font: 600 14px/1 var(--font); letter-spacing: 0.06em; color: var(--ink-2); white-space: nowrap; }
.price b { color: var(--ink); font-weight: 600; }
.btn {
	height: 50px;
	border-radius: 25px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font: 600 17px var(--font);
	width: 100%;
}
.btn.primary { background: var(--accent); color: var(--accent-fg); }
.btn.secondary { background: var(--fill-2); color: var(--ink); }
.btn.outline { background: var(--surface); box-shadow: var(--raise); }
.btn.sm { height: 38px; font-size: 15px; width: auto; padding: 0 16px; border-radius: 19px; }
.btn.danger { color: var(--stop); }

.avatar {
	width: 32px;
	height: 32px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	font-size: 18px;
	line-height: 1;
	flex-shrink: 0;
	background: var(--sage-bg);
	color: var(--sage-fg);
}
.avatar.blue { background: var(--blue-bg); color: var(--blue-fg); }
.avatar.clay { background: var(--clay-bg); color: var(--clay-fg); }
.avatar.violet { background: var(--violet-bg); color: var(--violet-fg); }
.avatar.human { background: var(--accent); color: var(--accent-fg); font: 600 13px var(--font); border-radius: 50%; }
.avatar.lg { width: 44px; height: 44px; border-radius: 13px; font-size: 24px; }
.avatar.round { border-radius: 50%; }

/* Inset grouped list */
.list { margin: 0 16px; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: var(--raise); }
.list .item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; position: relative; }
.list .item + .item::before { content: ''; position: absolute; top: 0; right: 0; left: 52px; height: 0.5px; background: var(--line-strong); }
.list.plain .item + .item::before { left: 16px; }
.list .item .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--chip); color: var(--ink); }
.list .item .ic svg { width: 18px; height: 18px; }
.list .item .ic.green { background: var(--green); color: #fff; }
.list .item .ic.accent { background: var(--accent); color: var(--accent-fg); }
.list .item .ic.blue { background: #4a78a6; color: #fff; }
.list .item .ic.clay { background: #b77b4f; color: #fff; }
.list .item .ic.violet { background: #8a6bb0; color: #fff; }
.list .item .ic.warn { background: #c8922c; color: #fff; }
.list .item .ic.gray { background: #8d9389; color: #fff; }
.list .item .ic.red { background: #c25b44; color: #fff; }
.list .item .val { color: var(--ink-2); font: var(--t-callout); white-space: nowrap; }
.list .item .chev { color: var(--ink-4); width: 14px; height: 14px; }
.list .item .t { font: var(--t-body); }
.list .item .s { font: var(--t-foot); color: var(--ink-2); margin-top: 1px; }
.list-foot { font: var(--t-foot); color: var(--ink-2); padding: 8px 32px 0; }
.toggle { width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex-shrink: 0; transition: background 0.2s; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); transition: transform 0.25s var(--spring); }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(20px); }

.segmented { display: flex; background: var(--fill-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button { flex: 1; height: 34px; border-radius: 9px; font: 500 14px var(--font); color: var(--ink); }
.segmented button.on { background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 0 0 0.5px var(--line); font-weight: 600; }
.theme-dark .segmented button.on { background: #3a4037; }

/* ---------- Sheets ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 85; pointer-events: none; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity 0.4s var(--ease); }
.sheet-layer.open { pointer-events: auto; }
.sheet-layer.open .sheet-backdrop { opacity: 1; }
.sheet {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	border-radius: 42px;
	background: var(--glass-strong);
	-webkit-backdrop-filter: blur(30px) saturate(180%);
	backdrop-filter: blur(30px) saturate(180%);
	box-shadow: 0 -2px 40px rgba(0, 0, 0, 0.18), inset 0 0 0 0.5px var(--glass-line);
	transform: translateY(110%);
	transition: transform 0.5s var(--ease), left 0.4s var(--ease), right 0.4s var(--ease), bottom 0.4s var(--ease), border-radius 0.4s var(--ease);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	max-height: calc(100% - 60px);
}
.theme-light .sheet { background: rgba(250, 251, 248, 0.94); }
.theme-dark .sheet { background: rgba(32, 35, 30, 0.95); }
.sheet.large { left: 0; right: 0; bottom: 0; top: 64px; max-height: none; border-radius: 40px 40px 0 0; background: var(--bg); }
.sheet.show { transform: translateY(0); }
.sheet.dragging { transition: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--ink-4); margin: 6px auto 0; flex-shrink: 0; opacity: 0.7; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px 6px; flex-shrink: 0; touch-action: none; }
.sheet-head .title { flex: 1; text-align: center; font: var(--t-headline); }
.sheet-head .gbtn { width: 40px; height: 40px; background: var(--fill-2); }
.sheet-body { overflow-y: auto; padding: 4px 0 28px; scrollbar-width: none; flex: 1; }

/* Context menu */
.ctx-layer { position: absolute; inset: 0; z-index: 88; display: none; }
.ctx-layer.open { display: block; }
.ctx-blur { position: absolute; inset: 0; background: rgba(120, 125, 118, 0.18); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); animation: fadein 0.25s both; }
.theme-dark .ctx-blur { background: rgba(0, 0, 0, 0.35); }
.ctx-preview { position: absolute; left: 16px; right: 16px; animation: lift 0.35s var(--spring) both; }
.ctx-menu {
	position: absolute;
	width: 250px;
	border-radius: 22px;
	overflow: hidden;
	background: var(--glass-strong);
	-webkit-backdrop-filter: blur(30px) saturate(180%);
	backdrop-filter: blur(30px) saturate(180%);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22), inset 0 0 0 0.5px var(--glass-line);
	animation: pop 0.32s var(--spring) both;
	transform-origin: top left;
}
.theme-light .ctx-menu { background: rgba(250, 251, 248, 0.92); }
.ctx-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 18px; font: var(--t-body); text-align: left; }
.ctx-menu button + button { border-top: 0.5px solid var(--line); }
.ctx-menu .sep { height: 8px; background: var(--fill-2); }
.ctx-menu button.red { color: var(--stop); }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes lift { from { transform: scale(0.96); } to { transform: scale(1.02); } }

/* Toast / HUD */
.toast { position: absolute; top: 60px; left: 50%; transform: translate(-50%, -160px); opacity: 0; z-index: 92; padding: 10px 18px; border-radius: 22px; font: 600 14px var(--font); display: flex; gap: 8px; align-items: center; transition: transform 0.45s var(--spring); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast { transition: transform 0.45s var(--spring), opacity 0.3s; }

/* ---------- Sidebar content ---------- */
.sb-top { display: flex; gap: 8px; padding: 0 14px 8px; align-items: center; }
.sb-search { flex: 1; height: 44px; border-radius: 22px; background: var(--fill-2); display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--ink-2); font: var(--t-body); }
.theme-light .sb-search { background: rgba(255, 255, 255, 0.7); box-shadow: var(--raise); }
.sb-search input { flex: 1; color: var(--ink); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: none; }
.sb-nav { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; font: 500 16px var(--font); width: 100%; text-align: left; }
.sb-nav svg { width: 21px; height: 21px; color: var(--ink-2); }
.sb-nav .count { margin-left: auto; font: 500 13px var(--font); color: var(--ink-3); }
.sb-group { font: 600 12.5px/1 var(--font); color: var(--ink-3); padding: 18px 12px 8px; display: flex; justify-content: space-between; align-items: center; }
.sb-chat { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 12px; font: 400 15.5px var(--font); width: 100%; text-align: left; color: var(--ink); }
.sb-chat span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-chat.active { background: var(--surface); box-shadow: var(--raise); font-weight: 500; }
.theme-dark .sb-chat.active { background: var(--surface-2); }
.sb-chat .pin { width: 13px; height: 13px; color: var(--ink-3); }
.sb-chat .folder { width: 19px; height: 19px; color: var(--ink-2); }
.sb-chat .kind { width: 16px; height: 16px; color: var(--ink-3); }
.sb-foot { padding: 8px 12px 34px; display: flex; flex-direction: column; gap: 8px; border-top: 0.5px solid var(--line); }
.balance { border-radius: 16px; padding: 11px 13px; background: var(--fill-2); display: flex; flex-direction: column; gap: 7px; }
.theme-light .balance { background: rgba(255, 255, 255, 0.6); box-shadow: var(--raise); }
.balance .meter { height: 5px; border-radius: 3px; background: rgba(30, 40, 30, 0.09); overflow: hidden; }
.theme-dark .balance .meter { background: rgba(220, 235, 220, 0.12); }
.balance .meter i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.usercard { display: flex; align-items: center; gap: 10px; padding: 6px 4px; width: 100%; text-align: left; }
.usercard .photo { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.mark { mark-style: none; background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- Chat ---------- */
.chat-scroll { padding: 110px 0 210px; }
.msg-user { display: flex; flex-direction: column; align-items: flex-end; padding: 6px 16px 6px 64px; gap: 6px; }
.bubble { background: var(--bubble); color: var(--ink); border-radius: 22px 22px 8px 22px; padding: 10px 15px; font: var(--t-body); max-width: 100%; }
.attach-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--surface); box-shadow: var(--raise); max-width: 260px; }
.attach-card .fi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; font: 700 10px var(--font); }
.fi.xls { background: #2f7148; } .fi.pdf { background: #b4492f; } .fi.doc { background: #3f6a96; } .fi.img { background: #8a6bb0; }
.attach-card b { font: 500 14px/1.25 var(--font); display: block; }
.attach-card small { font: var(--t-foot); color: var(--ink-2); }
.msg-ai { padding: 10px 20px 4px; }
.ai-meta { display: flex; align-items: center; gap: 8px; font: 500 13px var(--font); color: var(--ink-2); margin-bottom: 6px; }
.ai-meta .logo-dot { width: 22px; height: 22px; }
.step { display: flex; align-items: center; gap: 8px; font: 500 14px var(--font); color: var(--ink-2); padding: 3px 0; }
.step svg { width: 16px; height: 16px; }
.shimmer { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink) 45%, var(--ink-3) 70%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -100% 0; } }
.md { font: var(--t-body); color: var(--ink); }
.md p { margin: 0 0 12px; }
.md h3 { font: 650 19px/1.3 var(--font); margin: 18px 0 8px; letter-spacing: -0.01em; }
.md ul { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--ink-3); }
.md strong { font-weight: 620; }
.md code { font: 450 14.5px var(--mono); background: var(--code-bg); padding: 1px 5px; border-radius: 6px; }
.md .table-wrap { margin: 4px -20px 14px; overflow-x: auto; padding: 0 20px; scrollbar-width: none; }
.md table { border-collapse: separate; border-spacing: 0; font: 400 15px/1.35 var(--font); min-width: 100%; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 0.5px var(--line-strong); background: var(--surface); }
.md th { text-align: left; font: 600 13px var(--font); color: var(--ink-2); background: var(--surface-2); padding: 9px 12px; white-space: nowrap; }
.md td { padding: 9px 12px; border-top: 0.5px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.md td.num, .md th.num { text-align: right; }
.md pre { margin: 4px 0 14px; border-radius: 16px; background: var(--code-bg); box-shadow: inset 0 0 0 0.5px var(--line); overflow: hidden; }
.md pre .code-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 0 14px; font: 500 12.5px var(--font); color: var(--ink-2); }
.md pre .code-head button { display: flex; gap: 5px; align-items: center; font: 500 12.5px var(--font); color: var(--ink-2); padding: 4px 6px; }
.md pre code { display: block; background: none; padding: 8px 14px 14px; font: 400 13.5px/1.6 var(--mono); white-space: pre; overflow-x: auto; scrollbar-width: none; }
.tok-k { color: #8a4bb0; } .tok-s { color: #2f7148; } .tok-f { color: #3f6a96; } .tok-n { color: #b06a1e; }
.theme-dark .tok-k { color: #c9a4ee; } .theme-dark .tok-s { color: #9fd3a9; } .theme-dark .tok-f { color: #9cc1e6; } .theme-dark .tok-n { color: #e9b77a; }
.cite { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--chip); color: var(--ink-2); font: 600 11px/1 var(--font); vertical-align: 2px; margin-left: 2px; box-shadow: inset 0 0 0 0.5px var(--line-strong); }
.sources { display: flex; gap: 8px; overflow-x: auto; margin: 2px -20px 8px; padding: 0 20px; scrollbar-width: none; }
.source { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 7px; border-radius: 14px; background: var(--surface); box-shadow: var(--raise); font: 500 13px var(--font); white-space: nowrap; }
.source .n { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--chip); font: 600 11px var(--font); color: var(--ink-2); }
.msg-actions { display: flex; gap: 2px; margin: 2px -10px 0; color: var(--ink-2); }
.msg-actions button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 19px; }
.msg-actions svg { width: 19px; height: 19px; }
.cursor { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); vertical-align: 1px; margin-left: 3px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.6); opacity: 0.5; } }
.followups { display: flex; flex-direction: column; gap: 8px; padding: 8px 20px 0; }
.followups button { text-align: left; padding: 11px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--raise); font: var(--t-sub); display: flex; align-items: center; gap: 10px; }

/* Composer */
.composer {
	border-radius: 28px;
	padding: 6px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.composer .field { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.composer.one .field { min-height: 40px; }
.composer .field .ph { flex: 1; font: var(--t-body); color: var(--ink-3); padding: 0 6px; }
.composer .field .txt { flex: 1; font: var(--t-body); color: var(--ink); padding: 0 6px; }
.composer .cbtn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--ink); flex-shrink: 0; }
.composer .cbtn svg { width: 22px; height: 22px; }
.composer .cbtn.plus { background: var(--fill-2); }
.composer .send { width: 40px; height: 40px; border-radius: 20px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; flex-shrink: 0; }
.composer .send svg { width: 20px; height: 20px; }
.composer .tools { display: flex; gap: 6px; padding: 2px 2px 2px; }
.composer .tchip { height: 32px; border-radius: 16px; padding: 0 11px; display: flex; align-items: center; gap: 5px; font: 500 13.5px var(--font); background: var(--fill-2); color: var(--ink); }
.composer .tchip.on { background: var(--green-bg); color: var(--green); }
.composer .tchip svg { width: 16px; height: 16px; }
.composer .pending-files { display: flex; gap: 8px; padding: 4px 4px 6px; overflow-x: auto; }
.composer .pfile { display: flex; align-items: center; gap: 8px; background: var(--surface); border-radius: 14px; padding: 6px 10px 6px 6px; box-shadow: var(--raise); font: 500 13px var(--font); flex-shrink: 0; }
.composer .pfile .fi { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font: 700 9px var(--font); }

.empty-hero { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 28px 180px; text-align: center; }
.empty-hero h2 { font: 600 27px/1.2 var(--font); letter-spacing: -0.02em; margin: 18px 0 6px; }
.empty-hero p { margin: 0; color: var(--ink-2); font: var(--t-callout); }
.starter-grid { position: absolute; left: 0; right: 0; bottom: 232px; display: flex; gap: 10px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.starter { flex-shrink: 0; width: 178px; text-align: left; padding: 13px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--raise); display: flex; flex-direction: column; gap: 3px; }
.starter b { font: 600 15px/1.25 var(--font); }
.starter span { font: var(--t-foot); color: var(--ink-2); }

.model-btn { display: flex; align-items: center; gap: 5px; height: 44px; padding: 0 14px 0 16px; border-radius: 22px; font: 600 16px var(--font); }
.model-btn svg { width: 14px; height: 14px; color: var(--ink-2); }

/* Model picker rows */
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 60px; position: relative; width: 100%; text-align: left; }
.mrow + .mrow::before { content: ''; position: absolute; top: 0; left: 64px; right: 0; height: 0.5px; background: var(--line-strong); }
.mlogo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font: 700 14px var(--font); color: #fff; flex-shrink: 0; }
.mrow .check { color: var(--green); }

/* ---------- Bots ---------- */
.needs-card { margin: 4px 16px 0; padding: 14px; border-radius: 22px; background: var(--warn-bg); box-shadow: inset 0 0 0 0.5px var(--warn-line); display: flex; flex-direction: column; gap: 10px; }
.needs-card .row b { font: 600 15px var(--font); }
.needs-card p { margin: 0; font: var(--t-sub); color: var(--ink); }
.portrait-rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 20px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.portrait {
	position: relative;
	flex-shrink: 0;
	width: 228px;
	height: 300px;
	border-radius: 30px;
	overflow: hidden;
	scroll-snap-align: start;
	color: #fff;
	text-align: left;
	box-shadow: 0 10px 30px rgba(20, 30, 20, 0.16);
}
.portrait .art { position: absolute; inset: 0; }
.portrait .art svg { width: 100%; height: 100%; display: block; }
.portrait .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 16px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
.portrait .info b { font: 650 24px/1.1 var(--font); letter-spacing: -0.02em; display: block; }
.portrait .info span { font: 500 14px var(--font); opacity: 0.85; }
.portrait .status { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 15px; font: 600 12.5px var(--font); color: #fff; background: rgba(0, 0, 0, 0.28); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.portrait .status i { width: 8px; height: 8px; border-radius: 50%; background: #8ee0a8; box-shadow: 0 0 0 3px rgba(142, 224, 168, 0.3); animation: pulse 1.4s infinite; }
.portrait .status.warn i { background: #f3c766; box-shadow: 0 0 0 3px rgba(243, 199, 102, 0.3); animation: none; }
.portrait .status.idle i { background: #d6dbd2; box-shadow: none; animation: none; }
.portrait .progress { margin-top: 10px; display: flex; gap: 3px; }
.portrait .progress i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.portrait .progress i.done { background: #fff; }
.portrait .progress i.now { background: linear-gradient(90deg, #fff 50%, rgba(255, 255, 255, 0.3) 50%); }
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.team-card { border-radius: 24px; background: var(--surface); box-shadow: var(--raise); overflow: hidden; text-align: left; display: flex; flex-direction: column; }
.team-card .art { height: 104px; position: relative; }
.team-card .art svg { width: 100%; height: 100%; display: block; }
.team-card .body { padding: 10px 13px 13px; }
.team-card b { font: 600 16px/1.2 var(--font); display: block; }
.team-card span { font: var(--t-foot); color: var(--ink-2); }
.team-card .meta { margin-top: 8px; display: flex; gap: 6px; align-items: center; font: 500 12px var(--font); color: var(--ink-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); display: inline-block; }
.dot.green { background: var(--green); } .dot.warn { background: var(--warn); }

.bot-header-art { position: absolute; inset: 0 0 auto 0; height: 220px; z-index: 0; opacity: 0.28; pointer-events: none; -webkit-mask-image: linear-gradient(#000 20%, transparent); mask-image: linear-gradient(#000 20%, transparent); }
.bot-header-art svg { width: 100%; height: 100%; }
.bot-title { display: flex; flex-direction: column; align-items: center; gap: 0; }
.bot-title .faces { display: flex; }
.bot-title .faces .avatar { width: 26px; height: 26px; font-size: 14px; border-radius: 8px; box-shadow: 0 0 0 2px var(--bg); }
.bot-title .faces .avatar + .avatar { margin-left: -6px; }
.bot-title b { font: 600 15px/1.2 var(--font); display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.bot-title small { font: 500 11.5px var(--font); color: var(--ink-2); }
.bmsg { display: flex; gap: 10px; padding: 8px 16px; }
.bmsg .who { font: 600 14px var(--font); display: flex; gap: 6px; align-items: baseline; margin-bottom: 3px; }
.bmsg .who small { font: 400 12px var(--font); color: var(--ink-3); }
.bmsg .text { font: var(--t-callout); }
.bmsg .text p { margin: 0 0 8px; }
.mention { color: var(--green); font-weight: 600; }
.run-card { margin: 8px 0 4px; border-radius: 22px; background: var(--surface); box-shadow: var(--raise); overflow: hidden; }
.run-card .rc-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px 4px; }
.run-card .rc-head b { font: 600 15px var(--font); }
.run-card .rc-state { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px var(--font); color: var(--green); }
.run-card .rc-state i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.2s infinite; }
.run-card .plan { list-style: none; margin: 0; padding: 6px 14px 10px; display: flex; flex-direction: column; gap: 7px; }
.run-card .plan li { display: flex; gap: 10px; align-items: flex-start; font: var(--t-sub); }
.run-card .plan li .mk { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; margin-top: 0; }
.run-card .plan li.done { color: var(--ink-2); }
.run-card .plan li.done .mk { background: var(--green); color: #fff; }
.run-card .plan li.now { font-weight: 550; }
.run-card .plan li.now .mk { box-shadow: inset 0 0 0 2px var(--green); }
.run-card .plan li.now .mk::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 1.2s infinite; }
.run-card .plan li.todo { color: var(--ink-3); }
.run-card .plan li.todo .mk { box-shadow: inset 0 0 0 1.5px var(--ink-4); }
.run-card .computer { margin: 0 14px 10px; border-radius: 14px; overflow: hidden; position: relative; box-shadow: inset 0 0 0 0.5px var(--line-strong); }
.run-card .computer svg { display: block; width: 100%; height: auto; }
.run-card .computer .live { position: absolute; top: 8px; left: 8px; background: rgba(0, 0, 0, 0.55); color: #fff; font: 600 11px var(--font); padding: 4px 8px; border-radius: 10px; display: flex; gap: 5px; align-items: center; }
.run-card .computer .live i { width: 6px; height: 6px; border-radius: 50%; background: #ff5d4a; }
.run-card .rc-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 0.5px solid var(--line); font: 500 13px var(--font); color: var(--ink-2); }
.run-card .rc-foot button { color: var(--stop); font: 600 14px var(--font); display: flex; align-items: center; gap: 4px; }
.run-card.attention { background: var(--warn-bg); box-shadow: inset 0 0 0 0.5px var(--warn-line); }
.run-card.attention .rc-state { color: var(--warn-ink); }
.run-card.attention .rc-state i { animation: none; }
.approval-body { padding: 4px 14px 14px; }
.approval-body h4 { margin: 4px 0 4px; font: 600 16px var(--font); }
.approval-body p { margin: 0 0 10px; font: var(--t-sub); color: var(--ink-2); }
.approval-action { border-radius: 14px; background: var(--surface); padding: 10px 12px; display: flex; gap: 10px; align-items: center; box-shadow: var(--raise); margin-bottom: 12px; }
.approval-action .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: #3f6a96; color: #fff; font: 700 12px var(--font); }
.approval-action b { font: 600 14.5px var(--font); display: block; }
.approval-action small { font: var(--t-foot); color: var(--ink-2); }
.handoff { display: flex; align-items: center; gap: 10px; margin: 10px 20px; font: 500 13px var(--font); color: var(--ink-2); }
.handoff::before, .handoff::after { content: ''; flex: 1; height: 0.5px; background: var(--line-strong); }
.handoff .avatar { width: 20px; height: 20px; font-size: 11px; border-radius: 6px; }

.profile-hero { position: relative; height: 380px; overflow: hidden; color: #fff; }
.profile-hero .art { position: absolute; inset: 0; }
.profile-hero .art svg { width: 100%; height: 100%; display: block; }
.profile-hero .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 20px 18px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.42)); padding-top: 80px; }
.profile-hero h1 { margin: 0; font: 700 34px/1.05 var(--font); letter-spacing: -0.025em; }
.profile-hero .role { font: 500 16px var(--font); opacity: 0.9; margin-top: 4px; }
.profile-hero .tags { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.profile-hero .tags span { font: 600 12px var(--font); padding: 6px 10px; border-radius: 13px; background: rgba(255, 255, 255, 0.2); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 16px 4px; }
.quick-actions button { border-radius: 18px; background: var(--surface); box-shadow: var(--raise); padding: 11px 0 9px; display: flex; flex-direction: column; align-items: center; gap: 5px; font: 500 12.5px var(--font); color: var(--ink); }
.quick-actions svg { width: 22px; height: 22px; color: var(--green); }
.memory-chip { display: block; padding: 10px 14px; border-radius: 16px; background: var(--chip); font: var(--t-sub); margin: 0 0 8px; }
.app-icons { display: flex; gap: -6px; }
.app-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; font: 700 11px var(--font); box-shadow: 0 0 0 2px var(--surface); }
.app-ic + .app-ic { margin-left: -6px; }

/* Create bot */
.avatar-picker { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 18px; }
.avatar-picker .big { width: 112px; height: 112px; border-radius: 34px; overflow: hidden; box-shadow: 0 10px 30px rgba(20, 30, 20, 0.18); }
.avatar-picker .big svg { width: 100%; height: 100%; }
.swatches { display: flex; gap: 12px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; position: relative; }
.swatches button.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--ink); }
.symbols { display: flex; gap: 8px; }
.symbols button { width: 44px; height: 44px; border-radius: 13px; background: var(--fill-2); font-size: 22px; display: grid; place-items: center; }
.symbols button.on { background: var(--accent); color: var(--accent-fg); }
.field-card { margin: 0 16px 0; background: var(--surface); border-radius: 22px; box-shadow: var(--raise); overflow: hidden; }
.field-card .f { padding: 11px 16px; position: relative; }
.field-card .f + .f::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--line-strong); }
.field-card label { display: block; font: 500 12.5px var(--font); color: var(--ink-2); margin-bottom: 3px; }
.field-card .v { font: var(--t-body); }
.field-card .v.ph { color: var(--ink-3); }
.field-card .v.multi { font: var(--t-callout); line-height: 1.45; }

/* ---------- Image Studio ---------- */
.prompt-card { margin: 0 16px; border-radius: 26px; background: var(--surface); box-shadow: var(--raise); padding: 14px 16px 10px; }
.prompt-card .ptxt { font: var(--t-body); min-height: 96px; }
.prompt-card .pbar { display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.ref-thumb { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.ref-thumb svg { width: 100%; height: 100%; display: block; }
.model-rail { display: flex; gap: 10px; overflow-x: auto; padding: 2px 20px 4px; scrollbar-width: none; }
.model-card { flex-shrink: 0; width: 140px; border-radius: 20px; background: var(--surface); box-shadow: var(--raise); overflow: hidden; text-align: left; position: relative; }
.model-card .thumb { height: 92px; }
.model-card .thumb svg { width: 100%; height: 100%; display: block; }
.model-card .mc-body { padding: 8px 11px 10px; }
.model-card b { font: 600 14px/1.2 var(--font); display: block; }
.model-card small { font: 500 12px var(--font); color: var(--ink-2); display: flex; justify-content: space-between; margin-top: 3px; }
.model-card.on { box-shadow: 0 0 0 2.5px var(--green); }
.model-card .tick { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.model-card .tick svg { width: 14px; height: 14px; }
.ratio-row { display: flex; gap: 8px; padding: 0 20px; }
.ratio { flex: 1; height: 62px; border-radius: 16px; background: var(--surface); box-shadow: var(--raise); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font: 500 12.5px var(--font); }
.ratio i { display: block; border: 1.6px solid var(--ink-2); border-radius: 3px; }
.ratio.on { background: var(--accent); color: var(--accent-fg); box-shadow: none; }
.ratio.on i { border-color: var(--accent-fg); }
.gen-bar { position: absolute; left: 16px; right: 16px; bottom: 104px; z-index: 35; display: flex; gap: 10px; align-items: center; }
.gen-bar .btn { flex: 1; height: 54px; border-radius: 27px; font-size: 17px; box-shadow: 0 10px 26px rgba(20, 30, 20, 0.22); }
.gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.gen-tile { border-radius: 22px; overflow: hidden; position: relative; background: var(--surface-2); box-shadow: var(--raise); }
.gen-tile.wide { grid-column: span 2; }
.gen-tile .img { aspect-ratio: 1; position: relative; }
.gen-tile .img svg { width: 100%; height: 100%; display: block; }
.gen-tile .cap { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font: 500 12.5px var(--font); color: var(--ink-2); background: var(--surface); }
.gen-tile .cap b { color: var(--ink); font-weight: 600; }
.gen-progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); font: 500 13px var(--font); background: linear-gradient(120deg, var(--surface-2), var(--chip), var(--surface-2)); background-size: 300% 300%; animation: wash 3s ease-in-out infinite; }
.gen-progress .noise { position: absolute; inset: 0; opacity: 0.6; }
.gen-progress span { position: relative; }
@keyframes wash { 50% { background-position: 100% 100%; } }
.gen-tile .img .gen-progress svg.ring { width: 52px; height: 52px; position: relative; }
.masonry { columns: 2; column-gap: 8px; padding: 0 12px; }
.masonry .m { break-inside: avoid; margin-bottom: 8px; border-radius: 18px; overflow: hidden; position: relative; display: block; width: 100%; }
.masonry .m svg { width: 100%; height: auto; display: block; }
.masonry .m .model-tag { position: absolute; left: 8px; bottom: 8px; font: 600 11px var(--font); color: #fff; background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 4px 8px; border-radius: 9px; }
.search-field { margin: 0 16px; height: 40px; border-radius: 20px; background: var(--fill-2); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--ink-3); font: var(--t-body); }
.viewer { position: absolute; inset: 0; background: #0b0c0a; color: #fff; display: flex; flex-direction: column; }
.viewer .img { position: absolute; top: 150px; left: 0; right: 0; }
.viewer .img svg { width: 100%; height: auto; display: block; }
.viewer .vbar { position: absolute; top: 0; left: 0; right: 0; padding: 56px 16px 0; display: flex; gap: 8px; z-index: 3; }
.viewer .vbar .gbtn { background: rgba(255, 255, 255, 0.14); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.viewer .vinfo { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px 34px; z-index: 3; background: linear-gradient(transparent, #0b0c0a 18%); padding-top: 40px; }
.viewer .vinfo p { margin: 0 0 10px; font: var(--t-callout); color: rgba(255, 255, 255, 0.92); }
.viewer .vmeta { display: flex; gap: 8px; flex-wrap: wrap; font: 500 12.5px var(--font); color: rgba(255, 255, 255, 0.65); margin-bottom: 14px; }
.viewer .vmeta span { background: rgba(255, 255, 255, 0.1); padding: 5px 9px; border-radius: 10px; }
.viewer .vactions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.viewer .vactions button { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 500 12px var(--font); color: #fff; padding: 10px 0; border-radius: 18px; background: rgba(255, 255, 255, 0.1); }
.viewer .vactions button.hl { background: #f1f6ef; color: #1a241f; }
.viewer .vactions svg { width: 22px; height: 22px; }
.edit-field { display: flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, 0.12); border-radius: 24px; padding: 6px 6px 6px 14px; margin-bottom: 12px; font: var(--t-callout); }
.edit-field .send { width: 36px; height: 36px; border-radius: 18px; background: #f1f6ef; color: #1a241f; display: grid; place-items: center; }

/* ---------- Translations ---------- */
.lang-bar { display: flex; align-items: center; gap: 6px; margin: 0 16px; padding: 5px; border-radius: 26px; background: var(--surface); box-shadow: var(--raise); }
.lang-bar .lang { flex: 1; height: 42px; border-radius: 21px; display: flex; align-items: center; justify-content: center; gap: 5px; font: 600 15.5px var(--font); }
.lang-bar .lang small { font: 500 12px var(--font); color: var(--green); display: block; }
.lang-bar .lang svg { width: 13px; height: 13px; color: var(--ink-3); }
.lang-bar .swap { width: 42px; height: 42px; border-radius: 21px; display: grid; place-items: center; background: var(--fill-2); }
.tr-card { margin: 10px 16px 0; border-radius: 24px; background: var(--surface); box-shadow: var(--raise); padding: 14px 16px 10px; }
.tr-card .tr-text { font: 400 19px/1.45 var(--font); min-height: 60px; }
.tr-card .tr-foot { display: flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--ink-2); font: 500 12.5px var(--font); }
.tr-card .tr-foot .ib { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 19px; color: var(--ink); }
.tr-card .tr-foot .ib svg { width: 20px; height: 20px; }
.tr-card .tr-foot .ib.on { background: var(--green-bg); color: var(--green); }
.tr-card.out { background: var(--bubble); box-shadow: none; }
.theme-dark .tr-card.out { background: #222a20; }
.tr-card.out .tr-text .w { border-radius: 5px; padding: 0 1px; }
.tr-card.out .tr-text .w.alt { background: color-mix(in srgb, var(--green) 22%, transparent); box-shadow: 0 2px 0 var(--green); }
.tr-card.out .tr-text .w.u { text-decoration: underline dotted var(--ink-3); text-underline-offset: 4px; }
.tr-label { font: 600 12.5px var(--font); color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.option-row { display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.option-pill { flex-shrink: 0; display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--raise); font: 500 14px var(--font); }
.option-pill svg { width: 17px; height: 17px; color: var(--ink-2); }
.option-pill .k { color: var(--ink-2); }
.wave { display: flex; align-items: center; gap: 2px; height: 20px; }
.wave i { width: 3px; border-radius: 2px; background: var(--green); animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.1s; } .wave i:nth-child(3) { animation-delay: 0.2s; } .wave i:nth-child(4) { animation-delay: 0.3s; } .wave i:nth-child(5) { animation-delay: 0.4s; }
@keyframes wave { 0%, 100% { height: 5px; } 50% { height: 18px; } }
.alt-row { display: flex; align-items: center; gap: 12px; padding: 13px 16px; position: relative; width: 100%; text-align: left; }
.alt-row + .alt-row::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: 0.5px; background: var(--line-strong); }
.alt-row .t { font: var(--t-body); flex: 1; }
.alt-row .t small { display: block; font: var(--t-foot); color: var(--ink-2); }
.dict { margin: 0 16px; padding: 14px 16px; border-radius: 22px; background: var(--surface); box-shadow: var(--raise); }
.dict h4 { margin: 0; font: 650 22px var(--font); }
.dict .pos { font: italic 500 13px var(--font); color: var(--ink-2); }
.dict p { margin: 8px 0 0; font: var(--t-sub); }
.dict .ex { color: var(--ink-2); font-style: italic; }
.drop-zone { margin: 0 16px; border-radius: 26px; border: 1.5px dashed var(--line-strong); padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: var(--surface-2); }
.drop-zone .big-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--surface); box-shadow: var(--raise); display: grid; place-items: center; color: var(--green); }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; }
.doc-row + .doc-row::before { content: ''; position: absolute; top: 0; left: 66px; right: 0; height: 0.5px; background: var(--line-strong); }
.doc-row .fi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 700 10px var(--font); flex-shrink: 0; }
.doc-row b { font: 500 15.5px/1.25 var(--font); display: block; }
.doc-row small { font: var(--t-foot); color: var(--ink-2); }
.doc-progress { height: 4px; border-radius: 2px; background: var(--fill); margin-top: 6px; overflow: hidden; }
.doc-progress i { display: block; height: 100%; background: var(--green); border-radius: 2px; transition: width 0.4s; }

/* ---------- Sign in ---------- */
.signin { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; padding: 0 24px 46px; z-index: 50; overflow: hidden; }
.signin .glow { position: absolute; inset: -20% -40% auto -40%; height: 520px; background: radial-gradient(closest-side, color-mix(in srgb, var(--sage-bg) 90%, transparent), transparent), radial-gradient(closest-side at 70% 60%, color-mix(in srgb, var(--blue-bg) 80%, transparent), transparent); filter: blur(10px); opacity: 0.9; }
.signin .brand { position: relative; margin-top: 168px; display: flex; flex-direction: column; align-items: flex-start; }
.signin .brand h1 { font: 700 38px/1.08 var(--font); letter-spacing: -0.03em; margin: 24px 0 10px; }
.signin .brand p { margin: 0; font: var(--t-callout); color: var(--ink-2); max-width: 320px; }
.signin .actions { position: relative; margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.signin .email { height: 54px; border-radius: 27px; background: var(--surface); box-shadow: var(--raise), 0 0 0 1.5px var(--green); display: flex; align-items: center; padding: 0 7px 0 18px; font: var(--t-callout); gap: 8px; }
.signin .email .grow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signin .org-hint { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px; background: var(--green-bg); color: var(--ink); font: var(--t-sub); }
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font: 500 13px var(--font); margin: 4px 0; }
.signin .or::before, .signin .or::after { content: ''; flex: 1; height: 0.5px; background: var(--line-strong); }
.signin .legal { text-align: center; font: var(--t-foot); color: var(--ink-3); margin-top: 6px; }

/* Utility */
.hide { display: none !important; }
.sp8 { height: 8px; } .sp16 { height: 16px; } .sp24 { height: 24px; }
.pad { padding: 0 20px; }
.voice-orb { width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #dbe8d8, #6f9a7a 55%, #22302a); animation: breathe 2.6s ease-in-out infinite; box-shadow: 0 20px 60px rgba(47, 113, 72, 0.35); }
@keyframes breathe { 50% { transform: scale(1.06); } }

.composer.glass { background: var(--glass-strong); }
.screen .portrait { color: #fff; }
.sb-chat .avatar { flex: 0 0 auto; width: 24px; height: 24px; font-size: 13px; border-radius: 7px; }

/* ---------- Embed (?embed=1): device only, scaled to fit its iframe ---------- */
html:has(body.embed) { background: transparent; }
body.embed { height: 100%; overflow: hidden; }
body.embed .device {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(var(--fit, 1));
	transform-origin: 50% 50%;
}
body.embed .device::before, body.embed .device::after { display: none; }

/* Autoplay touch indicator */
.demo-tap {
	position: absolute;
	z-index: 200;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	background: rgba(120, 130, 120, 0.28);
	box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55) inset;
	pointer-events: none;
	animation: demo-tap 0.7s cubic-bezier(.32, .72, 0, 1) forwards;
}
@keyframes demo-tap {
	0% { transform: scale(0.4); opacity: 0; }
	30% { transform: scale(1); opacity: 1; }
	100% { transform: scale(1.35); opacity: 0; }
}

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