/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* ---------------------------------------------------------------------------
   Flow companion. Locked to August Drawbridge (Darker) — navy surfaces, one indigo accent.
   Radius rule: panels 14px, controls 10px, chips 7px, round targets pill.
   --------------------------------------------------------------------------- */

:root {
	color-scheme: dark;

	--bg: #0d0e15;
	--surface: #131520;
	--surface-2: #1c1f30;
	--surface-3: #252a41;
	--border: #252a41;
	--border-strong: #444b6f;

	--text: #c3cdfe;
	--text-2: #b8cdfe;
	--text-3: #5e6587;

	--accent: #4961da;
	--accent-hi: #7289fd;
	--accent-ink: #e1e6ff;
	--accent-wash: rgba(73, 97, 218, .18);

	--ok: #67c9e4;
	--warn: #75d5f0;
	--danger: #ec407a;
	--danger-wash: rgba(236, 64, 122, .12);

	--r-lg: 14px;
	--r: 10px;
	--r-sm: 7px;
	--r-pill: 999px;

	--rail: 268px;
	--doc: 400px;
	--ease: cubic-bezier(.16, 1, .3, 1);
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
	--safe-l: env(safe-area-inset-left, 0px);
	--safe-r: env(safe-area-inset-right, 0px);

	--sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	touch-action: manipulation;
}

html, body {
	height: 100%;
	height: -webkit-fill-available;
	margin: 0;
	overflow: hidden;
	overscroll-behavior: none;
}

body {
	position: relative;
	width: 100%;
	font: 400 14px/1.6 var(--sans);
	background: var(--bg);
	color: var(--text);
	-webkit-tap-highlight-color: transparent;
	-webkit-font-smoothing: antialiased;
	-webkit-touch-callout: none;
}

html.keyboard-open { --safe-b: 0px; }

button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid transparent; background-clip: content-box; border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* --- Shared controls ----------------------------------------------------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	min-height: 34px; padding: 0 12px;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2); color: var(--text);
	transition: background .14s var(--ease), border-color .14s var(--ease);
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.quiet { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.quiet:hover { color: var(--text); border-color: var(--border-strong); }

.icon-btn {
	display: inline-grid; place-items: center;
	width: 34px; height: 34px; flex: 0 0 auto;
	border: 0; border-radius: var(--r-pill);
	background: transparent; color: var(--text-2);
	transition: background .14s var(--ease), color .14s var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { opacity: .4; cursor: default; }

#attachBtn { position: relative; overflow: hidden; cursor: pointer; }
#fileInput {
	position: absolute; inset: 0; opacity: 0;
	width: 100%; height: 100%; font-size: 0; cursor: pointer;
}

.field {
	width: 100%; min-width: 0; padding: 8px 11px;
	background: var(--surface); color: var(--text);
	border: 1px solid var(--border); border-radius: var(--r);
}
.field::placeholder { color: var(--text-3); }
.field:focus { outline: none; border-color: var(--border-strong); }

.eyebrow {
	font-size: 10px; font-weight: 600; letter-spacing: .09em;
	text-transform: uppercase; color: var(--text-3);
}

/* --- Shell --------------------------------------------------------------- */

/* Covers exactly the visible part of the page, which ends at the keyboard
   when it is up (app.js sets --vvt and --vvh from the visual viewport). */
#app {
	position: fixed;
	top: var(--vvt, 0px);
	left: 0;
	right: 0;
	height: var(--vvh, 100%);
	width: 100%;
	min-height: 0;
	overflow: hidden;
	display: grid;
	grid-template-columns: var(--rail) minmax(0, 1fr);
	transition: grid-template-columns .22s var(--ease);
}

#app.doc-open { grid-template-columns: var(--rail) minmax(0, 1fr) var(--doc); }

/* --- Sidebar ------------------------------------------------------------- */

.rail {
	display: flex; flex-direction: column; min-height: 0; min-width: 0;
	/* Never sideways; only the chat list scrolls. */
	overflow: hidden;
	background: var(--surface);
	border-right: 1px solid var(--border);
	padding-top: var(--safe-t);
	padding-left: var(--safe-l);
}

.rail-top { display: flex; align-items: center; gap: 6px; padding: 12px 10px 10px 14px; }
.mark {
	display: block; width: 24px; height: 24px; flex: 0 0 auto;
	border-radius: 6px; overflow: hidden; background: #050505;
}
.mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.wordmark { font-size: 14px; font-weight: 620; letter-spacing: -.2px; margin-right: auto; }

.workspace {
	display: flex; align-items: center; gap: 8px; width: calc(100% - 20px);
	margin: 0 10px 10px; padding: 7px 10px;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2); color: var(--text-2); text-align: left;
	transition: border-color .14s var(--ease);
}
.workspace:hover { border-color: var(--border-strong); color: var(--text); }
.workspace .codicon { font-size: 14px; flex: 0 0 auto; }
.workspace-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
/* Another project has an unread chat: a dot before the chevron. */
.workspace .codicon-chevron-down { order: 1; }
.workspace.unread::after, .workspace-option.unread::after {
	content: ''; width: 7px; height: 7px; flex: 0 0 auto;
	border-radius: var(--r-pill); background: var(--accent);
}

.workspace-search { position: relative; flex: 0 0 auto; margin: 0 0 10px; }
.workspace-search .codicon {
	position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
	font-size: 14px; color: var(--text-3); pointer-events: none;
}
.card .workspace-search .field { margin: 0; padding-left: 34px; background: var(--surface-2); }

.workspace-list {
	display: flex; flex-direction: column; gap: 4px;
	flex: 1 1 auto; min-height: 120px; max-height: none;
	overflow: auto; overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	margin: 0 0 4px; padding: 0; list-style: none;
}
.workspace-row { display: flex; align-items: stretch; gap: 4px; flex: 0 0 auto; }
.workspace-option {
	display: flex; align-items: center; gap: 10px;
	flex: 1; min-width: 0; min-height: 44px; padding: 8px 12px;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2); color: var(--text);
	text-align: left; touch-action: manipulation;
}
.workspace-option:hover { border-color: var(--border-strong); }
.workspace-option.active { border-color: var(--border-strong); background: var(--surface-3); }
.workspace-option[aria-selected='true'] {
	border-color: var(--accent); background: var(--surface-3);
}
.workspace-option .codicon { font-size: 16px; color: var(--text-2); flex: 0 0 auto; }
.workspace-option[aria-selected='true'] .codicon { color: var(--accent-hi); }
.workspace-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.workspace-option-name, .workspace-option-path { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-option-name { font-size: 15px; }
.workspace-option-name mark { background: none; color: var(--accent-hi); font-weight: 650; }
.workspace-option-path { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.workspace-option-check { margin-left: auto; font-size: 16px; color: var(--accent-hi); order: 1; }

.workspace-remove, .workspace-remove-spacer { flex: 0 0 44px; }
.workspace-remove {
	display: grid; place-items: center; padding: 0;
	border: 1px solid transparent; border-radius: var(--r);
	background: transparent; color: var(--text-3);
	font-size: 13px; touch-action: manipulation;
	transition: color .14s var(--ease), background .14s var(--ease), border-color .14s var(--ease);
}
.workspace-remove .codicon { font-size: 15px; }
.workspace-remove:hover:not(:disabled) { color: var(--danger); background: var(--danger-wash); }
.workspace-remove.confirm {
	flex-basis: auto; padding: 0 12px;
	border-color: var(--danger); background: var(--danger-wash); color: var(--text);
}
.workspace-remove:disabled { opacity: .5; cursor: default; }
.workspace-remove.confirm:disabled { opacity: 1; }

.workspace-empty {
	display: flex; flex-direction: column; align-items: center; gap: 12px;
	padding: 22px 12px; color: var(--text-2); font-size: 13.5px; text-align: center;
}
#workspaceError { flex: 0 0 auto; }

.rail-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
#newSession { flex: 1; justify-content: flex-start; }
#newGeneralSession {
	width: 34px; height: 34px; border-radius: var(--r);
	border: 1px solid var(--border); background: var(--surface-2);
}
#newGeneralSession:hover { border-color: var(--border-strong); color: var(--text); }

.rail-search { position: relative; padding: 0 10px 10px; }
.rail-search .codicon { position: absolute; left: 20px; top: 50%; transform: translateY(-60%); font-size: 13px; color: var(--text-3); pointer-events: none; }
.rail-search .field { padding-left: 30px; font-size: 13px; background: transparent; }

.rail-list { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 16px; list-style: none; margin: 0; }
.rail-list .group { margin: 12px 0 6px; padding-left: 8px; }
.rail-list .group:first-child { margin-top: 0; }

.session {
	display: block; width: 100%; min-width: 0; overflow: hidden; text-align: left;
	padding: 8px 10px; margin-bottom: 2px;
	border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text-2);
	transition: background .14s var(--ease), color .14s var(--ease);
}
.session:hover { background: var(--surface-2); color: var(--text); }
.session[aria-current='true'] { background: var(--surface-3); color: var(--text); }
.session-title {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45;
}
.session.unread { position: relative; padding-right: 24px; color: var(--text); }
.session.unread .session-title { font-weight: 600; }
.session.unread::after {
	content: ''; position: absolute; top: 14px; right: 10px;
	width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent);
}
/* The rail never scrolls sideways: meta parts shrink and ellipsize; separators, dots and labels keep their size. */
.session-meta { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; margin-top: 3px; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.session-meta > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.session-meta > .session-sep, .session-meta > .dot, .session-meta > .session-label, .session-meta > .session-count { flex: 0 0 auto; }
.session-meta .dot { width: 5px; height: 5px; border-radius: var(--r-pill); background: var(--accent); flex: 0 0 auto; }

/* A chat that started others (a Conductor) opens like a folder. */
.session-group { min-width: 0; }
.session-row { position: relative; min-width: 0; }
.session.has-children { padding-left: 28px; }
.session-twistie {
	position: absolute; left: 4px; top: 7px; z-index: 1;
	display: grid; place-items: center; width: 22px; height: 22px; padding: 0;
	border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3);
	touch-action: manipulation;
}
.session-twistie:hover { background: var(--surface-3); color: var(--text); }
.session-twistie .codicon { font-size: 13px; transition: transform .14s var(--ease); }
.session-twistie[aria-expanded='true'] .codicon { transform: rotate(90deg); }
.session-count { color: var(--text-2); }
.session-children { list-style: none; margin: 0 0 4px 15px; padding: 0 0 0 8px; min-width: 0; border-left: 1px solid var(--border-strong); }
.session.child { padding-top: 6px; padding-bottom: 6px; }
.session.child .session-title { -webkit-line-clamp: 1; }
.session.child.unread::after { top: 12px; }
.session-folder { color: var(--text-2); }
.session-folder .codicon { font-size: 11px; margin-right: 3px; vertical-align: -1px; }
/* A long client address gives way before the count and the time do. */
.session-meta > .session-label.client { flex: 0 1 auto; min-width: 4em; }

.rail-empty { padding: 24px 12px; text-align: center; color: var(--text-3); font-size: 13px; }
/* "Show older chats": the next page of a big project's list. */
.rail-older { padding: 6px 4px 12px; }
.rail-older-btn {
	display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 34px;
	border: 1px dashed var(--border-strong); border-radius: var(--r-sm); background: none;
	color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; touch-action: manipulation;
}
.rail-older-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.rail-older-btn:disabled { cursor: default; opacity: .7; }
.rail-older-btn .codicon { font-size: 13px; }
.rail-older-error { margin: 6px 4px 0; color: var(--danger); font-size: 12px; }

.rail-foot {
	display: flex; align-items: center; gap: 8px;
	padding: 10px 14px calc(10px + var(--safe-b));
	border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2);
}
.status { display: inline-flex; align-items: center; gap: 7px; }
.status::before { content: ''; width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }
.status.online { color: var(--ok); }
.status.offline { color: var(--text-3); }
.status.reconnecting { color: var(--warn); }
.rail-foot .icon-btn { width: 28px; height: 28px; }
.rail-foot #hostsBtn { margin-left: auto; }

.session-host { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--accent-hi); }
.session-host.offline { color: var(--text-3); }

.host-rank { width: 16px; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.host-dot { width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--text-3); flex: 0 0 auto; }
.host-dot.online { background: var(--ok); }

/* --- Chat column --------------------------------------------------------- */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }

.chat-head {
	display: flex; align-items: center; gap: 10px;
	padding: calc(10px + var(--safe-t)) 16px 10px;
	border-bottom: 1px solid var(--border);
}
.chat-head h1 {
	flex: 1; min-width: 0; margin: 0;
	font-size: 14px; font-weight: 550; letter-spacing: -.1px;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
#activity { font-size: 12px; color: var(--text-3); white-space: nowrap; }
#activity.busy { color: var(--accent-hi); }

.transcript {
	flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 28px max(20px, calc((100% - 760px) / 2)) 12px;
	scroll-behavior: auto;
}

/* --- Empty state --------------------------------------------------------- */

.empty { display: flex; flex-direction: column; align-items: flex-start; padding-top: min(14vh, 120px); }
.empty .mark { width: 42px; height: 42px; border-radius: 10px; margin-bottom: 18px; }
.empty h2 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
.empty p { margin: 0; color: var(--text-2); max-width: 46ch; }
.empty kbd {
	font: 500 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px;
	background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}

/* --- Messages ------------------------------------------------------------ */

.msg { margin: 0 0 22px; overflow-wrap: anywhere; animation: msg-in .24s var(--ease); }
@keyframes msg-in { from { transform: translateY(6px); } }

.msg .role { display: block; margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); }

.msg.user {
	width: fit-content; max-width: 88%; margin-left: auto; margin-bottom: 26px;
	padding: 11px 15px; border-radius: var(--r);
	background: var(--surface-2); border: 1px solid var(--border);
}
.msg.user .role { display: none; }
.msg.user .body { display: grid; gap: 8px; }
.msg-images, .msg-files { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-images img {
	display: block; max-width: min(240px, 70vw); max-height: 180px;
	object-fit: cover; border-radius: var(--r-sm);
	border: 1px solid var(--border); background: var(--bg);
}
.msg-files span, .attach-file {
	display: inline-flex; align-items: center; gap: 6px;
	max-width: 220px; min-height: 32px; padding: 5px 10px;
	border: 1px solid var(--border); border-radius: var(--r-sm);
	background: var(--surface-2); color: var(--text-2); font-size: 12px;
}
.msg-files span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-file { position: relative; padding-right: 28px; background: var(--surface); }
.attach-file .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msg.assistant.streaming .body > :last-child::after {
	content: ''; display: inline-block; width: 7px; height: 1em;
	margin-left: 3px; vertical-align: -2px;
	background: var(--accent-hi); animation: caret 1.05s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Tools and thought sit below prose — a compact log, not chat cards. */
.tool-stack { display: flex; flex-direction: column; gap: 3px; margin: 0 0 16px; }
.msg.reasoning, .msg.tool, .msg.patch { margin: 0; animation: none; }

.disclosure {
	border: 1px solid var(--border); border-radius: var(--r-sm);
	background: var(--surface-2); overflow: hidden;
}
.disclosure > summary {
	display: flex; align-items: center; gap: 6px;
	padding: 4px 8px; list-style: none; cursor: pointer;
	font-size: 12px; font-weight: 600; color: var(--text-2);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--text); }
.disclosure > summary .chev { margin-left: auto; font-size: 11px; transition: transform .16s var(--ease); }
.disclosure[open] > summary .chev { transform: rotate(90deg); }
.disclosure > summary .codicon { font-size: 12px; flex: 0 0 auto; color: var(--text-3); }
.disclosure .inner { padding: 6px 8px 8px; border-top: 1px solid var(--border); }
.disclosure .inner .body { font-size: 12px; line-height: 1.5; color: var(--text-2); }

.tool-row {
	display: flex; align-items: center; gap: 6px;
	min-height: 26px; padding: 3px 8px;
	border: 1px solid var(--border); border-radius: var(--r-sm);
	background: var(--surface-2); font-size: 12px; line-height: 1.3; color: var(--text-3);
}
.tool-row .glyph { font-size: 12px; flex: 0 0 auto; color: var(--text-3); }
.tool-row .name { font: 600 12px/1.3 var(--sans); color: var(--text-2); flex: 0 0 auto; }
.tool-row .detail { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); }
.tool-row .state { margin-left: auto; flex: 0 0 auto; font-size: 12px; }
.tool-row.running .name, .tool-row.running .detail { color: var(--text-2); }
.tool-row.running .state { color: var(--accent-hi); }
.tool-row.completed .state { color: var(--ok); }
.tool-row.failed { border-color: var(--danger); }
.tool-row.failed .state { color: var(--danger); }

.msg.patch .role { margin: 0 0 4px; font-size: 11px; font-weight: 600; }
.patch-files { display: flex; flex-wrap: wrap; gap: 4px; }
.patch-files span {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 2px 7px; border-radius: var(--r-sm);
	background: var(--surface-2); border: 1px solid var(--border);
	font: 400 11px/1.4 var(--mono); color: var(--text-3);
}

.notice {
	display: flex; gap: 10px; align-items: flex-start;
	padding: 12px 14px; margin: 0 0 22px;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface); font-size: 13px; color: var(--text-2);
}
.notice .codicon { font-size: 15px; margin-top: 1px; flex: 0 0 auto; color: var(--text-3); }
.notice.error { border-color: var(--danger); background: var(--danger-wash); color: var(--text); }
.notice.error .codicon { color: var(--danger); }
.notice .grow { flex: 1; min-width: 0; }
.notice .btn { min-height: 28px; padding: 0 10px; font-size: 12px; }

.btn.earlier { display: flex; margin: 0 auto 22px; font-size: 13px; }

.steer-divider {
	display: flex; align-items: center; gap: 10px;
	margin: 4px 0 14px;
	font-size: 11px; font-weight: 600; letter-spacing: .5px;
	text-transform: uppercase; color: var(--text-3);
}
.steer-divider::before, .steer-divider::after {
	content: ''; flex: 1; height: 1px; background: var(--border-strong);
}
.steer-divider .steer-now {
	width: 22px; height: 22px;
	background: var(--accent); color: var(--accent-ink);
	touch-action: manipulation;
}
.steer-divider .steer-now:hover:not(:disabled) { background: var(--accent-hi); color: var(--accent-ink); }
.steer-divider .steer-now .codicon { font-size: 12px; }
.msg.user.pending { opacity: .78; }

.waiting {
	margin: 0 0 22px;
	animation: msg-in .24s var(--ease);
}
.waiting .role {
	display: block; margin: 0 0 8px;
	font-size: 12px; font-weight: 600; color: var(--text-3);
}
.waiting .dots {
	display: inline-flex; align-items: center; gap: 5px; height: 14px;
}
.waiting .dots i {
	width: 6px; height: 6px; border-radius: var(--r-pill);
	background: var(--accent-hi);
	animation: wait-dot 1s ease-in-out infinite;
}
.waiting .dots i:nth-child(2) { animation-delay: .16s; }
.waiting .dots i:nth-child(3) { animation-delay: .32s; }
@keyframes wait-dot {
	0%, 80%, 100% { opacity: .28; transform: translateY(0); }
	40% { opacity: 1; transform: translateY(-3px); }
}

/* --- Markdown prose ------------------------------------------------------ */

.body > :first-child { margin-top: 0; }
.body > :last-child,
.body :last-child { margin-bottom: 0; }
.body p { margin: 0 0 14px; }
.body ul, .body ol { margin: 0 0 14px; padding-left: 22px; }
.body li { margin: 4px 0; }
.body li::marker { color: var(--text-3); }
.body h1, .body h2, .body h3, .body h4 { margin: 24px 0 10px; line-height: 1.35; font-weight: 600; letter-spacing: -.2px; }
.body h1 { font-size: 20px; }
.body h2 { font-size: 17px; }
.body h3, .body h4 { font-size: 15px; }
.body a { color: var(--accent-hi); text-underline-offset: 3px; }
.body strong { color: #e1e6ff; font-weight: 600; }
.body code { font: 400 12.5px/1.5 var(--mono); background: var(--surface-3); border-radius: 5px; padding: 2px 5px; word-break: break-word; }
.body pre {
	position: relative; overflow: auto; margin: 0 0 16px;
	padding: 34px 14px 14px;
	border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
.body pre code { background: transparent; padding: 0; font-size: 12.5px; line-height: 1.65; }
.copy-code {
	position: absolute; right: 6px; top: 5px;
	min-height: 24px; padding: 0 8px; border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text-3); font-size: 11px;
}
.copy-code:hover { background: var(--surface-3); color: var(--text); }
.body blockquote { margin: 0 0 14px; padding-left: 14px; border-left: 2px solid var(--border-strong); color: var(--text-2); }
.body table { display: block; overflow-x: auto; border-collapse: collapse; margin: 0 0 16px; font-size: 13px; }
.body th, .body td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.body th { background: var(--surface-2); font-weight: 600; }
.body img { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.body hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

/* --- Skeleton ------------------------------------------------------------ */

.skeleton { display: grid; gap: 12px; }
.skeleton i { display: block; height: 13px; border-radius: 6px; background: var(--surface-2); }
.skeleton i:nth-child(1) { width: 32%; }
.skeleton i:nth-child(2) { width: 88%; }
.skeleton i:nth-child(3) { width: 74%; }
.skeleton i:nth-child(4) { width: 56%; }

/* --- Scroll pin ---------------------------------------------------------- */

.to-bottom {
	position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 30px; padding: 0 12px; border-radius: var(--r-pill);
	border: 1px solid var(--border-strong); background: var(--surface-2);
	color: var(--text-2); font-size: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .38);
}
.to-bottom:hover { color: var(--text); }
.chat-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* --- Approval ------------------------------------------------------------ */

.approval {
	margin: 0 max(20px, calc((100% - 760px) / 2)) 10px;
	padding: 14px 16px; max-height: 42vh; overflow: auto;
	border: 1px solid var(--accent); border-radius: var(--r-lg);
	background: var(--surface); box-shadow: 0 0 0 3px var(--accent-wash);
}
/* A Conductor's run asking its Conductor: shown, but not as something waiting on you. */
.approval.by-conductor { border-color: var(--border); box-shadow: none; }
.approval-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; font-weight: 600; }
.approval-head .codicon { color: var(--accent-hi); font-size: 15px; }
.approval-head .queue { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--text-3); }
.approval .target { margin: 0 0 12px; font: 400 12.5px/1.55 var(--mono); color: var(--text-2); overflow-wrap: anywhere; }
.approval .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.approval fieldset { border: 0; border-top: 1px solid var(--border); margin: 12px 0; padding: 12px 0 0; }
.approval legend { padding: 0; font-size: 13px; font-weight: 550; }
.approval .choice {
	display: flex; align-items: center; gap: 10px; min-height: 38px;
	padding: 4px 8px; border-radius: var(--r-sm); font-size: 13px; cursor: pointer;
}
.approval .choice:hover { background: var(--surface-2); }
.approval input[type='text'] { margin-top: 8px; }
.approval .error { margin: 10px 0 0; color: var(--danger); font-size: 12.5px; }
.approval .error:empty { display: none; }

/* --- Composer ------------------------------------------------------------ */

.composer-wrap { flex-shrink: 0; padding: 0 max(20px, calc((100% - 760px) / 2)) calc(10px + var(--safe-b)); }

.composer {
	display: flex; flex-direction: column;
	border: 1px solid var(--border); border-radius: var(--r-lg);
	background: var(--surface);
	transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.composer:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--accent-wash); }
.composer.drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; }
.attach-thumb {
	position: relative; width: 64px; height: 64px; flex: 0 0 auto;
	border-radius: var(--r-sm); overflow: visible;
}
.attach-thumb img {
	display: block; width: 64px; height: 64px; object-fit: cover;
	border-radius: var(--r-sm); border: 1px solid var(--border);
	background: var(--surface-2);
}
.attach-thumb .icon-btn,
.attach-file .icon-btn {
	position: absolute; top: -7px; right: -7px;
	width: 22px; height: 22px; background: var(--surface-3); color: var(--text);
	box-shadow: 0 0 0 2px var(--surface);
}
.attach-thumb .icon-btn .codicon,
.attach-file .icon-btn .codicon { font-size: 11px; }

.composer textarea {
	resize: none; border: 0; outline: 0; background: transparent;
	padding: 13px 15px 4px; min-height: 50px; max-height: 190px; font-size: 15px; line-height: 1.55;
}
.composer textarea::placeholder { color: var(--text-3); }
/* A leading slash command's pill sits behind the textarea, which stays the real input (controllers/promptMirror.ts). */
.composer { position: relative; }
.composer textarea { position: relative; z-index: 1; }
.prompt-mirror {
	position: absolute; z-index: 0; overflow: hidden; pointer-events: none;
	margin: 0; border: 0; color: transparent;
	white-space: pre-wrap; overflow-wrap: break-word; word-break: normal;
}
.prompt-mirror[hidden] { display: none; }
.prompt-cmd { border-radius: 5px; background: var(--accent-wash); box-shadow: 0 0 0 2px var(--accent-wash), inset 0 -1px 0 var(--accent); }

.composer-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px 10px; }
.composer-bar .grow { flex: 1; min-width: 0; }

.model-btn {
	display: none; align-items: center; gap: 6px;
	min-width: 0; max-width: 100%; height: 34px; padding: 0 10px 0 8px;
	border: 0; border-radius: var(--r-pill);
	background: var(--surface-2); color: var(--text-2);
	touch-action: manipulation;
}
.model-btn .codicon { font-size: 13px; color: var(--text-3); flex: 0 0 auto; }
.model-btn-label {
	min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	font-size: 13px; color: var(--text);
}
/* Reasoning effort keeps its room; the model name truncates first. */
.model-btn-effort { flex: 0 0 auto; white-space: nowrap; font-size: 13px; color: var(--text-2); }
.model-btn-effort::before { content: '· '; color: var(--text-3); }
.model-btn:hover { background: var(--surface-3); color: var(--text); }

.pickers { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
#modelOptions { display: contents; }
.picker-field { display: contents; }
.picker-field > span { display: none; }
.pickers select {
	max-width: min(210px, 100%); min-width: 0; min-height: 30px; padding: 0 6px;
	border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text-2); font-size: 12.5px;
	transition: background .14s var(--ease), color .14s var(--ease);
}
.pickers select:hover { background: var(--surface-2); color: var(--text); }

/* Existing sessions are read-only about their provider and model. */
.session-chip { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; padding-left: 2px; }
.session-chip .part {
	display: inline-flex; align-items: center; gap: 6px; min-width: 0;
	font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.session-chip .part .codicon { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.session-chip .part.model { flex: 1 1 auto; overflow: hidden; }
#chipModel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-chip .sep { width: 1px; height: 13px; background: var(--border-strong); flex: 0 0 auto; }
.session-chip select {
	min-height: 28px; padding: 0 6px; border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text-2); font-size: 12.5px; flex: 0 0 auto;
}
.session-chip select:hover { background: var(--surface-2); color: var(--text); }

#send { background: var(--accent); color: var(--accent-ink); touch-action: manipulation; }
#send:hover:not(:disabled) { background: var(--accent-hi); }
#send:disabled { background: var(--surface-3); color: var(--text-2); }
#stop { background: var(--surface-3); color: var(--text); touch-action: manipulation; }

.voice-btn { touch-action: manipulation; }
.voice-btn.recording { color: var(--danger); background: var(--danger-wash); }
.voice-btn.recording .codicon { animation: ap-pulse 1.4s ease-in-out infinite; }
.voice-timer { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--danger); }
#stop:hover:not(:disabled) { background: var(--border-strong); }
#stop:disabled { background: transparent; }

.composer-foot {
	display: flex; align-items: center; gap: 10px;
	padding: 7px 4px 0; min-height: 22px;
	font-size: 11px; color: var(--text-3);
}
.composer-foot .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#retryCatalog { min-height: 22px; padding: 0 8px; font-size: 11px; }

/* --- Document panel ------------------------------------------------------ */

.doc {
	display: flex; flex-direction: column; min-width: 0; min-height: 0;
	background: var(--surface); border-left: 1px solid var(--border);
	padding-top: var(--safe-t); padding-right: var(--safe-r);
}
.doc-head { display: flex; align-items: center; gap: 4px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--border); }
.doc-head .title { flex: 1; min-width: 0; }
.doc-head .title strong { display: block; font-size: 13px; font-weight: 600; }
.doc-head .title span { display: block; font: 400 11px/1.4 var(--mono); color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.doc-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 20px 20px calc(24px + var(--safe-b)); }
.doc-body .body { font-size: 13.5px; }
.doc-edit {
	flex: 1; min-height: 0; width: 100%; resize: none;
	padding: 16px 18px calc(18px + var(--safe-b));
	border: 0; outline: 0; background: var(--bg);
	font: 400 13px/1.7 var(--mono);
}
.doc-note { padding: 8px 16px; font-size: 12px; color: var(--danger); }
.doc-note:empty { display: none; }
#docBtn.has-plan { color: var(--accent-hi); }
#docBtn.unread, #menuBtn.unread { position: relative; }
#docBtn.unread::after, #menuBtn.unread::after {
	content: ''; position: absolute; top: 5px; right: 5px;
	width: 7px; height: 7px; border-radius: var(--r-pill);
	background: var(--accent); border: 2px solid var(--bg);
}

/* --- Overlays ------------------------------------------------------------ */

.scrim { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, .55); }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0, 0, 0, .66); padding: 24px; }
.card {
	width: min(430px, calc(100% - 32px)); padding: 26px;
	border: 1px solid var(--border-strong); border-radius: var(--r-lg);
	background: var(--surface); color: var(--text);
}
dialog.card {
	padding: 26px;
	max-height: min(86vh, 720px);
	max-height: min(86dvh, 720px);
	flex-direction: column;
	overflow: hidden;
}
dialog.card:not([open]) { display: none; }
dialog.card[open] { display: flex; }
dialog.card::backdrop { background: rgba(0, 0, 0, .66); }
dialog.card h2, dialog.card p { flex: 0 0 auto; }
#workspaceDialog .dialog-actions { flex: 0 0 auto; margin-top: 12px; }
.card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.card p { margin: 0 0 16px; color: var(--text-2); font-size: 13.5px; }
.card label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.card .field { padding: 11px 12px; font-size: 16px; margin-bottom: 4px; }
.card .error { margin: 8px 0 0; color: var(--danger); font-size: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

dialog.card.sheet { width: min(430px, calc(100% - 32px)); }
#modelDialog h2 { margin-bottom: 4px; font-size: 18px; }
#modelDialog p { margin-bottom: 18px; font-size: 13px; }
.picker-sheet { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px 2px; }
.picker-sheet .pickers {
	display: flex; flex-direction: column; align-items: stretch; gap: 16px; flex-wrap: nowrap;
}
.picker-sheet .picker-field {
	display: flex; flex-direction: column; align-items: stretch; gap: 7px; margin: 0;
}
.picker-sheet .picker-field > span {
	display: block; font-size: 12px; font-weight: 500; color: var(--text-2);
}
.picker-sheet .pickers select {
	width: 100%; max-width: none; min-height: 44px; padding: 0 38px 0 12px;
	appearance: none; -webkit-appearance: none;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%237289fd' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
	color: var(--text); font-size: 16px;
}
.picker-sheet .pickers select:disabled { opacity: .5; cursor: default; }
/* Short choices (Mode, Reasoning) are one tap in the sheet; their selects stay the source of truth. */
.segments { display: none; }
.picker-sheet select[data-segmented] { display: none; }
.picker-sheet .segments {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
	padding: 3px; border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2);
}
.segments button {
	min-width: 0; min-height: 38px; padding: 0 4px;
	border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text-2); font-size: 14px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	touch-action: manipulation;
	transition: background .14s var(--ease), color .14s var(--ease);
}
.segments button:hover:not(:disabled) { color: var(--text); }
.segments button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.segments button:disabled { opacity: .5; cursor: default; }
#modelDialog .dialog-actions { flex: 0 0 auto; }

/* --- Autopilot ------------------------------------------------------------ */

.main { position: relative; }

/* Status looks shared by pills, rail dots and the ending card. */
.ap-pill {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 10px; border-radius: var(--r-pill);
	font-size: 12px; font-weight: 600; white-space: nowrap;
	background: var(--surface-3); color: var(--text-2);
}
.ap-pill::before { content: ''; width: 6px; height: 6px; border-radius: var(--r-pill); background: currentColor; }
.ap-pill.active { background: var(--accent-wash); color: var(--accent-hi); }
.ap-pill.active::before { animation: ap-pulse 1.4s ease-in-out infinite; }
.ap-pill.needs { background: rgba(255, 196, 92, .16); color: #ffc45c; }
.ap-pill.done { background: rgba(103, 201, 228, .14); color: var(--ok); }
.ap-pill.bad { background: var(--danger-wash); color: var(--danger); }
@keyframes ap-pulse { 50% { opacity: .35; } }

/* Runs in the chat list */
.session.view.needs { background: rgba(255, 196, 92, .07); }
.session.view.needs .session-meta { color: #ffc45c; }
.session-meta .dot.needs { background: #ffc45c; }

#menuBtn.ap-badge { position: relative; }
#menuBtn.ap-badge::after {
	content: ''; position: absolute; top: 5px; right: 5px;
	width: 8px; height: 8px; border-radius: var(--r-pill);
	background: #ffc45c; border: 2px solid var(--bg);
}

/* Banner: a toast under the header, over whatever is showing. */
.ap-banner {
	position: absolute; z-index: 12; left: 50%; transform: translateX(-50%);
	top: calc(var(--safe-t) + 58px); width: min(640px, calc(100% - 24px));
	display: flex; align-items: center; gap: 10px;
	padding: 8px 8px 8px 14px; border-radius: var(--r-lg);
	border: 1px solid var(--border-strong); background: var(--surface-2);
	box-shadow: 0 12px 34px rgba(0, 0, 0, .45); font-size: 13px;
	animation: msg-in .24s var(--ease);
}
.ap-banner .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-banner strong { color: var(--text); font-weight: 600; }
.ap-banner > .codicon { font-size: 16px; }
.ap-banner.needs { border-color: #ffc45c; }
.ap-banner.needs > .codicon { color: #ffc45c; }
.ap-banner.done > .codicon { color: var(--ok); }
.ap-banner.bad { border-color: var(--danger); }
.ap-banner.bad > .codicon { color: var(--danger); }
.ap-banner .btn { min-height: 30px; }
.ap-banner .icon-btn { width: 30px; height: 30px; }

.ap-folder-notice {
	display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 6px 6px 6px 12px;
	border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
	font-size: 12.5px; color: var(--text-2);
}
.ap-folder-notice > .codicon { color: var(--accent-hi); }
.ap-folder-notice .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-folder-notice .btn { min-height: 28px; padding: 0 10px; font-size: 12px; }

/* Slash menu above the composer */
.composer-wrap { position: relative; }
.slash-menu {
	position: absolute; z-index: 9; bottom: calc(100% - 4px);
	left: max(20px, calc((100% - 760px) / 2)); width: min(420px, calc(100% - 40px));
	display: flex; flex-direction: column; gap: 2px; padding: 6px;
	border: 1px solid var(--border-strong); border-radius: var(--r-lg);
	background: var(--surface-2); box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}
.slash-item {
	display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
	padding: 8px 10px; border: 0; border-radius: var(--r-sm);
	background: transparent; color: var(--text); text-align: left;
}
.slash-item.active, .slash-item:hover { background: var(--surface-3); }
.slash-item:disabled { opacity: .5; cursor: default; }
.slash-name { font: 600 13px/1.4 var(--mono); color: var(--accent-hi); }
.slash-detail { font-size: 12px; color: var(--text-2); }
.slash-item:has(> .slash-icon) { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.slash-item > .slash-icon { grid-row: 1 / span 2; font-size: 16px; color: var(--accent-hi); }
.slash-item:has(> .slash-icon) > .slash-name, .slash-item:has(> .slash-icon) > .slash-detail { grid-column: 2; }

/* The sheet */
dialog.card.ap-sheet { width: min(560px, calc(100% - 32px)); padding: 22px 24px; }
.ap-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex: 0 0 auto; }
.ap-sheet-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.ap-sheet-head h2 .codicon { font-size: 18px; color: var(--accent-hi); }
.ap-step { margin-left: auto; font-size: 12px; color: var(--text-3); }
.ap-sheet-head .icon-btn { margin-right: -8px; }
.ap-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; margin: 0 -24px; padding: 0 24px 2px; }
.ap-scroll > label, .ap-card > label { margin-top: 14px; }
.ap-scroll > label:first-child { margin-top: 0; }
.ap-scroll textarea.field { font-size: 15px; resize: vertical; line-height: 1.5; }
.field.mono, .mono { font-family: var(--mono) !important; font-size: 13px !important; }
.ap-row { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 13px; color: var(--text-2); }
.ap-label, .ap-label-line { font-size: 12px; color: var(--text-2); }
.ap-label { width: 64px; flex: 0 0 auto; }
.ap-label-line { display: block; margin: 14px 0 6px; }
.ap-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
.ap-row .btn { min-height: 30px; }
.ap-harness { margin: 14px 0 0; padding: 0; border: 0; }
.ap-harness legend { padding: 0; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.ap-pickers { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-options { display: contents; }
.ap-pickers select {
	min-height: 38px; max-width: 100%; padding: 6px 10px;
	border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2); color: var(--text); font-size: 14px;
}
.ap-loading { align-self: center; font-size: 12px; color: var(--text-3); }
.ap-limits .field { width: 72px; padding: 6px 8px; font-size: 14px; margin: 0; text-align: center; }
.ap-schedule { flex-wrap: wrap; }
.ap-schedule .ap-toggle { display: flex; align-items: center; gap: 8px; margin: 0; }
.ap-schedule input[type="datetime-local"] { flex: 1; min-width: 180px; margin: 0; padding: 6px 10px; font-size: 14px; }
.ap-scheduled { padding: 14px 2px 8px; }
.ap-scheduled h2 { margin: 0 0 8px; font-size: 16px; }
.ap-scheduled .ap-row { margin-top: 10px; }
.card p.ap-note { margin: 14px 0 0; font-size: 12.5px; color: var(--text-2); }
.card p.ap-note + p.ap-note { margin-top: 6px; }
.card p.ap-note.error { color: var(--danger); }
.card p.ap-note strong { color: var(--text); }
.ap-drafting { display: flex; align-items: center; gap: 10px; padding: 18px 2px; color: var(--accent-hi); font-size: 14px; }
.ap-question { padding: 4px 0 8px; }
.ap-question-text { margin: 0 0 12px !important; color: var(--text) !important; font-size: 14px !important; }
.ap-answer { display: flex; gap: 8px; margin-top: 10px; }
.ap-answer .field { flex: 1; margin: 0; font-size: 15px; }
.ap-commands { display: flex; flex-direction: column; gap: 6px; }
.ap-command { display: flex; align-items: center; gap: 4px; }
.ap-command .field { flex: 1; margin: 0; padding: 9px 10px; }
.ap-add { align-self: flex-start; margin-top: 6px; min-height: 30px; font-size: 12.5px; }
.ap-notes { margin-top: 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; }
.ap-notes .ap-label-line { margin-top: 0; }
.ap-revise { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ap-revise .btn { margin-top: 6px; }
.ap-sheet .dialog-actions {
	position: sticky; bottom: 0; z-index: 1; flex: 0 0 auto; align-items: center;
	margin-top: 14px; padding: 12px 0 2px; background: var(--surface);
}
.ap-sheet .dialog-actions .grow { flex: 1; }

/* A run in the chat column: the chat's own body and composer step aside. */
#app.external-view .main > .chat-body,
#app.external-view .main > .approval,
#app.external-view .main > .composer-wrap { display: none !important; }
.run-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.run-tabs {
	display: flex; gap: 2px; padding: 6px max(20px, calc((100% - 760px) / 2)) 0;
	border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none;
}
.run-tabs [role='tab'] {
	padding: 6px 10px 8px; border: 0; border-bottom: 2px solid transparent;
	background: transparent; color: var(--text-3); font-size: 12.5px; font-weight: 550; white-space: nowrap;
}
.run-tabs [role='tab']:hover { color: var(--text); }
.run-tabs [role='tab'][aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent-hi); }
.run-body {
	flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 24px max(20px, calc((100% - 760px) / 2)) 12px;
}
.run-body .msg { animation: none; }
.run-needs { border-color: #ffc45c; box-shadow: 0 0 0 3px rgba(255, 196, 92, .14); }
.run-needs .approval-head .codicon { color: #ffc45c; }
.run-needs .actions .btn { min-height: 34px; }
.run-finish { margin: 0 max(20px, calc((100% - 760px) / 2)) 4px; }
.run-finish .msg { margin: 0; }
.ap-msg .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ap-msg .error { margin: 8px 0 0; color: var(--danger); font-size: 12.5px; }
.ap-msg .error:empty { display: none; }
.ap-hint { margin: 10px 0 0; font-size: 12px; color: var(--text-3); }
.run-chip { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 7px; min-width: 0; padding-left: 4px; font-size: 12.5px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.run-chip .codicon { color: var(--accent-hi); font-size: 14px; flex: 0 0 auto; }
#runSend { background: var(--accent); color: var(--accent-ink); touch-action: manipulation; }
#runSend:hover:not(:disabled) { background: var(--accent-hi); }
#runSend:disabled { background: var(--surface-3); color: var(--text-2); }
#runStop { background: var(--surface-3); color: var(--text); touch-action: manipulation; }
#runStop:hover { background: var(--border-strong); }
#runInput:disabled { opacity: .6; }

.ap-conversation { display: flex; flex-direction: column; min-width: 0; }
.ap-body { min-width: 0; overflow-wrap: anywhere; overflow: hidden; }
/* Consecutive Autopilot messages read as one: the label shows once. */
.ap-msg + .ap-msg { margin-top: -12px; }
.ap-msg + .ap-msg > .role { display: none; }
.ap-activity {
	display: flex; align-items: center; gap: 10px; margin: 0 0 22px;
	font-size: 13.5px; color: var(--accent-hi);
}
.ap-cardbox {
	display: flex; flex-direction: column; gap: 4px; padding: 16px;
	border: 1px solid #ffc45c; border-radius: var(--r-lg); background: var(--surface);
	box-shadow: 0 0 0 3px rgba(255, 196, 92, .1); overflow-wrap: anywhere;
}
.ap-card-intro { margin: 0 0 6px !important; color: var(--text-2); font-size: 13px; }
.ap-field { display: flex; flex-direction: column; }
.ap-cardbox .field { font-size: 14px; resize: vertical; line-height: 1.5; }
.ap-cardbox .ap-label-line { margin: 10px 0 5px; }
.ap-toggle { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; cursor: pointer; }
.ap-cardbox .actions { display: flex; gap: 8px; margin-top: 14px; }
.ap-cardbox .error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.ap-cardbox .error:empty { display: none; }
.ap-agreed { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ap-agreed > summary {
	display: flex; align-items: center; gap: 10px; padding: 10px 14px; list-style: none; cursor: pointer;
	font-size: 13px; color: var(--text-2); min-width: 0;
}
.ap-agreed > summary > span:not(.codicon) { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: var(--mono); font-size: 12.5px; }
.ap-agreed > summary::-webkit-details-marker { display: none; }
.ap-agreed > summary > .codicon-checklist { color: var(--ok); }
.ap-agreed > summary > .codicon-chevron-right { color: var(--text-3); transition: transform .16s var(--ease); }
.ap-agreed[open] > summary > .codicon-chevron-right { transform: rotate(90deg); }
.ap-agreed > .ap-card-facts { padding: 2px 14px 6px; }
.ap-agreed > .ap-hint { margin: 0; padding: 0 14px 12px; }
.ap-more { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; }
.ap-more > summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); list-style: revert; }
.ap-more[open] > summary { margin-bottom: 4px; }
.ap-file-list li { display: flex; align-items: center; gap: 4px; }
.ap-file-list li > .ap-file { flex: 1; min-width: 0; }
.ap-download { width: 30px; height: 30px; flex: 0 0 auto; }

.ap-muted { color: var(--text-3); font-size: 13px; }
.ap-warn { color: #ffc45c; font-size: 13px; }
.ap-round { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ap-round > summary {
	display: flex; align-items: center; gap: 10px; padding: 11px 14px;
	list-style: none; cursor: pointer; min-width: 0;
}
.ap-round > summary::-webkit-details-marker { display: none; }
.ap-round > summary > .codicon-chevron-right { margin-left: auto; color: var(--text-3); transition: transform .16s var(--ease); }
.ap-round[open] > summary > .codicon-chevron-right { transform: rotate(90deg); }
.ap-round-mark { font-size: 15px; flex: 0 0 auto; }
.ap-round-mark.ok { color: var(--ok); }
.ap-round-mark.bad { color: var(--danger); }
.ap-round-mark.muted { color: var(--accent-hi); }
.ap-round-name { font-weight: 600; font-size: 13.5px; flex: 0 0 auto; }
.ap-round-text { min-width: 0; font-size: 12.5px; color: var(--text-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap-round-body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow-wrap: anywhere; }
.ap-section h3 { margin: 0 0 6px; }
.ap-section .body { font-size: 13.5px; }
.ap-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ap-flags li { padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); overflow-wrap: anywhere; }
.ap-flags li.bad { background: var(--danger-wash); color: var(--text); }
.ap-flags li.warn { background: rgba(255, 196, 92, .1); color: #ffc45c; }
.ap-checks { display: flex; flex-direction: column; gap: 4px; }
.ap-check { border-radius: var(--r-sm); background: var(--surface-2); }
.ap-check > summary { display: flex; align-items: center; gap: 8px; padding: 7px 10px; list-style: none; cursor: pointer; min-width: 0; }
.ap-check > summary::-webkit-details-marker { display: none; }
.ap-check.ok > summary > .codicon { color: var(--ok); }
.ap-check.bad > summary > .codicon { color: var(--danger); }
.ap-check-command { flex: 1; min-width: 0; font: 400 12.5px/1.5 var(--mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.ap-check-meta { flex: 0 0 auto; font-size: 11.5px; color: var(--text-3); }
.ap-tail {
	margin: 0; padding: 10px 12px; max-height: 280px; overflow: auto;
	border-top: 1px solid var(--border); font: 400 11.5px/1.55 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.ap-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ap-file-list li { overflow-wrap: anywhere; }
.ap-file {
	display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px;
	border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); text-align: left;
}
.ap-file:hover { background: var(--surface-2); color: var(--text); }
.ap-file .codicon-diff-added { color: var(--ok); }
.ap-file .codicon-diff-removed { color: var(--danger); }
.ap-file .codicon-diff-modified { color: var(--accent-hi); }
.ap-file-path { flex: 1; min-width: 0; font: 400 12.5px/1.5 var(--mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ap-file-counts { flex: 0 0 auto; font: 400 11.5px/1.5 var(--mono); color: var(--text-3); }
#apUndoDialog .ap-file-list { flex: 1 1 auto; min-height: 0; overflow: auto; font: 400 12.5px/1.6 var(--mono); }

.ap-ending { padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--border-strong); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.ap-ending.done { border-color: var(--ok); }
.ap-ending.bad { border-color: var(--danger); }
.ap-ending-head { display: flex; align-items: center; gap: 10px; }
.ap-ending-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.ap-ending-head .codicon { font-size: 20px; color: var(--text-2); }
.ap-ending.done .ap-ending-head .codicon { color: var(--ok); }
.ap-ending.bad .ap-ending-head .codicon { color: var(--danger); }
.ap-ending-reason { margin: 0; color: var(--text-2); font-size: 13.5px; }
.ap-ending .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-card-facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.ap-card-facts dt { color: var(--text-3); }
.ap-card-facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.ap-transcript { padding-top: 4px; overflow-wrap: anywhere; }

@media (max-width: 900px) {
	.run-body, .run-tabs { padding-left: 16px; padding-right: 16px; }
	.run-view .run-needs,
	.run-view .run-finish { margin: 0 16px 10px; }
	dialog.card.ap-sheet { width: 100%; padding: 20px 18px calc(16px + var(--safe-b)); }
	.ap-scroll { margin: 0 -18px; padding: 0 18px 2px; }
	.slash-menu { left: 16px; width: calc(100% - 32px); }
	.ap-card-facts { grid-template-columns: 1fr; gap: 2px; }
	.ap-card-facts dd { margin-bottom: 8px; }
}

/* --- Responsive ---------------------------------------------------------- */

@media (min-width: 901px) {
	#menuBtn, #closeRail, .scrim { display: none !important; }
	.rail[hidden] { display: flex !important; }
}

@media (max-width: 900px) {
	#app, #app.doc-open { grid-template-columns: minmax(0, 1fr); }
	.rail[hidden] { display: flex !important; }
	.scrim[hidden] { display: block !important; }
	.rail {
		position: fixed; inset: 0 auto 0 0; z-index: 20;
		width: min(300px, 86vw); border-right: 1px solid var(--border);
		box-shadow: 0 0 40px rgba(0, 0, 0, .5);
		transform: translate3d(-100%, 0, 0);
		visibility: hidden;
		pointer-events: none;
		transition: transform .28s var(--ease), visibility .28s var(--ease);
	}
	.rail.is-open {
		transform: translate3d(0, 0, 0);
		visibility: visible;
		pointer-events: auto;
	}
	.scrim {
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity .28s var(--ease), visibility .28s var(--ease);
	}
	.scrim.is-open {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}
	.doc {
		position: fixed; inset: 0; z-index: 25; border-left: 0;
		padding-left: var(--safe-l);
	}
	.doc-head #docClose { order: -1; margin-right: 4px; }
	.transcript, .approval, .composer-wrap { padding-left: 16px; padding-right: 16px; }
	.approval { margin-left: 0; margin-right: 0; }
	.empty { padding-top: 12vh; }
	.empty h2 { font-size: 21px; }
	/* Tight icons so the model name has the room. Stop only shows while a turn is running. */
	.composer-bar { flex-wrap: nowrap; gap: 2px; padding: 6px 6px 6px 8px; }
	.composer-bar .grow { display: none; }
	.composer-bar .icon-btn { width: 34px; height: 34px; }
	.composer-bar .voice-timer { padding: 0 2px; }
	#stop:disabled { display: none; }
	.composer-bar .model-btn { display: inline-flex; flex: 1 1 auto; gap: 4px; height: 34px; margin-right: 4px; padding: 0 8px 0 11px; }
	.composer-bar .model-btn > .codicon-chip { display: none; }
	#pickersSlot { display: none; }
	.session-chip { display: none !important; }
	dialog.card.sheet {
		width: 100%; max-width: none; margin: auto 0 0;
		border-radius: var(--r-lg) var(--r-lg) 0 0;
		padding: 20px 18px calc(14px + var(--safe-b));
	}
	#modelDialog .dialog-actions { margin-top: 20px; }
	#modelDialog .dialog-actions .btn { flex: 1; min-height: 44px; }
}

@media (pointer: coarse) {
	/* A long press on a phone or iPad shouldn't select text; fields still can, and code blocks have Copy. */
	body { -webkit-user-select: none; user-select: none; }
	input, textarea, [contenteditable]:not([contenteditable="false"]) { -webkit-user-select: text; user-select: text; }
	.icon-btn { width: 40px; height: 40px; }
	.btn { min-height: 40px; }
	.model-btn { height: 40px; }
	.pickers select, .session-chip select { min-height: 36px; }
	.composer textarea { font-size: 16px; }
	.rail-foot .icon-btn { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
	.chat-head { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.btn:active { transform: none; }
}

/* --- Settings sheet: a tab rail and one panel, the same size on every tab --- */
dialog.card.sheet.settings-sheet {
	width: min(1120px, calc(100vw - 32px)); max-width: none;
	height: min(820px, calc(100vh - 32px)); height: min(820px, calc(100dvh - 32px));
	max-height: none; padding: 0;
}
dialog.card.settings-sheet[open] {
	display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
}
.settings-head {
	grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
	padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--border);
}
.card .settings-head h2 { flex: 1 1 auto; margin: 0; }
.settings-tabs {
	display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto;
	padding: 12px 8px; border-right: 1px solid var(--border);
}
.settings-tabs [role='tab'] {
	display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px;
	border: 0; border-radius: var(--r); background: transparent; color: var(--text-2);
	font-size: 14px; text-align: left; white-space: nowrap;
	transition: background .14s var(--ease), color .14s var(--ease);
}
.settings-tabs [role='tab']:hover { background: var(--surface-2); color: var(--text); }
.settings-tabs [role='tab'][aria-selected='true'] { background: var(--accent-wash); color: var(--text); font-weight: 600; }
.settings-tabs [role='tab'][aria-selected='true'] .codicon { color: var(--accent-hi); }
.settings-panel {
	min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
	padding: 18px 22px 28px;
}
.settings-panel:focus-visible { outline-offset: -2px; }
.settings-panel > section + section { margin-top: 28px; }
.card .settings-panel p { font-size: 13px; }
.settings-intro { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card .settings-intro p { flex: 1 1 auto; margin: 0; color: var(--text-2); }
.card h3.sheet-heading { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
@media (max-width: 700px) {
	dialog.card.sheet.settings-sheet {
		width: 100vw; height: 100vh; height: 100dvh; margin: 0; border: 0; border-radius: 0;
		padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
	}
	dialog.card.settings-sheet[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
	.settings-head { padding: 10px 12px 10px 16px; }
	.settings-tabs {
		flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
		padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border);
	}
	.settings-tabs::-webkit-scrollbar { display: none; }
	.settings-tabs [role='tab'] { flex: 0 0 auto; min-height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--r-pill); }
	.settings-tabs [role='tab'][aria-selected='true'] { border-color: var(--accent); }
	.settings-panel { padding: 14px 14px 24px; }
}

/* --- Usage (Settings › Usage): the IDE's Usage board, one provider per card --- */
.usage-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card .usage-head h3.sheet-heading { margin: 0; flex: 1 1 auto; }
.usage-stamp { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
#usageRefresh { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.card .usage-section > p { margin: 0 0 12px; font-size: 13px; }
.card .usage-section > p.error { color: var(--danger); }
.usage-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; gap: 10px; transition: opacity .16s var(--ease); }
.usage-board.loading { opacity: .55; }
.usage-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.usage-card-head { display: flex; align-items: baseline; gap: 8px; }
.usage-name { font-size: 14.5px; font-weight: 600; letter-spacing: -.2px; }
.usage-plan { font-size: 11.5px; color: var(--text-3); }
.usage-via { margin-left: auto; font-size: 11px; color: var(--text-3); white-space: nowrap; }
.card p.usage-note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.usage-note a { color: var(--accent-hi); text-decoration: none; }
.usage-cluster { margin-top: 12px; }
.usage-cluster-name { margin-bottom: 8px; font-size: 11px; color: var(--text-3); }
.usage-meter + .usage-meter { margin-top: 12px; }
.usage-meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.usage-meter-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.usage-meter-value { flex: 0 0 auto; font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
.usage-meter-reset { margin: 2px 0 6px; min-height: 16px; font-size: 11.5px; color: var(--text-3); }
.usage-track { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 2px; background: var(--accent-hi); transition: width .35s var(--ease); }
.usage-track.warn { background: rgba(240, 180, 70, .18); }
.usage-fill.warn { background: #f0b446; }
.usage-track.bad { background: var(--danger-wash); }
.usage-fill.bad { background: var(--danger); }

/* --- Push notifications (Settings › Notifications) --- */
.card .push-section p { margin: 0 0 10px; font-size: 13px; }
.card .push-section p.error { color: var(--danger); }
.push-actions { display: flex; gap: 8px; }

/* Keep plan approval within reach in both the chat and the mobile file panel. */
.plan-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.plan-actions > span { flex: 1; min-width: 120px; font-size: 12px; color: var(--text-2); }
.doc-build { order: 1; flex-shrink: 0; margin: 12px 16px calc(12px + var(--safe-b)); }

/* --- Autopilot activity canvas -------------------------------------------- */
.run-body.run-body-visualization { padding: 20px; }
.ap-viz { width: 100%; max-width: 1160px; margin: 0 auto; }
.ap-viz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ap-viz-eyebrow { color: var(--accent-hi); font: 10px/1.4 var(--mono); letter-spacing: .12em; }
.ap-viz-heading h2 { margin: 5px 0 0; font-size: 20px; line-height: 1.3; font-weight: 550; letter-spacing: -.025em; }
.ap-viz-head .btn { flex-shrink: 0; font-size: 11px; min-height: 36px; }
.ap-viz-summary { margin-top: 16px; font-size: 11px; color: var(--text-2); line-height: 1.8; }
.ap-viz-summary::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #91a0bb; margin-right: 7px; }
.ap-viz-summary[data-connection='live']::before { background: var(--ok); box-shadow: 0 0 9px #67c9e450; }
.ap-viz-note { margin: 5px 0 12px; color: #91a0bb; font-size: 11px; line-height: 1.6; }
.ap-viz-stage { position: relative; width: 100%; height: 540px; overflow: hidden; border: 1px solid #20323d; border-radius: var(--r-lg); background: radial-gradient(ellipse at 48% 45%, #122632 0%, #0b141e 45%, #080d14 100%); }
.ap-viz-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.ap-viz-canvas:active { cursor: grabbing; }
.ap-viz-map-info { position: absolute; top: 18px; left: 18px; color: #92aebc; font: 9px/1.5 var(--mono); letter-spacing: .08em; pointer-events: none; }
.ap-viz-map-hint { position: absolute; bottom: 17px; left: 16px; right: 16px; text-align: center; color: #849aa9; font: 10px/1.5 var(--mono); pointer-events: none; }
.ap-viz-controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 3px; padding: 3px; border: 1px solid #293b46; border-radius: 7px; background: #0c1721ed; }
.ap-viz-controls button { min-width: 32px; min-height: 32px; border: 0; border-radius: 4px; background: transparent; color: #b8d4df; font: 12px var(--mono); cursor: pointer; }
.ap-viz-controls button:hover { background: #213744; color: white; }
.ap-viz-files { margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; color: #91a0bb; font-size: 11px; }
.ap-viz-files summary { cursor: pointer; }
.ap-viz-file-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 0 16px; max-height: 200px; overflow: auto; margin-top: 8px; }
.ap-viz-file { grid-column: 1 / -1; justify-self: start; max-width: 100%; border: 0; padding: 4px 0; color: #89cabb; background: transparent; text-align: left; overflow-wrap: anywhere; font: 10px/1.5 var(--mono); cursor: pointer; }
.ap-viz-file:hover { text-decoration: underline; }
.ap-viz-details > .ap-viz-selected-file { color: #b9efdf; font-family: var(--mono); }
.ap-viz-legend { display: flex; justify-content: center; gap: 17px; flex-wrap: wrap; margin: 12px 0 22px; color: #91a0bb; font-size: 10px; }
.ap-viz-key::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 6px; background: var(--activity-color); border-radius: 2px; }
.ap-viz-agents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ap-viz-agent { min-height: 36px; padding: 5px 10px; background: transparent; border: 1px solid var(--border); border-radius: var(--r-sm); color: #91a0bb; font-size: 11px; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.ap-viz-agent[aria-pressed='true'] { color: var(--text); background: var(--accent-wash); border-color: var(--accent); }
.ap-viz-details { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow-wrap: anywhere; }
.ap-viz-details h3 { margin: 0; font-size: 13px; font-weight: 600; }
.ap-viz-details > p { color: #91a0bb; margin: 4px 0 12px; font-size: 11px; }
.ap-viz-activity { list-style: none; margin: 0; padding: 0; }
.ap-viz-activity li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.ap-viz-tool-name { color: var(--activity-color); font-size: 11px; }
.ap-viz-tool-title { grid-column: 1; color: var(--text-2); font-size: 11px; white-space: pre-wrap; }
.ap-viz-tool-state { grid-column: 2; grid-row: 1 / 3; align-self: center; color: #91a0bb; font: 10px var(--mono); }
.ap-viz-tool-state.completed { color: var(--ok); }
.ap-viz-tool-state.failed { color: var(--danger); }
@media (max-width: 600px) {
	.run-body.run-body-visualization { padding: 16px 10px; }
	.ap-viz-heading h2 { font-size: 17px; }
	.ap-viz-eyebrow { font-size: 9px; letter-spacing: .06em; }
	.ap-viz-head .btn { max-width: 102px; padding: 4px 8px; line-height: 1.4; }
	.ap-viz-legend { gap: 12px; }
}
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* --- /conductor sheet ----------------------------------------------------- */

.cond-sheet .segments {
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
	padding: 3px; border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface-2);
}
.cond-sheet .segments button { min-height: 34px; font-size: 13px; }
.cond-sheet .cond-new-folder { margin-top: 8px; font-size: 14px; padding: 9px 11px; }
.cond-sheet .cond-select { flex: 1; min-width: 0; padding: 7px 10px; font-size: 14px; margin: 0; }
.cond-sheet .ap-label { margin: 0; }
.cond-sheet .cond-formula-note { margin-top: 6px; }
.cond-similar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cond-similar li { display: flex; flex-direction: column; padding: 7px 10px; border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.cond-similar-title { font-size: 13px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cond-similar-meta { font-size: 11.5px; color: var(--text-3); }

/* --- Chips ----------------------------------------------------------------- */

.cond-chip {
	display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0;
	padding: 1px 7px; border: 1px solid var(--border); border-radius: var(--r-pill);
	background: var(--surface); color: var(--text-2); font-size: 11.5px; line-height: 1.5;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
}
.cond-chip.link { cursor: pointer; }
.cond-chip.link:hover { border-color: var(--border-strong); color: var(--text); }
.cond-chip .codicon { font-size: 11px; flex: 0 0 auto; }

/* --- The track card on a Conductor chat ----------------------------------- */

.track-card {
	flex: 0 0 auto; margin: 10px max(20px, calc((100% - 760px) / 2)) 0;
	padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r);
	background: var(--surface); font-size: 12.5px; color: var(--text-2);
}
.track-card.needs { border-color: rgba(255, 196, 92, .45); }
.track-card.starting .track-head > .codicon { color: var(--accent-hi); }
.track-card.failed { border-color: var(--danger); }
.track-card.failed .track-head > .codicon { color: var(--danger); }
#app.external-view .main > .track-card { display: none; }
.track-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.track-toggle { width: 24px; height: 24px; flex: 0 0 auto; }
.track-toggle .codicon { font-size: 13px; transition: transform .14s var(--ease); }
.track-toggle[aria-expanded='true'] .codicon { transform: rotate(90deg); }
.track-title { min-width: 0; flex: 0 1 auto; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; color: var(--text); font-size: 13px; }
.track-formula { flex: 0 0 auto; padding: 0 6px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font: 500 11.5px/1.6 var(--mono); }
.track-status { flex: 0 0 auto; padding: 1px 8px; font-size: 11px; }
.track-progress { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 60px; min-width: 50px; }
.track-bar { position: relative; flex: 1; height: 4px; min-width: 24px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.track-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--accent-hi); transition: width .3s var(--ease); }
.track-count { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--text-3); font-size: 11.5px; }
.track-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.track-actions .btn { min-height: 26px; padding: 0 8px; font-size: 12px; }
.track-stop.confirm { color: var(--danger); }
.track-request { margin: 6px 0 0 30px; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.track-needs { display: flex; align-items: center; gap: 6px; margin: 6px 0 0 32px; color: #ffc45c; }
.track-error { margin: 6px 0 0 32px; color: var(--danger); }
.track-steps { list-style: none; margin: 8px 0 2px; padding: 0 0 0 32px; display: grid; gap: 3px; max-height: 32vh; overflow-y: auto; }
.track-step { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 2px 0; }
.track-step > .codicon { flex: 0 0 auto; font-size: 13px; color: var(--text-3); }
.track-step.working > .codicon { color: var(--accent-hi); }
.track-step.review > .codicon, .track-step.needs-you > .codicon { color: #ffc45c; }
.track-step.done > .codicon { color: var(--ok); }
.track-step.blocked > .codicon { color: var(--danger); }
.track-step.done .track-step-title, .track-step.skipped .track-step-title { color: var(--text-3); }
.track-step.needs-you { margin: 0 -6px; padding: 2px 6px; border-radius: var(--r-sm); background: rgba(255, 196, 92, .09); }
.track-step-title { min-width: 0; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track-step-status { flex: 0 0 auto; color: var(--text-3); font-size: 11.5px; }
.track-step.needs-you .track-step-status { color: #ffc45c; }
.track-step-chats { display: inline-flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.track-chat-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: var(--r-pill); background: var(--text-3); }
.track-chat.working .track-chat-dot { background: var(--accent-hi); animation: ap-pulse 1.4s ease-in-out infinite; }
.track-chat.needs .track-chat-dot { background: #ffc45c; }
.track-chat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* One line on a narrow screen: the progress and actions, no steps until you open it. */
@media (max-width: 900px) {
	.track-card { margin-left: 16px; margin-right: 16px; }
	.track-formula, .track-status { display: none; }
	.track-open { display: none; }
	.track-steps { padding-left: 4px; }
	.track-needs, .track-error, .track-request { margin-left: 4px; }
}

/* --- Conductor prompts in the transcript ---------------------------------- */

.msg.cond-msg { margin: 0 0 18px; }
.cond-card .cond-card-meta { color: var(--text-3); font-weight: 400; }
.cond-wake .disclosure > summary { padding: 5px 9px; }
.cond-events { margin: 0; padding: 0 0 0 2px; display: grid; gap: 2px; font-size: 12px; color: var(--text-2); }
.cond-events li { list-style-position: inside; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cond-events li::marker { color: var(--text-3); }
.cond-rest { list-style: none; margin: 6px 0 0; padding: 0; font-size: 11.5px; color: var(--text-3); }
.cond-seed .cond-card { padding: 10px 13px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: var(--surface-2); }
.cond-card-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.cond-card-head .codicon { font-size: 13px; color: var(--accent-hi); }
.cond-card-head .cond-card-meta { margin-left: auto; font: 400 11px/1.4 var(--mono); }
.cond-request { margin-top: 6px; color: var(--text); font-size: 14px; }
.cond-request > :first-child { margin-top: 0; }
.cond-request > :last-child { margin-bottom: 0; }

/* --- Conductor tool rows ---------------------------------------------------- */

.conductor-tool .tool-row .detail { display: inline-flex; align-items: center; gap: 4px; }
.conductor-tool .tool-row .state { margin-left: 0; }
.conductor-tool .cond-raw-btn { margin-left: auto; width: 22px; height: 22px; flex: 0 0 auto; color: var(--text-3); }
.conductor-tool .cond-raw-btn .codicon { font-size: 12px; }
.cond-raw { margin: 3px 0 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); font: 11.5px/1.5 var(--mono); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }

/* --- Settings › Automation › How often you step in ------------------------- */

.cond-insight { border: 1px solid var(--border); border-radius: var(--r); }
.cond-insight + .cond-insight { margin-top: 6px; }
.cond-insight-summary {
	display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; width: 100%; min-height: 40px; padding: 6px 10px;
	border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.cond-insight-summary:hover .cond-insight-name { text-decoration: underline; text-underline-offset: 3px; }
.cond-insight-name { min-width: 120px; font: 600 12.5px/1.4 var(--mono); color: var(--accent-hi); }
.cond-insight-mean { font: 500 12.5px var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.cond-insight-trend { min-width: 72px; font-size: 12px; color: var(--text-3); }
.cond-insight-trend.down { color: var(--ok); }
.cond-insight-trend.up { color: #ffc45c; }
.cond-spark { flex: 0 0 auto; fill: var(--text-3); }
.cond-insight-gates { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cond-gate-state { padding: 0 6px; border-radius: var(--r-sm); font-size: 11px; font-weight: 600; white-space: nowrap; }
.cond-gate-state.relaxed { background: var(--accent-wash); color: var(--accent-hi); }
.cond-gate-state.ready { background: rgba(255, 196, 92, .14); color: #ffc45c; }
.cond-insight-summary .codicon-chevron-right { margin-left: auto; color: var(--text-3); transition: transform .16s var(--ease); }
.cond-insight.open .cond-insight-summary .codicon-chevron-right { transform: rotate(90deg); }
.cond-insight-detail { padding: 2px 12px 12px; }
.cond-quiet {
	margin-top: 8px; padding: 0; border: 0; background: none; color: var(--text-3);
	font: inherit; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.cond-quiet:hover { color: var(--text); }
.cond-jobs, .cond-gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.cond-jobs li { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; align-items: center; gap: 8px; }
.cond-job-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.cond-job-bar { position: relative; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.cond-job-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: #ffc45c; }
.cond-job-count { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.cond-gates { margin-top: 8px; }
.cond-gates li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--text-2); }
.cond-gate-step { font: 500 12px/1.4 var(--mono); color: var(--text); }
.cond-gate-count { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cond-gate-relaxed { flex: 0 0 auto; padding: 0 6px; border-radius: var(--r-sm); background: var(--accent-wash); color: var(--accent-hi); font-size: 11px; font-weight: 600; }
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* The preview panel and Preview chips (04-preview-panel.md §1). New rules only: app.css is unchanged. */

@media (min-width: 1100px) {
	#app.preview-open { grid-template-columns: var(--rail) minmax(0, 1fr) minmax(360px, calc((100vw - var(--rail)) * var(--preview-frac, .5))); }
	/* The doc and the preview share the slot: the Doc | Preview switch picks one. */
	#app.preview-open > .doc { display: none !important; }
}

.preview-panel {
	position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0;
	background: var(--surface); border-left: 1px solid var(--border);
	padding-top: var(--safe-t); padding-right: var(--safe-r);
}
@media (max-width: 1099px) {
	.preview-panel { position: fixed; inset: 0; z-index: 26; border-left: 0; padding-left: var(--safe-l); }
	.preview-splitter { display: none; }
}

.preview-head { display: flex; align-items: center; gap: 4px; min-height: 48px; padding: 6px 8px 6px 10px; border-bottom: 1px solid var(--border); touch-action: pan-x; }
.preview-tabs { display: flex; flex: 1; min-width: 0; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.preview-tabs::-webkit-scrollbar { display: none; }
.preview-tab { display: flex; align-items: center; flex: none; max-width: 200px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.preview-tab.active { border-color: var(--border-strong); background: var(--surface-3); }
.preview-tab-title {
	display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 30px; padding: 0 4px 0 10px;
	border: 0; background: none; color: var(--text); font: 500 12.5px/1 var(--sans);
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer;
}
.preview-tab-close { display: grid; place-items: center; width: 26px; height: 30px; border: 0; background: none; color: var(--text-3); cursor: pointer; }
.preview-tab-close:hover { color: var(--text); }
.preview-live { width: 7px; height: 7px; flex: none; border-radius: var(--r-pill); background: var(--text-3); }
.preview-live.on { background: var(--ok); }

.preview-slot { display: inline-flex; flex: none; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
.preview-slot button { height: 26px; padding: 0 10px; border: 0; border-radius: 5px; background: none; color: var(--text-2); font: 600 12px/1 var(--sans); cursor: pointer; }
.preview-slot button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.doc-head .preview-slot { margin-right: 8px; }

.preview-list { max-height: 45%; overflow: auto; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.preview-list ul { list-style: none; margin: 0; padding: 4px 0; }
.preview-list li { display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.preview-list-open { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 8px 4px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.preview-list-open:disabled { opacity: .55; cursor: default; }
.preview-list-title { font: 600 13px/1.3 var(--sans); }
.preview-list-where { font: 400 11px/1.4 var(--mono); color: var(--text-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview-list-left { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.preview-list-note { margin: 0; padding: 12px 14px; font-size: 12.5px; color: var(--text-2); }
.preview-list-note.error { color: var(--danger); }

.preview-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--bg); }
.preview-frame-box { position: absolute; inset: 0; overflow: hidden; }
.preview-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.preview-frame-box.fixed { overflow: auto; }
.preview-hint {
	position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
	margin: 0; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r);
	background: rgba(19, 21, 32, .94); color: var(--text-2); font-size: 12.5px;
}
.preview-card { display: grid; place-content: center; justify-items: center; gap: 12px; height: 100%; padding: 24px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.preview-card p { margin: 0; max-width: 36ch; }
.preview-media { display: grid; place-items: center; height: 100%; padding: 16px; overflow: auto; }
.preview-image, .preview-video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); background: repeating-conic-gradient(#1c1f30 0 25%, #131520 0 50%) 0 0 / 16px 16px; }
.preview-markdown { height: 100%; overflow: auto; padding: 20px 22px calc(24px + var(--safe-b)); }
.preview-markdown .body { font-size: 13.5px; max-width: 760px; }

.preview-bar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 6px 8px calc(6px + var(--safe-b)); border-top: 1px solid var(--border); }
.preview-auto { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px; font-size: 12px; color: var(--text-2); }
.preview-widths { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); }
.preview-widths button { height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--text-2); font: 500 11.5px/1 var(--mono); cursor: pointer; }
.preview-widths button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.preview-note { flex: 1; min-width: 60px; font-size: 11.5px; color: var(--text-3); text-align: right; padding-right: 4px; }

.preview-splitter { position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; cursor: col-resize; touch-action: none; z-index: 1; }
.preview-splitter:hover { background: linear-gradient(90deg, transparent 3px, var(--accent) 3px 5px, transparent 5px); }

.preview-chip {
	display: inline-flex; align-items: center; gap: 4px; margin: 0 0 0 6px; padding: 1px 8px;
	border: 1px solid var(--border-strong); border-radius: var(--r-sm);
	background: var(--surface-2); color: var(--accent-hi);
	font: 600 11.5px/1.55 var(--sans); vertical-align: 1px; cursor: pointer; -webkit-touch-callout: none;
}
.preview-chip:hover { background: var(--surface-3); }
.preview-chip .codicon { font-size: 12px; }

/* 3D models (ModelViewer.tsx) */
.model-viewer { position: relative; width: 100%; height: 100%; min-height: 240px; overflow: hidden; background: #12141c; }
.model-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.model-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--text-2); font: 500 13px/1.4 var(--sans); text-align: center; pointer-events: none; }
.model-overlay.error { color: var(--text); pointer-events: auto; }
.model-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--r); background: rgba(13, 14, 21, .82); backdrop-filter: blur(6px); }
.model-bar .btn { min-height: 28px; padding: 0 10px; font-size: 12px; }
.model-bar .btn.on { background: var(--accent-wash); color: var(--accent-hi); }
.model-bar select { min-height: 28px; font-size: 12px; }
.model-info { margin-left: auto; color: var(--text-3); font: 500 11.5px/1.3 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* Settings › Performance: every Mac stacked in one scroll, htop-style. Settings › Machines: the pool and placements, below. */

.machine-list { list-style: none; margin: 0; padding: 0; }
.machine { padding-bottom: 18px; }
.machine + .machine { padding-top: 4px; border-top: 1px solid var(--border); }

/* The heading stays at the top of the panel while you scroll through that Mac (over the panel's 18 px padding). */
.machine-head {
	position: sticky; top: -18px; z-index: 2;
	display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
	margin: 0 -22px; padding: 12px 22px 10px;
	background: var(--surface);
}
.machine-head .icon-btn { width: 28px; height: 28px; }
.machine-head .host-rank { width: auto; min-width: 14px; }
.machine-name {
	min-width: 0; max-width: 40%; padding: 0; border: 0; background: none;
	color: var(--text); font-size: 15.5px; font-weight: 600; text-align: left;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.machine-name:not(:disabled):not(.static):hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.machine-name:disabled { cursor: default; }
.machine-state { font-size: 12px; color: var(--text-2); }
.machine.active .machine-state { color: var(--ok); }
.machine-head .grow { flex: 1 1 auto; }
.machine-stat { font: 500 12px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.machine-spark { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-hi); font-size: 10.5px; }
.machine-spark span { color: var(--text-3); }
.machine-spark svg { display: block; }

.machine.offline { padding-bottom: 0; opacity: .6; }
.machine.offline .machine-head { position: static; }

.card .settings-panel p.machine-note { margin: 4px 0 10px; color: var(--text-2); font-size: 12.5px; }
.card .settings-panel p.machine-note.error { color: var(--danger); }

/* Bars: label, track, value. */
.meter { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.meter-label { font: 500 11px var(--mono); color: var(--text-3); text-align: right; }
.meter-track { display: flex; height: 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter-fill { height: 100%; background: var(--ok); transition: width .35s var(--ease); }
.meter-fill.mid { background: #f0b446; }
.meter-fill.high { background: var(--danger); }
.meter-fill.used { background: var(--ok); }
.meter-fill.wired { background: var(--accent-hi); }
.meter-fill.cache { background: #f0b446; opacity: .55; }
.meter-fill.swap { background: var(--danger); }
.meter-fill.disk { background: var(--accent-hi); }
.meter-text { min-width: 46px; font: 500 11.5px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.machine-cores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 18px; margin: 4px 0 10px; }
.machine-cores .meter { grid-template-columns: 22px minmax(0, 1fr) 38px; }
.machine-cores .meter-text { min-width: 0; }
.machine-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 6px 18px; margin-bottom: 10px; }

.machine-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.machine-chip {
	padding: 1px 8px; border: 1px solid var(--border); border-radius: var(--r-pill);
	color: var(--text-2); font-size: 11.5px; white-space: nowrap;
}

/* The process table's fold: one row naming the busiest three; a tap unfolds the table under it. */
.proc-toggle {
	display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 30px; padding: 4px 10px;
	border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
	color: var(--text-2); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.proc-toggle:hover { color: var(--text); background: var(--surface-3); }
.proc-toggle:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.proc-toggle[aria-expanded="true"] { margin-bottom: 6px; }
.proc-chev { flex: 0 0 auto; font-size: 12px; transition: transform .15s var(--ease); }
.proc-toggle[aria-expanded="true"] .proc-chev { transform: rotate(90deg); }
.proc-toggle-label { flex: 0 0 auto; font-weight: 600; color: var(--text); }
.proc-toggle-top { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-3); font: 500 11.5px var(--mono); font-variant-numeric: tabular-nums; }

/* The process table: read-only, monospace numbers, the command takes what is left. */
.proc-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.proc-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12px; }
.proc-table th, .proc-table td { padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-table th { background: var(--surface-2); color: var(--text-3); font: 600 11px var(--sans); text-align: left; }
.proc-table th.num, .proc-table td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.proc-table th:nth-child(1) { width: 72px; }
.proc-table th:nth-child(2) { width: 92px; }
.proc-table th:nth-child(3), .proc-table th:nth-child(4) { width: 66px; }
.proc-table th:nth-child(5) { width: 64px; }
.proc-table th:nth-child(6) { width: 84px; }
.proc-table tbody tr { border-top: 1px solid var(--border); }
.proc-table tbody tr.proc:hover { background: var(--surface-2); }
.proc-sort {
	display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none;
	color: inherit; font: inherit; cursor: pointer;
}
.proc-sort:hover, .proc-sort.active { color: var(--text); }
.proc-sort .codicon { font-size: 11px; }
.proc-user { color: var(--text-2); }
.proc-cmd { display: flex; align-items: center; gap: 6px; }
.proc-cmd-btn {
	display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto;
	padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.proc-cmd-btn .codicon { color: var(--accent-hi); font-size: 12px; flex: 0 0 auto; }
.proc-name { flex: 0 0 auto; font-weight: 600; }
.proc-args { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); font-family: var(--mono); font-size: 11.5px; }
.proc-badge {
	flex: 0 0 auto; padding: 0 6px; border-radius: var(--r-pill);
	background: var(--accent-wash); color: var(--accent-hi); font-size: 10.5px; font-weight: 600;
}
.proc.agent .proc-name { color: var(--accent-hi); }
.proc-full td { white-space: normal; padding: 4px 8px 8px 80px; }
.proc-full code { font: 400 11.5px/1.5 var(--mono); color: var(--text-2); overflow-wrap: anywhere; }

/* --- The work pool and the last placements (hosts.profiles, hosts.placements) --- */

.machines > section + section { margin-top: 26px; }
.card .settings-panel p.pool-intro { margin: 0 0 12px; color: var(--text-2); font-size: 12.5px; }
.card .settings-panel p.pool-note { margin: 0 0 10px; color: var(--text-2); font-size: 12.5px; }
.card .settings-panel p.pool-note.error { color: var(--danger); }

.pool-list, .placement-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }
.pool-row { display: grid; gap: 8px; padding: 10px 12px; }
.pool-row + .pool-row, .placement + .placement { border-top: 1px solid var(--border); }
.pool-row.offline .pool-name, .pool-row.offline .pool-load { color: var(--text-3); }
.pool-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.pool-line .grow { flex: 1 1 auto; }
.pool-name { font-size: 14.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.pool-load { font: 500 11.5px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pool-state {
	padding: 1px 9px; border: 1px solid var(--border); border-radius: var(--r-pill);
	font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--text-2);
}
.pool-state.pool { border-color: color-mix(in srgb, var(--ok) 55%, transparent); color: var(--ok); }
.pool-state.lent { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-hi); }
.pool-state.opt-in { border-style: dashed; }
.pool-state.out { color: var(--text-3); }
.pool-state.draining { border-color: #ffc45c; background: rgba(255, 196, 92, .08); color: #ffc45c; }
.pool-drain { min-height: 30px; padding: 0 12px; font-size: 12.5px; }

.pool-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-2); }
.card .pool-field { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--text-2); }
.pool-field-label { color: var(--text-3); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.pool-select { min-height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font: inherit; }
.card .pool-speed { width: 64px; min-height: 30px; padding: 0 8px; font: 500 12.5px var(--mono); }
.pool-tags { flex-wrap: wrap; }
.pool-tag { padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 11.5px; }
.pool-tag.none { background: none; }
.pool-saving { color: var(--text-3); font-size: 12px; }
/* Who last changed this machine's settings, and when (small). */
.card .settings-panel p.pool-changed { margin: 0; color: var(--text-3); font-size: 11.5px; }
.card .settings-panel p.pool-error { margin: 0; color: var(--danger); font-size: 12.5px; }

.pool-confirm {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px;
	border: 1px solid var(--danger); border-radius: var(--r); background: var(--danger-wash); font-size: 12.5px; color: var(--text);
}
.pool-confirm > span:first-child { flex: 1 1 260px; }
.pool-confirm-actions { display: inline-flex; gap: 8px; }
.pool-confirm .btn { min-height: 30px; font-size: 12.5px; }
.pool-confirm .btn.danger { border-color: var(--danger); background: var(--danger); color: #fff; }

/* The MacBook's "Add this Mac to the network": a switch and three durations. */
.pool-lend {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 10px 12px;
	border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
}
.pool-lend.on { border-color: var(--accent); background: var(--accent-wash); }
.card .lend-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
/* The real checkbox covers the whole switch and its words, invisibly: taps and the keyboard reach it. */
.lend-switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.lend-switch input:disabled { cursor: default; }
.lend-track {
	position: relative; flex: 0 0 auto; width: 38px; height: 22px; border-radius: var(--r-pill);
	background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .15s var(--ease), border-color .15s var(--ease);
}
.lend-thumb {
	position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
	background: var(--text-2); transition: transform .15s var(--ease), background .15s var(--ease);
}
.lend-switch input:checked + .lend-track { background: var(--accent); border-color: transparent; }
.lend-switch input:checked + .lend-track .lend-thumb { transform: translateX(16px); background: var(--accent-ink); }
.lend-switch input:focus-visible + .lend-track { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.lend-switch input:disabled + .lend-track { opacity: .5; }
.lend-choices { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-pill); overflow: hidden; }
.lend-choice {
	min-height: 28px; padding: 0 12px; border: 0; background: transparent; color: var(--text-2);
	font: inherit; font-size: 12.5px; cursor: pointer;
}
.lend-choice + .lend-choice { border-left: 1px solid var(--border); }
.lend-choice:hover:not(:disabled) { color: var(--text); background: var(--surface-3); }
.lend-choice.active { background: var(--accent-wash); color: var(--text); font-weight: 600; }
.lend-choice:disabled { opacity: .5; cursor: default; }
.card .settings-panel p.lend-summary { flex-basis: 100%; margin: 0; color: var(--text-2); font-size: 12px; }

/* The last 20 placements: when, what, where, project, needs; why underneath. */
.placement { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 12px; font-size: 12.5px; }
.placement-time { min-width: 44px; font: 500 12px var(--mono); color: var(--text-2); font-variant-numeric: tabular-nums; }
.placement-kind { padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: 11.5px; }
.placement-machine { font-weight: 600; color: var(--text); }
.placement-machine.refused { padding: 0 7px; border-radius: var(--r-pill); background: var(--danger-wash); color: var(--danger); font-size: 11.5px; }
.placement-badge { padding: 0 6px; border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-3); font-size: 10.5px; }
.placement-project { color: var(--text-2); }
.placement-needs { color: var(--text-3); font-size: 11.5px; }
.card .settings-panel p.placement-why { flex-basis: 100%; margin: 0; padding-left: 54px; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.placement.refused { background: color-mix(in srgb, var(--danger) 6%, transparent); box-shadow: inset 3px 0 0 var(--danger); }
.placement.refused .placement-why strong { color: var(--danger); font-weight: 600; }

/* Over the composer: where New Chat on Auto went. */
.placement-note .icon-btn { width: 26px; height: 26px; }
.placement-note.fallback > .codicon { color: #ffc45c; }

@media (max-width: 700px) {
	.machine-head { top: -14px; margin: 0 -14px; padding: 10px 14px 8px; }
	.machine-name { max-width: 60%; }
	.machine-head .grow { flex-basis: 100%; height: 0; }
	.proc-table { min-width: 560px; }
	.proc-full td { padding-left: 8px; }
	.pool-row { padding: 10px; }
	.pool-load { flex-basis: 100%; order: 3; }
	.pool-fields { gap: 8px 14px; }
	.lend-choices { width: 100%; }
	.lend-choice { flex: 1 1 0; padding: 0 6px; }
	.card .settings-panel p.placement-why { padding-left: 0; }
}
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* Settings › Automation › Schedules. New rules only: app.css is the vanilla page's, unchanged. */

.schedules-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.card .schedules-head h3.sheet-heading { flex: 1 1 auto; margin: 0; }
.schedules-filter {
	min-height: 30px; max-width: 220px; padding: 0 8px;
	border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); font-size: 12.5px;
}
.schedules-head .btn { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.card .schedules-settings > p { margin: 0 0 10px; font-size: 13px; }
.card .schedules-settings > p.schedules-intro { color: var(--text-3); font-size: 12.5px; }
.card .schedules-settings > p.schedules-error { color: var(--danger); }
.schedules-empty { color: var(--text-2); }

.schedules-group { margin-top: 12px; }
.schedules-group h4 {
	display: flex; align-items: center; gap: 6px; margin: 0 0 4px;
	font: 600 11px/1.3 var(--sans); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
}
.schedules-group.attention h4 { color: #ffc45c; }
.schedules-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }

.schedule { font-size: 13px; }
.schedule + .schedule { border-top: 1px solid var(--border); }
.schedule-line { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 8px; }
.schedule.attention .schedule-line { background: rgba(255, 196, 92, .06); }
.schedule.paused .schedule-title, .schedule.paused .schedule-when, .schedule.paused .schedule-next { opacity: .6; }

/* The On switch, drawn as a dot. */
.card .schedule-toggle { display: inline-grid; place-items: center; flex: 0 0 auto; width: 24px; height: 24px; margin: 0; cursor: pointer; }
.schedule-toggle input {
	appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin: 0;
	border: 2px solid var(--text-3); border-radius: var(--r-pill); background: transparent; cursor: pointer;
}
.schedule-toggle input:checked { border-color: var(--ok); background: var(--ok); }
.schedule.attention .schedule-toggle input:checked { border-color: #ffc45c; background: #ffc45c; }
.schedule-toggle input:disabled { opacity: .5; cursor: default; }
.schedule-toggle input:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }

.schedule-open {
	flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap;
	padding: 4px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.schedule-title { font-weight: 600; overflow-wrap: anywhere; }
.schedules-project-name { padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-3); font-size: 11px; }
.schedule-when { color: var(--text-2); }
.schedule-next { color: var(--text-3); font-size: 12px; }
.schedule-next.schedule-problem { color: #ffc45c; }
.schedule-open:hover .schedule-title { color: var(--accent-hi); }

.schedule-last { flex: 0 0 auto; display: inline-flex; align-items: center; color: var(--text-3); font-size: 12px; }
.schedule-last.none { font-size: 11.5px; }
.schedule-last .codicon { font-size: 14px; }
.schedule-last.started .codicon { color: var(--ok); }
.schedule-last.failed .codicon, .schedule-last.missed .codicon { color: var(--danger); }
.schedule-link {
	display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
	border: 0; border-radius: var(--r-pill); background: none; color: inherit; cursor: pointer;
}
.schedule-link:hover { background: var(--surface-2); }
.schedule-run { flex: 0 0 auto; min-height: 28px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.schedule-chevron { flex: 0 0 auto; color: var(--text-3); transition: transform .16s var(--ease); }
.schedule.open .schedule-chevron { transform: rotate(90deg); }

.schedule-note { margin: -2px 0 6px 40px; color: var(--text-2); font-size: 12px; }
.schedule-detail { padding: 2px 12px 12px 40px; }
.schedule-facts { margin: 0 0 8px; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 12.5px; }
.schedule-facts dt { color: var(--text-3); }
.schedule-facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.schedule-hook, .schedule-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.schedule-hook code, .schedule-secret code {
	min-width: 0; max-width: 100%; padding: 2px 6px; border-radius: var(--r-sm);
	background: var(--surface-2); font-size: 11.5px; overflow-wrap: anywhere;
}
.schedule-secret { padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); }
.schedule-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.schedule-actions .grow { flex: 1 1 auto; }
.schedule-actions .btn, .schedule-hook .btn, .schedule-secret .btn { min-height: 28px; }
.schedules-settings .btn.danger { border-color: var(--danger); background: var(--danger-wash); color: var(--text); }

@media (max-width: 600px) {
	.schedule-detail { padding-left: 12px; }
	.schedule-note { margin-left: 12px; }
	.schedule-facts { grid-template-columns: 1fr; gap: 0; }
	.schedule-facts dd { margin-bottom: 6px; }
}
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* Settings › Forged Tracker. New rules only: app.css is the vanilla page's, unchanged. */

.card .tracker-settings > p { margin: 0 0 10px; font-size: 13px; }
.card .tracker-settings > p.tracker-error { color: var(--danger); }
.tracker-empty, .tracker-hosts { color: var(--text-3); }
.card .tracker-settings > p.tracker-hosts { margin-top: 10px; font-size: 12px; }
.card .tracker-settings > p.tracker-note { color: var(--ok); }

.tracker-links { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }
.tracker-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 13px; }
.tracker-link + .tracker-link { border-top: 1px solid var(--border); }
.tracker-link-main { flex: 1 1 auto; min-width: 0; }
.tracker-link-name { font-weight: 600; overflow-wrap: anywhere; }
.tracker-link-folder { color: var(--text-2); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.tracker-link-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 2px; color: var(--text-3); font-size: 12px; }
.tracker-link-run {
	padding: 0; border: 0; background: none; color: var(--accent-hi); font: inherit; cursor: pointer; text-align: left;
}
.tracker-link-run:hover { text-decoration: underline; }
.tracker-link-broken { color: var(--danger); }
.tracker-link.broken .tracker-link-name { opacity: .7; }
.tracker-link-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.tracker-link-actions .btn { min-height: 30px; padding: 0 10px; font-size: 12.5px; }

.tracker-link-form { padding: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.tracker-link-form h4 { margin: 0 0 4px; font: 600 11px/1.3 var(--sans); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.card .tracker-link-form p.tracker-hint { margin: 0 0 8px; color: var(--text-3); font-size: 12.5px; }
.tracker-code-row { display: flex; gap: 8px; align-items: center; }
.card .tracker-code-row .field { flex: 1 1 auto; min-width: 0; margin: 0; padding: 8px 10px; text-transform: uppercase; }
.tracker-code-row .btn { flex: 0 0 auto; }
.tracker-preview { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; }
.tracker-folder {
	min-height: 34px; padding: 0 8px; max-width: 100%;
	border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 13px;
}
.tracker-preview-actions { display: flex; gap: 8px; }
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/* Chat heads (03-chat-heads.md §2–§3). New rules only: app.css is the vanilla page's, unchanged. */

.heads {
	--head-h: 32px;
	--head-max: 220px;
	--head-amber: #e8a33d;
	--head-gold: #e0b44c;
	position: fixed;
	z-index: 30;
	right: calc(12px + var(--safe-r));
	pointer-events: none;
}
.heads.side-left { right: auto; left: calc(12px + var(--safe-l)); }
@media (pointer: coarse) { .heads { --head-h: 36px; } }
@media (max-width: 900px) { .heads { --head-max: 180px; } }

/* Pills line up on the edge they're docked to. */
.heads-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.side-left .heads-stack { align-items: flex-start; }

.head-wrap { position: relative; display: flex; max-width: var(--head-max); pointer-events: auto; }
/* Only the head you drag moves; the rest stay put. */
.head-wrap.dragged { z-index: 1; transition: none; }
.head-wrap.dragged .head { box-shadow: 0 10px 28px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .45); }

.head {
	position: relative; display: flex; align-items: center; gap: 7px;
	min-width: 0; max-width: 100%; height: var(--head-h); padding: 0 11px 0 6px;
	border: 1px solid var(--border-strong); border-radius: var(--r-pill);
	background: var(--surface-2); color: var(--text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .4), 0 1px 3px rgba(0, 0, 0, .45);
	cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none;
	-webkit-touch-callout: none; overflow: hidden;
	animation: head-in .24s var(--ease);
}
.head:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.head.client { border-color: var(--head-gold); box-shadow: 0 0 0 1px var(--head-gold), 0 4px 14px rgba(0, 0, 0, .4); }
.head.state-recent { opacity: .62; }
.head.state-idle, .head.state-pinned { opacity: .85; }
.head.bounce { animation: head-bounce .6s var(--ease); }

.head-avatar {
	display: grid; place-items: center; flex: none; width: 20px; height: 20px;
	border-radius: var(--r-pill); background: var(--head-color, var(--surface-3)); overflow: hidden;
}
.head-icon { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.head-client { display: grid; place-items: center; color: #fff; }
.head-client .codicon { font-size: 12px; }
.head-name { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 13px/1.2 var(--sans); }

.head-badge {
	flex: none; min-width: 18px; height: 18px; padding: 0 5px;
	border-radius: var(--r-pill); background: var(--head-amber); color: #1a1205;
	font: 700 11px/18px var(--sans); text-align: center;
}
.head-spinner {
	flex: none; width: 12px; height: 12px; box-sizing: border-box;
	border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--text); border-radius: var(--r-pill);
	animation: head-spin .9s linear infinite;
}
.head-dot { flex: none; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
.head-done {
	display: grid; place-items: center; flex: none; width: 16px; height: 16px;
	border-radius: var(--r-pill); background: var(--ok); color: #05222b;
}
.head-done .codicon { font-size: 10px; }
/* An open notice (notify-window README §4.4): a bell, amber for high and urgent, blue otherwise. */
.head-notice {
	display: inline-flex; align-items: center; justify-content: center; gap: 3px; flex: none;
	min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
	border-radius: var(--r-pill); background: var(--accent); color: #fff;
	font: 700 11px/18px var(--sans);
}
.head-notice.amber { background: var(--head-amber); color: #1a1205; }
.head-notice .codicon { font-size: 11px; }
.head-notice-count { line-height: 18px; }
.head.has-notice { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.head.has-notice.amber { border-color: color-mix(in srgb, var(--head-amber) 55%, var(--border-strong)); }
/* The notification window is open beside this head. */
.head.anchored { border-color: var(--accent-hi); box-shadow: 0 0 0 1px var(--accent-hi), 0 4px 14px rgba(0, 0, 0, .4); }
.head.has-notice.amber.anchored { border-color: var(--head-amber); box-shadow: 0 0 0 1px var(--head-amber), 0 4px 14px rgba(0, 0, 0, .4); }
.head-progress { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .14); pointer-events: none; }
.head-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent-hi); }
.head-more { padding: 0 12px; background: var(--surface-3); }

.head-bubble {
	position: absolute; top: 50%; right: calc(100% + 10px); transform: translateY(-50%);
	width: max-content; max-width: min(280px, 60vw); padding: 7px 11px;
	border: 1px solid var(--border-strong); border-radius: var(--r);
	background: var(--surface-2); color: var(--text); text-align: left;
	font: 500 12.5px/1.35 var(--sans); box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
	animation: head-in .2s var(--ease);
}
.side-left .head-bubble { right: auto; left: calc(100% + 10px); }

.heads-target {
	position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%);
	display: grid; place-items: center; width: 56px; height: 56px;
	border: 1px solid var(--border-strong); border-radius: var(--r-pill);
	background: rgba(13, 14, 21, .85); color: var(--text); pointer-events: none;
	transition: transform .15s var(--ease), background .15s var(--ease);
}
.heads-target .codicon { font-size: 22px; }
.heads-target.over { transform: translateX(-50%) scale(1.18); background: var(--danger); color: #fff; }

.heads-menu {
	position: fixed; z-index: 31; display: flex; flex-direction: column; min-width: 210px; padding: 6px;
	border: 1px solid var(--border-strong); border-radius: var(--r);
	background: var(--surface-2); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); pointer-events: auto;
}
.heads-menu-title { padding: 6px 10px 4px; font: 600 11px/1.3 var(--sans); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.heads-menu button {
	display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px;
	border: 0; border-radius: var(--r-sm); background: none; color: var(--text);
	font: 500 13px/1.3 var(--sans); text-align: left; cursor: pointer;
}
@media (pointer: coarse) { .heads-menu button { min-height: 42px; } }
.heads-menu button:hover, .heads-menu button:focus-visible { background: var(--surface-3); outline: 0; }
.heads-menu-sub { justify-content: space-between; }
.heads-snooze { display: flex; flex-direction: column; margin: 2px 0 4px 10px; padding-left: 6px; border-left: 1px solid var(--border-strong); }
.heads-mini { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-pill); color: #fff; font: 700 10px/1 var(--sans); flex: none; }
.heads-overflow-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.heads-overflow-needs { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--head-amber); color: #1a1205; font: 700 10.5px/18px var(--sans); text-align: center; }
.heads-overflow-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }

.heads-toast {
	position: fixed; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%);
	display: flex; align-items: center; gap: 10px; padding: 8px 14px;
	border: 1px solid var(--border-strong); border-radius: var(--r);
	background: var(--surface-2); color: var(--text); font: 500 13px/1.3 var(--sans);
	box-shadow: 0 10px 28px rgba(0, 0, 0, .5); pointer-events: none; white-space: nowrap;
	animation: head-in .2s var(--ease);
}

/* Settings › Heads */
.heads-settings label { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.heads-settings select { min-height: 32px; }
.heads-snoozed { list-style: none; margin: 8px 0 0; padding: 0; }
.heads-snoozed li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.heads-snoozed li .grow { flex: 1; min-width: 0; }
.heads-snoozed .until { color: var(--text-3); font-size: 12px; }

/* Chat list labels: Conductor chats, chats a Conductor opened, scheduled chats, Client Chat sessions. */
.session-label { padding: 0 6px; border-radius: var(--r-sm); background: var(--accent-wash); color: var(--accent-hi); font-weight: 600; }
.session-label.link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.session-label.client { background: rgba(224, 180, 76, .16); color: #e0b44c; }

/* The workspace picker's project menu. */
.workspace-menu { position: fixed; z-index: 45; }

@keyframes head-in { from { opacity: 0; transform: scale(.7); } }
@keyframes head-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } 55% { transform: translateY(0); } 75% { transform: translateY(-4px); } }
@keyframes head-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.head, .head.bounce, .head-bubble, .heads-toast { animation: none; }
	.head-spinner { animation-duration: 4s; }
}
.chat-row-menu { position: fixed; z-index: 45; }
.heads-menu button:disabled { color: var(--text-3); cursor: default; background: none; }
/* Copyright (c) Microsoft Corporation. Licensed under the MIT License. */

/*
 * Notification toast, floating mini-chat window, and Settings › Notifications controls (§4.1).
 * Uses Flow's existing dark UI tokens from styles/app.css and heads/heads.css.
 */

.notice-layer {
	position: fixed;
	inset: 0;
	z-index: 36;
	pointer-events: none;
}

/* --- Collapsed 320 px Toast ------------------------------------------- */

.notice-toast {
	position: fixed;
	top: max(calc(12px + var(--safe-t)), var(--notice-toast-top, 58px));
	width: 320px;
	max-width: calc(100vw - 24px - var(--safe-l) - var(--safe-r));
	padding: 11px 12px;
	border-radius: 12px;
	background: rgba(19, 21, 32, 0.97);
	border: 1px solid var(--border-strong);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52), 0 2px 8px rgba(0, 0, 0, 0.32);
	backdrop-filter: blur(18px);
	-webkit-backdrop-filter: blur(18px);
	color: var(--text);
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	animation: noticeToastIn 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.notice-toast.is-right {
	right: calc(var(--notice-stack-offset, 16px) + var(--safe-r));
}

.notice-toast.is-left {
	left: calc(var(--notice-stack-offset, 16px) + var(--safe-l));
}

.notice-toast.is-amber {
	border-color: rgba(232, 163, 61, 0.48);
}

.notice-toast.priority-urgent {
	border-color: rgba(239, 68, 68, 0.58);
}

@keyframes noticeToastIn {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.notice-toast-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	min-width: 0;
}

.notice-toast-source {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text-2);
	font: 600 11.5px/1.2 var(--sans);
	cursor: pointer;
	text-align: left;
}

.notice-toast-glyph,
.notice-window-glyph {
	font-size: 13px;
	color: var(--accent);
	flex-shrink: 0;
}

.notice-toast.is-amber .notice-toast-glyph,
.notice-window.priority-high .notice-window-glyph {
	/* The head's amber bell (heads.css --head-amber), not the theme's cyan --warn. */
	color: #e8a33d;
}

.notice-toast.priority-urgent .notice-toast-glyph,
.notice-window.priority-urgent .notice-window-glyph {
	color: var(--danger);
}

.notice-toast-source-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-project-pill {
	display: inline-flex;
	align-items: center;
	max-width: 120px;
	padding: 1px 6px;
	border-radius: 5px;
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text-2);
	font: 500 10.5px/1.3 var(--sans);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex-shrink: 0;
}

.notice-toast-controls {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
}

.notice-icon-btn {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text-3);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color 120ms ease, color 120ms ease;
}

.notice-icon-btn:hover {
	background: var(--surface-3);
	color: var(--text);
}

.notice-icon-btn .codicon {
	font-size: 13px;
}

.notice-toast-main {
	display: flex;
	flex-direction: column;
	gap: 3px;
	cursor: pointer;
	min-width: 0;
}

.notice-toast-title {
	font: 600 13px/1.3 var(--sans);
	color: var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-toast-body {
	font: 400 12px/1.35 var(--sans);
	color: var(--text-2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-toast-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 2px;
}

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

.notice-suggestion-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 10px;
	border-radius: 7px;
	border: 1px solid var(--border-strong);
	background: var(--surface-2);
	color: var(--text);
	font: 500 12px/1.25 var(--sans);
	cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.notice-suggestion-btn:hover:not(:disabled) {
	background: var(--surface-3);
	border-color: rgba(255, 255, 255, 0.22);
}

.notice-suggestion-btn.is-primary {
	background: var(--accent);
	border-color: rgba(73, 97, 218, 0.65);
	color: #fff;
}

.notice-suggestion-btn.is-primary:hover:not(:disabled) {
	background: var(--accent-hi);
}

.notice-suggestion-btn.is-danger {
	background: rgba(239, 68, 68, 0.16);
	border-color: rgba(239, 68, 68, 0.45);
	color: #fca5a5;
}

.notice-suggestion-btn.is-danger:hover:not(:disabled) {
	background: rgba(239, 68, 68, 0.26);
}

.notice-suggestion-btn:disabled {
	opacity: 0.48;
	cursor: not-allowed;
}

/* --- Expanded Window (360×520 on ≥901px, 72% Bottom Sheet on ≤900px) --- */

.notice-window {
	position: fixed;
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	color: var(--text);
	pointer-events: auto;
	overflow: hidden;
}

.notice-window.is-floating {
	top: max(calc(12px + var(--safe-t)), var(--notice-window-top, 58px));
	width: 360px;
	/* As tall as its content, up to 520 px: a one-line notice isn't a mostly empty box. */
	height: auto;
	max-height: min(520px, calc(100dvh - 24px - var(--safe-t) - var(--safe-b)));
	border-radius: 14px;
}

.notice-window.is-floating.is-right {
	right: calc(var(--notice-stack-offset, 16px) + var(--safe-r));
}

.notice-window.is-floating.is-left {
	left: calc(var(--notice-stack-offset, 16px) + var(--safe-l));
}

.notice-window.is-sheet {
	left: calc(8px + var(--safe-l));
	right: calc(8px + var(--safe-r));
	bottom: var(--notice-sheet-bottom, 74px);
	height: 72dvh;
	max-height: calc(100dvh - var(--notice-sheet-bottom, 74px) - 8px - var(--safe-t));
	border-radius: 16px;
}

@media (max-width: 900px) {
	.notice-window {
		left: calc(8px + var(--safe-l));
		right: calc(8px + var(--safe-r));
		bottom: var(--notice-sheet-bottom, 74px);
		top: auto;
		width: auto;
		height: 72dvh;
		max-height: calc(100dvh - var(--notice-sheet-bottom, 74px) - 8px - var(--safe-t));
		border-radius: 16px;
	}
}

/* --- Window Header & ⋯ Menu ------------------------------------------- */

.notice-window-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.015);
	flex-shrink: 0;
}

.notice-window-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	flex: 1;
}

.notice-window-source {
	font: 600 12px/1.2 var(--sans);
	color: var(--text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-window-age {
	font: 400 11px/1.2 var(--sans);
	color: var(--text-3);
	flex-shrink: 0;
}

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

.notice-pager {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 1px 4px;
	border-radius: 6px;
	background: var(--surface);
	border: 1px solid var(--border);
}

.notice-pager-count {
	font: 500 11px/1.2 var(--sans);
	font-variant-numeric: tabular-nums;
	color: var(--text-2);
	padding: 0 3px;
}

.notice-menu-anchor {
	position: relative;
	display: inline-flex;
}

.notice-menu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	z-index: 40;
	min-width: 200px;
	padding: 4px;
	border-radius: 10px;
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.notice-menu-heading {
	padding: 5px 9px 3px;
	font: 600 10.5px/1.2 var(--sans);
	color: var(--text-3);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.notice-menu-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 6px 9px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	font: 400 12.5px/1.3 var(--sans);
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
}

.notice-menu-item:hover {
	background: var(--surface-3);
}

.notice-menu-Sub {
	color: var(--text-3);
	font-size: 11px;
}

.notice-menu-hint {
	font: 400 10.5px/1.2 var(--mono);
	color: var(--text-3);
	max-width: 92px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-copied-banner {
	padding: 5px 12px;
	background: rgba(73, 97, 218, 0.14);
	border-bottom: 1px solid rgba(73, 97, 218, 0.28);
	color: var(--accent-hi);
	font: 500 11.5px/1.3 var(--sans);
	flex-shrink: 0;
}

/* --- Window Scroll Area (Body + Conversation) ------------------------- */

.notice-window-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.notice-lead {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.notice-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.notice-window-title {
	margin: 0;
	font: 600 14.5px/1.35 var(--sans);
	color: var(--text);
}

.notice-count-pill {
	padding: 1px 6px;
	border-radius: 999px;
	background: var(--surface-2);
	border: 1px solid var(--border-strong);
	color: var(--text-2);
	font: 600 10.5px/1.3 var(--sans);
	flex-shrink: 0;
}

.notice-markdown-body {
	font-size: 13px;
	line-height: 1.48;
	color: var(--text-2);
}

.notice-markdown-body p {
	margin: 0 0 8px;
}

.notice-markdown-body p:last-child {
	margin-bottom: 0;
}

.notice-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.notice-link-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 9px;
	border-radius: 6px;
	background: var(--surface);
	border: 1px solid var(--border-strong);
	color: var(--accent-hi);
	font: 500 11.5px/1.25 var(--sans);
	text-decoration: none;
}

.notice-link-pill:hover {
	background: var(--surface-3);
}

.notice-delivery-error {
	padding: 6px 9px;
	border-radius: 7px;
	background: rgba(239, 68, 68, 0.14);
	border: 1px solid rgba(239, 68, 68, 0.35);
	color: #fca5a5;
	font: 500 11.5px/1.3 var(--sans);
}

/* --- Conversation Bubbles & Action Chips ------------------------------ */

.notice-conversation {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--border);
}

.notice-bubble {
	max-width: 88%;
	padding: 8px 10px;
	border-radius: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-self: flex-start;
}

.notice-bubble.is-michael {
	align-self: flex-end;
	background: rgba(73, 97, 218, 0.18);
	border-color: rgba(73, 97, 218, 0.36);
	color: var(--text);
}

.notice-bubble.is-agent {
	background: var(--surface-2);
	border-color: var(--border-strong);
}

.notice-bubble.is-system {
	align-self: center;
	max-width: 100%;
	padding: 3px 8px;
	background: transparent;
	border: 0;
	color: var(--text-3);
	font: 400 11px/1.3 var(--sans);
}

.notice-bubble-who {
	font: 600 10.5px/1.2 var(--sans);
	color: var(--text-3);
}

.notice-bubble-text {
	font-size: 12.5px;
	line-height: 1.42;
	color: var(--text);
}

.notice-bubble-text p {
	margin: 0;
}

.notice-action-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 2px;
}

.notice-action-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--border-strong);
	color: var(--text-2);
	font: 500 11px/1.25 var(--sans);
}

.notice-action-chip.is-link {
	color: var(--accent-hi);
	cursor: pointer;
}

.notice-action-chip.is-link:hover {
	background: rgba(73, 97, 218, 0.16);
	border-color: rgba(73, 97, 218, 0.4);
}

/* --- Window Suggestions, Composer & Footer ---------------------------- */

.notice-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 12px;
	border-top: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.01);
	flex-shrink: 0;
}

.notice-permission-note {
	padding: 4px 12px;
	font: 400 11px/1.3 var(--sans);
	color: var(--text-3);
	border-top: 1px solid var(--border);
	flex-shrink: 0;
}

.notice-error-line {
	padding: 6px 12px;
	background: rgba(239, 68, 68, 0.14);
	border-top: 1px solid rgba(239, 68, 68, 0.32);
	color: #fca5a5;
	font: 500 11.5px/1.3 var(--sans);
	flex-shrink: 0;
}

.notice-composer {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 8px 10px;
	border-top: 1px solid var(--border);
	background: var(--surface);
	flex-shrink: 0;
}

.notice-composer-input {
	flex: 1;
	min-width: 0;
	min-height: 34px;
	max-height: 94px;
	padding: 6px 9px;
	border-radius: 8px;
	border: 1px solid var(--border-strong);
	background: var(--surface-2);
	color: var(--text);
	font: 400 12.5px/20px var(--sans);
	resize: none;
	outline: none;
}

.notice-composer-input:focus {
	border-color: rgba(73, 97, 218, 0.6);
}

.notice-send-btn {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var(--accent);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
}

.notice-send-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.notice-window-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 12px;
	border-top: 1px solid var(--border);
	background: rgba(255, 255, 255, 0.015);
	flex-shrink: 0;
}

.notice-footer-open {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--accent-hi);
	font: 500 12px/1.25 var(--sans);
	cursor: pointer;
	min-width: 0;
}

.notice-footer-open:hover {
	text-decoration: underline;
}

.notice-footer-via {
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text-3);
	font: 400 11px/1.25 var(--sans);
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.notice-footer-via:hover {
	color: var(--text-2);
	text-decoration: underline;
}

/* --- Settings › Notifications Additions ------------------------------- */

.notice-settings-section {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.notice-settings-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.notice-segmented {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 3px;
	border-radius: 8px;
	background: var(--surface);
	border: 1px solid var(--border);
}

.notice-segmented-btn {
	padding: 4px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text-2);
	font: 500 12px/1.25 var(--sans);
	cursor: pointer;
}

.notice-segmented-btn.is-active {
	background: var(--surface-2);
	color: var(--text);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.notice-app-form {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.notice-app-input {
	flex: 1 1 130px;
	min-width: 110px;
	padding: 6px 9px;
	border-radius: 7px;
	border: 1px solid var(--border-strong);
	background: var(--surface);
	color: var(--text);
	font: 400 12.5px/1.3 var(--sans);
}

.notice-token-card {
	padding: 10px 12px;
	border-radius: 9px;
	background: rgba(73, 97, 218, 0.12);
	border: 1px solid rgba(73, 97, 218, 0.34);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.notice-token-code {
	padding: 5px 8px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.35);
	font: 500 11.5px/1.35 var(--mono);
	color: #bfdbfe;
	word-break: break-all;
}

.notice-apps-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.notice-app-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 8px;
	background: var(--surface);
	border: 1px solid var(--border);
}

.notice-app-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.notice-app-name {
	font: 600 12.5px/1.25 var(--sans);
	color: var(--text);
}

.notice-app-hosts {
	font: 400 11px/1.25 var(--mono);
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
