:root {
  --ink: #20221e;
  --ink-soft: #5e625a;
  --paper: #f5f2eb;
  --paper-strong: #fffdf8;
  --glass: rgba(247, 244, 236, 0.84);
  --glass-strong: rgba(250, 248, 242, 0.94);
  --line: rgba(36, 38, 33, 0.12);
  --line-strong: rgba(36, 38, 33, 0.22);
  --accent: #9f895f;
  --accent-dark: #75613f;
  --success: #62725e;
  --danger: #9c534c;
  --shadow: 0 18px 60px rgba(23, 25, 22, 0.17);
  --shadow-soft: 0 8px 28px rgba(23, 25, 22, 0.12);
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #d9d6ce;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  background: #d9d6ce;
  color: var(--ink);
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-touch-callout: none;
}

button {
  color: inherit;
}

button:not(:disabled),
a {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
[role="switch"]:focus-visible {
  outline: 3px solid rgba(159, 137, 95, 0.55);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell,
#scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.app-shell {
  isolation: isolate;
  background: radial-gradient(circle at 50% 30%, #eeece5, #cfcbc1);
}

#scene-canvas {
  z-index: 0;
  display: block;
  touch-action: none;
  outline: none;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.16em;
  line-height: 1.1;
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(14px + var(--safe-top)) calc(16px + var(--safe-right)) 16px calc(16px + var(--safe-left));
  pointer-events: none;
}

.brand-block,
.top-actions,
.control-dock,
.preset-rail,
.floating-panel,
.hotspot-card {
  pointer-events: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 11px 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.brand-block h1 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand-mark {
  position: relative;
  width: 33px;
  height: 33px;
  margin-right: 10px;
  border-radius: 10px;
  background: #252720;
  overflow: hidden;
}

.brand-mark span {
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: #f6f2e7;
  transform: skewY(-28deg);
}

.brand-mark span:nth-child(1) { left: 9px; }
.brand-mark span:nth-child(2) { left: 15px; background: #ad976b; }
.brand-mark span:nth-child(3) { left: 21px; }

.state-pill {
  align-self: flex-start;
  margin-left: 12px;
  padding: 5px 8px;
  border: 1px solid rgba(98, 114, 94, 0.22);
  border-radius: 999px;
  background: rgba(98, 114, 94, 0.11);
  color: #53614f;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 16px;
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.icon-button,
.dock-button,
.preset-chip,
.segment,
.close-button,
.primary-button,
.switch-control {
  border: 0;
  background: transparent;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 11px;
  color: var(--ink);
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.icon-button:hover,
.icon-button:active {
  background: rgba(37, 39, 32, 0.08);
}

.icon-button:active,
.dock-button:active,
.preset-chip:active {
  transform: scale(0.96);
}

.icon-button svg,
.dock-button svg,
.segment svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ar-button {
  position: relative;
  background: #252720;
  color: #f7f3e9;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.05em;
}

.ar-button:hover,
.ar-button:active {
  background: #383a33;
}

.ar-probe {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(35, 37, 31, 0.065);
}

.segmented.compact {
  margin-right: 1px;
}

.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 680;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.segment.is-active {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(29, 31, 26, 0.11);
}

.segment:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.light-toggle .segment {
  min-width: 34px;
  padding: 0 7px;
}

.floating-panel {
  position: absolute;
  z-index: 50;
  top: calc(76px + var(--safe-top));
  right: calc(16px + var(--safe-right));
  width: min(360px, calc(100vw - 32px - var(--safe-left) - var(--safe-right)));
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  animation: panel-in 180ms ease-out both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-7px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading h2,
.hotspot-card h2,
.loading-card h2,
.help-dialog h2 {
  margin: 0;
  font-family: ui-serif, "New York", Georgia, serif;
  font-weight: 590;
  letter-spacing: -0.025em;
}

.panel-heading h2 {
  font-size: 23px;
}

.close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0 0 3px;
  border-radius: 50%;
  background: rgba(36, 38, 33, 0.07);
  color: var(--ink-soft);
  font-size: 24px;
  line-height: 1;
}

.option-list {
  margin-top: 17px;
  border-top: 1px solid var(--line);
}

.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
}

.option-row strong,
.option-row small {
  display: block;
}

.option-row strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.option-row small {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.switch-control {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 70px;
  min-height: 44px;
  padding: 3px 7px 3px 3px;
  border-radius: 999px;
  background: rgba(98, 114, 94, 0.15);
  color: #53614f;
}

.switch-control span {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--paper-strong);
  box-shadow: 0 2px 6px rgba(34, 36, 31, 0.14);
}

.switch-control b {
  min-width: 22px;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.switch-control[aria-checked="false"] {
  flex-direction: row-reverse;
  padding: 3px 3px 3px 7px;
  background: rgba(36, 38, 33, 0.09);
  color: var(--ink-soft);
}

.switch-control:disabled {
  opacity: 0.42;
}

.compare-row {
  align-items: flex-start;
  padding: 13px 0;
}

.compare-toggle .segment {
  min-width: 54px;
  height: 44px;
  padding: 0 8px;
  font-size: 10px;
}

.panel-footnote {
  margin: 13px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.hotspot-layer {
  position: absolute;
  z-index: 16;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(35, 37, 31, 0.9) 0 14px, rgba(255, 255, 255, 0.82) 14.5px 15.2px, transparent 15.8px);
  color: #fffaf0;
  filter: drop-shadow(0 4px 7px rgba(20, 22, 18, 0.24));
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: opacity 120ms ease, transform 120ms ease;
}

.hotspot::before,
.hotspot::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}

.hotspot::after {
  transform: rotate(90deg);
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.hotspot.is-behind {
  opacity: 0;
  pointer-events: none;
}

.hotspot-card {
  position: absolute;
  z-index: 48;
  right: calc(18px + var(--safe-right));
  bottom: calc(126px + var(--safe-bottom));
  width: min(330px, calc(100vw - 36px - var(--safe-left) - var(--safe-right)));
  padding: 19px 44px 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  animation: card-in 180ms ease-out both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hotspot-card .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
}

.hotspot-card h2 {
  font-size: 22px;
}

.hotspot-card p:last-child {
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.look-surface {
  position: absolute;
  z-index: 7;
  top: 18%;
  right: 0;
  bottom: 122px;
  left: 38%;
  touch-action: none;
  cursor: grab;
}

.look-surface:active {
  cursor: grabbing;
}

.look-surface span {
  position: absolute;
  top: 50%;
  right: max(24px, calc(14px + var(--safe-right)));
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(30, 32, 28, 0.4);
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.look-surface.is-hinting span {
  opacity: 1;
}

.joystick {
  position: absolute;
  z-index: 24;
  left: calc(20px + var(--safe-left));
  bottom: calc(130px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  user-select: none;
  touch-action: none;
}

.joystick-ring {
  position: relative;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  background: rgba(29, 31, 27, 0.25);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.07), 0 8px 28px rgba(20, 22, 18, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.joystick-ring::before,
.joystick-ring::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.17);
}

.joystick-ring::before {
  top: 16px;
  bottom: 16px;
  left: 50%;
  width: 1px;
}

.joystick-ring::after {
  top: 50%;
  right: 16px;
  left: 16px;
  height: 1px;
}

.joystick-knob {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 39px;
  height: 39px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  background: rgba(248, 245, 237, 0.78);
  box-shadow: 0 4px 14px rgba(18, 20, 17, 0.2);
  transform: translate(-50%, -50%);
}

.preset-rail {
  position: absolute;
  z-index: 28;
  right: 0;
  bottom: calc(97px + var(--safe-bottom));
  left: 0;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 8px max(16px, var(--safe-right)) 8px max(16px, var(--safe-left));
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.preset-rail::-webkit-scrollbar {
  display: none;
}

.preset-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 13px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  background: rgba(245, 242, 235, 0.8);
  color: var(--ink-soft);
  box-shadow: 0 5px 18px rgba(24, 26, 22, 0.09);
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  scroll-snap-align: center;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.preset-chip span {
  display: inline-grid;
  place-items: center;
  width: 23px;
  height: 23px;
  margin-right: 6px;
  border-radius: 50%;
  background: rgba(35, 37, 31, 0.07);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.preset-chip.is-active {
  background: rgba(35, 37, 31, 0.9);
  color: #fffaf0;
}

.preset-chip.is-active span {
  background: rgba(255, 255, 255, 0.14);
}

.control-dock {
  position: absolute;
  z-index: 30;
  right: max(14px, calc(10px + var(--safe-right)));
  bottom: max(12px, calc(8px + var(--safe-bottom)));
  left: max(14px, calc(10px + var(--safe-left)));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(720px, calc(100% - 28px - var(--safe-left) - var(--safe-right)));
  min-height: 76px;
  margin: auto;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 21px;
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
}

.mode-switch {
  flex: 0 0 auto;
}

.text-segment {
  gap: 6px;
}

.mode-switch .segment {
  height: 50px;
  padding: 0 13px;
}

.mode-switch .segment svg {
  width: 18px;
  height: 18px;
}

.view-buttons {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.dock-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 76px;
  height: 55px;
  padding: 5px 8px;
  border-radius: 13px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 680;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.dock-button:hover,
.dock-button.is-active {
  background: rgba(35, 37, 31, 0.07);
  color: var(--ink);
}

.dock-button svg {
  width: 21px;
  height: 21px;
}

.utility-buttons {
  display: flex;
  flex: 0 0 auto;
  gap: 3px;
}

.dock-icon {
  width: 42px;
  height: 50px;
}

.toast {
  position: absolute;
  z-index: 80;
  top: calc(83px + var(--safe-top));
  left: 50%;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 15px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(32, 34, 29, 0.9);
  color: #fffaf0;
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toast-in 180ms ease-out both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.loading-screen {
  position: absolute;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) calc(22px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(22px + var(--safe-left));
  background:
    radial-gradient(circle at 18% 12%, rgba(176, 154, 113, 0.19), transparent 35%),
    radial-gradient(circle at 83% 78%, rgba(96, 112, 91, 0.15), transparent 38%),
    #e8e3d9;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.loading-screen::before,
.loading-screen::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(40, 42, 36, 0.07);
}

.loading-screen::before {
  inset: 7%;
}

.loading-screen::after {
  top: 7%;
  bottom: 7%;
  left: 50%;
}

.loading-screen.is-complete {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(248, 245, 238, 0.78);
  box-shadow: 0 24px 80px rgba(38, 40, 35, 0.13);
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.loading-brand {
  position: relative;
  width: 54px;
  height: 54px;
  margin: 0 auto 24px;
  border-radius: 16px;
  background: #252720;
  overflow: hidden;
}

.loading-brand i {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: #f8f3e7;
  transform: skewY(-28deg);
  animation: mark-pulse 1.4s ease-in-out infinite;
}

.loading-brand i:nth-child(1) { left: 15px; animation-delay: -0.24s; }
.loading-brand i:nth-child(2) { left: 25px; background: #b29b6e; animation-delay: -0.12s; }
.loading-brand i:nth-child(3) { left: 35px; }

@keyframes mark-pulse {
  0%, 100% { opacity: 0.45; transform: skewY(-28deg) scaleY(0.75); }
  50% { opacity: 1; transform: skewY(-28deg) scaleY(1); }
}

.loading-card h2 {
  font-size: clamp(27px, 7vw, 36px);
}

.loading-card > p:not(.eyebrow) {
  margin: 12px 0 20px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(34, 36, 31, 0.09);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-dark), #b5a479);
  transition: width 150ms ease;
}

.progress-label {
  display: block;
  margin-top: 9px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 690;
}

.load-error {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--danger);
}

.load-error p {
  color: var(--ink-soft) !important;
  font-size: 11px !important;
}

.load-error code {
  font-size: 0.95em;
}

.primary-button {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: #252720;
  color: #fffaf0;
  font-size: 12px;
  font-weight: 700;
}

.help-dialog {
  width: min(620px, calc(100vw - 28px - var(--safe-left) - var(--safe-right)));
  max-height: min(760px, calc(100dvh - 28px - var(--safe-top) - var(--safe-bottom)));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(249, 247, 241, 0.97);
  color: var(--ink);
  box-shadow: 0 28px 100px rgba(20, 22, 18, 0.32);
  overflow: auto;
}

.help-dialog::backdrop {
  background: rgba(22, 24, 20, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-inner {
  padding: 24px;
}

.help-dialog h2 {
  font-size: 27px;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 21px;
}

.help-grid section {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 105px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.48);
}

.help-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #252720;
  color: #fffaf0;
  font-size: 9px;
  font-weight: 740;
}

.help-grid h3,
.help-grid p {
  margin: 0;
}

.help-grid h3 {
  margin: 2px 0 5px;
  font-size: 13px;
}

.help-grid p,
.ios-note {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.keyboard-help {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(35, 37, 31, 0.055);
  color: var(--ink-soft);
  font-size: 10px;
}

.keyboard-help strong {
  margin-right: auto;
  color: var(--ink);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  margin: 0 1px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper-strong);
  color: var(--ink);
  font: 680 9px/1 -apple-system, sans-serif;
}

.ios-note {
  margin: 14px 2px;
}

.dialog-done {
  width: 100%;
}

.noscript-message {
  position: fixed;
  z-index: 200;
  inset: 20px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--paper-strong);
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    gap: 8px;
    padding-right: calc(10px + var(--safe-right));
    padding-left: calc(10px + var(--safe-left));
  }

  .brand-block {
    min-height: 45px;
    padding: 7px 9px 7px 7px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
    margin-right: 8px;
  }

  .brand-block h1 {
    font-size: 17px;
  }

  .brand-block .eyebrow {
    font-size: 8px;
  }

  .state-pill {
    display: none;
  }

  .top-actions {
    gap: 2px;
    padding: 3px;
  }

  .top-actions .icon-button {
    width: 44px;
    height: 44px;
  }

  .light-toggle .segment {
    min-width: 42px;
    height: 44px;
    padding: 0 6px;
  }

  .light-toggle svg {
    width: 17px;
    height: 17px;
  }

  .preset-rail {
    justify-content: flex-start;
    bottom: calc(91px + var(--safe-bottom));
  }

  .control-dock {
    gap: 5px;
    min-height: 70px;
    padding: 6px;
    border-radius: 19px;
  }

  .mode-switch .segment {
    min-width: 47px;
    height: 47px;
    padding: 0 8px;
    font-size: 0;
  }

  .mode-switch .segment svg {
    width: 21px;
    height: 21px;
  }

  .view-buttons {
    flex: 1 1 auto;
  }

  .dock-button {
    flex: 1 1 30%;
    min-width: 0;
    height: 51px;
    padding: 4px 3px;
    font-size: 8px;
  }

  .dock-button svg {
    width: 19px;
    height: 19px;
  }

  .utility-buttons {
    gap: 0;
  }

  .dock-icon {
    width: 44px;
    height: 47px;
  }

  .dock-icon svg {
    width: 18px;
    height: 18px;
  }

  .hotspot-card {
    right: calc(12px + var(--safe-right));
    bottom: calc(117px + var(--safe-bottom));
    width: calc(100vw - 24px - var(--safe-left) - var(--safe-right));
  }

  .floating-panel {
    top: calc(69px + var(--safe-top));
    right: calc(10px + var(--safe-right));
    width: calc(100vw - 20px - var(--safe-left) - var(--safe-right));
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .help-grid section {
    min-height: auto;
  }

  .keyboard-help {
    display: none;
  }

  .loading-card {
    padding: 30px 24px;
  }
}

@media (pointer: coarse) {
  .light-toggle .segment {
    min-width: 42px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  .brand-block > div:nth-child(2) {
    display: none;
  }

  .brand-mark {
    margin-right: 0;
  }

  .preset-chip {
    min-height: 44px;
  }

  .control-dock {
    left: max(8px, calc(5px + var(--safe-left)));
    right: max(8px, calc(5px + var(--safe-right)));
    width: calc(100% - 16px - var(--safe-left) - var(--safe-right));
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .topbar {
    padding-top: calc(7px + var(--safe-top));
  }

  .brand-block .eyebrow,
  .preset-rail,
  .dock-button span {
    display: none;
  }

  .brand-block {
    transform: scale(0.9);
    transform-origin: top left;
  }

  .control-dock {
    width: min(540px, calc(100% - 24px - var(--safe-left) - var(--safe-right)));
    min-height: 58px;
  }

  .mode-switch .segment,
  .dock-button,
  .dock-icon {
    height: 44px;
  }

  .joystick {
    bottom: calc(78px + var(--safe-bottom));
  }

  .joystick-ring {
    width: 76px;
    height: 76px;
  }

  .look-surface {
    bottom: 72px;
  }
}

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

@supports not (backdrop-filter: blur(1px)) {
  .brand-block,
  .top-actions,
  .floating-panel,
  .control-dock,
  .hotspot-card {
    background: rgba(248, 246, 240, 0.97);
  }
}
