:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: #11141b;
  --surface-raised: #171b24;
  --surface-hover: #1d2230;
  --border: #282e3c;
  --border-strong: #394155;
  --text: #f0f2f7;
  --text-dim: #9ba3b4;
  --accent: #7c8cff;
  --accent-strong: #465bcc;
  --accent-soft: rgba(124, 140, 255, .12);
  --green: #49c978;
  --green-soft: rgba(73, 201, 120, .1);
  --yellow: #e4b84d;
  --yellow-soft: rgba(228, 184, 77, .11);
  --red: #f06b67;
  --red-soft: rgba(240, 107, 103, .1);
  --shadow: 0 18px 48px rgba(0, 0, 0, .22);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sidebar: 244px;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% -20%, rgba(89, 109, 234, .12), transparent 32rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: #9eabff; text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid rgba(124, 140, 255, .62);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  gap: 6px;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--border);
  background: rgba(9, 11, 16, .94);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 0 10px;
  min-height: 48px;
  padding: 0 9px 8px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .14em;
}

.brand small {
  grid-column: 2;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(124, 140, 255, .5);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(124, 140, 255, .22), rgba(89, 109, 234, .06));
  color: #bcc4ff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, .08);
}

.start-work-nav {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 8px 0 12px;
  border: 1px solid #7888f2;
  border-radius: 9px;
  background: linear-gradient(180deg, #687bf0, #5368df);
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(70, 88, 204, .22);
}

.start-work-nav:hover,
.start-work-nav.active {
  filter: brightness(1.08);
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(70, 88, 204, .32);
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 520;
}

.nav:hover {
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
}
/* Active location: the blue-violet accent, a subtle wash and a left indicator
   — never text colour alone. The operator always knows where they are. */
.nav.active {
  color: #a68cf0;
  background: rgba(130, 80, 223, 0.14);
  border-left: 3px solid #8250DF;
  padding-left: 8px;
  font-weight: 640;
  text-decoration: none;
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow);
  text-align: center;
  font: 700 11px/20px var(--mono);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding: 14px 9px 2px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
}

.content-shell {
  width: calc(100% - var(--sidebar));
  min-width: 0;
  margin-left: var(--sidebar);
}

.status-bar {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 11, 16, .88);
  color: var(--text-dim);
  font-size: 12px;
  backdrop-filter: blur(18px);
}

.connection,
.freshness { display: flex; align-items: center; gap: 9px; }

.connection-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 4px rgba(155, 163, 180, .08);
}

.connection-dot.connected {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(73, 201, 120, .1);
}

.connection-dot.stale {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(228, 184, 77, .1);
}

.text-button {
  min-height: 32px;
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: #aab4ff;
  cursor: pointer;
}

.text-button:hover { color: white; text-decoration: underline; }

.main {
  width: min(1540px, 100%);
  min-height: calc(100vh - 48px);
  padding: 30px 34px 64px;
}

.page-loading {
  padding: 50px 0;
  color: var(--text-dim);
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p { margin-top: 0; }

.page-heading h1 {
  margin-bottom: 4px;
  font-size: clamp(21px, 2vw, 26px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.page-subtitle {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--text-dim);
  font-size: 13px;
}

.panel {
  margin-bottom: 16px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(23, 27, 36, .84), rgba(17, 20, 27, .9));
  box-shadow: 0 1px rgba(255, 255, 255, .02);
}

.panel > h2,
.feature-plan > h3,
.alert > h2 {
  margin-bottom: 14px;
  color: #cbd0db;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.disabled-panel { opacity: .7; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 11px;
  margin-bottom: 16px;
}

.overview-grid { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.metric-card {
  min-height: 112px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.metric-label {
  margin-bottom: 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.metric-value { font-size: 20px; font-weight: 680; letter-spacing: -.02em; }
.metric-detail { margin-top: 7px; color: var(--text-dim); font-size: 11px; }
.metric-inline { display: inline-flex; flex-direction: column; gap: 1px; }
.metric-inline small { color: var(--text-dim); font-size: 9.5px; text-transform: uppercase; }

.badge {
  display: inline-flex;
  max-width: 100%;
  min-height: 22px;
  align-items: center;
  padding: 2px 8px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.green { border-color: rgba(73, 201, 120, .34); background: var(--green-soft); color: var(--green); }
.badge.yellow { border-color: rgba(228, 184, 77, .34); background: var(--yellow-soft); color: var(--yellow); }
.badge.red { border-color: rgba(240, 107, 103, .34); background: var(--red-soft); color: var(--red); }
.badge.accent { border-color: rgba(124, 140, 255, .38); background: var(--accent-soft); color: #aeb8ff; }

.definition-list {
  display: grid;
  grid-template-columns: minmax(140px, 205px) minmax(0, 1fr);
  gap: 8px 18px;
  margin: 0;
  font-size: 13px;
}

.definition-list dt { color: var(--text-dim); }
.definition-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }

.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.data-table th {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .045em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  max-width: 330px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
  vertical-align: top;
}

.data-table tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.mono { font-family: var(--mono); font-size: 11.5px; }
.dim { color: var(--text-dim); }
.correlation { margin: 8px 0 0; color: var(--text-dim); font: 11px var(--mono); }

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn.primary { border-color: #7181ee; background: var(--accent-strong); color: white; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.subtle { border-color: transparent; background: transparent; color: var(--text-dim); }
.btn.danger { border-color: rgba(240, 107, 103, .38); color: var(--red); }
.btn[disabled] { filter: grayscale(.2); opacity: .42; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 16px; }

.alert {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.alert p:last-child { margin-bottom: 0; }
.alert.error { border-color: rgba(240, 107, 103, .35); background: var(--red-soft); }
.alert.success { border-color: rgba(73, 201, 120, .35); background: var(--green-soft); }
.alert.info { border-color: rgba(124, 140, 255, .28); background: var(--accent-soft); }
.error-box { margin: 10px 0; color: var(--red); font-size: 12px; }

.empty-state {
  padding: 24px 10px;
  color: var(--text-dim);
  text-align: center;
}

.empty-state.large {
  padding: 64px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 11px;
}

/* Start Work */
.stepper {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 0;
  margin: 0 0 18px;
  list-style: none;
}

.stepper li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 11px;
}

.stepper li:not(:last-child)::after {
  position: absolute;
  z-index: -1;
  top: 10px;
  right: 0;
  left: 26px;
  height: 1px;
  background: var(--border-strong);
  content: "";
}

.step-dot {
  display: inline-grid;
  width: 21px;
  height: 21px;
  flex: none;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
  font-size: 10px;
}

.stepper li.complete { color: var(--text); }
.stepper li.complete .step-dot { border-color: var(--green); background: var(--green-soft); color: var(--green); }

.launcher-panel { border-color: rgba(124, 140, 255, .28); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr minmax(190px, .72fr); gap: 14px; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 6px; color: #cfd3dc; font-size: 12px; font-weight: 650; }

.field input,
.field select {
  width: 100%;
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.field input:hover,
.field select:hover { border-color: #4a556f; }

.field input:disabled,
.field select:disabled { opacity: .55; }

.field-help { margin: 6px 0 0; color: var(--text-dim); font-size: 10.5px; line-height: 1.4; }

.validation-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(124, 140, 255, .25);
  border-radius: 9px;
  background: var(--accent-soft);
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, .16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.validation-error ul { margin: 8px 0 8px 20px; }
.review-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; color: var(--text-dim); }
.plan-evidence { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--border); }
.plan-evidence-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-evidence-head h3 { margin: 0; color: #cbd0db; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.plan-evidence-copy {
  max-height: 18rem;
  padding: 12px 13px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(9, 11, 16, .55);
}
.feature-plan { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.feature-plan .data-table { margin-top: 18px; }
.go-panel { margin: 22px -4px 0; border-color: rgba(228, 184, 77, .34); background: var(--yellow-soft); }
.go-semantics { font-weight: 650; }

.confirmation {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 11px;
  align-items: start;
  margin-top: 15px;
  cursor: pointer;
  line-height: 1.5;
}

.confirmation input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }

.go-button {
  min-height: 46px;
  padding-inline: 21px;
  border-color: #4fcf7f;
  background: linear-gradient(180deg, #36b967, #269852);
  color: white;
  font-weight: 750;
}

.go-receipt .definition-list { margin-top: 16px; }

/* Approvals and evidence */
.approval-list { display: grid; gap: 12px; }

.approval-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
}

.approval-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.approval-card-head > div { display: flex; align-items: center; gap: 10px; }
.approval-card-head h2 { margin: 0; font-size: 14px; }
.approval-card-head time { color: var(--text-dim); font: 11px var(--mono); white-space: nowrap; }
.approval-actions { padding-top: 4px; border-top: 1px solid var(--border); }
.evidence-copy { max-width: 100ch; white-space: pre-wrap; overflow-wrap: anywhere; }

.timeline { position: relative; padding: 0; margin: 0; list-style: none; }

.timeline li {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 12px;
  padding: 0 0 18px;
}

.timeline-marker {
  position: relative;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.timeline-marker::after {
  position: absolute;
  top: 9px;
  left: 2px;
  width: 1px;
  height: calc(100% + 28px);
  background: var(--border-strong);
  content: "";
}

.timeline li:last-child .timeline-marker::after { display: none; }
.timeline-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timeline-head time { color: var(--text-dim); font: 10.5px var(--mono); white-space: nowrap; }
.timeline-meta,
.timeline-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 5px; color: var(--text-dim); font-size: 10.5px; }
.timeline-body p { margin: 7px 0 0; color: #c7cbd5; font-size: 12px; }
.timeline-refs span { padding-right: 7px; border-right: 1px solid var(--border); font-family: var(--mono); }

.toast-region { position: fixed; z-index: 30; right: 20px; bottom: 20px; }
.toast { max-width: 380px; padding: 12px 15px; border: 1px solid var(--border-strong); border-radius: 9px; background: #202636; box-shadow: var(--shadow); }

/* Login */
.login-wrap {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 20px;
}

.login-box {
  width: min(390px, 100%);
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(17, 20, 27, .94);
  box-shadow: var(--shadow);
}

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; font-size: 12px; font-weight: 750; letter-spacing: .14em; }
.login-box h1 { margin-bottom: 4px; font-size: 20px; }
.login-box > p { margin-bottom: 21px; color: var(--text-dim); font-size: 12.5px; }
.login-box label { display: block; margin: 13px 0 5px; color: #cfd3dc; font-size: 12px; font-weight: 620; }

.login-box input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}

.login-submit { width: 100%; margin-top: 20px; }

.executive-summary { display: grid; gap: 14px; margin-bottom: 6px; }
.exec-section h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.exec-section h4 { font-size: 12px; margin-bottom: 4px; }
.exec-list { list-style: none; padding-left: 2px; display: grid; gap: 4px; font-size: 13px; }
.scope-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.execution-plan { padding-left: 20px; display: grid; gap: 8px; font-size: 13px; }
.execution-plan li::marker { color: var(--text-dim); font-weight: 700; }
.decision-banner { border: 1px solid #4b5a8a; background: color-mix(in srgb, var(--bg) 85%, #5b8cff 15%); border-radius: 10px; padding: 14px 16px; margin: 14px 0 4px; }
.decision-banner h3 { font-size: 13px; letter-spacing: .08em; margin-bottom: 6px; }
.decision-banner p { font-size: 12.5px; color: var(--text-dim); }
.live-execution { border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px 18px; margin: 14px 0; display: grid; gap: 12px; }
.live-heading { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.progress-wrap { display: inline-flex; align-items: center; gap: 8px; }
.progress-track { width: 180px; height: 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--border-strong); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #3f7d4e, #5b8cff); transition: width .6s ease; }
.execution-timeline { list-style: none; display: grid; gap: 8px; padding-left: 4px; }
.execution-timeline li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.execution-timeline .tl-dot { width: 16px; text-align: center; }
.execution-timeline li.tl-completed .tl-dot { color: #57c96f; }
.execution-timeline li.tl-running .tl-dot { color: #5b8cff; animation: pulse 1.4s ease-in-out infinite; }
.execution-timeline li.tl-failed .tl-dot { color: #ff7b7b; }
.execution-timeline .tl-label { min-width: 240px; }
.execution-timeline .tl-ts { font-size: 11.5px; }
.event-stream { list-style: none; display: grid; gap: 4px; font-size: 12.5px; max-height: 260px; overflow-y: auto; padding: 6px 8px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .execution-timeline li.tl-running .tl-dot { animation: none; } }

.role-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.role-card { border: 1px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
/* Mission Control status colours — canonical states only. */
.role-card.role-ready { border-left-color: #5b8cff; }
.role-card.role-queued, .role-card.role-disabled { border-left-color: #6a7080; }
.role-card.role-running { border-left-color: #5b8cff; border-color: #5b8cff; }
.role-card.role-completed { border-left-color: #57c96f; }
.role-card.role-waiting_for_human { border-left-color: #b48ce8; border-color: #b48ce8; }
.role-card.role-failed { border-left-color: #ff7b7b; border-color: #ff7b7b; }
.role-card.role-blocked { border-left-color: #e8a14c; }
.role-card.role-skipped { opacity: .6; }
.running-dot { width: 8px; height: 8px; border-radius: 50%; background: #5b8cff; display: inline-block; margin-right: 6px; animation: pulse 1.4s ease-in-out infinite; }
.role-status-wrap { display: inline-flex; align-items: center; }
.role-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.role-provider { font-size: 12px; color: var(--text-dim); }
.role-duty { font-size: 12.5px; margin: 0; }
.role-shared, .role-reason { font-size: 12px; color: var(--text-dim); margin: 0; }
.role-reason { color: #ff9b9b; }
.role-metrics { display: flex; gap: 12px; font-size: 11.5px; color: var(--text-dim); flex-wrap: wrap; }
.role-metrics b { font-weight: 600; color: var(--text); }
.role-evidence-list { display: grid; gap: 4px; }
.role-evidence summary { cursor: pointer; font-size: 12px; color: #8fb4ff; }
.evidence-events { list-style: none; display: grid; gap: 3px; font-size: 11.5px; padding: 6px 4px 2px; }
.evidence-events li { display: flex; gap: 8px; flex-wrap: wrap; }
.evidence-events code { font-size: 11px; color: var(--text-dim); }
.exec-mission-title { margin: 0 0 10px; font-size: 15px; }

.technical-evidence { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 10px; }
.technical-evidence > summary { cursor: pointer; font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
@media (max-width: 760px) { .scope-columns { grid-template-columns: 1fr; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(4,6,12,.72); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal-card { background: var(--panel, #12151d); border: 1px solid var(--border-strong); border-radius: 12px; padding: 22px 24px; width: min(440px, 92vw); display: grid; gap: 10px; }
.modal-card textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.btn.danger { border-color: #a13d3d; color: #ff9c9c; }

.check-list { margin: 12px 0 4px; padding-left: 4px; list-style: none; display: grid; gap: 6px; }
.check-list li { font-size: 12.5px; color: var(--text-dim); }

.workspace-context { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.workspace-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--text-dim); text-transform: uppercase; }
#workspace-switcher {
  max-width: 200px;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-size: 12.5px;
}
.workspace-info { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.mission-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 6px 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, var(--accent, #5b8cff) 12%);
  font-size: 12px;
}
.mission-strip .strip-k { color: var(--text-dim); font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.mission-strip .strip-v { color: var(--text); margin-right: 8px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .workspace-info { display: none; } }

@media (max-width: 1050px) {
  :root { --sidebar: 210px; }
  .main { padding-inline: 24px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .layout { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: max(12px, env(safe-area-inset-top)) 12px 9px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand { grid-template-columns: 30px 1fr; min-height: 38px; padding-bottom: 3px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand small { display: none; }
  .start-work-nav { min-height: 44px; margin: 7px 0; }
  .nav-list {
    display: grid;
    grid-auto-columns: max-content;
    grid-auto-flow: column;
    gap: 4px;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav { min-height: 40px; white-space: nowrap; }
  .sidebar-foot { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; border-top: 0; }
  .session-actor { display: none; }
  .content-shell { width: 100%; margin-left: 0; }
  .status-bar { position: sticky; min-height: 44px; padding: 7px 14px; }
  .freshness { gap: 5px; }
  .freshness span { display: none; }
  .main { min-height: calc(100vh - 170px); padding: 22px 14px calc(48px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: stretch; flex-direction: column; }
  .page-heading > .btn { align-self: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field:last-child { grid-column: auto; }
  .stepper { grid-template-columns: repeat(3, 1fr); row-gap: 9px; }
  .stepper li:nth-child(3)::after { display: none; }
  .definition-list { grid-template-columns: 1fr; gap: 2px; }
  .definition-list dd { margin-bottom: 9px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 104px; }
  .panel { padding: 16px; }
  .approval-card { padding: 15px; }
  .approval-card-head { flex-direction: column; gap: 7px; }
  .approval-card-head > div { align-items: flex-start; flex-direction: column; }
  .timeline-head { flex-direction: column; gap: 2px; }
  .timeline-head time { white-space: normal; }
  .toast-region { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; }
  .toast { max-width: none; }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .data-table tr { padding: 9px 0; border-bottom: 1px solid var(--border); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td {
    display: grid;
    grid-template-columns: minmax(105px, 34%) minmax(0, 1fr);
    gap: 10px;
    max-width: none;
    padding: 5px 2px;
    border: 0;
  }
  .data-table td::before {
    color: var(--text-dim);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
}

@media (max-width: 420px) {
  .metric-grid { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .stepper li:nth-child(3)::after { display: block; }
  .stepper li:nth-child(2n)::after { display: none; }
  .btn-row > .btn { flex: 1 1 auto; }
  .login-box { padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation: none; }
}

/* ── Dashboard 2.0 — Mission Control ─────────────────────────────────── */
.mission-control-grid { display: grid; grid-template-columns: 1.2fr .9fr .8fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .mission-control-grid { grid-template-columns: 1fr; } }
.mc-clock { display: grid; justify-items: center; gap: 12px; }
.mission-clock { position: relative; width: 220px; height: 220px; }
.mission-clock-ring { width: 220px; height: 220px; transform: rotate(-90deg); }
.clock-track { fill: none; stroke: var(--border-strong); stroke-width: 10; }
.clock-fill { fill: none; stroke: #5b8cff; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.clock-fill.clock-done { stroke: #57c96f; }
.clock-fill.clock-failed { stroke: #ff7b7b; }
.clock-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; }
.clock-percent { font-size: 34px; font-weight: 700; }
.clock-activity { font-size: 12.5px; max-width: 150px; }
.clock-stages { font-size: 11.5px; }
.activity-steps { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.activity-steps li { padding-left: 14px; position: relative; color: var(--text-dim); }
.activity-steps li::before { content: '\2193'; position: absolute; left: 0; opacity: .5; }
.activity-steps li:first-child::before { content: ''; }
.activity-steps li.step-completed { color: #57c96f; }
.activity-steps li.step-running { color: var(--text); font-weight: 600; }
.activity-steps li.step-failed { color: #ff7b7b; }
.mc-team .role-progress-grid { grid-template-columns: 1fr; }

/* ── Neue Klasse: Home command center ───────────────────────────────── */
.home-hero { display: grid; gap: 14px; padding: 48px 8px 34px; max-width: 640px; }
.hero-greeting { font-size: 34px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.hero-line { font-size: 17px; color: var(--text-dim); margin: 0; }
.hero-attention { color: var(--text); font-weight: 600; }
.hero-story { display: grid; gap: 4px; margin-top: 8px; }
.hero-story-title { font-size: 20px; font-weight: 600; text-decoration: none; }
.hero-cta { margin-top: 18px; width: fit-content; padding: 12px 28px; font-size: 15px; }
.quiet-facts { opacity: .92; }

/* ── Diamond Cut: boot, motion, calm ─────────────────────────────────── */
.boot-splash { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; gap: 8px; text-align: center; background: var(--bg, #0b0d12); transition: opacity .6s ease; pointer-events: none; }
.boot-splash.boot-done { opacity: 0; pointer-events: none; }
.boot-logo { font-size: 40px; font-weight: 800; letter-spacing: .28em; }
.boot-sub { font-size: 13px; letter-spacing: .14em; color: var(--text-dim); text-transform: uppercase; }
.boot-line { margin-top: 18px; font-size: 13px; color: var(--text-dim); }
main[data-enter] > * { animation: fade-in .35s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main[data-enter] > * { animation: none; } .boot-splash { transition: none; } }
.hero-actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.hero-cta-secondary { padding: 12px 22px; }

/* ── Strategic Advisor ───────────────────────────────────────────────── */
.advisor-panel { margin: 4px 0 18px; }
.advisor-open { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; font-size: 15px; }
.advisor-icon { font-size: 18px; }
.advisor-card { border: 1px solid var(--border-strong); border-radius: 14px; padding: 22px 24px; display: grid; gap: 12px; max-width: 640px; }
.advisor-label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.advisor-feature { font-size: 13px; }
.advisor-story { margin: 0; font-size: 22px; font-weight: 650; }
.advisor-story .ado-link { text-decoration: none; }
.advisor-facts { display: flex; gap: 20px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.advisor-why { list-style: none; display: grid; gap: 6px; padding: 6px 0 2px; font-size: 13.5px; color: #8fce9d; }
.advisor-thinking { color: var(--text-dim); }

.advisor-headline { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.advisor-why-line { font-size: 14px; margin: 0; }
.advisor-stories { margin: 4px 0 4px 18px; display: grid; gap: 6px; font-size: 15px; }

/* ── Strategic Advisor v2 — native Azure DevOps visual language ───────── */
.wi-glyph { flex: 0 0 auto; vertical-align: middle; }
.wi-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.wi-row > div { display: grid; }
.wi-kind { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.wi-title { font-size: 17px; font-weight: 600; }
.wi-feature .wi-title { color: #b48ce8; }
.wi-story .wi-title { color: #4aa8e0; }
.wi-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.wi-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; font-size: 14px; font-weight: 600; border-radius: 8px; }
.wi-btn-feature { background: #8250DF; border-color: #8250DF; color: #fff; }
.wi-btn-feature:hover { background: #6f3ec9; }
.wi-btn-story { background: #0078D4; border-color: #0078D4; color: #fff; }
.wi-btn-story:hover { background: #106ebe; }
.wi-btn .wi-glyph { filter: brightness(0) invert(1); }
.advisor-roadmap { margin-top: 8px; }
.advisor-roadmap summary { cursor: pointer; font-size: 13px; color: var(--text-dim); }
.advisor-roadmap .advisor-stories { list-style: none; margin: 8px 0 0; padding: 0; }
.advisor-roadmap li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.roadmap-current { font-weight: 600; }
.roadmap-future { color: var(--text-dim); }
.roadmap-tag { margin-left: auto; font-size: 11px; }
.advisor-dismiss { margin-top: 6px; background: transparent; }

/* ── Analytics sub-navigation ────────────────────────────────────────── */
.analytics-subnav { display: flex; gap: 4px; margin: 2px 0 18px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.subnav-item { padding: 6px 12px; border-radius: 7px; font-size: 13px; color: var(--text-dim); text-decoration: none; }
.subnav-item:hover { background: var(--surface-raised); color: var(--text); }
.subnav-item.active { color: #a68cf0; background: rgba(130,80,223,0.14); font-weight: 640; }
.btn.subtle { padding: 5px 12px; font-size: 12.5px; }

/* Mission completed summary — calm checkmarks, one line each on narrow. */
.mission-complete-summary { display: inline-flex; flex-wrap: wrap; gap: 4px 18px; color: var(--green, #3fb950); font-weight: 600; }
