/* Enterprise information is contained in its own drawer, separate from stage media. */
#detail.booth-drawer {
  --profile-muted: #5f6759;
  position: fixed;
  inset: var(--header-height) 0 0 auto;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: clamp(520px, 38vw, 560px);
  height: auto;
  min-height: 0;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--ui-line);
  border-radius: 0;
  background: var(--ui-paper);
  color: var(--ui-ink);
  box-shadow: -12px 0 44px #26342020;
  backdrop-filter: none;
  z-index: 30;
  font-size: 16px;
  line-height: 1.75;
  touch-action: pan-y;
}
body.night-ui #detail.booth-drawer,
body.night-ui #modal.product-modal { --profile-muted: #c0c5b6; }
#detail.booth-drawer .booth-drawer-header { padding: 24px 28px 18px; }
#detail.booth-drawer .sheet-grip { display: none; }
#detail.booth-drawer .booth-brand-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 16px;
}
#detail.booth-drawer .booth-brand-row:not(:has(.company-logo)) { grid-template-columns: minmax(0, 1fr) 44px; }
#detail.booth-drawer .company-logo {
  display: block;
  width: 100px;
  height: 56px;
  object-fit: contain;
  padding: 4px;
  border: 0;
  border-radius: 6px;
  background: #fff;
}
#detail.booth-drawer #detail-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0;
  font-weight: 650;
  color: var(--ui-ink);
  overflow-wrap: anywhere;
}
#detail.booth-drawer #detail-close {
  align-self: start;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ui-soft);
  color: var(--ui-ink);
  font-size: 26px;
  line-height: 1;
}
#detail.booth-drawer .booth-company-name {
  margin: 16px 0 10px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.65;
  color: var(--ui-ink);
  overflow-wrap: anywhere;
}
#detail.booth-drawer .booth-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin-top: 12px; }
#detail.booth-drawer .booth-meta > * {
  margin: 0;
  padding: 3px 9px;
  border: 0;
  border-radius: 5px;
  background: var(--ui-soft);
  color: var(--profile-muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
#detail.booth-drawer .profile-tabs {
  display: flex;
  gap: 0;
  margin: 0 28px;
  border-bottom: 1px solid var(--ui-line);
}
#detail.booth-drawer .profile-tabs [data-profile-tab] {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 10px 4px 13px;
  color: var(--profile-muted);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}
#detail.booth-drawer .profile-tabs [aria-selected="true"] { color: var(--ui-accent); font-weight: 650; }
#detail.booth-drawer .profile-tabs [aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -1px;
  left: 12px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ui-accent);
}
#detail.booth-drawer .booth-drawer-body {
  min-height: 0;
  padding: 24px 28px 28px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--ui-line) transparent;
  -webkit-overflow-scrolling: touch;
}
#detail.booth-drawer [data-profile-panel] { min-width: 0; }
#detail.booth-drawer [data-profile-panel] > :first-child { margin-top: 0; }
#detail.booth-drawer :is(.profile-intro, .detail-copy, .profile-intro p, .detail-copy p) {
  color: var(--ui-ink);
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
#detail.booth-drawer :is(.profile-intro p, .detail-copy p) { margin: 0 0 18px; }
#detail.booth-drawer :is(h3, .detail-subtitle) {
  margin: 26px 0 12px;
  color: var(--ui-ink);
  font-size: 20px;
  line-height: 1.5;
  font-weight: 600;
}
#detail.booth-drawer .detail-subtitle > small { margin-left: 8px; color: var(--profile-muted); font-size: 14px; font-weight: 400; }
#detail.booth-drawer .feature-list { margin: 14px 0 24px; padding-left: 20px; }
#detail.booth-drawer .feature-list li { padding: 5px 0; border: 0; color: var(--ui-ink); font-size: 16px; line-height: 1.75; }
.profile-preline { white-space: pre-line; overflow-wrap: anywhere; }
#detail.booth-drawer .profile-state { display: flex; align-items: center; gap: 8px; margin: 14px 0; color: var(--ui-accent); font-size: 14px; line-height: 1.7; }
#detail.booth-drawer .profile-state > span { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
#detail.booth-drawer .profile-awaiting { margin: 14px 0 22px; padding: 18px 0; border: 0; border-top: 1px solid var(--ui-line); }
#detail.booth-drawer .profile-awaiting b { font-size: 16px; font-weight: 600; }
#detail.booth-drawer .profile-awaiting p { margin: 8px 0 0; color: var(--profile-muted); font-size: 15px; line-height: 1.75; }
#detail.booth-drawer .profile-categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
#detail.booth-drawer .profile-categories span { padding: 5px 10px; border-radius: 5px; background: var(--ui-soft); color: var(--profile-muted); font-size: 14px; line-height: 1.6; }
#detail.booth-drawer .profile-source-note { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--ui-line); color: var(--profile-muted); font-size: 13px; line-height: 1.75; }
#detail.booth-drawer .profile-empty { margin: 0 0 18px; color: var(--profile-muted); font-size: 16px; line-height: 1.75; }
#detail.booth-drawer .product-preview-list { display: grid; margin: 16px 0; }
#detail.booth-drawer .product-preview-list > div { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--ui-line); }
#detail.booth-drawer .product-preview-list > div > span { color: var(--ui-accent); font: 15px ui-monospace, monospace; }
#detail.booth-drawer .product-preview-list p { margin: 0; color: var(--ui-ink); font-size: 16px; line-height: 1.75; }
#detail.booth-drawer .profile-product-grid { display: grid; gap: 0; margin: 0; }
#detail.booth-drawer .profile-product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-height: 140px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  border-radius: 0;
  text-align: left;
  background: transparent;
  color: var(--ui-ink);
}
#detail.booth-drawer .profile-product-card:first-child { padding-top: 0; min-height: 122px; }
.product-visual { display: block; width: 100%; aspect-ratio: 1; position: relative; overflow: hidden; border-radius: 9px; background: #fff; }
.product-visual img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-placeholder { display: flex; height: 100%; width: 100%; align-items: center; justify-content: center; gap: 12px; padding: 12px; color: var(--ui-accent); background: var(--ui-soft); }
.product-placeholder > b { font: 30px Georgia, serif; font-weight: 400; }
.product-placeholder > span { font-size: 13px; line-height: 1.6; }
.product-placeholder small { display: block; color: var(--profile-muted, var(--ui-muted)); font-size: 12px; margin-top: 5px; }
#detail.booth-drawer .profile-product-card .product-placeholder { flex-direction: column; gap: 3px; text-align: center; }
#detail.booth-drawer .product-card-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
#detail.booth-drawer .product-card-copy > b { font-size: 17px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
#detail.booth-drawer .product-card-copy > span { margin: 7px 0; font-size: 14px; line-height: 1.7; color: var(--profile-muted); overflow-wrap: anywhere; }
#detail.booth-drawer .product-card-copy > small { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: 14px; line-height: 1.6; color: var(--ui-accent); }
#detail.booth-drawer .product-card-copy i { font-size: 18px; font-style: normal; }
#detail.booth-drawer .profile-channel-list { display: grid; gap: 0; }
#detail.booth-drawer .profile-channel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ui-line);
  text-decoration: none;
  color: var(--ui-ink);
}
#detail.booth-drawer .profile-channel > :is(div, span) { min-width: 0; }
#detail.booth-drawer .profile-channel :is(b, strong) { display: block; font-size: 17px; font-weight: 600; line-height: 1.6; }
#detail.booth-drawer .profile-channel :is(p, small) { display: block; margin: 5px 0 0; color: var(--profile-muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
#detail.booth-drawer .profile-channel > :is(i, span):last-child { flex: none; color: var(--ui-accent); font-size: 22px; font-style: normal; }
#detail.booth-drawer .company-contact { margin: 0; padding: 0; border: 0; }
#detail.booth-drawer .profile-contact-list { margin: 0; }
#detail.booth-drawer .profile-contact-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--ui-line); }
#detail.booth-drawer .profile-contact-row dt { color: var(--profile-muted); font-size: 15px; line-height: 1.75; }
#detail.booth-drawer .profile-contact-row dd { margin: 0; color: var(--ui-ink); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
#detail.booth-drawer .profile-contact-row a { display: inline-flex; min-height: 44px; align-items: center; color: var(--ui-accent); text-underline-offset: 4px; }
#detail.booth-drawer .profile-contact-row:has(a) { align-items: center; padding-top: 9px; padding-bottom: 9px; }
#detail.booth-drawer .profile-contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 18px; }
#detail.booth-drawer .profile-contact-actions button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--ui-line); border-radius: 8px; color: var(--ui-ink); font-size: 15px; line-height: 1.5; }
#detail.booth-drawer :is(.profile-website, .profile-contact-actions a) { display: inline-flex; align-items: center; min-height: 44px; color: var(--ui-accent); font-size: 15px; line-height: 1.6; text-underline-offset: 4px; }
#detail.booth-drawer .booth-drawer-footer { padding: 16px 28px 20px; border-top: 1px solid var(--ui-line); background: var(--ui-paper); }
#detail.booth-drawer .booth-drawer-footer > :is(button, a) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--ui-accent);
  color: var(--ui-on-accent);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

/* Product information keeps imagery, readable details, and the purchase action in view. */
#modal.product-modal {
  --profile-muted: #5f6759;
  position: fixed;
  width: 960px;
  max-width: calc(100vw - 48px);
  height: min(680px, calc(100svh - 48px));
  max-height: calc(100svh - 48px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ui-line);
  border-radius: 20px;
  background: var(--ui-paper);
  color: var(--ui-ink);
}
#modal.product-modal .modal-top { position: absolute; z-index: 3; top: 14px; right: 14px; margin: 0; }
#modal.product-modal #modal-kicker { display: none; }
#modal.product-modal #modal-close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ui-line); border-radius: 50%; background: var(--ui-paper); color: var(--ui-ink); box-shadow: 0 2px 8px #26342012; font-size: 26px; line-height: 1; }
#modal.product-modal #modal-content { height: 100%; min-height: 0; }
#modal.product-modal .product-detail-layout { display: grid; grid-template-columns: 45% minmax(0, 55%); grid-template-rows: minmax(0, 1fr) auto; height: 100%; min-height: 0; }
#modal.product-modal .product-detail-gallery { display: flex; flex-direction: column; justify-content: center; gap: 16px; grid-column: 1; grid-row: 1 / 3; min-width: 0; min-height: 0; padding: 28px; background: var(--ui-soft); }
#modal.product-modal .product-visual-large { flex: 0 1 auto; aspect-ratio: 1; min-height: 0; max-height: 430px; border: 0; border-radius: 12px; }
#modal.product-modal .product-visual-large .product-placeholder > b { font-size: 48px; }
#modal.product-modal .product-visual-large .product-placeholder > span { font-size: 15px; }
#modal.product-modal .product-thumbnails { display: flex; flex: none; justify-content: center; gap: 10px; margin: 0; padding: 3px; overflow-x: auto; scrollbar-width: thin; }
#modal.product-modal .product-thumbnails button { flex: 0 0 60px; width: 60px; height: 60px; min-width: 44px; min-height: 44px; padding: 3px; overflow: hidden; border: 2px solid transparent; border-radius: 8px; background: #fff; color: var(--ui-ink); font-size: 14px; }
#modal.product-modal .product-thumbnails button img { display: block; width: 100%; height: 100%; object-fit: contain; }
#modal.product-modal .product-thumbnails [aria-pressed="true"] { border-color: var(--ui-accent); }
#modal.product-modal .product-detail-copy { grid-column: 2; grid-row: 1; min-height: 0; padding: 58px 32px 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
#modal.product-modal .product-brand-line { margin: 0 0 14px; color: var(--ui-accent); font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
#modal.product-modal .modal-title { margin: 0 0 18px; color: var(--ui-ink); font-family: inherit; font-size: 30px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
#modal.product-modal .product-detail-spec { margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--ui-line); color: var(--profile-muted); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
#modal.product-modal .product-detail-summary { color: var(--ui-ink); font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
#modal.product-modal .product-detail-summary p { max-width: none; margin: 0 0 16px; color: var(--ui-ink); font-size: 16px; line-height: 1.75; }
#modal.product-modal .product-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; grid-column: 2; grid-row: 2; min-width: 0; padding: 20px 32px 26px; border-top: 1px solid var(--ui-line); background: var(--ui-paper); }
#modal.product-modal .product-detail-actions :is(.profile-store, .product-phone) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border-radius: 10px; font-size: 16px; font-weight: 500; line-height: 1.5; text-align: center; text-decoration: none; }
#modal.product-modal .product-detail-actions .profile-store { flex: 1 1 160px; border: 1px solid var(--ui-accent); background: var(--ui-accent); color: var(--ui-on-accent); }
#modal.product-modal .product-detail-actions .product-phone { flex: 1 1 120px; border: 1px solid var(--ui-line); background: transparent; color: var(--ui-ink); }
#modal.product-modal .product-store-note { flex-basis: 100%; margin: 0; color: var(--profile-muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
:is(#detail.booth-drawer, #modal.product-modal) :is(button, a):focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  #detail.booth-drawer :is(.profile-product-card, .profile-channel):hover { background: var(--ui-soft); }
  #detail.booth-drawer .profile-tabs [data-profile-tab]:hover { color: var(--ui-accent); }
  :is(#detail.booth-drawer, #modal.product-modal) .close-button:hover { background: var(--ui-soft); }
}
@media (max-width: 700px) {
  #detail.booth-drawer {
    inset: auto 0 0;
    width: 100%;
    height: min(85svh, calc(100svh - var(--header-height)));
    max-height: calc(100svh - var(--header-height));
    border: 0;
    border-top: 1px solid var(--ui-line);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 36px #26342024;
  }
  #detail.booth-drawer.sheet-expanded { height: calc(100svh - var(--header-height)); border-radius: 0; }
  #detail.booth-drawer .booth-drawer-header { position: relative; padding: 46px 20px 16px; }
  #detail.booth-drawer .sheet-grip { position: absolute; top: 0; left: 50%; display: grid; place-items: center; width: 88px; height: 44px; padding: 0; transform: translateX(-50%); border-radius: 10px; touch-action: none; }
  #detail.booth-drawer .sheet-grip::after { content: ""; width: 36px; height: 4px; border-radius: 4px; background: var(--ui-line); }
  #detail.booth-drawer .sheet-grip > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #detail.booth-drawer .booth-brand-row { grid-template-columns: 90px minmax(0, 1fr) 44px; gap: 12px; }
  #detail.booth-drawer .company-logo { width: 90px; height: 50px; }
  #detail.booth-drawer #detail-title { font-size: 28px; }
  #detail.booth-drawer .booth-company-name { margin-top: 13px; margin-bottom: 9px; font-size: 15px; }
  #detail.booth-drawer .booth-meta { gap: 6px 8px; }
  #detail.booth-drawer .booth-meta > * { padding: 2px 8px; font-size: 12px; }
  #detail.booth-drawer .profile-tabs { margin: 0 20px; }
  #detail.booth-drawer .profile-tabs [data-profile-tab] { min-height: 48px; font-size: 14px; }
  #detail.booth-drawer .booth-drawer-body { padding: 20px; }
  #detail.booth-drawer .profile-product-card { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; min-height: 128px; padding: 16px 0; }
  #detail.booth-drawer .profile-product-card:first-child { min-height: 112px; }
  #detail.booth-drawer .product-card-copy > b { font-size: 16px; }
  #detail.booth-drawer .profile-contact-row { grid-template-columns: 66px minmax(0, 1fr); gap: 14px; }
  #detail.booth-drawer .booth-drawer-footer { padding: 12px 20px max(14px, env(safe-area-inset-bottom)); }
  #detail.booth-drawer .booth-drawer-footer > :is(button, a) { min-height: 50px; }
  #modal.product-modal { width: calc(100vw - 20px); max-width: calc(100vw - 20px); height: calc(100svh - 20px); max-height: calc(100svh - 20px); border-radius: 18px; }
  #modal.product-modal .modal-top { top: 10px; right: 10px; }
  #modal.product-modal .product-detail-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: 30svh minmax(0, 1fr) auto; }
  #modal.product-modal .product-detail-gallery { grid-column: 1; grid-row: 1; align-items: center; gap: 8px; padding: 14px 20px 10px; }
  #modal.product-modal .product-visual-large { flex: 1 1 auto; width: min(100%, 290px); height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; border-radius: 8px; }
  #modal.product-modal .product-thumbnails { gap: 8px; max-width: 100%; padding: 2px; }
  #modal.product-modal .product-thumbnails button { flex-basis: 44px; width: 44px; height: 44px; }
  #modal.product-modal .product-detail-copy { grid-column: 1; grid-row: 2; padding: 20px 22px; }
  #modal.product-modal .product-brand-line { margin-bottom: 10px; font-size: 14px; }
  #modal.product-modal .modal-title { margin-bottom: 14px; font-size: 28px; line-height: 1.35; }
  #modal.product-modal .product-detail-spec { margin-bottom: 16px; padding-bottom: 16px; }
  #modal.product-modal .product-detail-actions { grid-column: 1; grid-row: 3; gap: 10px; padding: 14px 20px max(14px, env(safe-area-inset-bottom)); }
  #modal.product-modal .product-detail-actions :is(.profile-store, .product-phone) { min-height: 48px; padding: 10px 14px; font-size: 15px; }
  #modal.product-modal .product-detail-actions .profile-store { flex-basis: 140px; }
  #modal.product-modal .product-detail-actions .product-phone { flex-basis: 100px; }
  #modal.product-modal .product-store-note { font-size: 12px; }
}
@media (max-width: 360px) {
  #detail.booth-drawer .booth-brand-row { grid-template-columns: 76px minmax(0, 1fr) 44px; gap: 9px; }
  #detail.booth-drawer .company-logo { width: 76px; height: 46px; }
  #detail.booth-drawer #detail-title { font-size: 26px; }
  #detail.booth-drawer .profile-tabs [data-profile-tab] { font-size: 13px; }
}
@media (max-height: 560px) and (max-width: 700px) {
  #detail.booth-drawer { height: calc(100svh - var(--header-height)); }
  #detail.booth-drawer .booth-drawer-header { padding-top: 12px; padding-bottom: 10px; }
  #detail.booth-drawer .sheet-grip { display: none; }
  #detail.booth-drawer .booth-company-name { margin-top: 8px; }
  #detail.booth-drawer .company-logo { height: 44px; }
  #detail.booth-drawer #detail-title { font-size: 26px; }
  #modal.product-modal .product-detail-layout { grid-template-columns: 40% minmax(0, 60%); grid-template-rows: minmax(0, 1fr) auto; }
  #modal.product-modal .product-detail-gallery { grid-column: 1; grid-row: 1 / 3; padding: 20px 14px; }
  #modal.product-modal .product-detail-copy { grid-column: 2; grid-row: 1; padding-top: 58px; }
  #modal.product-modal .product-detail-actions { grid-column: 2; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  #detail.booth-drawer, #modal.product-modal { animation: none; transition: none; }
}
