/* Guided browsing: one clear next stop, with the plaza always within reach. */
#journey-welcome {
  position: fixed;
  top: calc(var(--header-height) + 92px);
  bottom: auto;
  left: 24px;
  right: auto;
  width: min(480px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100svh - var(--header-height) - 194px);
  padding: 20px 24px 12px;
  border-radius: 20px;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
}
#journey-welcome .journey-heading > span { font-size: 12px; letter-spacing: 1px; }
#journey-welcome .journey-heading button { flex: none; width: 44px; height: 44px; margin: -8px -8px -4px 0; }
#journey-welcome h2 { margin: 14px 0 8px; font-size: 29px; line-height: 1.35; letter-spacing: 0; }
#journey-welcome > p { margin: 0 0 18px; font-size: 14px; line-height: 1.75; }
#journey-highlights { margin: 18px 0; }
#journey-highlights .highlight-grid, #journey-highlights.highlight-grid { display: grid; gap: 12px; }
#journey-highlights > p { margin: 10px 0 0; color: var(--ui-muted); font-size: 12px; line-height: 1.7; }
.highlight-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: 13px;
  color: var(--ui-ink);
  background: var(--ui-soft);
  text-align: left;
}
.highlight-card > img { display: block; width: 116px; height: 132px; padding: 6px; border-radius: 8px; object-fit: contain; background: #fff; }
.highlight-copy { display: block; min-width: 0; }
.highlight-copy > small { display: block; color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
.highlight-copy > b { display: block; margin-top: 5px; font-size: 23px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.highlight-copy > p { margin: 6px 0 8px; color: var(--ui-muted); font-size: 14px; line-height: 1.7; }
.highlight-copy > em { display: block; color: var(--ui-accent); font-size: 14px; font-style: normal; font-weight: 600; }
#journey-welcome .journey-choices { gap: 8px; }
#journey-welcome .journey-choices button { padding: 12px 5px; min-height: 68px; background: transparent; color: var(--ui-ink); }
#journey-welcome .journey-choices button b { font-size: 14px; line-height: 1.5; }
#journey-welcome .journey-choices button small { color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
#journey-welcome .journey-choices #journey-tour { background: var(--ui-accent); border-color: var(--ui-accent); color: var(--ui-on-accent); }
#journey-welcome .journey-choices #journey-tour small { color: inherit; }
#journey-welcome .journey-booklet-link { min-height: 48px; font-size: 13px; }
#journey-welcome .journey-booklet-link small { font-size: 11px; }

#browse-nav {
  position: fixed;
  z-index: 31;
  left: var(--browse-center-x, 50%);
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--control-edge);
  border-radius: 16px;
  background: var(--ui-paper);
  color: var(--ui-ink);
  box-shadow: var(--control-panel-shadow);
}
#browse-nav > button { min-width: 112px; min-height: 48px; padding: 10px 20px; border-radius: 10px; background: var(--ui-soft); color: var(--ui-accent); font-size: 15px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
#browse-nav button:disabled { opacity: .4; cursor: default; }
#journey-welcome button:focus-visible, #browse-nav button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
body.has-browse-nav .scene-bottom, body.has-browse-nav .scene-disclaimer { visibility: hidden; pointer-events: none; }
body.has-highlight-panel .scene-disclaimer { visibility: hidden; }
#detail.booth-drawer .booth-drawer-body { overscroll-behavior: contain; }
#modal.product-modal .modal-top { width: auto; max-width: calc(100% - 28px); }
#modal.product-modal #modal-close {
  width: auto;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: nowrap;
}

@media (hover: hover) {
  .highlight-card:hover { border-color: var(--ui-accent); background: var(--ui-paper); }
  #browse-nav button:not(:disabled):hover { background: var(--ui-accent); color: var(--ui-on-accent); }
}

/* Tablet and phone use a lower sheet, leaving the upper view for the booth. */
@media (max-width: 1000px) {
  body.has-browse-nav { --browse-nav-height: calc(80px + env(safe-area-inset-bottom, 0px)); }
  #browse-nav { left: 50%; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  #browse-nav > button { min-width: 120px; }
  body.has-browse-nav #detail.booth-drawer {
    top: auto;
    right: 0;
    left: 0;
    bottom: var(--browse-nav-height);
    width: 100%;
    height: min(48svh, calc(100svh - var(--header-height) - var(--browse-nav-height)));
    max-height: calc(100svh - var(--header-height) - var(--browse-nav-height));
    border-left: 0;
    border-top: 1px solid var(--ui-line);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px #26342020;
  }
  body.has-browse-nav #detail.booth-drawer.sheet-expanded { height: calc(100svh - var(--header-height) - var(--browse-nav-height)); }
  body.has-browse-nav #detail.booth-drawer .booth-drawer-header { padding: 0 18px 8px; }
  body.has-browse-nav #detail.booth-drawer .sheet-grip {
    position: relative;
    top: auto;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    transform: none;
    touch-action: none;
  }
  body.has-browse-nav #detail.booth-drawer .sheet-grip::after { content: ''; width: 36px; height: 4px; border-radius: 4px; background: var(--ui-line); }
  body.has-browse-nav #detail.booth-drawer .sheet-grip > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  body.has-browse-nav #detail.booth-drawer .booth-brand-row { grid-template-columns: 72px minmax(0, 1fr) 44px; gap: 12px; }
  body.has-browse-nav #detail.booth-drawer .booth-brand-row:not(:has(.company-logo)) { grid-template-columns: minmax(0, 1fr) 44px; }
  body.has-browse-nav #detail.booth-drawer .company-logo { width: 72px; height: 44px; }
  body.has-browse-nav #detail.booth-drawer #detail-title { font-size: 24px; }
  body.has-browse-nav #detail.booth-drawer .booth-company-name { margin: 7px 0 4px; font-size: 14px; line-height: 1.5; }
  body.has-browse-nav #detail.booth-drawer .booth-meta { gap: 5px 8px; margin-top: 5px; }
  body.has-browse-nav #detail.booth-drawer .booth-meta > * { font-size: 11px; padding: 2px 6px; }
  body.has-browse-nav #detail.booth-drawer .profile-tabs { margin: 0 18px; }
  body.has-browse-nav #detail.booth-drawer .profile-tabs [data-profile-tab] { min-height: 44px; padding: 9px 2px; font-size: 14px; }
  body.has-browse-nav #detail.booth-drawer .booth-drawer-body { padding: 16px 18px; }
  body.has-browse-nav #detail.booth-drawer .booth-drawer-footer { padding: 8px 18px 10px; }
  body.has-browse-nav #detail.booth-drawer .booth-drawer-footer > :is(button, a) { min-height: 44px; font-size: 14px; }
  #journey-welcome {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    width: auto;
    max-height: min(65svh, calc(100svh - var(--header-height) - 80px));
    padding: 16px 18px 8px;
    border-radius: 20px;
  }
  #journey-welcome h2 { font-size: 26px; margin-top: 10px; }
  #journey-welcome > p { font-size: 13px; margin-bottom: 12px; }
  #journey-highlights { margin: 12px 0; }
  .highlight-card { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .highlight-card > img { width: 88px; height: 110px; padding: 4px; }
  .highlight-copy > b { font-size: 21px; }
  .highlight-copy > p { font-size: 13px; line-height: 1.65; }
  #journey-welcome .journey-choices button b { font-size: 13px; }
  #journey-welcome .journey-choices button small { font-size: 10px; }
  body.has-highlight-panel .scene-bottom { visibility: hidden; pointer-events: none; }
}

@media (max-width: 360px) {
  #journey-welcome { left: 8px; right: 8px; padding-left: 14px; padding-right: 14px; }
  #journey-welcome .journey-booklet-link small { display: block; margin: 2px 0 0; }
}
@media (max-height: 560px) and (max-width: 1000px) {
  body.has-browse-nav #detail.booth-drawer { height: calc(100svh - var(--header-height) - var(--browse-nav-height)); }
  body.has-browse-nav #detail.booth-drawer .sheet-grip { display: none; }
  body.has-browse-nav #detail.booth-drawer .booth-drawer-header { padding-top: 10px; }
  body.has-browse-nav #detail.booth-drawer .booth-company-name, body.has-browse-nav #detail.booth-drawer .booth-meta { display: none; }
}

/* A phone opens directly into a readable sheet. Keep a strip of the plaza above
   it, and give the remaining viewport to the fixed header and scrolling text. */
@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px), (max-width: 1000px) and (max-height: 560px) {
  #detail.booth-drawer,
  body.has-browse-nav #detail.booth-drawer,
  body.has-browse-nav #detail.booth-drawer.sheet-expanded {
    --drawer-scene-strip: 64px;
    inset: calc(var(--header-height) + var(--drawer-scene-strip)) 0 0;
    width: 100%;
    height: calc(100svh - var(--header-height) - var(--drawer-scene-strip));
    height: calc(100dvh - var(--header-height) - var(--drawer-scene-strip));
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--ui-line);
    border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -8px 32px #26342020;
  }
  #detail.booth-drawer .booth-drawer-header,
  body.has-browse-nav #detail.booth-drawer .booth-drawer-header { padding: 16px 18px 12px; }
  #detail.booth-drawer .sheet-grip,
  body.has-browse-nav #detail.booth-drawer .sheet-grip { display: none; }
  #detail.booth-drawer .booth-drawer-body,
  body.has-browse-nav #detail.booth-drawer .booth-drawer-body {
    min-height: 0;
    padding: 16px 18px 24px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  body:has(#detail.booth-drawer:not([hidden])) #browse-nav { display: none; }
}
@media (max-height: 560px) and (max-width: 1000px), (max-height: 560px) and (pointer: coarse) and (max-width: 1100px) {
  #detail.booth-drawer,
  body.has-browse-nav #detail.booth-drawer,
  body.has-browse-nav #detail.booth-drawer.sheet-expanded { --drawer-scene-strip: 8px; }
  #detail.booth-drawer .booth-drawer-header,
  body.has-browse-nav #detail.booth-drawer .booth-drawer-header { padding-top: 10px; padding-bottom: 8px; }
  #detail.booth-drawer .company-logo,
  body.has-browse-nav #detail.booth-drawer .company-logo { height: 36px; }
  #detail.booth-drawer #detail-title,
  body.has-browse-nav #detail.booth-drawer #detail-title { font-size: 22px; }
  #detail.booth-drawer .booth-company-name,
  body.has-browse-nav #detail.booth-drawer .booth-company-name { display: block; margin: 6px 0 4px; font-size: 13px; }
  #detail.booth-drawer .booth-meta,
  body.has-browse-nav #detail.booth-drawer .booth-meta { display: flex; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #journey-welcome, #browse-nav { animation: none; transition: none; }
}

/* Company identity stays above the booth; sequential browsing is optional. */
#pins .pin { max-width: 260px; min-height: 44px; padding: 8px 12px; gap: 9px; border-radius: 9px; border: 1px solid #cdd4c5; background: #fffef7f5; color: #35462e; transform: translate(-50%, -100%); box-shadow: 0 3px 14px #20301720; }
#pins .pin > span { flex: 0 0 auto; width: auto; height: auto; background: transparent; color: inherit; font-size: 12px; }
#pins .pin .pin-company { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
#pins .pin.active { background: #4f6242; color: white; border-color: #4f6242; }
#pins .pin-stage { min-height: 34px; }
@media (max-width: 1000px) {
  #pins .pin { max-width: 220px; padding: 7px 10px; }
  #pins .pin .pin-company { font-size: 13px; }
}
