:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-soft: #e8edf5;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-contrast: #0f1823;
  --surface-contrast-soft: #162233;
  --text: #152030;
  --muted: #64748b;
  --line: #d7e0ea;
  --line-strong: #c2cfdd;
  --accent: #3d7a6b;
  --accent-strong: #2b6154;
  --accent-soft: rgba(61, 122, 107, 0.12);
  --shadow: 0 14px 36px rgba(15, 23, 35, 0.07);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 40px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI Variable", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(61, 122, 107, 0.08), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
}

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

button,
.btn,
.nav-link {
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
}

textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: rgba(61, 122, 107, 0.54);
  box-shadow: 0 0 0 4px rgba(61, 122, 107, 0.12);
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

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

h1,
h2,
h3 {
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(32px, 4.2vw, 46px);
  line-height: 1.04;
}

h2 {
  font-size: 24px;
  line-height: 1.1;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  line-height: 1.65;
}

.admin-layout {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 28px 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(61, 122, 107, 0.28), transparent 24%),
    linear-gradient(180deg, #111b27 0%, var(--surface-contrast) 100%);
  color: #e9f0f7;
}

.brand-block {
  display: grid;
  gap: 6px;
}

.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-meta,
.sidebar-footer__label,
.admin-eyebrow,
.stat-card__label,
.inline-note {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand-meta,
.sidebar-footer span {
  color: rgba(233, 240, 247, 0.68);
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 240, 247, 0.28) transparent;
}

.nav-group-label {
  margin: 12px 10px 0;
  color: rgba(233, 240, 247, 0.46);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: rgba(233, 240, 247, 0.76);
  font-weight: 700;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.is-active {
  color: #fff;
  border-color: rgba(233, 240, 247, 0.16);
  background: rgba(61, 122, 107, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-link__badge {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  padding-inline: 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 11px;
  font-weight: 800;
}

.nav-link__badge.is-critical {
  background: rgba(248, 113, 113, 0.2);
  color: #fecaca;
}

.nav-link__badge.is-warning {
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  align-self: end;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(233, 240, 247, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-footer strong {
  font-size: 18px;
}

.admin-workspace {
  min-width: 0;
  padding: 28px 32px 40px;
}

.admin-topbar,
.panel-head,
.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.admin-topbar {
  margin-bottom: 28px;
}

.admin-topbar__copy {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.admin-eyebrow {
  color: var(--accent-strong);
}

.admin-user-card {
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow);
}

.admin-user-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-main {
  display: grid;
  gap: 24px;
}

.stats-grid,
.two-col,
.three-col,
.zone-editor-layout,
.field-row {
  display: grid;
  gap: 20px;
}

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

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

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

.two-col {
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
  align-items: start;
}

.two-col--wide {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

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

.stat-card,
.panel,
.login-card,
.login-aside {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.stat-card {
  display: grid;
  gap: 10px;
  padding: 22px;
}

.stat-card strong {
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.stat-card__label {
  color: var(--accent-strong);
}

.stat-card--accent {
  background: linear-gradient(180deg, rgba(61, 122, 107, 0.12), rgba(255, 255, 255, 0.96));
}

.panel {
  padding: 24px;
  display: grid;
  gap: 20px;
}

.panel--form {
  gap: 18px;
}

.panel--nested {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
}

.panel-head {
  align-items: center;
}

.panel-head--compact {
  margin-top: 6px;
}

.inline-note {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.sidebar-footer span,
.sidebar-footer strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(61, 122, 107, 0.04);
}

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

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

.sidebar-toggle {
  display: none;
}

.table-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.table-pager__info {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}

.form-fieldset {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.form-fieldset legend {
  padding: 0 6px;
  font-weight: 600;
}

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

@media (max-width: 720px) {
  .form-row-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.catalog-filter-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.catalog-filter-form__actions {
  align-self: end;
}

.form-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.form-section h3 {
  margin-bottom: 2px;
}

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

.owner-filter-form {
  grid-template-columns: minmax(160px, 220px) auto auto;
  align-items: end;
}

.owner-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.owner-profile-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.owner-profile-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.owner-profile-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.owner-profile-card dl div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #fff;
}

.owner-profile-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.owner-profile-card dd {
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.owner-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.owner-chip-list span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(22, 34, 51, 0.08);
  color: var(--surface-contrast);
  font-size: 12px;
  font-weight: 700;
}

.owner-ranked-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.owner-ranked-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.owner-ranked-list span {
  color: var(--muted);
}

.ops-detail-list,
.ops-command-list,
.ops-backup-summary {
  display: grid;
  gap: 12px;
}

.ops-detail-list {
  margin: 0;
}

.ops-detail-list div {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.ops-detail-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ops-detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.ops-command-list input {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
}

.ops-command-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  color: var(--muted);
}

.ops-command-row input {
  min-width: 0;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.quick-filter-row a {
  text-decoration: none;
}

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

.ops-backup-summary div {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.ops-backup-summary strong {
  font-size: 16px;
}

.ops-backup-summary p {
  margin: 0;
  color: var(--muted);
}

.checkbox-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.checkbox-row span {
  color: var(--text);
  font-weight: 600;
}

.checkbox-row.compact {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 12px;
}

.entity-list,
#zone-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.entity-list li,
#zone-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.entity-list--compact {
  margin-top: 10px;
}

.entity-list strong,
#zone-list strong {
  display: block;
}

.entity-list span,
#zone-list span,
.empty-copy {
  color: var(--muted);
}

.table-wrap::before {
  content: "Гортайте таблицю горизонтально, якщо потрібно";
  display: none;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.complex-media-layout {
  align-items: start;
}

.complex-media-list,
.complex-media-card,
.complex-media-card__head,
.complex-media-card__grid,
.complex-media-preview {
  display: grid;
  gap: 14px;
}

.complex-media-list {
  gap: 18px;
}

.complex-media-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.complex-media-card__head {
  gap: 4px;
}

.complex-media-card__head strong {
  font-size: 18px;
}

.complex-media-card__head span {
  color: var(--muted);
  font-size: 13px;
}

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

.complex-media-preview {
  gap: 10px;
  color: var(--text);
}

.complex-media-preview span,
.form-hint {
  color: var(--muted);
  font-size: 13px;
}

.complex-media-preview img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.form-hint {
  margin: 0;
  line-height: 1.6;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge.is-available,
.status-badge.is-contacted,
.status-badge.is-sent,
.status-badge.is-success {
  background: rgba(45, 124, 95, 0.12);
  color: #24654f;
}

.status-badge.is-reserved,
.status-badge.is-processing,
.status-badge.is-pending,
.status-badge.is-partial_failed {
  background: rgba(188, 136, 40, 0.14);
  color: #916723;
}

.status-badge.is-sold,
.status-badge.is-failed {
  background: rgba(176, 90, 80, 0.12);
  color: #a24a40;
}

.status-badge.is-hidden,
.status-badge.is-archived,
.status-badge.is-skipped {
  background: rgba(100, 116, 139, 0.12);
  color: #526174;
}

.status-badge.is-role {
  background: rgba(22, 34, 51, 0.08);
  color: var(--surface-contrast);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(61, 122, 107, 0.14);
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary,
.btn-ghost {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.btn.secondary:hover,
.btn-ghost:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.btn.danger {
  background: rgba(191, 68, 68, 0.1);
  color: #9f2f2f;
  border-color: rgba(191, 68, 68, 0.28);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  border-color: rgba(233, 240, 247, 0.12);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(233, 240, 247, 0.18);
}

.btn-block {
  width: 100%;
}

.btn-small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form select,
.inline-form input[type="datetime-local"],
.inline-form input:not([type]) {
  min-width: 170px;
  min-height: 38px;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.editor-head {
  align-items: center;
}

.zone-editor-layout {
  grid-template-columns: minmax(0, 1.4fr) 360px;
  align-items: start;
}

.editor-stage {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(61, 122, 107, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(61, 122, 107, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #eef4fb 0%, #f8fbff 100%);
  background-size: 28px 28px, 28px 28px, auto;
}

#editor-image,
#editor-overlay {
  width: 100%;
  display: block;
}

#editor-overlay {
  position: absolute;
  inset: 0;
}

#editor-overlay polygon,
#editor-overlay polyline {
  transition: opacity 160ms ease, stroke-width 160ms ease;
}

#editor-overlay polygon:hover {
  opacity: 0.94;
}

.editor-actions {
  display: grid;
  gap: 10px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(61, 122, 107, 0.14), transparent 24%),
    linear-gradient(180deg, #eef4fb 0%, #f5f8fc 100%);
}

.login-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 24px;
}

.login-aside,
.login-card {
  padding: 32px;
}

.login-aside {
  background:
    radial-gradient(circle at top left, rgba(61, 122, 107, 0.28), transparent 26%),
    linear-gradient(180deg, #101823 0%, #152233 100%);
  color: #eff5fb;
}

.login-aside p,
.login-aside span {
  color: rgba(239, 245, 251, 0.78);
}

.login-aside .admin-eyebrow {
  color: #9fd3c7;
}

.login-aside__meta {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-aside__meta div {
  padding: 18px;
  border: 1px solid rgba(239, 245, 251, 0.1);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.login-aside__meta strong {
  display: block;
  margin-bottom: 8px;
}

.login-card {
  display: grid;
  align-content: center;
  gap: 16px;
}

.login-card__head {
  display: grid;
  gap: 8px;
}

.flash.error {
  padding: 12px 14px;
  border: 1px solid rgba(176, 90, 80, 0.16);
  border-radius: 14px;
  background: rgba(254, 226, 226, 0.9);
  color: #9c2f2f;
}

.flash.success {
  padding: 12px 14px;
  border: 1px solid rgba(64, 128, 89, 0.16);
  border-radius: 14px;
  background: rgba(230, 244, 235, 0.9);
  color: #285c3a;
}

.success-banner {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-color: rgba(64, 128, 89, 0.16);
  background: rgba(230, 244, 235, 0.9);
  color: #285c3a;
}

.success-banner > strong,
.success-banner > span {
  grid-column: 1 / -1;
}

.copy-field {
  color: #285c3a;
}

.copy-field input {
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

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

.settings-logo-preview,
.admin-image-grid,
.admin-image-card {
  display: grid;
  gap: 12px;
}

.settings-logo-preview {
  max-width: 220px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.settings-logo-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-logo-preview img {
  max-height: 76px;
  object-fit: contain;
}

.admin-image-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: var(--space-4);
}

.admin-image-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.admin-image-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: #fff;
}

.factory-safety-banner,
.factory-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.factory-safety-banner {
  padding: 18px 20px;
  border: 1px solid rgba(45, 124, 95, 0.28);
  border-radius: var(--radius-lg);
  background: rgba(45, 124, 95, 0.08);
}

.factory-safety-banner div,
.factory-result-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-safety-banner strong {
  font-size: 16px;
}

.factory-queue-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.factory-queue-summary div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
}

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

.factory-queue-summary dt,
.factory-job-preset > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.factory-queue-summary dd {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.factory-job-form {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(230px, 0.46fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.factory-job-form > label,
.factory-job-preset {
  min-width: 0;
}

.factory-job-preset {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 44px;
}

.factory-job-preset strong,
.factory-job-preset small {
  overflow-wrap: anywhere;
}

.factory-job-preset small {
  color: var(--muted);
}

.factory-job-form .btn {
  white-space: nowrap;
}

.factory-job-form :disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.factory-spec-scope {
  margin: -4px 0 0;
}

.factory-job-table {
  min-width: 1040px;
}

.factory-job-table th:nth-child(1) {
  width: 22%;
}

.factory-job-table th:nth-child(2) {
  width: 28%;
}

.factory-job-table th:nth-child(3) {
  width: 34%;
}

.factory-job-table th:nth-child(4) {
  width: 16%;
}

.factory-job-progress {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.factory-job-progress progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.16);
  accent-color: var(--accent);
}

.factory-job-progress strong {
  font-size: 12px;
  text-align: right;
}

.factory-job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.factory-job-actions form {
  margin: 0;
}

.factory-job-actions .is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.factory-report-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.factory-report-gate {
  align-items: center;
}

.factory-safety-banner .factory-report-badges {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.factory-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.factory-report-summary div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 16px;
  background: var(--surface-soft);
}

.factory-report-summary dt,
.factory-report-metrics dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.factory-report-summary dd,
.factory-report-metrics dd {
  min-width: 0;
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.factory-report-summary small,
.factory-report-metrics small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.factory-report-document-table {
  min-width: 780px;
}

.factory-report-document-table th:nth-child(1) {
  width: 34%;
}

.factory-report-document-table th:nth-child(2) {
  width: 18%;
}

.factory-report-issues {
  display: grid;
  gap: 7px;
  padding: 14px 16px;
  border-left: 3px solid #b05a50;
  background: rgba(176, 90, 80, 0.07);
}

.factory-report-issues ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.factory-report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--line);
}

.factory-report-metrics div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  background: var(--surface);
}

.factory-report-metrics--qa {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-report-metrics--validation {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.factory-report-metrics--validation div:last-child {
  grid-column: span 2;
}

.factory-report-qa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}

.factory-report-qa-block {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding-top: 18px;
}

.factory-report-qa-block + .factory-report-qa-block {
  margin-left: 22px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
}

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

.factory-report-section-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-report-section-head h3,
.factory-report-section-head p {
  margin: 0;
}

.factory-report-section-head h3 {
  font-size: 17px;
}

.factory-report-section-head p {
  color: var(--muted);
  font-size: 12px;
}

.factory-report-package-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: start;
}

.factory-report-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.factory-report-preview img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-contrast);
}

.factory-report-preview figcaption {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.factory-report-package-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.factory-report-package-metrics div:last-child {
  grid-column: 1 / -1;
}

.factory-report-guardrails {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
}

.factory-browser-attempt {
  display: grid;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.factory-browser-attempt-progress {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 48px minmax(120px, auto);
  align-items: center;
  gap: 10px;
}

.factory-browser-attempt-progress progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: rgba(100, 116, 139, 0.16);
  accent-color: var(--accent);
}

.factory-browser-attempt-progress strong {
  font-size: 12px;
  text-align: right;
}

.factory-browser-attempt-progress span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.factory-browser-attempt-metrics,
.factory-browser-evidence-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.factory-browser-evidence {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.factory-browser-evidence img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-contrast);
}

.factory-browser-evidence figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 12px;
}

.factory-browser-evidence figcaption strong {
  color: var(--text);
}

.factory-browser-start-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.factory-priority-summary,
.factory-coverage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.factory-priority-summary div,
.factory-coverage-summary div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 15px 18px;
}

.factory-priority-summary div + div,
.factory-coverage-summary div + div {
  border-left: 1px solid var(--line);
}

.factory-priority-summary dt,
.factory-coverage-summary dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.factory-priority-summary dd,
.factory-coverage-summary dd {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
}

.factory-priority-table {
  min-width: 820px;
}

.factory-priority-table th:first-child {
  width: 70px;
}

.factory-priority-table th:nth-child(2) {
  width: 32%;
}

.factory-priority-table th:nth-child(3) {
  width: 24%;
}

.factory-priority-number {
  display: inline-block;
  min-width: 2ch;
  color: var(--accent-strong);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.factory-priority-review {
  display: inline-block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 800;
}

.factory-coverage-note {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.factory-coverage-building {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding-top: 4px;
}

.factory-coverage-building + .factory-coverage-building {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.factory-coverage-building-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.factory-coverage-building-head > div {
  display: grid;
  gap: 2px;
}

.factory-coverage-building-head h3,
.factory-coverage-building-head p {
  margin: 0;
}

.factory-coverage-building-head h3 {
  font-size: 24px;
}

.factory-coverage-building-head p {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.factory-coverage-table {
  min-width: 1080px;
}

.factory-coverage-table th:nth-child(1) {
  width: 22%;
}

.factory-coverage-table th:nth-child(2),
.factory-coverage-table th:nth-child(3) {
  width: 15%;
}

.factory-coverage-table th:nth-child(4),
.factory-coverage-table th:nth-child(5) {
  width: 24%;
}

.factory-candidate-table {
  min-width: 980px;
}

.factory-candidate-thumb {
  width: 112px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.factory-inline-error {
  color: #a24a40;
  font-size: 13px;
  font-weight: 700;
}

.factory-break {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.factory-coverage-review-link {
  margin-top: 9px;
}

.factory-review-gates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.factory-review-gates > div {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 16px;
}

.factory-review-gates > div + div {
  border-left: 1px solid var(--line);
}

.factory-review-gates dt {
  font-size: 13px;
  font-weight: 800;
}

.factory-review-gates dd {
  margin: 0;
}

.factory-review-gates small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.factory-group-occurrence-table {
  min-width: 820px;
}

.factory-group-occurrence-table th:first-child {
  width: 28%;
}

.factory-evidence-table {
  min-width: 980px;
}

.factory-evidence-table th:first-child {
  width: 23%;
}

.factory-evidence-table th:nth-child(2),
.factory-evidence-table th:nth-child(3) {
  width: 19%;
}

.factory-evidence-table th:nth-child(4) {
  width: 17%;
}

.factory-evidence-table th:nth-child(5) {
  width: 22%;
}

.factory-evidence-table td {
  vertical-align: top;
}

.factory-machine-checks {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.factory-machine-checks summary {
  cursor: pointer;
  font-weight: 800;
}

.factory-machine-checks div {
  display: grid;
  gap: 3px;
  margin-top: 6px;
}

.factory-evidence-blocker {
  margin-top: 2px;
  border-left-color: #a66b2e;
}

.factory-receipt-table {
  min-width: 900px;
}

.factory-receipt-table th:first-child {
  width: 24%;
}

.factory-receipt-table th:nth-child(2) {
  width: 24%;
}

.factory-receipt-table th:nth-child(3) {
  width: 30%;
}

.factory-receipt-table th:nth-child(4) {
  width: 22%;
}

.factory-receipt-table td {
  vertical-align: top;
}

.factory-receipt-overlay {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}

.factory-receipt-overlay img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.factory-receipt-overlay figcaption {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.factory-review-candidates {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.factory-review-section-head,
.factory-review-comparison-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.factory-review-section-head > div,
.factory-review-comparison-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.factory-review-section-head h2,
.factory-review-section-head p,
.factory-review-comparison-head h3,
.factory-review-comparison-head p {
  margin: 0;
}

.factory-review-section-head h2 {
  font-size: 20px;
}

.factory-review-section-head p,
.factory-review-comparison-head p {
  color: var(--muted);
  font-size: 13px;
}

.factory-review-comparison-list {
  display: grid;
  gap: 14px;
}

.factory-review-comparison {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.factory-review-comparison[data-match-status="review-ready"] {
  border-color: rgba(45, 124, 95, 0.36);
}

.factory-review-comparison-head h3 {
  font-size: 18px;
}

.factory-review-comparison-body {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 22px;
  align-items: start;
}

.factory-review-preview {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.factory-review-preview img,
.factory-review-preview-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.factory-review-preview img {
  object-fit: contain;
}

.factory-review-preview-empty {
  display: grid;
  place-items: center;
  padding: 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.factory-review-preview figcaption {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.factory-review-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.factory-review-signals > div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.factory-review-signals > div:nth-child(odd) {
  padding-left: 0;
}

.factory-review-signals > div:nth-child(even) {
  padding-right: 0;
  border-left: 1px solid var(--line);
}

.factory-review-signals dt {
  font-size: 12px;
  font-weight: 800;
}

.factory-review-signals dd {
  display: grid;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.factory-review-signals small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.factory-review-signals .factory-review-signal-blocker {
  grid-column: 1 / -1;
  padding: 13px 0;
  border-left: 0;
}

.factory-review-rejected {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.factory-review-rejected summary {
  font-weight: 800;
  cursor: pointer;
}

.factory-review-rejected > p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.factory-group-rejected-table,
.factory-group-alternates-table {
  min-width: 780px;
}

.factory-action-form,
.factory-switch-form {
  display: grid;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.factory-action-form {
  grid-template-columns: minmax(280px, 1fr) minmax(120px, 0.28fr) minmax(150px, 0.32fr) auto;
}

.factory-switch-form {
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
}

.factory-action-form .btn,
.factory-switch-form .btn {
  white-space: nowrap;
}

.factory-action-form :disabled,
.factory-switch-form :disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.factory-result-head {
  padding-top: 4px;
}

.factory-result-head h3 {
  overflow-wrap: anywhere;
}

.factory-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
}

.factory-details div {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.factory-details div:last-child:nth-child(4) {
  grid-column: 1 / -1;
}

.factory-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.factory-details dd {
  margin: 0;
  font-weight: 700;
}

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

.factory-preview-grid figure {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.factory-preview-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-contrast);
}

.factory-preview-grid figcaption {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.factory-issues {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px 18px 14px 36px;
  border: 1px solid rgba(176, 90, 80, 0.22);
  border-radius: var(--radius-md);
  background: rgba(176, 90, 80, 0.08);
  color: #8c4038;
}

.factory-binding-list {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.factory-binding-list summary {
  cursor: pointer;
  font-weight: 800;
}

.factory-binding-list p {
  margin-top: 12px;
}

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

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

  .two-col,
  .two-col--wide,
  .zone-editor-layout,
  .login-layout {
    grid-template-columns: 1fr;
  }

  .complex-media-card__grid {
    grid-template-columns: 1fr;
  }

  .factory-action-form,
  .factory-job-form,
  .factory-switch-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .factory-report-package-layout {
    grid-template-columns: 1fr;
  }

  .factory-browser-attempt-metrics,
  .factory-browser-evidence-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .factory-priority-summary,
  .factory-coverage-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .factory-review-gates > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .factory-review-gates > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .factory-priority-summary div:nth-child(3),
  .factory-coverage-summary div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .factory-priority-summary div:nth-child(4),
  .factory-coverage-summary div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .factory-action-form .btn,
  .factory-job-form .btn,
  .factory-switch-form .btn {
    width: 100%;
  }
}

@media (max-width: 1040px) {
  .admin-layout,
  .three-col {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    gap: 18px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    overflow: visible;
    padding-right: 0;
  }

  /* Collapse the menu behind a toggle so page content is reachable without
     scrolling past the whole nav on small screens. */
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }

  .sidebar:not(.is-open) .sidebar-nav,
  .sidebar:not(.is-open) .sidebar-footer {
    display: none;
  }

  .admin-workspace {
    padding-top: 12px;
  }

  .leads-col-optional {
    display: none;
  }
}

@media (max-width: 720px) {
  .admin-workspace,
  .login-page {
    padding: 18px;
  }

  .admin-topbar,
  .panel-head,
  .editor-head,
  .field-row,
  .inline-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  .stats-grid,
  .field-row,
  .owner-kpi-grid,
  .owner-filter-form,
  .ops-backup-summary {
    grid-template-columns: 1fr;
  }

  .panel,
  .login-card,
  .login-aside {
    padding: 20px;
  }

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

  .table-wrap::before {
    display: block;
  }

  .nav-link {
    min-height: 42px;
    border-radius: 14px;
  }

  .inline-form .btn,
  .inline-form select,
  .inline-form input,
  .success-banner .btn {
    width: 100%;
  }

  .success-banner,
  .stats-grid--compact {
    grid-template-columns: 1fr;
  }

  .factory-review-comparison-body {
    grid-template-columns: 1fr;
  }

  .factory-safety-banner,
  .factory-result-head {
    display: grid;
    align-items: start;
  }

  .factory-safety-banner .factory-report-badges {
    justify-content: flex-start;
  }

  .factory-action-form,
  .factory-job-form,
  .factory-switch-form,
  .factory-details,
  .factory-preview-grid {
    grid-template-columns: 1fr;
  }

  .factory-report-summary,
  .factory-report-package-metrics,
  .factory-report-metrics--validation,
  .factory-report-metrics--qa,
  .factory-report-qa-grid {
    grid-template-columns: 1fr;
  }

  .factory-browser-attempt-metrics,
  .factory-browser-evidence-metrics,
  .factory-browser-evidence-grid {
    grid-template-columns: 1fr;
  }

  .factory-browser-attempt-progress {
    grid-template-columns: minmax(0, 1fr) 48px;
  }

  .factory-browser-attempt-progress span {
    grid-column: 1 / -1;
    text-align: left;
  }

  .factory-browser-start-form {
    align-items: stretch;
  }

  .factory-browser-start-form .btn {
    width: 100%;
  }

  .factory-report-metrics--validation div:last-child,
  .factory-report-package-metrics div:last-child {
    grid-column: auto;
  }

  .factory-report-qa-block + .factory-report-qa-block {
    margin-top: 22px;
    margin-left: 0;
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .factory-report-section-head {
    display: grid;
  }

  .factory-priority-summary,
  .factory-coverage-summary {
    grid-template-columns: 1fr;
  }

  .factory-queue-summary {
    grid-template-columns: 1fr;
  }

  .factory-queue-summary div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .factory-priority-summary div + div,
  .factory-priority-summary div:nth-child(3),
  .factory-coverage-summary div + div,
  .factory-coverage-summary div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .factory-coverage-building-head {
    display: grid;
    align-items: start;
  }

  .factory-coverage-building-head p {
    text-align: left;
  }

  .factory-review-section-head,
  .factory-review-comparison-head {
    display: grid;
  }

  .factory-review-gates,
  .factory-review-signals {
    grid-template-columns: 1fr;
  }

  .factory-review-gates > div + div,
  .factory-review-gates > div:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .factory-review-signals > div,
  .factory-review-signals > div:nth-child(odd),
  .factory-review-signals > div:nth-child(even),
  .factory-review-signals .factory-review-signal-blocker {
    grid-column: auto;
    padding: 13px 0;
    border-left: 0;
  }

  .factory-details div:last-child:nth-child(4) {
    grid-column: auto;
  }
}
