:root {
  color-scheme: dark;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #030914;
  color: #f2f8ff;
  font-synthesis: none;
  --panel: rgba(7, 19, 35, .84);
  --panel-strong: rgba(8, 23, 42, .96);
  --line: rgba(115, 213, 255, .15);
  --line-bright: rgba(96, 224, 255, .32);
  --muted: #8299ad;
  --cyan: #52e5ff;
  --blue: #6b8dff;
  --violet: #9d74ff;
  --green: #45e6a8;
  --amber: #ffc769;
  --red: #ff7184;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(87,208,255,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87,208,255,.026) 1px, transparent 1px),
    radial-gradient(circle at 14% -8%, rgba(49, 120, 209, .28), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(111, 73, 214, .15), transparent 28%),
    linear-gradient(145deg, #030914 0%, #06111f 52%, #030813 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}
body::before {
  content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.018), transparent 18%, transparent 82%, rgba(82,229,255,.025));
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}

.ambient { position: fixed; border-radius: 50%; filter: blur(110px); pointer-events: none; opacity: .22; }
.ambient-a { width: 520px; height: 520px; background: #1959c7; top: 8%; right: -240px; }
.ambient-b { width: 420px; height: 420px; background: #0f9f9b; bottom: -210px; left: -190px; }
main { position: relative; width: min(1540px, calc(100% - 56px)); margin: 0 auto; padding: 24px 0 28px; }

.topbar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 28px;
  margin-bottom: 14px; padding: 17px 19px; overflow: hidden; border: 1px solid rgba(105,209,255,.18);
  border-radius: 16px; background: linear-gradient(115deg, rgba(9,27,48,.92), rgba(5,15,29,.78));
  box-shadow: 0 18px 60px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(20px);
}
.topbar::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, transparent, var(--cyan), var(--violet), transparent);
  box-shadow: 0 0 18px rgba(82,229,255,.7);
}
.topbar::after {
  content: ""; position: absolute; top: 0; right: 18%; width: 220px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(82,229,255,.8), transparent);
}
.brand, .top-actions, .live-clock, .section-head, .node-title, .node-meta, .service-head, .service-state,
.metric-row, .actions, footer { display: flex; align-items: center; }
.brand { gap: 14px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 46px; height: 46px; padding: 10px; border: 1px solid rgba(82,229,255,.4); border-radius: 13px; background: linear-gradient(145deg, rgba(82,229,255,.12), rgba(107,141,255,.08)); box-shadow: 0 0 28px rgba(82,229,255,.12), inset 0 0 18px rgba(82,229,255,.05); }
.brand-mark span { display: block; flex: 1; border-radius: 3px 3px 1px 1px; background: linear-gradient(#78f5ff, #577cff); box-shadow: 0 0 8px rgba(82,229,255,.35); }
.brand-mark span:nth-child(1) { height: 42%; }
.brand-mark span:nth-child(2) { height: 78%; }
.brand-mark span:nth-child(3) { height: 58%; }
.eyebrow, .section-kicker { margin: 0; color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .2em; text-shadow: 0 0 18px rgba(82,229,255,.25); }
h1 { margin: 2px 0 0; font-size: 23px; letter-spacing: .04em; }
h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: .025em; }
p { margin: 0; }
.top-actions { gap: 14px; }
.live-clock { gap: 10px; padding-right: 4px; }
.live-clock b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.live-clock small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(78,217,154,.09), 0 0 18px rgba(78,217,154,.65); }
button { font: inherit; }
.primary-button, .action-button {
  border: 1px solid rgba(82,229,255,.38); border-radius: 9px; color: #f5fcff;
  background: linear-gradient(120deg, rgba(44,130,179,.34), rgba(84,78,181,.24));
  box-shadow: inset 0 1px rgba(255,255,255,.04); cursor: pointer; font-weight: 760; transition: .18s ease;
}
.primary-button { padding: 10px 16px; }
.access-badge { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; }
.access-badge.operator { color: #71e6b0; border-color: rgba(78,217,154,.24); background: rgba(78,217,154,.08); }
.access-badge.viewer { color: #f4c66e; border-color: rgba(244,189,101,.24); background: rgba(244,189,101,.08); }
.login-dialog { width: min(420px, calc(100% - 28px)); border: 1px solid rgba(124,159,188,.28); border-radius: 15px; padding: 0; color: #eaf3f9; background: #0d2031; box-shadow: 0 28px 90px rgba(0,0,0,.58); }
.login-dialog::backdrop { background: rgba(2,8,14,.76); backdrop-filter: blur(5px); }
.login-dialog form { padding: 24px; }
.login-dialog h2 { margin: 4px 0 9px; font-size: 19px; }
.login-dialog p { color: var(--muted); font-size: 10px; line-height: 1.55; }
.login-dialog label { display: block; margin: 17px 0 6px; color: #b7c9d7; font-size: 10px; }
.login-dialog input { width: 100%; border: 1px solid rgba(124,159,188,.3); border-radius: 9px; padding: 11px 12px; outline: none; color: #f3f8ff; background: rgba(3,12,20,.72); }
.login-dialog input:focus { border-color: rgba(85,216,232,.55); box-shadow: 0 0 0 3px rgba(85,216,232,.07); }
.login-error { min-height: 16px; margin-top: 7px; color: #ff8c94 !important; }
.login-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.primary-button:hover, .action-button:hover { transform: translateY(-1px); border-color: rgba(82,229,255,.65); background: linear-gradient(120deg, rgba(46,154,201,.44), rgba(94,83,206,.34)); box-shadow: 0 8px 22px rgba(23,111,161,.18); }
button:disabled { opacity: .46; cursor: wait; transform: none !important; }

.console-shell { display: grid; grid-template-columns: 184px minmax(0, 1fr); align-items: start; gap: 16px; }
.console-content { min-width: 0; }
.view-nav {
  position: sticky; z-index: 20; top: 16px; display: flex; min-height: calc(100vh - 32px); flex-direction: column; gap: 5px;
  padding: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px;
  background: linear-gradient(165deg, rgba(7,23,41,.96), rgba(3,12,24,.94));
  box-shadow: 0 22px 60px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.03); backdrop-filter: blur(22px);
}
.nav-label { display: flex; align-items: center; justify-content: space-between; margin: 3px 3px 10px; color: #637e92; font-size: 8px; font-weight: 850; letter-spacing: .16em; }
.nav-label i { width: 26px; height: 1px; background: linear-gradient(90deg, rgba(82,229,255,.6), transparent); }
.view-nav button {
  position: relative; flex: 0 0 auto; width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 9px;
  padding: 12px 10px 12px 42px; color: #869daf; background: transparent; cursor: pointer;
  text-align: left; font-size: 10px; font-weight: 760; transition: .18s ease;
}
.view-nav button::before {
  position: absolute; left: 11px; top: 50%; width: 20px; transform: translateY(-50%);
  color: #436277; font: 750 8px/1 ui-monospace, monospace; letter-spacing: .04em;
}
.view-nav button:nth-of-type(1)::before { content: "01"; }
.view-nav button:nth-of-type(2)::before { content: "02"; }
.view-nav button:nth-of-type(3)::before { content: "03"; }
.view-nav button:nth-of-type(4)::before { content: "04"; }
.view-nav button:nth-of-type(5)::before { content: "05"; }
.view-nav button:nth-of-type(6)::before { content: "06"; }
.view-nav button:hover { color: #f3fbff; background: rgba(82,229,255,.07); }
.view-nav button.active { border-color: rgba(82,229,255,.18); color: #fff; background: linear-gradient(105deg, rgba(31,119,153,.42), rgba(49,60,123,.2)); box-shadow: inset 3px 0 var(--cyan), inset 0 1px rgba(255,255,255,.03); }
.view-nav button.active::before { color: var(--cyan); text-shadow: 0 0 12px rgba(82,229,255,.45); }
.nav-foot { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line); }
.nav-foot span { display: flex; align-items: center; gap: 7px; color: #b5ccda; font-size: 9px; font-weight: 760; }
.nav-foot span i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(69,230,168,.6); }
.nav-foot small { display: block; margin: 5px 0 0 13px; color: #5e7689; font-size: 7px; }

.overview, .pipeline-panel, .activity-panel, .chat-panel, .projects-panel, .monitoring-panel, .alert-panel, .dispatch-panel {
  position: relative; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(10,29,49,.9), rgba(4,14,27,.9));
  box-shadow: 0 22px 65px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(12px);
}
.overview::before, .pipeline-panel::before, .activity-panel::before, .chat-panel::before,
.projects-panel::before, .monitoring-panel::before, .alert-panel::before, .dispatch-panel::before {
  content: ""; position: absolute; top: -1px; left: 22px; width: 90px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent); box-shadow: 0 0 12px rgba(82,229,255,.35);
}
.overview { display: grid; grid-template-columns: minmax(260px, 1.5fr) 170px repeat(4, minmax(92px, .5fr)); gap: 9px; padding: 13px; margin-bottom: 16px; }
.overview > * {
  min-height: 78px; padding: 13px 14px; border: 1px solid rgba(100,196,235,.1); border-radius: 11px;
  background: linear-gradient(145deg, rgba(9,29,48,.58), rgba(3,14,27,.45));
}
.overview > *:first-child { padding-left: 14px; background: radial-gradient(circle at 0 0, rgba(82,229,255,.085), transparent 50%), rgba(6,23,40,.56); }
.overview > *:last-child { border-right: 1px solid rgba(100,196,235,.1); }
#summary { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.global-state { display: flex; align-items: center; gap: 12px; }
.state-orb { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--muted); box-shadow: inset 0 0 0 9px rgba(255,255,255,.05); }
.state-orb::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
.global-state.healthy .state-orb { background: var(--green); box-shadow: 0 0 28px rgba(69,230,168,.38), inset 0 0 0 9px rgba(0,0,0,.14); }
.global-state.degraded .state-orb { background: var(--amber); }
.global-state.unhealthy .state-orb { background: var(--red); }
.global-state small, .stat span, .stat small { display: block; color: var(--muted); font-size: 10px; }
.global-state strong { display: block; margin-top: 3px; font-size: 15px; }
.stat strong { display: block; margin: 3px 0 1px; color: #fff; font-size: 25px; font-variant-numeric: tabular-nums; text-shadow: 0 0 22px rgba(82,229,255,.22); }

.pipeline-panel, .activity-panel, .chat-panel, .monitoring-panel, .alert-panel, .dispatch-panel { padding: 20px; margin-bottom: 18px; }
.section-head { justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-head > p { color: var(--muted); font-size: 11px; }
.pipeline-project-control { display: grid; grid-template-columns: auto minmax(190px, 270px); align-items: center; gap: 5px 9px; }
.pipeline-project-control label { color: #7790a4; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.pipeline-project-control select {
  min-width: 0; border: 1px solid rgba(82,229,255,.24); border-radius: 9px; padding: 8px 30px 8px 10px;
  outline: none; color: #e9f8ff; background: rgba(3,14,27,.82); font: 9px/1.35 inherit; cursor: pointer;
}
.pipeline-project-control select:focus { border-color: rgba(82,229,255,.55); box-shadow: 0 0 0 3px rgba(82,229,255,.06); }
.pipeline-project-control select:disabled { color: #637b8e; cursor: not-allowed; }
.pipeline-project-control small { grid-column: 2; color: #607b8e; font-size: 7px; text-align: right; }
.overview-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 16px; }
.overview-main { min-width: 0; }
.overview-sidebar { display: flex; min-width: 0; flex-direction: column; }
.overview-sidebar .dispatch-panel { order: 1; }
.overview-sidebar .alert-panel { order: 2; }
.overview-sidebar .activity-panel { order: 3; }
.overview-sidebar .alert-panel, .overview-sidebar .dispatch-panel, .overview-sidebar .activity-panel { padding: 15px; margin-bottom: 12px; }
.overview-sidebar .section-head { align-items: flex-start; margin-bottom: 12px; }
.overview-sidebar h2 { font-size: 15px; }
.overview-sidebar .alert-list { grid-template-columns: 1fr; }
.overview-sidebar .alert-item { grid-template-columns: 1fr; gap: 5px; }
.overview-sidebar .alert-node { color: var(--cyan); }
.overview-sidebar .activity-panel { margin-top: 0; }
.overview-sidebar pre { max-height: 165px; overflow: auto; font-size: 9px; line-height: 1.55; }
.dispatch-form { display: grid; gap: 9px; }
.dispatch-form label { display: grid; gap: 5px; color: #9eb2c3; font-size: 9px; }
.dispatch-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dispatch-form select, .dispatch-form input, .dispatch-form textarea {
  width: 100%; min-width: 0; border: 1px solid rgba(111,196,230,.2); border-radius: 9px;
  padding: 9px 10px; outline: none; color: #edf8ff; background: rgba(2,11,22,.76); font: 9px/1.4 inherit;
}
.dispatch-form select:focus, .dispatch-form input:focus, .dispatch-form textarea:focus { border-color: rgba(85,216,232,.52); box-shadow: 0 0 0 3px rgba(85,216,232,.06); }
.dispatch-form textarea { min-height: 78px; max-height: 150px; resize: vertical; }
.dispatch-form textarea::placeholder { color: #61778a; }
.dispatch-form .primary-button { width: 100%; margin-top: 2px; padding: 9px 12px; font-size: 10px; }
.dispatch-form select:disabled, .dispatch-form input:disabled, .dispatch-form textarea:disabled { opacity: .48; cursor: not-allowed; }
.stage-owner { display: block; margin-top: 8px; color: #9db4c5; font-size: 8px; line-height: 1.35; }
.gate-connection { display: inline-flex; margin-top: 7px; padding: 3px 6px; border-radius: 999px; font-size: 7px; font-weight: 800; }
.gate-connection.wired { color: #71e6b0; background: rgba(78,217,154,.1); }
.gate-connection.gated { color: #f4c66e; background: rgba(244,189,101,.1); }
.gate-connection.pending { color: #ff9ba3; background: rgba(255,114,125,.1); }
.gate-connection.verified { color: #71e6b0; background: rgba(78,217,154,.12); box-shadow: inset 0 0 0 1px rgba(78,217,154,.18); }
.gate-connection.proof { color: #f4c66e; background: rgba(244,189,101,.12); box-shadow: inset 0 0 0 1px rgba(244,189,101,.16); }
.gate-connection.blocked { color: #ff9ba3; background: rgba(255,114,125,.12); box-shadow: inset 0 0 0 1px rgba(255,114,125,.18); }
.gate-connection.incomplete { color: #91a3b6; background: rgba(112,133,155,.1); box-shadow: inset 0 0 0 1px rgba(112,133,155,.14); }
.stage-review { display: block; width: 100%; margin-top: 9px; border: 1px solid rgba(82,229,255,.35); border-radius: 7px; padding: 7px; color: #a8f5ff; background: linear-gradient(120deg, rgba(45,141,169,.14), rgba(96,83,181,.1)); font-size: 8px; font-weight: 820; cursor: pointer; transition: .16s ease; }
.stage-review:hover { border-color: rgba(85,216,232,.62); background: rgba(85,216,232,.14); transform: translateY(-1px); }
.stage-review:focus-visible { outline: 2px solid rgba(85,216,232,.72); outline-offset: 2px; }
.dispatch-status { color: var(--muted); font-size: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.dispatch-status[data-result="success"] { color: #71e6b0; }
.dispatch-status[data-result="warning"] { color: #f4c66e; }
.dispatch-status[data-result="error"] { color: #ff8c94; }
.monitoring-panel { container-type: inline-size; }
.resource-overview {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 12px;
}
.resource-overview-card {
  --machine-accent: #67ddff;
  --machine-accent-rgb: 103, 221, 255;
  position: relative; display: flex; min-width: 0; min-height: 330px; flex-direction: column;
  overflow: hidden; border: 1px solid rgba(var(--machine-accent-rgb), .23); border-radius: 15px;
  background:
    radial-gradient(circle at 8% 0, rgba(var(--machine-accent-rgb), .13), transparent 34%),
    linear-gradient(152deg, rgba(10,31,51,.88), rgba(3,13,25,.96));
  box-shadow: 0 18px 42px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.035);
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.resource-overview-card.machine-m4 { --machine-accent: #8c91ff; --machine-accent-rgb: 140, 145, 255; }
.resource-overview-card.machine-asset { --machine-accent: #55dcff; --machine-accent-rgb: 85, 220, 255; }
.resource-overview-card.machine-video { --machine-accent: #4ce5ad; --machine-accent-rgb: 76, 229, 173; }
.resource-overview-card::before {
  content: ""; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 2px;
  background: linear-gradient(180deg, transparent 4%, var(--machine-accent) 28%, rgba(var(--machine-accent-rgb), .18) 78%, transparent);
  box-shadow: 0 0 16px rgba(var(--machine-accent-rgb), .5);
}
.resource-overview-card::after {
  content: ""; position: absolute; z-index: 0; top: 0; right: 0; width: 92px; height: 92px; pointer-events: none;
  background:
    linear-gradient(135deg, transparent 48%, rgba(var(--machine-accent-rgb), .11) 49%, transparent 50%),
    linear-gradient(135deg, transparent 63%, rgba(var(--machine-accent-rgb), .07) 64%, transparent 65%);
}
.resource-overview-card:hover {
  border-color: rgba(var(--machine-accent-rgb), .42); transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(0,0,0,.27), 0 0 28px rgba(var(--machine-accent-rgb), .055), inset 0 1px rgba(255,255,255,.045);
}
.resource-overview-card.offline { filter: saturate(.58); border-color: rgba(255,114,125,.35); }
.resource-overview-head {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 72px; padding: 13px 14px; border-bottom: 1px solid rgba(var(--machine-accent-rgb), .12);
}
.resource-machine-identity { display: flex; min-width: 0; align-items: center; gap: 10px; }
.resource-machine-marker {
  display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-content: center; border: 1px solid rgba(var(--machine-accent-rgb), .34);
  border-radius: 11px; color: #f4fbff; background: linear-gradient(145deg, rgba(var(--machine-accent-rgb), .15), rgba(4,15,27,.75));
  box-shadow: 0 0 18px rgba(var(--machine-accent-rgb), .09), inset 0 1px rgba(255,255,255,.04); text-align: center;
}
.resource-machine-marker span { display: block; color: var(--machine-accent); font: 800 7px/1 ui-monospace, monospace; letter-spacing: .12em; }
.resource-machine-marker strong { display: block; margin-top: 3px; font-size: 11px; line-height: 1; }
.resource-machine-title { min-width: 0; }
.resource-machine-title strong {
  display: block; overflow: hidden; color: #f2f8ff; font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
.resource-machine-title small {
  display: block; margin-top: 4px; overflow: hidden; color: #7f98ab; font-size: 9px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap;
}
.resource-card-state { position: relative; z-index: 1; display: grid; flex: 0 0 auto; justify-items: end; gap: 6px; }
.resource-card-state > small { display: flex; align-items: center; gap: 5px; color: #849caf; font-size: 9px; white-space: nowrap; }
.resource-card-state > small i { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.resource-card-state > small.live i { background: var(--green); box-shadow: 0 0 8px rgba(69,230,168,.62); }
.resource-gauge-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px;
  margin: 11px 11px 0; padding: 10px; border: 1px solid rgba(var(--machine-accent-rgb), .11); border-radius: 12px;
  background: linear-gradient(145deg, rgba(3,15,27,.63), rgba(4,12,22,.44));
}
.resource-ring-item {
  --metric-color: var(--machine-accent);
  display: flex; min-width: 0; align-items: center; gap: 8px; padding: 3px;
}
.resource-ring-item.metric-gpu { --metric-color: #4ce5ad; }
.resource-ring-item.moderate { --metric-color: var(--amber); }
.resource-ring-item.high { --metric-color: var(--red); }
.resource-dial {
  position: relative; display: grid; width: 58px; height: 58px; flex: 0 0 auto; place-items: center; border-radius: 50%;
  background: conic-gradient(var(--metric-color) var(--meter-angle), rgba(93,126,148,.14) 0);
  box-shadow: 0 0 18px color-mix(in srgb, var(--metric-color) 13%, transparent);
}
.resource-dial::before {
  content: ""; position: absolute; inset: 6px; border: 1px solid rgba(121,175,203,.11); border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(24,53,72,.92), rgba(3,13,23,.98) 72%);
}
.resource-ring-item.unknown .resource-dial {
  border: 1px dashed rgba(126,153,173,.28); background: rgba(44,68,85,.08); box-shadow: none;
}
.resource-dial-value { position: relative; z-index: 1; text-align: center; }
.resource-dial-value strong { display: block; font-size: 17px; line-height: 1; font-variant-numeric: tabular-nums; }
.resource-dial-value small { display: block; margin-top: 2px; color: #7c94a6; font-size: 7px; }
.resource-ring-copy { min-width: 0; }
.resource-ring-copy > strong { display: block; font-size: 10px; }
.resource-load-state {
  display: inline-flex; margin-top: 5px; padding: 2px 5px; border-radius: 999px;
  color: #8fa5b6; background: rgba(126,153,173,.08); font-size: 8px; font-weight: 780; white-space: nowrap;
}
.resource-load-state.steady { color: #71e6b0; background: rgba(69,230,168,.08); }
.resource-load-state.active { color: #7debf8; background: rgba(82,229,255,.09); }
.resource-load-state.moderate { color: #f4c66e; background: rgba(244,189,101,.09); }
.resource-load-state.high { color: #ff9ba3; background: rgba(255,114,125,.1); }
.resource-rail-grid { position: relative; z-index: 1; display: grid; gap: 8px; padding: 10px 12px 8px; }
.resource-rail-item { --metric-color: var(--blue); min-width: 0; }
.resource-rail-item.metric-vram { --metric-color: var(--violet); }
.resource-rail-item.moderate { --metric-color: var(--amber); }
.resource-rail-item.high { --metric-color: var(--red); }
.resource-rail-head { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.resource-rail-label { display: flex; min-width: 0; align-items: center; gap: 6px; }
.resource-rail-label > i { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--metric-color); box-shadow: 0 0 7px color-mix(in srgb, var(--metric-color) 45%, transparent); }
.resource-rail-label > strong { font-size: 9px; }
.resource-rail-label .resource-load-state { margin-top: 0; }
.resource-rail-amount { display: flex; flex: 0 0 auto; align-items: baseline; gap: 2px; color: #f4f9ff; }
.resource-rail-amount strong { font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.resource-rail-amount small { color: #8ca1b2; font-size: 8px; }
.resource-rail-track {
  height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px;
  background: rgba(60,89,110,.22); box-shadow: inset 0 1px 2px rgba(0,0,0,.32);
}
.resource-rail-track > i {
  display: block; height: 100%; border-radius: inherit; background: var(--metric-color);
  background: linear-gradient(90deg, color-mix(in srgb, var(--metric-color) 58%, #315279), var(--metric-color));
  box-shadow: 0 0 8px color-mix(in srgb, var(--metric-color) 35%, transparent);
}
.resource-rail-item.unknown .resource-rail-track > i { width: 0 !important; }
.resource-rail-detail { display: block; margin-top: 4px; overflow: hidden; color: #667e91; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.resource-auxiliary-grid {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  margin-top: auto; border-top: 1px solid rgba(var(--machine-accent-rgb), .11); border-bottom: 1px solid rgba(var(--machine-accent-rgb), .08);
  background: rgba(var(--machine-accent-rgb), .065);
}
.resource-auxiliary-item { min-width: 0; padding: 8px 9px; background: rgba(3,13,24,.66); }
.resource-auxiliary-item span { display: block; overflow: hidden; color: #6f879a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.resource-auxiliary-item strong {
  display: block; margin-top: 4px; overflow: hidden; color: #cddbe5; font-size: 10px; font-variant-numeric: tabular-nums;
  text-overflow: ellipsis; white-space: nowrap;
}
.resource-freshness {
  position: relative; z-index: 1; min-height: 29px; padding: 8px 12px; color: #6d8496; font-size: 9px; line-height: 1.5;
}
@container (max-width: 830px) {
  .resource-overview { grid-template-columns: 1fr; }
  .resource-overview-card { min-height: 0; }
}
@container (max-width: 360px) {
  .resource-overview-head { flex-wrap: wrap; }
  .resource-card-state {
    width: 100%; grid-auto-flow: column; align-items: center; justify-content: space-between; justify-items: start;
  }
  .resource-gauge-grid { grid-template-columns: 1fr; }
  .resource-ring-item { justify-content: center; }
}
.alert-panel { padding-bottom: 15px; }
.alert-summary { padding: 5px 9px; border-radius: 999px; color: var(--muted); background: rgba(124,159,188,.08); font-size: 9px; font-weight: 800; }
.alert-summary.healthy { color: #71e6b0; background: rgba(78,217,154,.09); }
.alert-summary.warning { color: #f4c66e; background: rgba(244,189,101,.09); }
.alert-summary.critical { color: #ff8c94; background: rgba(255,114,125,.1); }
.alert-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.alert-item { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(5,15,25,.42); }
.alert-item.warning { border-color: rgba(244,189,101,.18); }
.alert-item.critical { border-color: rgba(255,114,125,.24); }
.alert-node { align-self: start; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.alert-item strong { display: block; font-size: 10px; }
.alert-item p { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.alert-empty { display: flex; align-items: center; gap: 9px; color: #85bda5; font-size: 10px; }
.alert-empty i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 9px rgba(78,217,154,.5); }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stage {
  position: relative; min-height: 100px; padding: 15px; overflow: visible; border: 1px solid var(--line);
  border-radius: 12px; background: linear-gradient(145deg, rgba(10,31,50,.67), rgba(4,14,26,.72));
  box-shadow: inset 0 1px rgba(255,255,255,.02); transition: .2s ease;
}
.stage:hover { z-index: 3; border-color: rgba(82,229,255,.3); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.035); }
.stage:not(:last-child)::after { content: "›"; position: absolute; z-index: 2; top: 34px; right: -9px; color: #4a647a; font-size: 21px; }
.stage:nth-child(4)::after { content: "⌄"; top: auto; right: 50%; bottom: -13px; }
.stage:nth-child(5) { grid-column: 4; }
.stage:nth-child(6) { grid-column: 3; grid-row: 2; }
.stage:nth-child(7) { grid-column: 2; grid-row: 2; }
.stage:nth-child(8) { grid-column: 1; grid-row: 2; }
.stage:nth-child(n+5):not(:last-child)::after { content: "‹"; right: auto; left: -9px; }
.stage-index { color: var(--cyan); font-size: 9px; font-weight: 850; letter-spacing: .14em; text-shadow: 0 0 14px rgba(82,229,255,.28); }
.stage strong { display: block; margin-top: 8px; font-size: 13px; }
.stage small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.stage-state { position: absolute; top: 14px; right: 13px; width: 7px; height: 7px; border-radius: 50%; background: #415368; }
.stage-state.working { background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.stage-state.ready, .stage-state.idle, .stage-state.recent { background: var(--green); }
.stage-state.queued { background: var(--amber); }
.stage-state.issue { background: var(--red); }
.stage-state.active { background: var(--cyan); box-shadow: 0 0 12px rgba(82,229,255,.65); }
.stage-state.recorded { background: #6b9fd0; }
.stage-state.review { background: var(--amber); box-shadow: 0 0 10px rgba(255,199,105,.45); }
.stage-state.complete { background: var(--green); }
.stage-state.blocked { background: var(--red); box-shadow: 0 0 10px rgba(255,113,132,.45); }

.machine-workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 360px);
  align-items: start; gap: 14px; margin-bottom: 18px;
}
.machines { min-width: 0; margin-bottom: 0; }
.machine-live-note {
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 7px; row-gap: 1px;
  padding: 8px 11px; border: 1px solid rgba(82,229,255,.18); border-radius: 10px;
  color: #c6f8ff; background: rgba(82,229,255,.055);
}
.machine-live-note i { grid-row: span 2; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(69,230,168,.7); }
.machine-live-note span { font-size: 9px; font-weight: 800; }
.machine-live-note small { color: var(--muted); font-size: 7px; }
.legend { gap: 15px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-dot.working { background: var(--cyan); }
.legend-dot.idle { background: var(--green); }
.legend-dot.issue { background: var(--red); }
.node-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.node-grid.single { grid-template-columns: 1fr; }
.node-grid.single .service-list { grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); }
.node-grid.single .node-role { min-height: auto; }
.node {
  position: relative; min-width: 0; overflow: hidden; border: 1px solid rgba(96,199,240,.2); border-radius: 16px; background: var(--panel);
  box-shadow: 0 24px 70px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.03);
}
.node::before {
  content: ""; position: absolute; z-index: 2; top: 0; left: 18px; width: 130px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), transparent); box-shadow: 0 0 15px rgba(82,229,255,.4);
}
.node.offline { border-color: rgba(255,114,125,.3); }
.node-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 0 0, rgba(82,229,255,.1), transparent 42%), linear-gradient(120deg, rgba(53,79,132,.2), transparent); }
.node-title { justify-content: space-between; gap: 12px; }
.node-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.machine-icon { position: relative; width: 30px; height: 22px; flex: 0 0 auto; border: 1px solid rgba(82,229,255,.55); border-radius: 4px; background: linear-gradient(145deg, #102d46, #071522); box-shadow: 0 0 16px rgba(82,229,255,.1), inset 0 0 10px rgba(82,229,255,.04); }
.machine-icon::before { content:""; position:absolute; width:10px; height:2px; background:#55708a; left:8px; bottom:-5px; }
.machine-icon::after { content:""; position:absolute; width:18px; height:1px; background:#55708a; left:4px; bottom:-7px; }
.node h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.node-role { margin: 11px 0 0; min-height: 31px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.node-meta { justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.monitor-warning {
  padding: 10px 18px; border-bottom: 1px solid rgba(244,189,101,.18);
  color: #f4c66e; background: rgba(244,189,101,.07); font-size: 9px; line-height: 1.5;
}
.resource-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); background: rgba(2, 12, 23, .4);
}
.resource-item { min-width: 0; padding: 11px; border: 1px solid rgba(104,207,248,.12); border-radius: 10px; background: linear-gradient(145deg, rgba(10,31,49,.7), rgba(4,16,29,.7)); }
.resource-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9px; }
.resource-head span { color: var(--muted); }
.resource-head strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.resource-track { height: 4px; margin: 8px 0 7px; overflow: hidden; border-radius: 999px; background: #142b3d; box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.resource-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green)); box-shadow: 0 0 9px rgba(82,229,255,.4); }
.resource-item.temperature .resource-track i { background: linear-gradient(90deg, var(--green), var(--amber), var(--red)); }
.resource-item small { display: block; overflow: hidden; color: #71889b; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.badge.healthy { color: #71e6b0; background: rgba(78,217,154,.11); border: 1px solid rgba(78,217,154,.2); }
.badge.degraded { color: #f4c66e; background: rgba(244,189,101,.1); border: 1px solid rgba(244,189,101,.2); }
.badge.unhealthy, .badge.offline { color: #ff8c94; background: rgba(255,114,125,.1); border: 1px solid rgba(255,114,125,.22); }
.service-list { display: grid; gap: 1px; background: var(--line); }
.service { padding: 17px 20px; background: linear-gradient(145deg, rgba(8,25,44,.98), rgba(5,17,31,.98)); transition: background .18s ease; }
.service:hover { background: linear-gradient(145deg, rgba(11,34,56,.98), rgba(6,20,35,.98)); }
.service-head { justify-content: space-between; align-items: flex-start; gap: 12px; }
.service-name { min-width: 0; }
.service-name strong { display: block; font-size: 13px; }
.service-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.service-state { flex: 0 0 auto; gap: 6px; font-size: 10px; font-weight: 750; }
.service-state i { width: 7px; height: 7px; border-radius: 50%; background: #677889; }
.service-state.working { color: #6de5ef; }
.service-state.working i { background: var(--cyan); box-shadow: 0 0 10px rgba(85,216,232,.7); }
.service-state.queued { color: #f4c66e; }
.service-state.queued i { background: var(--amber); }
.service-state.paused { color: #f4c66e; }
.service-state.paused i { background: var(--amber); box-shadow: 0 0 9px rgba(244,198,110,.45); }
.service-state.ready, .service-state.idle, .service-state.recent { color: #71e6b0; }
.service-state.ready i, .service-state.idle i, .service-state.recent i { background: var(--green); }
.service-state.unknown, .service-state.issue { color: #ff8c94; }
.service-state.unknown i, .service-state.issue i { background: var(--red); }
.current-task { margin-top: 11px; padding: 9px 10px; border-radius: 8px; background: rgba(3,11,19,.44); color: #c7d7e4; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.current-task b { color: var(--muted); font-weight: 600; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.metric { min-width: 0; padding: 8px 9px; border: 1px solid rgba(130,166,195,.1); border-radius: 7px; background: rgba(4,13,22,.28); }
.metric span { display: block; color: var(--muted); font-size: 9px; }
.metric b { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.last-result { margin-top: 9px; color: var(--muted); font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.service-detail { margin-top: 8px; color: #71889b; font-size: 9px; line-height: 1.45; }
.actions { flex-wrap: wrap; gap: 7px; padding: 13px 18px 16px; background: #0d1d2e; }
.actions-label { width: 100%; color: var(--muted); font-size: 9px; }
.action-button { padding: 7px 10px; font-size: 9px; }
.action-button.restart { border-color: rgba(244,189,101,.34); background: rgba(151,103,44,.16); }
.empty-service, .offline-message { padding: 20px 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.machine-workspace .chat-panel {
  position: sticky; top: 64px; min-width: 0; margin: 0; padding: 17px;
}
.machine-workspace .chat-panel .section-head { display: block; margin-bottom: 12px; }
.machine-workspace .chat-panel .section-head > p { margin-top: 6px; line-height: 1.45; }
.chat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chat-grid.single { grid-template-columns: 1fr; }
.chat-grid.single .chat-messages { height: 255px; }
.chat-card { min-width: 0; overflow: hidden; border: 1px solid rgba(102,202,243,.17); border-radius: 13px; background: linear-gradient(155deg, rgba(7,23,40,.8), rgba(3,13,25,.86)); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 15px; border-bottom: 1px solid var(--line); background: rgba(36,71,99,.15); }
.chat-agent { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agent-mark { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border: 1px solid rgba(82,229,255,.38); border-radius: 10px; color: var(--cyan); background: linear-gradient(145deg, rgba(82,229,255,.11), rgba(107,141,255,.08)); box-shadow: 0 0 20px rgba(82,229,255,.08); font-size: 10px; font-weight: 900; }
.chat-agent strong, .chat-agent small { display: block; }
.chat-agent strong { font-size: 12px; }
.chat-agent small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.chat-presence { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; }
.chat-presence i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(78,217,154,.6); }
.chat-presence.offline { color: var(--red); }
.chat-presence.offline i { background: var(--red); box-shadow: none; }
.chat-messages { height: 270px; overflow-y: auto; padding: 15px; scroll-behavior: smooth; }
.chat-message { display: flex; margin-bottom: 11px; }
.chat-message.user { justify-content: flex-end; }
.chat-bubble { max-width: 86%; padding: 10px 12px; border: 1px solid rgba(104,193,228,.08); border-radius: 11px 11px 11px 3px; background: #102a41; color: #dcecf6; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.user .chat-bubble { border-color: rgba(82,229,255,.15); border-radius: 11px 11px 3px 11px; background: linear-gradient(135deg, #1d577b, #334e91); color: #f4fbff; }
.chat-message.pending .chat-bubble { color: var(--muted); }
.chat-time { display: block; margin-top: 4px; color: #698095; font-size: 8px; }
.chat-shortcuts { display: flex; gap: 6px; padding: 0 15px 10px; overflow-x: auto; }
.chat-shortcut, .new-chat {
  flex: 0 0 auto; border: 1px solid rgba(124,159,188,.2); border-radius: 999px; color: #9eb2c3;
  background: rgba(14,32,48,.72); cursor: pointer; font-size: 8px;
}
.chat-shortcut { padding: 6px 9px; }
.new-chat { padding: 6px 9px; }
.chat-shortcut:hover, .new-chat:hover { color: #edf6ff; border-color: rgba(85,216,232,.38); }
.chat-compose { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.chat-compose textarea {
  display: block; width: 100%; min-height: 66px; max-height: 160px; resize: vertical; border: 1px solid rgba(124,159,188,.22);
  border-radius: 9px; padding: 10px 11px; outline: none; color: #eef6fc; background: rgba(3,12,20,.72);
  font: 10px/1.5 inherit;
}
.chat-compose textarea:focus { border-color: rgba(85,216,232,.52); box-shadow: 0 0 0 3px rgba(85,216,232,.06); }
.chat-compose textarea::placeholder { color: #61778a; }
.compose-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.compose-foot small { color: var(--muted); font-size: 8px; }
.send-chat { border: 1px solid rgba(85,216,232,.4); border-radius: 8px; padding: 7px 13px; color: #ecfbff; background: rgba(36,119,146,.33); cursor: pointer; font-size: 9px; font-weight: 800; }
.send-chat:hover { background: rgba(42,148,174,.42); }
.send-chat:disabled, .chat-compose textarea:disabled { opacity: .5; cursor: wait; }

.activity-panel { margin-top: 22px; }
.safe-note { color: var(--green); font-size: 10px; }
pre { min-height: 20px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #a9bac9; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
footer { justify-content: center; flex-wrap: wrap; gap: 8px 24px; padding: 4px 0; color: #5f7486; font-size: 9px; }

.projects-panel { padding: 22px; margin-bottom: 24px; }
.director-subtitle { margin-top: 7px; color: #8299ac; font-size: 9px; line-height: 1.5; }
.secondary-button {
  border: 1px solid rgba(102,150,255,.3); border-radius: 8px; padding: 8px 12px; color: #c8d9e8;
  background: rgba(43,78,123,.2); cursor: pointer; font-size: 9px; font-weight: 750;
}
.secondary-button:hover { color: #fff; background: rgba(55,102,164,.32); }
.project-overview {
  display: grid; grid-template-columns: 140px 180px 140px 1fr; margin-bottom: 14px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(120deg, rgba(9,31,51,.62), rgba(4,15,28,.62));
}
.project-overview > * { min-width: 0; padding: 12px 14px; border-right: 1px solid var(--line); }
.project-overview > *:last-child { border-right: 0; }
.project-overview span, .project-overview p { display: block; color: var(--muted); font-size: 9px; }
.project-overview strong { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.project-overview p { align-self: center; line-height: 1.5; }
.project-layout { display: grid; grid-template-columns: minmax(245px, .7fr) minmax(0, 2fr); gap: 13px; min-height: 480px; }
.project-layout.empty { grid-template-columns: 1fr; }
.project-list, .project-detail { min-width: 0; border: 1px solid rgba(103,203,245,.14); border-radius: 13px; background: rgba(3,13,25,.56); box-shadow: inset 0 1px rgba(255,255,255,.02); }
.project-list { overflow: hidden auto; max-height: 860px; padding: 8px; }
.project-card {
  width: 100%; margin: 0 0 6px; border: 1px solid transparent; border-radius: 9px; padding: 12px;
  color: #dcebf5; background: linear-gradient(135deg, rgba(17,46,69,.58), rgba(9,27,47,.52)); cursor: pointer; text-align: left; transition: .18s ease;
}
.project-card:hover { border-color: rgba(82,229,255,.24); background: linear-gradient(135deg, rgba(24,62,88,.72), rgba(15,36,65,.65)); transform: translateX(2px); }
.project-card.active { border-color: rgba(82,229,255,.42); background: linear-gradient(135deg, rgba(35,96,121,.48), rgba(53,54,124,.36)); box-shadow: inset 3px 0 var(--cyan), 0 8px 18px rgba(0,0,0,.1); }
.project-card-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.project-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.project-card small { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.project-current-badge { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: var(--cyan); background: rgba(85,216,232,.08); font-size: 7px; }
.project-progress { height: 3px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #192c3c; }
.project-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--green)); }
.project-detail { max-height: 980px; padding: 18px; overflow: auto; }
.project-empty { display: grid; place-content: center; height: 100%; min-height: 330px; text-align: center; }
.project-empty strong { font-size: 13px; }
.project-empty span { margin-top: 7px; color: var(--muted); font-size: 9px; }
.director-empty-shell { display: grid; align-content: center; min-height: 430px; padding: 30px; text-align: center; }
.director-empty-head h3 { margin-top: 10px; font-size: 18px; }
.director-empty-head p { max-width: 620px; margin: 7px auto 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.director-empty-badge { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(255,191,86,.25); border-radius: 999px; color: var(--amber); background: rgba(255,191,86,.07); font-size: 8px; }
.director-empty-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin: 24px auto 0; width: min(100%, 1100px); }
.director-empty-group { min-width: 0; padding: 11px; border: 1px solid rgba(85,216,232,.13); border-radius: 10px; background: linear-gradient(145deg, rgba(15,44,66,.65), rgba(6,20,35,.7)); text-align: left; }
.director-empty-group h4 { color: #d9f6fa; font-size: 9px; }
.director-empty-group-steps { display: grid; gap: 5px; margin-top: 8px; }
.director-empty-group-steps span { padding: 5px 7px; border-radius: 5px; color: #7895a8; background: rgba(4,16,28,.45); font-size: 7px; }
.director-empty-step { position: relative; display: grid; place-items: center; gap: 7px; min-height: 90px; padding: 12px 8px; border: 1px solid rgba(85,216,232,.13); border-radius: 10px; background: linear-gradient(145deg, rgba(15,44,66,.65), rgba(6,20,35,.7)); }
.director-empty-step:not(:last-child)::after { content: "›"; position: absolute; z-index: 2; top: 34px; right: -12px; color: #477087; font-size: 16px; }
.director-empty-step span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #7f9bad; background: #142c3d; font-size: 8px; }
.director-empty-step strong { font-size: 9px; }
.director-empty-rule { margin-top: 17px; color: #7493a7; font-size: 8px; }
.small-flow-board { margin: 4px 0 14px; padding: 13px; border: 1px solid rgba(98,178,218,.16); border-radius: 12px; background: rgba(5,20,34,.6); }
.small-flow-board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.small-flow-board-head strong { color: #edfaff; font-size: 10px; }
.small-flow-board-head span { color: #7893a6; font-size: 8px; text-align: right; }
.small-flow-groups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: 7px; }
.small-flow-group { min-width: 0; padding: 8px; border: 1px solid rgba(103,203,245,.1); border-radius: 9px; background: rgba(3,14,25,.5); }
.small-flow-group h4 { margin: 0 0 7px; color: #79dce9; font-size: 8px; letter-spacing: .04em; }
.small-flow-buttons { display: grid; gap: 5px; }
.small-flow-button { position: relative; display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 2px 7px; width: 100%; min-height: 54px; border: 1px solid rgba(124,159,188,.1); border-radius: 7px; padding: 7px; color: #b4c7d4; background: rgba(8,27,44,.58); cursor: pointer; text-align: left; transition: .16s ease; }
.small-flow-button:hover { border-color: rgba(85,216,232,.3); color: #effcff; transform: translateY(-1px); }
.small-flow-button.selected { border-color: rgba(85,216,232,.62); background: linear-gradient(135deg, rgba(30,91,108,.58), rgba(36,53,104,.45)); box-shadow: inset 2px 0 var(--cyan), 0 6px 14px rgba(0,0,0,.12); }
.small-flow-button.has-run:not(.selected) { border-color: rgba(78,217,154,.22); }
.small-flow-index { grid-row: span 2; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #67879b; background: #142b3b; font-size: 7px; font-weight: 850; }
.small-flow-button.selected .small-flow-index { color: #06151d; background: var(--cyan); box-shadow: 0 0 12px rgba(85,216,232,.28); }
.small-flow-button strong { min-width: 0; overflow: hidden; color: inherit; font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.small-flow-button small { grid-column: 2; min-width: 0; overflow: hidden; color: #668397; font-size: 6.5px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.small-flow-panel { padding: 16px; border: 1px solid rgba(85,216,232,.27); border-radius: 13px; background: radial-gradient(circle at top left, rgba(38,108,128,.17), transparent 35%), linear-gradient(145deg, rgba(8,28,45,.94), rgba(3,15,28,.94)); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.small-flow-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.small-flow-sequence { color: var(--cyan); font-size: 8px; font-weight: 850; }
.small-flow-panel-head h3 { margin-top: 4px; font-size: 21px; }
.small-flow-panel-head p { margin-top: 5px; color: #829daf; font-size: 8px; }
.small-flow-test-badge { flex: 0 0 auto; padding: 6px 9px; border: 1px solid rgba(255,191,86,.25); border-radius: 999px; color: var(--amber); background: rgba(255,191,86,.08); font-size: 7px; }
.small-flow-contract-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 14px; }
.small-flow-contract-card { min-width: 0; padding: 12px; border: 1px solid rgba(124,159,188,.11); border-radius: 9px; background: rgba(4,18,31,.66); }
.small-flow-contract-card h4 { color: #dceef7; font-size: 9px; }
.small-flow-contract-card.gate { box-shadow: inset 0 2px rgba(255,191,86,.34); }
.small-flow-contract-card p, .small-flow-contract-card small { display: block; margin-top: 8px; color: #8aa2b2; font-size: 7px; line-height: 1.55; overflow-wrap: anywhere; }
.small-flow-fact-list { display: grid; gap: 5px; margin: 8px 0 0; padding-left: 15px; color: #8aa2b2; font-size: 7px; line-height: 1.45; }
.small-flow-control { margin-top: 10px; padding: 13px; border: 1px solid rgba(102,150,255,.16); border-radius: 10px; background: rgba(9,22,39,.7); }
.small-flow-control-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.small-flow-control-head div { color: #e8f6ff; font-size: 10px; font-weight: 800; }
.small-flow-control-head small { max-width: 60%; color: #748fa2; font-size: 7px; line-height: 1.45; text-align: right; }
.small-flow-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.small-flow-field { display: grid; gap: 5px; color: #819aad; font-size: 7px; }
.small-flow-field.wide { grid-column: span 3; }
.small-flow-field textarea, .small-flow-field input { width: 100%; border: 1px solid rgba(124,159,188,.18); border-radius: 7px; padding: 8px 9px; color: #e7f4fb; background: rgba(3,13,24,.8); font: inherit; outline: none; resize: vertical; }
.small-flow-field textarea:focus, .small-flow-field input:focus { border-color: rgba(85,216,232,.52); box-shadow: 0 0 0 2px rgba(85,216,232,.07); }
.small-flow-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.small-flow-tools span { margin-right: 3px; color: #718ca0; font-size: 7px; }
.small-flow-tools b { padding: 4px 6px; border-radius: 5px; color: #9edfe7; background: rgba(44,129,146,.18); font-size: 6.5px; font-weight: 750; }
.small-flow-tools b.manual { color: #d9b775; background: rgba(143,96,27,.16); }
.small-flow-actions { display: flex; gap: 8px; margin-top: 11px; }
.small-flow-launch { border: 1px solid rgba(78,217,154,.38); border-radius: 8px; padding: 8px 12px; color: #c5f6dc; background: rgba(36,119,84,.26); cursor: pointer; font-size: 8px; font-weight: 850; }
.small-flow-launch:hover { background: rgba(42,151,102,.34); }
.small-flow-launch:disabled, .small-flow-actions button:disabled { opacity: .42; cursor: not-allowed; }
.small-flow-action-status { min-height: 16px; margin-top: 8px; color: #7e9caf; font-size: 7px; line-height: 1.5; }
.small-flow-action-status[data-result="error"] { color: var(--red); }
.small-flow-run-evidence { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.small-flow-run-process, .small-flow-run-result { min-width: 0; min-height: 100px; padding: 12px; border: 1px solid rgba(124,159,188,.11); border-radius: 9px; background: rgba(4,18,31,.64); }
.small-flow-run-process { box-shadow: inset 0 2px rgba(85,216,232,.35); }
.small-flow-run-result { box-shadow: inset 0 2px rgba(78,217,154,.35); }
.small-flow-run-process h4, .small-flow-run-result h4 { color: #dceef7; font-size: 9px; }
.small-flow-run-process p, .small-flow-run-process small, .small-flow-empty-result { display: block; margin-top: 8px; color: #829cad; font-size: 7px; line-height: 1.55; overflow-wrap: anywhere; }
.small-flow-artifacts { display: grid; gap: 5px; margin-top: 8px; }
.small-flow-artifact { padding: 7px; border-radius: 6px; background: rgba(22,57,48,.32); }
.small-flow-artifact strong, .small-flow-artifact small { display: block; overflow-wrap: anywhere; }
.small-flow-artifact strong { color: #bcefd3; font-size: 7px; }
.small-flow-artifact small { margin-top: 4px; color: #6e9d87; font-size: 6px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.detail-head h3 { margin: 2px 0 0; font-size: 18px; }
.detail-head p { margin-top: 6px; color: var(--muted); font-size: 9px; }
.detail-state { padding: 5px 8px; border-radius: 999px; color: #79e7b7; background: rgba(78,217,154,.09); font-size: 8px; }
.task-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin: 13px 0 16px; }
.task-strip div { min-width: 0; padding: 8px 9px; border: 1px solid rgba(124,159,188,.1); border-radius: 7px; background: rgba(13,30,45,.5); }
.task-strip span { display: block; color: var(--muted); font-size: 8px; }
.task-strip strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.director-rail-shell { margin: 4px 0 14px; padding: 12px; border: 1px solid rgba(98,178,218,.13); border-radius: 11px; background: rgba(5,20,34,.58); }
.director-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.director-rail-head strong { font-size: 9px; }
.director-rail-head span { color: #8da9ba; font-size: 8px; text-align: right; }
.director-rail { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding: 2px 0 4px; }
.director-rail-button { position: relative; min-width: 0; min-height: 76px; border: 0; padding: 7px 4px; color: #8ca1b2; background: transparent; cursor: pointer; text-align: center; }
.director-rail-button:not(:last-child)::before { content: ""; position: absolute; z-index: 0; top: 19px; left: calc(50% + 15px); width: calc(100% - 30px); height: 1px; background: #253e50; }
.director-rail-button:hover { color: #d9f5fa; }
.director-rail-button span, .director-rail-button strong, .director-rail-button small { display: block; }
.director-rail-button span { position: relative; z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; margin: 0 auto; border: 1px solid #29475c; border-radius: 50%; color: #698396; background: #0b2030; font-size: 7px; }
.director-rail-button strong { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.director-rail-button small { margin-top: 3px; font-size: 7px; }
.director-rail-button.actual span { border-color: var(--cyan); color: #05141c; background: var(--cyan); box-shadow: 0 0 14px rgba(85,216,232,.34); }
.director-rail-button.selected { color: #effcff; }
.director-rail-button.selected strong { color: #effcff; }
.director-rail-button.selected span { box-shadow: 0 0 0 4px rgba(85,216,232,.07), 0 0 14px rgba(85,216,232,.2); }
.director-rail-button.blocked span { border-color: rgba(255,114,125,.65); color: var(--red); }
.director-rail-button.review span { border-color: rgba(255,191,86,.7); color: var(--amber); }
.director-rail-button.complete span { border-color: rgba(78,217,154,.7); color: #061710; background: var(--green); }
.director-rail-button.complete:not(:last-child)::before { background: rgba(78,217,154,.34); }
.director-focus { padding: 16px; border: 1px solid rgba(85,216,232,.24); border-radius: 13px; background: radial-gradient(circle at top left, rgba(38,108,128,.18), transparent 36%), linear-gradient(145deg, rgba(8,28,45,.93), rgba(3,15,28,.93)); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.director-focus.blocked { border-color: rgba(255,114,125,.34); }
.director-focus.review { border-color: rgba(255,191,86,.36); }
.director-focus.complete { border-color: rgba(78,217,154,.3); }
.director-focus-top { display: flex; align-items: flex-start; gap: 10px; }
.director-focus-title { flex: 1; min-width: 0; }
.director-step-number { color: var(--cyan); font-size: 8px; font-weight: 800; }
.director-focus-title h3 { margin-top: 4px; font-size: 20px; }
.director-focus-title p { margin-top: 5px; color: #8299aa; font-size: 8px; }
.director-focus-state { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; color: #aec5d3; background: rgba(124,159,188,.09); font-size: 8px; }
.director-focus-state.active { color: var(--cyan); background: rgba(85,216,232,.1); }
.director-focus-state.blocked { color: var(--red); background: rgba(255,114,125,.1); }
.director-focus-state.review { color: var(--amber); background: rgba(255,191,86,.1); }
.director-focus-state.complete { color: var(--green); background: rgba(78,217,154,.1); }
.director-return { flex: 0 0 auto; border: 1px solid rgba(85,216,232,.3); border-radius: 7px; padding: 6px 8px; color: #bceff4; background: rgba(37,109,129,.22); cursor: pointer; font-size: 8px; }
.director-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.director-evidence-card { min-width: 0; min-height: 135px; padding: 13px; border: 1px solid rgba(124,159,188,.12); border-radius: 10px; background: rgba(4,18,31,.68); }
.director-evidence-card.input { box-shadow: inset 0 2px rgba(102,150,255,.42); }
.director-evidence-card.process { box-shadow: inset 0 2px rgba(85,216,232,.42); }
.director-evidence-card.result { box-shadow: inset 0 2px rgba(78,217,154,.42); }
.director-card-label { display: block; color: #718a9c; font-size: 8px; font-weight: 800; }
.director-evidence-card strong { display: block; margin-top: 9px; color: #edf8ff; font-size: 11px; line-height: 1.4; }
.director-evidence-card p { margin-top: 7px; color: #8da3b3; font-size: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.director-result-button { margin-top: 11px; border: 1px solid rgba(78,217,154,.34); border-radius: 7px; padding: 7px 10px; color: #b7f4d7; background: rgba(36,119,84,.24); cursor: pointer; font-size: 8px; font-weight: 800; }
.director-result-button:hover { background: rgba(42,151,102,.32); }
.director-decision { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 11px; margin-top: 10px; padding: 11px 13px; border-left: 3px solid var(--cyan); border-radius: 7px; background: rgba(27,74,93,.24); }
.director-decision span { color: #7f9bad; font-size: 8px; }
.director-decision strong { color: #dff8fb; font-size: 9px; line-height: 1.5; }
.director-decision.blocked { border-left-color: var(--red); background: rgba(104,37,51,.2); }
.director-decision.review { border-left-color: var(--amber); background: rgba(113,78,28,.18); }
.director-decision.complete { border-left-color: var(--green); background: rgba(35,91,67,.19); }
.director-no-stage { color: var(--muted); font-size: 9px; }
.director-history { margin-top: 12px; border: 1px solid rgba(124,159,188,.11); border-radius: 9px; background: rgba(4,17,29,.48); }
.director-history > summary { padding: 11px 13px; color: #829bad; cursor: pointer; font-size: 8px; font-weight: 800; }
.director-history .project-steps { padding: 0 10px 10px; }
.project-steps { display: grid; gap: 7px; }
.project-step {
  display: grid; grid-template-columns: 28px minmax(110px,.65fr) minmax(130px,1fr) minmax(120px,.8fr);
  align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid rgba(104,198,235,.1); border-radius: 9px; background: linear-gradient(135deg, rgba(8,27,44,.66), rgba(4,17,30,.62));
}
.step-index { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #8398a9; background: #172b3b; font-size: 8px; font-weight: 850; }
.step-name strong { display: block; font-size: 10px; }
.step-name small, .step-evidence, .step-time { color: var(--muted); font-size: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.step-state { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 8px; }
.step-state i { width: 5px; height: 5px; border-radius: 50%; background: #536879; }
.project-step.active { border-color: rgba(85,216,232,.32); background: rgba(25,64,80,.38); }
.project-step.active .step-index, .step-state.active i { color: #06131c; background: var(--cyan); }
.project-step.blocked { border-color: rgba(255,114,125,.3); }
.project-step.blocked .step-index, .step-state.blocked i { background: var(--red); }
.project-step.review .step-index, .step-state.review i { color: #1a1205; background: var(--amber); }
.project-step.complete .step-index, .step-state.complete i { color: #05160f; background: var(--green); }
.project-step.recorded .step-index, .step-state.recorded i { background: #5d8eb9; }
.project-sources { margin-top: 13px; color: #62798c; font-size: 8px; }
.project-preview { margin-top: 6px; border: 1px solid rgba(85,216,232,.3); border-radius: 6px; padding: 5px 8px; color: #bceff4; background: rgba(37,109,129,.22); cursor: pointer; font-size: 8px; }
.project-preview:hover { background: rgba(42,148,174,.32); }
.review-dialog { width: min(1180px, calc(100% - 28px)); max-height: calc(100vh - 32px); border: 1px solid rgba(82,229,255,.28); border-radius: 16px; padding: 0; color: #eaf3f9; background: linear-gradient(145deg, #081d31, #040f1d); box-shadow: 0 32px 110px rgba(0,0,0,.72), 0 0 40px rgba(82,229,255,.07); }
.review-dialog::backdrop { background: rgba(2,8,14,.82); backdrop-filter: blur(5px); }
.review-shell { padding: 18px; }
.review-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.review-head h2 { margin-top: 3px; }
.review-head p:last-child { margin-top: 5px; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.review-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; min-height: 520px; }
.review-gallery { max-height: 670px; overflow-y: auto; display: grid; align-content: start; gap: 7px; }
.review-thumb { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; padding: 6px; color: #aabccc; background: rgba(5,15,25,.54); cursor: pointer; text-align: left; }
.review-thumb.active { border-color: rgba(85,216,232,.55); background: rgba(30,87,105,.35); }
.review-thumb img { display: block; width: 100%; height: 100px; border-radius: 5px; object-fit: cover; background: #050c13; }
.review-thumb small { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.video-thumb { display: grid; place-items: center; height: 82px; border-radius: 5px; color: var(--cyan); background: rgba(21,50,70,.7); font-size: 12px; }
.review-main { min-width: 0; display: flex; flex-direction: column; }
.review-viewer { display: grid; place-items: center; min-height: 390px; max-height: 58vh; overflow: hidden; border: 1px solid rgba(82,229,255,.16); border-radius: 11px; background: radial-gradient(circle at center, #081b2a, #02070c 72%); box-shadow: inset 0 0 45px rgba(0,0,0,.45); }

@keyframes softPulse {
  0%, 100% { opacity: .7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.pulse, .machine-live-note i, .chat-presence i { animation: softPulse 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.review-viewer img, .review-viewer video { display: block; max-width: 100%; max-height: 58vh; object-fit: contain; }
.review-main > label { display: grid; gap: 5px; margin-top: 10px; color: #9eb2c3; font-size: 9px; }
.review-main textarea { min-height: 70px; max-height: 130px; resize: vertical; border: 1px solid rgba(124,159,188,.22); border-radius: 8px; padding: 9px; outline: none; color: #edf6ff; background: rgba(3,12,20,.72); font: 9px/1.5 inherit; }
.review-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.review-actions .secondary-button { color: #ffabb1; border-color: rgba(255,114,125,.28); }

.workflow-center {
  position: relative; min-height: 720px; padding: 20px; border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(145deg, rgba(10,29,49,.9), rgba(4,14,27,.9));
  box-shadow: 0 22px 65px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.025); backdrop-filter: blur(12px);
}
.workflow-center::before {
  content: ""; position: absolute; top: -1px; left: 22px; width: 90px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent); box-shadow: 0 0 12px rgba(82,229,255,.35);
}
.workflow-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 7px; }
.workflow-summary > div { padding: 11px 12px; border: 1px solid rgba(100,196,235,.11); border-radius: 10px; background: rgba(4,16,29,.55); }
.workflow-summary span { display: block; color: var(--muted); font-size: 8px; }
.workflow-summary strong { display: block; margin-top: 4px; overflow: hidden; color: #effaff; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-sync { min-height: 16px; margin: 0 0 12px; color: #6f899d; font-size: 8px; }
.work-system-block { margin-bottom: 12px; }
.work-family-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work-family-card { padding: 11px; border: 1px solid rgba(82,229,255,.14); border-radius: 9px; background: linear-gradient(140deg, rgba(15,41,61,.64), rgba(6,22,39,.6)); }
.work-family-card strong { font-size: 10px; }
.work-family-card p { margin-top: 5px; color: #91a9b9; font-size: 8px; line-height: 1.5; }
.work-family-card small { display: block; margin-top: 6px; color: #65b7cb; font-size: 7px; line-height: 1.45; }
.work-family-card .work-family-dependency { color: #82dbbd; }
.work-command-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin-top: 8px; }
.work-command-card { min-width: 0; padding: 9px; border: 1px solid rgba(124,159,188,.1); border-radius: 8px; background: rgba(8,25,40,.55); }
.work-command-card code { display: inline-block; margin-right: 6px; padding: 3px 6px; border-radius: 5px; color: #061c28; background: var(--cyan); font-size: 9px; font-weight: 900; }
.work-command-card strong { font-size: 9px; }
.work-command-card p { margin-top: 6px; color: #8da4b5; font-size: 8px; line-height: 1.45; }
.work-command-card small { display: block; margin-top: 6px; color: #5f7a8e; font-size: 7px; line-height: 1.4; overflow-wrap: anywhere; }
.work-system-lower { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.work-system-label { display: block; margin: 0 0 5px 2px; color: #617d90; font-size: 7px; letter-spacing: .05em; }
.performance-baselines, .work-order-list { display: grid; gap: 5px; }
.performance-baseline, .work-order-record { padding: 8px 9px; border: 1px solid rgba(124,159,188,.09); border-radius: 7px; background: rgba(7,27,44,.54); }
.performance-baseline { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; }
.performance-baseline strong, .work-order-record strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.performance-baseline span { color: #ff9aa3; font-size: 8px; }
.performance-baseline.pass span { color: #6ee1b0; }
.performance-baseline small, .work-order-record small { grid-column: 1 / -1; color: #607a8e; font-size: 7px; line-height: 1.4; }
.work-order-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 8px; cursor: pointer; list-style-position: outside; }
.work-order-summary::marker { color: #65b7cb; }
.work-order-record p { color: #8da4b5; font-size: 8px; }
.work-order-timing { display: grid; gap: 4px; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(124,159,188,.09); }
.work-stage-timing { display: grid; grid-template-columns: minmax(105px,.45fr) minmax(0,1fr); gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 5px; background: rgba(3,15,27,.44); }
.work-stage-timing small { grid-column: auto; overflow-wrap: anywhere; }
.work-stage-timing.slow strong { color: #ff9aa3; }
.work-order-record.slow { border-color: rgba(255,113,132,.22); }
.workflow-center-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .7fr); align-items: start; gap: 12px; }
.workflow-primary, .workflow-side { display: grid; gap: 12px; min-width: 0; }
.workflow-block, .workflow-tools { min-width: 0; border: 1px solid rgba(103,203,245,.13); border-radius: 12px; background: rgba(3,13,25,.54); box-shadow: inset 0 1px rgba(255,255,255,.018); }
.workflow-block { padding: 14px; }
.workflow-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.workflow-block-head small { display: block; color: #607b8f; font-size: 7px; letter-spacing: .06em; }
.workflow-block-head h3 { margin: 3px 0 0; font-size: 13px; }
.workflow-block-head > span { padding: 4px 7px; border-radius: 999px; color: #8ccdda; background: rgba(82,229,255,.07); font-size: 7px; white-space: nowrap; }
.agent-directory { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.agent-card { min-width: 0; padding: 10px; border: 1px solid rgba(124,159,188,.12); border-radius: 9px; background: linear-gradient(140deg, rgba(15,41,61,.64), rgba(6,22,39,.6)); }
.agent-card.offline { opacity: .6; }
.agent-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.agent-card-command { color: var(--cyan); font-size: 12px; font-weight: 850; }
.agent-card-state { display: inline-flex; align-items: center; gap: 4px; color: #69dfad; font-size: 7px; }
.agent-card-state::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.agent-card.offline .agent-card-state { color: #708696; }
.agent-card strong { display: block; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.agent-card p { min-height: 27px; margin-top: 5px; color: #8da4b5; font-size: 8px; line-height: 1.45; }
.agent-card small { display: block; margin-top: 6px; color: #587286; font-size: 7px; }
.workflow-version-control { display: grid; gap: 4px; color: #7891a4; font-size: 7px; }
.workflow-version-control select, .agent-message-form select, .agent-message-form textarea {
  width: 100%; border: 1px solid rgba(82,229,255,.2); border-radius: 8px; outline: none; color: #e9f8ff; background: rgba(3,14,27,.82); font: 9px/1.4 inherit;
}
.workflow-version-control select, .agent-message-form select { padding: 7px 9px; }
.workflow-stages { display: grid; gap: 6px; }
.workflow-stage { display: grid; grid-template-columns: 28px minmax(150px,.8fr) minmax(220px,1.2fr) minmax(180px,1fr); align-items: start; gap: 8px; padding: 9px; border: 1px solid rgba(104,198,235,.09); border-radius: 8px; background: rgba(7,27,44,.56); }
.workflow-stage-index { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #07202a; background: var(--cyan); font-size: 8px; font-weight: 900; }
.workflow-stage strong { display: block; font-size: 9px; }
.workflow-stage small, .workflow-stage p { color: var(--muted); font-size: 7px; line-height: 1.45; overflow-wrap: anywhere; }
.workflow-stage p b { color: #b6d2df; font-weight: 760; }
.agent-message-form { display: grid; gap: 9px; }
.agent-message-form label { display: grid; gap: 5px; color: #8ba1b2; font-size: 8px; }
.agent-message-form textarea { min-height: 88px; max-height: 180px; resize: vertical; padding: 9px; }
.agent-message-status { min-height: 16px; color: #71899c; font-size: 8px; line-height: 1.45; }
.agent-message-status.success { color: #69dfad; }
.agent-message-status.error { color: #ff8e99; }
.agent-message-list { display: grid; gap: 6px; max-height: 386px; overflow-y: auto; }
.message-record { padding: 8px 9px; border: 1px solid rgba(124,159,188,.1); border-radius: 8px; background: rgba(10,29,44,.55); }
.message-record-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.message-record strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.message-state { flex: 0 0 auto; padding: 3px 6px; border-radius: 999px; color: #9eb4c3; background: rgba(124,159,188,.09); font-size: 7px; }
.message-state.complete, .message-state.accepted { color: #6ee1b0; background: rgba(69,230,168,.09); }
.message-state.progress { color: var(--cyan); background: rgba(82,229,255,.08); }
.message-state.failed { color: #ff8f99; background: rgba(255,113,132,.09); }
.message-record p { margin-top: 5px; color: #8da4b5; font-size: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.message-record small { display: block; margin-top: 5px; color: #587185; font-size: 7px; }
.workflow-lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.workflow-change-list, .experiment-list { display: grid; gap: 6px; }
.workflow-change, .experiment-record { padding: 9px; border: 1px solid rgba(124,159,188,.1); border-radius: 8px; background: rgba(8,25,40,.55); }
.workflow-change strong, .experiment-record strong { display: block; font-size: 9px; }
.workflow-change p, .experiment-record p { margin-top: 5px; color: #8da4b5; font-size: 8px; line-height: 1.45; }
.workflow-change small, .experiment-record small { display: block; margin-top: 5px; color: #5e788a; font-size: 7px; }
.workflow-tools { margin-top: 12px; padding: 0; }
.workflow-tools summary { padding: 11px 13px; color: #9bb2c2; cursor: pointer; font-size: 9px; }
.tool-directory { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 0 13px 13px; }
.tool-record { min-width: 0; padding: 9px; border: 1px solid rgba(124,159,188,.09); border-radius: 8px; color: #9db4c3; background: rgba(12,34,51,.58); font-size: 8px; }
.tool-record-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-record-head strong { color: #e8f7ff; font-size: 9px; }
.tool-status { flex: 0 0 auto; max-width: 48%; padding: 3px 6px; border-radius: 999px; color: #82dbbd; background: rgba(69,230,168,.08); font-size: 7px; text-align: right; }
.tool-record small { display: block; margin-top: 3px; color: #587184; font-size: 7px; }
.tool-record > p, .tool-contract p { margin-top: 6px; color: #91a9b9; font-size: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.tool-record b, .training-module b { color: #bfd7e3; }
.tool-record-details { margin-top: 6px; border-top: 1px solid rgba(124,159,188,.08); }
.tool-record-details summary { padding: 6px 0 0; color: #65b7cb; font-size: 7px; }
.tool-contract { padding: 2px 0 3px; }
.tool-doc-link { display: inline-block; margin-top: 6px; color: var(--cyan); font-size: 8px; }
.workflow-training { margin-top: 12px; }
.training-policy { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.training-policy-card { padding: 10px; border: 1px solid rgba(124,159,188,.1); border-radius: 8px; background: rgba(8,25,40,.55); }
.training-policy-card strong { font-size: 9px; }
.training-policy-card p { margin-top: 5px; color: #8da4b5; font-size: 8px; line-height: 1.5; }
.training-policy-card small { display: block; margin-top: 6px; color: #65b7cb; font-size: 7px; line-height: 1.45; }
.training-modules { display: grid; gap: 6px; margin-top: 8px; }
.training-module { border: 1px solid rgba(124,159,188,.1); border-radius: 8px; background: rgba(7,27,44,.56); }
.training-module > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; cursor: pointer; }
.training-module > summary strong, .training-module > summary small { display: block; }
.training-module > summary strong { color: #e9f8ff; font-size: 9px; }
.training-module > summary small { margin-top: 3px; color: #678195; font-size: 7px; }
.training-mode { max-width: 42%; color: #82dbbd; font-size: 7px; text-align: right; }
.training-module-body { padding: 0 10px 10px; border-top: 1px solid rgba(124,159,188,.08); }
.training-module-body p { margin-top: 7px; color: #8da4b5; font-size: 8px; line-height: 1.5; }
.training-materials { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 8px; color: #8da4b5; font-size: 8px; }
.training-materials a { color: var(--cyan); }
.training-materials span { color: #82dbbd; }
.workflow-empty { padding: 16px; border: 1px dashed rgba(124,159,188,.15); border-radius: 8px; color: #6f8799; text-align: center; font-size: 8px; }

@media (max-width: 1320px) {
  .console-shell { grid-template-columns: 1fr; gap: 14px; }
  .view-nav {
    top: 6px; min-height: 0; flex-direction: row; gap: 5px; padding: 5px; overflow-x: auto;
    border-radius: 12px; background: rgba(4,14,27,.92);
  }
  .nav-label, .nav-foot { display: none; }
  .view-nav button { flex: 1 0 auto; width: auto; min-width: 116px; padding: 10px 14px; text-align: center; }
  .view-nav button::before { display: none; }
  .view-nav button.active { box-shadow: inset 0 -2px var(--cyan), inset 0 1px rgba(255,255,255,.03); }
  .overview-workspace { grid-template-columns: minmax(0, 1fr) 300px; }
  .machine-workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .overview { grid-template-columns: repeat(4, 1fr); }
  .overview > * { border-right: 1px solid var(--line); }
  .overview > *:nth-child(1) { grid-column: span 3; }
  .overview > *:nth-child(2), .overview > *:last-child { border-right: 0; }
  .overview > *:nth-child(n+3) { margin-top: 14px; padding-top: 15px; border-top: 1px solid var(--line); }
  .node-grid { grid-template-columns: 1fr 1fr; }
  .node:last-child { grid-column: span 2; }
  .chat-grid { grid-template-columns: 1fr; }
  .project-overview { grid-template-columns: repeat(3, 1fr); }
  .project-overview p { grid-column: span 3; border-top: 1px solid var(--line); }
  .project-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .project-step { grid-template-columns: 28px minmax(100px,.7fr) 1fr; }
  .step-time { display: none; }
  .agent-directory { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .small-flow-groups { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .overview-workspace { grid-template-columns: 1fr; }
  .overview-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .overview-sidebar .dispatch-panel { grid-row: span 2; }
  .overview-sidebar .alert-panel, .overview-sidebar .dispatch-panel, .overview-sidebar .activity-panel { margin-bottom: 0; }
  .machine-workspace { grid-template-columns: 1fr; }
  .machine-workspace .chat-panel { position: static; }
  .chat-grid.single .chat-messages { height: 280px; }
  .workflow-center-grid { grid-template-columns: 1fr; }
  .workflow-side { grid-template-columns: 1fr 1fr; }
  .work-command-list { grid-template-columns: 1fr 1fr; }
  .director-evidence-grid { grid-template-columns: 1fr; }
  .director-evidence-card { min-height: 0; }
  .director-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 5px; }
  .director-rail-button:nth-child(4)::before { display: none; }
  .small-flow-groups { grid-template-columns: 1fr 1fr; }
  .small-flow-contract-grid, .small-flow-run-evidence { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { width: min(100% - 24px, 1480px); padding-top: 18px; }
  .topbar, .section-head { align-items: flex-start; }
  .topbar { flex-direction: column; }
  .view-nav { top: 0; }
  .top-actions { width: 100%; justify-content: space-between; }
  .overview { grid-template-columns: 1fr 1fr; padding: 15px; }
  .overview > *:nth-child(1) { grid-column: span 2; border-right: 0; }
  .overview > *:nth-child(2) { grid-column: span 2; border-top: 1px solid var(--line); margin-top: 10px; }
  .overview > * { padding: 12px; }
  .overview > *:nth-child(4), .overview > *:nth-child(6) { border-right: 0; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline-panel .section-head { display: grid; }
  .pipeline-project-control { width: 100%; grid-template-columns: 70px minmax(0, 1fr); }
  .pipeline-project-control small { text-align: left; }
  .stage:nth-child(n) { grid-column: auto; grid-row: auto; }
  .stage:nth-child(n):not(:last-child)::after { content: "⌄"; top: auto; right: 50%; bottom: -12px; left: auto; }
  .node-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr 1fr; }
  .overview-metrics { grid-template-columns: 1fr 1fr; }
  .alert-list { grid-template-columns: 1fr; }
  .alert-item { grid-template-columns: 88px minmax(0, 1fr); }
  .node:last-child { grid-column: auto; }
  .legend, .section-head > p { display: none; }
  .project-layout { grid-template-columns: 1fr; }
  .project-list { max-height: 280px; }
  .project-overview { grid-template-columns: 1fr 1fr; }
  .project-overview p { grid-column: span 2; }
  .project-overview > div:nth-child(2) { border-right: 0; }
  .task-strip { grid-template-columns: 1fr 1fr; }
  .director-empty-shell { padding: 20px 10px; }
  .director-empty-flow { grid-template-columns: 1fr; }
  .director-empty-step { min-height: 60px; grid-template-columns: 30px 1fr; place-items: center start; text-align: left; }
  .director-empty-step:not(:last-child)::after { content: "⌄"; top: auto; right: 50%; bottom: -13px; }
  .director-focus-top { flex-wrap: wrap; }
  .director-rail { grid-template-columns: 1fr 1fr; }
  .director-rail-button:nth-child(2n)::before { display: none; }
  .director-return { order: 4; width: 100%; }
  .director-decision { grid-template-columns: 1fr; }
  .small-flow-board-head, .small-flow-panel-head, .small-flow-control-head { align-items: flex-start; flex-direction: column; }
  .small-flow-board-head span, .small-flow-control-head small { max-width: none; text-align: left; }
  .small-flow-groups, .small-flow-form { grid-template-columns: 1fr; }
  .small-flow-field.wide { grid-column: auto; }
  .small-flow-actions { flex-direction: column; }
  .small-flow-actions button { width: 100%; }
  .project-step { grid-template-columns: 28px 1fr; }
  .step-evidence { grid-column: 2; }
  .review-layout { grid-template-columns: 1fr; min-height: auto; }
  .review-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 180px; }
  .review-thumb img { height: 70px; }
  .review-viewer { min-height: 280px; }
  .workflow-summary { grid-template-columns: 1fr 1fr; }
  .agent-directory, .workflow-side, .workflow-lower-grid, .tool-directory, .training-policy, .work-family-list, .work-system-lower, .work-command-list { grid-template-columns: 1fr; }
  .workflow-stage { grid-template-columns: 28px 1fr; }
  .workflow-stage > :nth-child(n+3) { grid-column: 2; }
}
  .overview-sidebar { grid-template-columns: 1fr; }
  .overview-sidebar .dispatch-panel { grid-row: auto; }
