:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-muted: #eef3f2;
  --line: #d8e0df;
  --line-strong: #b7c7c5;
  --text: #17201f;
  --muted: #60706d;
  --accent: #0f766e;
  --accent-dark: #0b5c56;
  --green: #21865b;
  --blue: #245fc5;
  --amber: #a86b12;
  --red: #b42318;
  --purple: #6b4bb7;
  --shadow: 0 16px 36px rgba(19, 30, 29, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.16;
}

h2 {
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.25;
}

p {
  line-height: 1.65;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfc;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
  white-space: nowrap;
}

.nav-item span {
  width: 28px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
}

.nav-item.is-active,
.nav-item:hover {
  border-color: #a8d5cf;
  background: #e9f7f5;
  color: var(--accent-dark);
}

.side-status {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.side-status strong {
  display: block;
  margin: 5px 0;
}

.side-status p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.section-label,
.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.doc-links {
  display: grid;
  gap: 8px;
}

.doc-links a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.main {
  min-width: 0;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.topbar-copy {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.toolbar,
.band-actions,
.board-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-button,
.primary-button,
.secondary-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.tool-button,
.secondary-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

.primary-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tool-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.status-strip {
  min-height: 68px;
  border: 1px solid #acd6d0;
  border-radius: 8px;
  background: #eaf8f6;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.status-strip strong,
.status-strip span {
  display: block;
}

.status-strip span {
  margin-top: 3px;
  color: #44615d;
}

.api-strip {
  background: #f6faf9;
  border-color: var(--line);
}

.api-strip.is-online {
  border-color: #9ed7ba;
  background: #edf8f2;
}

.api-strip.is-offline {
  border-color: #f0c68f;
  background: #fff8ed;
}

.access-strip {
  align-items: flex-start;
  background: #fff;
  border-color: var(--line);
}

.access-strip.is-authorized {
  border-color: #a7cfb8;
  background: #f1faf5;
}

.access-controls {
  min-width: min(660px, 100%);
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(120px, 1fr) minmax(100px, 0.8fr) minmax(120px, 1fr) auto auto minmax(96px, 0.8fr) auto;
  gap: 8px;
}

.access-controls input,
.access-controls button {
  width: 100%;
  min-height: 38px;
}

.access-controls input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.access-controls input:focus {
  outline: 2px solid #a8d5cf;
  outline-offset: 1px;
}

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

.metric {
  min-width: 0;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

.metric span,
.metric small {
  color: var(--muted);
}

.metric strong {
  font-size: 24px;
  line-height: 1;
}

.metric small {
  line-height: 1.45;
}

.band {
  scroll-margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 14px;
}

.band-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.band-head p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.entry-switch {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 3px;
  padding: 3px;
}

.entry-switch button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.entry-switch button.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}

.entry-panel,
.review-panel,
.confirm-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.entry-panel {
  grid-row: span 2;
}

.is-hidden {
  display: none;
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.smart-upload-list {
  display: grid;
  gap: 8px;
}

.smart-upload-empty,
.smart-file-card,
.smart-result-strip {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.smart-upload-empty {
  min-height: 76px;
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 4px;
}

.smart-upload-empty strong,
.smart-upload-empty small,
.smart-file-card strong,
.smart-file-card small {
  display: block;
}

.smart-upload-empty small,
.smart-file-card small {
  color: var(--muted);
}

.smart-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.smart-file-card {
  min-height: 68px;
  padding: 10px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.smart-file-card > span {
  width: 42px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e5f6ed;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.smart-file-card.good {
  border-color: #b6dbc9;
  background: #f5fbf8;
}

.smart-file-card.good > span {
  background: #e5f6ed;
  color: var(--green);
}

.smart-file-card.bad {
  border-color: #efa89e;
  background: #fff7f5;
}

.smart-file-card.bad > span {
  background: #fde7e3;
  color: var(--red);
}

.smart-result-strip {
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.smart-result-strip span {
  min-height: 44px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.smart-result-strip strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.memory-suggestion-panel {
  min-width: 0;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #f5fbfa;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.memory-suggestion-panel.muted {
  border-color: var(--line);
  background: #f8fbfb;
}

.memory-suggestion-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.memory-suggestion-head strong,
.memory-suggestion-head small {
  display: block;
}

.memory-suggestion-head small {
  color: var(--muted);
}

.memory-suggestion-head > span {
  min-width: 58px;
  min-height: 30px;
  border-radius: 999px;
  background: #e5f6ed;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.memory-suggestion-panel.muted .memory-suggestion-head > span {
  background: #eef2f2;
  color: var(--muted);
}

.memory-suggestion-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.memory-suggestion-metrics span {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.memory-suggestion-metrics strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.draft-group-panel {
  display: grid;
  gap: 8px;
}

.draft-group-card {
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #ead18b;
  border-radius: 8px;
  background: #fffaf0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.draft-group-card strong,
.draft-group-card small {
  display: block;
}

.draft-group-card small {
  color: #6d4d04;
}

.draft-group-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-group-action input {
  width: 74px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  font: inherit;
  font-weight: 800;
}

.draft-readiness-panel {
  min-width: 0;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #f5fbfa;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.draft-readiness-header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.draft-readiness-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.draft-readiness-header strong,
.draft-readiness-header small {
  display: block;
}

.draft-readiness-header small {
  color: var(--muted);
}

.draft-readiness-result {
  min-width: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.draft-readiness-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 56%, transparent 57%),
    conic-gradient(var(--green) calc(var(--ready) * 1%), #f2d06b 0 84%, #e77f72 0);
  display: grid;
  place-items: center;
  align-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.draft-readiness-ring strong,
.draft-readiness-ring small {
  display: block;
  line-height: 1;
}

.draft-readiness-ring strong {
  font-size: 18px;
}

.draft-readiness-ring small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.draft-readiness-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.draft-readiness-metrics span {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.draft-readiness-metrics strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.draft-readiness-metrics .ready strong {
  color: var(--green);
}

.draft-readiness-metrics .needs-fix strong {
  color: #9c6a05;
}

.draft-readiness-metrics .blocked strong {
  color: var(--red);
}

.draft-issue-list {
  display: grid;
  gap: 6px;
}

.draft-issue-card {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.draft-issue-card.blocked {
  border-color: #efa89e;
  background: #fff7f5;
}

.draft-issue-card.needs-fix {
  border-color: #ead18b;
  background: #fffaf0;
}

.draft-issue-card strong,
.draft-issue-card small {
  display: block;
}

.draft-issue-card small {
  color: var(--muted);
}

.draft-saved-state {
  min-width: 0;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.draft-saved-state.needs-fix {
  border-color: #ead18b;
  background: #fffaf0;
}

.draft-saved-state strong,
.draft-saved-state small {
  display: block;
}

.draft-saved-state small {
  color: var(--muted);
}

.draft-saved-state span {
  min-width: 68px;
  min-height: 32px;
  border-radius: 999px;
  background: #eef7f5;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.draft-saved-state.needs-fix span {
  background: #fff3d4;
  color: #9c6a05;
}

.draft-reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.draft-reference-card {
  min-width: 0;
  border: 1px solid #ead18b;
  border-radius: 8px;
  background: #fffdf7;
  padding: 8px;
}

.draft-reference-card strong,
.draft-reference-card small {
  display: block;
}

.draft-reference-card small {
  color: var(--muted);
}

.reference-resolution-panel {
  min-width: 0;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.reference-resolution-panel.needs-fix {
  border-color: #ead18b;
  background: #fffdf7;
}

.reference-resolution-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.reference-resolution-head strong,
.reference-resolution-head small {
  display: block;
}

.reference-resolution-head small {
  color: var(--muted);
}

.reference-resolution-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.reference-resolution-metrics span {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.reference-resolution-metrics strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.reference-pass-state {
  min-height: 52px;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #f5fbfa;
  display: grid;
  align-content: center;
  justify-items: center;
}

.reference-pass-state strong,
.reference-pass-state small {
  display: block;
}

.reference-pass-state small {
  color: var(--muted);
}

.reference-conflict-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reference-conflict-group {
  min-width: 0;
  border: 1px solid #ead18b;
  border-radius: 8px;
  background: #fffaf0;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.reference-conflict-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.reference-conflict-group-head span {
  min-width: 46px;
  min-height: 28px;
  border-radius: 999px;
  background: #fff3d4;
  color: #8a6005;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.reference-conflict-list {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.reference-conflict-card {
  min-width: 0;
  border: 1px solid #eedaa3;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.reference-conflict-card.duplicate {
  border-color: #d9c27f;
}

.reference-conflict-card strong,
.reference-conflict-card small {
  display: block;
}

.reference-conflict-card small {
  color: var(--muted);
}

.reference-choice-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reference-choice-row button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.reference-choice-row button.is-active {
  border-color: #0f8f7e;
  background: #e7f5f1;
  color: #0b6e61;
}

.reference-overflow {
  color: var(--muted);
}

.reference-lock-action {
  display: flex;
  justify-content: flex-end;
}

.reference-lock-state {
  min-width: 0;
  border: 1px solid #b8d6cf;
  border-radius: 8px;
  background: #f5fbfa;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.reference-lock-state.blocked {
  border-color: #efa89e;
  background: #fff7f5;
}

.reference-lock-state strong,
.reference-lock-state small {
  display: block;
}

.reference-lock-state small {
  color: var(--muted);
}

.reference-lock-state span {
  min-width: 58px;
  min-height: 30px;
  border-radius: 999px;
  background: #e5f6ed;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.reference-lock-state.blocked span {
  background: #fde7e3;
  color: var(--red);
}

.sheet-grid,
.bucket-grid,
.confirmation-list,
.workbench-grid {
  display: grid;
  gap: 8px;
}

.sheet-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sheet-card,
.bucket-card,
.confirmation-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.sheet-card {
  min-height: 108px;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.sheet-card.good,
.bucket-card.good {
  border-color: #b6dbc9;
  background: #f5fbf8;
}

.sheet-card.warn,
.bucket-card.warn {
  border-color: #e7ca7c;
  background: #fffaf0;
}

.sheet-card.bad,
.bucket-card.bad {
  border-color: #efa89e;
  background: #fff7f5;
}

.bucket-card {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.bucket-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.bucket-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e5eefb;
  color: var(--blue);
  font-weight: 900;
}

.sheet-card.good .bucket-icon,
.bucket-card.good .bucket-icon {
  background: #e5f6ed;
  color: var(--green);
}

.sheet-card.warn .bucket-icon,
.bucket-card.warn .bucket-icon {
  background: #fff0c2;
  color: var(--amber);
}

.sheet-card.bad .bucket-icon,
.bucket-card.bad .bucket-icon {
  background: #fde7e3;
  color: var(--red);
}

.sheet-card strong,
.sheet-card small,
.bucket-card strong,
.bucket-card small,
.confirmation-item strong,
.confirmation-item small {
  display: block;
}

.sheet-card small,
.bucket-card small,
.confirmation-item small,
.bucket-meta {
  color: var(--muted);
  line-height: 1.4;
}

.bucket-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}

.bucket-meta span {
  min-height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  font-weight: 800;
}

.bucket-issue {
  color: #6d4d04;
}

.advisory-chip {
  min-width: 0;
  min-height: 26px;
  border: 1px solid #b9d8f6;
  border-radius: 8px;
  background: #f3f8fd;
  color: #20425f;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  width: fit-content;
  max-width: 100%;
}

.advisory-chip span {
  width: 22px;
  height: 18px;
  border-radius: 6px;
  background: #dbeeff;
  color: #1f5f93;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}

.advisory-chip.compact {
  margin-top: 4px;
}

.confirmation-item {
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.decision-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(48px, 1fr));
  gap: 3px;
  padding: 3px;
}

.decision-group button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.decision-group button.is-active {
  border-color: #a8d5cf;
  background: #fff;
  color: var(--accent-dark);
}

.decision-group button.danger {
  border-color: #efb0a8;
  color: var(--red);
}

.confirm-footer {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.confirm-footer strong,
.confirm-footer small {
  display: block;
}

.confirm-footer small {
  margin-top: 3px;
  color: var(--muted);
}

.workbench-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workbench-band {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.workbench-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

.workbench-focus {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.workbench-toolbar {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.view-stack {
  display: grid;
  gap: 5px;
}

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

.workbench-status-card {
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

.workbench-status-card span,
.workbench-status-card small {
  color: var(--muted);
  line-height: 1.4;
}

.workbench-status-card strong {
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.12;
}

.workbench-rail {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.workbench-side-panel {
  min-height: 0;
}

.action-feedback-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.action-feedback-panel.is-accepted,
.action-feedback-panel.is-saved {
  border-left-color: var(--green);
  background: #f5fbf8;
}

.action-feedback-panel.is-rejected,
.action-feedback-panel.is-conflict {
  border-color: #efb0a8;
  border-left-color: var(--red);
  background: #fff7f5;
}

.action-feedback-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.action-feedback-main strong,
.action-feedback-main small {
  display: block;
}

.action-feedback-main small {
  color: var(--muted);
  line-height: 1.45;
}

.action-feedback-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.health-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.health-score {
  min-height: 152px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.health-score span,
.health-score small {
  color: var(--muted);
  font-weight: 800;
}

.health-score strong {
  font-size: 46px;
  line-height: 1;
}

.health-category-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.health-category {
  min-width: 0;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.health-category.good {
  border-color: #b6dbc9;
  background: #f5fbf8;
}

.health-category.warn {
  border-color: #e7ca7c;
  background: #fffaf0;
}

.health-category.bad {
  border-color: #efa89e;
  background: #fff7f5;
}

.health-category span,
.health-category small {
  color: var(--muted);
  font-weight: 800;
}

.health-category strong {
  font-size: 28px;
  line-height: 1;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.2fr) minmax(360px, 1.35fr);
  gap: 12px;
  align-items: stretch;
}

.tool-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.panel-title,
.board-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title span {
  min-height: 24px;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.template-list {
  display: grid;
  gap: 8px;
}

.template-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.template-item strong,
.template-item small {
  display: block;
}

.template-item small {
  color: var(--muted);
  line-height: 1.45;
}

.template-item button {
  width: max-content;
}

textarea {
  width: 100%;
  min-height: 262px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: #fcfdfd;
  line-height: 1.6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.legacy-text-input {
  display: none;
}

.mapping-table-wrap,
.table-scroll {
  min-width: 0;
  overflow: auto;
}

.data-table,
.timetable {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td,
.timetable th,
.timetable td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.data-table th,
.data-table td {
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.data-table th {
  background: #f7faf9;
  color: #42514f;
}

.pill {
  min-height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 850;
  background: var(--surface-muted);
  color: var(--muted);
}

.pill.good {
  background: #e5f6ed;
  color: var(--green);
}

.pill.warn {
  background: #fff2cf;
  color: #815206;
}

.pill.bad {
  background: #fde7e3;
  color: var(--red);
}

.pill.info {
  background: #e8eefb;
  color: var(--blue);
}

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

.wizard-step {
  min-width: 0;
  min-height: 132px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 11px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.wizard-step.complete {
  border-left-color: var(--green);
}

.wizard-step.warning {
  border-left-color: var(--amber);
}

.wizard-step.pending {
  border-left-color: var(--blue);
}

.wizard-step.blocked {
  border-left-color: var(--red);
}

.wizard-step strong {
  line-height: 1.35;
}

.wizard-step p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.issue-list {
  display: grid;
  gap: 8px;
}

.repair-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 12px;
  align-items: start;
}

.issue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: center;
}

.issue.blocking {
  border-color: #efb0a8;
  background: #fff7f5;
}

.issue.warning {
  border-color: #e9ce88;
  background: #fffaf0;
}

.issue.info {
  border-color: #bed1ef;
  background: #f6f9ff;
}

.issue.is-active {
  outline: 2px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

.issue strong,
.issue span {
  display: block;
}

.issue span,
.issue small {
  color: var(--muted);
  line-height: 1.45;
}

.repair-panel {
  position: sticky;
  top: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.repair-panel.is-empty {
  min-height: 180px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.repair-panel-head,
.repair-source,
.repair-status-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.repair-panel-head {
  border-left: 4px solid var(--accent);
}

.repair-panel-head.bad {
  border-left-color: var(--red);
}

.repair-panel-head.warn {
  border-left-color: var(--amber);
}

.repair-panel-head.info {
  border-left-color: var(--blue);
}

.repair-panel-head strong,
.repair-source strong,
.repair-status-card strong {
  line-height: 1.35;
}

.repair-panel-head small,
.repair-source small,
.repair-status-card small {
  color: var(--muted);
  line-height: 1.45;
}

.repair-field-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.repair-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.repair-actions .primary-button,
.repair-actions .secondary-button {
  width: 100%;
}

.run-surface {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: stretch;
}

.run-console,
.run-step,
.run-result {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.run-console {
  display: grid;
  align-content: space-between;
  gap: 16px;
}

.run-console h3 {
  margin-top: 8px;
  font-size: 22px;
}

.run-console p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.run-meter {
  display: grid;
  gap: 7px;
}

.run-meter span {
  font-size: 24px;
  font-weight: 900;
}

.run-meter div {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}

.run-meter i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease;
}

.run-progress-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.run-step {
  min-height: 118px;
  border-left: 4px solid var(--line-strong);
  display: grid;
  align-content: start;
  gap: 7px;
}

.run-step.complete {
  border-left-color: var(--green);
  background: #f5fbf8;
}

.run-step.active {
  border-left-color: var(--blue);
  background: #f6f9ff;
}

.run-step.warning {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.run-step.blocked {
  border-color: #efb0a8;
  border-left-color: var(--red);
  background: #fff7f5;
}

.run-step strong,
.run-step small,
.run-result strong,
.run-result span {
  display: block;
}

.run-step small,
.run-result span {
  color: var(--muted);
  line-height: 1.45;
}

.run-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.run-result {
  display: grid;
  gap: 5px;
}

.run-result strong {
  font-size: 22px;
  line-height: 1;
}

.unscheduled-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.unscheduled-panel.is-quiet {
  border-style: dashed;
  color: var(--muted);
}

.unscheduled-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.unscheduled-head h3 {
  font-size: 15px;
}

.unscheduled-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.unscheduled-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffaf0;
  padding: 11px;
  display: grid;
  gap: 8px;
}

.unscheduled-card.blocking {
  border-color: #efb0a8;
  border-left-color: var(--red);
  background: #fff7f5;
}

.unscheduled-card strong,
.unscheduled-card small {
  display: block;
}

.unscheduled-card small {
  color: var(--muted);
  line-height: 1.45;
}

.unscheduled-card .secondary-button {
  justify-self: start;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 12px;
  align-items: start;
}

.board-panel {
  padding: 0;
  overflow: hidden;
}

.board-head {
  min-height: 70px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.board-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.select-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

select {
  min-height: 36px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font-weight: 750;
}

.segmented {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  gap: 3px;
  padding: 3px;
}

.segmented button {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.segmented button.is-active {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.timetable {
  min-width: 820px;
}

.timetable th {
  height: 42px;
  background: #f7faf9;
  color: #42514f;
  font-size: 13px;
}

.timetable th:first-child,
.period-cell {
  width: 82px;
}

.period-cell {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.slot {
  height: 108px;
  padding: 7px;
  vertical-align: top;
  background: #fff;
}

.slot.empty {
  background-image: linear-gradient(135deg, rgba(15, 118, 110, 0.055) 25%, transparent 25%);
  background-size: 10px 10px;
}

.slot.is-over {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  background: #eefaf8;
}

.lesson-card,
.pool-card,
.conflict-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}

.lesson-card {
  border-left: 4px solid var(--blue);
  min-height: 78px;
  padding: 8px;
  display: grid;
  gap: 5px;
  cursor: grab;
}

.lesson-card:active,
.pool-card:active {
  cursor: grabbing;
}

.lesson-card.locked {
  border-left-color: #687675;
  background: #f6f8f8;
}

.lesson-card.conflict {
  border-color: #edaea6;
  border-left-color: var(--red);
  background: #fff7f5;
}

.lesson-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-weight: 900;
}

.lesson-title button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.lesson-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.badge-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.right-rail {
  display: grid;
  gap: 12px;
}

.pool-list,
.conflict-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding-right: 2px;
}

.pool-card {
  border-left: 4px solid var(--green);
  padding: 9px;
  display: grid;
  gap: 5px;
  cursor: grab;
}

.pool-card small {
  color: var(--muted);
  line-height: 1.4;
}

.pool-card button {
  justify-self: start;
}

.conflict-item {
  border-left: 4px solid var(--amber);
  padding: 9px;
  display: grid;
  gap: 4px;
}

.conflict-item.hard {
  border-color: #edaea6;
  border-left-color: var(--red);
  background: #fff7f5;
}

.conflict-item.soft {
  border-color: #e8cf89;
  background: #fffaf0;
}

.conflict-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.version-list {
  margin: 0;
  padding-left: 21px;
  color: var(--muted);
  display: grid;
  gap: 5px;
}

.version-list button {
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0;
  font-weight: 850;
}

.empty-state {
  min-height: 72px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
}

.delivery-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.1fr) 300px minmax(340px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.delivery-main {
  min-width: 0;
  display: grid;
  gap: 12px;
  align-content: start;
}

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

.publish-card {
  min-width: 0;
  min-height: 116px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 11px;
  display: grid;
  align-content: space-between;
  gap: 6px;
}

.publish-card.is-active.draft {
  border-left-color: var(--red);
  background: #fff7f5;
}

.publish-card.is-active.saved {
  border-left-color: var(--blue);
  background: #f5f8ff;
}

.publish-card.is-active.published {
  border-left-color: var(--green);
  background: #f5fbf8;
}

.publish-card.is-active.stale {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.publish-card span,
.publish-card small {
  color: var(--muted);
  line-height: 1.4;
}

.publish-card strong {
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.12;
}

.publish-control-panel {
  min-height: 0;
}

.publish-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.publish-flow-step {
  min-width: 0;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 9px;
  display: grid;
  align-content: space-between;
  gap: 5px;
}

.publish-flow-step strong,
.publish-flow-step small {
  display: block;
}

.publish-flow-step small {
  color: var(--muted);
  line-height: 1.4;
}

.handoff-panel {
  min-height: 0;
}

.handoff-switch {
  justify-self: start;
}

.handoff-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.handoff-card {
  min-width: 0;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 9px;
  display: grid;
  align-content: space-between;
  gap: 5px;
}

.handoff-card span,
.handoff-card small {
  color: var(--muted);
  line-height: 1.4;
}

.handoff-card strong {
  overflow-wrap: anywhere;
  line-height: 1.18;
}

.delivery-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.delivery-check {
  min-width: 0;
  min-height: 74px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfc;
  padding: 8px;
  display: grid;
  align-content: space-between;
  gap: 5px;
}

.delivery-check.passed {
  border-left-color: var(--green);
  background: #f5fbf8;
}

.delivery-check.blocked {
  border-left-color: var(--red);
  background: #fff7f5;
}

.delivery-check strong {
  font-size: 13px;
  line-height: 1.25;
}

.summary-list {
  margin: 0;
  display: grid;
  gap: 8px;
}

.summary-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.summary-list dt,
.summary-list dd {
  margin: 0;
}

.summary-list dt {
  color: var(--muted);
}

.summary-list dd {
  font-weight: 850;
}

.phone-preview {
  width: 300px;
  min-height: 430px;
  border: 1px solid #1d2a29;
  border-radius: 24px;
  background: #f7faf9;
  padding: 12px;
  justify-self: center;
  box-shadow: 0 20px 40px rgba(19, 30, 29, 0.14);
}

.phone-top {
  height: 38px;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.phone-body {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.phone-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.phone-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 4px;
}

.phone-item span {
  color: var(--muted);
  font-size: 12px;
}

.payload-preview {
  margin: 0;
  min-height: 360px;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f2a29;
  color: #e8f3ef;
  padding: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(560px, calc(100vw - 32px));
  border-radius: 8px;
  background: #1f2a29;
  color: #fff;
  padding: 11px 14px;
  box-shadow: var(--shadow);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1240px) {
  .metric-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .import-layout,
  .import-grid,
  .delivery-layout,
  .workbench-shell {
    grid-template-columns: 1fr;
  }

  .entry-panel {
    grid-row: auto;
  }

  .sheet-grid,
  .smart-result-strip,
  .workbench-grid,
  .workbench-status-grid,
  .publish-status-grid,
  .publish-flow,
  .handoff-card-grid,
  .delivery-check-grid,
  .health-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-layout {
    grid-template-columns: 1fr;
  }

  .phone-preview {
    width: min(300px, 100%);
  }

  .access-controls {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-group {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    overflow: auto;
  }

  .side-status,
  .doc-links {
    display: none;
  }

  .topbar,
  .band-head,
  .workbench-toolbar,
  .status-strip,
  .schedule-layout,
  .confirm-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar,
  .band-actions,
  .board-actions {
    justify-content: flex-start;
  }

  .wizard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue {
    grid-template-columns: 1fr;
  }

  .repair-workspace {
    grid-template-columns: 1fr;
  }

  .run-surface {
    grid-template-columns: 1fr;
  }

  .run-progress-grid,
  .run-result-grid,
  .unscheduled-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repair-panel {
    position: static;
  }

  .confirmation-item {
    grid-template-columns: 1fr;
  }

  .draft-group-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .draft-readiness-header,
  .draft-readiness-result,
  .memory-suggestion-head,
  .reference-resolution-head,
  .reference-lock-state {
    grid-template-columns: 1fr;
  }

  .draft-readiness-ring {
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .wizard-grid,
  .sheet-grid,
  .smart-file-grid,
    .smart-result-strip,
    .memory-suggestion-metrics,
    .draft-readiness-metrics,
    .reference-resolution-metrics,
    .reference-conflict-grid,
    .workbench-grid,
  .workbench-status-grid,
  .publish-status-grid,
  .publish-flow,
  .handoff-card-grid,
  .delivery-check-grid,
  .health-category-grid,
  .run-progress-grid,
  .run-result-grid,
  .unscheduled-card-grid {
    grid-template-columns: 1fr;
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar,
  .band-actions,
  .entry-actions {
    align-items: stretch;
  }

  .access-controls {
    grid-template-columns: 1fr;
  }

  .tool-button,
  .primary-button,
  .secondary-button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .segmented {
    width: 100%;
  }

  .entry-switch,
  .decision-group,
  .draft-group-action,
  .reference-lock-action,
  .repair-actions {
    width: 100%;
  }

  .draft-group-action {
    display: grid;
    grid-template-columns: 1fr;
  }

  .draft-group-action input {
    width: 100%;
  }

  .repair-actions {
    grid-template-columns: 1fr;
  }

  .bucket-main {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .bucket-main .pill {
    grid-column: 1 / -1;
    width: max-content;
  }

  .board-head {
    display: grid;
  }

  .action-feedback-panel {
    grid-template-columns: 1fr;
  }

  .action-feedback-pills {
    justify-content: flex-start;
  }

  select {
    width: 100%;
  }
}
