:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --ink: #172025;
  --muted: #61707a;
  --line: #d7e0e5;
  --accent: #126a72;
  --accent-2: #1f8a70;
  --blue: #2563eb;
  --yellow: #b7791f;
  --red: #c2413b;
  --green: #15803d;
  --shadow: 0 18px 45px rgba(19, 35, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button, select { font: inherit; }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #152127; color: #f7fafb; padding: 20px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: #e5f4ef; color: #12343b; font-weight: 800; font-size: 13px; }
.brand strong, .brand span { display: block; }
.brand span { color: #a9b8be; font-size: 12px; margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav-item { color: #bdc9ce; text-decoration: none; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 8px; font-size: 14px; }
.nav-item.active, .nav-item:hover { background: #223239; color: #fff; }
.nav-icon { width: 22px; height: 22px; border-radius: 6px; background: #31444c; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; gap: 8px; color: #b8c6cb; font-size: 13px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.09); }
.dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; background: #87949a; }
.dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(21,128,61,.18); }
.main { padding: 24px; display: grid; gap: 18px; align-content: start; }
.topbar, .pane-header, .status-strip, .activity-pane, .primary-pane, .review-pane { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.topbar { border-radius: 8px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.15; letter-spacing: 0; }
h2 { font-size: 16px; line-height: 1.25; letter-spacing: 0; }
h3 { font-size: 15px; line-height: 1.25; letter-spacing: 0; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.top-actions { display: flex; align-items: end; gap: 10px; }
.select-label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
select, .icon-button { height: 38px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 12px; }
.icon-button { cursor: pointer; font-weight: 700; }
.icon-button:hover { border-color: var(--accent); color: var(--accent); }
.status-strip { border-radius: 8px; padding: 12px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.status-tile { background: var(--surface-2); border: 1px solid #dfe7ea; border-radius: 8px; padding: 12px; display: grid; gap: 4px; position: relative; min-height: 70px; }
.status-tile > span { width: 9px; height: 9px; border-radius: 99px; position: absolute; right: 12px; top: 12px; background: #a4b1b7; }
.status-tile.good > span { background: var(--green); box-shadow: 0 0 0 4px rgba(21,128,61,.14); }
.status-tile strong { font-size: 13px; }
.status-tile small { color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.primary-pane, .review-pane, .activity-pane { border-radius: 8px; overflow: hidden; }
.pane-header { padding: 16px; display: flex; justify-content: space-between; align-items: center; box-shadow: none; border-width: 0 0 1px 0; border-radius: 0; }
.pane-header.compact { padding-bottom: 12px; }
.sync-label { color: var(--muted); font-size: 12px; }
.project-list { display: grid; gap: 14px; padding: 16px; }
.project-block { border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; overflow: hidden; }
.project-head { padding: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: start; border-bottom: 1px solid var(--line); }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.project-meta.tight { margin-top: 0; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; height: 24px; border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 700; background: #edf2f4; color: #43535b; }
.pill.green { background: #e8f6ee; color: var(--green); }
.pill.blue { background: #eaf1ff; color: var(--blue); }
.pill.yellow { background: #fff6dd; color: var(--yellow); }
.pill.red { background: #ffeded; color: var(--red); }
.workstream-list-header { padding: 10px 14px; background: #eef4f6; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.section-label { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.subsection-title { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.workstream { padding: 14px; display: grid; gap: 12px; border-bottom: 1px solid var(--line); background: #f8fbfc; }
.workstream:last-child { border-bottom: 0; }
.workstream-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.owner { color: var(--muted); font-size: 12px; margin-top: 5px; }
.pipeline-grid { display: grid; gap: 10px; }
.pipeline { border: 1px solid #dce5e8; background: #fff; border-radius: 8px; padding: 12px; display: grid; gap: 12px; }
.pipeline-top { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.pipeline-step { color: var(--muted); font-size: 12px; margin-top: 4px; }
.progress { height: 6px; border-radius: 999px; background: #e7eef1; overflow: hidden; }
.progress span { display: block; height: 100%; width: var(--value, 0%); background: var(--accent); border-radius: inherit; transition: width .25s ease; }
.node-lane { display: grid; grid-template-columns: repeat(var(--nodes, 5), minmax(82px, 1fr)); gap: 8px; }
.node { border: 1px solid var(--line); border-radius: 8px; min-height: 66px; padding: 9px; display: grid; align-content: center; gap: 6px; background: #f6f9fa; position: relative; }
.node:before { content: ""; width: 10px; height: 10px; border-radius: 999px; background: #aab7bd; box-shadow: 0 0 0 4px rgba(130,145,152,.12); }
.node strong { font-size: 12px; line-height: 1.2; }
.node small { color: var(--muted); font-size: 11px; }
.node.queued:before { background: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
.node.running { border-color: rgba(31,138,112,.45); background: #f0fbf7; }
.node.running:before { background: var(--accent-2); box-shadow: 0 0 0 5px rgba(31,138,112,.18); animation: pulse 1.4s infinite; }
.node.waiting:before { background: var(--yellow); box-shadow: 0 0 0 4px rgba(183,121,31,.15); }
.node.failed:before { background: var(--red); box-shadow: 0 0 0 4px rgba(194,65,59,.14); }
.node.done:before { background: var(--green); box-shadow: 0 0 0 4px rgba(21,128,61,.14); }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.28); opacity: .72; } }
.review-pane { display: grid; gap: 0; }
.review-list { padding: 14px; display: grid; gap: 10px; }
.review-item { border: 1px solid var(--line); border-radius: 8px; padding: 11px; display: grid; gap: 7px; background: #fbfcfd; }
.review-item strong { font-size: 13px; }
.review-item span { color: var(--muted); font-size: 12px; }
.decision-box { margin: 0 14px 14px; padding: 14px; border-radius: 8px; background: #ecf7f4; border: 1px solid #cde8df; display: grid; gap: 7px; }
.decision-box span { color: #39555b; font-size: 12px; line-height: 1.45; }
.activity-pane { padding-bottom: 4px; }
.activity-log { display: grid; padding: 0 16px 16px; }
.activity-row { display: grid; grid-template-columns: 132px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.activity-row time { color: var(--muted); font-size: 12px; }
.empty, .error { padding: 18px; color: var(--muted); }
.error { color: var(--red); }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: repeat(2, 1fr); }
  .topbar { align-items: stretch; flex-direction: column; }
  .top-actions { justify-content: space-between; }
  .node-lane { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
