/* V9 — quiet, tactile exhibition controls. Scene/layout geometry stays upstream. */
.scene-shell {
  --control-radius: 14px;
  --control-inner-radius: 10px;
  --control-edge: #65745829;
  --control-highlight: #ffffffb8;
  --control-shadow: 0 5px 20px #20331b12, 0 1px 3px #20331b0a;
  --control-panel-shadow: 0 16px 50px #20331b1c, 0 2px 6px #20331b0a;
  --control-ease: cubic-bezier(.2,.7,.25,1);
}
body.night-ui .scene-shell {
  --control-edge: #c8d2b82e;
  --control-highlight: #ffffff0c;
  --control-shadow: 0 5px 20px #070c0633, 0 1px 3px #070c0633;
  --control-panel-shadow: 0 16px 50px #070c0666, 0 2px 6px #070c0633;
}

/* A consistent surface and highlight make small controls readable over the scene. */
.scene-search-field,
.scene-quick-actions .day-night-switch,
.scene-quick-actions #toggle-labels,
.scene-quick-actions .stage-media-open,
.scene-tools,
.scene-bottom .view-switch,
.scene-bottom .tour-launch,
.walk-nav {
  border: 1px solid var(--control-edge);
  border-radius: var(--control-radius);
  background: var(--ui-float);
  box-shadow: var(--control-shadow), inset 0 1px 0 var(--control-highlight);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.scene-shell button {
  transition: background-color 180ms var(--control-ease), color 180ms var(--control-ease),
    border-color 180ms var(--control-ease), box-shadow 180ms var(--control-ease);
}
.scene-shell button:focus-visible { outline-offset: 3px; }
.scene-shell button:disabled { cursor: default; }
.scene-shell button:not(:disabled):active { transition-duration: 70ms; }

/* Search is one field, with no nested rectangular chrome. */
.scene-search-field { height: 48px; gap: 10px; padding: 0 7px 0 16px; }
.scene-search-field>svg { width: 18px; height: 18px; flex-basis: 18px; color: var(--ui-accent); }
.scene-search-field #booth-search-sidebar { font-size: 12px; letter-spacing: .15px; }
.scene-search-field:focus-within {
  border-color: var(--ui-accent);
  box-shadow: var(--control-shadow), 0 0 0 3px #80956b1c;
}
.scene-search-field kbd {
  display: grid; place-items: center; width: 23px; height: 25px; flex: 0 0 23px;
  margin-right: 5px; padding: 0; border-color: var(--control-edge); border-radius: 6px;
  background: var(--ui-soft); box-shadow: 0 1px 0 var(--control-edge); font-size: 10px;
}
.scene-search-field #search-clear { width: 40px; height: 42px; flex-basis: 40px; border-radius: 9px; }
.search-panel {
  padding: 10px; border-color: var(--control-edge); border-radius: 18px;
  box-shadow: var(--control-panel-shadow); background: var(--ui-paper);
}
.search-panel-heading { padding: 0 4px 5px 9px; min-height: 44px; }
.search-panel-heading b { font-size: 12px; letter-spacing: .4px; }
.search-panel #search-close { width: 44px; height: 44px; border-radius: 10px; }
.search-categories { padding: 0 4px 12px; gap: 5px; }
.search-categories button {
  min-height: 40px; padding: 8px 6px; font-size: 10px;
  border-color: transparent; border-radius: 10px; background: var(--ui-soft);
}
.search-categories button[aria-pressed=true] {
  background: var(--ui-accent); border-color: var(--ui-accent);
  box-shadow: inset 0 1px 0 #ffffff1a; color: var(--ui-on-accent);
}
.search-result-meta { padding: 0 10px 9px; font-size: 9px; }
.search-panel .zone-list { gap: 3px; }
.search-panel .zone-row { min-height: 64px; padding: 11px 10px; border-radius: 11px; gap: 9px; }
.search-panel .zone-row.active {
  border-color: transparent; background: var(--ui-soft);
  box-shadow: inset 2px 0 0 var(--ui-accent);
}
.search-panel .zone-row b { font-size: 12px; line-height: 1.5; font-weight: 500; }
.search-panel .zone-row small { font-size: 10px; line-height: 1.4; }
.search-panel .zone-number { font-size: 10px; width: 32px; }
.search-panel .zone-arrow { opacity: .55; }
.search-footnote { margin: 9px 5px 0; padding: 11px 5px 1px; font-size: 9px; }

/* The quick actions and tool rail share one comfortable touch size. */
.scene-quick-actions { gap: 7px; }
.scene-quick-actions .day-night-switch,
.scene-quick-actions #toggle-labels,
.scene-quick-actions .stage-media-open {
  min-height: 46px; padding: 0 14px; font-size: 11px; gap: 7px;
}
.scene-quick-actions .day-night-switch>span:first-child { font-size: 18px; }
.scene-quick-actions #toggle-labels[aria-pressed=true],
.scene-quick-actions .stage-media-open[aria-expanded=true] {
  background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-on-accent);
  box-shadow: var(--control-shadow), inset 0 1px 0 #ffffff1f;
}
.scene-tools { padding: 4px; gap: 2px; }
.scene-tools button {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--control-inner-radius); font-size: 21px;
}
.scene-tools>span { margin: 3px 9px; background: var(--control-edge); }

/* Segmented navigation: a soft rail, a single active destination. */
.scene-bottom .view-switch { padding: 4px; gap: 3px; }
.scene-bottom .view-switch button {
  min-height: 44px; padding: 11px 17px !important;
  border-radius: var(--control-inner-radius); font-size: 11px; font-weight: 500;
}
.scene-bottom .view-switch .selected {
  background: var(--ui-accent); color: var(--ui-on-accent);
  box-shadow: 0 2px 5px #20331b14, inset 0 1px 0 #ffffff1f;
}
.scene-bottom .view-switch button span { font-size: 15px; vertical-align: -1px; }
.scene-bottom .tour-launch { height: 54px; padding: 0 17px; gap: 9px; font-size: 11px; }
.scene-bottom .tour-launch .play-icon {
  width: 24px; height: 24px; border-color: var(--control-edge); background: var(--ui-soft);
}

/* A clear direction pad instead of six disconnected square buttons. */
.walk-nav { width: 174px; padding: 10px; gap: 5px; }
.walk-nav .walk-turns { width: 100%; gap: 4px; margin-bottom: 2px; }
.walk-turns b { font-size: 9px; letter-spacing: .5px; }
.walk-nav button {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center; padding: 0;
  border: 1px solid transparent; border-radius: 10px;
  color: var(--ui-ink); background: var(--ui-soft); font-size: 20px;
}
.walk-nav .walk-turns button { height: 44px; display: flex; gap: 0; }
.walk-nav .walk-turns button span { font-size: 20px; }
.walk-nav .walk-turns button small { font-size: 8px; line-height: 1.2; }
.walk-nav .walk-movement { gap: 5px; }
.walk-nav button:active {
  background: var(--ui-accent); color: var(--ui-on-accent);
  border-color: var(--ui-accent); box-shadow: inset 0 2px 4px #0000001a;
}
.walk-nav button:active small { color: inherit; }
.walk-nav .walk-help { margin-top: 4px; font-size: 8px; letter-spacing: .15px; }

/* Content sheets use spacing and hierarchy rather than heavy dividers. */
.detail-panel {
  border-color: var(--control-edge); border-radius: 18px;
  background: var(--ui-paper); box-shadow: var(--control-panel-shadow);
}
.detail-top { gap: 12px; padding-bottom: 12px; }
.detail-panel .close-button { width: 44px; height: 44px; border-color: transparent; border-radius: 12px; background: var(--ui-soft); }
.detail-code { font-size: 29px; letter-spacing: -1px; }
.detail-panel h2 { line-height: 1.5; letter-spacing: .3px; }
.detail-panel .eyebrow { font-size: 9px; letter-spacing: 1.5px; }
.detail-tag { display: inline-block; font-size: 11px; margin-top: 3px; }
.detail-copy { font-size: 12px; line-height: 1.9; }
.booth-products, .booth-tags { gap: 6px; }
.booth-products span, .booth-tags span { border-color: transparent; border-radius: 7px; padding: 7px 9px; line-height: 1.4; }
.detail-actions { gap: 8px; }
.detail-actions .primary, .detail-actions .secondary,
.media-transport button, .media-local .secondary {
  min-height: 44px; border-radius: 10px; font-size: 11px;
}
.detail-actions .primary { box-shadow: inset 0 1px 0 #ffffff1f; }
.detail-panel .text-action { min-height: 44px; line-height: 1.5; }
.stage-video-host { border-radius: 12px; }
.media-now { border: 0; border-radius: 12px; padding: 15px; }
.media-now>b { line-height: 1.5; }
.stage-program-list { gap: 7px; }
.stage-program-list button { min-height: 58px; border-color: var(--control-edge); border-radius: 11px; }
.stage-program-list button b { font-size: 12px; }
.stage-program-list button small { line-height: 1.5; }
.media-local .text-action { font-size: 11px; }
.tour-bar { border-color: var(--control-edge); border-radius: 13px; box-shadow: var(--control-shadow); }
.tour-bar button { min-height: 40px; border-radius: 9px; }

@media (hover: hover) and (pointer: fine) {
  .scene-quick-actions button:hover, .scene-tools button:hover,
  .scene-bottom .tour-launch:hover, .walk-nav button:hover {
    background: var(--ui-soft); border-color: var(--control-edge);
  }
  .scene-bottom .view-switch button:not(.selected):hover { background: var(--ui-soft); color: var(--ui-ink); }
  .scene-quick-actions #toggle-labels[aria-pressed=true]:hover,
  .scene-quick-actions .stage-media-open[aria-expanded=true]:hover { background: var(--ui-accent); }
  .walk-nav button:active { background: var(--ui-accent); color: var(--ui-on-accent); border-color: var(--ui-accent); }
  .search-panel .zone-row:hover { border-color: transparent; background: var(--ui-soft); }
  .search-panel .zone-row:hover .zone-arrow { opacity: 1; }
  .detail-panel .secondary:hover, .stage-program-list button:not(:disabled):hover { border-color: var(--ui-accent); background: var(--ui-soft); }
}

@media (max-width: 700px) {
  .scene-shell { --control-radius: 12px; --control-inner-radius: 9px; }
  .scene-search-field { height: 44px; padding: 0 4px 0 10px; gap: 6px; }
  .scene-search-field #booth-search-sidebar { font-size: 16px; letter-spacing: -.4px; }
  .scene-search-field>svg { width: 16px; height: 16px; flex-basis: 16px; }
  .scene-search-field kbd { display: none; }
  .scene-search-field #search-clear { width: 32px; flex-basis: 32px; height: 42px; }
  .scene-quick-actions { gap: 5px; }
  .scene-quick-actions .day-night-switch,
  .scene-quick-actions .stage-media-open { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .scene-quick-actions #toggle-labels { min-height: 44px; padding: 0 10px; font-size: 10px; }
  .scene-tools button { width: 40px; height: 42px; }
  .scene-bottom .view-switch { padding: 3px; gap: 2px; }
  .scene-bottom .view-switch button { min-height: 44px; padding: 10px 10px !important; font-size: 10px; }
  .scene-bottom .tour-launch { height: 52px; padding: 0 11px; gap: 6px; font-size: 10px; }
  .scene-bottom .tour-launch .play-icon { width: 20px; height: 20px; }
  .walk-nav { width: 162px; padding: 8px; gap: 4px; }
  .walk-nav .walk-turns { margin-bottom: 0; gap: 3px; }
  .walk-turns b { font-size: 8px; }
  .walk-nav .walk-movement { gap: 4px; }
  .walk-nav .walk-help { display: none; }
  .search-panel { border-radius: 15px; }
  .search-categories button { min-height: 44px; }
  .detail-panel { border-radius: 16px; }
  .detail-panel .detail-copy { font-size: 12px; }
  .detail-panel .detail-note { font-size: 10px; }
  .detail-panel, .search-panel, .walk-nav, .scene-tools, .view-switch { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Keep the direction pad compact on short screens, while retaining touch targets. */
@media (max-height: 540px) and (min-width: 701px) {
  .walk-nav { width: 162px; padding: 7px; gap: 3px; }
  .walk-nav .walk-turns { margin-bottom: 0; gap: 2px; }
  .walk-nav .walk-help { display: none; }
  .scene-tools button { width: 40px; height: 38px; }
  .scene-tools { gap: 0; padding: 3px; }
  .scene-bottom .tour-launch { height: 50px; }
  .scene-bottom .view-switch button { min-height: 40px; padding: 10px 13px !important; }
  /* Short landscape sheets need their content space; retain the sticky close
     control but let actions scroll with the content instead of covering it. */
  body .detail-panel { bottom: max(16px, env(safe-area-inset-bottom)); max-height: none; }
  .detail-panel .detail-actions { position: static; margin-bottom: 0; padding-bottom: 0; }
  .scene-shell:has(.detail-panel:not([hidden])) .scene-bottom { visibility: hidden; pointer-events: none; }
}
@media (max-width: 380px) {
  .scene-bottom .view-switch button { padding: 10px 8px !important; font-size: 9px; }
  .scene-bottom .tour-launch { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-shell button { transition: none; }
}
