:root {
  --bg: #0d0f10;
  --panel: #151719;
  --panel-raised: #1b1e20;
  --panel-soft: #202326;
  --border: #303437;
  --border-soft: #25292b;
  --text: #f3f1ea;
  --text-soft: #d0d2cd;
  --muted: #a5aaa8;
  --dim: #808683;
  --accent: #ff5a1f;
  --accent-soft: #ff7545;
  --danger: #ef5753;
  --warning: #f2a93b;
  --focus: #f5c84b;
  --blue: #4aa3ff;
  --green: #62c987;
  --yellow: #f1c84b;
  --purple: #a77bff;
  --cyan: #4fd5dc;
  --header-h: 64px;
  --left-w: 292px;
  --right-w: 324px;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 480px;
  background: var(--bg);
}

.topbar {
  position: relative;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: #111315;
}

.brand-block, .topbar-meta, .mobile-actions { display: flex; align-items: center; }
.brand-block { gap: 12px; min-width: 0; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}
.brand-mark span {
  position: absolute;
  width: 22px;
  height: 7px;
  border: 1px solid #b9bbb6;
  transform: skewY(-25deg);
}
.brand-mark span:nth-child(1) { top: 3px; }
.brand-mark span:nth-child(2) { top: 11px; border-color: #deddd6; }
.brand-mark span:nth-child(3) { top: 19px; border-color: var(--accent); }
.brand-copy { min-width: 0; }
.eyebrow {
  margin-bottom: 2px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  line-height: 1;
  text-transform: uppercase;
}
.topbar h1 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-short { display: none; }
.topbar-meta { gap: 10px; flex: 0 0 auto; }
.revision {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #49312a;
  border-radius: 999px;
  background: #241915;
  color: #ffb99e;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.view-index-link {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid #5a3528;
  border-radius: 999px;
  background: #1f1714;
  color: #ffc1aa;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.view-index-link:hover { border-color: var(--accent); color: var(--text); }
.view-index-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mobile-actions { display: none; gap: 6px; }

.workspace {
  height: calc(100dvh - var(--header-h));
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  overflow: hidden;
}

.panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  overflow: hidden;
}
.layer-panel { border-right: 1px solid var(--border); }
.inspector-panel { border-left: 1px solid var(--border); }
.panel-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.panel-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.panel h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.panel-close { display: none !important; }

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-raised);
  cursor: pointer;
}
.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { border-color: #4b5154; background: #222629; }

.search-wrap {
  position: relative;
  margin: 12px 14px 4px;
}
.search-wrap > svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  color: var(--dim);
  transform: translateY(-50%);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101214;
  color: var(--text);
  font-size: 12px;
}
.search-wrap input::placeholder { color: var(--dim); }
.search-wrap input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  right: 7px;
  top: 50%;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}
.search-results {
  position: absolute;
  z-index: 60;
  top: calc(var(--header-h) + 120px);
  left: 12px;
  width: calc(var(--left-w) - 24px);
  max-height: min(430px, calc(100dvh - 170px));
  padding: 6px;
  border: 1px solid #3c4245;
  border-radius: 12px;
  background: #141719;
  box-shadow: 0 18px 48px rgba(0,0,0,.38);
  overflow: auto;
}
.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.search-result:hover, .search-result:focus-visible { background: var(--panel-soft); }
.search-result-dot { width: 7px; height: 7px; border-radius: 50%; }
.search-result-copy { min-width: 0; }
.search-result-name {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-meta { display: block; margin-top: 2px; color: var(--dim); font-size: 10px; }
.search-empty { padding: 14px 10px; color: var(--dim); font-size: 12px; }

.panel-section { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); }
.view-preset-section { padding-top: 9px; padding-bottom: 10px; }
.view-presets { display: grid; gap: 6px; }
.view-preset-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}
.view-preset-level {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
}
.view-preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.view-preset-grid button {
  min-width: 0;
  height: 29px;
  padding: 0 3px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #101214;
  color: var(--dim);
  font-size: 8.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.view-preset-grid button:hover { border-color: #51585b; color: var(--text-soft); }
.view-preset-grid button.active { border-color: #66706d; background: #2a2e31; color: var(--text); }
.view-preset-grid button:disabled { opacity: .42; cursor: wait; }
.focus-section { padding-top: 9px; }
.layers-section { min-height: 0; display: flex; flex: 1 1 auto; flex-direction: column; }
.section-heading {
  min-height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.section-heading h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.text-actions { display: flex; align-items: center; gap: 5px; color: #525856; }
.text-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  cursor: pointer;
}
.text-actions button:hover { color: var(--text-soft); }
.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101214;
}
.segmented button {
  min-width: 0;
  height: 29px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.segmented button.active { background: #2a2e31; color: var(--text); }

.layer-list { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #3b4144 transparent; }
.layer-row {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 5px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.layer-row:hover { background: #1c1f21; }
.layer-row[aria-pressed="false"] { opacity: .48; }
.eye-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
}
.eye-icon svg { width: 17px; height: 17px; }
.layer-row[aria-pressed="false"] .eye-open { display: none; }
.layer-row[aria-pressed="true"] .eye-closed { display: none; }
.layer-dot { width: 8px; height: 8px; border-radius: 2px; }
.layer-copy { min-width: 0; }
.layer-name { display: block; color: var(--text-soft); font-size: 11px; font-weight: 600; }
.layer-desc { display: block; margin-top: 1px; overflow: hidden; color: var(--dim); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.layer-count { color: var(--dim); font-family: var(--mono); font-size: 9px; }

.model-key { padding-top: 11px; padding-bottom: 10px; }
.key-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; color: var(--dim); font-size: 10px; }
.key-swatch { width: 14px; height: 5px; border-radius: 2px; }
.key-swatch.rejected { background: var(--danger); }
.key-swatch.hold { background: var(--warning); }
.key-swatch.trade { background: var(--blue); }
.key-swatch.context { background: #8c9390; }
.panel-foot {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.viewport {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}
#modelCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
.viewport-topline {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.view-label, .compact-button, .viewport-toolbar, .help-card, .selection-chip, .construction-note { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.view-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(74,79,82,.85);
  border-radius: 9px;
  background: rgba(20,23,25,.86);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: #72d79a; box-shadow: 0 0 0 3px rgba(114,215,154,.12); }
.compact-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(74,79,82,.85);
  border-radius: 9px;
  background: rgba(20,23,25,.86);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  pointer-events: auto;
}
.compact-button svg { width: 14px; height: 14px; }
.compact-button:hover { color: var(--text); border-color: #62696c; }
.viewport-toolbar {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 48px;
  display: flex;
  gap: 3px;
  align-items: center;
  padding: 4px;
  border: 1px solid rgba(74,79,82,.9);
  border-radius: 12px;
  background: rgba(20,23,25,.88);
  transform: translateX(-50%);
}
.viewport-toolbar button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.viewport-toolbar button:hover { background: #2a2e31; color: var(--text); }
.viewport-toolbar button[data-mode="xray"], .viewport-toolbar button[data-mode="wire"] { background: #32231d; color: var(--accent-soft); }
.viewport-toolbar svg { width: 17px; height: 17px; }
.toolbar-divider { width: 1px; height: 21px; margin: 0 2px; background: var(--border); }
.help-card {
  position: absolute;
  z-index: 8;
  top: 52px;
  right: 12px;
  width: 250px;
  padding: 14px;
  border: 1px solid #454b4e;
  border-radius: 12px;
  background: rgba(20,23,25,.96);
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}
.help-title { margin-bottom: 10px; font-size: 12px; font-weight: 700; }
.help-card dl { margin: 0; }
.help-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.help-card dt { color: var(--muted); font-size: 10px; }
.help-card dd { margin: 0; color: var(--text-soft); font-family: var(--mono); font-size: 9px; }
.help-card p { margin: 11px 0 0; color: var(--dim); font-size: 10px; line-height: 1.45; }

.loading-card, .error-card {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100% - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #151719;
  transform: translate(-50%, -50%);
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.loader-model { position: relative; width: 60px; height: 48px; margin: 0 auto 14px; }
.loader-floor {
  position: absolute;
  left: 50%;
  width: 52px;
  height: 18px;
  border: 1px solid #686d6a;
  transform: translateX(-50%) skewY(-18deg);
}
.floor-a { top: 0; border-color: var(--accent); animation: loaderPulse 1.35s ease-in-out infinite; }
.floor-b { top: 12px; animation: loaderPulse 1.35s .18s ease-in-out infinite; }
.floor-c { top: 24px; animation: loaderPulse 1.35s .36s ease-in-out infinite; }
@keyframes loaderPulse { 0%,100% { opacity: .35; } 45% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .loader-floor { animation: none; } }
.loading-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.loading-label { color: var(--text-soft); font-size: 12px; font-weight: 650; }
.loading-copy strong { color: var(--accent-soft); font-family: var(--mono); font-size: 12px; }
.progress-track { height: 4px; margin-top: 11px; border-radius: 99px; background: #292d2f; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .15s linear; }
.loading-card p { margin: 9px 0 0; color: var(--dim); font-size: 10px; }
.error-card { text-align: center; }
.error-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.error-card p { margin: 0 0 13px; color: var(--muted); font-size: 11px; }
.error-card button, .inspector-actions button, .clear-selection {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}
.error-card button { padding: 0 18px; background: var(--accent); border-color: var(--accent); color: #160805; }

.selection-chip {
  position: absolute;
  z-index: 5;
  left: 12px;
  bottom: 48px;
  max-width: min(360px, calc(100% - 24px));
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 7px 0 10px;
  border: 1px solid rgba(74,79,82,.9);
  border-radius: 10px;
  background: rgba(20,23,25,.9);
}
.selection-color { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 2px; background: var(--focus); }
#selectionChipText { min-width: 0; overflow: hidden; color: var(--text-soft); font-family: var(--mono); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.selection-chip button { width: 25px; height: 25px; padding: 0; border: 0; background: transparent; color: var(--dim); font-size: 18px; cursor: pointer; }
.touch-hint {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 16px;
  color: var(--dim);
  font-size: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}
.construction-note {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  max-width: 276px;
  padding: 9px 10px;
  border: 1px solid rgba(74,79,82,.75);
  border-radius: 9px;
  background: rgba(20,23,25,.82);
}
.construction-note strong, .construction-note span { display: block; }
.construction-note strong { margin-bottom: 2px; color: #d9dad5; font-size: 9px; }
.construction-note span { color: var(--dim); font-size: 8px; line-height: 1.35; }
.mobile-disclaimer { display: none; }

.empty-inspector {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
}
.inspect-cube { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 15px; border: 1px solid var(--border); border-radius: 14px; background: #111315; color: #666c69; }
.inspect-cube svg { width: 36px; height: 36px; }
.empty-inspector h3 { margin: 0 0 7px; font-size: 14px; font-weight: 650; }
.empty-inspector p { max-width: 220px; margin: 0; color: var(--dim); font-size: 11px; line-height: 1.55; }
.object-inspector { min-height: 0; flex: 1 1 auto; padding: 16px; overflow: auto; }
.object-heading { padding-bottom: 13px; border-bottom: 1px solid var(--border-soft); }
.object-layer { display: inline-flex; min-height: 21px; align-items: center; padding: 0 7px; border-radius: 6px; background: #282c2e; color: var(--text-soft); font-size: 9px; font-weight: 700; }
.object-heading h3 { margin: 10px 0 5px; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13px; font-weight: 650; line-height: 1.4; }
.object-id { color: var(--dim); font-family: var(--mono); font-size: 9px; }
.inspector-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 12px 0; }
.inspector-actions button:hover, .clear-selection:hover { border-color: #4d5356; background: #292d2f; }
.metadata-list { border-top: 1px solid var(--border-soft); }
.metadata-row { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.metadata-key { color: var(--dim); font-size: 9px; line-height: 1.45; }
.metadata-value { overflow-wrap: anywhere; color: var(--text-soft); font-family: var(--mono); font-size: 9px; line-height: 1.45; }
.clear-selection { width: 100%; margin-top: 13px; }
.inspector-note { display: flex; gap: 9px; padding: 13px 15px; border-top: 1px solid var(--border-soft); background: #121416; }
.note-icon { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #515754; border-radius: 50%; color: var(--muted); font-family: var(--mono); font-size: 9px; }
.inspector-note p { margin: 0; color: var(--dim); font-size: 9px; line-height: 1.45; }
.inspector-note strong { color: #ffb99e; font-weight: 650; }

.drawer-backdrop { position: fixed; z-index: 35; inset: var(--header-h) 0 0; background: rgba(0,0,0,.56); }
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 24px;
  max-width: calc(100vw - 30px);
  padding: 10px 13px;
  border: 1px solid #4e5558;
  border-radius: 10px;
  background: #202326;
  color: var(--text-soft);
  font-size: 11px;
  transform: translateX(-50%);
  box-shadow: 0 16px 38px rgba(0,0,0,.35);
}
.noscript-message { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--bg); color: var(--text); text-align: center; }

@media (max-width: 1120px) {
  :root { --left-w: 270px; --right-w: 292px; }
  .construction-note { display: none; }
}

@media (max-width: 900px) {
  :root { --header-h: 58px; }
  .topbar { padding: 0 12px; }
  .topbar-meta { margin-left: auto; }
  .revision { display: none; }
  .mobile-actions { display: flex; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .panel {
    position: fixed;
    z-index: 50;
    top: var(--header-h);
    bottom: 0;
    width: min(360px, 92vw);
    border: 0;
    box-shadow: 18px 0 50px rgba(0,0,0,.48);
    transition: transform .22s ease;
  }
  .layer-panel { left: 0; transform: translateX(-104%); }
  .inspector-panel { right: 0; transform: translateX(104%); box-shadow: -18px 0 50px rgba(0,0,0,.48); }
  .layer-panel.open, .inspector-panel.open { transform: translateX(0); }
  .panel-close { display: inline-grid !important; }
  .mobile-disclaimer { display: block; padding: 8px 14px; border-top: 1px solid #49312a; background: #241915; color: #ffb99e; font-size: 10px; font-weight: 650; }
  .search-results { position: fixed; top: calc(var(--header-h) + 118px); left: 12px; width: min(336px, calc(92vw - 24px)); }
  .viewport { grid-column: 1; }
  .touch-hint { bottom: 13px; }
  .viewport-toolbar { bottom: 44px; }
  .selection-chip { bottom: 44px; }
  .construction-note { display: block; bottom: 10px; right: 10px; max-width: 230px; }
}

@media (max-width: 640px) {
  .brand-mark { width: 26px; height: 26px; }
  .brand-mark span { width: 19px; height: 6px; }
  .brand-mark span:nth-child(1) { top: 3px; }
  .brand-mark span:nth-child(2) { top: 10px; }
  .brand-mark span:nth-child(3) { top: 17px; }
  .eyebrow { font-size: 8px; }
  .topbar h1 { max-width: 42vw; font-size: 13px; }
  .status-badge { display: none; }
  .viewport-topline { top: 9px; left: 9px; right: 9px; }
  .compact-button { width: 32px; padding: 0; justify-content: center; }
  .compact-button svg { width: 15px; height: 15px; }
  .compact-button { font-size: 0; }
  .view-label { max-width: calc(100% - 43px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .viewport-toolbar { bottom: 12px; }
  .touch-hint { display: none; }
  .construction-note { display: block; top: 48px; right: auto; bottom: auto; left: 9px; max-width: 220px; padding: 7px 9px; border-color: #49312a; background: rgba(36,25,21,.94); }
  .construction-note strong { margin: 0; color: #ffb99e; font-size: 10px; }
  .construction-note span { display: none; }
  .selection-chip { left: 9px; right: 9px; bottom: 59px; max-width: none; }
  .help-card { top: 48px; right: 9px; width: min(250px, calc(100% - 18px)); }
  .loading-card { padding: 17px; }
}

@media (max-width: 360px) {
  .topbar { gap: 8px; padding: 0 8px; }
  .brand-block { gap: 7px; }
  .topbar h1 { max-width: none; font-size: 12px; }
  .title-full { display: none; }
  .title-short { display: inline; }
  .mobile-actions { gap: 4px; }
  .mobile-actions .icon-button { width: 34px; height: 34px; }
  .view-index-link { min-height: 28px; padding: 0 8px; font-size: 9px; }
  .viewport-toolbar button { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .progress-track span { transition: none; }
}
