:root {
  color-scheme: light;
  --bg: #f3f5f6;
  --panel: #ffffff;
  --line: #d5dadd;
  --ink: #1f2328;
  --muted: #5c6670;
  --accent: #0b6b57;
  --accent-2: #0e4b7a;
  --warn: #8a5a00;
  --danger: #9f2d2d;
  --soft: #e8f3ef;
  --soft-warn: #f8efdf;
  --soft-danger: #f7e8e8;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent-2); text-decoration-thickness: 1px; }
button, input, textarea, select { font: inherit; border-radius: 8px; }
button { cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 10px 14px; font-weight: 700; }
button.secondary { background: #fff; color: var(--accent); }
button.ghost { background: transparent; color: var(--accent-2); border-color: var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 10px 12px; }
textarea { min-height: 92px; resize: vertical; }
.wrap { width: min(1440px, calc(100% - 32px)); margin: 0 auto; }
.auth-shell, .app-shell { min-height: 100vh; }
.auth-shell { display: grid; place-items: center; padding: 32px 0; }
.auth-card, .panel, .metric, .board-card, .list-card, .hero { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.auth-card { width: min(560px, 100%); padding: 24px; display: grid; gap: 16px; }
.brand { display: grid; gap: 8px; }
.brand h1 { margin: 0; font-size: 32px; }
.brand-hero { grid-template-columns: 120px 1fr; align-items: center; gap: 18px; }
.brand-copy { display: grid; gap: 8px; }
.brand-hero-art, .header-brand-art { display: block; width: 100%; height: auto; object-fit: contain; }
.muted { color: var(--muted); }
.field-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button.active { background: var(--accent-2); border-color: var(--accent-2); }
header { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 0 14px; align-items: center; }
.header-main { display: grid; gap: 6px; }
.header-main.with-art { grid-template-columns: 96px 1fr; align-items: center; gap: 14px; }
.header-main h1 { margin: 0; font-size: 30px; }
.header-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
main { padding: 22px 0 56px; }
.hero { padding: 18px; display: grid; gap: 12px; margin-bottom: 18px; }
.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 16px; display: grid; gap: 10px; min-height: 92px; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric .value { font-size: 30px; font-weight: 800; line-height: 1; }
.metric .value.ok { color: var(--accent); }
.metric .value.warn { color: var(--warn); }
.metric .value.critical { color: var(--danger); }
.grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: 16px; }
.panel { overflow: hidden; margin-bottom: 18px; }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-body { padding: 16px 18px; }
.issue-list, .host-list, .doc-list, .command-list, .journal-list { display: grid; gap: 10px; }
.issue, .host-row, .doc-row, .command-row, .journal-day, .board-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.issue.severity-critical { border-color: #e7b7b7; background: var(--soft-danger); }
.issue.severity-warning { border-color: #eddcb6; background: var(--soft-warn); }
.issue-head, .host-head, .row-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.badge.ok { color: var(--accent); border-color: #b7d9cf; background: var(--soft); }
.badge.warning { color: var(--warn); border-color: #ead9b7; background: var(--soft-warn); }
.badge.critical { color: var(--danger); border-color: #e5baba; background: var(--soft-danger); }
.subtle-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.kv { display: grid; gap: 4px; }
.kv span { color: var(--muted); font-size: 12px; }
.kv strong { font-size: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-shell { display: grid; gap: 16px; }
.detail-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.advice-list, .entry-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.board-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.board-card { padding: 16px; display: grid; gap: 12px; }
.board-items { display: grid; gap: 10px; min-height: 80px; }
.board-item { cursor: grab; }
.board-item.dragging { opacity: .5; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; }
pre.code { margin: 0; background: #f6f8f9; border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12px; }
.chat-shell { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.chat-sidebar, .chat-main { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.chat-sidebar { padding: 14px; display: grid; gap: 12px; align-content: start; }
.chat-sidebar-head, .chat-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.chat-thread-list { display: grid; gap: 8px; max-height: 720px; overflow: auto; }
.chat-thread { width: 100%; text-align: left; background: #fff; color: var(--ink); border: 1px solid var(--line); padding: 12px; display: grid; gap: 6px; }
.chat-thread strong { font-size: 14px; }
.chat-thread span, .chat-thread small { color: var(--muted); display: block; }
.chat-thread.active { border-color: var(--accent-2); background: #eef5fb; }
.chat-main { padding: 16px; display: grid; gap: 14px; min-height: 720px; }
.chat-transcript { background: #f7f9fa; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 12px; overflow: auto; min-height: 420px; max-height: 720px; }
.hidden { display: none !important; }
.chat-message { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; max-width: 90%; }
.chat-message.user { margin-left: auto; background: #eef6f2; border-color: #c9dfd4; }
.chat-message.assistant { background: #f8fbff; border-color: #d3e3f3; }
.chat-message.system { background: #f4f7fb; border-color: #d7e2ef; }
.chat-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.chat-chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-chip { display: inline-flex; align-items: center; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12px; }
.chat-chip.status-claimed,
.chat-chip.status-pending { background: #fff7dc; border-color: #e4c56a; color: #6f5200; }
.chat-chip.status-resolved,
.chat-chip.status-completed,
.chat-chip.status-approved,
.chat-chip.status-sent { background: #eef6f2; border-color: #c9dfd4; color: #28503c; }
.chat-chip.status-denied,
.chat-chip.status-rejected,
.chat-chip.status-escalated,
.chat-chip.status-failed { background: #fceeee; border-color: #e6b7b7; color: #7f2f2f; }
.chat-progress-note { margin: -2px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.focused-item { border-color: #2b6cb0 !important; box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.18); background: #f7fbff; }
.chat-body { white-space: pre-wrap; line-height: 1.45; user-select: text; }
.chat-attachments { display: grid; gap: 10px; margin-top: 10px; }
.chat-attachments.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.attachment-block { display: grid; gap: 12px; margin-top: 10px; }
.chat-attachment-group { display: grid; gap: 8px; }
.proof-review-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.attachment-review-note { font-size: 12px; color: var(--muted); }
.attachment-review-note.status-approved { color: #28503c; }
.attachment-review-note.status-rejected { color: #7f2f2f; }
.chat-attachment-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(255,255,255,0.72); display: grid; gap: 8px; }
.chat-attachment-image-button { display: block; padding: 0; border: 0; background: transparent; text-align: left; cursor: zoom-in; }
.chat-attachment-image { display: block; max-width: 100%; max-height: 420px; border-radius: 6px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.chat-attachment-image.compact { max-height: 160px; width: 100%; }
.chat-attachment-file { font-weight: 600; }
.lightbox-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.72); display: grid; place-items: center; padding: 24px; z-index: 1400; }
.lightbox-card { width: min(1100px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.lightbox-image { display: block; width: 100%; height: auto; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.chat-composer { display: grid; gap: 10px; }
.chat-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chat-scope-warning { border: 1px solid #e4c56a; background: #fff7dc; color: #6f5200; border-radius: 8px; padding: 10px 12px; line-height: 1.4; }
.chat-advanced { border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; padding: 10px 12px; }
.chat-advanced summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}
.toast.ok { border-color: #b7d9cf; background: var(--soft); color: #28503c; }
.toast.error { border-color: #e6b7b7; background: #fceeee; color: #7f2f2f; }
.suite-map-hero { grid-template-columns: 1fr auto; align-items: center; }
.suite-map-hero h2 { margin: 0 0 6px; }
.suite-map-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.suite-map-meta span { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 5px 9px; color: var(--muted); font-size: 12px; }
.suite-map-panel { background: #e8edf0; }
.suite-map-controls { background: #fff; align-items: center; }
.suite-map-viewport { height: min(68vh, 760px); min-height: 560px; overflow: hidden; background: #edf1f3; }
.suite-roadmap-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.suite-roadmap-svg:active { cursor: grabbing; }
.suite-lane-backdrop { fill: #fff; stroke: #cfd7dc; stroke-width: 1.5; }
.suite-lane-accent { fill: var(--lane-color); }
.suite-lane-name { fill: #17212b; font-size: 21px; font-weight: 800; }
.suite-lane-subtitle { fill: #58656f; font-size: 12px; }
.suite-lane-status { fill: var(--lane-color); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.suite-rail { fill: none; stroke: #c2cbd1; stroke-width: 8; stroke-linecap: round; }
.suite-rail-segment { fill: none; stroke-width: 8; stroke-linecap: round; }
.suite-rail-segment.progressed { stroke: var(--lane-color); opacity: .72; }
.suite-rail-segment.planned { stroke: #c2cbd1; stroke-dasharray: 12 11; }
.suite-stage-shape { stroke-width: 4; vector-effect: non-scaling-stroke; }
.suite-stage.status-complete .suite-stage-shape { fill: var(--lane-color); stroke: #fff; }
.suite-stage.status-current .suite-stage-shape { fill: #fff; stroke: var(--lane-color); stroke-width: 6; }
.suite-stage.status-next .suite-stage-shape { fill: #fff; stroke: var(--lane-color); stroke-dasharray: 4 4; }
.suite-stage.status-later .suite-stage-shape { fill: #eef2f4; stroke: #aeb9c0; }
.suite-stage.status-blocked .suite-stage-shape { fill: #fce8e8; stroke: var(--danger); }
.suite-stage-label { fill: #28343d; font-size: 12px; font-weight: 700; }
.suite-stage-decision-pin circle { fill: #f59e0b; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.suite-stage-decision-pin text { fill: #472c00; font-size: 12px; font-weight: 900; }
.suite-finish-pole { fill: none; stroke: #64727c; stroke-width: 4; stroke-linecap: round; }
.suite-stage.status-complete .suite-finish-pole,
.suite-stage.status-current .suite-finish-pole { stroke: var(--lane-color); }
.suite-branch path { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.suite-branch text { fill: #65727c; font-size: 10px; font-weight: 650; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.suite-branch.status-complete path { stroke: var(--lane-color); opacity: .62; }
.suite-branch.status-current path { stroke: var(--lane-color); stroke-dasharray: 8 5; }
.suite-branch.status-next path,
.suite-branch.status-later path { stroke: #aeb9c0; stroke-dasharray: 6 7; }
.suite-current-marker line { stroke: var(--lane-color); stroke-width: 3; vector-effect: non-scaling-stroke; }
.suite-current-marker circle { fill: rgba(255,255,255,.9); stroke: var(--lane-color); stroke-width: 5; vector-effect: non-scaling-stroke; }
.suite-current-marker rect { fill: var(--lane-color); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.suite-current-marker text { fill: #fff; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.suite-current-marker.checkpoint { opacity: .78; }
.suite-current-marker.active circle { animation: suite-pulse 1.8s ease-in-out infinite; }
@keyframes suite-pulse {
  0%, 100% { stroke-width: 4; opacity: 1; }
  50% { stroke-width: 10; opacity: .58; }
}
.suite-map-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; }
.suite-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot, .legend-pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #64727c; background: #fff; }
.legend-dot.complete { background: var(--accent); border-color: var(--accent); }
.legend-dot.current { border-width: 4px; border-color: var(--accent-2); }
.legend-dot.next { border-color: var(--accent-2); border-style: dashed; }
.legend-dot.later { background: #eef2f4; border-color: #aeb9c0; }
.legend-pulse { border: 4px solid #7c3aed; box-shadow: 0 0 0 4px rgba(124,58,237,.15); }
.suite-live-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.suite-live-card { border: 1px solid var(--line); border-top: 5px solid var(--lane-color); border-radius: 8px; background: #fff; padding: 14px; display: grid; gap: 10px; }
.suite-live-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.suite-live-task { min-height: 42px; padding: 9px 10px; border-radius: 7px; background: #f4f6f7; color: var(--muted); line-height: 1.4; }
.suite-live-task.active { background: color-mix(in srgb, var(--lane-color) 10%, white); color: var(--ink); font-weight: 650; }
.suite-project-detail { display: grid; gap: 18px; }
.suite-detail-heading { display: grid; grid-template-columns: minmax(0, .8fr) minmax(280px, 1.2fr); gap: 20px; align-items: start; }
.suite-detail-heading h2 { margin: 4px 0 0; }
.suite-stage-history { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.suite-stage-card, .suite-workstream-card { border: 1px solid var(--line); border-left: 5px solid #aeb9c0; border-radius: 8px; padding: 12px; background: #fff; display: grid; gap: 8px; }
.suite-stage-card.status-complete { border-left-color: var(--accent); }
.suite-stage-card.status-current { border-left-color: #f59e0b; background: #fffaf0; }
.suite-stage-card.status-next { border-left-color: var(--accent-2); }
.suite-stage-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.suite-stage-card-head span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.suite-stage-card p, .suite-workstream-card p { margin: 0; line-height: 1.42; }
.suite-date-row, .suite-workstream-dates { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.suite-workstream-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.suite-workstream-card.status-checkpointed { border-left-color: #0e7490; }
.suite-workstream-card.status-active { border-left-color: #f59e0b; background: #fffaf0; }
.suite-workstream-card small { color: var(--muted); line-height: 1.35; }
.suite-decision-link { justify-self: start; background: #f59e0b; color: #2f1f00; border-color: #d98900; }
.suite-decision-link:hover { background: #e99000; }
.suite-decision-hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.suite-decision-hero h2 { margin: 4px 0 6px; }
.suite-decision-intro { display: grid; gap: 10px; }
.suite-decision-intro p { margin: 0; line-height: 1.5; }
.suite-pinned-gates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.suite-pinned-gates span { border-radius: 999px; padding: 5px 9px; background: #fff7dc; border: 1px solid #e4c56a; color: #6f5200; font-size: 12px; font-weight: 700; }
.suite-decision-form { display: grid; gap: 16px; }
.suite-decision-group { display: grid; gap: 12px; }
.suite-decision-group > h3 { margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.suite-question { margin: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px; display: grid; gap: 10px; }
.suite-question legend { padding: 0 6px; font-size: 16px; font-weight: 800; }
.suite-question > p { margin: 0; }
.suite-choice-list { display: grid; gap: 8px; }
.suite-choice { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 11px; cursor: pointer; }
.suite-choice:has(input:checked) { border-color: var(--accent-2); background: #edf6ff; box-shadow: 0 0 0 1px var(--accent-2); }
.suite-choice.recommended { border-left: 5px solid #16a34a; }
.suite-choice input { margin-top: 4px; }
.suite-choice span { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.suite-choice span b { color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 7px; font-size: 10px; text-transform: uppercase; }
.suite-choice span small { grid-column: 1 / -1; color: var(--muted); line-height: 1.4; }
.suite-answer-note textarea { min-height: 64px; }
.suite-submission-history { display: grid; gap: 8px; }
.suite-submission-history details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.suite-submission-history summary { cursor: pointer; font-weight: 750; }
.suite-submission-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.suite-submission-answers p { line-height: 1.4; }
@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid, .board-grid, .two-col, .chat-shell { grid-template-columns: 1fr; }
  .suite-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suite-stage-history { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suite-workstream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { grid-template-columns: 1fr; }
  .header-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 20px, 100%); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner { grid-template-columns: 1fr; }
  .brand-hero,
  .header-main.with-art { grid-template-columns: 1fr; }
  .brand-hero-art,
  .header-brand-art { max-width: 120px; }
  .subtle-grid { grid-template-columns: 1fr 1fr; }
  .chat-main { min-height: 0; }
  .chat-transcript { min-height: 320px; }
  .chat-action-grid { grid-template-columns: 1fr; }
  .suite-map-hero { grid-template-columns: 1fr; }
  .suite-map-meta { justify-content: flex-start; }
  .suite-map-controls { align-items: start; flex-direction: column; }
  .suite-map-viewport { height: 46vh; min-height: 360px; max-height: 440px; }
  .suite-live-grid { grid-template-columns: 1fr; }
  .suite-detail-heading, .suite-decision-hero { grid-template-columns: 1fr; }
  .suite-stage-history, .suite-workstream-grid, .suite-submission-answers { grid-template-columns: 1fr; }
}
