:root {
  color-scheme: light;
  --bg: #f2f6f8;
  --surface: #ffffff;
  --surface-subtle: #f7fafb;
  --surface-strong: #e9f0f3;
  --text: #172b35;
  --text-strong: #0c202a;
  --muted: #607681;
  --faint: #8798a1;
  --accent: #086e86;
  --accent-hover: #075c70;
  --accent-soft: #e5f3f6;
  --ok: #287a58;
  --ok-soft: #e8f5ee;
  --warn: #9a650c;
  --warn-soft: #fff4d9;
  --err: #b4383b;
  --err-soft: #fbeaec;
  --border: #d5e0e4;
  --border-strong: #b9c9cf;
  --viewer: #111a1f;
  --shadow: 0 8px 24px rgba(29, 55, 67, 0.08);
  --radius: 8px;
  --sidebar: 224px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111a1f;
  --surface: #172329;
  --surface-subtle: #1b2a31;
  --surface-strong: #22343c;
  --text: #dae4e8;
  --text-strong: #f2f6f7;
  --muted: #9dafb7;
  --faint: #7f929b;
  --accent: #59a9bc;
  --accent-hover: #72bbcb;
  --accent-soft: #193640;
  --ok: #63b68e;
  --ok-soft: #19372a;
  --warn: #e2b45d;
  --warn-soft: #382f1e;
  --err: #e2797b;
  --err-soft: #3d2528;
  --border: #2d4048;
  --border-strong: #40565f;
  --viewer: #070c0f;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
canvas {
  -webkit-tap-highlight-color: transparent;
}
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  color: #eaf2f4;
  background: #102b36;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 22px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e6f4f6;
  color: #086e86;
}
.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand-sub {
  display: block;
  color: #abc0c8;
  font-size: 11px;
  margin-top: 1px;
}
.nav-label {
  padding: 8px 10px;
  color: #8facb7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  color: #bed0d6;
  text-decoration: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}
.nav-item.active {
  color: #fff;
  background: rgba(121, 190, 204, 0.15);
  box-shadow: inset 2px 0 #70bed0;
}
.nav-item svg,
.icon-btn svg,
.btn svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.sidebar-foot {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9eb4bd;
  font-size: 11px;
}
.sidebar-foot strong {
  display: block;
  color: #d8e5e9;
  font-size: 12px;
  margin-bottom: 2px;
}

.main {
  min-width: 0;
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.crumb {
  color: var(--muted);
  font-size: 12px;
}
.crumb-link,
.back-link {
  color: var(--accent);
  text-decoration: none;
}
.crumb-link:hover,
.back-link:hover {
  text-decoration: underline;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.content {
  padding: 22px 24px 28px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  color: var(--text-strong);
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
h2 {
  color: var(--text-strong);
  font-size: 16px;
  margin-bottom: 4px;
}
h3 {
  color: var(--text-strong);
  font-size: 13px;
  margin-bottom: 8px;
}
.subhead,
.description {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.panel-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.panel-body {
  padding: 18px;
}
.panel-title {
  color: var(--text-strong);
  font-size: 13px;
  font-weight: 700;
}
.panel-meta {
  color: var(--muted);
  font-size: 11px;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition:
    background 0.14s,
    border-color 0.14s,
    color 0.14s;
}
.btn-primary {
  color: #fff;
  background: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn-secondary:hover,
.icon-btn:hover {
  background: var(--surface-strong);
}
.btn-danger {
  color: var(--err);
  background: var(--surface);
  border-color: var(--border);
}
.btn-block {
  width: 100%;
}
.btn[disabled],
.btn.loading {
  opacity: 0.65;
  cursor: not-allowed;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}
.loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading .loader,
.loader.visible {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.field {
  margin-bottom: 18px;
}
.field:last-child {
  margin-bottom: 0;
}
.field-label {
  display: flex;
  justify-content: space-between;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 7px;
}
.field-hint {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.control {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
}
.control:hover {
  border-color: var(--accent);
}
.control:focus {
  border-color: var(--accent);
  outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.file-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 7px;
  background: var(--surface-subtle);
}
.file-control:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.file-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}
.file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
}
.file-copy strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
}
.file-copy span {
  color: var(--muted);
  font-size: 11px;
}
.form-error {
  min-height: 20px;
  margin-top: 10px;
  color: var(--err);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.normal,
.badge.connected {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 24%, transparent);
}
.badge.alarm,
.badge.error,
.badge.disconnected {
  color: var(--err);
  background: var(--err-soft);
  border-color: color-mix(in srgb, var(--err) 24%, transparent);
}
.badge.warning,
.badge.processing {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 25%, transparent);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 43%) 1fr;
  background: var(--surface);
}
.auth-form {
  display: grid;
  align-content: center;
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  padding: 48px;
}
.auth-brand {
  margin-bottom: 52px;
}
.auth-brand .brand-name {
  color: var(--text-strong);
  font-size: 15px;
}
.auth-brand .brand-sub {
  color: var(--muted);
}
.auth-form h1 {
  font-size: 27px;
  margin-bottom: 8px;
}
.auth-form .subhead {
  margin-bottom: 30px;
}
.auth-aside {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 48px;
  color: #eaf3f5;
  background: #0d2b37;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.38;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0 31px,
      rgba(138, 188, 199, 0.08) 32px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 31px,
      rgba(138, 188, 199, 0.06) 32px
    );
}
.auth-signal {
  position: absolute;
  inset: 15% 8% auto;
  height: 220px;
  opacity: 0.7;
}
.auth-message {
  position: relative;
  max-width: 540px;
}
.auth-message h2 {
  color: #fff;
  font-size: 24px;
  max-width: 460px;
}
.auth-message p {
  color: #a9c0c8;
  font-size: 13px;
}

.setup-grid {
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 16px;
}
.workflow-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.workflow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.workflow-step:last-child {
  border-bottom: 0;
}
.step-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.workflow-step.active .step-num {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.workflow-step strong {
  display: block;
  color: var(--text-strong);
  font-size: 12px;
}
.workflow-step span {
  color: var(--muted);
  font-size: 11px;
}
.security-note {
  display: flex;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 11px;
  margin-top: 18px;
}

.launcher-shell {
  min-height: 100vh;
  background: var(--bg);
}
.launcher-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 64px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.launcher-brand {
  padding: 0;
}
.launcher-brand .brand-name {
  color: var(--text-strong);
}
.launcher-brand .brand-sub {
  color: var(--muted);
}
.launcher-main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 76px) 0;
}
.launcher-intro {
  margin-bottom: 28px;
}
.launcher-intro h1 {
  font-size: clamp(28px, 4vw, 38px);
  margin-bottom: 8px;
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.app-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding: 22px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(29, 55, 67, 0.03);
  text-decoration: none;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
a.app-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow);
}
.app-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 22px;
}
.app-icon svg {
  width: 25px;
  height: 25px;
}
.reconstruction-icon {
  color: #5f54a8;
  background: #efedfb;
}
[data-theme="dark"] .reconstruction-icon {
  color: #b5aaef;
  background: #2c2946;
}
.app-card-body strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-strong);
  font-size: 15px;
}
.app-card-body span {
  display: block;
  max-width: 260px;
  color: var(--muted);
  font-size: 12px;
}
.app-arrow {
  position: absolute;
  top: 24px;
  right: 22px;
  color: var(--faint);
  font-size: 20px;
}
.app-card-disabled {
  box-shadow: none;
  opacity: .68;
}
.coming-soon {
  position: absolute;
  top: 22px;
  right: 20px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.placeholder-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.placeholder-panel {
  width: min(600px, 100%);
  padding: clamp(28px, 6vw, 52px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.placeholder-panel .back-link {
  display: inline-block;
  margin-bottom: 42px;
  font-size: 12px;
  font-weight: 700;
}
.placeholder-icon {
  margin-bottom: 18px;
}
.placeholder-panel .subhead {
  max-width: 500px;
  margin-bottom: 24px;
}
.reconstruction-error { margin-bottom:18px; padding:12px; color:var(--err); background:var(--err-soft); border:1px solid var(--err); border-radius:7px; font-size:12px; }
.model-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.model-card { overflow:hidden; color:var(--text); background:var(--surface); border:1px solid var(--border); border-radius:10px; text-decoration:none; transition:transform .15s,box-shadow .15s; }
.model-card:hover { transform:translateY(-2px); box-shadow:var(--shadow); }
.model-card img,.model-preview-empty { width:100%; aspect-ratio:16/10; display:grid; place-items:center; object-fit:contain; color:var(--accent); background:var(--viewer); font-size:42px; }
.model-card-copy { display:block; padding:14px; }
.model-card-copy strong,.model-card-copy span { display:block; }
.model-card-copy strong { color:var(--text-strong); font-size:13px; }
.model-card-copy span { margin-top:4px; color:var(--muted); font-size:10px; }
.empty-models { max-width:600px; padding:40px; text-align:center; }
.empty-models .app-icon { margin-inline:auto; }
.empty-models .subhead { margin-bottom:20px; }
.reconstruction-viewer-page { min-height:100vh; background:var(--bg); color:var(--text); }
.reconstruction-viewer-main { min-width:0; height:100vh; overflow:hidden; }
.reconstruction-viewer-content { position:relative; height:calc(100vh - 56px); min-height:0; display:flex; flex-direction:column; padding:16px 20px 20px; }
.viewer-titlebar { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:16px; }
.viewer-titlebar h1 { margin:3px 0 0; font-size:24px; }
.multi-view-grid { flex:1; min-height:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:10px; opacity:0; visibility:hidden; transition:opacity .18s ease; }
.multi-view-grid.is-ready { opacity:1; visibility:visible; }
.medical-view-panel { min-width:0; min-height:0; display:grid; grid-template-rows:38px minmax(0,1fr); overflow:hidden; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.medical-view-panel > header { display:flex; align-items:center; justify-content:space-between; padding:0 12px; color:var(--text-strong); background:var(--surface-subtle); border-bottom:1px solid var(--border); font-size:12px; }
.medical-view-panel > header span { color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.06em; }
.medical-view { position:relative; min-width:0; min-height:0; overflow:hidden; display:flex; align-items:center; justify-content:center; background:#000; }
.medical-view canvas,.medical-view img { max-width:100%; max-height:100%; }
.viewer-control,.viewer-select { position:absolute; z-index:5; right:10px; min-height:32px; padding:0 9px; border:1px solid #546770; border-radius:5px; }
.viewer-control { top:10px; }.viewer-select { top:49px; }
.viewer-loading { position:absolute; z-index:8; inset:82px 20px 20px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; color:var(--text-strong); background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.viewer-loading[hidden] { display:none; }
.viewer-loading > span:last-child { color:var(--muted); font-size:12px; }
.viewer-loading-spinner { width:34px; height:34px; margin-bottom:5px; border:3px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:viewer-spin .8s linear infinite; }
.viewer-loading-error .viewer-loading-spinner { display:none; }
.viewer-loading-error { color:var(--err); }
@keyframes viewer-spin { to { transform:rotate(360deg); } }

.workspace {
  height: calc(100vh - 56px);
  min-height: 600px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
  gap: 12px;
}
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.workspace-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.workspace-title h1 {
  font-size: 18px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.72fr);
  gap: 12px;
}
.viewer-panel,
.results-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.viewer-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 5px;
}
.viewer-stage {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: var(--viewer);
}
.viewer-stage video,
.viewer-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border: 1px solid #32434a;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  object-fit: contain;
}
.viewer-caption {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--muted);
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  font-size: 11px;
}
.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.status-cell {
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.status-cell:last-child {
  border-right: 0;
}
.status-cell label {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.status-cell strong {
  color: var(--text-strong);
  font-size: 11px;
}
.results-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.results-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 88px 1.35fr;
  padding: 8px 14px;
  color: var(--faint);
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.vital-block {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 88px 1.35fr;
  align-items: center;
  min-height: 72px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.vital-block:hover {
  background: var(--surface-subtle);
}
.v-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.v-label small {
  display: block;
  color: var(--faint);
  font-size: 9px;
  font-weight: 500;
  margin-top: 3px;
}
.v-value {
  color: var(--text-strong);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  letter-spacing: -0.025em;
}
.stats-wrap {
  display: grid;
  gap: 4px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  color: var(--faint);
  font-size: 9px;
}
.stat {
  min-width: 0;
}
.stat span {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.results-foot {
  padding: 11px 14px;
  color: var(--muted);
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  font-size: 10px;
}

.roi-layout {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
}
.roi-viewer {
  min-height: 520px;
}
.roi-viewer canvas {
  cursor: crosshair;
}
.region-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.region-list {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
}
.region-empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.region-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.region-item strong {
  display: block;
  color: var(--text-strong);
  font-size: 12px;
}
.region-item code {
  color: var(--muted);
  font:
    10px/1.4 "SFMono-Regular",
    Consolas,
    monospace;
}
.region-actions {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.instruction {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 7px;
  font-size: 11px;
}

@media (max-width: 1000px) {
  :root {
    --sidebar: 70px;
  }
  .brand-copy,
  .nav-item span,
  .nav-label,
  .sidebar-foot {
    display: none;
  }
  .brand {
    justify-content: center;
    padding-inline: 0;
  }
  .nav-item {
    justify-content: center;
  }
  .workspace-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.8fr);
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .model-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 18px 14px;
  }
  .topbar {
    padding: 0 14px;
  }
  .workspace {
    height: auto;
    min-height: calc(100vh - 56px);
    padding: 10px;
  }
  .workspace-grid,
  .roi-layout {
    grid-template-columns: 1fr;
  }
  .viewer-panel {
    min-height: 58vh;
  }
  .results-panel {
    min-height: 420px;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-aside {
    display: none;
  }
  .auth-form {
    padding: 30px 24px;
  }
  .results-header,
  .vital-block {
    grid-template-columns: 1fr 72px 1.25fr;
  }
  .app-grid {
    grid-template-columns: 1fr;
  }
  .launcher-header {
    padding: 12px 16px;
  }
  .launcher-main {
    width: min(100% - 28px, 1120px);
    padding-top: 34px;
  }
  .model-grid { grid-template-columns:1fr; }
  .multi-view-grid { grid-template-columns:1fr; grid-template-rows:repeat(4,minmax(340px,1fr)); height:auto; }
  .reconstruction-viewer-main { height:auto; min-height:100vh; overflow:visible; }
  .reconstruction-viewer-content { height:auto; min-height:calc(100vh - 56px); padding:16px 14px; }
  .viewer-loading { inset:82px 14px 16px; min-height:420px; }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
