:root {
  --frost-tint:linear-gradient(to bottom,transparent,rgb(244 245 235 / 58%));
  --frost-mask:linear-gradient(to bottom,transparent,#0009 38%,#000 75%);
}
.phone-ui, .site-bar nav #phoneDate {display:none}
@media (min-width:801px) {
  #visit [data-face=compact] .visit-trip {display:none}
}
@media (max-width:800px) {
  :root {
    --phone-dock-space:calc(70px + env(safe-area-inset-bottom, 0px));
    --phone-dock-bottom:calc(9px + env(safe-area-inset-bottom, 0px));
    --sheet-mask:linear-gradient(to bottom, #000 calc(100% - var(--phone-dock-bottom)), transparent 100%);
    --glass-paper:rgb(255 254 249 / 91%);
  }
  .site-bar nav [data-plan], .world #marketHelper, .world .finder .mast {display:none}
  .site-bar nav #phoneDate {display:inline-flex;color:#245444;min-height:44px}
  .site-bar nav [data-tour] {width:auto;min-height:44px}
  .site-bar nav [data-tour] .ico {display:block}
  .site-bar nav [data-tour] span {display:inline}

  .world[data-phone-view=map]:not(.market-focused) #mapCanvas {--atlas-anchor-y:.44}
  .world[data-phone-view=map] .fa-country-shape {top:10%;height:73%}
  .world[data-phone-view=map] .finder, .world[data-phone-view=map]:not(.is-folded) .finder {display:none}
  .world[data-phone-view]:not([data-phone-view=map]) .finder {
    display:flex;flex-direction:column;inset:auto 0 0;transform:none;
    width:min(100%,540px);margin-inline:auto;
    height:clamp(300px,54svh,520px);max-height:calc(100% - var(--bar-height) - 12px);
    padding:12px clamp(14px,4vw,22px) 0;
  }
  .world[data-phone-view]:not([data-phone-view=map]) .finder, #visit .visit-paper {
    border:0;border-radius:20px 20px 0 0;box-shadow:none;overflow:hidden;
    background:var(--glass-paper);
    -webkit-mask-image:var(--sheet-mask);mask-image:var(--sheet-mask);
  }
  /* Native modal dialogs paint above the document, so the visible layer owns the frost. */
  body:not(:has(dialog:modal))::after, .visit-dialog:modal::after, .atc-dialog:modal::after,
  #guides:modal::after, #routePlanner:modal::after {
    content:"";position:fixed;inset:auto 0 0;height:var(--phone-dock-space);
    z-index:85;pointer-events:none;
    background:var(--frost-tint);
    -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
    -webkit-mask-image:var(--frost-mask);mask-image:var(--frost-mask);
  }
  #routePlanner:modal::after {position:absolute;z-index:1}
  #routePlanner .pick-nav {position:relative;z-index:2}
  .phone-sheet-head {display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;border-bottom:1px solid #dedfd6}
  .phone-sheet-head h1 {display:flex;align-items:baseline;gap:8px;margin:0;font:500 29px/1.2 Georgia,serif;letter-spacing:-1px}
  .phone-sheet-head h1 {margin-inline-end:auto}
  .phone-sheet-head #phoneResetFilters {font-size:13px;gap:3px;padding-inline:3px}
  .phone-sheet-head #phoneResetFilters .ico {width:15px;height:15px}
  .phone-sheet-head small {font:550 14px/1.3 system-ui,sans-serif;letter-spacing:0;color:#596457}
  .phone-sheet-head button, #phoneDock button {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:44px;color:#285648;background:transparent;font-weight:650}
  .world[data-phone-view=list] #catalogBody,
  .world[data-phone-view=list] :is(.catalog-clip,.catalog-content,.reel-shell) {
    display:flex;flex-flow:column;flex:1;min-height:0;overflow:hidden;
  }
  .world[data-phone-view=list] .catalog-content {padding:0}
  .world[data-phone-view=list] .reel-shell {background:transparent}
  .world[data-phone-view=list] #fan.deck:not(.fan-single) {flex:1;min-height:0;height:auto}
  .world[data-phone-view=list] #fan.deck {
    -webkit-mask-image:none;mask-image:none;
    padding:9px 4px var(--phone-dock-space);row-gap:9px;
    scroll-padding-bottom:var(--phone-dock-space);
  }
  .world[data-phone-view=list] .catalog-content > :not(.reel-shell),
  .world[data-phone-view] .reel-bar {display:none}
  .world[data-phone-view=search]:not(.is-folded) .finder {height:clamp(340px,64svh,570px)}
  .world[data-phone-view=search] .market-search button[type=submit] {display:none}
  .world[data-phone-view=search] .market-search {min-height:42px}
  .world[data-phone-view=search] .reel-shell {background:transparent;flex:none}
  /* The search sheet scrolls as one surface, through the results to nearby places. */
  .world[data-phone-view=search] #fan.deck {
    height:auto;flex:none;overflow:visible;cursor:auto;
    padding:8px 4px;row-gap:9px;-webkit-mask-image:none;mask-image:none;
  }
  .world[data-phone-view=search] #catalogBody {display:block;overflow:auto}
  .world[data-phone-view=search] .catalog-clip {overflow:visible}
  .world[data-phone-view=search] .catalog-content {padding:8px 0 var(--phone-dock-space)}
  .world[data-phone-view=search] .directory-heading {padding:0 0 5px}
  .world[data-phone-view=search] .directory-heading h1 {display:none}
  .world[data-phone-view=search] #dayStatus {text-decoration:none;font-size:14px}
  .world[data-phone-view=search] .discovery-foot {padding:0}
  .world[data-phone-view=search] #suggestRows {position:static;max-height:none;box-shadow:none}
  #phoneDock {
    display:flex;position:fixed;z-index:90;pointer-events:auto;bottom:var(--phone-dock-bottom);left:50%;transform:translateX(-50%);
    padding:4px 10px;gap:4px;border:1px solid #c4cab9;border-radius:32px;background:var(--glass-paper);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 3px 16px #20281f15;
  }
  #phoneDock button {padding:0 10px;color:#596156;font-size:14px}
  #phoneDock button[aria-pressed=true] {color:#193d28}
  #phoneDock button[aria-pressed=true] svg {fill:#dafa70;stroke:#233820}
  body:has(#routePlanner[open]) #phoneDock {display:none}
  .atc-dialog[open] {padding-bottom:var(--phone-dock-space)}
  #visit .visit-dialog {padding-bottom:0}
  #visit .visit-paper {
    --visit-full-height:min(calc(79dvh + var(--phone-dock-space)),calc(100dvh - var(--bar-height) - 4px));
  }
  #visit .visit-paper {background:rgb(255 254 249 / 97%)}
  #visit .visit-handle {height:16px}
  #visit .visit-more {padding-bottom:var(--phone-dock-space)}
  #visit [data-face=compact] .visit-overview {padding-bottom:var(--phone-dock-space)}
  #visit .visit-dialog[data-face=compact] .visit-paper {height:min(var(--visit-peek-height),76dvh)}
  .atc-dialog .atc-surface, #guides[open], #visit .visit-action-panel, .world #marketPeek {
    background:linear-gradient(160deg,rgb(250 250 240 / 84%),rgb(255 254 249 / 97%) 42%,var(--glass-paper));
    border-color:transparent;box-shadow:0 6px 28px rgb(45 60 40 / 12%);
  }
  .atc-dialog .atc-surface, #visit .visit-action-panel, .world #marketPeek, #guides[open]::before {
    --popup-mask:linear-gradient(to bottom,#000 calc(100% - 4px),transparent 100%);
    -webkit-mask-image:var(--popup-mask);mask-image:var(--popup-mask);
  }
  /* Keep the dialog itself unmasked: its fixed navigation sits outside the paper. */
  #guides[open] {background:transparent;box-shadow:none;border:0}
  #guides[open]::before {
    content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
    border-radius:inherit;background:var(--glass-paper);
  }
  #guides[open] {
    inset:0 0 var(--phone-dock-space);transform:none;margin:auto;height:fit-content;
    max-height:calc(100dvh - var(--phone-dock-space) - 20px);overflow:visible;
    display:flex;flex-direction:column;
  }
  #guideList {min-height:0;overflow:auto;overscroll-behavior:contain}
  #visit [data-face=compact] :is(.visit-photo,.visit-quick-actions,.visit-schedule) {display:none}
  #visit [data-face=compact] .visit-overview {display:block}
  #visit [data-face=compact] .visit-facts {display:grid;grid-template-columns:1fr;gap:10px}
  #visit [data-face=compact] .visit-toolbar {display:flex;flex-wrap:wrap;gap:0;padding:6px var(--visit-space) 0}
  #visit [data-face=compact] .visit-heading {width:100%;padding-right:36px}
  #visit [data-face=compact] .visit-city {display:block}
  #visit [data-face=compact] .visit-actions {justify-content:flex-start;flex-direction:row-reverse}
  #visit [data-face=compact] .visit-back {position:absolute;top:10px;right:8px}
  #visit [data-face=compact] .visit-route {font-size:15px;padding-inline:0 16px}
  #visit [data-face=compact] .visit-route {display:inline-flex}
  @media (prefers-reduced-motion:no-preference) {
    .world[data-phone-view]:not([data-phone-view=map]) .finder {animation:phone-sheet-in 420ms cubic-bezier(.22,.72,.25,1)}
    @keyframes phone-sheet-in {from {translate:0 100%} to {translate:0 0}}
  }
}

@media (min-width:801px) {
  .market-search button[type=submit] {display:none}
  .finder #allMarkets {align-self:flex-start;background:transparent;color:#24594d}
  .finder #allMarkets:hover {color:#173c30}
  /* Attach the frost to the edge of each scrollport, below its controls. */
  #visit [data-face=full] .visit-paper::before,
  .atc-surface::after, #guides[open]::after, #routePlanner[open]::after {
    content:"";position:absolute;inset:auto 0 0;height:38px;
    pointer-events:none;z-index:1;background:var(--frost-tint);
    -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
    -webkit-mask-image:var(--frost-mask);mask-image:var(--frost-mask);
  }
  .finder #fan.deck:not(.fan-single) {
    padding-bottom:min(84px,10dvh);
    --fade-depth:min(84px,10dvh,28%);
    --deck-mask:linear-gradient(to top,transparent,rgba(0,0,0,.08) calc(var(--fade-depth) * .22),rgba(0,0,0,.5) calc(var(--fade-depth) * .52),rgba(0,0,0,.92) calc(var(--fade-depth) * .82),black var(--fade-depth));
    -webkit-mask-image:var(--deck-mask);mask-image:var(--deck-mask);
  }
  .finder .reel-bar {position:relative}
  .finder .reel-bar::before {
    content:"";position:absolute;inset:auto 0 100%;height:min(70px,8dvh);
    pointer-events:none;
    -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
    --blur-mask:linear-gradient(to top,transparent,#000a 38%,transparent);
    -webkit-mask-image:var(--blur-mask);mask-image:var(--blur-mask);
  }
  #catalogToggle:focus-visible {
    outline:none;color:#194c31;
    background:transparent;
  }
  #catalogToggle:focus-visible::before {
    content:"";display:inline-block;width:.5em;height:.5em;margin-inline-end:.4em;
    border-radius:50%;background:currentColor;
  }
  #visit [data-face=full] .visit-scroll {padding-bottom:40px}
  #visit .visit-paper {background:rgb(255 254 249 / 97%)}
  .atc-dialog .atc-surface, #guides[open], #visit .visit-action-panel, #marketPeek {
    background:linear-gradient(160deg,rgb(250 250 240 / 91%),rgb(255 254 249 / 97%) 42%,rgb(255 254 249 / 93%));
  }
  .atc-surface, #guides[open] {overflow:hidden}
  .atc-head, .guide-bar {flex:none}
  #guides[open] {display:flex;flex-direction:column;padding-bottom:0}
  .atc-body, #guideList {min-height:0;overflow:auto;overscroll-behavior:contain;padding-bottom:40px}
  #routePlanner[open]::after {height:52px}
  #routePlanner .pick-nav {position:relative;z-index:2}
}
