:root {
	--bg: #0d0d0d;
	--surface: #1a1a19;
	--surface-2: #232322;
	--surface-3: #2c2c2a;
	--ink: #ffffff;
	--ink-2: #c3c2b7;
	--ink-3: #898781;
	--grid: #2c2c2a;
	--hairline: rgba(255,255,255,0.10);
	--blue: #3987e5;
	--aqua: #199e70;
	--yellow: #c98500;
	--violet: #9085e9;
	--red: #e66767;
	--orange: #d95926;
	--magenta: #d55181;
	--good: #33b466;
	--warning: #fab219;
	--serious: #ec835a;
	--critical: #d03b3b;
	--edge: #4a4a47;
	--edge-hi: #3987e5;
	/* aliases — several call sites reference these names */
	--green: var(--good);
	--ok: var(--good);
	--ink-1: var(--ink);
	--line: var(--hairline);
	/* motion tokens: one shared vocabulary for every transition/animation */
	--t-fast: 120ms;
	--t-med: 180ms;
	--t-slow: 260ms;
	--e-out: cubic-bezier(.2,.8,.2,1);
	--e-in: cubic-bezier(.5,0,.8,.4);
	--e-spring: cubic-bezier(.2,.9,.3,1.35);
	color-scheme: dark;
}
[data-theme="light"] {
	--bg: #f9f9f7;
	--surface: #fcfcfb;
	--surface-2: #f0efec;
	--surface-3: #e1e0d9;
	--ink: #0b0b0b;
	--ink-2: #52514e;
	--ink-3: #898781;
	--grid: #e1e0d9;
	--hairline: rgba(11,11,11,0.10);
	--blue: #2a78d6;
	--aqua: #1baf7a;
	--yellow: #eda100;
	--violet: #4a3aa7;
	--red: #e34948;
	--orange: #eb6834;
	--magenta: #e87ba4;
	--edge: #b9b8b0;
	--edge-hi: #2a78d6;
	/* status colors need darker light-theme values to stay readable on near-white */
	--good: #107a10;
	--warning: #92650a;
	--serious: #b5501e;
	--critical: #bb2f2f;
	color-scheme: light;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	background: var(--bg); color: var(--ink);
	display: grid; grid-template-columns: 1fr; grid-template-rows: 50px 1fr;
	overflow: hidden; font-size: 14px; line-height: 1.5;
	-webkit-user-select: none; user-select: none;
	-webkit-font-smoothing: antialiased;
	transition: padding-left var(--t-slow) var(--e-out);
}
::selection { background: color-mix(in srgb, var(--blue) 32%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }
/* Desktop: fixed sidebar shown, content padded left. Collapse hides it. */
@media (min-width: 761px) {
	body { padding-left: 210px; }
	body.side-closed { padding-left: 0; }
	body.side-closed #side { transform: translateX(-100%); }
}
/* Mobile: sidebar is an off-canvas overlay, hidden until opened. */
@media (max-width: 760px) {
	#side { transform: translateX(-100%); box-shadow: 2px 0 26px rgba(0,0,0,0.34); }
	body.side-open #side { transform: translateX(0); }
	body.side-open #sideBackdrop { opacity: 1; pointer-events: auto; }
}
#sideBackdrop {
	position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,0.5);
	opacity: 0; pointer-events: none; transition: opacity var(--t-slow) var(--e-out);
}
.side-toggle {
	display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
	border: 1px solid var(--hairline); border-radius: 9px; background: var(--surface-2); color: var(--ink-2);
	cursor: pointer; flex-shrink: 0; margin-right: 4px;
}
.side-toggle:hover { background: var(--surface-3); color: var(--ink); }
.side-toggle svg { width: 17px; height: 17px; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
.cmd, #logView, .ai-box, #lamTable td, .live-row, .env-card dl, .act-list, .dsec p, .dsec li,
.tile, .issue .tx, .pstep .txt, .acc-body, .event-log, .kv, #dSub, .chart-card h5 {
	-webkit-user-select: text; user-select: text; cursor: auto;
}
button, .tab, .pill, .flow-btn, .layer-chip, .ws-tile { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button { transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform 80ms var(--e-out), box-shadow var(--t-fast), filter var(--t-fast); }
button:active { transform: scale(0.98); }
a { transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
#side {
	position: fixed; left: 0; top: 0; bottom: 0; width: 210px; z-index: 60; background: var(--surface);
	border-right: 1px solid var(--hairline); display: flex; flex-direction: column;
	padding: 14px 10px 12px; min-height: 0;
	transition: transform var(--t-slow) var(--e-out);
}
.brand { display: flex; align-items: center; gap: 9px; cursor: pointer; background: none; border: none; color: var(--ink); font-family: inherit; padding: 4px 8px; border-radius: 9px; }
.brand:hover { background: var(--surface-2); }
.brand svg { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; }
.brand b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.tabs { display: flex; flex-direction: column; gap: 1px; margin-top: 16px; flex: 1; overflow-y: auto; }
.tab svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.tab.active svg { opacity: 1; }
.side-foot { padding: 8px 10px 0; border-top: 1px solid var(--hairline); font-size: 10.5px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.bell { position: relative; }
.bell .cnt {
	position: absolute; top: -5px; right: -6px; min-width: 16px; height: 16px; border-radius: 9px;
	background: var(--critical); color: #fff; font-size: 9.5px; font-weight: 700;
	display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.tab {
	display: flex; align-items: center; gap: 11px; text-align: left; position: relative;
	padding: 8px 12px; border-radius: 9px; cursor: pointer; border: none;
	background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500;
	font-family: inherit; width: 100%;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active { background: var(--surface-3); color: var(--ink); }
.tab.active::before {
	content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
	border-radius: 0 2px 2px 0; background: var(--blue);
}
.spacer { flex: 1; }
.pill-group { display: flex; border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }
.pill {
	padding: 6px 12px; border: none; background: transparent; color: var(--ink-2);
	cursor: pointer; font-size: 12.5px; font-weight: 600; font-family: inherit;
}
.pill.active { background: var(--blue); color: #fff; }
.btn {
	padding: 6px 12px; border: 1px solid var(--hairline); border-radius: 8px;
	background: var(--surface-2); color: var(--ink-2); cursor: pointer;
	font-size: 12.5px; font-weight: 500; font-family: inherit;
}
.btn:hover { background: var(--surface-3); color: var(--ink); }
main { grid-row: 2; grid-column: 1; position: relative; overflow: hidden; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }

/* ============ ARCHITECTURE MAP ============ */
#viewMap.active { display: flex; flex-direction: column; }
#mapWrap { position: relative; flex: 1; overflow: auto; }
#canvas { position: relative; width: 1440px; height: 1120px; transform-origin: 0 0; }
#edgeSvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.edge { stroke: var(--edge); stroke-width: 1.5; fill: none; opacity: 0.8; }
.edge.dashed { stroke-dasharray: 5 5; }
.edge.hi { stroke: var(--edge-hi); stroke-width: 3; opacity: 1; }
.edge.dim { opacity: 0.08; }
.edge-label {
	font-size: 10px; fill: var(--ink-3); font-weight: 600;
	paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round;
}
.edge-label.hi { fill: var(--edge-hi); font-weight: 700; font-size: 11px; }
.gbox {
	position: absolute; border-radius: 20px; pointer-events: none; z-index: 0;
	border: 1px solid color-mix(in srgb, var(--gc) 26%, transparent);
	background: color-mix(in srgb, var(--gc) 4.5%, transparent);
}
.gbox > span {
	pointer-events: auto; cursor: pointer;
	position: absolute; top: -10px; left: 18px; font-size: 10.5px; font-weight: 700;
	letter-spacing: 0.1em; text-transform: uppercase; background: var(--bg);
	padding: 1px 10px; border-radius: 20px; color: color-mix(in srgb, var(--gc) 65%, var(--ink));
	border: 1px solid color-mix(in srgb, var(--gc) 30%, transparent);
}
.gbox > span:hover { color: var(--ink); }
#canvas.clean .node p { display: none; }
#canvas.clean .node .badge { display: none; }
#canvas.clean .node { width: 164px; padding: 10px 13px; }
#canvas.clean .edge-label { display: none; }
.lane-box {
	position: absolute; border: 1px dashed var(--hairline); border-radius: 16px;
	background: color-mix(in srgb, var(--surface) 36%, transparent);
	pointer-events: none; z-index: 0;
}
.lane-box span {
	position: absolute; top: -9px; left: 16px; font-size: 10.5px; font-weight: 700;
	letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3);
	background: var(--bg); padding: 0 8px; border-radius: 6px;
}
.node {
	position: absolute; width: 188px; background: var(--surface);
	border: 1px solid var(--hairline); border-radius: 11px; padding: 9px 11px 8px;
	cursor: grab; user-select: none; transition: box-shadow 0.15s, opacity 0.2s;
	border-left: 4px solid var(--nc, var(--blue)); z-index: 2;
	box-shadow: 0 1px 4px rgba(0,0,0,0.22);
}
.node h3 .ic { margin-right: 5px; font-size: 12px; }
.node:hover { box-shadow: 0 4px 18px rgba(0,0,0,0.35); }
.node.dragging { cursor: grabbing; box-shadow: 0 8px 26px rgba(0,0,0,0.5); z-index: 30; }
.node.sel { outline: 2px solid var(--blue); }
.node.dim { opacity: 0.22; }
.node.flow-hi { outline: 2px solid var(--edge-hi); box-shadow: 0 0 0 5px color-mix(in srgb, var(--edge-hi) 22%, transparent); }
.node h3 { font-size: 13px; font-weight: 600; line-height: 1.25; }
.node p { font-size: 11px; color: var(--ink-3); margin-top: 3px; line-height: 1.35; }
.node .badge {
	display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 6px;
	border-radius: 20px; margin-top: 5px; letter-spacing: 0.03em;
	background: var(--surface-3); color: var(--ink-2);
}
.badge.staging-only { background: color-mix(in srgb, var(--yellow) 25%, transparent); color: var(--yellow); }
.note {
	position: absolute; width: 190px; min-height: 56px; background: color-mix(in srgb, var(--yellow) 16%, var(--surface));
	border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent); border-radius: 8px;
	padding: 8px 10px; font-size: 12px; color: var(--ink); cursor: grab; z-index: 20;
}
.note textarea {
	width: 100%; background: transparent; border: none; color: inherit; resize: vertical;
	font-family: inherit; font-size: 12px; min-height: 40px; outline: none;
}
.note .x { position: absolute; top: 2px; right: 7px; cursor: pointer; color: var(--ink-3); font-size: 13px; }
#mapToolbar { background: var(--surface); border-bottom: 1px solid var(--hairline); flex-shrink: 0; padding: 6px 14px; }
#mapToolbar .trow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 3px 0; }
.tgroup { display: inline-flex; border: 1px solid var(--hairline); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.tgroup .pill { border-radius: 0; }
.pill.on { background: var(--blue); color: #fff; }
#mapToolbar .hint { font-size: 11.5px; color: var(--ink-3); }
.flow-btn {
	padding: 6px 11px; border-radius: 20px; border: 1px solid var(--hairline);
	background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 12px;
	font-weight: 500; font-family: inherit;
}
.flow-btn:hover { color: var(--ink); border-color: var(--blue); }
.flow-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.flow-btn.tour { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }
.flow-btn.tour.active { background: var(--violet); border-color: var(--violet); }
#mapWrap { cursor: grab; }
#mapWrap.panning { cursor: grabbing; }
.cfg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--hairline); }
.cfg-row:last-child { border-bottom: none; }
.cfg-row label { font-size: 12.5px; color: var(--ink-2); }
.cfg-row input {
	width: 130px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 7px;
	color: var(--ink); padding: 5px 9px; font-size: 12px; font-family: inherit; text-align: right;
}
.cfg-row input:focus { outline: none; border-color: var(--blue); }
.cfg-note { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
/* drawer */
#drawer {
	position: absolute; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
	background: var(--surface); border-left: 1px solid var(--hairline);
	transform: translateX(105%); transition: transform var(--t-slow) var(--e-out); z-index: 65;
	display: flex; flex-direction: column;
}
#drawer.open { transform: translateX(0); }
#drawer .dhead { padding: 16px 18px 12px; border-bottom: 1px solid var(--hairline); }
#drawer .dhead h2 { font-size: 16px; font-weight: 600; padding-right: 30px; }
#drawer .dhead p { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
#drawer .dbody { flex: 1; overflow-y: auto; padding: 14px 18px 30px; }
#drawer .close {
	position: absolute; top: 12px; right: 12px; background: var(--surface-2); border: none;
	color: var(--ink-2); width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.dsec { margin-bottom: 18px; }
.dsec h4 {
	font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--ink-3); margin-bottom: 7px; font-weight: 700;
}
.dsec p { font-size: 13px; line-height: 1.55; color: var(--ink-2); margin-bottom: 6px; }
.dsec ul { list-style: none; }
.dsec li {
	font-size: 12.5px; line-height: 1.5; color: var(--ink-2); padding: 4px 0 4px 14px;
	position: relative;
}
.dsec li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--nc, var(--blue)); }
.cmd {
	background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px;
	padding: 8px 10px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
	font-size: 11px; color: var(--ink-2); margin: 6px 0; position: relative;
	white-space: pre-wrap; word-break: break-all; line-height: 1.5; padding-right: 44px;
}
.cmd .copy {
	position: absolute; top: 6px; right: 6px; background: var(--surface-2); border: none;
	color: var(--ink-3); border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 10px;
	font-family: inherit;
}
.cmd .copy:hover { color: var(--ink); }

/* ============ DEPLOY ============ */
#viewDeploy { overflow-y: auto; padding: 24px clamp(16px, 4vw, 48px) 60px; }
.deploy-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; max-width: 1200px; margin: 0 auto; align-items: start; }
@media (max-width: 900px) { .deploy-grid { grid-template-columns: 1fr; } }
.pipe-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 12px; align-self: start; }
.pipe-item {
	text-align: left; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--hairline);
	background: var(--surface); color: var(--ink-2); cursor: pointer; font-family: inherit; font-size: 13px;
	font-weight: 500;
}
.pipe-item small { display: block; color: var(--ink-3); font-weight: 400; font-size: 11px; margin-top: 2px; }
.pipe-item.active { border-color: var(--blue); color: var(--ink); background: var(--surface-2); }
.pipe-detail { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 22px 26px; }
.pipe-detail h2 { font-size: 18px; margin-bottom: 4px; }
.pipe-detail .meta { color: var(--ink-3); font-size: 12.5px; margin-bottom: 18px; }
.pstep { display: flex; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--hairline); }
.pstep:last-child { border-bottom: none; }
.pstep .num {
	width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); color: var(--ink-2);
	display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
	margin-top: 1px;
}
.pstep.on .num { background: var(--blue); color: #fff; }
.pstep .txt h5 { font-size: 13.5px; font-weight: 600; }
.pstep .txt p { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.pstep .txt .cmd { margin-top: 7px; }
.callout {
	border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent);
	background: color-mix(in srgb, var(--warning) 12%, transparent);
	border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55;
	margin-top: 16px; color: var(--ink-2);
}
.callout b { color: var(--warning); }
.callout.crit { border-color: color-mix(in srgb, var(--critical) 55%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.callout.crit b { color: var(--critical); }

/* ============ LOGS / RUNBOOK ============ */
#viewLogs { overflow-y: auto; padding: 24px clamp(16px, 4vw, 48px) 60px; }
.logs-inner { max-width: 1080px; margin: 0 auto; }
.logs-inner h2 { font-size: 18px; margin: 8px 0 14px; }
.logs-inner h2:not(:first-child) { margin-top: 36px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th, td { text-align: left; padding: 9px 14px; font-size: 12.5px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }
tr:last-child td { border-bottom: none; }
td .cmd { margin: 0; }
td.ret { white-space: nowrap; color: var(--ink-2); }
.acc { border: 1px solid var(--hairline); border-radius: 12px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.acc summary {
	padding: 13px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none;
	display: flex; align-items: center; gap: 10px;
}
.acc summary::before { content: "▸"; color: var(--ink-3); transition: transform 0.15s; }
.acc[open] summary::before { transform: rotate(90deg); }
.acc .acc-body { padding: 2px 18px 16px 36px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.acc .acc-body ol { padding-left: 16px; }
.acc .acc-body li { margin: 5px 0; }
.sev { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: 0.05em; }
.sev.p1 { background: color-mix(in srgb, var(--critical) 22%, transparent); color: var(--critical); }
.sev.p2 { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.sev.p3 { background: var(--surface-3); color: var(--ink-2); }

/* ============ SIMULATOR ============ */
.sim-inner { max-width: 1080px; margin: 0 auto; }
.sim-grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
@media (max-width: 950px) { .sim-grid { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: border-color .15s ease; }
.card h3 { font-size: 15px; margin-bottom: 4px; }
.card .sub { font-size: 12px; color: var(--ink-3); margin-bottom: 16px; }
.ctl { margin-bottom: 18px; }
.ctl label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.ctl label output { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--blue); }
.tasks-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; min-height: 44px; }
.task-chip {
	width: 74px; border-radius: 9px; border: 1px solid var(--hairline); background: var(--surface-2);
	padding: 6px 8px; font-size: 10px; color: var(--ink-2); transition: opacity 0.3s;
}
.task-chip .bar { height: 5px; border-radius: 3px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.task-chip .bar i { display: block; height: 100%; background: var(--good); width: 20%; transition: width 0.2s, background 0.2s; }
.task-chip.warn .bar i { background: var(--warning); }
.task-chip.crit .bar i { background: var(--critical); }
.task-chip.dead { opacity: 0.3; }
.task-chip .pct { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.alarm-banner {
	display: none; align-items: center; gap: 10px; border-radius: 10px; padding: 11px 14px;
	font-size: 12.5px; font-weight: 600; margin-top: 12px;
}
.alarm-banner.warn { display: flex; background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent); }
.alarm-banner.crit { display: flex; background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); border: 1px solid color-mix(in srgb, var(--critical) 50%, transparent); }
.viz-root { --surface-1: var(--surface); }
#memChartWrap { position: relative; }
#memChart { width: 100%; height: 300px; display: block; }
.axis-txt { font-size: 10.5px; fill: var(--ink-3); }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--edge); stroke-width: 1; }
.mem-line { stroke: var(--blue); stroke-width: 2; fill: none; }
.mem-area { fill: color-mix(in srgb, var(--blue) 14%, transparent); }
.thresh { stroke-width: 1.4; stroke-dasharray: 6 4; }
.thresh-lbl { font-size: 10.5px; font-weight: 700; }
#simTooltip {
	position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--hairline);
	border-radius: 8px; padding: 6px 10px; font-size: 11.5px; display: none; z-index: 5;
	font-variant-numeric: tabular-nums; box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.legend-row .k { display: flex; align-items: center; gap: 6px; }
.legend-row .sw { width: 14px; height: 3px; border-radius: 2px; }
.event-log { margin-top: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 12px; height: 128px; overflow-y: auto; }
.event-log div { padding: 1.5px 0; }
.event-log .t-warn { color: var(--warning); }
.event-log .t-crit { color: var(--critical); }
.event-log .t-good { color: var(--good); }
kbd { background: var(--surface-3); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-family: inherit; }
.pen-c { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.pen-c.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
#mapWrap.pen { cursor: crosshair; }
.edge.pulse {
	stroke: var(--edge-hi); stroke-width: 2.6; opacity: 1;
	stroke-dasharray: 8 7; animation: edgeFlow 0.6s linear infinite;
}
@keyframes edgeFlow { to { stroke-dashoffset: -15; } }
#canvas.clean .edge-label.hi { display: block; }
.node.nb { border-color: color-mix(in srgb, var(--edge-hi) 60%, var(--hairline)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--edge-hi) 18%, transparent); }
.view.active { animation: viewIn var(--t-slow) var(--e-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.skl { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; min-height: 15px; color: transparent !important; }
.skl::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ink) 7%, transparent), transparent); animation: shim 1.6s ease-in-out infinite; }
@keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.rb-form { border: 1px dashed var(--hairline); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.rb-form input, .rb-form select, .rb-form textarea { width: 100%; background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); padding: 8px 10px; font-size: 12.5px; font-family: inherit; margin-bottom: 8px; }
.rb-form textarea { min-height: 110px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.acc summary .rb-acts { margin-left: auto; display: flex; gap: 6px; opacity: 0; transition: opacity 0.15s; }
.acc summary:hover .rb-acts { opacity: 1; }

/* ============ LOCK + WORKSPACES ============ */
.gate {
	position: fixed; inset: 0; z-index: 200; background: var(--bg);
	display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0;
	animation: fadeIn var(--t-med) var(--e-out);
}
.gate.hidden { display: none; }
.gate .gate-card { animation: cardIn var(--t-slow) var(--e-out) both; }
.gate.closing, .modal.closing { animation: fadeOut var(--t-fast) var(--e-in) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.975); } }
.cg-progress {
	display: flex; align-items: center; justify-content: center; gap: 9px;
	padding: 4px 0 14px; font-size: 13px; color: var(--ink-2);
}
.cg-spin {
	width: 14px; height: 14px; border-radius: 50%; flex: none;
	border: 2px solid var(--hairline); border-top-color: var(--blue);
	animation: cgspin 0.8s linear infinite;
}
@keyframes cgspin { to { transform: rotate(360deg); } }
.gate-card {
	width: 360px; max-width: 90vw; background: var(--surface); border: 1px solid var(--hairline);
	border-radius: 18px; padding: 34px 34px 30px; text-align: center;
}
.gate-card .mark {
	width: 54px; height: 54px; border-radius: 14px; background: var(--blue); color: #fff;
	font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center;
	margin: 0 auto 16px;
}
.gate-card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.gate-card p { font-size: 13px; color: var(--ink-3); margin: 6px 0 20px; }
.gate-card input {
	width: 100%; background: var(--bg); border: 1px solid var(--hairline); border-radius: 10px;
	padding: 11px 14px; color: var(--ink); font-size: 14px; font-family: inherit; text-align: center;
	letter-spacing: 0.2em;
}
.gate-card input:focus { outline: none; border-color: var(--blue); }
.gate-card input.err { border-color: var(--critical); animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* :where keeps specificity at (0,1,0) so component-level styles inside gates
   (.ob-row, .ob-prov, .walk-opt, .ws-tile …) still override this default. */
.gate-card :where(button:not(.btn)) {
	width: 100%; margin-top: 12px; padding: 11px; border: none; border-radius: 10px;
	background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.gate-card :where(button:not(.btn)):hover { filter: brightness(1.08); }
.gate-card :where(button:not(.btn)):disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.gate-card .btn { padding: 10px 14px; border-radius: 10px; font-size: 13px; }
.ws-grid { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.ws-tile {
	width: 210px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
	padding: 24px 22px; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink);
	transition: border-color 0.15s, transform 0.15s;
}
.ws-tile:hover { border-color: var(--blue); transform: translateY(-2px); }
.ws-tile .logo {
	width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 19px; color: #fff; margin-bottom: 14px;
}
.ws-tile h3 { font-size: 15.5px; font-weight: 700; }
.ws-tile p { font-size: 12px; color: var(--ink-3); margin-top: 4px; line-height: 1.45; }
.ws-tile.ghost { border-style: dashed; cursor: default; opacity: 0.6; }
.ws-tile.ghost:hover { border-color: var(--hairline); transform: none; }
.gate-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.gate-sub { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; }
.btn-back { margin-right: 4px; }
.ver { font-size: 10.5px; color: var(--ink-3); margin-top: 18px; letter-spacing: 0.04em; }

/* ============ OVERVIEW ============ */
#viewOverview { overflow-y: auto; padding: 24px clamp(16px, 4vw, 48px) 60px; }
#viewAI, #viewLambdas, #viewSettings, #viewActions { overflow-y: auto; }
.env-edit { border: 1px solid var(--hairline); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.env-edit .cfg-row input, .env-edit .cfg-row select { width: 100%; max-width: 240px; }
.cfg-row select { background: var(--bg); border: 1px solid var(--hairline); border-radius: 7px; color: var(--ink); padding: 5px 9px; font-size: 12px; font-family: inherit; }
#viewSettings .cfg-row input[type=number] { width: 90px; }
.env-edit summary { cursor: pointer; font-size: 12px; color: var(--ink-3); margin: 6px 0; }
.env-ok { color: var(--good); font-size: 11.5px; } .env-bad { color: var(--critical); font-size: 11.5px; }
.ov-inner { max-width: 1080px; margin: 0 auto; }
.ov-inner h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 26px 0 12px; font-weight: 700; }
.ov-inner h2:first-child { margin-top: 4px; }
/* auto-fill (not -fit) so a lone tile keeps column width instead of stretching full-bleed */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 18px; transition: border-color 0.15s; }
.tile:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--hairline)); }
.tile .num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.tile .lbl { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.env-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.env-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 18px 20px; }
.env-card h3 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.env-card h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.env-card dl { margin-top: 12px; }
.env-card .kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.env-card .kv:last-child { border-bottom: none; }
.env-card .kv dt { color: var(--ink-3); }
.env-card .kv dd { font-variant-numeric: tabular-nums; }
.ql-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.ql {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
	padding: 11px 14px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 500;
}
.ql:hover { border-color: var(--blue); }
.ql span { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.ql::after { content: "↗"; color: var(--ink-3); font-size: 11px; }

/* ============ COMMAND PALETTE ============ */
#palette {
	position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.45);
	display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
#palette.open { display: flex; animation: fadeIn var(--t-med) var(--e-out); }
#palette.open.closing { animation: fadeOut var(--t-fast) var(--e-in) both; }
.pal-box {
	width: 560px; max-width: 92vw; background: var(--surface); border: 1px solid var(--hairline);
	border-radius: 14px; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,0.5);
	animation: palIn var(--t-med) var(--e-out) both;
}
@keyframes palIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.pal-box input {
	width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--hairline);
	padding: 15px 18px; color: var(--ink); font-size: 15px; font-family: inherit; outline: none;
}
.pal-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.pal-item {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 13.5px;
}
.pal-item .k { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.pal-item.on { background: var(--surface-3); }
.pal-empty { padding: 18px; color: var(--ink-3); font-size: 13px; text-align: center; }

/* layer filter chips */
.layer-chip {
	padding: 5px 10px; border-radius: 20px; border: 1px solid var(--hairline); background: var(--surface);
	color: var(--ink-3); cursor: pointer; font-size: 11.5px; font-weight: 600; font-family: inherit;
}
.layer-chip.on { color: var(--ink); border-color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.node.layer-dim { opacity: 0.15; }
.cost-line { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-2); padding: 10px 12px; background: var(--surface-2); border-radius: 10px; margin-bottom: 14px; }
.cost-line output { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.dlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.dlinks a {
	display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 8px;
	border: 1px solid var(--hairline); color: var(--ink-2); text-decoration: none; font-size: 12px; font-weight: 500;
}
.dlinks a:hover { border-color: var(--blue); color: var(--ink); }
.dlinks a::after { content: "↗"; font-size: 10px; color: var(--ink-3); }

/* live sync */
.sync { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.sync .sdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex-shrink: 0; }
.sync.live .sdot { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.sync.err .sdot { background: var(--critical); }
.sync.warn { color: var(--warning); }
.sync.warn .sdot { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); }
.sync.loading { color: var(--blue); }
.sync.loading .sdot { background: var(--blue); animation: syncPulse 1s ease-in-out infinite; }
@keyframes syncPulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blue) 40%, transparent); opacity: 1; } 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 0%, transparent); opacity: .55; } }
.node .st { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; }
.st.g { background: var(--good); } .st.w { background: var(--warning); } .st.c { background: var(--critical); }
.tile .num .u { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.tile.t-warn { border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.tile.t-crit { border-color: color-mix(in srgb, var(--critical) 55%, transparent); }
.live-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.live-row:last-child { border-bottom: none; }
.live-row .lk { color: var(--ink-3); }
.live-row .lv { font-variant-numeric: tabular-nums; text-align: right; }
.lv.ok { color: var(--good); } .lv.warn { color: var(--warning); } .lv.crit { color: var(--critical); }

/* charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 14px 8px; }
.chart-card h5 { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; justify-content: space-between; }
.chart-card h5 output { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-card svg { width: 100%; height: 110px; display: block; }
/* activity */
.act-list { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 6px 14px; }
.act-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; align-items: baseline; }
.act-row:last-child { border-bottom: none; }
.act-row .at { color: var(--ink-3); font-size: 11px; white-space: nowrap; min-width: 64px; font-variant-numeric: tabular-nums; }
.act-row .who { color: var(--ink-3); margin-left: auto; font-size: 11.5px; white-space: nowrap; }
/* lambdas table */
#lamTable td.err { color: var(--critical); font-weight: 700; }
#lamTable td.zero { color: var(--ink-3); }
#lamTable tbody tr { cursor: pointer; }
#lamTable tbody tr:hover td { background: var(--surface-2); }
/* logs viewer */
.logbar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--hairline); background: var(--surface); flex-wrap: wrap; }
.logbar select, .logbar input {
	background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink);
	padding: 7px 10px; font-size: 12.5px; font-family: inherit;
}
.logbar input { flex: 1; min-width: 140px; }
.btn.on { border-color: var(--blue); color: var(--blue); }
#logView {
	position: absolute; top: 54px; bottom: 0; left: 0; right: 0; overflow-y: auto;
	font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.55;
	padding: 10px 16px 30px; background: var(--bg);
}
#viewLive { display: none; }
#viewLive.active { display: block; position: absolute; inset: 0; }
.logline { white-space: pre-wrap; word-break: break-all; padding: 1px 0; color: var(--ink-2); }
.logline .ts { color: var(--ink-3); margin-right: 8px; }
.logline.err { color: var(--red); }
.logline.warn { color: var(--yellow); }
.logline.meta { color: var(--ink-3); font-family: inherit; }
#logChat {
	position: absolute; right: 14px; top: 62px; bottom: 14px; width: 400px; max-width: 82vw;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
	display: flex; flex-direction: column; z-index: 6; box-shadow: 0 14px 44px rgba(0,0,0,0.5);
}
.lc-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent); font-size: 13px; }
.lc-title { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; min-width: 0; }
.lc-title b { font-weight: 600; font-size: 13.5px; letter-spacing: .01em; }
.lc-live { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green, #3fb96f); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green, #3fb96f) 22%, transparent); flex: none; animation: lcLive 2.4s ease-in-out infinite; }
@keyframes lcLive { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--green, #3fb96f) 10%, transparent); } }
.lc-hspace { flex: 1; }
.lc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.lc-q {
	align-self: flex-end; color: #fff; border-radius: 18px 18px 5px 18px; padding: 9px 14px;
	font-size: 13px; line-height: 1.55; max-width: 82%;
	background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 88%, #7db2ff), var(--blue));
	box-shadow: 0 4px 14px color-mix(in srgb, var(--blue) 22%, transparent);
}
.lc-a {
	align-self: flex-start; max-width: 100%; font-size: 13px !important; line-height: 1.65 !important;
	background: transparent !important; border: none !important; padding: 1px 0 0 !important; border-radius: 0 !important;
}
.lc-row { display: flex; gap: 10px; align-items: flex-start; }
.lc-av { width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; margin-top: 1px; box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent); }
.lc-a.typing:empty {
	background: var(--surface-2) !important; border-radius: 16px !important; padding: 13px 14px !important;
	display: flex; align-items: center; min-width: 54px; min-height: 12px;
}
.lc-a.typing:empty::after {
	content: "" !important; width: 6px; height: 6px; border-radius: 50%; margin: 0;
	background: var(--ink-3); color: transparent;
	box-shadow: 12px 0 0 var(--ink-3), 24px 0 0 var(--ink-3);
	animation: lcDots 1.1s ease-in-out infinite !important;
}
@keyframes lcDots { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sc-chip { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 20px; padding: 6px 12px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; font-family: inherit; }
.sc-chip:hover { border-color: var(--blue); color: var(--ink); }
.lc-input { padding: 10px 12px 12px; border-top: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent); }
.lc-composer {
	display: flex; align-items: center; gap: 6px; width: 100%;
	background: var(--bg); border: 1px solid var(--hairline); border-radius: 999px;
	padding: 4px 4px 4px 16px; transition: border-color .15s, box-shadow .15s;
}
.lc-composer:focus-within { border-color: color-mix(in srgb, var(--blue) 55%, var(--hairline)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); }
.lc-composer input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--ink); padding: 8px 0; font-size: 13px; font-family: inherit; }
.lc-send {
	width: 32px; height: 32px; border-radius: 50%; border: none; flex: none; cursor: pointer;
	background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center;
	transition: filter .12s, transform .08s;
}
.lc-send:hover { filter: brightness(1.12); }
.lc-send:active { transform: scale(.94); }
/* AI + issues */
.ai-box { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 20px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.ai-box h4 { color: var(--ink); font-size: 13px; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-box h4:first-child { margin-top: 0; }
.ai-box li { margin: 4px 0 4px 16px; }
.ai-box b { color: var(--ink); }
.ai-box .cmd { margin: 8px 0; }
.ai-box code { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.mdhr { border: none; border-top: 1px solid var(--hairline); margin: 12px 0; }
#chatFab {
	position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%;
	background: linear-gradient(135deg, color-mix(in srgb, var(--blue) 86%, #8ab8ff), var(--blue));
	color: #fff; border: none; cursor: pointer; z-index: 140;
	box-shadow: 0 12px 34px color-mix(in srgb, var(--blue) 38%, rgba(0, 0, 0, .4));
	display: flex; align-items: center; justify-content: center;
	transition: transform var(--t-fast) var(--e-spring), box-shadow var(--t-fast);
}
#chatFab:hover { transform: scale(1.08) translateY(-1px); box-shadow: 0 16px 40px color-mix(in srgb, var(--blue) 46%, rgba(0, 0, 0, .4)); }
#chatFab svg { width: 22px; height: 22px; }
#sysChat {
	position: fixed; right: 22px; bottom: 84px; width: 440px; max-width: 92vw; height: min(600px, 76vh);
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: blur(22px) saturate(1.25); -webkit-backdrop-filter: blur(22px) saturate(1.25);
	border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent); border-radius: 22px;
	display: none; flex-direction: column; z-index: 150; overflow: hidden;
	box-shadow: 0 28px 90px rgba(0, 0, 0, .55), inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
}
#sysChat.open { display: flex; animation: lcIn var(--t-slow) var(--e-spring) both; }
#sysChat.open.closing { animation: lcOut var(--t-fast) var(--e-in) both; }
@keyframes lcIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lcOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
#sysChat.max {
	top: 16px; left: 16px; right: 16px; bottom: 16px;
	width: auto; height: auto; max-width: none; border-radius: 24px;
}
#sysChat.max .lc-msgs { padding: 26px max(28px, calc((100% - 780px) / 2)); gap: 18px; }
#sysChat.max .lc-input { padding: 14px max(28px, calc((100% - 780px) / 2)) 20px; }
#sysChat.max .lc-composer input { padding: 11px 0; font-size: 14px; }
#sysChat.max .lc-send { width: 38px; height: 38px; }
#sysChat.max .lc-a { font-size: 14px !important; line-height: 1.75 !important; }
#sysChat.max .lc-q { font-size: 14px; padding: 11px 16px; }
#sysChat.max .lc-head { padding: 15px 18px 15px 22px; font-size: 14px; }
#sysChat.max .lc-av { width: 27px; height: 27px; }
.typing::after { content: "▋"; color: var(--blue); animation: blink 0.9s steps(1) infinite; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }
#canvas.anim { transition: transform 0.55s cubic-bezier(0.22, 0.9, 0.35, 1); }
#flowCaption.big { width: min(920px, 94%); padding: 26px 30px 18px; }
#flowCaption.big .step-txt { font-size: 15.5px; line-height: 1.7; }
#flowCaption.big #fcTitle { font-size: 18px; }
/* action cards */
.axn { background: var(--surface); border: 1px solid var(--hairline); border-radius: 13px; margin-bottom: 9px; cursor: pointer; transition: border-color 0.15s; overflow: hidden; }
.axn:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--hairline)); }
.axn-head { display: flex; align-items: center; gap: 11px; padding: 13px 16px; }
.axn-head b { font-size: 13.5px; }
.axn-head .chev { margin-left: auto; color: var(--ink-3); transition: transform 0.18s; font-size: 12px; }
.axn.open .chev { transform: rotate(90deg); }
.axn-body { display: none; padding: 0 16px 14px 16px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.axn.open .axn-body { display: block; animation: expandIn var(--t-med) var(--e-out); }
@keyframes expandIn { from { opacity: 0; transform: translateY(-4px); } }
.sev.crit-a { background: color-mix(in srgb, var(--critical) 22%, transparent); color: var(--critical); }
.sev.warn-a { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.sev.rout-a { background: var(--surface-3); color: var(--ink-2); }
/* walkthrough card v2 */
#flowCaption {
	position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 40;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 18px;
	width: min(720px, 92%); display: none; padding: 18px 22px 14px;
	box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}
#flowCaption.show { display: block; animation: viewIn var(--t-med) var(--e-out); }
.fc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fc-chip { background: var(--surface-3); color: var(--ink-2); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
#fcTitle { font-size: 15px; letter-spacing: -0.01em; }
#flowCaption .step-txt { font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
#flowCaption .step-txt b { color: var(--blue); }
.fc-foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.fc-dots { display: flex; gap: 5px; }
.fc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); }
.fc-dots i.on { background: var(--blue); }
.fc-next { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }
.walk-opt { text-align: left; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 13px; cursor: pointer; color: var(--ink); font-family: inherit; width: 100%; }
.walk-opt:hover { border-color: var(--blue); }
.walk-opt b { font-size: 13px; display: block; }
.walk-opt span { font-size: 11px; color: var(--ink-3); }
#walkOpts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
#walkOpts .walk-opt.full { grid-column: 1 / 3; border-color: color-mix(in srgb, var(--blue) 50%, var(--hairline)); }
.ai-box.thinking { color: var(--ink-3); font-style: italic; }
.issue {
	display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
	border: 1px solid var(--hairline); border-radius: 12px; padding: 13px 16px; margin-bottom: 8px;
}
.issue .sev { flex-shrink: 0; margin-top: 1px; }
.issue .tx { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.issue .tx b { color: var(--ink); }
.issue .ack { margin-left: auto; flex-shrink: 0; }
.issue.acked { opacity: 0.45; }
.no-issues { color: var(--good); font-size: 13.5px; padding: 14px 4px; }
/* app errors (SDK ingest) */
.ae-pills { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 20px; padding: 3px; }
.ae-pill {
	border: none; background: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600;
	padding: 4px 11px; border-radius: 16px; cursor: pointer; transition: background var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out);
}
.ae-pill:hover { color: var(--ink-2); }
.ae-pill.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
#aeEnvSel { width: auto; min-width: 130px; }
.ae-row { cursor: pointer; animation: cardIn var(--t-med) var(--e-out) both; }
.ae-row:hover { border-color: color-mix(in srgb, var(--blue) 35%, var(--hairline)); }
.ae-row .tx { min-width: 0; }
.ae-meta { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; word-break: break-word; }
.ae-detail { display: none; }
.ae-detail.open {
	display: block; margin: -4px 0 8px; padding: 12px 16px; background: var(--surface-2);
	border: 1px solid var(--hairline); border-radius: 12px; animation: expandIn var(--t-med) var(--e-out) both;
}
.ae-stack {
	font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; line-height: 1.55; color: var(--ink-2);
	white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; margin: 0;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px; padding: 10px 12px;
}
.ae-kv { font-size: 12px; color: var(--ink-2); margin-bottom: 8px; word-break: break-all; }
.ae-kv span { color: var(--ink-3); font-weight: 600; font-size: 11px; margin-right: 8px; text-transform: uppercase; letter-spacing: 0.04em; }
.ae-setup { max-width: 640px; }
.ae-setup .cmd { margin-top: 8px; }
.key-dead { opacity: 0.45; }
.key-dead .team-email { text-decoration: line-through; }
/* shortcuts modal */
.kbd-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--ink-2); }
.kbd-row:last-child { border-bottom: none; }
/* external console links */
.xl { color: var(--ink-3); font-size: 11px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.xl:hover { color: var(--blue); }
.issue .xl { margin-left: auto; flex-shrink: 0; align-self: center; }
.issue .xl + .ack { margin-left: 10px; }
a.tile { display: block; color: inherit; text-decoration: none; }
.axn-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.act-row .xl { flex-shrink: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
#sAiModel, #sAiKey { width: 100%; max-width: 240px; text-align: left; }

/* logs v2 */
.logtools {
	position: absolute; top: 54px; left: 0; right: 0; height: 40px; z-index: 2;
	display: flex; align-items: center; gap: 10px; padding: 0 16px;
	background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.logtools input {
	flex: 0 1 280px; min-width: 140px; background: var(--bg); border: 1px solid var(--hairline);
	border-radius: 7px; color: var(--ink); padding: 5px 9px; font-size: 12px; font-family: inherit;
}
.logcount { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.logtools .btn { margin-left: auto; padding: 4px 10px; font-size: 11.5px; }
#logView.v2 { top: 94px; padding: 6px 0 30px; }
#logView.v2 .logline { padding: 2px 16px; }
.lrow {
	display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
	padding: 2px 16px 2px 14px; border-left: 2px solid transparent; color: var(--ink-2);
}
.lrow.alt { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.lrow.err { border-left-color: var(--red); }
.lrow.warn { border-left-color: var(--warning); }
.lrow.debug { color: var(--ink-3); }
.lrow.hid { display: none; }
.lrow.x { cursor: pointer; }
.lrow.x:hover { background: var(--surface-2); }
.lts { flex-shrink: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lcaret { flex-shrink: 0; width: 9px; font-size: 9px; color: var(--ink-3); transition: transform 0.12s; }
.lcaret.off { visibility: hidden; }
.lrow.open > .lcaret { transform: rotate(90deg); }
.lchip {
	flex-shrink: 0; font-size: 9px; font-weight: 700; letter-spacing: 0.09em;
	padding: 1px 6px; border-radius: 5px; line-height: 1.6;
}
.lchip.error { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }
.lchip.warn { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.lchip.info { background: var(--surface-3); color: var(--ink-2); }
.lchip.debug { background: var(--surface-2); color: var(--ink-3); }
.lmsg { flex: 1 1 240px; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.lfull {
	display: none; flex-basis: 100%; margin: 4px 0 4px 18px; padding: 9px 12px;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 9px;
	font-family: inherit; font-size: 11px; line-height: 1.5; color: var(--ink-2);
	white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; cursor: text;
}
.lrow.open > .lfull { display: block; animation: expandIn var(--t-med) var(--e-out); }

/* ============ WORKSPACE SWITCHER ============ */
.ws-switch { display: inline-flex; }
.ws-btn { display: inline-flex; align-items: center; gap: 7px; max-width: 190px; }
.ws-btn #wsBtnName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.ws-caret { color: var(--ink-3); font-size: 9px; }
.ws-menu {
	position: fixed; min-width: 220px; max-width: 300px; z-index: 260;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 11px;
	box-shadow: 0 16px 50px rgba(0,0,0,0.45); padding: 5px; display: none;
}
.ws-menu.open { display: block; animation: menuIn var(--t-med) var(--e-out); transform-origin: top left; }
.ws-menu.open.closing { animation: menuOut var(--t-fast) var(--e-in) both; }
@keyframes menuIn { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
@keyframes menuOut { to { opacity: 0; transform: scale(.97) translateY(-3px); } }
.ws-item {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
	text-align: left; padding: 8px 11px; border: none; border-radius: 8px; background: transparent;
	color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit;
}
.ws-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item:hover { background: var(--surface-2); color: var(--ink); }
.ws-item.on { color: var(--ink); font-weight: 600; }
.ws-check { color: var(--blue); font-size: 12px; }
.ws-item.ws-danger { color: var(--critical); }
.ws-item.ws-danger:hover { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }
.ws-sep { height: 1px; background: var(--hairline); margin: 5px 4px; }
.ws-confirm { padding: 10px 11px 8px; }
.ws-confirm p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 10px; }
.ws-confirm-btns { display: flex; gap: 8px; }
.ws-confirm-btns .ws-danger { border-color: color-mix(in srgb, var(--critical) 55%, transparent); color: var(--critical); }
.ws-confirm-btns .ws-danger:hover { background: color-mix(in srgb, var(--critical) 12%, transparent); }
.ws-tile.ghost-add { border-style: dashed; }
.ws-tile.ghost-add:hover { border-color: var(--blue); }
#mapEmpty {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	z-index: 8; background: color-mix(in srgb, var(--bg) 72%, transparent);
}
.map-empty-card {
	width: 400px; max-width: 88%; background: var(--surface); border: 1px solid var(--hairline);
	border-radius: 16px; padding: 26px 28px; text-align: center;
}
.map-empty-card h3 { font-size: 15.5px; font-weight: 700; }
.map-empty-card p { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; margin: 8px 0 16px; }
#wsModal .gate-card input, #wsOnboard .gate-card input { text-align: left; letter-spacing: normal; font-size: 13.5px; }
#wsModal { background: rgba(0,0,0,0.5); }

.model-row { display: flex; align-items: center; gap: 6px; }
.model-row input { width: 100%; max-width: 190px; }
.model-hint { font-size: 11.5px; color: var(--ink-3); padding: 3px 0; }
.ws-ai-head { font-size: 12.5px; font-weight: 700; margin: 14px 0 2px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.model-pick { max-height: 150px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: 8px; background: var(--bg); margin: 4px 0 6px; }
.model-pick.hidden { display: none; }
.model-opt { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--hairline); color: var(--ink); font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; padding: 5px 9px; cursor: pointer; }
.model-opt:last-child { border-bottom: none; }
.model-opt:hover { background: var(--hairline); color: var(--blue); }
.model-opt-label { font-size: 11px; color: var(--ink-3); font-family: -apple-system, "Segoe UI", sans-serif; }
.model-pick { display: flex; flex-direction: column; }
.model-search { flex: none; width: 100%; box-sizing: border-box; background: var(--bg); border: none; border-bottom: 1px solid var(--hairline); color: var(--ink); font-size: 12px; padding: 6px 9px; outline: none; position: sticky; top: 0; }
.model-search::placeholder { color: var(--ink-3); }
.model-opts { overflow-y: auto; }

/* security */
#viewSecurity { overflow-y: auto; }
.sec-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sec-grade {
	width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
	font-size: 34px; font-weight: 700; letter-spacing: -0.02em;
	background: color-mix(in srgb, var(--sgc, var(--ink-3)) 15%, transparent);
	border: 1px solid color-mix(in srgb, var(--sgc, var(--ink-3)) 40%, transparent);
	color: var(--sgc, var(--ink-3));
}
.sec-grade.sg-a { --sgc: var(--good); }
.sec-grade.sg-b { --sgc: var(--aqua); }
.sec-grade.sg-c { --sgc: var(--warning); }
.sec-grade.sg-d { --sgc: var(--serious); }
.sec-grade.sg-e { --sgc: var(--orange); }
.sec-grade.sg-f { --sgc: var(--critical); }
.sec-num { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sec-scanned { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sec-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.sec-chip {
	font-size: 10px; font-weight: 700; padding: 2px 9px; border-radius: 20px;
	letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.sec-chip.sc-crit { background: color-mix(in srgb, var(--critical) 22%, transparent); color: var(--critical); }
.sec-chip.sc-high { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.sec-chip.sc-med { background: var(--surface-3); color: var(--ink-2); }
.sec-chip.sc-low { background: var(--surface-2); color: var(--ink-3); }
.sec-group {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--ink-3); margin: 18px 0 8px;
}
.sec-find {
	display: flex; gap: 12px; align-items: flex-start; background: var(--surface);
	border: 1px solid var(--hairline); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
}
.sec-find .sec-chip { flex-shrink: 0; margin-top: 2px; }
.sec-find-main { flex: 1; min-width: 0; -webkit-user-select: text; user-select: text; cursor: auto; }
.sec-find-title { font-size: 13px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sec-find-title b { color: var(--ink); font-weight: 600; }
.sec-src {
	font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
	background: var(--surface-3); color: var(--ink-2); border-radius: 5px; padding: 1px 6px;
}
.sec-find-detail { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; }
.sec-find-res {
	font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px;
	color: var(--ink-3); margin-top: 4px; word-break: break-all;
}
.sec-find-at { font-size: 11px; color: var(--ink-3); white-space: nowrap; flex-shrink: 0; margin-top: 3px; font-variant-numeric: tabular-nums; }
.sec-find .xl { flex-shrink: 0; align-self: center; }
.sec-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 240px)); margin-bottom: 6px; }
.sec-sub {
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
	color: var(--ink-3); margin: 16px 0 8px;
}
.sec-actor {
	font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--ink-2);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sec-sig { background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.sec-sig.x { cursor: pointer; }
.sec-sig.x:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--hairline)); }
.sec-sig-head { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.sec-cnt { margin-left: auto; color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.sec-sig-sample {
	font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-3);
	margin-top: 5px; white-space: pre-wrap; word-break: break-all;
	-webkit-user-select: text; user-select: text; cursor: text;
}
.sec-sig-full { display: none; }
.sec-sig.open .sec-sig-full { display: block; animation: expandIn var(--t-med) var(--e-out); }
.sec-sig.open .sec-sig-trunc { display: none; }
.sec-cov { margin-top: 26px; }
.sec-track { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-variant-numeric: tabular-nums; }
.sec-st {
	font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
	border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.sec-st.ss-open { background: var(--surface-3); color: var(--ink-2); }
.sec-st.ss-prog { background: color-mix(in srgb, var(--blue) 20%, transparent); color: var(--blue); }
.sec-st.ss-done { background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good); }
.sec-st.ss-acc { background: var(--surface-2); color: var(--ink-3); }
.sec-st.ss-rea { background: color-mix(in srgb, var(--critical) 24%, transparent); color: var(--critical); }
.sec-age { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sec-find.reappeared { border-color: color-mix(in srgb, var(--critical) 45%, var(--hairline)); }
.sec-banner {
	background: color-mix(in srgb, var(--critical) 13%, transparent);
	border: 1px solid color-mix(in srgb, var(--critical) 40%, transparent);
	color: var(--critical); border-radius: 10px; padding: 9px 14px;
	font-size: 12.5px; font-weight: 600; margin-bottom: 10px;
}
.sec-flash {
	border: 1px solid color-mix(in srgb, var(--good) 38%, transparent);
	background: color-mix(in srgb, var(--good) 12%, transparent);
	color: var(--good); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; margin-bottom: 10px;
}
.sec-act { display: flex; align-items: center; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.sec-sel {
	padding: 5px 8px; border: 1px solid var(--hairline); border-radius: 8px;
	background: var(--surface-2); color: var(--ink-2); cursor: pointer;
	font-size: 12px; font-weight: 500; font-family: inherit;
}
.sec-sel:disabled, .sec-find .btn:disabled { opacity: 0.55; cursor: default; }
.sec-msg { font-size: 12px; line-height: 1.45; margin-top: 8px; border-radius: 8px; padding: 6px 10px; }
.sec-msg.pending { background: var(--surface-2); color: var(--ink-3); }
.sec-msg.ok { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.sec-msg.warn { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }
.sec-msg.err { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.sec-note { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.sec-note-edit { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sec-note-in {
	flex: 1; min-width: 180px; background: var(--surface-2); border: 1px solid var(--hairline);
	border-radius: 8px; color: var(--ink); font-family: inherit; font-size: 12px; padding: 6px 10px; outline: none;
}
.sec-note-in::placeholder { color: var(--ink-3); }
.sec-tl { margin-top: 9px; border-top: 1px solid var(--hairline); padding-top: 8px; }
.sec-hev { display: flex; gap: 10px; align-items: baseline; font-size: 12px; padding: 3px 0; }
.sec-hev .at { color: var(--ink-3); font-size: 11px; white-space: nowrap; min-width: 64px; font-variant-numeric: tabular-nums; }
.sec-hev-k { color: var(--ink); font-weight: 600; white-space: nowrap; }
.sec-hev-d { color: var(--ink-3); min-width: 0; word-break: break-word; }
.sec-hist-empty { font-size: 12px; color: var(--ink-3); padding: 3px 0; }
.sec-res-h { display: flex; align-items: center; gap: 10px; }
.sec-res-h .sec-cnt { margin-left: 0; }
.sec-res {
	display: flex; align-items: center; gap: 10px; background: var(--surface);
	border: 1px solid var(--hairline); border-radius: 10px; padding: 9px 14px;
	margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2);
}
.sec-res-ok { color: var(--good); font-size: 11px; font-weight: 600; white-space: nowrap; }
.sec-res-at { margin-left: auto; color: var(--ink-3); font-size: 11px; white-space: nowrap; }

/* ---- timeline ---- */
#viewTimeline { overflow-y: auto; }
.tl-inner { max-width: 1280px; margin: 0 auto; padding: 18px clamp(16px,3vw,36px) 60px; }
.tl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tl-bar .spacer { flex: 1; }
.tl-custom { display: flex; align-items: center; gap: 6px; }
.tl-custom input {
	background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px;
	color: var(--ink); padding: 5px 8px; font-size: 11.5px; font-family: inherit;
}
.tl-arrow { color: var(--ink-3); font-size: 12px; }
.tl-clamp {
	font-size: 11px; font-weight: 600; color: var(--warning);
	border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
	border-radius: 999px; padding: 3px 9px;
}
.tl-chart {
	position: relative; background: var(--surface); border: 1px solid var(--hairline);
	border-radius: 14px; padding: 10px 0 4px; overflow-x: auto; overflow-y: hidden;
}
.tl-svg { display: block; max-width: 100%; }
.tl-zone-crit { fill: color-mix(in srgb, var(--critical) 9%, transparent); }
.tl-zone-warn { fill: color-mix(in srgb, var(--warning) 8%, transparent); }
.tl-thresh { stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.75; }
.tl-thresh.crit { stroke: var(--critical); }
.tl-thresh.warn { stroke: var(--warning); }
.tl-base { stroke: var(--hairline); stroke-width: 1; }
.tl-grid { stroke: var(--grid); stroke-width: 1; opacity: 0.45; }
.tl-axis { font-size: 9.5px; fill: var(--ink-3); }
.tl-lane-lbl { font-size: 10.5px; fill: var(--ink-2); font-weight: 600; }
.tl-lane-line { stroke: var(--hairline); stroke-width: 1; stroke-dasharray: 1 5; }
.tl-mem { stroke: var(--blue); stroke-width: 1.8; fill: none; }
.tl-mem-fill { fill: color-mix(in srgb, var(--blue) 12%, transparent); }
.tl-cpu { stroke: var(--ink-3); stroke-width: 1.2; fill: none; opacity: 0.7; }
.tl-5xx { fill: var(--red); opacity: 0.9; }
.tl-mk { cursor: pointer; transition: filter var(--t-fast); }
.tl-mk:hover { filter: brightness(1.25); }
.tl-link { cursor: pointer; }
.tl-vline { stroke-width: 1.3; stroke-dasharray: 4 4; }
.tl-vline.amber { stroke: var(--warning); }
.tl-vline.red { stroke: var(--critical); }
.tl-vlabel { font-size: 9.5px; font-weight: 700; }
.tl-vlabel.amber { fill: var(--warning); }
.tl-vlabel.red { fill: var(--critical); }
.tl-empty { padding: 10px 0 4px 96px; color: var(--ink-3); font-size: 12.5px; }
.tl-selbox {
	position: absolute; background: color-mix(in srgb, var(--blue) 14%, transparent);
	border-left: 1px solid var(--blue); border-right: 1px solid var(--blue);
	pointer-events: none; top: 14px;
}
.tl-playhead { position: absolute; width: 1.5px; background: var(--ink); cursor: ew-resize; z-index: 3; }
.tl-playhead::before {
	content: ""; position: absolute; left: -5.5px; top: -5px;
	width: 12px; height: 12px; border-radius: 50%; background: var(--ink);
	border: 2px solid var(--surface);
}
.tl-playhead:focus-visible { outline: none; }
.tl-playhead:focus-visible::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 60%, transparent); }
.tl-ph-at {
	position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
	background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700;
	padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}
.tl-tip {
	position: absolute; z-index: 5; pointer-events: none; max-width: 300px;
	background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px;
	padding: 9px 11px; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.tl-tip-h { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; font-size: 12.5px; }
.tl-tip-h span { color: var(--ink-3); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.tl-tip-at { color: var(--ink-3); font-size: 11px; margin: 2px 0 4px; }
.tl-tip-l { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; word-break: break-word; }
.tl-tip-go { color: var(--blue); margin-top: 3px; }
.tl-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 2px 0; }
.tl-lg { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); }
.tl-lg i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.tl-lg i.lg-mem { background: var(--blue); }
.tl-lg i.lg-cpu { background: var(--ink-3); }
.tl-lg i.lg-5xx { background: var(--red); }
.tl-lg i.lg-good { background: var(--good); }
.tl-lg i.lg-crit { background: var(--critical); }
.tl-lg i.lg-violet { background: var(--violet); }
.tl-lg i.lg-orange { background: var(--orange); }
.tl-lg-note { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.tl-state { margin-top: 16px; }
.tl-state-idle { color: var(--ink-3); font-size: 12.5px; padding: 6px 2px; }
.tl-state-h { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.tl-state-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tl-state-dep { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.tl-state-al { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tl-al {
	font-size: 11px; font-weight: 600; color: var(--critical);
	border: 1px solid color-mix(in srgb, var(--critical) 45%, transparent);
	border-radius: 999px; padding: 3px 9px;
}
.tl-ai { margin-top: 26px; }
.tl-h { font-size: 15px; margin-bottom: 10px; }
.tl-aibar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tl-pmbar { margin-top: 12px; }
.tl-tt-badge {
	background: color-mix(in srgb, var(--warning) 16%, transparent);
	border: 1px solid color-mix(in srgb, var(--warning) 55%, transparent);
	color: var(--warning); border-radius: 999px; padding: 3px 10px;
	font-size: 11px; font-weight: 700; cursor: pointer;
}
body.time-travel #mapWrap { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--warning) 45%, transparent); }
.sec-find.tl-flash { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 35%, transparent); }

/* layout editor */
.card-grid {
	display: grid; grid-template-columns: repeat(12, 1fr);
	column-gap: 14px; row-gap: 0; align-items: start;
}
.gc {
	grid-column: span var(--col-span, 12);
	min-width: 0; position: relative;
	min-height: calc((var(--row-span, 1) - 1) * 200px);
}
.ov-inner .gc > h2 { margin-top: 26px; }
.ov-inner .card-grid > .gc:first-child > h2 { margin-top: 4px; }
@media (max-width: 1100px) {
	.card-grid { grid-template-columns: repeat(6, 1fr); }
	.gc { grid-column: span var(--col-span-md, 6); }
}
@media (max-width: 700px) {
	.card-grid { grid-template-columns: 1fr; }
	.gc { grid-column: 1 / -1; }
}
.gc-handle, .gc-size { display: none; }
.gc-hide { display: none; }
body.gc-edit .gc {
	outline: 1px dashed color-mix(in srgb, var(--blue) 50%, transparent);
	outline-offset: 3px; border-radius: 12px;
}
body.gc-edit .gc-handle, body.gc-edit .gc-size { display: flex; }
body.gc-edit .gc.gc-hide { display: none; }
.gc-handle {
	position: absolute; top: 2px; right: 2px; z-index: 4;
	align-items: center; justify-content: center; gap: 3px;
	width: 26px; height: 22px; padding: 0; cursor: grab;
	border: 1px solid var(--hairline); border-radius: 7px;
	background: var(--surface-2); color: var(--ink-3); font-family: inherit;
}
.gc-handle:hover { color: var(--ink); border-color: var(--blue); }
.gc-handle i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: block; }
.gc-size {
	position: absolute; right: -3px; bottom: -3px; z-index: 4;
	width: 18px; height: 18px; padding: 0; cursor: nwse-resize;
	align-items: flex-end; justify-content: flex-end;
	border: none; background: transparent; color: var(--blue);
}
.gc-size::after {
	content: ""; width: 11px; height: 11px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	border-bottom-right-radius: 3px; opacity: 0.75;
}
.gc-size:hover::after { opacity: 1; }
.gc.gc-dragging {
	z-index: 30; opacity: 0.92; cursor: grabbing;
	outline-style: solid; outline-color: var(--blue);
	box-shadow: 0 16px 44px rgba(0,0,0,0.4);
}
.gc.gc-sizing { outline-style: solid; outline-color: var(--blue); }
.gc.gc-drop { outline-style: solid; outline-color: color-mix(in srgb, var(--blue) 70%, transparent); }
body.gc-edit .gc-handle:focus-visible, body.gc-edit .gc-size:focus-visible { outline: 2px solid var(--blue); }
.gc-edit-btn.on { border-color: var(--blue); color: var(--blue); }

/* header v2 */
header {
	grid-row: 1; grid-column: 1; position: relative;
	display: flex; align-items: center; gap: 12px;
	padding: 0 14px; flex-wrap: nowrap; overflow: hidden;
	background: transparent; border-bottom: 1px solid var(--hairline);
}
header::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	-webkit-backdrop-filter: blur(16px) saturate(1.25);
	backdrop-filter: blur(16px) saturate(1.25);
}
header > * { flex: 0 0 auto; }
header .spacer { flex: 1 1 auto; min-width: 0; }
.hd-left, .hd-env, .hd-right, .hd-actions, .auto-wrap, .acct { display: flex; align-items: center; }
.hd-left { gap: 10px; }
.hd-right { gap: 8px; }
.hd-actions { gap: 6px; }
.hd-rule { width: 1px; height: 18px; background: var(--hairline); }
header .crumb {
	font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap;
	max-width: 240px; overflow: hidden; text-overflow: ellipsis;
}
header .crumb .crumb-ws { color: var(--ink-2); font-weight: 600; }
header.hd-hasws .crumb-ws, header.hd-hasws .crumb-mid { display: none; }
header.hd-tight { gap: 8px; }
header.hd-tight .crumb { max-width: 140px; }
header.hd-tight .crumb-ws, header.hd-tight .crumb-mid { display: none; }
header.hd-tight .ws-btn { max-width: 132px; }
header.hd-nocrumb .crumb, header.hd-nocrumb .hd-rule { display: none; }
header.hd-squeeze .hd-env { flex: 0 1 auto; min-width: 0; overflow: hidden; }
header.hd-squeeze #envToggle { overflow-x: auto; scrollbar-width: none; }
header.hd-squeeze #envToggle::-webkit-scrollbar { display: none; }

header .btn {
	height: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
	background: transparent; border: 1px solid transparent; color: var(--ink-2);
}
header .btn:hover { background: var(--surface-2); border-color: var(--hairline); color: var(--ink); }
header .btn:focus-visible { border-radius: 8px; }
header .icb { width: 30px; padding: 0; }
header .icb svg { width: 15px; height: 15px; }
header .hd-more { font-size: 15px; line-height: 1; }
header .ws-btn { background: var(--surface-2); border-color: var(--hairline); max-width: 190px; padding: 0 9px 0 11px; }
header .ws-btn:hover { background: var(--surface-3); }
header .ws-btn #wsBtnName { font-size: 12.5px; }
header .bell .cnt { top: -3px; right: -4px; }

header .pill-group { height: 30px; padding: 2px; gap: 2px; border-radius: 9px; background: var(--surface-2); border-color: var(--hairline); }
header .pill {
	display: inline-flex; align-items: center; height: 24px; padding: 0 11px;
	border-radius: 7px; font-size: 12px; font-weight: 600;
}
header .pill:hover:not(.active) { background: var(--surface-3); color: var(--ink); }

header .sync {
	height: 30px; gap: 7px; padding: 0 10px; border-radius: 8px;
	background: var(--surface-2); border: 1px solid var(--hairline);
	font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap;
}
header .sync #syncTxt { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; }
header.hd-tight .sync #syncTxt { max-width: 128px; }
header.hd-dot .hd-actions .sync { width: 30px; padding: 0; justify-content: center; }
header.hd-dot .hd-actions .sync #syncTxt { display: none; }

.auto-wrap { height: 30px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface-2); }
header .auto-wrap .btn { height: 28px; border: none; background: transparent; }
header .auto-wrap .auto-btn { padding: 0 9px; border-radius: 7px 0 0 7px; }
header .auto-wrap .auto-more { width: 21px; border-radius: 0 7px 7px 0; border-left: 1px solid var(--hairline); font-size: 9px; color: var(--ink-3); }
header .auto-wrap .btn:hover { background: var(--surface-3); color: var(--ink); }
#autoBtn.on { color: var(--blue); }

.acct-btn {
	width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid color-mix(in srgb, var(--blue) 55%, transparent);
	background: color-mix(in srgb, var(--blue) 22%, transparent);
	color: var(--blue); font-family: inherit; font-size: 12px; font-weight: 700;
}
.acct-btn:hover { background: color-mix(in srgb, var(--blue) 34%, transparent); color: var(--ink); }

.hd-menu, .acct-menu, .hd-pop {
	position: fixed; display: none; z-index: 260;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
	box-shadow: 0 16px 50px rgba(0,0,0,0.45);
}
.hd-menu.open, .acct-menu.open, .hd-pop.open { display: block; animation: menuIn var(--t-med) var(--e-out); transform-origin: top right; }
.hd-menu.open.closing, .acct-menu.open.closing, .hd-pop.open.closing { animation: menuOut var(--t-fast) var(--e-in) both; }
.hd-menu { min-width: 252px; padding: 6px; }
.hd-mrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 6px; border-radius: 8px; }
.hd-mrow:hover { background: var(--surface-2); }
.hd-mlbl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.hd-mctx { font-size: 11px; color: var(--ink-3); padding: 5px 7px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); }
.hd-menu .sync #syncTxt { max-width: 150px; }

.hd-pop { width: 214px; padding: 12px; z-index: 261; }
.hd-pop-lbl { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.hd-pop-row { display: flex; align-items: center; gap: 8px; }
.hd-pop-row input {
	width: 74px; height: 30px; padding: 0 9px; font-family: inherit; font-size: 12.5px;
	background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink);
}
.hd-pop-row input:focus { outline: none; border-color: var(--blue); }
.hd-pop-unit { font-size: 12px; color: var(--ink-3); }
.hd-pop-note { font-size: 11px; line-height: 1.45; color: var(--ink-3); margin-top: 10px; }

.acct-menu { min-width: 224px; padding: 10px; }
.acct-email { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 4px 9px; }
#acctMenu .acct-signout { width: 100%; height: 32px; justify-content: center; background: var(--surface-2); border: 1px solid var(--hairline); color: var(--ink-2); }
#acctMenu .acct-signout:hover { background: var(--surface-3); color: var(--ink); }

.view-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 0 2px; min-height: 34px; }
.view-tools .btn { height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.view-tools .gc-edit-btn svg { flex-shrink: 0; }

/* ============ ONBOARDING ============ */
.ob-card {
	width: 760px; max-width: 94vw; max-height: 88vh; padding: 24px 26px 18px;
	text-align: left; display: flex; flex-direction: column;
}
.ob-card h2 { font-size: 19px; text-align: left; }
.ob-card p#obSub { font-size: 12.5px; color: var(--ink-3); margin: 5px 0 0; line-height: 1.5; }
.ob-head { border-bottom: 1px solid var(--hairline); padding-bottom: 13px; }
.ob-steps { display: flex; align-items: center; gap: 4px; list-style: none; margin-top: 14px; flex-wrap: wrap; }
.ob-stepdot { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 999px; border: 1px solid transparent; }
.ob-stepno {
	width: 20px; height: 20px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
	font-size: 10.5px; font-weight: 700; background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--hairline);
}
.ob-steplbl { font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ob-stepdot.on { background: var(--surface-2); border-color: var(--hairline); }
.ob-stepdot.on .ob-stepno { background: var(--blue); color: #fff; border-color: var(--blue); }
.ob-stepdot.on .ob-steplbl { color: var(--ink); }
.ob-stepdot.done .ob-stepno { background: transparent; color: var(--good); border-color: var(--good); }
.ob-stepdot.done .ob-steplbl { color: var(--ink-2); }

.ob-body { flex: 1; overflow-y: auto; padding: 16px 2px 6px; min-height: min(230px, 40vh); }
.ob-err { color: var(--critical); font-size: 12px; line-height: 1.4; min-height: 16px; padding: 2px 2px 0; }
.ob-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.ob-foot-gap { flex: 1; }
.ob-card .btn { width: auto; height: 34px; margin-top: 0; padding: 0 14px; border-radius: 9px; font-size: 12.5px; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--ink-2); }
.ob-card .btn:hover { background: var(--surface-3); color: var(--ink); }
.ob-card .ob-primary {
	width: auto; height: 34px; margin-top: 0; padding: 0 18px; border: none; border-radius: 9px;
	background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ob-card .ob-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.ob-card .ob-primary.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }

.ob-provs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ob-card .ob-prov {
	display: flex; flex-direction: column; align-items: center; gap: 9px; width: auto; margin: 0;
	padding: 18px 10px 14px; border: 1px solid var(--hairline); border-radius: 14px;
	background: var(--surface-2); color: var(--ink); cursor: pointer; font-family: inherit; font-size: 13px;
}
.ob-card .ob-prov:hover:not(:disabled) { border-color: var(--blue); }
.ob-card .ob-prov.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.ob-card .ob-prov.soon { opacity: 0.5; cursor: not-allowed; }
.ob-prov-logo { height: 40px; display: flex; align-items: center; justify-content: center; }
.ob-prov-name { font-size: 12.5px; font-weight: 600; text-align: center; }
.ob-tag {
	font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
	color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 2px 8px;
}
.ob-tag.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }

.ob-rows { display: flex; flex-direction: column; max-height: 216px; overflow-y: auto; }
.ob-card .ob-row {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
	margin: 0 0 6px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 11px;
	background: var(--surface-2); color: var(--ink); cursor: pointer; font-family: inherit; text-align: left;
}
.ob-card .ob-row:hover { border-color: var(--blue); }
.ob-card .ob-row.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.ob-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-row-name { font-size: 13px; font-weight: 600; }
.ob-row-sub { font-size: 11px; color: var(--ink-3); }
.ob-badge {
	flex: none; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
	padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2);
}
.ob-badge.sso { color: var(--violet); }
.ob-badge.static { color: var(--yellow); }
.ob-badge.assume-role { color: var(--aqua); }

.ob-conn {
	display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; padding: 10px 12px;
	border: 1px solid var(--hairline); border-radius: 11px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.ob-conn.ok { background: color-mix(in srgb, var(--good) 8%, transparent); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.ob-conn.bad { background: color-mix(in srgb, var(--critical) 8%, transparent); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.ob-conn b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; background: var(--critical); }
.ob-conn.ok .ob-dot, .ob-dot.ok { background: var(--good); }
.ob-found-head .ob-dot { margin-top: 0; }

.ob-load { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 46px 0; color: var(--ink-2); font-size: 13px; }
.ob-load.small { padding: 14px 0; justify-content: flex-start; font-size: 12.5px; }

.ob-panel { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.ob-panel.bad { border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.ob-card .ob-panel p, .ob-card .ob-help-body p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 0 0 2px; }
.ob-card .ob-help-h { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin: 12px 0 0; }
.ob-card .ob-panel .cmd, .ob-card .ob-help-body .cmd { margin: 6px 0 2px; padding-right: 10px; }
.ob-card .ob-panel .btn, .ob-card .ob-help-body .btn { margin-top: 12px; }
.ob-card .ob-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin: 10px 0 0; }
.ob-card .ob-note.warn { color: var(--warning); }
.ob-card .ob-note b { color: var(--ink-2); }

.ob-form { max-width: 420px; }
.ob-label { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin-bottom: 5px; }
.ob-card input.ob-input, .ob-card select.ob-input {
	width: 100%; background: var(--bg); border: 1px solid var(--hairline); border-radius: 9px;
	padding: 9px 11px; color: var(--ink); font-size: 13px; font-family: inherit;
	text-align: left; letter-spacing: normal;
}
.ob-card .ob-input:focus { outline: none; border-color: var(--blue); }
.ob-card input.ob-input.bad { border-color: var(--critical); }
.ob-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-top: 12px; }
.ob-fld { min-width: 0; }

.ob-found { border: 1px solid var(--hairline); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.ob-found-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ob-sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; margin-top: 12px; }
.ob-sum div { min-width: 0; }
.ob-sum dt { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); }
.ob-sum dd { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; margin-top: 2px; }

.ob-checks { list-style: none; display: flex; flex-direction: column; gap: 1px; margin-top: 12px; }
.ob-check { display: flex; gap: 9px; align-items: flex-start; padding: 6px 8px; border-radius: 8px; }
.ob-check.opt { opacity: 0.66; }
.ob-mark { width: 15px; flex: none; text-align: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.ob-check.ok .ob-mark { color: var(--good); }
.ob-check.bad .ob-mark { color: var(--critical); }
.ob-check-main { display: flex; flex-direction: column; min-width: 0; }
.ob-check-lbl { font-size: 12.5px; color: var(--ink-2); }
.ob-check-sub { font-size: 11px; color: var(--ink-3); line-height: 1.45; margin-top: 1px; overflow-wrap: anywhere; }

.ob-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ob-checkbox { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); cursor: pointer; }
.ob-checkbox input { width: 15px; height: 15px; flex: none; accent-color: var(--blue); cursor: pointer; }

.ob-help { margin-top: 14px; border-top: 1px solid var(--hairline); padding-top: 10px; }
.ob-help > summary { font-size: 12px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px; }
.ob-help > summary::-webkit-details-marker { display: none; }
.ob-help > summary::before { content: "›"; display: inline-block; color: var(--ink-3); transition: transform 0.15s; }
.ob-help[open] > summary::before { transform: rotate(90deg); }
.ob-help-body { padding-top: 8px; }

@media (max-width: 880px) {
	.ob-provs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ob-grid, .ob-sum { grid-template-columns: 1fr; }
}

.role-tpl { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 10px; background: var(--surface-2); }
.role-tpl.hidden { display: none; }
.role-steps { margin: 0 0 8px; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.role-steps b { color: var(--ink-1); }
.role-tpl code { font-size: 12px; color: var(--ink-2); word-break: break-all; }

/* ---- connect AWS (hosted) ---- */
.cx-card { max-width: 560px; padding: 28px 30px 24px; }
.cx-steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.cx-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); padding: 4px 10px 4px 4px; border-radius: 999px; }
.cx-dot b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); font-size: 11px; font-weight: 600; }
.cx-dot.on { color: var(--ink-1); background: var(--surface-2); }
.cx-dot.on b { background: var(--blue); color: #fff; }
.cx-dot.done b { background: var(--green, #3fb950); color: #fff; }
.cx-card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
.cx-note { color: var(--ink-2); font-size: 13.5px; line-height: 1.6; margin: 0 0 14px; }
.cx-note b { color: var(--ink-1); }
.cx-small { font-size: 12px; color: var(--ink-3); }
.cx-select, .cx-input { width: 100%; margin: 0 0 14px; }
.cx-launch { display: inline-block; text-decoration: none; margin-bottom: 6px; }
.cx-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.cx-checks { display: flex; flex-direction: column; gap: 5px; margin: 4px 0 8px; font-size: 12.5px; }
.cx-err { margin-top: 12px; color: var(--red, #f85149); font-size: 13px; }
.cx-busy { margin-top: 10px; color: var(--ink-3); font-size: 12.5px; }

/* ---- region picker + wizard polish ---- */
.cx-search-wrap { position: relative; margin-bottom: 12px; }
.cx-search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.cx-search { width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 11px; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--ink); font-size: 13.5px; outline: none; transition: border-color .15s, box-shadow .15s; }
.cx-search::placeholder { color: var(--ink-3); }
.cx-search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent); }
.cx-region-grid { max-height: 302px; overflow-y: auto; margin: 0 -4px 2px; padding: 2px 4px; }
.cx-region-group { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 14px 4px 8px; }
.cx-region-group:first-child { margin-top: 2px; }
.cx-region-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 8px; }
.cx-region { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--surface-2); color: var(--ink); cursor: pointer; transition: transform .16s cubic-bezier(.2,.8,.2,1), border-color .16s, box-shadow .16s, background .16s; }
.cx-region:hover { border-color: var(--blue); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.cx-region.on { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); box-shadow: inset 0 0 0 1px var(--blue); }
.cx-region-top { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.cx-region-name { font-size: 13px; font-weight: 600; }
.cx-region-tick { color: var(--blue); font-size: 12px; font-weight: 700; opacity: 0; transform: scale(.5); transition: opacity .16s, transform .16s cubic-bezier(.2,1.4,.4,1); }
.cx-region.on .cx-region-tick { opacity: 1; transform: scale(1); }
.cx-region-city { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.cx-region-code { font-size: 10.5px; color: var(--ink-3); font-family: ui-monospace, Menlo, monospace; margin-top: 3px; }
.cx-region-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 13px; }
/* service picker cards: same visual language as the region cards, dimmed when unticked */
.cx-svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 8px; max-height: 302px; overflow-y: auto; margin: 0 -4px 2px; padding: 2px 4px; }
.cx-svc:not(.on) { opacity: .55; }
.cx-svc:not(.on):hover { opacity: .85; }
.cx-primary { height: 38px; padding: 0 22px; border-radius: 10px; border: none; background: var(--blue); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: filter .14s, transform .08s; }
.cx-primary:hover { filter: brightness(1.08); }
.cx-primary:active { transform: translateY(1px); }
.cx-primary:disabled { opacity: .5; cursor: not-allowed; }
#cxBody > * { animation: cxStepIn var(--t-slow) var(--e-out) both; }
@keyframes cxStepIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

/* the connect modal sits above the connect gate (z-index 200), which is what it replaces */
.modal {
	position: fixed; inset: 0; z-index: 310;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .62);
	padding: 24px;
	animation: fadeIn var(--t-med) var(--e-out);
}
.modal.hidden { display: none; }
.modal-card {
	position: relative;
	width: 100%;
	background: var(--surface);
	border: 1px solid var(--hairline);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	animation: cardIn var(--t-slow) var(--e-out) both;
}
.modal-x {
	position: absolute; top: 12px; right: 14px;
	background: none; border: 0; cursor: pointer;
	color: var(--ink-3); font-size: 20px; line-height: 1;
	padding: 4px 8px; border-radius: 8px;
}
.modal-x:hover { color: var(--ink-1); background: var(--surface-2); }

/* ============ SSO buttons ============ */
.sso-area:empty { display: none; }
.sso-div { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: var(--ink-3); font-size: 11.5px; }
.sso-div::before, .sso-div::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.sso-btns { display: flex; flex-direction: column; gap: 8px; }
.sso-btn { width: 100%; padding: 10px; justify-content: center; text-align: center; font-size: 13px; }

/* ============ Team / organization ============ */
.role-badge {
	display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600;
	border: 1px solid var(--hairline); color: var(--ink-2); background: var(--surface-2); letter-spacing: 0.02em;
}
.role-badge.role-owner { color: var(--blue); border-color: var(--blue); }
.role-badge.role-admin { color: var(--yellow); border-color: var(--yellow); }
.team-row { gap: 12px; }
.team-email { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.team-you { font-size: 10px; color: var(--ink-3); border: 1px solid var(--hairline); border-radius: 999px; padding: 0 6px; }
.team-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.team-role-sel { background: var(--bg); border: 1px solid var(--hairline); border-radius: 7px; color: var(--ink); padding: 4px 7px; font-size: 12px; font-family: inherit; }
.team-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }
.team-invite-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.team-invite-row input { flex: 1; min-width: 160px; background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); padding: 7px 10px; font-size: 13px; font-family: inherit; }
.team-invite-row input:focus { outline: none; border-color: var(--blue); }
.team-invite-row select { background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); padding: 7px 9px; font-size: 12.5px; font-family: inherit; }
.team-invite-out { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; }
.team-link-row { display: flex; gap: 8px; align-items: center; }
.team-link-inp { flex: 1; background: var(--bg); border: 1px solid var(--hairline); border-radius: 8px; color: var(--ink); padding: 7px 10px; font-size: 12px; font-family: inherit; }
.team-link-inp:focus { outline: none; border-color: var(--blue); }

/* ============ Invite acceptance card ============ */
#inviteGate .invite-home { display: inline-block; width: auto; padding: 9px 18px; margin-top: 8px; }
#inviteGate .auth-form input[readonly] { opacity: 0.75; cursor: default; }

/* ---- sectioned settings page ---- */
.set-wrap { display: grid; grid-template-columns: 190px 1fr; gap: 30px; max-width: 900px; margin: 0 auto; padding: 26px clamp(16px,4vw,48px) 60px; align-items: start; }
.set-title { font-size: 18px; margin: 0 0 14px; letter-spacing: -0.01em; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 26px; }
.set-navi { text-align: left; padding: 8px 12px; border-radius: 9px; border: none; background: transparent; color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background .12s, color .12s; }
.set-navi:hover { background: var(--surface-2); color: var(--ink); }
.set-navi.active { background: var(--surface-3); color: var(--ink); font-weight: 600; }
.set-panel { display: none; }
.set-panel.active { display: block; animation: viewIn var(--t-slow) var(--e-out); }
@media (max-width: 760px) {
	.set-wrap { grid-template-columns: 1fr; gap: 14px; padding-top: 18px; }
	.set-nav { flex-direction: row; overflow-x: auto; position: static; gap: 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
	.set-navi { white-space: nowrap; flex-shrink: 0; }
	.set-title { display: none; }
}

/* ---- global input focus polish ---- */
input[type=text], input[type=password], input[type=number], input[type=email], input:not([type]), select, textarea {
	transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=password]:focus, input[type=number]:focus, input[type=email]:focus, input:not([type]):focus, select:focus, textarea:focus {
	outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 15%, transparent);
}

/* ---- danger zone (account deletion) ---- */
.danger-card { margin-top: 14px; border-color: color-mix(in srgb, var(--critical) 35%, var(--hairline)); }
.danger-card h3 { color: var(--critical); }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.danger-title { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.danger-btn { border: 1px solid var(--critical) !important; color: var(--critical) !important; background: transparent !important; white-space: nowrap; font-weight: 600; }
.danger-btn:hover { background: var(--critical) !important; color: #fff !important; }
.danger-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---- timeline: incidents & saved reports (tl-inc-) ---- */
.tl-inc { margin-top: 26px; }
.tl-inc-list { display: flex; flex-direction: column; gap: 10px; }
.tl-inc-row {
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04); overflow: hidden;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.tl-inc-row.on { border-color: color-mix(in srgb, var(--blue) 35%, var(--hairline)); }
.tl-inc-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; flex-wrap: wrap; }
.tl-inc-head:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.tl-inc-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 55%, transparent); }
.tl-inc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tl-inc-dot.open { background: var(--critical); animation: tlIncPulse 1.6s ease-in-out infinite; }
.tl-inc-dot.resolved { background: var(--ink-3); opacity: .6; }
@keyframes tlIncPulse {
	0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--critical) 45%, transparent); }
	50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--critical) 0%, transparent); }
}
.tl-inc-title { font-size: 13px; font-weight: 600; }
.tl-inc-range { font-size: 11.5px; color: var(--ink-3); }
.tl-inc-chips { display: inline-flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.tl-inc-chip {
	font-size: 10px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--hairline);
	color: var(--ink-2); background: color-mix(in srgb, var(--ink) 4%, transparent);
	text-transform: lowercase; letter-spacing: .02em; white-space: nowrap;
}
.tl-inc-body { padding: 8px 14px 14px; border-top: 1px dashed var(--hairline); }
.tl-inc-sum { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin: 4px 0 8px; }
.tl-inc-sum p { margin-bottom: 6px; }
.tl-inc-sec { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin: 12px 0 4px; }
.tl-inc-item { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--ink-2); padding: 3px 0; }
.tl-inc-txt { min-width: 0; word-break: break-word; }
.tl-inc-k { font-weight: 700; flex: none; }
.tl-inc-k.amber { color: var(--warning); }
.tl-inc-k.red { color: var(--critical); }
.tl-inc-k.added { color: var(--ok, #38b26c); }
.tl-inc-k.removed { color: var(--red); }
.tl-inc-k.changed { color: var(--warning); }
.tl-inc-jump {
	margin-left: auto; flex: none; border: none; background: none; cursor: pointer;
	color: var(--blue); font-size: 11px; padding: 2px 6px; border-radius: 6px; white-space: nowrap;
}
.tl-inc-jump:hover { background: color-mix(in srgb, var(--blue) 12%, transparent); }
.tl-inc-busy { padding: 6px 0; font-size: 12px; }
.tl-inc-built { margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.tl-inc-flash { border-color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 35%, transparent); }

/* AI window chrome: generated content lives in a framed panel with a title bar, not a bare
   text blob. Shared by the timeline's analysis and postmortem panels. */
.tl-sechead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.tl-sechead .tl-h { margin: 0; }
.tl-spacer { flex: 1; }
.ai-act { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); border-color: color-mix(in srgb, var(--blue) 40%, var(--hairline)); }
.ai-act:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.ai-act.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--blue) 55%, transparent); }
.ai-act svg { flex: none; opacity: .9; }
.ai-win {
	border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
	background: var(--surface); margin-top: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
	animation: aiWinIn var(--t-slow) var(--e-out) both;
}
@keyframes aiWinIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.ai-win + .ai-win { margin-top: 14px; }
.ai-win-bar {
	display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 14px;
	background: linear-gradient(to bottom, color-mix(in srgb, var(--blue) 8%, var(--surface-2)), var(--surface-2));
	border-bottom: 1px solid var(--hairline); font-size: 12.5px; color: var(--ink);
}
.ai-win-bar b { font-weight: 600; letter-spacing: .01em; }
.ai-win-glyph { color: var(--blue); display: inline-flex; }
.ai-ibtn {
	width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
	border: none; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer;
	transition: background .12s, color .12s;
}
.ai-ibtn:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.ai-ibtn.ok { color: var(--green, #3fb96f); }
.ai-win .ai-win-body { border: none; border-radius: 0; background: transparent; padding: 16px 20px 18px; }
.ai-think { display: flex; flex-direction: column; gap: 10px; padding: 2px 0; }
.ai-think .skl { height: 11px; border-radius: 6px; }
.ai-think-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* foresight: prediction cards with a severity spine, sparkline evidence, prevent-now strip */
#viewForesight { overflow-y: auto; }
.fs-wrap { max-width: 900px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 48px) 60px; }
.fs-ctx { font-size: 11px; border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 10px; color: var(--ink-3); }
.fs-ctx.ok { color: var(--green, #3fb96f); border-color: color-mix(in srgb, var(--green, #3fb96f) 45%, transparent); }
.fs-card {
	border: 1px solid var(--hairline); border-left: 3px solid var(--ink-3); border-radius: 12px;
	background: var(--surface); padding: 13px 16px; margin-bottom: 10px;
	animation: aiWinIn var(--t-slow) var(--e-out) both;
}
.fs-card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fs-card-top b { font-size: 13.5px; }
.fs-sev { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border: 1px solid; border-radius: 999px; padding: 2px 8px; flex: none; }
.fs-when { font-size: 11.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.fs-why { font-size: 12.5px; color: var(--ink-2); line-height: 1.6; margin: 7px 0 0; }
.fs-prevent { display: flex; align-items: baseline; gap: 8px; margin-top: 9px; font-size: 12.5px; color: var(--ink); }
.fs-prevent span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); border: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); border-radius: 999px; padding: 2px 8px; flex: none; }
.fs-sparkwrap { display: inline-flex; opacity: .85; }
.fs-spark { display: block; }
.fs-clear { border: 1px dashed var(--hairline); border-radius: 12px; padding: 18px; }
.fs-details { margin-top: 14px; }
.fs-details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.fs-sig { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent); font-size: 12.5px; color: var(--ink-2); }
.fs-sig b { font-size: 12.5px; }
.fs-stamp { margin-top: 12px; font-size: 11px; color: var(--ink-3); }

/* ---- toasts ---- */
#toasts {
	position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	z-index: 400; pointer-events: none;
}
.toast {
	display: flex; align-items: center; gap: 9px; max-width: min(480px, 90vw);
	background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px;
	padding: 9px 14px; font-size: 12.5px; color: var(--ink); pointer-events: auto;
	box-shadow: 0 10px 34px rgba(0,0,0,0.4);
	animation: toastIn var(--t-med) var(--e-out) both;
}
.toast.closing { animation: toastOut var(--t-fast) var(--e-in) both; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.toast.ok::before { background: var(--good); }
.toast.err::before { background: var(--critical); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-4px); } }

/* ---- in-app confirm dialog (replaces native confirm/prompt) ---- */
.confirm-card { width: 420px; max-width: 92vw; padding: 22px 24px 18px; }
.confirm-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.confirm-card p { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 14px; }
.confirm-card p b { color: var(--ink); }
.confirm-input {
	width: 100%; background: var(--bg); border: 1px solid var(--hairline); border-radius: 9px;
	color: var(--ink); padding: 9px 11px; font-size: 13px; font-family: inherit; margin-bottom: 14px;
}
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-actions .btn { padding: 8px 14px; border-radius: 9px; font-size: 13px; }
.confirm-actions .confirm-go {
	padding: 8px 16px; border: none; border-radius: 9px; cursor: pointer;
	background: var(--blue); color: #fff; font-size: 13px; font-weight: 600; font-family: inherit;
}
.confirm-actions .confirm-go:hover { filter: brightness(1.08); }
.confirm-actions .confirm-go:disabled { opacity: 0.45; cursor: not-allowed; filter: none; }
.confirm-actions .confirm-go.danger { background: var(--critical); }

/* ---- Firefox scrollbars ---- */
@supports (-moz-appearance: none) {
	* { scrollbar-color: var(--surface-3) transparent; scrollbar-width: thin; }
}

/* ---- reduced motion: collapse all animation to near-zero, keep end states ---- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---- overview: status hero ---- */
.ov-hero {
	display: flex; align-items: center; gap: 14px;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
	padding: 16px 20px;
}
.ov-hero-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--ink-3); }
.ov-hero.ok .ov-hero-dot { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); }
.ov-hero.warn .ov-hero-dot { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 22%, transparent); }
.ov-hero.crit .ov-hero-dot { background: var(--critical); box-shadow: 0 0 0 4px color-mix(in srgb, var(--critical) 24%, transparent); animation: tlIncPulse 1.6s ease-in-out infinite; }
.ov-hero.loading .ov-hero-dot { background: var(--blue); animation: syncPulse 1s ease-in-out infinite; }
.ov-hero-txt { min-width: 0; }
.ov-hero-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.ov-hero.crit .ov-hero-title { color: var(--critical); }
.ov-hero-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ov-hero-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) {
	.ov-hero { flex-wrap: wrap; }
	.ov-hero-actions { justify-content: flex-start; }
}

/* ---- overview: grouped estate list ---- */
.est-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 4px 16px; }
.est-note { font-size: 12.5px; color: var(--ink-3); padding: 10px 0; }
.est-group { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.est-group:last-child { border-bottom: none; }
.est-cat {
	flex: none; width: 92px; font-size: 10.5px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3);
}
.est-items { display: flex; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.est-item {
	display: inline-flex; align-items: baseline; gap: 6px;
	font-size: 12.5px; color: var(--ink-2); text-decoration: none;
	border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 11px;
	background: var(--surface-2); transition: border-color var(--t-fast), color var(--t-fast);
}
a.est-item:hover { border-color: var(--blue); color: var(--ink); }
.est-item b { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- overview: compact environment rows ---- */
.env-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.env-row:last-child { border-bottom: none; }
.env-row .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--good); }
.env-row b { font-weight: 600; }
.env-row .env-meta { color: var(--ink-3); font-size: 12px; margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the activity feed lives in a narrow rail — cap it so it never dictates the row height */
#actList { max-height: 300px; overflow-y: auto; }

/* ---- overview: uniform section cards ---- */
/* Every overview section is one card with its header inside — one container pattern,
   one padding, one rhythm. Inner content sits on surface-2 for a single level of depth. */
.ov-inner .card-grid { row-gap: 14px; }
.ovs {
	height: 100%;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 14px;
	padding: 14px 18px 16px;
}
.ovs-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; min-height: 26px; }
.ov-inner .ovs-h h2 { margin: 0; font-size: 12px; }
.ovs-h .btn { height: 26px; padding: 0 10px; font-size: 11.5px; display: inline-flex; align-items: center; }
/* flatten inner containers that carry their own card chrome elsewhere */
.ovs .est-card, .ovs .act-list, .ovs .env-card { background: none; border: none; border-radius: 0; padding: 0; }
.ovs .chart-card, .ovs .tile, .ovs .ql { background: var(--surface-2); }
.ovs .act-row:last-child { border-bottom: none; }
/* the hero card fills its row like the section cards do */
.ov-hero { min-height: 74px; }

/* ---- data health panel ---- */
.sync-click { cursor: pointer; }
.ov-fix { border-color: color-mix(in srgb, var(--warning) 55%, transparent) !important; color: var(--warning) !important; }
.ov-fix:hover { background: color-mix(in srgb, var(--warning) 12%, transparent) !important; }
.dh-card { max-width: 620px; padding: 22px 24px 18px; }
.dh-h { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.dh-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.dh-row { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.dh-row:last-of-type { border-bottom: none; }
.dh-tag {
	flex: none; margin-top: 1px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em;
	text-transform: uppercase; border-radius: 999px; padding: 2px 8px;
	background: var(--surface-3); color: var(--ink-2); white-space: nowrap;
}
.dh-tag.dh-denied { background: color-mix(in srgb, var(--critical) 18%, transparent); color: var(--critical); }
.dh-tag.dh-expired { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.dh-tag.dh-notEnabled { background: var(--surface-2); color: var(--ink-3); }
.dh-main { min-width: 0; }
.dh-main b { font-size: 13px; font-weight: 600; }
.dh-err { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--ink-3); margin-top: 2px; word-break: break-word; line-height: 1.5; }
.dh-sec { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); margin: 16px 0 8px; }
.dh-fix { border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface-2); padding: 12px 14px; margin-bottom: 8px; }
.dh-fix b { font-size: 12.5px; }
.dh-fix p { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; margin: 4px 0 0; }
.dh-fix .cmd { margin-top: 8px; }
.dh-fix-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dh-fix-acts .btn { text-decoration: none; display: inline-flex; align-items: center; }
.dh-checks { margin-top: 10px; font-size: 12px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.dh-checks .cg-spin { display: inline-block; vertical-align: middle; margin-right: 6px; }
.dh-check.ok { color: var(--good); }
.dh-check.bad { color: var(--critical); }
.dh-check span { color: var(--ink-3); }
.dh-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dh-pick { margin-top: 4px; font-size: 12.5px; }
.dh-pick .env-bad { display: block; margin-top: 8px; }
.dh-pick-l { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); margin: 10px 0 4px; }
.dh-pick select {
	width: 100%; background: var(--bg); border: 1px solid var(--hairline); border-radius: 9px;
	color: var(--ink); padding: 8px 10px; font-size: 13px; font-family: inherit;
}
.dh-pick-note { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }

/* ---- multi-service watch: picker list + overview strip ---- */
.dh-pick-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--hairline); border-radius: 9px; background: var(--bg); padding: 6px 10px 10px; }
.dh-pick-cl { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 10px 0 4px; }
.dh-pick-cl:first-child { margin-top: 4px; }
.dh-pick-svc { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; border-radius: 6px; }
.dh-pick-svc:hover { background: var(--surface-2); color: var(--ink); }
.dh-pick-svc input { flex: none; width: 14px; height: 14px; cursor: pointer; }
.svc-strip { display: flex; flex-direction: column; margin-top: 10px; }
.svc-strip:empty { display: none; }
.svc-row { display: flex; align-items: center; gap: 9px; padding: 6px 2px; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.svc-row:last-child { border-bottom: none; }
.svc-row .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.svc-row .dot.ok { background: var(--good); }
.svc-row .dot.warn { background: var(--warning); }
.svc-row b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-row .svc-meta { margin-left: auto; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- "explain this" info buttons ---- */
.ai-info {
	display: inline-flex; align-items: center; gap: 5px; flex: none;
	height: 20px; padding: 0 9px; border: 1px solid color-mix(in srgb, var(--blue) 32%, transparent);
	border-radius: 999px; background: color-mix(in srgb, var(--blue) 7%, transparent);
	color: var(--blue); cursor: pointer; vertical-align: middle;
	font-size: 10.5px; font-weight: 600; font-family: inherit; letter-spacing: 0.02em;
	transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.ai-info:hover { background: color-mix(in srgb, var(--blue) 16%, transparent); border-color: color-mix(in srgb, var(--blue) 55%, transparent); }
.ai-info svg { flex: none; opacity: 0.9; }
.issue .ai-info, .sec-find-title .ai-info { margin-left: 6px; }
#lamTable .ai-info { margin-left: 10px; }

/* ---- AI explain bottom sheet ---- */
.ai-sheet {
	position: fixed; inset: 0; z-index: 330; display: none;
	align-items: center; justify-content: center;
	background: rgba(0, 0, 0, 0.38); padding: 24px 16px;
}
.ai-sheet.open { display: flex; animation: fadeIn var(--t-med) var(--e-out); }
.ai-sheet.open.closing { animation: fadeOut var(--t-fast) var(--e-in) both; }
.ai-sheet-card {
	width: min(680px, 100%); max-height: min(74vh, 640px);
	display: flex; flex-direction: column;
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: blur(22px) saturate(1.25); -webkit-backdrop-filter: blur(22px) saturate(1.25);
	border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent);
	border-radius: 20px; overflow: hidden;
	box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
	animation: sheetIn var(--t-slow) var(--e-spring) both;
}
.ai-sheet.open.closing .ai-sheet-card { animation: sheetOut var(--t-fast) var(--e-in) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(22px) scale(0.97); } }
@keyframes sheetOut { to { opacity: 0; transform: translateY(14px) scale(0.98); } }
.ai-sheet-head {
	display: flex; align-items: center; gap: 10px; flex: none;
	padding: 12px 12px 12px 16px; border-bottom: 1px solid color-mix(in srgb, var(--hairline) 70%, transparent);
}
.ai-sheet-glyph {
	width: 26px; height: 26px; border-radius: 9px; flex: none;
	display: inline-flex; align-items: center; justify-content: center;
	background: color-mix(in srgb, var(--blue) 18%, transparent); color: var(--blue);
}
.ai-sheet-t { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; min-width: 0; }
.ai-sheet-t b { font-size: 13.5px; font-weight: 600; }
.ai-sheet-sub { font-size: 10.5px; color: var(--ink-3); }
.ai-sheet-body { overflow-y: auto; padding: 14px 18px 18px; }
.ai-sheet-ans { font-size: 13px; line-height: 1.65; color: var(--ink-2); animation: fadeIn var(--t-med) var(--e-out); }
.ai-sheet-ans h4 { color: var(--ink); font-size: 12.5px; margin: 12px 0 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.ai-sheet-ans h4:first-child { margin-top: 0; }
.ai-sheet-ans li { margin: 4px 0 4px 16px; }
.ai-sheet-ans b { color: var(--ink); }
.ai-sheet-ans code { background: var(--surface-2); border-radius: 5px; padding: 1px 6px; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
/* tappable links in AI answers, everywhere markdown renders */
.ai-sheet-ans a, .ai-box a { color: var(--blue); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--blue) 40%, transparent); word-break: break-all; }
.ai-sheet-ans a:hover, .ai-box a:hover { border-bottom-color: var(--blue); }
@media (max-width: 700px) { .ai-sheet { padding: 12px; } .ai-sheet-card { border-radius: 16px; max-height: 82vh; } }
