@font-face {
  font-display: swap;
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  src: url("./assets/fonts/newsreader-latin.woff2") format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  src: url("./assets/fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  --paper: #f7f2ea;
  --paper-strong: #fffaf2;
  --olive: #3f4938;
  --olive-deep: #1f302e;
  --clay: #b8795b;
  --stone: #d8c7ad;
  --mist: #b8c0a8;
  --line: rgba(247, 242, 234, 0.18);
  --ink: #30382d;
  --shadow: 0 18px 50px rgba(18, 28, 25, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #090b0e; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(184, 121, 91, 0.38); outline-offset: 2px; }
[hidden] { display: none !important; }

#view { display: block; width: 100%; height: 100%; outline: none; cursor: grab; touch-action: none; }
#view:active { cursor: grabbing; }

#tour-header {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.brand-card, .tour-actions, #tour-navigation, #help-card, #ask-house-panel, #object-anchor-panel, #movement-hint { pointer-events: auto; }

.brand-card {
  display: flex;
  align-items: center;
  min-height: 84px;
  padding: 13px 17px 13px 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--paper);
  background: rgba(55, 66, 50, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.wordmark {
  min-width: 178px;
  color: var(--paper);
  font-family: "Newsreader", Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

.wordmark small {
  display: block;
  margin-top: 7px;
  color: #d6a18a;
  font-family: "Inter", sans-serif;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.property-identity { min-width: 182px; margin-left: 19px; padding-left: 19px; border-left: 1px solid rgba(247, 242, 234, 0.2); }
.property-identity > span, .debug-label, #help-card .help-heading span { display: block; color: rgba(247, 242, 234, 0.62); font-size: 8px; font-weight: 600; letter-spacing: 0.13em; text-transform: uppercase; }
.property-identity h1 { margin: 3px 0 2px; font-family: "Newsreader", Georgia, serif; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }

#status { display: flex; align-items: center; gap: 7px; margin: 0; color: rgba(247, 242, 234, 0.7); font-size: 9px; }
#status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px rgba(184, 121, 91, 0.15); }

.tour-actions { display: flex; align-items: center; gap: 8px; padding: 7px; border: 1px solid rgba(247, 242, 234, 0.2); border-radius: 10px; background: rgba(31, 48, 46, 0.9); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.tour-actions button, .tour-actions a, #help-card button, #tour-navigation button { cursor: pointer; }
.quiet-button, .icon-button, .primary-button { min-height: 42px; border: 0; border-radius: 7px; }
.quiet-button { display: inline-flex; align-items: center; padding: 0 15px; color: var(--paper); background: transparent; font-size: 11px; text-decoration: none; }
.quiet-button:hover { background: rgba(247, 242, 234, 0.1); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; padding: 0; color: var(--paper); background: rgba(247, 242, 234, 0.08); }
.icon-button:hover { background: rgba(247, 242, 234, 0.16); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.primary-button { padding: 0 17px; color: var(--olive-deep); background: var(--clay); font-size: 11px; font-weight: 700; }
.ask-button { min-height: 42px; border: 0; border-radius: 7px; padding: 0 15px; color: var(--olive-deep); background: #f0d1bd; cursor: pointer; font-size: 11px; font-weight: 800; }
.ask-button:hover, .ask-button[aria-expanded="true"] { background: #d9a285; }

#help-card { position: fixed; z-index: 25; top: 84px; right: max(18px, env(safe-area-inset-right)); width: min(360px, calc(100vw - 36px)); padding: 25px; border: 1px solid rgba(63, 73, 56, 0.13); border-radius: 12px; color: var(--ink); background: rgba(255, 250, 242, 0.96); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.help-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
#help-card .help-heading span { color: #788173; }
#help-card h2 { margin: 6px 0 0; font-family: "Newsreader", Georgia, serif; font-size: 29px; font-weight: 600; letter-spacing: -0.03em; }
.icon-button.light { width: 34px; min-height: 34px; color: var(--olive); background: rgba(63, 73, 56, 0.08); font-size: 20px; }
#help-card ol { display: grid; gap: 16px; margin: 24px 0; padding: 0; list-style: none; }
#help-card li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; font-size: 11px; line-height: 1.45; }
#help-card li b { color: var(--olive); }
#help-card li span { color: rgba(48, 56, 45, 0.68); }
.viewer-height { display: grid; grid-template-columns: 1fr 72px 42px; align-items: center; gap: 8px; padding-top: 17px; border-top: 1px solid rgba(63, 73, 56, 0.13); color: var(--olive); font-size: 11px; }
.viewer-height input { width: 100%; min-height: 36px; border: 1px solid rgba(63, 73, 56, 0.2); border-radius: 6px; color: var(--ink); background: var(--paper); padding: 0 8px; }
.viewer-height span { color: rgba(48, 56, 45, 0.55); font-size: 9px; }
.viewer-analytics { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 9px; margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(63, 73, 56, 0.13); color: var(--olive); font-size: 10px; line-height: 1.35; }
.viewer-analytics input { margin-top: 2px; }
.viewer-analytics small { display: block; margin-top: 4px; color: rgba(48, 56, 45, 0.6); font-size: 8px; line-height: 1.45; }

#ask-house-panel {
  position: fixed;
  z-index: 44;
  top: 84px;
  right: max(18px, env(safe-area-inset-right));
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100vh - 106px);
  padding: 23px;
  overflow: auto;
  border: 1px solid rgba(63, 73, 56, 0.16);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.ask-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.ask-heading span { display: block; color: #788173; font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.ask-heading h2 { margin: 5px 0 0; font-family: "Newsreader", Georgia, serif; font-size: 31px; font-weight: 600; letter-spacing: -0.035em; }
.ask-context { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.ask-context span, .ask-trust { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border-radius: 999px; color: #546052; background: rgba(63, 73, 56, 0.08); font-size: 8px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.ask-context span:first-child::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #4f9865; content: ""; }
.ask-intro { margin: 12px 0 14px; color: rgba(48, 56, 45, 0.7); font-size: 10px; line-height: 1.5; }
.ask-prompts { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-prompts button { min-height: 31px; border: 1px solid rgba(63, 73, 56, 0.15); border-radius: 999px; padding: 5px 9px; color: var(--olive); background: rgba(63, 73, 56, 0.055); cursor: pointer; font-size: 9px; font-weight: 650; }
.ask-prompts button:hover { border-color: rgba(184, 121, 91, 0.45); background: rgba(184, 121, 91, 0.12); }
#ask-house-form { display: grid; gap: 6px; margin-top: 17px; }
#ask-house-form label { color: #697365; font-size: 8px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
#ask-house-form > div { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
#ask-house-input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid rgba(63, 73, 56, 0.22); border-radius: 8px; padding: 0 12px; color: var(--ink); background: var(--paper-strong); font-size: 11px; }
#ask-house-form button { min-height: 44px; border: 0; border-radius: 8px; padding: 0 16px; color: var(--paper); background: var(--olive); cursor: pointer; font-size: 10px; font-weight: 800; }
.ask-answer { margin-top: 14px; padding: 14px; border: 1px solid rgba(63, 73, 56, 0.14); border-radius: 10px; background: rgba(63, 73, 56, 0.055); }
.ask-answer p { margin: 9px 0 0; color: var(--ink); font-family: "Newsreader", Georgia, serif; font-size: 18px; line-height: 1.35; }
.ask-trust { color: #2f6841; background: rgba(79, 152, 101, 0.13); }
.ask-evidence { display: grid; gap: 5px; margin-top: 11px; }
.ask-evidence span { display: block; padding-top: 6px; border-top: 1px solid rgba(63, 73, 56, 0.1); color: rgba(48, 56, 45, 0.68); font-size: 9px; line-height: 1.4; }
.ask-technical { margin-top: 11px; color: #657061; }
.ask-technical summary { cursor: pointer; font-size: 9px; font-weight: 700; }
.ask-technical pre { max-height: 165px; color: #d8e1d5; background: #26312b; }
.ask-warning { margin: 12px 0 0; color: #85614f; font-size: 8px; line-height: 1.45; }

#object-anchor-panel {
  position: fixed;
  z-index: 46;
  top: 84px;
  right: max(18px, env(safe-area-inset-right));
  width: min(430px, calc(100vw - 36px));
  max-height: calc(100vh - 106px);
  padding: 22px;
  overflow: auto;
  border: 1px solid rgba(63, 73, 56, 0.18);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}
.anchor-author-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.anchor-author-heading span { color: #788173; font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.anchor-author-heading h2 { margin: 5px 0 0; font-family: "Newsreader", Georgia, serif; font-size: 29px; letter-spacing: -0.035em; }
.anchor-author-help, .anchor-instruction { margin: 12px 0; color: rgba(48, 56, 45, 0.7); font-size: 10px; line-height: 1.5; }
.anchor-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 13px 0; }
.anchor-progress span { display: grid; gap: 2px; padding: 9px; border-radius: 8px; color: #657061; background: rgba(63, 73, 56, 0.07); font-size: 8px; text-align: center; }
.anchor-progress b { color: var(--olive-deep); font-size: 16px; }
.anchor-field { display: grid; gap: 6px; margin: 12px 0; color: var(--olive); font-size: 9px; font-weight: 700; }
.anchor-field select, .anchor-field textarea { width: 100%; border: 1px solid rgba(63, 73, 56, 0.22); border-radius: 8px; padding: 9px 10px; color: var(--ink); background: var(--paper-strong); font-size: 10px; }
.anchor-field select { min-height: 42px; }
.anchor-field textarea { resize: vertical; line-height: 1.4; }
.anchor-step-buttons, .anchor-pick-buttons, .anchor-primary-actions, .anchor-secondary-actions { display: grid; gap: 7px; margin-top: 8px; }
.anchor-step-buttons { grid-template-columns: 1fr 1.2fr 1fr; }
.anchor-pick-buttons, .anchor-primary-actions, .anchor-secondary-actions { grid-template-columns: 1fr 1fr; }
#object-anchor-panel button:not(.icon-button) { min-height: 38px; border: 1px solid rgba(63, 73, 56, 0.2); border-radius: 7px; padding: 7px 9px; color: var(--olive); background: rgba(63, 73, 56, 0.07); cursor: pointer; font-size: 9px; font-weight: 700; }
#object-anchor-panel button:not(.icon-button):hover { background: rgba(63, 73, 56, 0.14); }
#object-anchor-panel button:disabled { cursor: not-allowed; opacity: 0.42; }
#anchor-save-point, #anchor-validate-current { color: var(--paper) !important; background: var(--olive) !important; }
#anchor-needs-review { color: #8a592f !important; }
.anchor-coordinate-card { display: grid; gap: 7px; margin: 12px 0; padding: 11px; border-radius: 9px; color: var(--paper); background: #27372f; }
.anchor-coordinate-card div { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 8px; }
.anchor-coordinate-card span { color: rgba(247, 242, 234, 0.64); font-size: 8px; text-transform: uppercase; }
.anchor-coordinate-card strong { color: #efb38f; font-size: 10px; }
.anchor-coordinate-card code { overflow: hidden; color: #eef3eb; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.anchor-author-status { min-height: 30px; margin: 12px 0 0; color: #687365; font-size: 10px; line-height: 1.45; }
.anchor-author-status.error { color: #9d3f34; }
.anchor-author-status.saved { color: #267044; }
body.anchor-authoring-mode #tour-header { right: 466px; }
body.anchor-authoring-mode #touch-walk { display: none; }
body.anchor-picking #view { cursor: copy; }

#tour-navigation { position: fixed; z-index: 20; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(190px, 270px) auto 48px; gap: 8px; width: min(630px, calc(100vw - 36px)); padding: 9px; border: 1px solid rgba(63, 73, 56, 0.13); border-radius: 12px; background: rgba(255, 250, 242, 0.96); box-shadow: var(--shadow); transform: translateX(-50%); backdrop-filter: blur(20px); }
#tour-navigation label { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 3px 7px 2px; }
#tour-navigation label span { color: #7a8275; font-size: 7px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
#destination { width: 100%; border: 0; color: var(--ink); background: transparent; font-family: "Newsreader", Georgia, serif; font-size: 17px; font-weight: 600; outline: none; }
.nav-primary, .nav-reset { min-height: 48px; border: 0; border-radius: 7px; }
.nav-primary { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 174px; padding: 0 17px; color: var(--paper); background: var(--olive); font-size: 11px; font-weight: 600; }
.nav-primary:hover { background: var(--olive-deep); }
.nav-primary:disabled { cursor: wait; opacity: 0.55; }
.nav-primary span { color: #d6a18a; font-size: 18px; }
.nav-reset { display: flex; align-items: center; justify-content: center; width: 48px; padding: 0; color: var(--olive); background: rgba(63, 73, 56, 0.08); }
.nav-reset:hover { background: rgba(63, 73, 56, 0.15); }
.nav-reset svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#movement-hint { position: fixed; z-index: 15; left: 50%; bottom: calc(max(22px, env(safe-area-inset-bottom)) + 82px); margin: 0; padding: 8px 12px; border: 1px solid rgba(247, 242, 234, 0.16); border-radius: 999px; color: rgba(247, 242, 234, 0.85); background: rgba(31, 48, 46, 0.74); box-shadow: 0 9px 25px rgba(18, 28, 25, 0.18); font-size: 9px; transform: translateX(-50%); backdrop-filter: blur(12px); }
#movement-hint span { margin: 0 6px; color: #d6a18a; }

#authoring-panel {
  position: fixed;
  z-index: 45;
  top: 118px;
  right: 18px;
  width: min(380px, calc(100vw - 36px));
  max-height: calc(100vh - 140px);
  padding: 20px;
  overflow: auto;
  border: 1px solid rgba(63, 73, 56, 0.18);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.97);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.authoring-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.authoring-heading span:first-child { color: #788173; font-size: 8px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.authoring-heading h2 { margin: 4px 0 8px; font-family: "Newsreader", Georgia, serif; font-size: 29px; letter-spacing: -0.03em; }
.authoring-count { display: grid; min-width: 34px; height: 34px; place-items: center; border-radius: 50%; color: var(--olive-deep); background: var(--clay); font-size: 12px; font-weight: 800; }
.authoring-help { color: rgba(48, 56, 45, 0.68); font-size: 11px; line-height: 1.5; }
.authoring-overlay-toggle { display: flex; align-items: center; gap: 10px; margin: 12px 0; padding: 9px 10px; border: 1px solid rgba(63, 73, 56, 0.16); border-radius: 8px; background: rgba(86, 242, 154, 0.08); cursor: pointer; }
.authoring-overlay-toggle input { width: 16px; height: 16px; accent-color: #27764a; }
.authoring-overlay-toggle span { display: grid; gap: 2px; color: var(--olive); font-size: 10px; }
.authoring-overlay-toggle small { color: rgba(48, 56, 45, 0.62); font-size: 9px; font-weight: 500; }
.authoring-position-card { margin: 12px 0; padding: 10px; border: 1px solid rgba(63, 73, 56, 0.18); border-radius: 9px; background: #27372f; }
.authoring-position-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--paper); font-size: 10px; }
.authoring-position-heading span { color: rgba(247, 242, 234, 0.68); font-size: 9px; text-align: right; }
#authoring-position-map { display: block; width: 100%; height: auto; border: 1px solid rgba(247, 242, 234, 0.12); border-radius: 6px; background: #18241f; }
.authoring-position-card p { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 7px 0 0; color: rgba(247, 242, 234, 0.7); font-size: 8px; }
.map-key { display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; }
.map-key:first-child { margin-left: 0; }
.map-key.you { background: #fffaf2; box-shadow: 0 0 0 2px #314e3e; }
.map-key.safe { background: #56f29a; }
.map-key.proposed { background: #e18a57; }
.authoring-field { display: grid; gap: 6px; margin: 12px 0; color: var(--olive); font-size: 10px; font-weight: 700; }
.authoring-field input, .authoring-field select { width: 100%; min-height: 40px; border: 1px solid rgba(63, 73, 56, 0.22); border-radius: 7px; padding: 8px 10px; color: var(--ink); background: var(--paper-strong); }
.authoring-buttons { display: grid; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.authoring-buttons.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.authoring-buttons.compact:first-of-type { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#authoring-panel button { min-height: 38px; border: 1px solid rgba(63, 73, 56, 0.2); border-radius: 7px; padding: 7px 8px; color: var(--olive); background: rgba(63, 73, 56, 0.07); cursor: pointer; font-size: 10px; font-weight: 700; }
#authoring-panel button:hover { background: rgba(63, 73, 56, 0.14); }
#authoring-panel button:disabled { cursor: not-allowed; opacity: 0.45; }
#authoring-panel button.danger { color: #8a392f; }
.authoring-snap-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 10px; padding: 10px; border: 1px solid rgba(183, 103, 64, 0.32); border-radius: 9px; background: rgba(214, 161, 138, 0.16); }
.authoring-snap-card[hidden] { display: none; }
.authoring-snap-card div { display: grid; gap: 2px; color: var(--olive); font-size: 10px; }
.authoring-snap-card span { color: #9d5035; font-size: 9px; }
#authoring-snap { border-color: rgba(157, 80, 53, 0.36) !important; color: #863e2c !important; background: rgba(255, 250, 242, 0.72) !important; }
.authoring-save-row { display: grid; gap: 8px; grid-template-columns: 1fr auto; margin-top: 14px; }
#authoring-save { color: var(--paper) !important; background: var(--olive) !important; }
.authoring-status { min-height: 32px; margin: 12px 0 0; color: #6a7468; font-size: 10px; line-height: 1.45; }
.authoring-status.error { color: #9d3f34; }
.authoring-status.saved { color: #267044; }
body.authoring-mode #tour-header { right: 416px; }
body.authoring-mode #touch-walk { display: none; }

#panel { position: fixed; z-index: 40; top: 118px; left: 18px; width: min(390px, calc(100vw - 36px)); max-height: calc(100vh - 140px); padding: 15px; overflow: auto; border: 1px solid #ffffff22; border-radius: 14px; color: #f3f5f7; background: #11151be8; box-shadow: 0 16px 40px #0008; backdrop-filter: blur(14px); }
#panel .heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#panel .heading h2 { margin: 3px 0 13px; font-size: 18px; }
#panel .debug-label { color: #8f9aa8; }
#collapse { width: 32px; padding: 4px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.metrics span { padding: 8px; border-radius: 8px; background: #ffffff0c; color: #b9c4d1; font-size: 12px; }
.metrics b { color: #8de1b0; font-size: 16px; }
#panel label { display: grid; grid-template-columns: 1fr 130px; align-items: center; gap: 10px; margin: 7px 0; font-size: 12px; color: #ccd4df; }
#panel label.check { display: flex; }
#object-filter-row[hidden] { display: none; }
#panel input[type="number"], #panel select { width: 100%; padding: 6px 8px; border: 1px solid #ffffff22; border-radius: 6px; color: white; background: #07090d; }
#panel button { padding: 8px 10px; border: 1px solid #ffffff22; border-radius: 7px; color: white; background: #273342; cursor: pointer; }
#panel button:hover { background: #34465a; }
.debug-wide { width: 100%; margin: 4px 0 10px; }
.buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-top: 12px; }
.help { color: #8794a3; font-size: 11px; line-height: 1.5; }
details { font-size: 12px; }
pre { max-height: 230px; overflow: auto; padding: 8px; border-radius: 6px; background: #07090d; font-size: 10px; white-space: pre-wrap; }
#panel.collapsed { width: 250px; }
#panel.collapsed #controls { display: none; }

#touch-walk, #touch-walk *, #view {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#touch-walk {
  position: fixed;
  z-index: 18;
  right: 18px;
  bottom: 94px;
  display: none;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
#touch-drive {
  position: relative;
  width: 96px;
  height: 96px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(247, 242, 234, 0.28);
  border-radius: 50%;
  touch-action: none;
  pointer-events: auto;
  background:
    linear-gradient(90deg, transparent 49%, rgba(247, 242, 234, 0.12) 50%, transparent 51%),
    radial-gradient(circle, rgba(247, 242, 234, 0.12) 0 34%, transparent 35%),
    rgba(31, 48, 46, 0.84);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
#touch-drive::before, #touch-drive::after {
  position: absolute;
  top: 50%;
  color: rgba(247, 242, 234, 0.5);
  font-size: 11px;
  line-height: 1;
  transform: translateY(-50%);
}
#touch-drive::before { left: 9px; content: "‹"; }
#touch-drive::after { right: 9px; content: "›"; }
#touch-drive-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper);
  background: var(--clay);
  box-shadow: 0 8px 18px rgba(84, 36, 20, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, background 180ms ease;
  will-change: transform;
}
#touch-drive-thumb svg { width: 22px; height: 22px; fill: currentColor; }
#touch-drive.is-active { border-color: rgba(247, 242, 234, 0.62); background-color: rgba(31, 48, 46, 0.95); }
#touch-drive.is-active #touch-drive-thumb { background: #b86242; transition: none; }
.touch-drive-label {
  display: grid;
  gap: 1px;
  padding: 7px 10px;
  border: 1px solid rgba(247, 242, 234, 0.16);
  border-radius: 999px;
  color: var(--paper);
  text-align: center;
  pointer-events: none;
  background: rgba(31, 48, 46, 0.78);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.touch-drive-label b { font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.touch-drive-label small { color: rgba(247, 242, 234, 0.72); font-size: 9px; }

@media (pointer: coarse) {
  #touch-walk { display: flex; flex-direction: column; }
  #movement-hint { display: none; }
}

@media (max-width: 760px) {
  #tour-header { align-items: stretch; }
  .brand-card { min-height: 70px; padding: 11px 14px; }
  .wordmark { min-width: 0; font-size: 23px; }
  .wordmark small { display: none; }
  .property-identity { min-width: 0; margin-left: 13px; padding-left: 13px; }
  .property-identity > span { display: none; }
  .property-identity h1 { max-width: 130px; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .quiet-button { width: 42px; padding: 0; font-size: 0; }
  .quiet-button::after { content: "?"; font-size: 15px; }
  #anchor-author-toggle::after { content: "3D"; font-size: 9px; font-weight: 800; }
  .primary-button { padding: 0 12px; }
  .ask-button { width: 42px; padding: 0; font-size: 0; }
  .ask-button::after { content: "Ask"; font-size: 9px; }
  #tour-navigation { grid-template-columns: minmax(0, 1fr) auto 44px; }
  .nav-primary { min-width: 48px; width: 48px; padding: 0; justify-content: center; font-size: 0; }
  .nav-primary span { font-size: 20px; }
  .nav-reset { width: 44px; }
  #movement-hint { max-width: calc(100vw - 36px); white-space: nowrap; }
  body.authoring-mode #tour-header { right: max(18px, env(safe-area-inset-right)); }
  body.anchor-authoring-mode #tour-header { right: max(18px, env(safe-area-inset-right)); }
  #authoring-panel { top: 104px; max-height: calc(100vh - 120px); }
  #object-anchor-panel { top: 104px; max-height: calc(100vh - 120px); }
}

@media (max-width: 520px) {
  #tour-header { left: 10px; right: 10px; top: 10px; }
  .brand-card { flex: 1; }
  .wordmark { font-size: 21px; }
  .property-identity { display: none; }
  .tour-actions { flex: 0 0 auto; }
  #fullscreen { display: none; }
  #help-card { top: 76px; right: 10px; width: calc(100vw - 20px); }
  #ask-house-panel { top: 76px; right: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 96px); padding: 18px; }
  #object-anchor-panel { top: 76px; right: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 96px); padding: 18px; }
  #tour-navigation { bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
  #movement-hint { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 82px); }
  #panel { top: 86px; left: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 172px); }
  #touch-walk { right: 14px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 78px); }
  #touch-drive { width: 88px; height: 88px; }
  #touch-drive-thumb { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
