:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fbfcfd;
  --border: #e5e9f0;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --red: #f04438;
  --red-50: #fff1f0;
  --blue: #3274f6;
  --blue-50: #edf4ff;
  --green: #16a56a;
  --green-50: #ecfdf3;
  --orange: #f59e0b;
  --orange-50: #fff7e6;
  --purple: #7c5cff;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
}

button,
.nav-item,
tr[data-action] {
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    background-color 0.14s ease,
    border-color 0.14s ease;
}

button:active,
button.is-click-feedback,
.nav-item.is-click-feedback,
tr.is-click-feedback {
  transform: translateY(1px);
  box-shadow: inset 0 0 0 999px rgba(16, 24, 40, 0.04);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--border);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
}

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

.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 8px;
  color: #344054;
  font-weight: 600;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--red);
  background: var(--red-50);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid currentColor;
  font-size: 11px;
}

.role-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.role-card strong,
.role-card span {
  display: block;
}

.role-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 72px;
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.search-box {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search-box span {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 12px;
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffe4de;
  color: var(--red);
  font-weight: 700;
}

.page {
  padding: 28px;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin: 2px 0 6px;
  font-size: 30px;
  letter-spacing: 0;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.section-no {
  margin: 0;
  color: var(--red);
  font-weight: 800;
}

.page-heading__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: white;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.is-ok {
  background: var(--green);
}

.status-dot.is-danger {
  background: var(--red);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.kpi-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi-card,
.mini-stat,
.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kpi-card {
  min-height: 132px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.kpi-card span,
.mini-stat span {
  color: var(--muted);
}

.kpi-card strong,
.mini-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  letter-spacing: 0;
}

.kpi-card small {
  margin-left: 4px;
  font-size: 14px;
}

.kpi-card i {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  opacity: 0.2;
  background: currentColor;
}

.kpi-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tone-danger {
  color: var(--red);
}

.tone-primary {
  color: var(--blue);
}

.tone-success {
  color: var(--green);
}

.tone-warning {
  color: var(--orange);
}

.tone-neutral {
  color: #475467;
}

.progress {
  height: 5px;
  margin-top: 16px;
  background: #eef0f4;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr) auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 5px solid #d0d5dd;
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.command-panel.tone-success {
  border-left-color: var(--green);
}

.command-panel.tone-warning {
  border-left-color: var(--orange);
}

.command-panel.tone-danger {
  border-left-color: var(--red);
}

.command-panel__copy {
  min-width: 0;
  align-self: center;
}

.command-panel__copy strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1.25;
}

.command-panel__copy p {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

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

.command-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.command-stat span,
.command-stat small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.command-stat strong {
  display: block;
  margin: 6px 0 2px;
  color: var(--text);
  font-size: 18px;
  overflow-wrap: anywhere;
}

.command-panel__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-width: 150px;
}

.command-panel__actions .ghost-button,
.command-panel__actions .primary-button {
  width: 100%;
  justify-content: center;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid #d0d5dd;
  border-radius: 8px;
  background: var(--surface-soft);
}

.action-item.tone-success {
  border-left-color: var(--green);
  background: #ecfdf3;
}

.action-item.tone-warning {
  border-left-color: var(--orange);
  background: #fff7e8;
}

.action-item.tone-danger {
  border-left-color: var(--red);
  background: var(--red-50);
}

.action-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.action-item strong {
  display: block;
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.action-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.today-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.today-hero h2 {
  margin: 4px 0 0;
  font-size: 34px;
  line-height: 1.2;
}

.today-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.today-stage-card {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  text-align: center;
  box-shadow: var(--shadow);
}

.today-stage-card span,
.today-stage-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.today-stage-card strong {
  font-size: 20px;
}

.today-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.today-stage-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.today-stage {
  min-height: 114px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.today-stage strong,
.today-stage span,
.today-stage small {
  display: block;
}

.today-stage span {
  color: var(--text);
  font-weight: 800;
}

.today-stage small {
  color: var(--muted);
  line-height: 1.45;
}

.today-stage.is-done {
  border-color: rgba(18, 183, 106, 0.26);
  background: var(--green-50);
}

.today-stage.is-current {
  border-color: rgba(240, 68, 56, 0.28);
  background: var(--red-50);
}

.today-stage.is-blocked {
  border-color: rgba(240, 68, 56, 0.36);
  background: var(--red-50);
  box-shadow: inset 4px 0 0 var(--red);
}

.next-action-list {
  display: grid;
  gap: 10px;
}

.next-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.next-action span {
  grid-column: 1;
  color: var(--muted);
  line-height: 1.45;
}

.next-action .badge {
  grid-row: 1 / span 2;
  grid-column: 2;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.panel h2,
.panel h3,
.subsection h4 {
  margin: 0;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.source-form {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 2fr) 120px 150px 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.source-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.source-form input,
.source-form select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 800;
}

.danger-text,
.error-text {
  color: #b42318;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
}

tr[data-action] {
  cursor: pointer;
}

tr[data-action]:hover {
  background: #f9fafb;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f2f4f7;
  color: #475467;
}

.badge.tone-success {
  color: var(--green);
  background: var(--green-50);
}

.badge.tone-warning {
  color: #b76b00;
  background: var(--orange-50);
}

.badge.tone-danger {
  color: var(--red);
  background: var(--red-50);
}

.badge.tone-primary {
  color: var(--blue);
  background: var(--blue-50);
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(100px, 1fr) 40px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar-row div {
  height: 7px;
  border-radius: 999px;
  background: #eef0f4;
}

.bar-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
}

.queue-list,
.summary-list,
.field-grid {
  display: grid;
  gap: 10px;
}

.queue-list div,
.summary-list div,
.field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.field {
  display: block;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.field strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.activity-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.strategy-layout,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.split-layout.wide-left {
  grid-template-columns: minmax(0, 1.15fr) 420px;
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.form-field span,
.review-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-field input,
.form-field select,
.review-note textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.review-note textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.ratio-editor {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.ratio-editor label {
  display: grid;
  grid-template-columns: 150px 1fr 54px;
  gap: 14px;
  align-items: center;
}

input[type="range"] {
  accent-color: var(--red);
}

.strategy-footer,
.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.switch {
  margin-right: auto;
  color: var(--muted);
}

.ghost-button,
.primary-button {
  flex-shrink: 0;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: white;
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.icon-button {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  font-weight: 800;
}

.notice,
.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--orange);
  border-radius: 8px;
  background: var(--orange-50);
  color: #8a4b00;
  font-weight: 600;
}

.notice.is-busy {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: #f4b740;
}

.notice.is-busy::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(138, 75, 0, 0.22);
  border-top-color: #8a4b00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.workflow-guide,
.delivery-command {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.workflow-guide__top,
.delivery-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.workflow-guide__top strong,
.delivery-command strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.workflow-guide__top p,
.delivery-command p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.workflow-guide__actions,
.delivery-command__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.workflow-step {
  min-width: 0;
  min-height: 92px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-top: 4px solid #d0d5dd;
  border-radius: 8px;
  background: var(--surface-soft);
  color: inherit;
}

.workflow-step:hover,
.workflow-step.is-route {
  border-color: var(--red);
}

.workflow-step.is-route {
  background: var(--red-50);
}

.workflow-step.is-done {
  border-top-color: var(--green);
}

.workflow-step.is-current {
  border-top-color: var(--orange);
}

.workflow-step.is-blocked {
  border-top-color: var(--red);
  background: var(--red-50);
}

.workflow-step__index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.workflow-step strong,
.workflow-step small,
.workflow-step em {
  display: block;
}

.workflow-step strong,
.workflow-step em {
  overflow-wrap: anywhere;
}

.workflow-step small {
  margin-top: 4px;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.workflow-step em {
  color: var(--text);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.workflow-guide__bottom {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.workflow-status,
.delivery-command__status {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.workflow-status span,
.delivery-command__status span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workflow-status strong,
.delivery-command__status strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.workflow-status small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.workflow-status.tone-success,
.delivery-command__status.tone-success {
  border-color: rgba(18, 183, 106, 0.28);
  background: var(--green-50);
}

.workflow-status.tone-warning,
.delivery-command__status.tone-warning {
  border-color: rgba(245, 158, 11, 0.34);
  background: var(--orange-50);
}

.workflow-status.tone-danger,
.delivery-command__status.tone-danger {
  border-color: rgba(240, 68, 56, 0.28);
  background: var(--red-50);
}

.workflow-status.tone-primary {
  border-color: rgba(50, 116, 246, 0.24);
  background: var(--blue-50);
}

.delivery-command {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr) auto;
}

.delivery-command__status strong {
  font-size: 16px;
}

.form-error {
  margin: 14px 0 0;
  border-color: var(--red);
  background: var(--red-50);
  color: #b42318;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(240, 68, 56, 0.08), rgba(50, 116, 246, 0.07)),
    var(--bg);
}

.login-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.login-brand strong,
.login-brand p {
  display: block;
  margin: 0;
}

.login-brand p,
.login-meta {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  margin-top: 22px;
  display: grid;
  gap: 14px;
}

.login-form label,
.delivery-form label,
.admin-input {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input,
.delivery-form input,
.delivery-form select,
.delivery-form textarea,
.admin-input input,
.admin-input textarea,
.compact-select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
}

.admin-input textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}

.delivery-form {
  display: grid;
  gap: 12px;
}

.delivery-form textarea {
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}

.login-meta {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.8fr);
  gap: 16px;
}

.workspace-form {
  display: grid;
  gap: 16px;
}

.settings-form {
  display: grid;
  gap: 16px;
}

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

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

.full-span {
  grid-column: 1 / -1;
}

.settings-subtitle {
  margin: 4px 0 0;
  font-size: 15px;
}

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

.capability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.capability-card {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  display: grid;
  gap: 6px;
}

.capability-card > span,
.capability-card small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.capability-card strong {
  overflow-wrap: anywhere;
}

.json-preview {
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #101828;
  color: white;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.compact-table table {
  min-width: 560px;
}

.stage-timeline {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.stage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: white;
  color: inherit;
  font: inherit;
  text-align: left;
}

.stage-item.is-ok {
  border-left-color: #12b76a;
}

.stage-item.is-failed {
  border-left-color: #f04438;
}

.stage-item.is-running {
  border-left-color: #f79009;
}

.stage-item.is-active {
  border-color: var(--red);
  border-left-color: var(--red);
  background: var(--red-50);
  box-shadow: 0 10px 28px rgba(240, 68, 56, 0.12);
}

.stage-item:hover {
  border-color: var(--red);
}

.stage-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.diagnostic-panel {
  overflow: hidden;
}

.advanced-panel {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.advanced-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}

.advanced-panel > summary::-webkit-details-marker {
  display: none;
}

.advanced-panel > summary strong,
.advanced-panel > summary small {
  display: block;
}

.advanced-panel > summary small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
}

.advanced-panel[open] > summary {
  border-bottom: 1px solid var(--border);
}

.advanced-panel .diagnostic-layout {
  padding: 16px;
}

.production-control {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.production-control-grid label {
  display: grid;
  gap: 6px;
}

.production-control-grid span,
.production-switches {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.production-control-grid input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.production-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
}

.production-switches label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.compact-row {
  margin-top: 0;
}

.preflight-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.preflight-panel.is-ok {
  border-color: rgba(18, 183, 106, 0.32);
}

.preflight-panel.is-blocked {
  border-color: rgba(240, 68, 56, 0.32);
}

.ghost-button.danger {
  color: #b42318;
  border-color: rgba(240, 68, 56, 0.36);
  background: var(--red-50);
}

.diagnostic-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.diagnostic-sidebar,
.diagnostic-main,
.diagnostic-section,
.diagnostic-steps,
.diagnostic-item-list,
.wave-list {
  display: grid;
  gap: 12px;
}

.diagnostic-main {
  min-width: 0;
}

.diagnostic-columns {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
}

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

.diagnostic-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.diagnostic-heading span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.wave-button,
.diagnostic-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: inherit;
  font: inherit;
  text-align: left;
}

.wave-button:hover,
.diagnostic-item:hover {
  border-color: var(--red);
}

.wave-button.is-active,
.diagnostic-item.is-active {
  border-color: var(--red);
  background: var(--red-50);
}

.diagnostic-item.is-ok {
  border-left: 4px solid #12b76a;
}

.diagnostic-item.is-failed {
  border-left: 4px solid #f04438;
}

.wave-button small,
.diagnostic-item small,
.wave-button em,
.diagnostic-item em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.diagnostic-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.diagnostic-error,
.diagnostic-warning {
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.diagnostic-error {
  border: 1px solid rgba(240, 68, 56, 0.24);
  background: var(--red-50);
  color: #b42318;
}

.diagnostic-warning {
  border: 1px solid rgba(247, 144, 9, 0.22);
  background: var(--orange-50);
  color: #9a3412;
}

.diagnostic-json {
  min-width: 0;
}

.diagnostic-json summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.diagnostic-json .json-preview {
  margin-top: 8px;
}

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

.diagnostic-step {
  border: 1px solid var(--border);
  border-left: 4px solid var(--muted);
  border-radius: 8px;
  background: var(--surface-soft);
}

.diagnostic-step.is-ok {
  border-left-color: #12b76a;
}

.diagnostic-step.is-failed {
  border-left-color: #f04438;
}

.diagnostic-step.is-running {
  border-left-color: #f79009;
}

.diagnostic-step summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
}

.diagnostic-step summary::-webkit-details-marker {
  display: none;
}

.diagnostic-step summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.diagnostic-step-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.run-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.muted-line {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.compact-select {
  min-width: 136px;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
}

.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.is-active {
  background: var(--red);
  color: white;
}

.detail-panel {
  align-self: start;
}

.detail-stack {
  display: grid;
  gap: 14px;
}

.detail-stack p {
  margin: 0;
  color: #344054;
  line-height: 1.7;
}

.review-copy {
  font-size: 16px;
}

.review-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.risk-list,
.tag-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-line span {
  color: var(--blue);
  background: var(--blue-50);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

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

.rule-grid article,
.subsection,
.evidence-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.rule-grid p,
.evidence-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.score-text {
  color: var(--red);
  font-size: 18px;
}

.mini-stat {
  padding: 18px;
}

.mini-stat strong {
  font-size: 28px;
}

.stepper {
  display: flex;
  gap: 5px;
}

.stepper span {
  width: 8px;
  height: 8px;
  overflow: hidden;
  color: transparent;
  border-radius: 50%;
  background: var(--green);
}

.review-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 330px;
  gap: 16px;
}

.review-command {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.review-command strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.review-command p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.review-command__stats {
  display: flex;
  gap: 10px;
}

.review-stat {
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.review-stat span,
.review-stat strong {
  display: block;
}

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

.review-stat strong {
  margin-top: 4px;
  font-size: 18px;
}

.review-workbench {
  grid-template-columns: 340px minmax(0, 1fr) 330px;
}

.review-content-panel,
.queue-panel,
.action-panel {
  align-self: start;
}

.review-queue {
  display: grid;
  gap: 10px;
  max-height: 720px;
  overflow: auto;
}

.review-queue button {
  width: 100%;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  text-align: left;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
}

.review-queue button.is-active {
  border-color: var(--red);
  background: var(--red-50);
}

.review-queue img {
  width: 58px;
  height: 76px;
  border-radius: 6px;
  object-fit: cover;
}

.review-queue strong,
.review-queue small {
  display: block;
}

.review-queue small {
  margin-top: 7px;
  color: var(--muted);
}

.title-row,
.package-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.image-strip figure {
  margin: 0;
}

.image-strip img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.image-strip figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

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

.check-grid div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.check-grid strong,
.check-grid small {
  display: block;
  margin-top: 8px;
}

.check-grid small {
  color: var(--muted);
}

.action-stack {
  display: grid;
  gap: 10px;
}

.decision {
  min-height: 48px;
  display: grid;
  gap: 4px;
  align-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-weight: 800;
  text-align: left;
  padding: 12px 14px;
}

.decision span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.decision.is-selected {
  border-color: currentColor;
  box-shadow: inset 4px 0 0 currentColor;
}

.decision.success {
  color: var(--green);
  background: var(--green-50);
}

.decision.primary {
  color: var(--blue);
  background: var(--blue-50);
}

.decision.warning {
  color: #b76b00;
  background: var(--orange-50);
}

.decision.danger {
  color: var(--red);
  background: var(--red-50);
}

.review-current-action {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.review-current-action span {
  color: var(--muted);
}

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

.file-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.file-list small {
  color: var(--muted);
}

.insight-list {
  display: grid;
  gap: 12px;
}

.insight-list article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.6;
}

.empty-state,
.loading-screen {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: var(--muted);
}

.loader {
  width: 36px;
  height: 36px;
  border: 4px solid #edf0f5;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: 8px;
  background: #101828;
  color: white;
  box-shadow: var(--shadow);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .brand span:not(.brand-mark),
  .nav-item span:last-child,
  .role-card {
    display: none;
  }

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

  .dashboard-grid,
  .command-panel,
  .today-hero,
  .today-layout,
  .admin-grid,
  .strategy-layout,
  .split-layout,
  .split-layout.wide-left,
  .diagnostic-layout,
  .diagnostic-columns,
  .production-control-grid,
  .review-layout,
  .delivery-command {
    grid-template-columns: 1fr;
  }

  .workflow-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .sidebar {
    padding-inline: 12px;
  }
}

@media (min-width: 721px) and (max-width: 960px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 20px;
  }

  .search-box {
    max-width: none;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .page {
    padding: 22px 20px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: auto;
    padding: 10px 12px 8px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  }

  .brand {
    padding: 0;
    border-bottom: 0;
  }

  .brand span:not(.brand-mark) {
    display: block;
  }

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

  .brand strong {
    font-size: 15px;
  }

  .brand small {
    font-size: 12px;
  }

  .nav {
    display: flex;
    gap: 8px;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border);
    background: white;
    font-size: 13px;
  }

  .nav-item span:last-child {
    display: block;
    white-space: nowrap;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    font-size: 10px;
    border-radius: 5px;
  }

  .workspace {
    flex: 1;
  }

  .topbar {
    position: static;
    min-height: 0;
    padding: 12px 14px;
    gap: 10px;
  }

  .topbar,
  .page-heading,
  .workflow-guide__top {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    max-width: none;
  }

  .search-box input {
    height: 40px;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions .ghost-button,
  .topbar-actions time,
  .topbar-actions .avatar,
  .topbar-actions .icon-button {
    flex: 0 0 auto;
  }

  .topbar-actions .ghost-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .topbar-actions time {
    display: none;
  }

  .topbar-actions .avatar {
    display: none;
  }

  .page {
    padding: 16px 14px 24px;
  }

  .page-heading {
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-heading h1 {
    font-size: 24px;
    line-height: 1.2;
  }

  .page-heading p {
    line-height: 1.5;
  }

  .page-heading__meta {
    align-self: flex-start;
    max-width: 100%;
    border-radius: 8px;
    overflow-wrap: anywhere;
  }

  .today-stage-card {
    border-radius: 8px;
    text-align: left;
  }

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

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

  .next-action .badge {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }

  .kpi-grid,
  .kpi-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .kpi-card,
  .mini-stat {
    min-height: 112px;
    padding: 14px;
  }

  .kpi-card strong,
  .mini-stat strong {
    font-size: 26px;
    overflow-wrap: anywhere;
  }

  .kpi-card i {
    width: 32px;
    height: 32px;
    right: 14px;
    top: 14px;
  }

  .dashboard-grid,
  .today-layout,
  .strategy-layout,
  .split-layout,
  .split-layout.wide-left,
  .admin-grid,
  .review-layout,
  .side-stack {
    gap: 12px;
  }

  .workflow-guide,
  .delivery-command,
  .command-panel {
    padding: 14px;
  }

  .workflow-guide__top,
  .command-panel,
  .today-hero,
  .review-command,
  .workflow-guide__actions,
  .delivery-command__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .command-panel__stats {
    grid-template-columns: 1fr;
  }

  .command-panel__actions {
    min-width: 0;
  }

  .workflow-steps,
  .today-stage-flow,
  .workflow-guide__bottom {
    grid-template-columns: 1fr;
  }

  .workflow-step {
    min-height: 0;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    border-top-width: 1px;
    border-left: 4px solid #d0d5dd;
  }

  .workflow-step.is-done {
    border-left-color: var(--green);
  }

  .workflow-step.is-current {
    border-left-color: var(--orange);
  }

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

  .workflow-step small {
    min-height: 0;
  }

  .panel {
    padding: 14px;
    overflow: hidden;
  }

  .panel-header,
  .title-row,
  .package-header {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .panel-header h2 {
    font-size: 18px;
  }

  .panel-header .primary-button,
  .panel-header .ghost-button {
    width: 100%;
  }

  .panel-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .production-switches,
  .compact-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .source-form {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
  }

  tr[data-action] {
    cursor: pointer;
  }

  tr[data-action]:hover {
    background: white;
  }

  td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    min-height: 32px;
    padding: 6px 0;
    border-bottom: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  td small {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .bar-row {
    grid-template-columns: 86px minmax(80px, 1fr) 34px;
  }

  .activity-list li {
    grid-template-columns: 1fr auto;
  }

  .activity-list small {
    grid-column: 1 / -1;
  }

  .segmented {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .segmented::-webkit-scrollbar {
    display: none;
  }

  .segmented button {
    flex: 1 0 auto;
    white-space: nowrap;
  }

  .ratio-editor label {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .field-grid.two-col,
  .field-grid.three-col,
  .review-facts,
  .ratio-settings,
  .run-meta,
  .diagnostic-json-grid,
  .capability-grid {
    grid-template-columns: 1fr;
  }

  .strategy-footer,
  .button-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .switch {
    margin-right: 0;
  }

  .button-row .ghost-button,
  .button-row .primary-button,
  .strategy-footer .ghost-button,
  .strategy-footer .primary-button {
    width: 100%;
  }

  .review-queue {
    display: flex;
    max-height: none;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .review-queue::-webkit-scrollbar {
    display: none;
  }

  .review-queue button {
    flex: 0 0 min(280px, 84vw);
    grid-template-columns: 52px 1fr;
  }

  .review-queue img {
    width: 52px;
    height: 68px;
  }

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

  .file-list div {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
  }

  .form-grid,
  .rule-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .search-box span {
    display: none;
  }

  .search-box input {
    padding-left: 12px;
  }

  .page-heading__meta {
    width: 100%;
  }

  .panel-header .primary-button,
  .panel-header .ghost-button {
    min-height: 40px;
  }
}

@media (max-width: 420px) {
  .kpi-grid,
  .kpi-grid.compact,
  .image-strip {
    grid-template-columns: 1fr;
  }

  td {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (hover: none), (pointer: coarse) {
  button,
  .nav-item,
  .ghost-button,
  .primary-button,
  .icon-button,
  .segmented button,
  .compact-select {
    min-height: 44px;
  }
}
