: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: #0ca30c;
	--warning: #fab219;
	--serious: #ec835a;
	--critical: #d03b3b;
	--edge: #4a4a47;
	--edge-hi: #3987e5;
}
[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;
}
* { 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: 210px 1fr; grid-template-rows: 50px 1fr;
	overflow: hidden; font-size: 14px;
	-webkit-user-select: none; user-select: none;
	-webkit-font-smoothing: antialiased;
}
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: 1px; border-radius: 6px; }
button { transition: background 0.12s, border-color 0.12s, color 0.12s; }
button:active { transform: translateY(0.5px); }
#side {
	grid-row: 1 / 3; grid-column: 1; background: var(--surface);
	border-right: 1px solid var(--hairline); display: flex; flex-direction: column;
	padding: 14px 10px 12px; min-height: 0;
}
.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: 750; 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: 800;
	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: 550;
	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: 550; font-family: inherit;
}
.btn:hover { background: var(--surface-3); color: var(--ink); }
main { grid-row: 2; grid-column: 2; 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; }
.gbox span:hover { color: var(--ink); }
.gbox span-x {
	position: absolute; top: -10px; left: 18px; font-size: 10.5px; font-weight: 800;
	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);
}
#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: 800;
	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: 650; 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: 550; 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; }
#flowCaption {
	position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40;
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 10px;
	padding: 10px 16px; max-width: 720px; display: none; align-items: center; gap: 14px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
#flowCaption.show { display: flex; }
#flowCaption .step-txt { font-size: 13px; line-height: 1.4; }
#flowCaption .step-txt b { color: var(--blue); }
/* 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 0.22s ease; z-index: 60;
	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: 650; 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: 550;
}
.pipe-item small { display: block; color: var(--ink-3); font-weight: 450; 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: 650; }
.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: 800; 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; }
.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: 550; }
.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 0.22s ease; }
@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.1s 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;
}
.gate.hidden { display: none; }
.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: 800; 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); } }
.gate-card button {
	width: 100%; margin-top: 12px; padding: 11px; border: none; border-radius: 10px;
	background: var(--blue); color: #fff; font-size: 14px; font-weight: 650; cursor: pointer; font-family: inherit;
}
.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: 800; 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: 750; 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; }
.card h3 { font-size: 14px; margin-bottom: 10px; }
.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: 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; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, 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: 550;
}
.ql:hover { border-color: var(--blue); }
.ql span { color: var(--ink-3); font-size: 11px; font-weight: 450; }
.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; }
.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);
}
.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: 550;
}
.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); }
.node { position: relative; }
.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: 8px; padding: 11px 14px; border-bottom: 1px solid var(--hairline); font-weight: 650; font-size: 13px; }
.lc-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lc-q { align-self: flex-end; background: var(--blue); color: #fff; border-radius: 12px 12px 3px 12px; padding: 8px 12px; font-size: 13px; max-width: 85%; }
.lc-a { align-self: flex-start; max-width: 95%; font-size: 12.5px !important; padding: 10px 13px !important; border-radius: 3px 12px 12px 12px !important; }
.lc-row { display: flex; gap: 8px; align-items: flex-start; }
.lc-av { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; margin-top: 2px; }
.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 { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--hairline); }
.lc-input input { flex: 1; background: var(--bg); border: 1px solid var(--hairline); border-radius: 9px; color: var(--ink); padding: 8px 11px; font-size: 12.5px; font-family: inherit; }
/* 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: 50px; height: 50px; border-radius: 50%;
	background: var(--blue); color: #fff; border: none; cursor: pointer; z-index: 140;
	box-shadow: 0 10px 30px rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center;
	transition: transform 0.15s;
}
#chatFab:hover { transform: scale(1.07); }
#chatFab svg { width: 22px; height: 22px; }
#sysChat {
	position: fixed; right: 22px; bottom: 84px; width: 440px; max-width: 92vw; height: min(580px, 74vh);
	background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px;
	display: none; flex-direction: column; z-index: 150; box-shadow: 0 22px 70px rgba(0,0,0,0.6);
	animation: viewIn 0.18s ease;
}
#sysChat.open { display: flex; }
#sysChat.max {
	top: 16px; left: 16px; right: 16px; bottom: 16px;
	width: auto; height: auto; max-width: none; border-radius: 20px;
}
#sysChat.max .lc-msgs { padding: 26px max(28px, calc((100% - 780px) / 2)); gap: 16px; }
#sysChat.max .lc-input { padding: 16px max(28px, calc((100% - 780px) / 2)) 22px; border-top: 1px solid var(--hairline); }
#sysChat.max .lc-input input { padding: 13px 16px; font-size: 14px; border-radius: 13px; }
#sysChat.max .lc-a { font-size: 14px !important; line-height: 1.7 !important; padding: 13px 17px !important; }
#sysChat.max .lc-q { font-size: 14px; padding: 10px 15px; }
#sysChat.max .lc-head { padding: 15px 22px; font-size: 14px; }
#sysChat.max .lc-av { width: 26px; height: 26px; }
.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; }
.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 0.2s ease; }
.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; }
/* 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: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
#sAiModel, #sAiKey { 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: 750; 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; }

/* ============ 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: 650; 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: viewIn 0.14s ease; }
.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: 550; 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: 650; }
.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: 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: 800; 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: 800; 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: 800; 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: 650; }
.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: 800; 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; }
.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: 800; 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: 650; 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: 550; 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: 650; 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: 650; 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: 650; 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: 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: transform 0.1s; }
.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: 650; 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: 650; 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: 2; 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: 550; 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: 650; }
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: 750;
}
.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: viewIn 0.14s ease; }
.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: 550; 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: 230px; }
.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: 650; 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: 650; 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: rgba(12, 163, 12, 0.14); }

.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: rgba(57, 135, 229, 0.1); }
.ob-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ob-row-name { font-size: 13px; font-weight: 650; }
.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: rgba(12, 163, 12, 0.08); border-color: rgba(12, 163, 12, 0.35); }
.ob-conn.bad { background: rgba(208, 59, 59, 0.08); border-color: rgba(208, 59, 59, 0.35); }
.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: rgba(208, 59, 59, 0.4); }
.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: 650; 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: 800; 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; }

/* the connect modal sits above the connect gate (z-index 200), which is what it replaces */
.modal {
	position: fixed; inset: 0; z-index: 300;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0, 0, 0, .62);
	padding: 24px;
}
.modal.hidden { display: none; }
.modal-card {
	position: relative;
	width: 100%;
	background: var(--surface-1);
	border: 1px solid var(--line);
	border-radius: 16px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	max-height: calc(100vh - 48px);
	overflow-y: auto;
}
.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-3); }
