﻿button, input, select { font: inherit; }
button, select, input[type="checkbox"] { cursor: pointer; }
[hidden] { display: none !important; }

.page-shell {
  width: min(1680px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  transition: width var(--ease-ui), margin var(--ease-ui), padding var(--ease-ui);
}
body.has-draft-bar .page-shell { padding-bottom: 112px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.eyebrow { color: var(--ink-3); font-size: 13px; font-weight: 800; }
h1 { margin: 5px 0 0; font-size: 32px; line-height: 1.12; color: var(--ink); }
.topbar h1 { margin-top: 0; }
h2 { margin: 0; font-size: 18px; color: var(--ink); }
p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

.topbar-actions, .dialog-actions, .table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.primary-button, .ghost-button, .chip-button, .text-button, .row-button, .icon-button, .th-filter {
  border-radius: 6px;
  min-height: 28px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 11px;
  transition: background-color .14s, border-color .14s, color .14s;
}
.primary-button { padding: 0 10px; background: var(--primary); color: #fff; box-shadow: none; }
.primary-button:hover:not(:disabled) { background: #0051d8; }
.ghost-button, .chip-button { padding: 0 10px; background: var(--surface); color: var(--ink-2); border-color: var(--line-s); }
.ghost-button:hover:not(:disabled), .chip-button:hover { border-color: var(--line); background: var(--surface-2); }
.text-button, .row-button { background: transparent; color: var(--primary); padding: 0 8px; border: 0; }
.row-button { min-height: 26px; font-size: 11px; }
.icon-button { width: 28px; min-height: 28px; border: 0; background: var(--surface-2); color: var(--ink-2); font-size: 15px; }
button:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.admin-layout { display: grid; gap: 12px; }
.summary-strip { display: block; }
.surface-card {
  background: var(--surface);
  border: 1px solid var(--line-s);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(15,23,42,.06);
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 16px 12px; }

.control-scope-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  background: var(--surface-2);
}
.control-scope-field { display: grid; gap: 6px; }
.control-scope-field > span { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.control-scope-field select { min-height: 34px; background: var(--surface); }
.control-scope-query { min-width: 68px; min-height: 34px; }
.control-scope-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 54px 24px;
  color: var(--ink-3);
  text-align: center;
}
.control-scope-empty strong { color: var(--ink); font-size: 16px; }
.control-scope-empty span { font-size: 12px; font-weight: 600; }

.work-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.table-panel { overflow: hidden; }
.draft-action-bar {
  position: fixed;
  left: 236px;
  right: 16px;
  bottom: 16px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  min-height: 68px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line-s);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(16, 42, 67, 0.2);
}
.draft-bar-summary {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 800;
}
.draft-bar-summary strong {
  color: var(--ink);
  font-size: 18px;
}
.draft-bar-actions { display: flex; align-items: center; gap: 8px; }
.draft-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-count-text {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.control-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}
.overview-primary,
.overview-metric {
  display: grid;
  grid-template-rows: 16px 27px;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-height: 72px;
  border: 0;
  padding: 13px 16px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}
.overview-primary { background: var(--surface-2); }
.overview-primary span,
.overview-metric span { color: var(--ink-3); font-size: 11px; font-weight: 800; }
.overview-metric { border-left: 1px solid var(--line-s); }
.overview-primary span,
.overview-metric span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  line-height: 16px;
  white-space: nowrap;
}
.overview-primary strong,
.overview-metric strong {
  display: block;
  min-width: 2ch;
  color: var(--ink);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  line-height: 27px;
}
.overview-primary:hover,
.overview-metric:hover { background: var(--primary-soft); }
.overview-primary.active,
.overview-metric.active { background: var(--primary-soft); box-shadow: inset 0 -3px 0 var(--primary); }
.floor-group-row td { padding: 0; border-top: 8px solid var(--line-s); border-bottom: 1px solid var(--line-s); background: var(--surface-2); }
.floor-group-row:first-child td { border-top-width: 0; }
.floor-group-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.floor-group-toggle {
  display: grid;
  grid-template-columns: 20px auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 8px 13px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
}
.floor-group-toggle:hover { background: var(--primary-soft); }
.floor-capability-button {
  min-height: 26px;
  margin-right: 13px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}
.floor-capability-button:hover { background: var(--surface-2); }
.floor-group-toggle strong { color: var(--ink); font-size: 15px; }
.floor-group-chevron { color: var(--primary); font-size: 20px; line-height: 1; text-align: center; }
.space-setting-row td { background: var(--surface); }
.space-setting-row:hover td { background: var(--surface-2); }
.table-head { border-bottom: 1px solid var(--line-s); }
.table-control-group { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.table-control-label { color: var(--ink-3); font-size: 11px; font-weight: 700; white-space: nowrap; }
.floor-select-control { flex-wrap: nowrap; }
.floor-select-control select {
  width: 120px;
  min-height: 30px;
  border-color: rgba(0,87,231,.28);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.compact-control-button { min-height: 26px; padding: 0 9px; border-radius: 6px; font-size: 11px; }
.segmented-buttons { display: inline-flex; align-items: center; }
.segmented-buttons .ghost-button { border-radius: 0; }
.segmented-buttons .ghost-button:first-child { border-radius: 6px 0 0 6px; }
.segmented-buttons .ghost-button:last-child { margin-left: -1px; border-radius: 0 6px 6px 0; }
.table-control-divider { align-self: stretch; width: 1px; min-height: 30px; background: var(--line-s); }
.filter-control-group { justify-content: flex-end; }
.selection-apply-bar { display: grid; grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr) minmax(240px, 1fr) auto; gap: 10px; align-items: end; padding: 12px 16px; border-bottom: 1px solid var(--line-s); background: var(--surface-2); }
.selection-apply-bar strong { display: block; color: var(--ink); font-size: 14px; }
.selection-apply-bar span { color: var(--muted); font-size: 12px; }
.selection-apply-bar .selection-compatibility-notice { display: block; margin-top: 4px; color: var(--bad); font-size: 11px; font-weight: 750; line-height: 1.4; }
.selection-compatibility-notice button { min-height: 0; border: 0; padding: 0; background: transparent; color: var(--primary); font-size: 11px; font-weight: 850; text-decoration: underline; }
.apply-toggle { display: grid; grid-template-columns: auto minmax(120px, 1fr); align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; font-weight: 850; }
.apply-toggle select { min-height: 32px; }
.apply-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.table-tools { justify-content: flex-end; }
.th-tools { display: inline-flex; align-items: center; gap: 8px; }
.table-search-inline { display: inline-grid; grid-template-columns: 26px minmax(110px, 140px); align-items: center; min-height: 32px; border: 1px solid var(--line-s); border-radius: 6px; background: var(--surface); overflow: hidden; }
.table-search-inline span { display: grid; place-items: center; height: 100%; color: var(--primary); font-size: 20px; font-weight: 900; }
.space-search { width: 100%; min-height: 32px; border: 0 !important; padding: 0 8px 0 2px; background: transparent; color: var(--ink); font-size: 12px; outline: 0 !important; box-shadow: none !important; appearance: none; -webkit-appearance: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.active-filter-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 9px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 850; }
.active-filter-chip button { border: 0; background: transparent; color: var(--primary); font-weight: 900; padding: 0; min-height: 0; }
.unsaved-pill { min-height: 32px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 900; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 1200px; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-s); text-align: left; vertical-align: middle; }
th { color: var(--ink-3); font-size: 11px; font-weight: 700; background: var(--surface-2); }
td { font-size: 12px; font-weight: 600; background: var(--surface); }
tr.dirty td { background: var(--warn-soft); vertical-align: top; }
tr.failed td { background: var(--bad-soft); }
.check-col { width: 44px; text-align: center; }
.space-name-col { width: 9.5em; }
.table-wrap th:nth-child(3) { width: 126px; }
.table-wrap th:nth-child(4),
.table-wrap th:nth-child(5) { width: 170px; }
.table-wrap th:nth-child(6) { width: 112px; }
.table-wrap th:nth-child(7) { width: 210px; }
.table-wrap th:nth-child(8) { width: 130px; }
.space-name {
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}
.muted { color: var(--muted); font-size: 12px; }
.cell-edit { display: grid; gap: 6px; min-width: 154px; }
.change-note { color: var(--warn); font-size: 12px; font-weight: 800; }
.change-note-placeholder { visibility: hidden; }
.objective-support-notice { color: var(--bad); font-size: 11px; font-weight: 750; line-height: 1.45; }
.model-compatibility-notice { color: var(--bad); font-size: 11px; font-weight: 750; line-height: 1.45; }
.model-compatibility-notice button { min-height: 0; border: 0; padding: 0 0 0 4px; background: transparent; color: var(--primary); font-size: 11px; font-weight: 850; text-decoration: underline; }
.model-compatibility-link { justify-self: start; min-height: 0; border: 0; padding: 0; background: transparent; color: var(--ink-3); font-size: 11px; font-weight: 750; line-height: 1.35; text-align: left; text-decoration: underline; }
.model-compatibility-link:hover { color: var(--primary); }
.compatibility-available { color: var(--good); font-size: 11px; font-weight: 750; }
.compatibility-cell { display: grid; gap: 6px; min-width: 0; }
select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line-s);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
}
select:disabled { color: var(--ink-3); background: var(--surface-2); }

.th-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 8px;
  color: var(--ink-2);
  background: transparent;
  border-color: transparent;
}
.th-filter:hover, .th-filter.active { background: var(--primary-soft); color: var(--primary); border-color: rgba(0,87,231,.16); }
.th-filter span { font-size: 11px; }

.filter-popover {
  position: fixed;
  z-index: 50;
  width: 240px;
  max-width: calc(100vw - 24px);
  border: 1px solid var(--line-s);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 22px 54px rgba(18, 42, 68, 0.22);
  overflow: hidden;
}
.filter-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 8px 12px; border-bottom: 1px solid var(--line-s); color: var(--ink); }
.filter-option-list { display: grid; max-height: 310px; overflow: auto; padding: 8px; }
.filter-option { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); text-align: left; font-size: 13px; }
.filter-option:hover, .filter-option.active { background: var(--primary-soft); color: var(--primary); }
.filter-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.filter-option.active .filter-dot { background: var(--primary); }

.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.badge-normal { background: var(--good-soft); color: var(--good); }
.badge-check { background: var(--warn-soft); color: var(--warn); }
.badge-limit { background: var(--surface-2); color: var(--ink-2); }
.badge-fail, .badge-offline { background: var(--bad-soft); color: var(--bad); }
.badge-unsaved { background: var(--warn-soft); color: var(--warn); }
.badge-savefail { background: var(--bad-soft); color: var(--bad); }
.manage-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 100px; }

.draft-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 6px;
  padding: 10px 10px 12px;
  overflow: auto;
}
.draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  border: 1px solid var(--line-s);
  border-radius: 8px;
  background: var(--surface);
  padding: 7px 9px 8px;
}
.draft-card.failed { border-color: rgba(228,67,90,.35); background: var(--bad-soft); }
.draft-main { min-width: 0; }
.draft-title { color: var(--ink); font-size: 13px; font-weight: 900; line-height: 1.15; }
.draft-meta { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.15; }
.draft-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 5px; flex-wrap: nowrap; }
.draft-actions .badge { min-height: 20px; padding: 0 7px; font-size: 10px; }
.draft-actions .row-button { min-height: 20px; padding: 0 2px; font-size: 11px; line-height: 1; }
.draft-change-list { grid-column: 1 / -1; display: grid; gap: 2px; padding-top: 1px; }
.draft-change-row {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 20px;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.2;
}
.draft-change-label { color: var(--ink-3); font-weight: 850; }
.draft-change-before {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-3);
}
.draft-change-arrow { color: var(--warn); font-weight: 900; }
.draft-change-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.2;
}
.draft-failure-reason {
  grid-column: 1 / -1;
  color: var(--bad);
  font-size: 11px;
  line-height: 1.25;
}
.empty-state { display: grid; gap: 6px; justify-items: center; padding: 48px 16px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 16px; }
.empty-state span { font-size: 13px; }

.save-dialog,
.draft-review-dialog,
.capability-dialog,
.model-compatibility-dialog { border: 0; padding: 0; background: transparent; }
.capability-dialog[open],
.model-compatibility-dialog[open] {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  overflow: hidden;
}
.save-dialog::backdrop,
.draft-review-dialog::backdrop,
.capability-dialog::backdrop,
.model-compatibility-dialog::backdrop { background: rgba(15, 33, 52, 0.42); }
.dialog-card { width: min(720px, calc(100vw - 32px)); border-radius: 14px; background: var(--surface); border: 1px solid var(--line-s); box-shadow: 0 24px 70px rgba(14, 35, 57, 0.28); }
.draft-review-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(760px, calc(100vh - 40px)); overflow: hidden; }
.save-preview-list { min-height: 120px; }
.capability-dialog-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(760px, calc(100vh - 40px)); overflow: hidden; }
.capability-space-list { display: grid; align-content: start; gap: 8px; overflow: auto; padding: 12px 16px 16px; }
.capability-space-item { border: 1px solid var(--line-s); border-radius: 10px; background: var(--surface); overflow: hidden; }
.capability-space-item.is-unknown { border-color: rgba(217,119,6,.35); background: var(--warn-soft); }
.capability-space-heading { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line-s); }
.capability-space-heading strong { color: var(--ink); font-size: 13px; }
.capability-space-heading span { color: var(--ink-3); font-size: 11px; }
.capability-definition-list { margin: 0; padding: 3px 12px 7px; }
.capability-definition-list > div { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-s); font-size: 12px; line-height: 1.45; }
.capability-definition-list > div:last-child { border-bottom: 0; }
.capability-definition-list dt { color: var(--ink-3); font-weight: 850; }
.capability-definition-list dd { margin: 0; color: var(--ink); }
.capability-unconnected { margin: 0; padding: 12px; color: var(--warn); font-size: 12px; font-weight: 800; }
.model-compatibility-dialog-card { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; max-height: min(760px, calc(100vh - 40px)); overflow: hidden; }
.model-compatibility-tools { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-s); background: var(--surface-2); }
.model-compatibility-tools label { display: grid; gap: 5px; }
.model-compatibility-tools label > span { color: var(--ink-3); font-size: 11px; font-weight: 800; }
.model-compatibility-tools input,
.model-compatibility-tools select { width: 100%; min-height: 32px; border: 1px solid var(--line-s); border-radius: 6px; padding: 0 10px; background: var(--surface-2); color: var(--ink); font-size: 12px; font-weight: 500; }
.model-compatibility-list { overflow: auto; padding: 0 16px 16px; }
.compatibility-flat-list { border-top: 1px solid var(--line-s); }
.compatibility-flat-row { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(0, 1.35fr); gap: 20px; align-items: start; min-height: 46px; padding: 12px 4px; border-bottom: 1px solid var(--line-s); color: var(--ink); font-size: 12px; line-height: 1.45; }
.compatibility-flat-row.is-header { min-height: 38px; padding-top: 10px; padding-bottom: 8px; color: var(--ink-3); font-size: 11px; font-weight: 700; }
.compatibility-flat-row > strong { color: var(--ink); font-size: 12px; }
.compatibility-reason-text { color: var(--bad); font-weight: 750; }
.compatibility-reason-details summary { cursor: pointer; color: var(--bad); font-weight: 750; }
.compatibility-reason-details p { margin: 6px 0 0; color: var(--ink-2); font-size: 11px; }
.compatibility-model-group { border-bottom: 1px solid var(--line-s); }
.compatibility-model-group:first-child { border-top: 1px solid var(--line-s); }
.compatibility-model-group > summary { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 48px; padding: 11px 4px; cursor: pointer; list-style: none; }
.compatibility-model-group > summary::-webkit-details-marker { display: none; }
.compatibility-model-group > summary::before { content: "›"; color: var(--ink-3); font-size: 18px; font-weight: 900; line-height: 1; }
.compatibility-model-group[open] > summary::before { content: "⌄"; }
.compatibility-model-group > summary strong { color: var(--ink); font-size: 13px; }
.compatibility-model-group > summary span { color: var(--bad); font-size: 11px; font-weight: 800; white-space: nowrap; }
.compatibility-model-group[open] > summary { background: var(--surface-2); }
.compatibility-space-reasons { padding: 0 4px 8px 22px; }
.compatibility-space-reasons > div { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr); gap: 18px; padding: 9px 0; border-top: 1px solid var(--line-s); font-size: 12px; line-height: 1.45; }
.compatibility-space-reasons span { color: var(--ink-3); font-weight: 750; }
.compatibility-space-reasons strong { color: var(--bad); font-weight: 750; }
.dialog-actions { justify-content: flex-end; padding: 14px 16px 16px; border-top: 1px solid var(--line-s); }
.toast {
  position: fixed;
  left: 50%;
  top: 22px;
  z-index: 120;
  transform: translateX(-50%);
  max-width: min(840px, calc(100vw - 40px));
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 20px 32px;
  border: 1px solid var(--line-s);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 9px 28px rgba(16, 42, 67, 0.16);
}
.toast::before {
  content: "i";
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.toast.success::before { content: "✓"; background: var(--good); }
.toast.warning::before { content: "!"; background: var(--warn); }
.toast.error::before { content: "!"; background: var(--bad); }

@media (max-width: 1180px) {
  .draft-card { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  .selection-apply-bar { grid-template-columns: 1fr 1fr; }
  .selection-apply-bar .primary-button, .selection-apply-bar .ghost-button { width: 100%; }
  .apply-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }
  .sidebar { display: none; }
  .draft-action-bar { left: 16px; }
  .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
}

@media (max-width: 700px) {
  body.has-draft-bar .page-shell { padding-bottom: 190px; }
  .page-shell { width: min(100% - 20px, 1560px); padding-top: 12px; }
  .topbar, .section-head { align-items: flex-start; flex-direction: column; }
  .topbar-actions { width: 100%; }
  .topbar-actions button { flex: 1; }
  h1 { font-size: 25px; }
  .control-scope-toolbar { grid-template-columns: 1fr; }
  .control-scope-query { width: 100%; }
  .control-overview { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .model-compatibility-tools { grid-template-columns: 1fr; }
  .compatibility-flat-row,
  .compatibility-space-reasons > div { grid-template-columns: 1fr; gap: 4px; }
  .draft-action-bar { align-items: stretch; flex-direction: column; gap: 10px; }
  .draft-bar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .draft-bar-actions .primary-button { grid-column: 1 / -1; }
  .floor-group-toggle { grid-template-columns: 20px auto; }
  .selection-apply-bar { grid-template-columns: 1fr; }
  .table-tools { justify-content: flex-start; }
  .table-control-divider { display: none; }
  .filter-control-group { justify-content: flex-start; }
}













