/* ============================================================================
   CITY ATLAS  ·  stylesheet (the Tidal Currents sheet, plus the overlay
   chips and the overlay settings drawer)
   ----------------------------------------------------------------------------
   The map fills the window. The text has the look of the shell screensaver
   plate (lib/screensaver.js, #sn-saver-label): STIX Two Text for the title,
   the model and the values, Inter in spaced capitals for the small labels,
   a hairline rule that fades at both ends, and a boxed mark with brackets in
   the section colour. main.js sets --c on <html> from lib/nav-data.js.

   The head is centred at the top and the foot is centred at the base. #veil
   darkens the two bands behind them, as the plate gradient does. Text sizes
   follow --fs = min(100vw, 80vh), the same measure as the plate.

   The atlas and the about sheet have the look of the saver menu: a dark box
   with a faint border, Inter text, and a dot in the section colour. On a
   wide screen they are drawers on the right. On a phone they are sheets.

   grep -n targets
     'HEAD'      category, title, rule, model
     'FOOT'      parameters, notes, time bar, controls
     'CHIPS'     the three overlay toggles
     'LAYERS'    the overlay settings drawer: groups, sliders, legends
     'LABELS'    place labels on the map
     'SHEETS'    atlas and about sheet
     'PHONE'     the phone block
     'SAVER'     what saver mode hides
   ========================================================================== */
:root {
  --c: #50c0ff;
  --fs: min(100vw, 80vh);
  --serif: var(--sci-serif, 'STIX Two Text', Georgia, serif);
  --sans: var(--sci-sans, Inter, system-ui, sans-serif);
  --cream: #f4f1ea;
  --cream2: #e2ddd1;
  --cream3: #cfc9bc;
  --cap: #a4acb8;
  --line: rgba(244, 240, 230, 0.85);
  --box: #0c0f15;
  --edge: rgba(255, 255, 255, 0.08);
  --dim: #8591a3;
  --dim2: #6c7788;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  color: var(--cream);
  font-family: var(--sans);
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
body { position: fixed; inset: 0; }
[hidden] { display: none !important; }
button { font-family: inherit; touch-action: manipulation; }

#stage { position: fixed; inset: 0; height: 100dvh; background: #000; touch-action: none; overflow: hidden; }
body.idle #stage { cursor: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#veil {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.6) 0, rgba(0,0,0,.22) 14%, transparent 26%, transparent 60%, rgba(0,0,0,.5) 76%, rgba(0,0,0,.86) 100%);
}
#overlay { position: absolute; inset: 0; pointer-events: none; }

/* HEAD. The plate's top block, smaller: the map must stay in view. */
#head {
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: min(100%, 980px);
  padding: max(clamp(18px, calc(var(--fs) * .05), 56px), calc(env(safe-area-inset-top, 0px) + 12px)) 16px 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .85);
}
#cat {
  font: 500 clamp(9px, calc(var(--fs) * .015), 12px)/1 var(--sans);
  letter-spacing: .34em; padding-left: .34em; text-transform: uppercase;
  color: var(--c); margin: 0 0 .9em;
}
#ttl {
  margin: 0; max-width: 24ch;
  font: 400 clamp(26px, calc(var(--fs) * .066), 64px)/1.04 var(--serif);
  color: #f8f5ee; text-wrap: balance;
}
#head .rule {
  display: block; width: min(70%, 480px); height: 1px;
  margin: clamp(10px, calc(var(--fs) * .022), 20px) 0 clamp(8px, calc(var(--fs) * .018), 16px);
  background: linear-gradient(90deg, transparent, rgba(244,240,230,.9) 16%, rgba(244,240,230,.9) 84%, transparent);
  transform: scaleX(0); transition: transform 1.4s cubic-bezier(.22,.7,.12,1) .2s;
}
body.shown #head .rule { transform: scaleX(1); }
#sub {
  max-width: 34em;
  font: italic 400 clamp(13px, calc(var(--fs) * .024), 21px)/1.3 var(--serif);
  color: var(--cream2); text-wrap: balance;
}

/* FOOT. Parameters, notes, the week bar and the controls, centred. */
#foot {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 980px);
  padding: 0 16px max(clamp(14px, calc(var(--fs) * .03), 34px), calc(env(safe-area-inset-bottom, 0px) + 10px));
  display: flex; flex-direction: column; align-items: center; text-align: center;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .85);
}
#params {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: .6em 1.9em; font: 400 clamp(13px, calc(var(--fs) * .022), 19px)/1.25 var(--serif);
}
/* The ramp and the scale bar sit in the gap between value and label, out of
   flow, so every value stays on one baseline. */
.p { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.p .v { font-style: italic; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--cream); }
.p .v .sym { font-style: italic; }
.p .v .m1 { color: #62c4ff; }
.p small {
  margin-top: .8em;
  font: 400 .56em/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--cap); text-shadow: none; white-space: nowrap;
}
.p .ramp { position: absolute; left: 0; right: 0; bottom: 1.02em; height: 2px; border-radius: 1px; }
.p .bar { position: absolute; left: 50%; bottom: .98em; height: 4px; transform: translateX(-50%); border: solid rgba(244,240,230,.7); border-width: 0 1px 1px; }
#notes {
  max-width: 44em; margin-top: .75em;
  font: italic 400 clamp(12px, calc(var(--fs) * .019), 16px)/1.4 var(--serif);
  color: var(--cream3);
}
#notes .src {
  display: block; margin-top: .55em;
  font: 400 .62em/1.3 var(--sans); font-style: normal; letter-spacing: .14em; text-transform: uppercase;
  color: var(--cap); text-shadow: none;
}

/* The week: a hairline as wide as the head rule. Day ticks, a filled part
   and a small knob. Drag it to set the time. */
#scrub {
  position: relative; width: min(70%, 480px); height: 1px;
  margin: clamp(12px, calc(var(--fs) * .024), 20px) 0 clamp(10px, calc(var(--fs) * .02), 16px);
  background: linear-gradient(90deg, transparent, rgba(244,240,230,.32) 10%, rgba(244,240,230,.32) 90%, transparent);
  pointer-events: auto; cursor: pointer; touch-action: none;
}
#scrub::after { content: ''; position: absolute; inset: -14px 0; }
#scrub .fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, transparent, var(--line) 10%);
}
#scrub .knob {
  position: absolute; top: 50%; left: 0; width: 7px; height: 7px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--c); box-shadow: 0 0 10px var(--c);
}
#scrub .tick { position: absolute; top: -3px; width: 1px; height: 7px; background: rgba(244,240,230,.4); }

#controls {
  display: flex; align-items: center; gap: 4px;
  pointer-events: auto; transition: opacity 600ms ease;
}
body.idle #controls { opacity: .18; }
body.idle #controls:hover, body.idle #controls:focus-within { opacity: 1; }
#controls button {
  appearance: none; margin: 0; padding: 0;
  min-width: 38px; height: 38px; border: 0; border-radius: 4px;
  background: transparent; color: var(--cream);
  font: 400 24px/1 var(--serif); cursor: pointer;
  display: grid; place-items: center;
}
#controls button:hover { color: var(--c); }
#controls button:focus-visible { outline: 1px solid var(--line); outline-offset: 2px; }
#controls #prev, #controls #next { font-size: 28px; padding-bottom: 3px; }
#controls #play svg { width: 13px; height: 13px; fill: currentColor; }
#controls #info { font: italic 400 19px/1 var(--serif); }
#controls #info[aria-pressed="true"] { color: var(--c); }
#controls .sep { width: 1px; height: 20px; background: rgba(244,240,230,.25); margin: 0 6px; }
/* The location box: the site mark of the plate, as a button. */
#controls #where {
  display: inline-flex; align-items: baseline; gap: 0; height: auto;
  margin: 0 6px; padding: .5em .5em .5em .2em;
  font: 500 clamp(13px, calc(var(--fs) * .02), 17px)/1 var(--serif);
  letter-spacing: .1em; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 0;
  background: rgba(5, 7, 11, .58);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#controls #where:hover, #controls #where[aria-expanded="true"] { color: var(--cream); border-color: var(--c); }
#where .br { color: var(--c); letter-spacing: 0; padding: 0 .4em; }
#locName { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; }
#locCount { margin-left: .8em; font: 400 .66em/1 var(--sans); letter-spacing: .12em; color: var(--cap); font-variant-numeric: tabular-nums; }

/* LABELS. Place names in the small capitals of the plate's parameter labels. */
.lbl { position: absolute; width: 0; height: 0; }
.lbl .dot {
  position: absolute; width: 4px; height: 4px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--cream); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6);
}
.lbl .txt {
  position: absolute; top: 0; transform: translateY(-52%);
  font: 500 10px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(244, 241, 234, .82); white-space: nowrap;
  text-shadow: 0 0 6px rgba(0, 0, 0, .95), 0 0 2px #000;
}
.lbl.s-right .txt { left: 8px; }
.lbl.s-left .txt { right: 8px; }
.lbl.z-xs .txt { font-size: max(8px, calc(var(--fs) * .011)); color: rgba(244, 241, 234, .62); }
.lbl.z-sm .txt { font-size: max(8.5px, calc(var(--fs) * .012)); }
.lbl.z-md .txt { font-size: max(9px, calc(var(--fs) * .0135)); }
.lbl.z-lg .txt { font-size: max(9.5px, calc(var(--fs) * .015)); color: var(--cream); }

/* fade, loading, fallback */
#fade { position: absolute; inset: 0; background: #000; opacity: 1; transition: opacity 320ms ease; pointer-events: none; }
#fade.clear { opacity: 0; }
#loading {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--cap);
}
#loading span { width: 5px; height: 5px; border-radius: 50%; background: var(--c); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
#fallback { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(88vw, 440px); text-align: center; }
#fallback p { margin: 0; font: italic 400 clamp(14px, 2vw, 18px)/1.5 var(--serif); color: var(--cream3); }
.no-gpu .lbl, .no-gpu #params, .no-gpu #notes, .no-gpu #scrub, .no-gpu #play, .no-gpu #chips, .no-gpu #layersBtn { display: none !important; }

/* SHEETS. The atlas and the about sheet, in the look of the saver menu. */
#scrim { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .4); }
.sheet {
  position: fixed; top: 12px; right: 12px; bottom: 12px;
  width: min(400px, calc(100vw - 24px)); z-index: 11;
  display: flex; flex-direction: column;
  background: var(--box); border: 1px solid var(--edge); border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  color: #c9d2df; font: 400 14px/1.45 var(--sans);
  animation: sheetSide 240ms cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheetSide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: transparent; color: var(--dim);
  font: 300 22px/1 var(--sans); cursor: pointer;
}
.close:hover { background: rgba(255, 255, 255, .06); color: #f1f4f8; }
.grip { display: none; }

#caption { display: block; overflow: auto; padding: 20px 22px 18px; -webkit-user-select: text; user-select: text; }
#caption h2 { margin: 0 40px 12px 0; font: 400 24px/1.1 var(--serif); color: #f8f5ee; }
#caption h2 small { display: block; margin-top: 6px; font: italic 400 15px/1.3 var(--serif); color: var(--cream2); }
#caption p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.6; color: #c9d2df; }
#caption p.data { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--edge); font-size: 12px; color: var(--dim); }
#caption .credits { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--edge); }
#caption .credits h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #e6ebf2; }
#caption .credits ul { margin: 0; padding: 0; list-style: none; }
#caption .credits li { margin: 0 0 8px; font-size: 12px; line-height: 1.55; color: var(--dim); }
#caption .credits a { color: var(--c); text-underline-offset: 2px; }
#caption .credits a:hover { color: #cfeaff; }

#atlas header { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 18px 20px 14px; border-bottom: 1px solid var(--edge); }
#atlas header h2 { margin: 0; font-size: 1.2rem; font-weight: 600; color: #f1f4f8; }
#atlasCount { font-size: .8rem; color: var(--dim); font-variant-numeric: tabular-nums; }
#atlasBody { flex: 1; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px 14px 18px; scrollbar-width: thin; scrollbar-color: #26303c transparent; }
.a-group h3 { display: flex; align-items: center; gap: 8px; margin: 16px 4px 10px; font-size: .86rem; font-weight: 600; color: #e6ebf2; }
.a-group h3::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.a-group h3 small { margin-left: auto; font-size: .75rem; font-weight: 400; color: var(--dim2); font-variant-numeric: tabular-nums; }
.a-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a-item {
  appearance: none; display: flex; flex-direction: column;
  padding: 0; margin: 0; border: 1px solid var(--edge); border-radius: 8px;
  background: rgba(255, 255, 255, .02); color: #c9d2df;
  text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color 160ms, background 160ms;
}
.a-item:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .18); }
.a-item[aria-current="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); }
.a-item:focus-visible { outline: 1px solid var(--c); outline-offset: 2px; }
.a-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #05070a; }
.a-thumb.none { background: radial-gradient(120% 90% at 30% 40%, rgba(70, 120, 200, .25), transparent 60%), #05070a; }
.a-cap { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; }
.a-title { font: 400 15px/1.2 var(--serif); color: #f1f4f8; }
.a-model { font-size: .72rem; color: var(--dim2); }


/* CHIPS. The overlay toggles: small boxed labels with a dot in the overlay colour. */
#chips { display: flex; gap: 8px; margin: 0 0 clamp(6px, calc(var(--fs) * .012), 12px); pointer-events: auto; transition: opacity 600ms ease; }
body.idle #chips { opacity: .18; }
body.idle #chips:hover, body.idle #chips:focus-within { opacity: 1; }
.chip {
  appearance: none; display: inline-flex; align-items: center; gap: .55em;
  height: 30px; padding: 0 .9em; border: 1px solid rgba(244,240,230,.28); border-radius: 15px;
  background: rgba(5, 7, 11, .5); color: var(--cream3);
  font: 500 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: border-color 160ms, color 160ms, background 160ms;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; box-sizing: border-box; }
.chip:hover { color: var(--cream); border-color: rgba(244,240,230,.5); }
.chip[aria-pressed="true"] { color: var(--cream); border-color: var(--k, var(--c)); background: color-mix(in srgb, var(--k, var(--c)) 14%, rgba(5,7,11,.55)); }
.chip[aria-pressed="true"] .dot { background: var(--k, var(--c)); border-color: var(--k, var(--c)); box-shadow: 0 0 8px var(--k, var(--c)); }
.chip:disabled { opacity: .35; cursor: default; }
#chipTerrain { --k: #e0b46a; }
#chipOcean { --k: #3fc4e8; }
#chipWind { --k: #f2e6c4; }
#controls #layersBtn svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; }
#controls #layersBtn[aria-expanded="true"] { color: var(--c); }
#scrub.off { visibility: hidden; }

/* LAYERS. The overlay settings, in the look of the atlas: a drawer on the left. */
.sheet.left { right: auto; left: 12px; width: min(340px, calc(100vw - 24px)); animation-name: sheetLeft; }
@keyframes sheetLeft { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
#layers header { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--edge); }
#layers header h2 { margin: 0; font-size: 1.2rem; font-weight: 600; color: #f1f4f8; }
#layersBody { flex: 1; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 4px 16px 18px; scrollbar-width: thin; scrollbar-color: #26303c transparent; }
.lg { margin: 14px 0 0; padding: 12px 12px 10px; border: 1px solid var(--edge); border-radius: 10px; background: rgba(255,255,255,.02); }
.lg.on { border-color: color-mix(in srgb, var(--k, var(--c)) 45%, transparent); }
.lg h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 4px; font-size: .9rem; font-weight: 600; color: #e6ebf2; }
.lg h3 .sw { margin-left: auto; }
.lg .why { margin: 0 0 8px; font-size: 12px; line-height: 1.5; color: var(--dim); }
.lg .row { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: #c9d2df; }
.lg .row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--cream2); }
.lg .row.two { grid-template-columns: 92px 1fr; }
.lg .seg { display: inline-flex; border: 1px solid var(--edge); border-radius: 7px; overflow: hidden; }
.lg .seg button { appearance: none; border: 0; background: transparent; color: var(--dim); padding: 6px 9px; font: 500 11.5px/1 var(--sans); cursor: pointer; }
.lg .seg button[aria-pressed="true"] { background: color-mix(in srgb, var(--k, var(--c)) 22%, transparent); color: #f1f4f8; }
.lg .src { margin: 8px 0 0; font-size: 11px; line-height: 1.5; color: var(--dim2); }
.lg .src a { color: var(--dim); }
.lg .legend { position: relative; height: 8px; margin: 10px 0 2px; border-radius: 4px; }
.lg .legend + .ticks { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.lg .status { font-size: 11.5px; color: var(--dim); min-height: 1.4em; }
.lg .status.err { color: #e8a37a; }
.sw { appearance: none; position: relative; width: 34px; height: 20px; border-radius: 10px; border: 1px solid var(--edge); background: #1a2029; cursor: pointer; flex: none; padding: 0; }
.sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #8591a3; transition: transform 160ms, background 160ms; }
.sw[aria-checked="true"] { background: color-mix(in srgb, var(--k, var(--c)) 45%, #1a2029); border-color: var(--k, var(--c)); }
.sw[aria-checked="true"]::after { transform: translateX(14px); background: #f4f1ea; }
.lg[data-k="terrain"] { --k: #e0b46a; }
.lg[data-k="ocean"] { --k: #3fc4e8; }
.lg[data-k="wind"] { --k: #f2e6c4; }
.lg[data-k="view"] { --k: var(--c); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; touch-action: manipulation; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: rgba(244,240,230,.25); border-radius: 1px; }
input[type="range"]::-moz-range-track { height: 2px; background: rgba(244,240,230,.25); border-radius: 1px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--k, var(--c)); border: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--k, var(--c)) 60%, transparent); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--k, var(--c)); border: 0; }
input[type="range"]:disabled { opacity: .4; }

/* the about sheet: a small table of numbers */
#caption .facts { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 12px 0; font-size: 12.5px; color: #c9d2df; }
#caption .facts span:nth-child(2n) { text-align: right; color: var(--cream2); font-variant-numeric: tabular-nums; }
#caption h3.sub { margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: #e6ebf2; }
.lbl.water .txt { font-style: italic; text-transform: none; letter-spacing: .06em; font-family: var(--serif); color: rgba(170, 215, 240, .8); }

/* PHONE. Short side under 600px on a touch screen, or a narrow window. */
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  #head { padding-left: 12px; padding-right: 12px; }
  #ttl { font-size: clamp(24px, 7.4vw, 34px); }
  #sub { font-size: 13px; }
  #params { gap: .5em 1.3em; font-size: 14px; }
  #notes { font-size: 0; max-width: none; margin-top: .4em; }
  #notes .src { font-size: 9px; margin-top: 8px; }
  #scrub { width: 80%; }
  #controls button { min-width: 44px; height: 44px; }
  #controls #where { font-size: 14px; padding: .7em .4em .7em .1em; }
  #locCount { display: none; }
  #locName { max-width: 46vw; }
  body.idle #controls, body.idle #controls:focus-within { opacity: 0; }

  .sheet {
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-width: 640px; margin: 0 auto;
    max-height: 80dvh; border-radius: 16px 16px 0 0; border-bottom: 0;
    animation: sheetUp 280ms cubic-bezier(.2, .8, .2, 1);
    transition: transform 120ms ease;
  }
  #caption { padding: 0 20px calc(20px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; touch-action: pan-y; }
  #atlas { height: 80dvh; }
  .sheet.left { left: 0; right: 0; width: auto; animation-name: sheetUp; }
  #layers { max-height: 72dvh; }
  #layers header { padding: 2px 18px 10px; }
  #layers header .close { top: -8px; width: 44px; height: 44px; }
  #chips { gap: 6px; }
  .chip { height: 34px; padding: 0 .8em; font-size: 10.5px; letter-spacing: .1em; }
  body.idle #chips { opacity: 0; }
  #atlasBody { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .grip { display: block; height: 26px; flex: none; position: relative; touch-action: none; cursor: grab; }
  #caption .grip { margin: 0 -20px 4px; }
  .grip::after { content: ''; position: absolute; left: 50%; top: 10px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255, 255, 255, .28); }
  #caption .close { top: 22px; width: 44px; height: 44px; }
  #atlas header { padding: 2px 18px 12px; }
  #atlas header .close { top: -8px; width: 44px; height: 44px; }
  .a-thumb { aspect-ratio: 3 / 2; }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* SAVER. The shell plate names the place, so the page shows the map only. */
body.saver #head, body.saver #foot, body.saver #veil, body.saver #overlay,
body.saver .sheet, body.saver #scrim, body.saver #loading { display: none !important; }
body.saver, body.saver #stage { cursor: none; }

@media (prefers-reduced-motion: reduce) {
  #fade, #controls, #head .rule { transition: none; }
  .sheet { animation: none; }
  #loading span { animation: none; opacity: .7; }
}
