/* Shared refinements: retain the warm paper, olive, Raleway and original imagery. */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--olive) var(--paper);
}
body { min-height: 100dvh; }
button, select, summary, .button, .nav a, .social-follow a {
  touch-action: manipulation;
}
button, summary, .button, .nav a {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button, .button {
  transition: transform 120ms cubic-bezier(.23,1,.32,1), background-color 120ms ease-out, border-color 120ms ease-out;
}
button:enabled:active, .button:active { transform: scale(.98); }
/* Geographic pins already use transform for positioning. */
.marker:enabled:active { transform: translate(-50%,-50%); }
button:disabled { cursor: default; }
summary:active, .nav a:active { color: var(--olive); }
input, textarea, select { caret-color: var(--olive); }
input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ochre);
  outline-offset: 4px;
}
.stallholder-dialog { overscroll-behavior: contain; }
.market-title, .detail h3, .product h2 { overflow-wrap: anywhere; }
.market-distance { display: block; margin-top: 8px; }
.results-scroll { grid-template-columns: minmax(0,1fr) 44px; }
.results-scroll-rail button { width: 44px; padding: 11px; }
.market-list { scroll-padding-block: 8px; }
.price, .price-amount, #count, #locationPageLabel { font-variant-numeric: tabular-nums; }
.top .nav { scroll-padding-inline: 4px; }

/* Allow content to shrink inside its grid track before wrapping. */
.hero > *, .workspace > *, .script-feature > *, .how > *,
.kelly > *, .kelly-guide > *, .memory-strip > *, .order-layout > *,
.price-layout > *, .ban-prep-layout > *, .broth-recipe-layout > * { min-width: 0; }
.market-address, .market-label, .detail-address span, .detail-sources,
.market-evidence, .creator-handle, .creator h3, .source-details p,
.price-source-list, .product-note { overflow-wrap: anywhere; }
.results-head { flex-wrap: wrap; }
.results-head h3 { min-width: 0; flex: 1 1 120px; }
.results-head .quiet { flex: none; }
.detail-address svg, .social-follow > a:not(.brand) { flex-shrink: 0; }
.social-follow > .brand span { min-width: 0; overflow-wrap: anywhere; }
.social-follow > .brand { min-height: 44px; }
.stallholder-dialog { max-width: calc(100% - 24px); }
.stallholder-chinese, .stallholder-english { overflow-wrap: anywhere; }
.order-choices button, .order-languages button, .chip { min-width: 0; overflow-wrap: anywhere; }
.broth-tabs, .broth-method, .ban-views, .tabs { flex-wrap: wrap; }
.broth-tabs button, .broth-method button, .ban-views button, .tabs button { min-width: 0; overflow-wrap: anywhere; }
.creator nav a, .detail-sources a { min-width: 44px; }

/* Recipe advice shares the recipe column and a consistent pause before actions. */
.ban-panel .ban-shopping-tip,
.ban-panel > [role="tabpanel"] > .ban-note,
.ban-panel .ban-noodle-tip,
.order-tip {
  margin-block: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.65;
  max-width: none;
}
.ban-panel .ban-noodle-tip > summary,
.order-tip > summary {
  min-height: 44px;
  padding: 0;
  gap: 16px;
  color: var(--olive);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
}
.order-tip > summary { justify-content: space-between; }
.ban-panel .ban-noodle-tip > summary::after,
.order-tip > summary::after { flex: none; }
.ban-noodle-tip .ban-noodle-layout { padding: 16px 0 0; gap: 24px; }
.ban-noodle-tip p { line-height: 1.65; }
.ban-noodle-tip .ban-note { margin: 16px 0 0; font-size: .9rem; }
.ban-noodle-tip .price-inline { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; }
.order-tip p { margin-top: 12px; }
.ban-panel .ban-actions,
.acai-panel .ban-actions {
  margin: 24px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  gap: 12px 24px;
  align-items: center;
}
.ban-actions > .price-inline,
.ban-actions > .text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding-block: 12px;
  line-height: 1.5;
}
.ban-panel .ban-source { margin-top: 28px; color: var(--muted); font-size: .85rem; line-height: 1.65; }
.ban-panel .ban-noodle-tip .ban-packs { min-width: 0; }

/* The directory needs more than one third of a tablet's width. */
@media (min-width: 761px) and (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .workspace .map { grid-column: 1 / -1; width: 100%; border-radius: 12px; }
  .map #marketMap { height: 320px; }
  .market-results, .detail-dock { padding: 20px 16px; }
  .detail-dock { max-height: none; overflow: visible; }
  .detail h3 { font-size: 1.4rem; }
  .guide-links { grid-template-columns: 1fr; gap: 16px; }
  .creator-list { column-gap: 24px; }
  .creator-details { gap: 14px; }
  .creator-avatar { width: 64px; height: 64px; }
}

@media (pointer: coarse) {
  input, textarea, select { font-size: 16px; }
  .map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
}

@media (max-width: 760px) {
  .wrap {
    width: auto;
    margin-left: max(20px, env(safe-area-inset-left, 0px));
    margin-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .social-follow { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
  .social-follow > .brand { font-size: .85rem; line-height: 1.35; }
  .top { padding-block: 4px; }
  .top { width: 100%; min-width: 0; }
  .top .nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 12px; width: 100%; min-width: 0; white-space: normal; overflow: visible; padding: 4px 0; }
  .top .nav a { font-size: .9rem; min-height: 44px; line-height: 1.4; padding-block: 8px; overflow-wrap: anywhere; }
  .hero { padding-block: 28px 32px; gap: 24px; }
  .hero h1 { font-size: clamp(2rem, 8.8vw, 2.65rem); line-height: 1.1; }
  .hero p { line-height: 1.65; }
  .hero-actions { gap: 8px 16px; }
  .hero-actions .button { flex-basis: 100%; min-height: 52px; }
  .hero-actions .text-link { padding-inline: 0; }
  .hero-photo img { height: auto; aspect-ratio: 16/10; }
  .hero-photo figcaption { text-align: left; line-height: 1.5; }
  .section-head { display: block; margin-bottom: 24px; }
  .section-head p { margin-top: 10px; line-height: 1.6; }
  .filters { gap: 24px; }
  .region-field { gap: 10px; }
  .region-field label, .interests legend { font-size: .95rem; }
  .region-field select, .region-field .location-button { min-height: 48px; border-radius: 10px; }
  .interest-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .interest-options .chip { min-height: 48px; padding: 10px 12px; font-size: .9rem; }
  .filter-tools { margin-bottom: 20px; gap: 8px 16px; }
  .location-privacy { line-height: 1.6; }
  .workspace { gap: 8px; }
  .market-results { padding-top: 16px; }
  .market-button { padding: 18px 28px 18px 12px; }
  .market-title { line-height: 1.4; }
  .market-address { line-height: 1.55; }
  .market-label { margin-top: 10px; line-height: 1.5; }
  .detail-dock .detail { padding: 24px 20px; border-radius: 14px; }
  .detail h3 { font-size: 1.5rem; line-height: 1.2; }
  .detail p { line-height: 1.65; }
  .detail-sources a { display: inline-flex; align-items: center; min-height: 44px; }
  .shop-tabs { flex-wrap: wrap; gap: 6px; border: 0; }
  .shop-tabs button { flex: 1 1 calc(50% - 6px); border-radius: 10px; font-size: .95rem; padding: 12px; }
  .recipe-stories { gap: 20px; padding-block: 10px 18px; }
  .recipe-story { flex-basis: 112px; width: 112px; font-size: .9rem; }
  .story-ring { width: 104px; height: 104px; }
  .recipe-story span:last-child { white-space: normal; }
  .order-steps button { line-height: 1.45; }
  .ban-panel .ban-shopping-tip,
  .ban-panel > [role="tabpanel"] > .ban-note,
  .ban-panel .ban-noodle-tip,
  .order-tip { padding: 16px; margin-block: 20px; }
  .ban-panel .ban-actions, .acai-panel .ban-actions {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 8px;
    padding-top: 16px;
    margin-top: 20px;
  }
  .ban-actions > * { min-width: 0; width: 100%; }
  .order-steps { flex-wrap: wrap; gap: 8px; }
  .order-steps li { flex: 1 1 calc(50% - 8px); }
  .order-steps button { flex-direction: row; align-items: center; min-height: 54px; }
  .broth-tabs button, .ban-views button, .tabs button { flex: 1 1 120px; }
  .acai-panel .ban-list li, .acai-extras .ban-list li { flex-wrap: wrap; gap: 8px 16px; }
  .acai-panel .ban-list label { flex-basis: 160px; }
  .acai-panel .ban-list li > span { margin-left: 34px; text-align: left; }
  .nearby-pages { flex-wrap: wrap; }
  .market-list { height: min(360px, 65dvh); max-height: 360px; }
  .stallholder-dialog { padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .stallholder-chinese { padding: 20px; }
  .product { padding: 20px; border-radius: 14px; }
  .product-note { line-height: 1.65; }
  .product .button { min-height: 52px; }
  .footer, footer { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .social-follow > .brand { font-size: .75rem; gap: 4px; }
  .social-follow .fish-logo { width: 30px; }
  .social-follow { gap: 0; }
  .ban-intro { grid-template-columns: 1fr; }
  .creator-details { gap: 14px; }
  .creator-avatar { width: 56px; height: 56px; }
  .creator h3 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, .button { transition: none; }
  button:enabled:active, .button:active { transform: none; }
  .marker:enabled:active { transform: translate(-50%,-50%); }
}
