:root {
  color-scheme: light dark;
  --bg: #f3f5f7;
  --surface: #fafbfc;
  --surface-raised: #fefefe;
  --surface-muted: #e9edf2;
  --surface-pressed: #dde3ea;
  --ink: #172b4d;
  --ink-soft: #44546f;
  --muted: #626f86;
  --line: #c7ced8;
  --line-strong: #9ba7b6;
  --accent: #0c66e4;
  --accent-strong: #0052cc;
  --accent-soft: #e9f2ff;
  --accent-ink: #09326c;
  --success: #216e4e;
  --success-soft: #dcfff1;
  --warning: #974f0c;
  --warning-soft: #fff3eb;
  --danger: #ae2e24;
  --danger-soft: #ffeceb;
  --unknown: #596773;
  --unknown-soft: #e9edf2;
  --shadow: 0 8px 24px rgb(23 43 77 / 0.08);
  --radius: 6px;
  --font-sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a1d;
    --surface: #1d2228;
    --surface-raised: #242a31;
    --surface-muted: #2c333b;
    --surface-pressed: #38414b;
    --ink: #e6e9ed;
    --ink-soft: #c3cad3;
    --muted: #a6b0bd;
    --line: #46515e;
    --line-strong: #647181;
    --accent: #579dff;
    --accent-strong: #85b8ff;
    --accent-soft: #0d2f5f;
    --accent-ink: #cce0ff;
    --success: #7ee2b8;
    --success-soft: #123b2d;
    --warning: #f5cd47;
    --warning-soft: #453719;
    --danger: #ff9c8f;
    --danger-soft: #4d2525;
    --unknown: #b6c2cf;
    --unknown-soft: #303943;
    --shadow: 0 8px 24px rgb(5 9 12 / 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
select,
textarea {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

button,
select {
  min-height: 38px;
}

button {
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 2px;
}

code,
pre,
textarea {
  font-family: var(--font-mono);
}

code {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 60px;
  padding: 8px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.brand-lockup > div {
  display: grid;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand-lockup span:last-child {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: #f7f9fc;
  font-weight: 800;
}

.source-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.source-nav a {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.source-nav a:hover {
  color: var(--accent);
}

.app-main {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 42px) 52px;
}

.deadline-bar {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(300px, 2fr) minmax(180px, auto);
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  background: var(--surface);
}

.deadline-bar > div:first-child {
  display: grid;
}

.deadline-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.deadline-bar strong {
  font-size: 15px;
}

.deadline-bar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.deadline-count {
  justify-self: end;
  padding: 6px 9px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.workbench {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workbench-heading,
.manifest-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.workbench-heading h1,
.manifest-heading h2,
.source-section h2 {
  margin: 0;
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.15;
}

.workbench-heading p,
.manifest-heading p,
.source-section p {
  max-width: 76ch;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.privacy-lockup {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.privacy-lockup span,
.result-stamp {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.result-stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(250px, 0.9fr);
}

.planner-form {
  min-width: 0;
  padding: 14px 16px 16px;
  border-right: 1px solid var(--line);
}

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

.input-panel {
  min-width: 0;
}

.field-heading,
.section-title-row,
.status-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field-heading > div:first-child {
  display: grid;
  gap: 1px;
}

.field-kicker {
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-heading label {
  font-size: 13px;
  font-weight: 750;
}

.field-tools {
  display: flex;
  gap: 4px;
}

.tool-button,
.copy-button,
.tab-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.tool-button {
  min-height: 30px;
  padding: 4px 8px;
}

.tool-button:hover,
.copy-button:hover,
.tab-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink);
}

.field-limit {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

textarea {
  display: block;
  width: 100%;
  min-width: 0;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.48;
}

.input-panel textarea {
  height: 170px;
  min-height: 112px;
  margin-top: 7px;
  padding: 10px 11px;
}

textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

textarea:focus,
select:focus {
  border-color: var(--accent);
}

.field-help {
  min-height: 34px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.preference-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(220px, 1.15fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.preference-row label {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-raised);
  padding: 7px 30px 7px 9px;
  font-size: 12px;
}

.input-summary {
  display: grid;
  align-content: center;
  min-height: 38px;
  color: var(--muted);
  font-size: 11px;
}

.input-summary span:first-child {
  color: var(--ink-soft);
  font-weight: 750;
}

.primary-button {
  min-width: 210px;
  padding: 9px 14px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: #f7f9fc;
  font-weight: 750;
  white-space: nowrap;
}

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

.form-message {
  min-height: 19px;
  margin: 7px 0 -5px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.form-message.is-warning {
  color: var(--warning);
}

.form-message.is-success {
  color: var(--success);
}

.status-panel {
  min-width: 0;
  padding: 14px;
  background: var(--surface-muted);
}

.status-heading span:first-child,
.status-next span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.status-heading h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.state-badge,
.table-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.state-unknown {
  background: var(--unknown-soft);
  color: var(--unknown);
}

.state-review,
.state-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.state-blocked,
.state-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.state-evidence,
.state-complete {
  background: var(--success-soft);
  color: var(--success);
}

.state-info {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-grid > div {
  min-width: 0;
  padding: 9px 10px;
}

.metric-grid > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.metric-grid > div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.metric-grid dt {
  color: var(--muted);
  font-size: 10px;
}

.metric-grid dd {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
}

.status-next {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.status-next strong {
  font-size: 12px;
  line-height: 1.4;
}

.status-boundary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.privacy-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.privacy-strip span {
  min-width: 0;
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.privacy-strip span + span {
  border-left: 1px solid var(--line);
}

.manifest-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 72px;
}

.manifest-heading {
  align-items: center;
}

.manifest-heading h2 {
  font-size: 21px;
}

.tab-list {
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  padding: 7px 8px 0;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 7px 12px;
  border-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  white-space: nowrap;
}

.tab-button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tab-panel {
  min-width: 0;
  padding: 14px;
}

.tab-panel.is-hidden,
.tab-panel[hidden] {
  display: none;
}

.workbook-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-strong);
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.workbook-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 11px;
}

.workbook-summary > div + div {
  border-left: 1px solid var(--line);
}

.workbook-summary span,
.section-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.workbook-summary strong {
  font-family: var(--font-mono);
  font-size: 20px;
  line-height: 1.1;
}

.workbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(330px, 0.72fr);
  gap: 20px;
}

.section-title-row > div {
  min-width: 0;
}

.section-title-row .section-kicker {
  display: block;
  margin-bottom: 2px;
}

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

.wave-lane {
  min-width: 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.wave-lane.wave-1 {
  border-left-color: var(--danger);
}

.wave-lane.wave-2 {
  border-left-color: var(--warning);
}

.wave-lane.wave-3 {
  border-left-color: var(--accent);
}

.wave-lane.recorded {
  border-left-color: var(--success);
}

.wave-lane header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

.wave-index {
  color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
}

.wave-lane header > div {
  display: grid;
}

.wave-lane header strong {
  color: var(--ink);
  font-size: 11px;
}

.wave-lane header div span {
  color: var(--muted);
  font-size: 10px;
}

.wave-items {
  display: grid;
  max-height: 176px;
  overflow-y: auto;
}

.wave-items > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
}

.wave-items > div:last-child {
  border-bottom: 0;
}

.wave-items strong,
.wave-items span,
.wave-items p {
  font-size: 10px;
}

.wave-items strong {
  color: var(--ink);
}

.wave-items span,
.wave-items p {
  color: var(--muted);
}

.wave-items p {
  margin: 0;
  padding: 14px 9px;
}

.evidence-request-list {
  display: grid;
  max-height: 418px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.evidence-request {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-raised);
}

.evidence-request:last-child {
  border-bottom: 0;
}

.evidence-request > span:first-child {
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.evidence-request p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.archive-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.workbook-boundary {
  margin: -2px 0 9px;
  color: var(--muted);
  font-size: 10px;
}

.workbook-table {
  min-width: 1340px;
  table-layout: fixed;
}

.workbook-table th:nth-child(1),
.workbook-table td:nth-child(1) {
  width: 8%;
}

.workbook-table th:nth-child(2),
.workbook-table td:nth-child(2) {
  width: 10%;
}

.workbook-table th:nth-child(3),
.workbook-table td:nth-child(3),
.workbook-table th:nth-child(4),
.workbook-table td:nth-child(4) {
  width: 11%;
}

.workbook-table th:nth-child(5),
.workbook-table td:nth-child(5),
.workbook-table th:nth-child(6),
.workbook-table td:nth-child(6) {
  width: 9%;
}

.workbook-table th:nth-child(7),
.workbook-table td:nth-child(7) {
  width: 21%;
}

.workbook-table th:nth-child(8),
.workbook-table td:nth-child(8) {
  width: 21%;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.manifest-table {
  min-width: 1300px;
  table-layout: fixed;
}

th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

th,
td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

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

.manifest-table th:nth-child(1),
.manifest-table td:nth-child(1) {
  width: 13%;
}

.manifest-table th:nth-child(2),
.manifest-table td:nth-child(2),
.manifest-table th:nth-child(3),
.manifest-table td:nth-child(3) {
  width: 10.5%;
}

.manifest-table th:nth-child(4),
.manifest-table td:nth-child(4) {
  width: 13%;
}

.manifest-table th:nth-child(5),
.manifest-table td:nth-child(5) {
  width: 9%;
}

.manifest-table th:nth-child(6),
.manifest-table td:nth-child(6) {
  width: 10%;
}

.manifest-table th:nth-child(7),
.manifest-table td:nth-child(7) {
  width: 11%;
}

.manifest-table th:nth-child(8),
.manifest-table td:nth-child(8) {
  width: 8%;
}

.manifest-table th:nth-child(9),
.manifest-table td:nth-child(9) {
  width: 15%;
}

td {
  color: var(--ink-soft);
  font-size: 11px;
}

td strong,
.repository-label {
  color: var(--ink);
}

.repository-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.workspace-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

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

.cell-note {
  display: block;
  color: var(--muted);
}

.empty-row td,
.empty-copy {
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.evidence-layout,
.controls-grid,
.handoff-grid,
.action-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.evidence-layout > section,
.controls-grid > section,
.admin-steps,
.command-pack,
.queue-section,
.copy-panel {
  min-width: 0;
  padding-top: 2px;
}

h3 {
  margin: 0 0 9px;
  font-size: 14px;
}

.check-list,
.destination-list,
.missing-list,
.queue-list {
  display: grid;
  gap: 7px;
}

.check-item,
.destination-item,
.missing-item,
.queue-item {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 2fr) auto;
  align-items: start;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

.check-item strong,
.destination-item strong,
.missing-item strong,
.queue-item strong {
  color: var(--ink);
  font-size: 11px;
}

.check-item p,
.destination-item p,
.missing-item p,
.queue-item p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.caveat-band {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
}

.caveat-band strong {
  flex: 1 0 100%;
}

.admin-steps ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
}

.admin-steps p,
.command-pack p,
.handoff-note,
.copy-feedback {
  color: var(--muted);
  font-size: 11px;
}

.command-pack pre {
  overflow-x: auto;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 11px;
  line-height: 1.6;
}

.copy-button {
  min-height: 30px;
  padding: 4px 9px;
}

.queue-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.control-table {
  min-width: 620px;
}

.handoff-note {
  margin: 0 0 12px;
  padding: 9px 10px;
  border-left: 3px solid var(--success);
  background: var(--success-soft);
  color: var(--success);
}

.copy-panel textarea {
  padding: 10px;
  background: var(--surface-raised);
  font-size: 11px;
}

.portfolio-copy-panel {
  grid-column: 1 / -1;
}

.copy-feedback {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--success);
  font-weight: 700;
}

.source-section {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 32px;
  align-items: start;
  margin-top: 14px;
  padding: 18px 4px;
}

.source-section h2 {
  font-size: 18px;
}

.source-links {
  display: grid;
  gap: 7px;
}

.source-links a {
  font-size: 12px;
  font-weight: 650;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 42px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1120px) {
  .workbench-grid {
    grid-template-columns: 1fr;
  }

  .planner-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-panel {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    gap: 12px;
  }

  .status-panel .metric-grid {
    margin: 0;
  }

  .status-boundary {
    grid-column: 1 / -1;
  }

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

  .input-summary {
    order: 4;
  }

  .primary-button {
    width: 100%;
  }

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

  .workbook-summary > div:nth-child(4) {
    border-left: 0;
  }

  .workbook-summary > div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 767px) {
  html {
    scroll-behavior: auto;
  }

  .app-bar {
    min-height: 52px;
    padding: 7px 12px;
  }

  .brand-mark {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .brand-lockup strong {
    font-size: 13px;
  }

  .brand-lockup span:last-child {
    font-size: 10px;
  }

  .source-nav {
    display: none;
  }

  .app-main {
    padding: 10px 8px 32px;
  }

  .deadline-bar {
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-height: 50px;
    padding: 7px 9px;
  }

  .deadline-bar p {
    display: none;
  }

  .deadline-bar strong {
    font-size: 13px;
  }

  .deadline-count {
    max-width: 154px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .workbench {
    margin-top: 8px;
  }

  .workbench-heading,
  .manifest-heading {
    display: block;
    padding: 10px;
  }

  .workbench-heading h1 {
    font-size: 20px;
  }

  .workbench-heading p {
    max-width: none;
    margin-top: 3px;
    font-size: 11px;
  }

  .privacy-lockup {
    display: none;
  }

  .planner-form {
    padding: 10px;
  }

  .input-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .input-panel textarea {
    height: 112px;
    min-height: 90px;
    margin-top: 4px;
    padding: 8px;
    font-size: 10px;
    line-height: 1.35;
  }

  .field-help {
    display: none;
  }

  .field-heading label {
    font-size: 12px;
  }

  .field-kicker,
  .field-limit {
    font-size: 9px;
  }

  .tool-button {
    min-height: 26px;
    padding: 2px 6px;
    font-size: 10px;
  }

  .preference-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 8px;
    padding-top: 8px;
  }

  .preference-row label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  select {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 10px;
  }

  .input-summary {
    display: none;
  }

  .primary-button {
    grid-column: 1 / -1;
    min-height: 42px;
    min-width: 0;
    font-size: 13px;
  }

  .form-message {
    margin-top: 4px;
    font-size: 10px;
  }

  .status-panel {
    display: none;
  }

  .privacy-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 8px 0;
  }

  .privacy-strip span {
    padding: 6px 7px;
    font-size: 9px;
    text-align: left;
  }

  .privacy-strip span:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .privacy-strip span:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .manifest-heading h2 {
    font-size: 18px;
  }

  .manifest-heading p {
    font-size: 10px;
  }

  .result-stamp {
    display: inline-flex;
    margin-top: 7px;
  }

  .result-stamps {
    justify-content: flex-start;
  }

  .tab-list {
    padding-left: 5px;
  }

  .tab-button {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 10px;
  }

  .tab-panel {
    padding: 8px;
  }

  .manifest-table,
  .manifest-table tbody,
  .manifest-table tr,
  .manifest-table td,
  .workbook-table,
  .workbook-table tbody,
  .workbook-table tr,
  .workbook-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .manifest-table thead,
  .workbook-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .manifest-table tbody,
  .workbook-table tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  .manifest-table tr,
  .workbook-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-raised);
  }

  .manifest-table td,
  .workbook-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
  }

  .manifest-table td:nth-child(1),
  .manifest-table td:nth-child(2),
  .manifest-table td:nth-child(3),
  .manifest-table td:nth-child(4),
  .manifest-table td:nth-child(5),
  .manifest-table td:nth-child(6),
  .manifest-table td:nth-child(7),
  .manifest-table td:nth-child(8),
  .manifest-table td:nth-child(9) {
    width: 100%;
  }

  .workbook-table td:nth-child(1),
  .workbook-table td:nth-child(2),
  .workbook-table td:nth-child(3),
  .workbook-table td:nth-child(4),
  .workbook-table td:nth-child(5),
  .workbook-table td:nth-child(6),
  .workbook-table td:nth-child(7),
  .workbook-table td:nth-child(8) {
    width: 100%;
  }

  .manifest-table td:last-child,
  .workbook-table td:last-child {
    border-bottom: 0;
  }

  .manifest-table td::before,
  .workbook-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .manifest-table .empty-row,
  .workbook-table .empty-row {
    border: 0;
  }

  .manifest-table .empty-row td,
  .workbook-table .empty-row td {
    display: block;
    padding: 18px;
    text-align: center;
  }

  .manifest-table .empty-row td::before,
  .workbook-table .empty-row td::before {
    display: none;
  }

  .evidence-layout,
  .controls-grid,
  .handoff-grid,
  .action-layout,
  .source-section {
    grid-template-columns: 1fr;
  }

  .evidence-layout,
  .controls-grid,
  .handoff-grid,
  .action-layout {
    gap: 16px;
  }

  .check-item,
  .destination-item,
  .missing-item,
  .queue-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .caveat-band {
    display: grid;
    gap: 5px;
  }

  .portfolio-copy-panel {
    grid-column: auto;
  }

  .workbook-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
  }

  .workbook-summary > div {
    padding: 8px;
  }

  .workbook-summary > div:nth-child(odd) {
    border-left: 0;
  }

  .workbook-summary > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .workbook-summary strong {
    font-size: 17px;
  }

  .wave-board {
    grid-template-columns: 1fr;
  }

  .wave-items {
    max-height: none;
  }

  .evidence-request-list {
    max-height: 360px;
  }

  .evidence-request {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .evidence-request .table-badge {
    grid-column: 2;
  }

  .archive-section .section-title-row {
    display: grid;
  }

  .archive-actions {
    justify-content: flex-start;
  }

  .source-section {
    gap: 14px;
    padding: 14px 4px;
  }

  .app-footer {
    display: grid;
    gap: 3px;
    padding: 12px;
  }
}

@media (max-width: 380px) {
  .workbench-heading h1 {
    font-size: 18px;
  }

  .input-panel textarea {
    height: 102px;
  }

  .deadline-count {
    max-width: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .app-bar {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
