:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #eef3f8;
  --ink: #172033;
  --muted: #64748b;
  --border: #d8e0ea;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #059669;
  --warning: #b7791f;
  --danger: #dc2626;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

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

.sidebar {
  background: #172033;
  color: #f8fafc;
  padding: 18px;
  overflow: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar h1, .sidebar h2, .sidebar h3 { margin: 0; }
.sidebar h1 { font-size: 1.1rem; }
.sidebar h2 { font-size: 0.95rem; margin-top: 20px; color: #bfdbfe; }

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 64px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--border);
}

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

.mobile-model-link { display: none; }

.share-mode #saveBtn,
.share-mode .sidebar > a[href="admin.html"] {
  display: none;
}

.canvas-area {
  min-height: 0;
  flex: 1;
  position: relative;
}

#canvas {
  width: 100%;
  height: calc(100vh - 64px);
}

.section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.field label {
  color: #cbd5e1;
  font-size: 0.82rem;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.sidebar input, .sidebar select, .sidebar textarea {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

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

.btn {
  border: 0;
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--panel-soft);
  color: var(--ink);
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.success { background: var(--success); color: #fff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.full { width: 100%; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 14px;
  padding: 20px;
}

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

.line-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}

.line-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.line-card p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 8px 0 0;
}

.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat { padding: 16px; }
.stat .label { color: var(--muted); font-size: 0.82rem; }
.stat .value { font-size: 1.7rem; font-weight: 750; margin-top: 4px; }

.panel { margin: 0 20px 20px; overflow: hidden; }
.panel-header {
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.panel-body { padding: 16px; overflow-x: auto; }

.project-filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.6fr) minmax(150px, .8fr) minmax(130px, .7fr);
  gap: 8px;
  width: min(720px, 65vw);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th { color: var(--muted); background: #f8fafc; font-size: 0.78rem; }
tr:hover td { background: #f8fbff; }

.project-table { min-width: 1180px; }
.project-table td { vertical-align: middle; }
.project-table .col-action { width: 100px; text-align: center; }
.project-table .col-center { text-align: center; }
.row-detail-btn { padding: 8px 10px; white-space: nowrap; }
.serial-link { color: var(--primary); }
.drawing-ready {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #dcfce7;
  color: #15803d;
  font-weight: 900;
}
.drawing-empty { color: var(--muted); }

.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.fail { background: #fee2e2; color: #991b1b; }
.badge.survey { background: #e0f2fe; color: #075985; }
.badge.design { background: #ede9fe; color: #5b21b6; }
.badge.pricing { background: #fef3c7; color: #92400e; }
.badge.production { background: #ffedd5; color: #9a3412; }
.badge.installation { background: #dbeafe; color: #1d4ed8; }
.badge.completed { background: #e2e8f0; color: #334155; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 0.22s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
  background: rgba(15, 23, 42, 0);
  opacity: 0;
  transition: opacity .2s ease, background .2s ease;
}
.drawer-backdrop.open {
  pointer-events: auto;
  background: rgba(15, 23, 42, .28);
  opacity: 1;
}
.drawer-close-btn:hover {
  filter: brightness(1.05);
}
.drawer .panel-body { overflow: auto; }
.drawer .field label { color: var(--muted); }
.drawer-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.system-info-section {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.quote-box {
  position: absolute;
  top: 80px;
  right: 20px;
  width: 320px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.quote-box h3 { margin: 0 0 8px; }
.quote-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.86rem; margin: 5px 0; }
.quote-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; font-weight: 800; }

.view-controls { display: flex; gap: 4px; }

#measureResult {
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.warning-banner {
  display: none;
  position: absolute;
  top: 14px;
  left: 20px;
  z-index: 2;
  max-width: 420px;
  padding: 9px 12px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}

.warning-banner.show { display: block; }

.dimension-strip {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dimension-strip span {
  padding: 6px 9px;
  background: rgba(23, 32, 51, 0.9);
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
}

.card-preview {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
}

.card-preview-item {
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
}

.muted-text {
  color: var(--muted);
  font-size: 0.8rem;
  margin-left: 8px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.view-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 0;
}

.view-tab {
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.view-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.bonus-toolbar {
  margin: 20px;
  padding: 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.bonus-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.bonus-filters { display: flex; align-items: end; gap: 10px; }
.bonus-filters label { color: var(--muted); font-size: .78rem; }
.bonus-filters input { margin-top: 4px; min-width: 140px; }
.bonus-summary-grid { padding-top: 0; }
.bonus-owner-total td {
  background: #eef6ff;
  border-bottom-color: #bfdbfe;
}

.drawer-section {
  margin: 16px 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.section-title { font-weight: 800; color: var(--ink); }

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  color: var(--ink);
  font-size: .84rem;
}

.check-field input { width: auto; }

.bonus-preview {
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: .86rem;
  line-height: 1.6;
}

.workstation-editor { display: grid; gap: 9px; margin-top: 10px; }
.drawer-hidden-controls { display: none; }
.system-summary-row input:disabled {
  color: var(--muted);
  background: #f8fafc;
}

.workstation-record {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.workstation-record-title {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  font-size: .84rem;
}

.workstation-record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.workstation-record-grid .field { margin: 2px 0; }
.workstation-record-grid .field label { color: var(--muted); }

.empty-state {
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 0.86rem;
}

.drawer-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 14px;
}

.session-label {
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, .55);
}

.login-overlay[hidden] { display: none; }

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

.login-panel > strong { font-size: 1.15rem; }
.login-panel p { margin: 7px 0 14px; color: var(--muted); font-size: .84rem; }
.login-panel .field label { color: var(--muted); }
.login-error { min-height: 22px; margin-top: 9px; color: var(--danger); font-size: .82rem; }
.login-connection-box {
  margin: 12px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbff;
  overflow: hidden;
}
.login-connection-box summary {
  cursor: pointer;
  padding: 9px 11px;
  color: var(--muted);
  font-size: .8rem;
  list-style-position: inside;
}
.login-connection-box[open] {
  padding: 0 12px 12px;
}
.login-connection-box[open] summary {
  margin: 0 -12px 10px;
  border-bottom: 1px solid var(--border);
  background: #f2f6fb;
}
.login-connection-box p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .78rem;
}
.login-connection-box label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .78rem;
}
.login-connection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}
.login-connection-row input {
  width: 100%;
  min-width: 0;
}

.settings-layout {
  margin: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.settings-heading,
.migration-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.settings-heading p,
.migration-box p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.settings-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #eef3f8;
}
.settings-switch-btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.settings-switch-btn.active {
  border-color: #bfdbfe;
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 22px rgba(37, 99, 235, .12);
}
.settings-pane { margin-top: 16px; }
.settings-pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.settings-pane-heading p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.settings-section { padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; }
.settings-section h3 { margin: 0 0 8px; font-size: .92rem; }
.settings-section .field label { color: var(--muted); }
.settings-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.settings-four { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bonus-settings-layout {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}
.bonus-primary-section { background: #fff; }
.bonus-primary-grid {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) repeat(2, minmax(150px, 1fr));
  gap: 10px;
}
.bonus-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.bonus-setting-card { background: #fff; }
.bonus-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.bonus-card-heading h3 { margin: 0; }
.bonus-card-heading span {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .74rem;
  font-weight: 750;
}
.bonus-compact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bonus-compact-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bonus-compact-grid .field { margin: 0; }
.bonus-compact-grid input,
.bonus-primary-grid input {
  padding: 7px 8px;
}
.quote-work-section { background: #fff; }
.quote-basis-note {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.quote-work-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.quote-work-items.work-hours { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.quote-setting-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.quote-setting-group h4 {
  margin: 0 0 10px;
  color: #334155;
  font-size: .88rem;
}
.quote-setting-group-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.quote-work-items.work-hours .quote-setting-group-fields {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.quote-setting-group .field { margin: 0; }
.pricing-pair-field {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 92px 92px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
}
.pricing-pair-field:last-child { border-bottom: 0; }
.pricing-pair-field > label {
  min-width: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.pricing-pair-row {
  display: grid;
  grid-column: 2 / 4;
  grid-template-columns: 92px 92px;
  gap: 8px;
  align-items: center;
}
.pricing-pair-row input {
  min-width: 0;
  padding: 7px 6px;
  text-align: right;
}
.pricing-pair-header {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 92px 92px;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid #cbd5e1;
  color: #64748b;
  font-size: .76rem;
  font-weight: 750;
}
.pricing-pair-header span:nth-child(2),
.pricing-pair-header span:nth-child(3) { text-align: center; }
.quote-work-items.work-hours .pricing-pair-header { display: none; }
.quote-work-hour-field {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #e2e8f0;
}
.quote-work-hour-field:last-child { border-bottom: 0; }
.quote-work-hour-field > label {
  min-width: 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.quote-work-hour-row {
  display: grid;
  grid-template-columns: auto 48px auto auto 48px auto;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}
.quote-work-hour-row input {
  min-width: 0;
  padding: 6px 5px;
  text-align: right;
}
.migration-box { margin-top: 14px; padding: 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fff7f7; }

.sandbox-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  margin: 20px;
}

.sandbox-sidebar,
.sandbox-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.sandbox-sidebar { padding: 12px; align-self: start; }
.sandbox-editor { padding: 16px; min-width: 0; }
.sandbox-sidebar-header,
.scenario-project-header,
.sandbox-section-heading,
.sandbox-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.scenario-list { display: grid; gap: 6px; margin-top: 10px; }
.scenario-list-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.scenario-list-item.active { border-color: var(--primary); background: #eff6ff; }
.scenario-list-item strong, .scenario-list-item span { display: block; }
.scenario-list-item span { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.sandbox-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px auto auto auto;
  gap: 8px;
  align-items: end;
}
.sandbox-toolbar .field { margin: 0; }
.sandbox-toolbar .field label { color: var(--muted); }
.sandbox-settings { margin-top: 14px; }
.sandbox-formula { margin-top: 12px; }
.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.formula-grid article {
  padding: 10px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
}
.formula-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #1e3a8a;
  font-size: .82rem;
}
.formula-grid p {
  margin: 4px 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.sandbox-parameter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sandbox-parameter-grid label,
.scenario-project-fields label {
  color: var(--muted);
  font-size: .76rem;
}
.sandbox-parameter-grid input,
.scenario-project-fields input,
.scenario-project-fields select { margin-top: 4px; }
.sandbox-project-heading { margin: 18px 0 10px; }
.scenario-projects { display: grid; gap: 10px; }
.scenario-project {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.scenario-project-fields {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 130px 150px 150px;
  gap: 8px;
  margin-top: 10px;
}
.scenario-stations { display: grid; gap: 6px; margin-top: 10px; }
.scenario-station {
  display: grid;
  grid-template-columns: 110px minmax(140px, 1fr) 140px 140px 120px 100px;
  gap: 7px;
  align-items: center;
}
.scenario-station strong { font-size: .8rem; }
.scenario-delay { display: flex; align-items: center; gap: 5px; font-size: .75rem; }
.scenario-delay input { width: auto; }
.sandbox-actions { justify-content: flex-end; margin-top: 12px; }
.sandbox-summary { padding-inline: 0; }
.sandbox-result-panel { margin: 0; box-shadow: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { max-height: none; }
  .mobile-model-link { display: flex; margin-top: 12px; background: #e2e8f0; }
  #canvas { height: 70vh; }
  .quote-box { position: static; width: auto; margin: 12px; }
  .dimension-strip { position: static; padding: 0 12px; }
  .view-controls { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .line-grid { grid-template-columns: 1fr; }
  .settings-switch { grid-template-columns: 1fr; }
  .settings-pane-heading { align-items: stretch; flex-direction: column; }
  .settings-grid { grid-template-columns: 1fr; }
  .bonus-primary-grid,
  .bonus-card-grid { grid-template-columns: 1fr; }
  .settings-four { grid-template-columns: 1fr 1fr; }
  .quote-work-items { grid-template-columns: 1fr; }
  .quote-work-hour-field {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .sandbox-layout { grid-template-columns: 1fr; margin: 12px; }
  .sandbox-toolbar { grid-template-columns: 1fr 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .sandbox-parameter-grid { grid-template-columns: repeat(3, 1fr); }
  .scenario-project-fields { grid-template-columns: 1fr 1fr; }
  .scenario-station { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .topbar-actions #apiUrl {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .panel { margin: 0 12px 16px; }
  .line-grid { padding: 0 12px 16px; }
  .panel-header { align-items: stretch; flex-direction: column; gap: 10px; }
  .panel-header input { width: 100% !important; }
  .project-filters { grid-template-columns: 1fr; width: 100%; }
  .project-filter-bar { grid-template-columns: 1fr; }
  .filter-check { justify-content: flex-start; }
  .view-tabs { padding-inline: 12px; }
  .bonus-toolbar { margin: 12px; align-items: stretch; flex-direction: column; }
  .bonus-filters { align-items: stretch; flex-direction: column; }
  .bonus-filters input { min-width: 0; }
  .workstation-record-grid { grid-template-columns: 1fr; }
  .settings-layout { margin: 12px; }
  .settings-three, .settings-four { grid-template-columns: 1fr; }
  .settings-heading, .migration-box { align-items: stretch; flex-direction: column; }
  .sandbox-toolbar, .sandbox-parameter-grid, .scenario-project-fields, .scenario-station { grid-template-columns: 1fr; }
}

/* Admin workspace: kitchen-table designer visual language */
body {
  min-height: 100vh;
  overflow: hidden;
  background: #edf2f7;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

.admin-shell.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }

.admin-sidebar {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 14px;
  border-right: 1px solid #334155;
  background: #172337;
  color: #f8fafc;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 4px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
  font-weight: 850;
}

.admin-brand strong,
.admin-brand span {
  display: block;
}

.admin-brand strong { font-size: .96rem; }
.admin-brand div > span { margin-top: 3px; color: #94a3b8; font-size: .75rem; }

.sidebar-session {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  margin: 14px 0;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 8px;
  background: #1e2d44;
}

.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .13);
}

.sidebar-session.offline .session-dot {
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, .15);
}

.sidebar-session strong,
.sidebar-session span { display: block; }
.sidebar-session strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-session div > span { margin-top: 3px; color: #93c5fd; font-size: .72rem; }

.admin-sidebar .view-tabs {
  display: grid;
  gap: 5px;
  padding: 0;
}

.admin-sidebar .view-tab {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.admin-sidebar .view-tab > span {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-radius: 6px;
  background: rgba(148, 163, 184, .1);
  color: #93c5fd;
  font-size: .69rem;
}

.admin-sidebar .view-tab:hover {
  border-color: #475569;
  background: #1e2d44;
}

.admin-sidebar .view-tab.active {
  border-color: #3b82f6;
  background: #263a58;
  color: #fff;
}

.admin-sidebar .view-tab.active > span {
  background: #2563eb;
  color: #fff;
}

.sidebar-lines {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.sidebar-section-title {
  margin: 0 4px 8px;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 750;
}

.admin-sidebar .line-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 0;
}

.admin-sidebar .line-card {
  padding: 9px 10px;
  border-color: rgba(148, 163, 184, .2);
  background: #1e2d44;
  color: #f8fafc;
}

.admin-sidebar .line-card strong { font-size: .78rem; }
.admin-sidebar .badge { padding: 3px 6px; font-size: .65rem; }

.sidebar-connection {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .18);
}

.sidebar-connection summary {
  color: #bfdbfe;
  font-size: .78rem;
  font-weight: 750;
  cursor: pointer;
}

.sidebar-connection input {
  margin-top: 9px;
  border-color: #475569;
  background: #26364f;
  color: #fff;
  font-size: .75rem;
}

.sidebar-connection-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 7px;
}

.admin-sidebar .btn {
  border: 1px solid #475569;
  background: #26364f;
  color: #f8fafc;
}

.sidebar-logout {
  width: 100%;
  margin-top: 10px;
}

.admin-shell > .main {
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
}

.admin-shell .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar > div:first-child strong,
.topbar > div:first-child span { display: block; }
.topbar > div:first-child strong { font-size: 1.05rem; }
.topbar #connectionStatus { margin-top: 4px; color: var(--muted); font-size: .75rem; }

.sidebar-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #eef2f7;
  color: #334155;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.sidebar-toggle:hover { border-color: #93c5fd; background: #dbeafe; }

.sidebar-collapsed .admin-sidebar { padding-inline: 9px; }
.sidebar-collapsed .admin-brand { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .admin-brand > div,
.sidebar-collapsed .sidebar-session > div,
.sidebar-collapsed .sidebar-lines,
.sidebar-collapsed .sidebar-connection { display: none; }
.sidebar-collapsed .sidebar-session {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 11px 6px;
}
.sidebar-collapsed .admin-sidebar .view-tab {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  overflow: hidden;
  padding: 8px 5px;
  color: transparent;
  font-size: 0;
}
.sidebar-collapsed .admin-sidebar .view-tab > span {
  width: 38px;
  font-size: .67rem;
}
.sidebar-collapsed .sidebar-logout {
  overflow: hidden;
  color: transparent;
  font-size: 0;
}
.sidebar-collapsed .sidebar-logout::after {
  color: #f8fafc;
  font-size: .72rem;
  content: "登出";
}


.summary-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  padding: 16px 20px;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 86px;
  padding: 14px 16px;
  box-shadow: none;
}

.stat::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #2563eb;
  content: "";
}

.stat .value { font-size: 1.5rem; }

.project-workspace {
  margin-top: 0;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
}

.project-workspace .panel-header {
  min-height: 58px;
  padding: 12px 14px;
}

.project-view-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #eef2f7;
}

.project-view-toggle button {
  border: 0;
  border-radius: 5px;
  padding: 7px 15px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
}

.project-view-toggle button.active {
  background: #2563eb;
  color: #fff;
}

.project-filter-bar {
  display: grid;
  grid-template-columns: minmax(250px, 1.7fr) repeat(3, minmax(130px, .65fr)) minmax(130px, auto);
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.filter-check {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .8rem;
  font-weight: 750;
  white-space: nowrap;
}

.filter-check input {
  width: auto;
  margin: 0;
}

.board-display-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.board-display-bar[hidden] { display: none; }
.board-display-bar > span {
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
}

.board-density-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #eef2f7;
}

.board-density-toggle button {
  border: 0;
  border-radius: 4px;
  padding: 5px 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

.project-list-view {
  max-height: calc(100vh - 280px);
  overflow: auto;
}

.project-list-view table { margin: 0; }
.project-list-view thead { position: sticky; top: 0; z-index: 3; }
.project-list-view th { background: #edf2f7; }
.manual-status-note {
  display: block;
  margin-top: 4px;
  color: #b45309;
  font-size: .66rem;
  font-weight: 750;
}

.project-board-view {
  min-height: calc(100vh - 300px);
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(7, minmax(210px, 1fr));
  gap: 10px;
  overflow: auto;
  padding: 12px;
  background: #e9eef5;
}

.project-board-view[hidden] { display: none; }

.project-workstation-view {
  min-height: calc(100vh - 300px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 280px);
  gap: 10px;
  overflow: auto;
  padding: 12px;
  background: #e9eef5;
}

.project-workstation-view[hidden] { display: none; }

.workload-column {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #d5dee9;
  border-radius: 8px;
  background: #f7f9fc;
}

.workload-column > header {
  display: grid;
  gap: 8px;
  min-height: 78px;
  padding: 10px;
  border-bottom: 2px solid #2563eb;
  cursor: grab;
  user-select: none;
}

.workload-column.dragging {
  opacity: .55;
}

.workload-column.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.workload-column > header strong,
.workload-column > header span {
  display: block;
}

.workload-column > header strong {
  font-size: .92rem;
}

.workload-column > header div:first-child > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
}

.workload-station-counts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.workload-station-counts.single {
  grid-template-columns: 1fr;
}

.workload-station-counts span {
  padding: 4px 6px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #334155;
  font-size: .68rem;
  font-weight: 750;
  text-align: center;
}

.workload-card-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 140px;
  padding: 8px;
}

.workload-empty-slot {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
}

.workload-card {
  padding: 10px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .06);
}

.workload-card.overdue {
  border-color: #fecaca;
  background: #fff7f7;
}

.workload-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workload-card-top strong {
  color: #1d4ed8;
  font-size: .78rem;
}

.workload-card-top span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .68rem;
  font-weight: 800;
}

.workload-card button {
  width: 100%;
  margin: 8px 0 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.workload-card button:hover { color: #1d4ed8; }

.workload-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.manual-status-note.inline {
  display: inline-flex;
  margin-top: 0;
}

.workload-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.workload-card dt {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 750;
}

.workload-card dd {
  margin: 2px 0 0;
  font-size: .74rem;
  font-weight: 750;
}

.danger-text { color: var(--danger); }

.workload-empty {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: .9rem;
}

.kanban-column {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid #d5dee9;
  border-radius: 8px;
  background: #f7f9fc;
}

.kanban-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 2px solid #3b82f6;
}

.kanban-column > header strong { font-size: .86rem; }
.kanban-column > header span {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .7rem;
  text-align: center;
}

.kanban-column.locked > header { border-bottom-color: #94a3b8; }
.kanban-column.drag-over { border-color: #2563eb; background: #eff6ff; }

.kanban-column-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 140px;
  padding: 8px;
}

.project-card {
  padding: 11px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 9px rgba(15, 23, 42, .06);
}

.project-card[draggable="true"] { cursor: grab; }
.project-card.dragging { opacity: .45; }

.project-card-top,
.project-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.project-card-top strong { color: #1d4ed8; font-size: .78rem; }
.project-card-top .badge { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.project-card-title {
  width: 100%;
  margin: 9px 0 7px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .94rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.project-card-title:hover { color: #1d4ed8; }

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: .72rem;
}

.project-card-meta span {
  padding-right: 6px;
  border-right: 1px solid #d8e0ea;
}

.project-card-assignment {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  color: #1e40af;
  font-size: .74rem;
  font-weight: 700;
}

.project-card-assignment strong {
  color: #172033;
}

.project-card footer {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

.project-card footer span {
  color: #64748b;
  font-size: .67rem;
  font-weight: 700;
}

.project-card footer .ready { color: #047857; }
.project-card footer .manual { color: #b45309; }

.kanban-empty {
  padding: 22px 8px;
  color: #94a3b8;
  font-size: .75rem;
  text-align: center;
}

.drawer {
  width: min(680px, 100vw);
  border-left: 1px solid #334155;
}

.assignment-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .32);
}

.assignment-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .22);
}

.assignment-panel strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.assignment-panel p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.assignment-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .8rem;
}

.assignment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.drawer-header {
  min-height: 66px;
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #172337;
  color: #fff;
}

.drawer-header .btn {
  border: 1px solid #475569;
  background: #26364f;
  color: #fff;
}

.drawer .panel-body {
  padding: 14px 16px 88px;
  background: #f1f5f9;
}

.drawer-section {
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.drawer-section > summary {
  padding: 13px 14px;
  color: #172033;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
}

.drawer-section[open] > summary {
  border-bottom: 2px solid #3b82f6;
  background: #f8fafc;
}

.drawer-section-content { padding: 4px 14px 14px; }
.system-info-section { padding: 0; background: #fff; }

.project-photo-section .muted-text {
  display: block;
  margin: 2px 0 12px;
}

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

.photo-upload-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.photo-upload-card strong {
  display: block;
  font-size: .9rem;
}

.photo-upload-card span,
.photo-card span,
.photo-status {
  color: var(--muted);
  font-size: .78rem;
}

.photo-upload-card input {
  min-width: 0;
  padding: 7px 8px;
  font-size: .82rem;
}

.photo-status {
  margin: 4px 0 10px;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  object-fit: cover;
  background: #e2e8f0;
}

.photo-card > div {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.photo-card strong {
  font-size: .84rem;
}

.photo-card p {
  margin: 0;
  color: var(--ink);
  font-size: .78rem;
  line-height: 1.35;
}

.photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: #fff;
  background: rgba(220, 38, 38, .9);
  font-size: .72rem;
  cursor: pointer;
}

.status-source-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.status-source-row .field { margin-bottom: 0; }

.drawer-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .08);
}

@media (max-width: 1000px) {
  .admin-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .admin-shell.sidebar-collapsed { grid-template-columns: 72px minmax(0, 1fr); }
  .project-filter-bar { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  body { overflow: auto; }
  .admin-shell { display: block; }
  .sidebar-toggle { display: none; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 10px 12px;
  }
  .admin-brand { padding-bottom: 10px; }
  .sidebar-session { margin: 10px 0; }
  .admin-sidebar .view-tabs { grid-template-columns: repeat(2, 1fr); }
  .admin-sidebar .view-tab { grid-template-columns: 34px minmax(0, 1fr); }
  .sidebar-lines, .sidebar-connection { display: none; }
  .sidebar-logout { margin-top: 8px; }
  .admin-shell > .main { height: auto; min-height: 100vh; overflow: visible; }
  .admin-shell .topbar { position: static; align-items: stretch; }
  .topbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .summary-grid { padding: 12px; }
  .project-workspace { margin: 0 12px 16px; }
  .project-filter-bar { grid-template-columns: 1fr; }
  .project-list-view { max-height: none; }
  .project-board-view { min-height: 560px; grid-auto-columns: 280px; }
  .project-board-view {
    grid-auto-flow: column;
    grid-template-columns: none;
  }
  .drawer { width: 100vw; }
  .drawer .panel-body { padding-inline: 10px; }
  .status-source-row { grid-template-columns: 1fr; }
  .photo-upload-grid { grid-template-columns: 1fr; }
}
