/* Shared console palette and host/deployment workspaces. */
:root, :root[data-theme="light"] {
  --ops-panel: #fff;
  --ops-bg: #f4f3fa;
  --ops-text: #201a36;
  --ops-muted: #5c5674;
  --ops-accent: #6243c0;
  --ops-tint: #eee9fb;
  --ops-line: #ddd7ec;
  --ops-series-0: #6144c0;
  --ops-series-1: #007b70;
  --ops-series-2: #ad5b0a;
  --ops-good: #138060;
  --ops-warning: #995707;
  --ops-error: #a92d53;
}
:root[data-theme="dark"] {
  --ops-panel: #201d38;
  --ops-bg: #151328;
  --ops-text: #f5f1ff;
  --ops-muted: #c0b8db;
  --ops-accent: #bdacff;
  --ops-tint: #34284f;
  --ops-line: #443b63;
  --ops-series-0: #c1acff;
  --ops-series-1: #60ded2;
  --ops-series-2: #ffc27c;
  --ops-good: #63deb4;
  --ops-warning: #ffc27c;
  --ops-error: #ff9ebd;
}
body[data-workspace] {
  --c-bg: var(--ops-bg);
  --c-surface: var(--ops-panel);
  --c-text: var(--ops-text);
  --c-muted: var(--ops-muted);
  --c-primary: var(--ops-accent);
  --c-primary-soft: var(--ops-tint);
  --c-border: var(--ops-line);
  --c-layer: var(--ops-bg);
  --c-border-strong: color-mix(in srgb,var(--ops-line) 67%,var(--ops-accent));
}
body[data-workspace] .nx-sidebar {
  background: linear-gradient(165deg,#221b3f,#151429 55%,#1b172f);
  border-inline-end: 1px solid #41345a;
}
body[data-workspace] .nx-sidebar .nav-item.active {
  background: #473964;
  color: #fff;
  border-color: #7665a0;
}
body[data-workspace] .nx-main { background: var(--ops-bg); }
body[data-workspace] .nx-topbar, body[data-workspace] .console-section-navigation {
  background: var(--ops-panel);
  border-color: var(--ops-line);
}
body[data-workspace] .console-section-heading small { display: none; }
body[data-workspace] .console-section-heading { margin-bottom: 4px; }
body[data-workspace] .console-section-navigation { padding-top: 15px; }
body[data-workspace] .nx-brand-mark { background: #443660; color: #d5c7ff; }
body[data-workspace] .nx-footer { color: var(--ops-muted); }
body[data-workspace] .button:focus-visible, .ops-workspace select:focus-visible, .ops-workspace input:focus-visible {
  outline: 2px solid var(--ops-accent);
  outline-offset: 3px;
}
body[data-workspace] :is(.panel,.project-card,.console-card,.console-metric,.ops-surface) { border-radius: 14px; }
body[data-workspace] :is(.console-page-header,.project-heading) h1 { letter-spacing: -.045em; font-weight: 720; }
body[data-workspace] .astral-mission { background: linear-gradient(125deg,var(--ops-tint),var(--ops-panel)); }
body[data-workspace] .project-monogram { background: var(--ops-tint); color: var(--ops-accent); }
body[data-workspace] .host-directory-actions { flex-wrap: wrap; justify-content: end; }
body[data-workspace] .host-directory-item { min-width: 0; }
.ops-workspace { color: var(--ops-text); min-width: 0; grid-template-columns: minmax(0,1fr); gap: 0; }
.ops-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.ops-heading h1 { font-size: clamp(27px,3vw,38px); font-weight: 720; line-height: 1.15; margin: 0 0 10px; letter-spacing: -.045em; }
.ops-heading p, .ops-surface p { color: var(--ops-muted); margin: 0 0 10px; line-height: 1.65; font-size: 13px; }
.ops-heading p { margin-bottom: 0; }
.ops-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 20px; }
.ops-filter label, .ops-probe-form label { font-size: 13px; display: grid; gap: 6px; }
.ops-filter label { max-width: 100%; min-width: min(180px,100%); }
.ops-filter select, .ops-probe-form input, .ops-probe-form select { width: 100%; min-height: 38px; }
.ops-filter p { margin: 0; align-self: center; font-size: 13px; color: var(--ops-muted); }
.ops-filter p[data-error="true"], [data-deployment-worker][data-error="true"] { color: var(--ops-error); }
.ops-health { padding: 13px 15px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; justify-content: space-between; border: 1px solid var(--ops-line); border-radius: 10px; background: var(--ops-tint); color: var(--ops-muted); margin-bottom: 14px; font-size: 12px; }
.ops-health > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ops-health strong { color: var(--ops-text); }
.ops-status-dot { width: 9px; height: 9px; background: var(--ops-muted); border-radius: 100%; }
.ops-health[data-health="healthy"] .ops-status-dot { background: var(--ops-good); }
.ops-health[data-health="warning"] .ops-status-dot { background: var(--ops-warning); }
.ops-health:is([data-health="offline"],[data-health="revoked"]) .ops-status-dot { background: var(--ops-error); }
.ops-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.ops-metric, .ops-surface { background: var(--ops-panel); border: 1px solid var(--ops-line); color: var(--ops-text); padding: 18px; border-radius: 14px; min-width: 0; overflow-wrap: anywhere; }
.ops-metric { display: flex; flex-direction: column; gap: 6px; min-height: 108px; }
.ops-metric span, .ops-metric small { color: var(--ops-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ops-metric strong { font-size: clamp(18px,2.3vw,27px); font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.ops-surface { margin-bottom: 16px; }
.ops-surface h2, .ops-surface h3 { font-size: 16px; margin: 0 0 9px; font-weight: 700; }
.ops-chart-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.ops-chart-grid canvas { width: 100%; height: 174px; display: block; color: var(--ops-muted); }
.ops-chart-grid .ops-legend { display: flex; flex-wrap: wrap; gap: 14px; }
.ops-chart-grid .ops-legend span:before { content: ""; display: inline-block; width: 11px; height: 3px; margin: 0 5px 3px 0; background: var(--ops-series-0); }
.ops-chart-grid .ops-legend span:nth-child(2):before { background: var(--ops-series-1); }
.ops-chart-grid .ops-legend span:nth-child(3):before { background: var(--ops-series-2); }
.ops-surface .table-wrap { overflow: auto; }
.ops-surface summary { cursor: pointer; }
.ops-history { max-height: 420px; }
.ops-surface pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.ops-probe-form { display: grid; grid-template-columns: 1fr 2fr 1fr auto; align-items: end; gap: 12px; padding-block: 12px 20px; }
.ops-probe-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0; border-top: 1px solid var(--ops-line); }
.ops-probe-row p:last-child { margin-bottom: 0; }
.ops-paging, [data-acceptance-actions], .ops-workflow-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.deployment-gates { list-style: none; padding: 0; margin: 14px 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.deployment-gates li { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--ops-line); border-radius: 9px; background: var(--ops-bg); }
.deployment-gates li strong { font-size: 14px; }
.deployment-gates li span { color: var(--ops-muted); font-size: 12px; }
.deployment-gates li[data-state="done"] span { color: var(--ops-good); }
.deployment-gates li[data-state="failed"] span { color: var(--ops-error); }
.deployment-gates li[data-state="running"] span { color: var(--ops-accent); }
@media(max-width:1050px) {
  .ops-metric-grid, .deployment-gates { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:740px) {
  .ops-chart-grid { grid-template-columns: 1fr; gap: 0; }
  .ops-probe-form { grid-template-columns: 1fr 1fr; }
  .ops-surface, .ops-metric { padding: 12px; }
  body[data-workspace] .console-section-navigation { padding-inline: 16px; }
}
@media(max-width:390px) { .ops-probe-form { grid-template-columns: 1fr; } }
body[data-workspace] .login-overlay .auth-story { background: radial-gradient(ellipse at 72% 62%,#453566,#241c41 47%,#151327 84%); color: #f7f1ff; }
body[data-workspace] .login-overlay .auth-story h2 { font-weight: 700; }
body[data-workspace] .login-overlay .auth-story h2 em { color: #c7b5ff; }
@media(max-width:850px) {
  body[data-workspace] :is(.nx-shell,.nx-main,.nx-content,.console-section-navigation) { width: 100%; max-width: 100%; min-width: 0; }
  body[data-workspace] .console-section-tabs { max-width: 100%; }
  body[data-workspace] .nx-main > .nx-topbar { flex-wrap: wrap; height: auto; padding-block: 8px; }
  body[data-workspace] .nx-topbar .nx-actions { flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
  .ops-workspace { width: 100%; max-width: 100%; }
}
