/* DevOps Command Center — dark navy, blue glow borders, severity colours. */
:root {
  --bg0: #060b1d; --bg1: #0a1330; --panel: rgba(13, 24, 58, .86); --panel2: #101f4a; --line: #1f3a7a; --line2: #2b55b5;
  --glow: 0 0 0 1px rgba(64, 128, 255, .35), 0 0 18px rgba(40, 110, 255, .18) inset;
  --text: #e3e9ff; --muted: #8fa0c9; --accent: #3d8bff; --accent2: #22d3ee;
  --crit: #ff4d6a; --high: #ff9a3c; --warn: #f5c542; --info: #3fa9ff; --ok: #2fd18b; --demo: #c084fc;
  --radius: 12px; --font: Inter, ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: radial-gradient(1200px 600px at 70% -10%, #13235a 0%, transparent 60%), radial-gradient(900px 500px at 0% 100%, #0f1d4d 0%, transparent 60%), var(--bg0); color: var(--text); font: 14px/1.45 var(--font); overflow-x: hidden; }
a { color: #7fb2ff; text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; border-radius: 6px; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
pre { background: #050a1a; border: 1px solid var(--line); padding: 10px; border-radius: 8px; overflow: auto; white-space: pre-wrap; }
h1 { font-size: 20px; margin: 4px 0 14px; } h2 { font-size: 17px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 0; display: flex; align-items: center; gap: 8px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11px; } .error { color: var(--crit); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .gap4 { gap: 4px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--panel2); padding: 6px 10px; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- App shell ---------------------------------------------------------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; grid-template-rows: 62px auto auto;
  grid-template-areas: "top top top" "side main assist" "office office office"; gap: 12px; padding: 0 12px 12px; min-height: 100vh; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 8px 4px; border-bottom: 1px solid rgba(43, 85, 181, .35); }
.sidebar { grid-area: side; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.main { grid-area: main; min-width: 0; outline: none; }
.rail { grid-area: assist; min-width: 0; align-self: start; display: flex; flex-direction: column; gap: 12px; }
.assistant { min-width: 0; }
.office { grid-area: office; min-width: 0; }

.logo { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.logo b { display: block; font-size: 18px; letter-spacing: .2px; } .logo span { font-size: 12px; color: var(--muted); }
.logo-ic { width: 30px; height: 30px; color: #ff7a45; stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(255, 122, 69, .6)); }
.gsearch { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: rgba(9, 18, 48, .9); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; box-shadow: var(--glow); }
.gsearch input { flex: 1; background: none; border: 0; color: var(--text); padding: 9px 0; font: inherit; outline: none; min-width: 0; }
.gsearch kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.gresults { position: absolute; top: 44px; left: 0; right: 0; background: #0b1638; border: 1px solid var(--line2); border-radius: 10px; z-index: 40; max-height: 60vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.gresults a { display: block; padding: 7px 12px; color: var(--text); } .gresults a:hover { background: var(--panel2); text-decoration: none; }
.gsec { font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 8px 12px 2px; } .pad { padding: 10px; }
.hright { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.conn { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.envpill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; border: 1px solid; }
.envpill .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.env-production { color: var(--ok); border-color: rgba(47, 209, 139, .5); background: rgba(47, 209, 139, .12); }
.env-staging, .env-lab { color: var(--warn); border-color: rgba(245, 197, 66, .5); background: rgba(245, 197, 66, .1); }
.env-demo { color: var(--demo); border-color: rgba(192, 132, 252, .55); background: rgba(192, 132, 252, .14); }
.env-unconfigured { color: var(--muted); border-color: var(--line); }
.clock { display: flex; gap: 8px; align-items: baseline; } .clock b { font-size: 16px; } .clock span { color: var(--muted); font-size: 12.5px; }
.user { position: relative; } .userbtn { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; }
.usermenu { position: absolute; right: 0; top: 34px; background: #0b1638; border: 1px solid var(--line2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 40; min-width: 160px; }

.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); border: 1px solid transparent; }
.sidebar nav a:hover { background: rgba(31, 58, 122, .45); text-decoration: none; }
.sidebar nav a.active { background: linear-gradient(90deg, rgba(61, 139, 255, .35), rgba(61, 139, 255, .08)); border-color: rgba(61, 139, 255, .6); box-shadow: 0 0 16px rgba(61, 139, 255, .25); }
.sidebar nav a span:nth-child(2) { flex: 1; }
.nbadge { background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.side-art { margin-top: auto; padding: 16px 8px; } .slogan { font: italic 600 20px/1.15 "Comic Sans MS", "Segoe Print", cursive; color: #c9d6ff; transform: rotate(-12deg); }
.slogan .heart .ic { color: #ff6b8a; width: 16px; }

/* ---- Panels ------------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--glow); min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head.sub { margin-top: 12px; } .viewall { font-size: 12px; }
.count { background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.state { padding: 14px; color: var(--muted); font-style: italic; display: flex; gap: 8px; align-items: center; }
.state-error { color: #ffb3c0; } .state-disconnected { color: #c6b9e8; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--accent2); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; color: var(--text); }
.sev-critical, .st-critical, .st-error, .st-breached, .st-failed { color: var(--crit); background: rgba(255, 77, 106, .14); border-color: rgba(255, 77, 106, .5); }
.sev-high, .st-high { color: var(--high); background: rgba(255, 154, 60, .14); border-color: rgba(255, 154, 60, .5); }
.sev-warning, .st-warning, .st-at_risk, .st-blocked, .st-degraded, .st-investigating, .st-triaging { color: var(--warn); background: rgba(245, 197, 66, .12); border-color: rgba(245, 197, 66, .45); }
.sev-info, .st-info, .st-open, .st-queued, .st-monitoring, .st-working, .st-in_progress, .st-deploying { color: var(--info); background: rgba(63, 169, 255, .12); border-color: rgba(63, 169, 255, .45); }
.st-ok, .st-connected, .st-met, .st-completed, .st-success, .st-resolved, .st-healthy, .st-firing { border-color: rgba(47, 209, 139, .45); }
.st-ok, .st-connected, .st-met, .st-completed, .st-success, .st-resolved, .st-healthy { color: var(--ok); background: rgba(47, 209, 139, .12); }
.st-firing { color: var(--crit); background: rgba(255, 77, 106, .1); border-color: rgba(255, 77, 106, .4); }
.st-responding_to_incident { color: #fff; background: var(--crit); border-color: var(--crit); }
.sev-unknown, .st-not_configured, .st-disconnected, .st-no_data, .st-idle, .st-closed, .st-silenced, .st-unknown, .st-no_SLA_configured { color: var(--muted); background: rgba(143, 160, 201, .08); }
.demo, .st-demo { color: var(--demo) !important; background: rgba(192, 132, 252, .14) !important; border-color: rgba(192, 132, 252, .5) !important; }
.conf-high { color: var(--ok); } .conf-medium { color: var(--warn); } .conf-low { color: var(--high); }

/* Welcome */
.welcome { display: flex; justify-content: space-between; align-items: stretch; gap: 16px; padding: 0 0 0 20px; overflow: hidden; min-height: 112px;
  background: linear-gradient(100deg, rgba(13, 24, 58, .95) 35%, rgba(22, 52, 128, .7)), repeating-linear-gradient(90deg, rgba(61, 139, 255, .06) 0 2px, transparent 2px 26px); margin-bottom: 12px; }
.welcome-text { padding: 16px 0; } .welcome-text h2 { font-size: 26px; margin: 0 0 6px; }
.wave-hand { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-8deg); } }
.welcome-art { position: relative; display: flex; align-items: flex-end; gap: 0; }
.mascot { width: 170px; height: 124px; } .mascot .wave { animation: pawwave 2.6s ease-in-out infinite; transform-origin: 150px 125px; }
@keyframes pawwave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-22deg); } }
.bubble { align-self: center; margin-right: 18px; max-width: 260px; display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.bubble.status-ok { background: #c8f7dc; color: #0d3b27; } .bubble.status-degraded { background: #ffe9b8; color: #4a3200; }
.bubble.status-critical { background: #ffd0d8; color: #5a0d1c; } .bubble.status-unknown { background: #dfe4f5; color: #2a3456; }
.bubble .dot { margin-top: 5px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; position: relative; }
.kpi-card { display: flex; gap: 12px; align-items: center; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--text); cursor: pointer; font: inherit; box-shadow: var(--glow); transition: transform .15s, border-color .15s; }
.kpi-card:hover { transform: translateY(-2px); border-color: var(--line2); }
.kpi-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.kpi-icon .ic { width: 22px; height: 22px; color: #fff; }
.kpi-critical .kpi-icon { background: var(--crit); box-shadow: 0 0 14px rgba(255, 77, 106, .6); } .kpi-high .kpi-icon { background: var(--high); }
.kpi-medium .kpi-icon { background: var(--warn); } .kpi-medium .kpi-icon .ic { color: #3a2a00; } .kpi-low .kpi-icon { background: var(--info); } .kpi-total .kpi-icon { background: #31407a; }
.kpi-body { display: flex; flex-direction: column; min-width: 0; } .kpi-label { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi-critical .kpi-label { color: #ff8da0; } .kpi-high .kpi-label { color: #ffb878; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; } .kpi-sub { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.delta { font-weight: 700; font-size: 13px; } .delta.up { color: var(--crit); } .delta.down { color: var(--ok); } .delta.flat { color: var(--muted); }
.kpi-foot { grid-column: 1 / -1; margin-top: -6px; }

/* Overview grid */
.ov-grid { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
#p-health { grid-column: span 4; } #p-incidents { grid-column: span 8; }
#p-trend { grid-column: span 4; } #p-infra { grid-column: span 4; } #p-deploy { grid-column: span 4; }
#p-activity { grid-column: span 4; } #p-sla { grid-column: span 4; } #p-links { grid-column: span 4; }
.ov-grid > .panel { align-self: stretch; }
.insights { margin-top: 12px; } .insight { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px dashed rgba(43, 85, 181, .35); }
.insight.lvl-warning b { color: #ffd68a; }

.overall { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 2px 0 10px; }
.overall.st-healthy { color: var(--ok); } .overall.st-degraded { color: var(--warn); } .overall.st-critical { color: var(--crit); } .overall.st-unknown, .overall.st-loading { color: var(--muted); } .overall.st-demo { color: var(--demo); }
.hrow { display: grid; grid-template-columns: 96px 1fr 48px; align-items: center; gap: 10px; margin: 8px 0; }
.hname { display: flex; gap: 8px; align-items: center; }
.hbar { height: 8px; background: rgba(143, 160, 201, .15); border-radius: 99px; overflow: hidden; } .hbar.na { background: repeating-linear-gradient(45deg, rgba(143, 160, 201, .12) 0 6px, transparent 6px 12px); }
.hbar .fill { display: block; height: 100%; border-radius: 99px; transition: width .6s; }
.fill.ok { background: linear-gradient(90deg, #12b981, #34e2a0); } .fill.warn { background: var(--warn); } .fill.crit { background: var(--crit); } .fill.demo { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.hval { text-align: right; font-weight: 600; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(43, 85, 181, .25); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; } th.sort { cursor: pointer; user-select: none; } th.sort:hover { color: var(--text); }
table.compact td { font-size: 13px; } tr.clickable { cursor: pointer; } tr.clickable:hover, tr.clickable:focus { background: rgba(61, 139, 255, .1); }
tr.dup td { opacity: .55; }
.mini { padding: 3px 6px; font-size: 12px; }

.chip { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.chip.on { color: var(--text); border-color: var(--accent); background: rgba(61, 139, 255, .2); }
.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.lg { background: none; border: 0; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.lg::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); } .lg.off { opacity: .4; text-decoration: line-through; }
.chart-wrap { position: relative; } svg.trend { width: 100%; height: auto; display: block; }
.gridline { stroke: rgba(143, 160, 201, .15); } .axis { fill: var(--muted); font-size: 10px; }
.hover-line { stroke: #fff; stroke-opacity: .5; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 6px; background: #0b1638; border: 1px solid var(--line2); border-radius: 8px; padding: 6px 8px; font-size: 12px; pointer-events: none; min-width: 130px; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.avail { margin: -4px 0 4px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: rgba(9, 18, 48, .6); border: 1px solid rgba(43, 85, 181, .3); text-align: center; }
.tile .ic { width: 24px; height: 24px; color: #8ab4ff; } .tname { font-size: 12px; text-transform: capitalize; overflow-wrap: break-word; } .tstate { font-size: 11.5px; font-weight: 600; }
.tile.st-ok .tstate, .tile.st-connected .tstate { color: var(--ok); } .tile.st-warning .tstate { color: var(--warn); } .tile.st-critical .tstate, .tile.st-error .tstate { color: var(--crit); }
.tile.st-demo .tstate { color: var(--demo); } .tile.st-no_data .tstate, .tile.st-disconnected .tstate, .tile.st-not_configured .tstate { color: var(--muted); }
.tile { background: rgba(9, 18, 48, .6) !important; }

.deploys, .feed, .logs, .steps, .mini-list { list-style: none; margin: 0; padding: 0; }
.deploys li { display: grid; grid-template-columns: 22px 1fr auto auto; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(43, 85, 181, .2); }
.dname { display: flex; flex-direction: column; min-width: 0; overflow-wrap: break-word; }
.dstat .ic { width: 16px; } .dstat.st-ok { color: var(--ok); background: none; } .dstat.st-critical { color: var(--crit); background: none; } .dstat.st-warning { color: var(--warn); background: none; }
.feed li { display: grid; grid-template-columns: 42px 20px minmax(0, 1fr); gap: 2px 8px; padding: 5px 0; border-bottom: 1px solid rgba(43, 85, 181, .18); font-size: 12.5px; }
.feed .fdetail { grid-column: 3; font-size: 11.5px; } .ftime { color: var(--muted); }
.fcat .ic { width: 15px; } .cat-alert { color: var(--crit); } .cat-incident { color: var(--high); } .cat-task { color: var(--info); } .cat-deployment { color: var(--ok); } .cat-runbook { color: #a5b4fc; } .cat-assistant { color: var(--accent2); } .cat-integration { color: var(--warn); }
.logs li { font-family: "JetBrains Mono", Menlo, monospace; font-size: 11px; padding: 2px 0; overflow-wrap: anywhere; } .ltime { color: var(--muted); margin-right: 4px; }
.lvl-INFO { color: #6ee7b7; } .lvl-WARNING { color: var(--warn); } .lvl-ERROR, .lvl-CRITICAL { color: var(--crit); }

.sla { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; }
.gauge { position: relative; width: 110px; height: 110px; } .gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-bg { fill: none; stroke: rgba(143, 160, 201, .15); stroke-width: 9; } .g-fg { fill: none; stroke: url(#none) var(--ok); stroke: var(--ok); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(47, 209, 139, .6)); }
.gval { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18px; }
.gval b { font-size: 20px; } .gval span { font-size: 10px; color: var(--muted); }
.srow { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 4px 0; border-bottom: 1px solid rgba(43, 85, 181, .2); font-size: 12.5px; } .srow .tiny { grid-column: 1 / -1; }

.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.qa-link { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px; color: var(--text); font-size: 12px; text-align: center; }
.qa-link .ic { width: 24px; height: 24px; color: #8ab4ff; } a.qa-link:hover { background: rgba(61, 139, 255, .14); text-decoration: none; }
.qa-link.disabled { opacity: .35; cursor: not-allowed; }

/* Assistant rail */
.assistant .panel-head h3 .ic { color: #ff7a45; }
.assistant { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--glow); }
.assist-hero { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 10px; }
.robot { width: 72px; height: 72px; flex: none; animation: float 3.5s ease-in-out infinite; } .robot .antenna { animation: blink 1.8s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 90%, 100% { opacity: 1; } 95% { opacity: .2; } }
.bubble-r { background: #13306f; border: 1px solid var(--line2); border-radius: 12px; padding: 9px 11px; font-size: 12.5px; }
.steps li { display: flex; gap: 6px; align-items: center; font-size: 12px; padding: 2px 0; color: var(--muted); }
.steps li.done { color: #9be7c4; } .steps li.bad { color: #ffb3c0; } .steps .ic { width: 14px; } .steps li span:nth-child(2) { flex: 1; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.qa-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; background: rgba(9, 18, 48, .7); border: 1px solid var(--line2); color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.qa-btn:hover:not(:disabled) { background: rgba(61, 139, 255, .2); } .qa-btn:disabled { opacity: .55; cursor: not-allowed; } .qa-btn span { flex: 1; }
.prog { display: block; height: 6px; background: rgba(143, 160, 201, .18); border-radius: 99px; overflow: hidden; margin: 4px 0; }
.prog span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }

/* ---- Engineering office ------------------------------------------------ */
.office { background: linear-gradient(180deg, rgba(10, 19, 48, .2), rgba(10, 19, 48, .95) 40%), repeating-linear-gradient(90deg, rgba(61, 139, 255, .05) 0 3px, transparent 3px 40px); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 0; box-shadow: var(--glow); overflow: hidden; }
.office-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.team-pill { display: inline-flex; gap: 6px; align-items: center; background: rgba(9, 18, 48, .9); border: 1px solid var(--line2); border-radius: 999px; padding: 4px 12px; font-weight: 600; color: var(--ok); }
.office-floor { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.char { --state-color: #3d8bff; position: relative; display: flex; flex-direction: column; align-items: center; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; padding: 0; min-width: 0; }
.char:hover .char-svg { filter: drop-shadow(0 0 8px rgba(61, 139, 255, .5)); }
.char-bubble { position: relative; width: 100%; max-width: 210px; min-height: 64px; background: rgba(12, 24, 62, .96); border: 1px solid var(--line2); border-radius: 12px; padding: 6px 9px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; text-align: left; margin-bottom: 2px; }
.char-bubble::after { content: ""; position: absolute; bottom: -7px; left: 40%; border: 7px solid transparent; border-top-color: var(--line2); border-bottom: 0; }
.char-bubble b { font-size: 13px; } .btask { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.char-svg { width: 100%; max-width: 220px; height: auto; display: block; }
.char-plate { margin: -4px 0 8px; padding: 3px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 700; border: 1px solid; white-space: nowrap; }
.role-noc_commander { background: #12306f; border-color: #3d8bff; } .role-sre { background: #3b1f78; border-color: #8b5cf6; } .role-monitoring { background: #0f4b39; border-color: #2fd18b; }
.role-devops { background: #0f3c55; border-color: #22d3ee; } .role-automation { background: #2b3550; border-color: #94a3b8; } .role-runbook { background: #5a3010; border-color: #ff9a3c; }
.char .fx { opacity: 0; transition: opacity .3s; }
.state-idle { --state-color: #64748b; } .state-working { --state-color: #3d8bff; } .state-investigating { --state-color: #f5c542; } .state-monitoring { --state-color: #2fd18b; }
.state-deploying { --state-color: #22d3ee; } .state-success { --state-color: #2fd18b; } .state-failed { --state-color: #ff4d6a; } .state-blocked { --state-color: #f5a623; } .state-responding_to_incident { --state-color: #ff4d6a; }
.state-idle .fx-idle, .state-investigating .fx-investigating, .state-deploying .fx-deploying, .state-success .fx-success, .state-failed .fx-failed, .state-blocked .fx-blocked, .state-responding_to_incident .fx-responding, .state-monitoring .fx-monitoring { opacity: 1; }
.char .body { transform-origin: 110px 150px; animation: breathe 4s ease-in-out infinite; }
.char .eye { transform-box: fill-box; transform-origin: center; animation: eyeblink 5s infinite; }
@keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes eyeblink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.state-working .paw, .state-responding_to_incident .paw, .state-deploying .paw { animation: type .32s ease-in-out infinite alternate; }
.state-working .paw-r, .state-responding_to_incident .paw-r, .state-deploying .paw-r { animation-delay: .16s; }
.state-responding_to_incident .paw { animation-duration: .18s; }
@keyframes type { from { transform: translateY(0); } to { transform: translateY(-4px); } }
.state-investigating .head { transform-origin: 110px 90px; animation: tilt 3s ease-in-out infinite; } .state-investigating .fx-investigating { animation: bob 1.6s ease-in-out infinite; }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-7deg); } }
@keyframes bob { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-4px, -4px); } }
.state-monitoring .head { transform-origin: 110px 90px; animation: scan 4s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.screen .spark { stroke-dasharray: 90; animation: draw 3s linear infinite; } .screen .bar { transform-box: fill-box; transform-origin: bottom; animation: bars 1.8s ease-in-out infinite alternate; }
.screen .b2 { animation-delay: .3s; } .screen .b3 { animation-delay: .6s; } .screen .b4 { animation-delay: .9s; }
@keyframes draw { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }
@keyframes bars { from { transform: scaleY(.6); } to { transform: scaleY(1.4); } }
.state-idle .screen .spark, .state-idle .screen .bar, .state-blocked .screen .spark, .state-blocked .screen .bar { animation-play-state: paused; }
.state-deploying .fx-deploying { animation: launch 1.8s ease-in infinite; } @keyframes launch { 0% { transform: translateY(6px); opacity: .3; } 60% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }
.state-success .body { animation: hop .9s ease-out 2; } @keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }
.state-failed .head { transform: translateY(3px) rotate(4deg); transform-origin: 110px 90px; } .state-failed .laptop-screen { animation: flash 1s steps(2) infinite; }
@keyframes flash { 50% { opacity: .15; } }
.state-blocked .fx-blocked, .state-responding_to_incident .siren { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; } }
.state-responding_to_incident .aura { animation: alarm 1s ease-in-out infinite; } @keyframes alarm { 50% { opacity: .35; } }
.state-idle .fx-idle text { animation: zz 2.4s ease-in-out infinite; } @keyframes zz { 0% { opacity: 0; transform: translateY(4px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* ---- Task board / drawers / misc --------------------------------------- */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.col { background: rgba(9, 18, 48, .6); border: 1px solid rgba(43, 85, 181, .3); border-radius: 10px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.col-head { font-weight: 700; display: flex; justify-content: space-between; } .col-head .count { background: var(--panel2); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.card:hover { border-color: var(--line2); } .ctitle { font-weight: 600; font-size: 13px; overflow-wrap: break-word; }
.btn { background: rgba(16, 31, 74, .9); color: var(--text); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: inherit; }
.btn:hover:not(:disabled) { border-color: var(--accent2); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(90deg, #2563eb, #3d8bff); border-color: #3d8bff; } .btn.small { padding: 3px 9px; font-size: 12px; } .tiny-btn { padding: 1px 6px; font-size: 11px; }
input, select, textarea { background: #071030; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font: inherit; max-width: 100%; }
textarea { width: 100%; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.grid { display: grid; gap: 12px; margin-bottom: 12px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.main > div > .panel, .main section.panel { margin-bottom: 12px; }
.ov-grid section.panel { margin-bottom: 0; }
.item { border: 1px solid rgba(43, 85, 181, .35); border-radius: 8px; padding: 8px 10px; background: rgba(9, 18, 48, .55); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 4px 12px; overflow-wrap: break-word; } .kv > div:nth-child(odd) { color: var(--muted); }
.kpi { display: flex; flex-direction: column; } .kpi .v { font-size: 26px; font-weight: 800; } .kpi .l, .kpi .s { color: var(--muted); font-size: 12px; }
.warnline { background: rgba(245, 197, 66, .1); border: 1px solid rgba(245, 197, 66, .4); color: #ffe6a6; padding: 6px 10px; border-radius: 8px; margin: 6px 0; font-size: 12.5px; }
.demoline { background: rgba(192, 132, 252, .1); border: 1px solid rgba(192, 132, 252, .4); padding: 6px 10px; border-radius: 8px; margin: 6px 0; font-size: 12.5px; }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }
.cite { font-size: 10.5px; padding: 0 5px; border-radius: 6px; background: #1d3a7a; color: #b9d2ff; margin-left: 3px; cursor: help; }
.fact-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(760px, 96vw); background: #0a1435; border-left: 1px solid var(--line2); overflow: auto; padding: 18px; z-index: 50; box-shadow: -10px 0 40px rgba(0, 0, 0, .55); }
.drawer .close, .modal .close { float: right; position: sticky; top: 0; z-index: 2; }
.drawer-body, .modal-body { clear: both; padding-top: 4px; }
.modal { position: fixed; inset: 0; background: rgba(2, 6, 20, .7); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal-box { width: min(980px, 94vw); max-height: 88vh; overflow: auto; background: #0a1435; border: 1px solid var(--line2); border-radius: 14px; padding: 18px; }
.md h2 { font-size: 18px; margin-top: 16px; } .md h3 { font-size: 15px; margin-top: 14px; } .md td { border: 1px solid rgba(43, 85, 181, .35); } .md blockquote { border-left: 3px solid var(--demo); margin: 8px 0; padding-left: 10px; color: #e3c4f2; }
.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-box { width: min(400px, 100%); display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; box-shadow: var(--glow); }
.login-box h1 span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1440px) { #p-trend, #p-activity { grid-column: span 6; } #p-infra, #p-sla { grid-column: span 6; } #p-deploy, #p-links { grid-column: span 6; } }
@media (max-width: 1366px) { .main table.compact, .drawer table.compact { display: block; overflow-x: auto; } }
@media (max-width: 1280px) {
  .app { grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "top top" "side main" "side assist" "office office"; }
  .office-floor { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "top" "side" "main" "assist" "office"; padding: 0 8px 8px; }
  .topbar { flex-wrap: wrap; } .gsearch { order: 3; flex-basis: 100%; max-width: none; } .hright { gap: 8px; } .clock span { display: none; }
  .sidebar nav { flex-direction: row; overflow-x: auto; } .sidebar nav a { white-space: nowrap; padding: 8px 10px; } .side-art { display: none; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .ov-grid > .panel { grid-column: 1 / -1 !important; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .office-floor { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: minmax(0, 1fr); } .welcome { flex-direction: column; padding: 0 12px; } .welcome-art { justify-content: space-between; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); } table.compact { display: block; overflow-x: auto; }
}
@media (max-width: 520px) { .clock, .conn, .userbtn span, .logo span { display: none; } .logo { min-width: 0; } }
@media (min-width: 1200px) and (min-height: 660px) and (max-height: 920px) {
  .app[data-route="overview"] .welcome-text p, .app[data-route="overview"] .kpi-sub .tiny { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Insights panel: collapsed until its header is clicked. */
.insights { padding: 0; }
.ins-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.ins-head h3 { margin: 0; } .ins-hint { margin-left: auto; }
.ins-body { max-height: 0; overflow: hidden; padding: 0 14px; opacity: 0; transition: max-height .3s ease, opacity .2s ease, padding .3s ease; }
.insights.pinned .ins-body { max-height: 1600px; opacity: 1; padding: 0 14px 12px; transition-delay: 0s; }
.insights.pinned { border-color: var(--line2); }

/* ---- Overview fits one screen (NOC wall): no page scroll on desktop ------- */
.side-links { padding: 4px 2px; } .side-links .panel-head { margin: 4px 6px; } .side-links .qa-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.side-links .qa-link { font-size: 10.5px; padding: 4px 0; } .side-links .qa-link .ic { width: 20px; height: 20px; }
#p-health { grid-column: span 4; } #p-incidents { grid-column: span 8; } #p-trend { grid-column: span 8; }
#p-infra { grid-column: span 4; } #p-deploy { grid-column: span 4; } #p-activity { grid-column: span 4; } #p-sla { grid-column: span 4; }
@media (max-width: 1280px) { #p-health, #p-infra, #p-deploy, #p-activity, #p-sla, #p-incidents, #p-trend { grid-column: span 6; } }
.feed.one li { grid-template-columns: 38px 18px minmax(0, 1fr); }
@media (min-width: 1200px) and (min-height: 660px) {
  :root:has(.app[data-route="overview"]) { --fit: 1; }
  body:has(.app[data-route="overview"]) { overflow: hidden; }
  .app[data-route="overview"] {
    height: 100vh; min-height: 0; gap: 8px; padding-bottom: 8px;
    grid-template-rows: 50px minmax(0, 1fr) clamp(170px, 23vh, 260px);
    grid-template-columns: 210px minmax(0, 1fr) clamp(260px, 19vw, 300px);
    grid-template-areas: "top top top" "side main assist" "office office office";
  }
  .app[data-route="overview"] .topbar { padding: 4px; }
  .app[data-route="overview"] .sidebar, .app[data-route="overview"] .rail { min-height: 0; overflow: hidden; }
  .app[data-route="overview"] .rail { gap: 8px; align-self: stretch; height: 100%; }
  .app[data-route="overview"] .assistant { padding: 8px 12px; }
  .app[data-route="overview"] .assist-hero { margin: 2px 0 4px; } .app[data-route="overview"] .robot { width: 52px; height: 52px; }
  .app[data-route="overview"] .bubble-r { font-size: 11.5px; padding: 6px 8px; }
  .app[data-route="overview"] .qa-btn { padding: 7px 10px; } .app[data-route="overview"] .actions { gap: 5px; }
  .app[data-route="overview"] .rail #livelogs { flex: 1; min-height: 0; overflow: hidden; padding: 8px 12px; }
  .app[data-route="overview"] .sidebar nav a { padding: 6px 10px; }
  .app[data-route="overview"] .side-art { display: none; }
  .app[data-route="overview"] .main, .app[data-route="overview"] #view { min-height: 0; height: 100%; }
  .app[data-route="overview"] #view { display: flex; flex-direction: column; gap: 8px; position: relative; }
  .app[data-route="overview"] .welcome { min-height: 0; height: clamp(48px, 7vh, 84px); margin: 0; flex: none; }
  .app[data-route="overview"] .welcome-text { padding: 6px 0; align-self: center; }
  .app[data-route="overview"] .welcome-text h2 { font-size: clamp(17px, 2.3vh, 23px); margin: 0 0 2px; }
  .app[data-route="overview"] .welcome-text p { margin: 0; font-size: 12.5px; }
  .app[data-route="overview"] .mascot { height: 100%; width: auto; }
  .app[data-route="overview"] .bubble { padding: 5px 10px; font-size: 12px; }
  .app[data-route="overview"] .kpis { margin: 0; gap: 8px; flex: none; }
  .app[data-route="overview"] .kpi-card { padding: 5px 10px; }
  .app[data-route="overview"] .kpi-icon { width: 30px; height: 30px; } .app[data-route="overview"] .kpi-icon .ic { width: 18px; height: 18px; }
  .app[data-route="overview"] .kpi-value { font-size: clamp(19px, 2.6vh, 26px); }
  .app[data-route="overview"] .kpi-foot { margin: -3px 0 0; font-size: 10.5px; }
  .app[data-route="overview"] .ov-grid { flex: 1; min-height: 0; gap: 8px; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .app[data-route="overview"] #p-health { grid-column: span 3; } .app[data-route="overview"] #p-incidents { grid-column: span 5; }
  .app[data-route="overview"] #p-trend { grid-column: span 4; } .app[data-route="overview"] #p-infra,
  .app[data-route="overview"] #p-deploy, .app[data-route="overview"] #p-activity, .app[data-route="overview"] #p-sla { grid-column: span 3; }
  .app[data-route="overview"] .ov-grid > .panel { min-height: 0; overflow: hidden; padding: 8px 12px; display: flex; flex-direction: column; }
  .app[data-route="overview"] .panel-head { margin-bottom: 4px; flex-wrap: nowrap; }
  .app[data-route="overview"] .panel-head h3 { white-space: nowrap; min-width: 0; overflow: hidden; }
  .app[data-route="overview"] .viewall { white-space: nowrap; }
  .app[data-route="overview"] .deploys .badge { padding: 0 5px; font-size: 10.5px; }
  .app[data-route="overview"] .overall { margin: 0 0 4px; }
  .app[data-route="overview"] .hrow { margin: 1px 0; } .app[data-route="overview"] .hrow .ic { width: 15px; height: 15px; }
  .app[data-route="overview"] .tiles { gap: 4px; } .app[data-route="overview"] .tile { padding: 2px; gap: 0; }
  .app[data-route="overview"] .tile { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 5px; align-items: center; text-align: left; padding: 3px 6px; }
  .app[data-route="overview"] .tile .ic { width: 17px; height: 17px; grid-row: span 2; } .app[data-route="overview"] .tname { font-size: 11px; } .app[data-route="overview"] .tstate { font-size: 10.5px; }
  .app[data-route="overview"] .deploys li { padding: 1px 0; font-size: 12px; line-height: 1.35; }
  .app[data-route="overview"] .deploys .dname { flex-direction: row; gap: 6px; white-space: nowrap; overflow: hidden; }
  .app[data-route="overview"] .deploys .dname > * { overflow: hidden; text-overflow: ellipsis; }
  .app[data-route="overview"] .feed li { grid-template-columns: 38px 18px minmax(0, 1fr); padding: 3px 0; font-size: 12px; }
  .app[data-route="overview"] .feed .fdetail { display: none; }
  .app[data-route="overview"] .feed .ftitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app[data-route="overview"] .gauge { width: 84px; height: 84px; } .app[data-route="overview"] .sla { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .app[data-route="overview"] .gval b { font-size: 15px; } .app[data-route="overview"] .gval span { font-size: 9px; }
  .app[data-route="overview"] .srow { padding: 2px 0; font-size: 11.5px; } .app[data-route="overview"] .srow .tiny { display: none; }
  .app[data-route="overview"] table.compact td, .app[data-route="overview"] table.compact th { padding: 3px 6px; font-size: 12px; }
  /* Insights: one line in the layout; when open it floats over the panels. */
  .app[data-route="overview"] .insights { flex: none; position: relative; z-index: 5; }
  .app[data-route="overview"] .insights .ins-head { padding: 5px 12px; }
  .app[data-route="overview"] .insights .ins-body { position: absolute; left: -1px; right: -1px; bottom: 100%; background: #0b1638; border: 1px solid var(--line2); border-radius: 12px 12px 0 0; box-shadow: 0 -12px 30px rgba(0, 0, 0, .45); border-width: 0; }
  .app[data-route="overview"] .insights.pinned .ins-body { max-height: 55vh; overflow: auto; padding: 10px 14px; border-width: 1px; }
  /* Office: compact strip that fills its row. */
  .app[data-route="overview"] .office { min-height: 0; display: flex; flex-direction: column; padding: 4px 12px 0; }
  .app[data-route="overview"] .office-head { margin-bottom: 2px; font-size: 11px; } .app[data-route="overview"] .team-pill { padding: 2px 10px; }
  .app[data-route="overview"] .office-floor { flex: 1; min-height: 0; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .app[data-route="overview"] .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .app[data-route="overview"] .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* State shows as the icon colour + tooltip; one line per tile. */
  .app[data-route="overview"] .tile .tstate { display: none; } .app[data-route="overview"] .tile .ic { grid-row: auto; }
  .app[data-route="overview"] .tile.st-ok .ic, .app[data-route="overview"] .tile.st-connected .ic { color: var(--ok); }
  .app[data-route="overview"] .tile.st-warning .ic { color: var(--warn); }
  .app[data-route="overview"] .tile.st-critical .ic, .app[data-route="overview"] .tile.st-error .ic { color: var(--crit); }
  .app[data-route="overview"] .tile.st-demo .ic { color: var(--demo); }
  .app[data-route="overview"] .tile.st-no_data .ic, .app[data-route="overview"] .tile.st-disconnected .ic, .app[data-route="overview"] .tile.st-not_configured .ic { color: var(--muted); }
  .app[data-route="overview"] .char { height: 100%; min-height: 0; justify-content: flex-end; }
  .app[data-route="overview"] .char-bubble { min-height: 0; padding: 3px 8px; font-size: 11px; gap: 1px; max-width: 190px; }
  .app[data-route="overview"] .char-bubble b { font-size: 11.5px; }
  .app[data-route="overview"] .char-bubble .tiny.muted { display: none; }
  .app[data-route="overview"] .char-bubble .tiny.error { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app[data-route="overview"] .char-bubble .prog { height: 3px; margin: 1px 0; }
  .app[data-route="overview"] .char-bubble .btask { -webkit-line-clamp: 1; }
  .app[data-route="overview"] .char-bubble .badge { font-size: 10px; padding: 0 6px; }
  .app[data-route="overview"] .char-svg { flex: 1; min-height: 0; width: auto; max-width: 100%; }
  .app[data-route="overview"] .char-plate { margin: -2px 0 3px; font-size: 11px; padding: 1px 10px; }
}
@media (min-width: 1200px) and (min-height: 660px) and (max-height: 920px) {
  .app[data-route="overview"] .welcome-text p, .app[data-route="overview"] .kpi-sub .tiny { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.qa-link { position: relative; }
.qa-badge { position: absolute; top: 0; right: 14%; min-width: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: #24406f; color: #cfe0ff; text-align: center; }
.qa-badge.hot { background: var(--crit); color: #fff; }
.qa-link { position: relative; }
.qa-badge { position: absolute; top: 0; right: 14%; min-width: 18px; padding: 0 5px; border-radius: 999px; font-size: 10.5px; font-weight: 700; background: #24406f; color: #cfe0ff; text-align: center; }
.qa-badge.hot { background: var(--crit); color: #fff; }

/* Audit log: fixed columns, long values wrap inside the panel. */
table.audit { table-layout: fixed; width: 100%; }
table.audit .c-time { width: 105px; } table.audit .c-actor { width: 64px; } table.audit .c-role { width: 70px; }
table.audit .c-action { width: 245px; } table.audit .c-target { width: 150px; }
table.audit td { overflow-wrap: anywhere; word-break: break-word; }
.nowrap { white-space: nowrap; } .wrap { overflow-wrap: anywhere; }
.kvchip { display: inline-block; margin: 0 6px 3px 0; padding: 1px 6px; border-radius: 5px; background: rgba(31, 58, 122, .35); font-family: "JetBrains Mono", Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 1366px) { table.audit { display: table; } #audit { overflow-x: auto; } }

/* Long tokens (paths, IDs, labels) wrap inside cells; the main column never spills into the rail. */
.main { overflow-x: clip; }
.main td { overflow-wrap: break-word; }
.main .panel { overflow-x: auto; }
table.qa-findings { table-layout: fixed; }
.assign { border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; margin: 8px 0 14px; background: rgba(61, 139, 255, .06); display: flex; flex-direction: column; gap: 8px; }
.assign h3 { margin: 0; }
.qa-btn .tiny { margin-left: auto; white-space: nowrap; }
.askbox { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 2px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 10px; background: rgba(9, 18, 48, .7); }
.askbox textarea { min-height: 52px; resize: vertical; font-size: 12.5px; }
.askbox .answer p { margin: 4px 0 6px; font-size: 12.5px; max-height: 9em; overflow: auto; }
.app[data-route="overview"] .askbox textarea { min-height: 38px; }
.qa-btn .tiny { font-size: 10px; opacity: .8; }
.app[data-route="overview"] .qa-btn .tiny { display: none; }
.app[data-route="overview"] .askbox { margin: 6px 0 0; padding: 6px 8px; gap: 4px; }
.app[data-route="overview"] .askbox .tiny { display: none; }

.tlog { list-style: none; margin: 0; padding: 0; }
.tlog li { display: grid; grid-template-columns: 46px 96px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(43, 85, 181, .18); font-size: 12.5px; }
.tlog .tstatus { font-weight: 600; }
.qa-btn .qa-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.qa-btn .qa-text .tiny { margin: 0; }
/* Short windows (laptops, ~660–820px tall): compress the fit layout further. */
@media (min-width: 1200px) and (min-height: 660px) and (max-height: 820px) {
  .app[data-route="overview"] { grid-template-rows: 46px minmax(0, 1fr) clamp(116px, 18vh, 148px); gap: 6px; }
  .app[data-route="overview"] .topbar { padding: 2px 4px; }
  .app[data-route="overview"] #view { gap: 6px; }
  .app[data-route="overview"] .welcome { height: 44px; }
  .app[data-route="overview"] .welcome-text h2 { font-size: 17px; }
  .app[data-route="overview"] .welcome-text p, .app[data-route="overview"] .kpi-sub .tiny, .app[data-route="overview"] .kpi-foot { display: none; }
  .app[data-route="overview"] .kpi-card { padding: 3px 8px; } .app[data-route="overview"] .kpi-icon { width: 26px; height: 26px; }
  .app[data-route="overview"] .kpi-value { font-size: 20px; }
  .app[data-route="overview"] .ov-grid, .app[data-route="overview"] .rail { gap: 6px; }
  .app[data-route="overview"] .ov-grid > .panel { padding: 6px 10px; }
  .app[data-route="overview"] .hrow { margin: 0; }
  .app[data-route="overview"] .gauge { width: 66px; height: 66px; } .app[data-route="overview"] .sla { grid-template-columns: 66px minmax(0, 1fr); }
  .app[data-route="overview"] .gval b { font-size: 12px; } .app[data-route="overview"] .gval span { display: none; }
  .app[data-route="overview"] .assist-hero .robot { display: none; } .app[data-route="overview"] .bubble-r { font-size: 11px; padding: 4px 8px; }
  .app[data-route="overview"] .askbox textarea { min-height: 30px; }
  .app[data-route="overview"] .qa-btn { padding: 5px 10px; }
  .app[data-route="overview"] .sidebar nav a { padding: 5px 10px; }
  .app[data-route="overview"] .office-head { display: none; }
  .app[data-route="overview"] .char-bubble { padding: 2px 6px; }
  .app[data-route="overview"] .char-bubble .btask, .app[data-route="overview"] .char-bubble .tiny { display: none; }
  .app[data-route="overview"] .sidebar nav a { font-size: 13px; gap: 9px; }
  .app[data-route="overview"] .sidebar nav a span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app[data-route="overview"] .side-links .panel-head { margin: 2px 6px; }
  .app[data-route="overview"] .side-links .qa-link { padding: 2px 0; font-size: 10px; } .app[data-route="overview"] .side-links .qa-link .ic { width: 17px; height: 17px; }
  .app[data-route="overview"] #p-trend > .muted.tiny, .app[data-route="overview"] #p-trend .legend { display: none; }
  .app[data-route="overview"] .overall { margin: 0 0 2px; font-size: 12.5px; }
  .app[data-route="overview"] .hrow { font-size: 12.5px; line-height: 1.3; }
  .app[data-route="overview"] .deploys li { line-height: 1.2; }
  .app[data-route="overview"] .panel-head h3 { font-size: 13px; }
}
.steps-md { font-size: 12.5px; } .steps-md h2, .steps-md h3 { font-size: 13px; margin: 8px 0 4px; } .steps-md pre { font-size: 11.5px; }
.app[data-route="overview"] .qa-btn .qa-text .tiny { display: none; }
.qa-btn .qa-text > span { flex: none; }
@media (min-width: 1200px) and (min-height: 660px) and (max-height: 700px) {
  .app[data-route="overview"] .deploys li:nth-child(n+5) { display: none; }
}
/* SLA gauge: text always fits inside the ring. */
.gauge { container-type: inline-size; }
.gval { padding: 0; gap: 1px; }
.gval b { font-size: 17cqi; line-height: 1.05; white-space: nowrap; }
.gval span { font-size: 8.5cqi; white-space: nowrap; }
.app[data-route="overview"] .gval b { font-size: 17cqi; } .app[data-route="overview"] .gval span { display: block; font-size: 8.5cqi; }
.srow { grid-template-columns: 1fr auto; }
.spending { margin-top: 4px; }
@media (min-width: 1200px) and (min-height: 660px) and (max-height: 820px) {
  .app[data-route="overview"] .gval span { display: none; }
  .app[data-route="overview"] .gval b { font-size: 19cqi; }
}
/* The insights body floats above the panel; the panel must not clip it. */
.main .panel.insights { overflow: visible; }
/* Task Log */
.tl-table td:nth-child(2) { min-width: 260px; }
.checklist { list-style: none; margin: 0 0 8px; padding: 0; } .checklist li { padding: 3px 0; } .strike { text-decoration: line-through; }
.col { display: flex; flex-direction: column; gap: 6px; }
.col label, .assign label { display: flex; flex-direction: column; gap: 3px; }
.mt { margin-top: 16px; }
.chip b { margin-left: 4px; }
.tl-table td:nth-child(2) .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Investigation timeline: time · kind · text · author */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 84px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid rgba(43, 85, 181, .18); font-size: 12.5px; }
.timeline li > span:nth-child(3) { overflow-wrap: break-word; }
/* Show more / Hide for long lists (util.autoCollapse) */
.cl-hidden { display: none !important; }
.show-more { display: block; margin: 8px auto 4px; }
.col label.opt { flex-direction: row; align-items: flex-start; gap: 8px; text-align: left; }
.col label.opt input { margin-top: 2px; flex: none; }
.tl-trigger { white-space: nowrap; }

/* Every other page also fits one screen: the page never scrolls; header rows stay,
   the content box (.fit-fill, added by util.fitWrap) scrolls inside. */
@media (min-width: 1200px) and (min-height: 660px) {
  body:has(.app[data-fit]) { overflow: hidden; }
  .app[data-fit] {
    height: 100vh; min-height: 0; gap: 8px; padding-bottom: 8px;
    grid-template-rows: 50px minmax(0, 1fr);
    grid-template-columns: 210px minmax(0, 1fr) clamp(260px, 19vw, 300px);
    grid-template-areas: "top top top" "side main assist";
  }
  .app[data-fit] .office { display: none; }
  .app[data-fit] .topbar { padding: 4px; }
  .app[data-fit] .sidebar, .app[data-fit] .rail { min-height: 0; overflow: hidden; }
  .app[data-fit] .rail { gap: 8px; align-self: stretch; height: 100%; }
  .app[data-fit] .rail #livelogs { flex: 1; min-height: 0; overflow: hidden; }
  .app[data-fit] .side-art { display: none; }
  .app[data-fit] .main, .app[data-fit] #view { min-height: 0; height: 100%; }
  .app[data-fit] #view { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
  .app[data-fit] #view > * { flex: none; margin-top: 0; margin-bottom: 0; }
  .app[data-fit] #view > .fit-fill { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-right: 4px; }
  .app[data-fit] .fit-fill thead th { position: sticky; top: 0; z-index: 1; background: var(--bg1); }
  /* Task board: each column scrolls on its own */
  .app[data-fit] .fit-fill:has(> .panel .board) { display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
  .app[data-fit] .fit-fill > .panel:has(.board) { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .app[data-fit] .fit-fill > .panel:has(.board) > #board { flex: 1; min-height: 0; }
  .app[data-fit] .board { height: 100%; }
  .app[data-fit] .board > .col { min-height: 0; overflow: auto; }
}
.hdr-refresh { font-size: 15px; line-height: 1; padding: 5px 9px; }
.hdr-refresh.spinning { animation: spin 0.8s linear infinite; }
td.mono { white-space: nowrap; } /* IDs like PR-APP-010 never break */

/* Idol office: sparkles twinkle, hair sways, the desk lightstick glows in the state colour */
.char .sparkle, .mascot .sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2.6s ease-in-out infinite; }
.char .sparkle.s2, .mascot .sparkle.s2 { animation-delay: .9s; } .char .sparkle.s3 { animation-delay: 1.7s; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.5) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
.state-idle .sparkle, .state-blocked .sparkle { animation-duration: 5s; }
.state-success .sparkle { animation-duration: .9s; }
.char .hair-back { transform-origin: 110px 50px; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.state-working .head, .state-deploying .head { transform-origin: 110px 96px; animation: groove 1.1s ease-in-out infinite; }
@keyframes groove { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-1.5px); } }
.char .ls-ball { transform-box: fill-box; transform-origin: center; animation: lsglow 1.6s ease-in-out infinite; filter: drop-shadow(0 0 4px var(--state-color)); }
@keyframes lsglow { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.12); } }
.state-idle .ls-ball { animation: none; opacity: .35; }
.state-responding_to_incident .ls-ball { animation-duration: .5s; }
.char .visor { animation: visor 2s ease-in-out infinite; } @keyframes visor { 50% { opacity: .35; } }
.state-idle .mouth { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) { .char .sparkle, .char .hair-back, .char .head, .char .ls-ball, .char .visor, .mascot .sparkle { animation: none !important; } }
.char-art { display: contents; }
/* Header pill turns amber when the live alert/metric source is down */
.envpill.env-degraded { background: rgba(245, 166, 35, .14); border-color: var(--warn); color: var(--warn); }
.envpill.env-degraded .dot { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
/* Assistant rail only on Overview; other pages use the full width */
@media (min-width: 1200px) and (min-height: 660px) {
  .app[data-fit] { grid-template-columns: 210px minmax(0, 1fr); grid-template-areas: "top top" "side main"; }
  .app[data-fit] .rail { display: none; }
}
.envpill.env-pending { background: rgba(100, 116, 139, .14); border-color: #64748b; color: var(--muted); }
.envpill.env-pending .dot { background: #64748b; box-shadow: none; }
/* Virtual Room: the 3D stage fills the page box; a chip list under it gives keyboard access */
.room-stage { position: relative; min-height: 420px; flex: 1 1 auto; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0a1330; }
.room-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.room-legend { position: absolute; left: 12px; top: 10px; z-index: 2; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; background: rgba(9, 18, 48, .78); padding: 5px 10px; border-radius: 8px; }
.room-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.room-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; flex: none; }
.app[data-route="room"] #view > .fit-fill { display: flex; flex-direction: column; overflow: hidden; }
.room-jump { display: inline-flex; gap: 4px; flex-wrap: wrap; } .room-jump .chip { font-size: 11.5px; padding: 1px 8px; }
