/* Dino Gogo interaction floor. Shared by React, the static hub and mini-apps.
   Change these tokens together with docs/ui-standards.md and browser QA.
   !important is reserved here for floors that older event themes must not shrink. */
:root {
  --dino-target-min: 3rem;
  --dino-action-gap: .75rem;
  --dino-decision-gap: 1rem;
  --dino-section-gap: 1.5rem;
  --dino-body-size: 1rem;
  --dino-control-size: 1rem;
  --dino-support-size: .875rem;
  --dino-title-size: 1.25rem;
  --dino-page-title-size: clamp(1.75rem, 5vw, 2.5rem);
  --dino-body-leading: 1.6;
  --dino-control-leading: 1.5;
}
body {
  font-size: var(--dino-body-size);
  line-height: var(--dino-body-leading);
}

/* Spatial puzzle tiles are one spatial input, not independent action buttons. */
:root body button:not(.puzzle button, .adoption-home-button, .event-template-primary),
:root body [role='button']:not(.puzzle [role='button']),
:root body summary,
:root body .dino-control,
:root body :is(.all-events-return, .passport-link, .brand-button, .quick-events a,
    .passport-save-qr, .secondary-cta, .event-template-button, .hub-line-channels a,
    .event-template-text-link, .event-template-location a, .passport-story a, .line-community-link, .quiz-entry,
    .ba-primary, .ba-secondary, .ba-text-button, .line-connect-button,
    .line-later-button, .back-button, .checkin-fallback, .topbar a,
    .quiz-language-bar a) {
  min-height: var(--dino-target-min) !important;
  min-width: var(--dino-target-min) !important;
  height: auto;
  font-size: var(--dino-control-size) !important;
  line-height: var(--dino-control-leading) !important;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  touch-action: manipulation;
}
summary { text-align: start; }
input:not([type='hidden'], [type='checkbox'], [type='radio'], [type='range'], [type='color']),
textarea,
select {
  min-height: var(--dino-target-min) !important;
  font-size: var(--dino-body-size) !important;
  line-height: var(--dino-control-leading);
  min-width: 0;
  max-width: 100%;
}
/* The full label, not just the small checkbox drawing, is the touch target. */
label:has(input:is([type='checkbox'], [type='radio'])) {
  min-height: var(--dino-target-min);
  cursor: pointer;
}

/* Primary and utility actions: label and icon share one natural centre line. */
:is(.secondary-cta, .passport-save-qr, .all-events-return, .passport-link,
    .checkin-button, .da-secondary, .line-connect-button, .line-later-button,
    .event-template-button, .ba-primary, .ba-secondary, .dino-control) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
  box-sizing: border-box;
}
:is(.secondary-cta, .passport-save-qr, .checkin-button, .dino-control) > svg {
  flex-shrink: 0;
}
/* Keep the illustrated egg action and its approved display face. */
:root body :is(.adoption-home-button, .event-template-primary) {
  min-height: 94px !important;
  font-size: 1.75rem !important;
  line-height: 1.25 !important;
}
.event-template-primary { display: flex !important; }
:is(.adoption-home-button, .event-template-primary) .adoption-hatch-egg { flex-shrink: 0; }

/* Apply to action groups, never to the icon/label spacing inside a button. */
:is(.dino-actions, .line-invite-actions, .passport-booking-actions,
    .da-stack, .event-template-actions, .event-home-actions, .header-actions,
    .language-toggle, .footer-nav, .event-template-nav, .ba-team-tabs,
    .ba-local-tools, .ba-selection-bar, .dialog-footer, .detail-choices,
    .quick-events) {
  gap: var(--dino-action-gap) !important;
}
.quiz-language-bar > div { display: flex; gap: var(--dino-action-gap); }
.quiz-language-bar { gap: var(--dino-action-gap); flex-wrap: wrap; }
:is(.topbar, .answers, .question-options, fieldset:has(> .answer)) { gap: var(--dino-action-gap) !important; }
:is(.topbar a, .quiz-language-bar a) { display: inline-flex; align-items: center; }
:is(.dino-actions, .header-actions, .line-invite-actions, .ba-team-tabs,
    .ba-selection-bar) { flex-wrap: wrap; }
:is(.dino-actions[data-decision], .organizer-actions, .ba-person-decisions,
    .passport-scan-review, .line-disconnect-confirm) {
  gap: var(--dino-decision-gap) !important;
}
.line-disconnect-confirm { display: flex; flex-wrap: wrap; align-items: center; }
.line-disconnect-confirm > p { flex-basis: 100%; }
.line-disconnect-confirm button + button { margin: 0; }
.footer-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-inline: 1rem; }
.footer-action { padding: .5rem .25rem; }
.event-template-nav a { flex: 1; min-width: 0; }
/* Navigation is the only compact label role; its touch area is still 48px. */
:root body button.footer-action,
:root body .event-template-nav a {
  font-size: var(--dino-support-size) !important;
  line-height: 1.5 !important;
}
.language-toggle button { padding: .5rem; flex-shrink: 0; }
.event-topbar { column-gap: var(--dino-action-gap); }
.event-member-greeting { font-size: var(--dino-support-size); }
.event-topbar .all-events-return { max-width: none; }
.site-header { height: auto; min-height: 90px; padding-block: 1rem; flex-wrap: wrap; }
.site-header .brand-button { display: flex; align-items: center; }
.quick-event-title { font-size: var(--dino-control-size) !important; line-height: 1.5; }
.quick-event { text-align: start !important; }
.quick-event-title { flex: 1; }
.quick-event-date { min-width: 5rem; }
.quick-event-date small { white-space: nowrap; }

/* Body and support roles stay readable instead of shrinking on narrow phones. */
:is(.collection-screen, .line-invite, .event-template, .da-settings,
    .dino-account-dialog, .checkin-dialog, .personal-pass-scanner,
    .organizer-panel, .bloq-app-page, .site-shell) p,
:is(.da-stack, .bloq-app-page, .organizer-date) label,
:is(.line-community-link, .line-connect-consent label) {
  font-size: var(--dino-body-size) !important;
  line-height: var(--dino-body-leading) !important;
}
small,
:is(.da-small, .line-local-note, .event-template-eyebrow, .event-template-facts dt,
    .event-template-button small, .event-template-note, .booking-card-head,
    .passport-qr-caption, .passport-qr-heading p, .event-status, .opening-label,
    .event-peek, .event-card-copy > small, .admin-stat small, .admin-companion-help,
    .attendance-stamp span, .line-community-link small) {
  font-size: var(--dino-support-size) !important;
  line-height: 1.5 !important;
}
:is(.collection-screen, .line-invite, .event-template, .dino-account-dialog,
    .personal-pass-scanner) { scroll-margin-bottom: 7rem; }
:is(button, a, input, select, summary, textarea):focus-visible {
  outline: 3px solid #bc4319;
  outline-offset: 3px;
}
html[lang='th'] :is(button, a, summary, label, input, select, textarea) {
  letter-spacing: 0 !important;
  line-height: 1.6 !important;
}
/* At 320px a third header column would squeeze names and the language buttons. */
@media (max-width: 380px) {
  .event-topbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--dino-action-gap); }
  .event-topbar .event-member-greeting { grid-row: 2; grid-column: 1 / -1; text-align: start; }
  .event-template-facts { grid-template-columns: 1fr; }
  :root body :is(.adoption-home-button, .event-template-primary) { font-size: 1.5rem !important; }
  .event-topbar .all-events-return { justify-self: start; }
}
@media (max-width: 600px) {
  .quick-events { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :is(button, a, summary) { transition: none !important; }
}
