:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f9f8ff;
  --text: #16182a;
  --muted: #6f7287;
  --line: #e7e8f0;
  --blue: #2563eb;
  --purple: #7c3aed;
  --purple-soft: #f2edff;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --success: #027a48;
  --success-soft: #ecfdf3;
  --shadow: 0 14px 35px rgba(27, 31, 59, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

button, input { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: linear-gradient(180deg, #17172a 0%, #201942 100%);
  color: white;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 36px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  box-shadow: 0 10px 30px rgba(98, 76, 255, 0.35);
}

.brand-name { font-weight: 750; letter-spacing: -0.02em; }
.brand-sub { color: #aca9c6; font-size: 12px; margin-top: 2px; }

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #bdbbd0;
  text-align: left;
  padding: 11px 13px;
  border-radius: 11px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: white;
  background: rgba(255,255,255,0.09);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px 2px;
  border-top: 1px solid rgba(255,255,255,0.11);
  color: #bdbbd0;
  font-size: 13px;
}

.small-label {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #817f9b;
  margin-bottom: 7px;
}

.env-row { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 12px rgba(74,222,128,.6);
}

.docs-link {
  color: #cac8df;
  display: inline-block;
  margin-top: 13px;
  text-decoration: none;
}

.main {
  width: min(1400px, 100%);
  padding: 42px 48px 80px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-start;
  margin-bottom: 34px;
}

.eyebrow {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  color: var(--purple);
  margin-bottom: 8px;
}

h1, h2, p { margin-top: 0; }
h1 { font-size: 40px; letter-spacing: -0.045em; margin-bottom: 8px; }
h2 { font-size: 25px; letter-spacing: -0.03em; margin-bottom: 7px; }
.subtitle, .hint { color: var(--muted); }

.status-wrap { display: flex; align-items: center; gap: 10px; }

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
}

.status-loading { background: #f0f1f5; color: #626578; }
.status-ok { background: var(--success-soft); color: var(--success); }
.status-error { background: var(--danger-soft); color: var(--danger); }

.secondary-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
}

.secondary-button:hover { border-color: #c9cad7; }

.section { margin-top: 34px; scroll-margin-top: 20px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 4px 14px rgba(27, 31, 59, 0.025);
}

.metric-card.accent {
  background: linear-gradient(140deg, #ffffff 0%, #f5f1ff 100%);
  border-color: #ded2ff;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.metric-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 10px 0 3px;
}

.metric-note { color: #999bad; font-size: 12px; }

.ai-panel {
  margin-top: 16px;
  padding: 24px;
  border-radius: var(--radius);
  color: white;
  background:
    radial-gradient(circle at 90% 10%, rgba(124,58,237,.55), transparent 30%),
    linear-gradient(115deg, #172554 0%, #312e81 45%, #4c1d95 100%);
  box-shadow: var(--shadow);
}

.ai-panel {
  display: grid;
  grid-template-columns: 1fr minmax(340px, .8fr);
  gap: 35px;
  align-items: center;
}

.ai-panel .eyebrow { color: #c4b5fd; }
.ai-panel p { color: #d8d8e8; margin-bottom: 0; line-height: 1.55; }

.ai-input-row { display: flex; gap: 8px; }
.ai-input-row input {
  width: 100%;
  background: rgba(255,255,255,.1);
  color: #d6d6e7;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 11px;
  padding: 12px 13px;
}
.ai-input-row button {
  border: 0;
  border-radius: 11px;
  padding: 0 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 13px;
}

.section-heading h2 { margin-bottom: 0; }

.stack { display: grid; gap: 11px; }

.attention-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--purple);
  border-radius: 14px;
  padding: 18px 20px;
}

.attention-card.danger { border-left-color: #ef4444; }

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.card-title { font-weight: 750; margin-bottom: 5px; }
.card-summary { color: var(--muted); line-height: 1.45; }
.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 650;
  background: #f1f2f6;
  color: #65687b;
}
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
/* S18: Unknown is its own chip (grey, dashed): it never reads like a No or a known state. */
.chip.tri-unknown { background: #f6f7f9; color: #4f5566; border: 1px dashed #9aa0ad; }

.table-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #8a8d9f;
  background: #fbfbfd;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }

.subject-cell { font-weight: 650; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }

.empty-state {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.empty-title { color: var(--text); font-weight: 700; margin-bottom: 5px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { grid-template-columns: repeat(5, 1fr); }
  .sidebar-footer { display: none; }
  .main { padding: 30px 22px 60px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ai-panel { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .topbar { flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .nav { grid-template-columns: 1fr 1fr; }
  .table-card { overflow-x: auto; }
}


/* 10.16 Mission Control operational review workflow */

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

.case-toolbar input,
.case-toolbar select,
.action-card input,
.action-card select,
.action-card textarea {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text);
}
.auth-warning {
  margin-top: 12px;
  color: #9d9ab6;
  line-height: 1.4;
  font-size: 11px;
}

.case-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.case-toolbar input,
.case-toolbar select { min-height: 38px; }
.case-toolbar input { width: 210px; }

.identity-banner {
  margin-bottom: 12px;
  border: 1px solid #f4d69a;
  background: #fff9e8;
  color: #765516;
  padding: 10px 13px;
  border-radius: 11px;
  font-size: 12px;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr);
  gap: 14px;
  align-items: start;
}

.case-list-panel,
.case-detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.case-list-panel {
  max-height: 850px;
  overflow-y: auto;
}
.case-detail-panel {
  min-height: 430px;
}

.case-list {
  display: grid;
}
.case-list-item {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: white;
  text-align: left;
  padding: 15px 16px;
  cursor: pointer;
}
.case-list-item:hover { background: #fafafe; }
.case-list-item.selected {
  background: var(--purple-soft);
  box-shadow: inset 3px 0 0 var(--purple);
}
.case-list-item:last-child { border-bottom: 0; }
.case-list-top {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.case-list-title {
  font-weight: 750;
  font-size: 13px;
  line-height: 1.35;
}
.case-list-summary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}
.case-list-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #9698a8;
  font-size: 10px;
  margin-top: 9px;
}

.case-detail-header {
  padding: 22px 23px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.case-detail-header h3 {
  margin: 0 0 7px;
  font-size: 22px;
  letter-spacing: -0.025em;
}
.case-detail-header p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}
.case-status-stack {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-grid {
  padding: 15px 23px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: #fbfbfd;
  border-bottom: 1px solid var(--line);
}
.detail-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
}
.detail-label {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.detail-value {
  font-weight: 700;
  margin-top: 5px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-section {
  padding: 19px 23px;
  border-bottom: 1px solid var(--line);
}
.detail-section:last-child { border-bottom: 0; }
.detail-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
}
.detail-section details {
  margin-top: 8px;
}
.detail-section summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #595c70;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 12px;
}
.context-grid > div {
  padding: 10px 11px;
  background: #fafafe;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.context-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
}
.context-grid strong { font-size: 12px; }

.required-action {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-left: 3px solid var(--purple);
  background: #faf8ff;
  margin-bottom: 8px;
  border-radius: 7px;
}
.required-action strong { font-size: 12px; }
.required-action span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.json-block,
.brief-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 320px;
  overflow: auto;
  background: #151724;
  color: #e9eaf2;
  border-radius: 9px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.45;
}

.action-zone { background: #fcfbff; }
.action-warning {
  font-size: 11px;
  line-height: 1.45;
  color: #765516;
  background: #fff9e8;
  border: 1px solid #f4d69a;
  border-radius: 9px;
  padding: 9px 11px;
  margin-bottom: 11px;
}
.action-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  background: white;
  margin-top: 10px;
}
.action-card h5 {
  margin: 0;
  font-size: 12px;
}
.action-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.action-card textarea { resize: vertical; }
.specialist-card {
  border-color: #d9cffb;
  background: #fdfcff;
}
.verify-card {
  border-color: #f0c7c4;
  background: #fffdfd;
}

.primary-button,
.danger-button {
  border: 0;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
  width: fit-content;
}
.primary-button {
  background: var(--purple);
  color: white;
}
.danger-button {
  background: #b42318;
  color: white;
}
.primary-button:hover,
.danger-button:hover { filter: brightness(.96); }

.closed-panel {
  background: var(--success-soft);
  color: var(--success);
}

.timeline {
  display: grid;
  gap: 0;
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 9px;
  padding-bottom: 15px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: -2px;
  width: 1px;
  background: var(--line);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 3px;
  background: var(--purple);
  border: 3px solid #eee9ff;
  position: relative;
  z-index: 1;
}
.timeline-title {
  font-weight: 700;
  font-size: 12px;
}
.timeline-meta {
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.chip.amber { background: #fff4df; color: #95650c; }
.chip.green { background: var(--success-soft); color: var(--success); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
  background: #1b1c29;
  color: white;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-size: 12px;
  z-index: 30;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.error { background: #8f1f16; }
.toast.warn { background: #8a5b09; }

@media (max-width: 1100px) {
  .case-layout { grid-template-columns: 1fr; }
  .case-list-panel { max-height: 420px; }
  .status-wrap { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 700px) {
  .detail-grid,
  .context-grid { grid-template-columns: 1fr; }
  .case-toolbar { justify-content: stretch; }
  .case-toolbar > * { width: 100% !important; }
}
/* 10.16a human context layer */
.case-toolbar { grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); }
.case-toolbar #caseSearch { min-width: 280px; }
.case-production-group { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 14px; background: var(--panel); }
.case-production-header { display:flex; justify-content:space-between; gap:14px; padding:13px 14px; border-bottom:1px solid var(--border); background:rgba(255,255,255,.025); }
.case-production-title { font-weight:700; line-height:1.35; }
.case-production-meta { margin-top:4px; color:var(--muted); font-size:12px; }
.issue-count { flex:0 0 auto; font-size:12px; color:var(--muted); white-space:nowrap; }
.case-production-group .case-list-item { border:0; border-bottom:1px solid var(--border); border-radius:0; margin:0; }
.case-production-group .case-list-item:last-child { border-bottom:0; }
.case-human-issue { margin-top:7px; font-size:15px; font-weight:650; color:var(--accent); }
.fixture-list { display:grid; gap:8px; }
.fixture-row { display:grid; grid-template-columns:minmax(80px,110px) 1fr; gap:12px; padding:9px 0; border-bottom:1px solid var(--border); }
.fixture-row:last-child { border-bottom:0; }
.audit-grid { display:grid; gap:8px; margin-top:10px; }
.audit-grid>div { display:grid; grid-template-columns:90px minmax(0,1fr); gap:10px; }
.audit-grid span { color:var(--muted); }
.audit-grid code { overflow-wrap:anywhere; font-size:11px; }
@media(max-width:900px){.case-toolbar{grid-template-columns:1fr 1fr}.case-toolbar #caseSearch,.case-toolbar #syncCasesButton{grid-column:1/-1}}


/* 10.16b — production overview / deterministic prioritisation */
.production-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.production-toolbar select,
.production-toolbar input {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  min-width: 140px;
}
.production-toolbar input { min-width: 250px; }

.production-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 12px;
}
.production-summary > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
}
.production-summary strong {
  display: block;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.production-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.production-board {
  display: grid;
  gap: 10px;
}
.production-row {
  display: grid;
  grid-template-columns: minmax(280px, 2.1fr) minmax(90px, .55fr) minmax(120px, .75fr) minmax(170px, 1fr) minmax(260px, 1.6fr);
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid #d9dbe5;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(27,31,59,.025);
}
.production-row.attention-blocked { border-left-color: var(--danger); }
.production-row.attention-gap { border-left-color: #dc6803; }
.production-row.attention-confirmation_required { border-left-color: #7c3aed; }
.production-row.attention-review { border-left-color: #667085; }
.production-row.attention-clear { border-left-color: var(--success); }

.production-main,
.production-stat,
.production-action {
  padding: 15px 16px;
}
.production-stat,
.production-action {
  border-left: 1px solid var(--line);
}
.production-row-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.production-row-title {
  font-weight: 760;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.production-row-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.4;
}
.production-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.production-stat strong {
  font-size: 14px;
}
.production-stat span,
.production-action > span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: 4px;
}
.production-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}
.production-action strong {
  font-size: 13px;
  line-height: 1.4;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 0 0;
  text-align: left;
  width: fit-content;
}
.text-button:hover { text-decoration: underline; }

@media (max-width: 1180px) {
  .production-row {
    grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(100px, .7fr));
  }
  .production-action {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 800px) {
  .production-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-row { grid-template-columns: 1fr; }
  .production-stat,
  .production-action {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .production-action { grid-column: auto; }
}


/* 10.16c — consolidated production workspace */
.hidden { display: none !important; }

.production-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
}
.compact-button {
  padding: 7px 10px;
  font-size: 12px;
}

.production-workspace-section {
  scroll-margin-top: 18px;
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.workspace-header h2 {
  margin: 4px 0 5px;
}
.workspace-subtitle {
  color: var(--muted);
  font-size: 13px;
}
.workspace-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.workspace-summary-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
}
.workspace-summary-card span,
.workspace-summary-card small {
  display: block;
  color: var(--muted);
}
.workspace-summary-card span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.workspace-summary-card strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 15px;
}
.workspace-summary-card small {
  font-size: 11px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.workspace-span-2 { grid-column: 1 / -1; }
.workspace-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  min-width: 0;
}
.workspace-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 12px;
}
.workspace-panel-heading h3 {
  margin: 0;
  font-size: 15px;
}
.workspace-panel-heading > span {
  color: var(--muted);
  font-size: 11px;
}

.workspace-fixtures {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}
.workspace-fixture {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.workspace-fixture:last-child { border-bottom: 0; }

.workspace-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.workspace-plan-grid > div {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
}
.workspace-plan-grid span,
.workspace-kv span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.workspace-plan-grid strong,
.workspace-kv strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.workspace-action-list,
.workspace-result-list {
  display: grid;
  gap: 8px;
}
.workspace-action-row,
.workspace-result-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.workspace-action-row:last-child,
.workspace-result-row:last-child {
  border-bottom: 0;
}
.workspace-action-row > div,
.workspace-result-row > div {
  min-width: 0;
}
.workspace-action-row strong,
.workspace-result-row strong {
  display: block;
  font-size: 13px;
}
.workspace-action-row span,
.workspace-result-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.workspace-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.workspace-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.workspace-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.workspace-issue-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.workspace-issue-list > div {
  border-left: 3px solid var(--danger);
  padding: 7px 9px;
  background: rgba(220, 38, 38, .04);
  border-radius: 5px;
  font-size: 12px;
}
.workspace-discrepancy {
  display: grid;
  gap: 2px;
}
.workspace-discrepancy.severity-warning {
  border-left-color: #b8860b;
  background: #fff8e6;
}
.workspace-discrepancy small {
  color: var(--muted);
}
.workspace-inline-note {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}
.workspace-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}
.workspace-brief {
  max-height: 420px;
  overflow: auto;
}
.workspace-case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.workspace-case-card {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}
.workspace-case-card:hover {
  border-color: var(--purple);
}
.workspace-case-card span {
  display: block;
  font-weight: 700;
}
.workspace-case-card small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.workspace-audit {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: var(--surface);
}
.workspace-audit summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}

@media (max-width: 1000px) {
  .workspace-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .workspace-header { flex-direction: column; }
  .workspace-header-actions { justify-content: flex-start; }
  .workspace-summary-grid,
  .workspace-grid,
  .workspace-case-grid { grid-template-columns: 1fr; }
  .workspace-span-2 { grid-column: auto; }
  .workspace-plan-grid { grid-template-columns: 1fr; }
}

/* Live feed ages (10.17d) */
.feed-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.feed-chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border, #d7d9e0); background: var(--surface, #fff); color: var(--muted, #555); }
.feed-chip.feed-ok { border-color: #b7e0c4; background: #eef9f1; color: #1f6b3a; }
.feed-chip.feed-stale { border-color: #f0c2c2; background: #fdeeee; color: #8a1f1f; }


/* 10.17e prepared actions */
.change-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 8px 0; }
.change-table th, .change-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #e3e4ea); vertical-align: top; }
.change-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #666); }
.change-table td.before { color: #8a1f1f; text-decoration: line-through; white-space: pre-wrap; }
.change-table td.after { color: #1f6b3a; font-weight: 600; white-space: pre-wrap; }
.change-table td.col { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted, #666); }
.reasoning-list { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.reasoning-list li { margin-bottom: 4px; }
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.impact-card { border: 1px solid var(--border, #e3e4ea); border-radius: 10px; padding: 10px 12px; background: var(--surface, #fff); }
.impact-card span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #666); }
.impact-card strong { display: block; font-size: 13px; margin: 4px 0; }
.impact-card small { display: block; font-size: 12px; color: var(--muted, #666); }
.follow-up { border: 1px dashed var(--border, #d7d9e0); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.follow-up strong { display: block; font-size: 13px; }
.follow-up .draft { white-space: pre-wrap; background: #f6f7fb; border-radius: 8px; padding: 8px; font-size: 12px; margin: 6px 0; }
.follow-up .follow-up-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.follow-up .follow-up-row select, .follow-up .follow-up-row input { flex: 1; min-width: 120px; }
.action-decision-row { display: flex; gap: 12px; flex-wrap: wrap; }
.action-decision-row .action-card { flex: 1; min-width: 260px; }
.chip.applied, .chip.ready { background: var(--success-soft, #e6f6ea); color: var(--success, #1f6b3a); }
.chip.proposed { background: #e9efff; color: #2b4ba8; }
.chip.needs_information, .chip.apply_failed { background: #fff4df; color: #95650c; }
.chip.denied, .chip.superseded_by_staff_edit, .chip.overtaken_by_staff_edit { background: var(--danger-soft, #fdeeee); color: var(--danger, #8a1f1f); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 10px 0; }
.report-grid div { border: 1px solid var(--border, #e3e4ea); border-radius: 10px; padding: 10px; }
.report-grid span { display: block; font-size: 11px; color: var(--muted, #666); text-transform: uppercase; }
.report-grid strong { font-size: 20px; }

/* daily queue (10.17f) */
.queue-summary { display: grid; gap: 4px; margin: 8px 0 12px; padding: 10px 12px; border-radius: 10px; background: rgba(127, 127, 127, 0.08); }
.queue-summary-meta { font-size: 12px; opacity: 0.8; }
.queue-summary button { justify-self: start; margin-top: 4px; }
.queue-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }

/* 16 Sep 2026: league feeds table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th, .data-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(127, 127, 127, 0.25); vertical-align: top; }
.data-table th { font-weight: 600; opacity: 0.8; }

/* ---------------------------------------------------------------------------
   v0.11.0 (milestone 1): sign-in card, who-is-signed-in in the header, Accounts card.
   --------------------------------------------------------------------------- */
.sign-in-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--purple-soft) 100%);
}
.sign-in-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}
.sign-in-brand { margin-bottom: 22px; color: var(--text); }
.sign-in-brand .brand-mark { background: var(--purple); color: white; }
.sign-in-brand .brand-sub { color: var(--muted); }
.auth-form h2 { margin: 0 0 14px; font-size: 20px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-size: 13px; font-weight: 650; }
.auth-field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-weight: 400;
  background: var(--surface-soft);
}
.auth-field input:focus { outline: 2px solid var(--purple); outline-offset: 1px; }
.auth-rules { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.auth-message { font-size: 13px; line-height: 1.45; padding: 9px 11px; border-radius: 9px; margin-bottom: 12px; }
.auth-message.info { background: #fff9e8; color: #765516; border: 1px solid #f4d69a; }
.auth-message.error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3c2bd; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.link-button { border: 0; background: none; color: var(--purple); cursor: pointer; padding: 6px 0; font-weight: 600; }
.link-button:hover { text-decoration: underline; }

.session-wrap { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.session-name { font-weight: 650; font-size: 13px; }

.accounts-table th, .accounts-table td { vertical-align: middle; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.account-actions select { border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; background: white; }
.account-role-change { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.primary-button.small, .danger-button.small, .secondary-button.small { padding: 5px 9px; font-size: 12px; }

/* v0.11.4 cards: a card whose source was refused or failed, its reason, and the Workers list. */
.metric-value.metric-withheld { font-size: 20px; color: var(--muted, #555); letter-spacing: 0; }
.metric-state { color: #8a5a00; font-size: 12px; margin-top: 2px; }
.worker-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.worker-item .feed-chip { display: inline-block; font-size: 11px; padding: 2px 8px; }
.source-blocked .empty-copy { color: #8a5a00; }
