.action-bar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.action-bar-inner {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 8px 0;
}
.control-row, .source-row, .step-controls, .filter-row, .title-row, .report-actions, .prompt-toolbar, .dialog-actions, .modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.control-row { width: 100%; }
.control-row .select-label { flex: 1 1 240px; max-width: 360px; min-width: 0; }
.select-label, .stack-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.masthead {
  background: var(--navy);
  color: #f7f9fc;
  padding: 12px 0 0;
}
.masthead a { color: #d7e4ff; }
.masthead .eyebrow, .masthead .brand-line, .aside-kicker { color: #b7e3a8; }
.masthead h1 { color: #f7f9fc; font-size: 34px; line-height: 1.12; margin: 0 0 4px; }
.masthead .subtitle, .masthead .source-label { color: #d5e2f7; }
.subtitle, .source-label, .brand-line { margin: 0 0 4px; }
.source-label, .brand-line { font-size: 13px; }
.back-link { margin: 0 0 8px; font-size: 13px; }
.mast-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.mast-copy { grid-column: span 8; min-width: 0; }
.mast-aside {
  grid-column: span 4;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-card);
  padding: 12px 14px;
}
.aside-kicker {
  margin: 8px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mast-aside .aside-kicker:first-child { margin-top: 0; }
.aside-value { margin: 0 0 4px; font-size: 14px; line-height: 1.35; }
.mast-aside .meter { margin: 6px 0 2px; background: rgba(255, 255, 255, 0.16); }
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.metric-strip div { min-width: 0; }
.metric-strip dt {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c5d4ef;
}
.metric-strip dd { margin: 4px 0 0; font-size: 14px; color: #fff; }
.tablist {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 8px 0 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  color: #f7f9fc;
  background: transparent;
  border: 0;
  border-radius: 6px 6px 0 0;
  min-height: 40px;
  padding: 8px 12px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.tab.is-selected { background: var(--bg); color: var(--navy); }
.messages { padding-top: 12px; }
.block-grid {
  width: min(var(--app-max), calc(100% - 48px));
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.block { min-width: 0; display: flex; }
.block > .panel, .block > article { flex: 1; width: 100%; }
.span-full { grid-column: span 12; }
.span-half { grid-column: span 6; }
.block-grid > .block.span-half:first-child { grid-column: span 8; }
.block-grid > .block.span-half:nth-child(2) { grid-column: span 4; }
.panel, .tools-card, .notice, .error-box, .info-card, .snapshot, .workspace {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.status-panel { padding-bottom: 8px; }
.panel-dark {
  background: var(--navy);
  color: #f7f9fc;
  border-color: var(--navy-ink);
}
.panel-dark .eyebrow { color: #b7e3a8; }
.panel-dark .body, .panel-dark .body-large { color: #f7f9fc; max-width: none; }
.panel-note { background: #f7f8fb; }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 16px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 12px;
  background: #fbfcfe;
  min-width: 0;
}
.kpi h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kpi p { margin: 0; font-size: 15px; line-height: 1.35; }
.timeline-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(112px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.phase-node {
  font: inherit;
  text-align: left;
  color: var(--text);
  background: transparent;
  border-style: solid;
  border-width: 3px 0 0;
  border-color: var(--line);
  border-radius: 0;
  min-height: 0;
  padding: 10px 10px 4px 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.phase-node.state-complete { border-color: var(--green); }
.phase-node.state-current { border-color: var(--navy); background: #e7eefc; border-radius: 0 0 6px 6px; padding-left: 8px; }
.phase-node.state-risk { border-color: #a16207; background: var(--amber-bg); }
.phase-node.state-blocked { border-color: var(--danger); background: #fde8e6; }
.phase-node.state-future { border-color: #c5ceda; }
.phase-kicker { font-size: 12px; color: var(--muted); }
.phase-node strong { font-size: 14px; line-height: 1.3; }
.phase-exit, .note, .empty-note { color: var(--muted); font-size: 13px; }
.phase-exit {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.phase-layout, .explorer {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 12px;
}
.phase-nav, .explorer-choices { display: flex; flex-direction: column; gap: 6px; }
.phase-select, .explorer-choice, .info-card {
  text-align: left;
  font: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 10px;
  color: var(--text);
  cursor: pointer;
}
.phase-select { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-height: 0; }
.phase-select.is-selected, .explorer-choice.is-selected { border-color: var(--navy); box-shadow: inset 3px 0 0 var(--green-bright); }
.phase-detail h3, .item-list h3, .report-sheet h3 { margin-top: 16px; }
.refs, .glossary, .field-row { margin: 8px 0; }
.refs div, .glossary div, .field-row { margin: 0 0 8px; }
.refs dt, .glossary dt { font-weight: 650; }
.refs dd, .glossary dd { margin: 0; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-list label, .check-row { display: flex; gap: 8px; align-items: flex-start; }
.check-copy { display: flex; flex-direction: column; }
.check-detail { color: var(--muted); font-size: 14px; }
.flow { margin: 10px 0; }
.flow-steps, .pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill, .tone-green, .tone-lime, .tone-blue, .tone-amber, .tone-red, .tone-neutral, .tone-navy, .tone-ink, .tone-ember, .tone-muted {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}
.tone-solid { color: #fff; }
.tone-green, .tone-lime { background: var(--green-soft); }
.tone-blue { background: #e7eefc; }
.tone-amber, .tone-ember { background: #fff4d6; }
.tone-red { background: #fde8e6; }
.tone-navy, .tone-ink { background: #e8eef8; }
.tone-solid.tone-green, .tone-solid.tone-lime { background: var(--green); color: #fff; }
.tone-solid.tone-red { background: var(--danger); color: #fff; }
.tone-solid.tone-navy, .tone-solid.tone-ink { background: var(--navy); color: #fff; }
.notice { border-color: #b7d7b2; background: #f3faf2; margin-bottom: 12px; }
.error-box, .form-alert { border: 1px solid #e7b7b2; background: #fff6f5; border-radius: var(--radius-card); color: var(--danger); padding: 12px 14px; margin: 12px 0; }
.draft-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff4d6;
  color: #6b4a00;
  border: 1px solid #e6d3a1;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 4px 10px;
}
.planned-note { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.workspace { margin-top: 8px; }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(260px, 4fr) minmax(0, 8fr);
  gap: 24px;
}
.workspace-actions h2, .workspace-library h2 { font-size: 18px; }
.action-row { padding: 14px 0; border-top: 1px solid var(--line); }
.action-row:first-of-type { border-top: 0; padding-top: 0; }
.action-row h3 { font-size: 15px; margin-bottom: 4px; }
.action-row p { margin: 0 0 10px; color: var(--muted); font-size: 14px; max-width: 42ch; }
.library-list, .draft-list ul { list-style: none; margin: 0; padding: 0; }
.library-list li, .draft-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.drop-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.drop-hint.is-active {
  position: fixed;
  inset: 16px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--navy);
  border-radius: var(--radius-card);
  background: rgba(244, 246, 249, 0.94);
  color: var(--navy);
  font-size: 18px;
  font-weight: 650;
}
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}
.more-panel .button-quiet, .more-panel .button-danger { width: 100%; justify-content: flex-start; }
.fact-grid, .compact-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 12px 0;
}
.fact-grid div { min-width: 0; }
.fact-grid dt { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.fact-grid dd { margin: 2px 0 0; }
.prompt-list, .update-list { display: flex; flex-direction: column; gap: 12px; }
.prompt-card, .update-entry, .report-sheet {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  background: #fff;
}
.prompt-head, .update-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.prompt-head h3, .update-head h3 { margin: 0; font-size: 17px; }
.prompt-body {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 360px;
  margin: 12px 0 0;
  padding: 12px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 13px;
  line-height: 1.45;
}
.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr);
  gap: 12px;
  margin: 8px 0 12px;
  align-items: end;
}
.update-section { margin-top: 10px; }
.update-section ul { margin: 4px 0 0; padding-left: 18px; }
.update-summary { margin: 8px 0; font-size: 15px; }
.report-sheet { margin-top: 12px; }
.report-actions { margin: 8px 0; }
dialog.modal {
  width: min(900px, calc(100% - 32px));
  max-height: min(92vh, 960px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 0;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 26, 46, 0.12);
}
dialog.modal::backdrop { background: rgba(7, 30, 78, 0.48); }
.modal-frame { display: flex; flex-direction: column; max-height: min(92vh, 960px); }
.modal-header, .modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
}
.modal-header { border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 22px; margin: 0; }
.modal-footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.modal-steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fb;
}
.modal-steps li {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 2px;
}
.modal-steps li.is-current { color: var(--navy); box-shadow: inset 0 -2px 0 var(--green-bright); }
.modal-steps li.is-done { color: var(--green); }
.modal-body { padding: 16px 20px 20px; overflow: auto; }
.source-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 16px;
}
.source-card {
  font: inherit;
  text-align: left;
  min-height: 88px;
  padding: 12px;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  cursor: pointer;
}
.source-card strong { font-size: 14px; }
.source-card span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.source-card.is-selected { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.preview, .json-editor {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 220px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px;
  font-size: 13px;
}
.json-editor { width: 100%; min-height: 220px; max-height: 320px; }
.project-footer { width: min(var(--app-max), calc(100% - 48px)); margin: 16px auto 8px; color: var(--muted); font-size: 13px; }
.callout { border-left: 3px solid var(--green-bright); padding-left: 10px; }
.banner-draft { font-weight: 650; }
.update-grid {
  display: grid;
  grid-template-columns: 180px 220px;
  gap: 12px;
  margin-bottom: 12px;
}
.list-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.list-editor {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  margin: 0;
  padding: 10px 12px 12px;
}
.list-editor legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.list-row { display: flex; gap: 8px; margin-bottom: 8px; }
.list-row .field { flex: 1; }
.body-large { font-size: 18px; line-height: 1.4; }
.card-block, .card-grid, .info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.step-count, .step-text { margin: 8px 0; }
.dot {
  width: 10px;
  height: 10px;
  min-height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
}
.dot.is-selected { background: var(--navy); }
.filter.is-selected { background: #e8eef8; }
@media (max-width: 1024px) {
  .metric-strip, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .mast-copy, .mast-aside { grid-column: span 12; }
  .workspace-grid, .list-columns, .update-grid, .filter-bar, .fact-grid { grid-template-columns: 1fr; }
  .block-grid > .block.span-half,
  .block-grid > .block.span-half:first-child,
  .block-grid > .block.span-half:nth-child(2) { grid-column: span 12; }
  .phase-layout, .explorer { grid-template-columns: 1fr; }
  .timeline-rail { grid-auto-flow: row; grid-auto-columns: auto; }
  .phase-node { border-width: 0 0 0 3px; border-radius: 0; padding: 8px 8px 12px 12px; }
}
@media (max-width: 768px) {
  .block-grid, .project-footer { width: min(var(--app-max), calc(100% - 32px)); }
  .modal-steps { flex-wrap: wrap; }
  .control-row { display: grid; grid-template-columns: 1fr 1fr; }
  .control-row .select-label, .control-row .more { grid-column: 1 / -1; max-width: none; }
  .control-row > .button, .control-row > .button-secondary, .control-row > .button-quiet, .control-row .more > summary { width: 100%; }
}
@media (max-width: 375px) {
  .masthead h1 { font-size: 28px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
}
