/* ui.css — the button system and the quiet chrome. Loaded last.

   Two kinds of button, one accent.
   · .btn      general. Paper, an ink rule, no shadow. Almost every button.
   · .btn-sig  signature. The one action a surface exists for — Pick for me,
               Share, Open the note, Show results, Read it, Send — in the
               accent, carrying the guide's one remaining hard shadow.
   Modifiers: .btn-icon (44px square), .btn-quiet (tertiary, no frame),
   .btn-block (full width), .btn-on-dark (outline on a dark scrim).
   .chip is the selectable sibling for filters and holds: ink when on, never
   the accent, so the accent always means "the thing to press".

   Rules are scoped under :root with doubled classes so the system outranks
   the older per-component styles and their edition overrides without
   !important. The press effect uses `translate`, never `transform`, so
   buttons that are centred with a transform do not jump when tapped. */

:root {
  /* the one accent: the masthead red, one step deeper so cream type on it
     clears 5:1 */
  --accent: #c8202a;
  --accent-ink: #fffaf0;
  --accent-hover: #ad1820;
  --hair: color-mix(in srgb, var(--ink) 20%, transparent);
  --wash: color-mix(in srgb, var(--ink) 7%, var(--paper-hi));
  --btn-h: 44px;
  --lift: 3px 3px 0 var(--ink);
  /* the dock is two rows: the pool (filter + near me) over the four tabs */
  --dock-ctx-h: 56px;
  --dock-nav-h: 60px;
  --dock-h: calc(var(--dock-ctx-h) + var(--dock-nav-h));
}
html[data-theme="dark"] { --accent: #ff5661; --accent-ink: #17130f; --accent-hover: #ff7880; }
html[data-edition="jackpot"] { --accent: #ff38b8; --accent-ink: #160921; --accent-hover: #ff6dcc; }
/* About has nothing to filter, so the dock folds to one row there */
body:not(.dock-has-context) { --dock-h: var(--dock-nav-h); }

/* ── general ──────────────────────────────────────────────────── */
/* No position or margin here: a button's place on the page belongs to its
   component (absolute photo arrows, the sticky close, fixed lightbox keys). */
:root .btn.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: var(--btn-h);
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper-hi);
  color: var(--ink);
  box-shadow: none;
  font: 800 var(--t-label)/1.1 var(--mono);
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  opacity: 1;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .12s, translate .12s;
  -webkit-tap-highlight-color: transparent;
}
/* the system sets display, so it has to honour every way a button is hidden */
:root .btn.btn[hidden],
:root .chip.chip[hidden],
:root .lightbox.single .lb-nav.btn { display: none; }
@media (min-width: 760px) {
  /* the desk keeps the search field open in the plate; the phone keys go */
  :root .search-trigger.btn,
  :root .search-dismiss.btn { display: none; }
}
@media (max-width: 759px) {
  :root .search:not(.open) .btn { display: none; }
}
:root .btn.btn:hover { background: var(--wash); color: var(--ink); text-decoration: none; }
:root .btn.btn:active { translate: 0 1px; }
:root .btn.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
:root .btn.btn:disabled,
:root .btn.btn[aria-disabled="true"] { opacity: .36; cursor: default; translate: none; }
:root .btn.btn:disabled:hover { background: var(--paper-hi); }
/* toggles read as switched on in ink, not in the accent */
:root .btn.btn[aria-pressed="true"],
:root .btn.btn.is-on { background: var(--ink); color: var(--paper-hi); }
:root .btn.btn .glyph { font-size: 15px; line-height: 1; letter-spacing: 0; }

/* ── signature ────────────────────────────────────────────────── */
:root .btn.btn-sig { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: var(--lift); }
:root .btn.btn-sig:hover { background: var(--accent-hover); color: var(--accent-ink); }
:root .btn.btn-sig:active { translate: 3px 3px; box-shadow: none; }
:root .btn.btn-sig:disabled { box-shadow: none; }

/* ── modifiers ────────────────────────────────────────────────── */
:root .btn.btn-icon { width: var(--btn-h); height: var(--btn-h); padding: 0; flex: none; font-size: 18px; letter-spacing: 0; }
:root .btn.btn-quiet { border-color: transparent; background: transparent; }
:root .btn.btn-quiet:hover { background: var(--wash); }
:root .btn.btn-block { display: flex; width: 100%; }
:root .btn.btn-on-dark { border-color: #fffaf0; background: transparent; color: #fffaf0; }
:root .btn.btn-on-dark:hover { background: #fffaf0; color: #14110d; }
:root .btn .arrow-glyph { transform: none; }
/* tap areas stay 44px but never spill visibly */
:root .btn.btn::after { pointer-events: none; }

/* a group shares one frame: the masthead plate */
:root .btn-group { display: inline-flex; align-items: stretch; border: 1.5px solid var(--ink); background: var(--paper-hi); box-shadow: none; }
:root .btn-group .btn.btn { min-height: 40px; height: 40px; border: 0; border-left: 1px solid var(--hair); background: transparent; }
:root .btn-group .btn.btn:first-child { border-left: 0; }
:root .btn-group .btn.btn:hover { background: var(--wash); }
:root .btn-group .btn.btn[aria-pressed="true"],
:root .btn-group .btn.btn[aria-expanded="true"],
:root .btn-group .btn.btn.active { background: var(--ink); color: var(--paper-hi); }
:root .btn-group .btn.btn-icon { width: 42px; }

/* a text link that behaves like a button: breadcrumbs */
:root .btn-link { min-height: 44px; margin: 0 -6px; padding: 0 6px; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── chips: filters, holds, outlets ───────────────────────────── */
:root .chip.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--btn-h);
  padding: 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper-hi);
  color: var(--ink);
  box-shadow: none;
  transform: none;
  font: 800 var(--t-micro)/1.15 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
:root .chip.chip:hover { background: var(--wash); }
:root .chip.chip:active { translate: 0 1px; }
:root .chip.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
:root .chip.chip.active,
:root .chip.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper-hi); }
:root .chip.chip:disabled { opacity: .35; cursor: not-allowed; }
:root .chip.chip small { color: inherit; opacity: .62; font: inherit; }

/* ── form select styled as a general button ───────────────────── */
:root select.select {
  min-height: var(--btn-h);
  padding: 0 34px 0 12px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: var(--paper-hi) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23181410' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px;
  box-shadow: none;
  color: var(--ink);
  font: 800 var(--t-micro)/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
  appearance: none;
  -webkit-appearance: none;
}
html[data-theme="dark"] select.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f7edd9' stroke-width='2'/%3E%3C/svg%3E"); }
:root select.select:disabled { opacity: .4; }

/* ═══ Applying the system ══════════════════════════════════════ */

/* masthead: one plate — find · about · edition */
:root .press-plate.btn-group { flex: none; margin-left: auto; }
:root .masthead-actions { display: flex; align-items: stretch; }
:root .masthead-actions .btn.btn { border-left: 1px solid var(--hair); }
:root .search-trigger.btn { padding: 0 12px; letter-spacing: .08em; font-size: var(--t-micro); }
:root .search-trigger .search-trigger-icon { color: var(--accent); font-size: 15px; }
:root .search-trigger.btn[aria-expanded="true"] .search-trigger-icon,
:root .search-trigger.btn.has-query .search-trigger-icon { color: inherit; }
:root .search-trigger.btn.has-query { background: var(--ink); color: var(--paper-hi); }
:root .masthead-btn.btn { font: 400 18px/1 var(--serif); letter-spacing: 0; text-transform: none; }
:root .theme-toggle.btn { font-size: 15px; }
@media (min-width: 760px) {
  :root .press-plate.btn-group { flex: 1 1 auto; max-width: 440px; }
  :root .press-plate .search { height: 40px; }
}
/* the phone search strip */
:root .search.open { box-shadow: none; }
:root .search.open .search-icon { background: transparent; color: var(--accent); }
:root .search.open .btn.search-dismiss { width: 44px; height: 100%; border: 0; border-left: 1px solid var(--hair); background: transparent; color: var(--ink); }
:root .search.open .btn.search-clear { height: 100%; border: 0; border-left: 1px solid var(--hair); padding: 0 10px; font-size: var(--t-micro); }

/* the dock: the pool on top, four tabs below, Pick for me the signature */
:root .dock {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  height: calc(var(--dock-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--paper-hi) 97%, transparent);
  box-shadow: none;
}
:root .dock-context { display: none; height: var(--dock-ctx-h); padding: 6px 10px; border-bottom: 1px solid var(--hair); }
:root body.dock-has-context .dock-context { display: block; }
:root .dock-nav { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); min-height: 0; }
:root .dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--ink) 66%, transparent);
  font: 800 var(--t-micro)/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
:root .dock-btn .dock-icon { width: 34px; height: 28px; border: 0; border-radius: 0; background: none; box-shadow: none; transform: none; font-size: 18px; }
:root .dock-btn.active { color: var(--ink); }
:root .dock-btn.active .dock-icon { background: none; color: var(--ink); box-shadow: none; transform: none; }
:root .dock-btn.active::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 3px; background: var(--ink); }
:root .dock-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: -4px; }
:root .dock-btn.random { color: var(--ink); }
:root .dock-btn.random .dock-icon,
:root .dock-btn.random.active .dock-icon { border: 1.5px solid var(--ink); background: var(--accent); color: var(--accent-ink); box-shadow: 2px 2px 0 var(--ink); }
:root .dock-btn.random:active .dock-icon { translate: 2px 2px; box-shadow: none; }
:root .dock-btn.random.active::before { display: none; }

/* the pool row inside the dock */
:root .dock .pool-controls {
  position: static;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
}
:root .filter-launch.btn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0 6px 0 12px;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
}
:root .filter-launch .filter-launch-icon { display: grid; place-items: center; width: 18px; height: 18px; border: 0; background: none; color: var(--ink); }
:root .filter-launch .filter-launch-icon svg { width: 18px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
/* on a phone the neighbourhood name needs the room more than the word "filter" does */
@media (max-width: 479px) { :root .filter-launch .filter-launch-copy small { display: none; } }
:root .filter-launch .filter-launch-copy { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
:root .filter-launch .filter-launch-copy small { flex: none; color: color-mix(in srgb, var(--ink) 58%, transparent); font: 800 var(--t-micro)/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
:root .filter-launch .filter-launch-copy strong { min-width: 0; max-width: none; margin: 0; overflow: hidden; font: 400 18px/1.05 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
:root .filter-launch .filter-launch-count { min-width: 30px; height: 30px; padding: 0 7px; border: 0; background: var(--ink); color: var(--paper-hi); font: 800 var(--t-label)/30px var(--mono); text-align: center; }
:root .near-toggle.btn { width: auto; min-width: 0; padding: 0 14px; transform: none; box-shadow: none; animation: none; }
:root .near-toggle.btn.loading { animation: nearPulse .8s steps(2, end) infinite; }
@keyframes nearPulse { 50% { background: var(--ink); color: var(--paper-hi); } }
:root body.filter-open .dock .pool-controls,
:root body.is-picking .dock .pool-controls { opacity: .35; pointer-events: none; }

@media (min-width: 760px) {
  :root { --dock-ctx-h: 54px; --dock-nav-h: 56px; }
  :root .dock { left: 50%; right: auto; bottom: 16px; width: 440px; height: var(--dock-h); padding-bottom: 0; transform: translateX(-50%); border: 1.5px solid var(--ink); box-shadow: var(--lift); transition: left .45s var(--ease); }
  /* with a review open the panel owns the right-hand side; the dock re-centres
     on what is left instead of sliding half under the panel */
  :root body:has(#dossier.open) .dock { left: calc((100vw - min(540px, 45vw)) / 2); width: min(440px, calc(100vw - min(540px, 45vw) - 32px)); }
}
@media (min-width: 760px) and (max-height: 520px) {
  :root { --dock-ctx-h: 50px; --dock-nav-h: 50px; }
  :root .dock { bottom: 6px; }
  :root .dock-btn { gap: 3px; }
  :root .dock-btn .dock-icon { height: 24px; }
}

/* world chrome */
:root .world-up.btn { padding: 0 14px; }
:root .world-up.btn b { font-size: 15px; line-height: 1; }
:root .world-crumb { border: 0; background: color-mix(in srgb, var(--paper-hi) 88%, transparent); box-shadow: none; opacity: 1; padding: 0 12px; }
:root .street-track { border: 1.5px solid var(--ink); box-shadow: none; }
:root .street-tick.on i { background: var(--accent); }
:root .focus-card { border: 1.5px solid var(--ink); box-shadow: var(--lift); }
:root .focus-card h2 { margin: 3px 0 2px; font-size: 27px; line-height: .95; }
:root .focus-card .focus-label { color: var(--accent); }
:root .gesture-arrow { color: var(--paper-hi); }
/* landmarks bump the street chrome up a band now the dock is two rows */
:root .street-rail { bottom: calc(var(--dock-h) + 10px); }
:root .focus-card { bottom: calc(var(--dock-h) + 66px); }
:root .gesture-coach { bottom: calc(var(--dock-h) + 14px); }
@media (min-width: 760px) {
  :root .street-rail { bottom: calc(var(--dock-h) + 30px); }
  :root .focus-card { bottom: calc(var(--dock-h) + 90px); }
  :root .gesture-coach { bottom: calc(var(--dock-h) + 30px); }
}

/* map */
:root .map-caption { box-shadow: none; }
:root .near-status { border: 1.5px solid var(--ink); box-shadow: none; }
:root .near-status-mark { background: var(--ink); color: var(--paper-hi); }
:root .near-status-copy b { color: var(--accent); }
:root .map-preview { border: 1.5px solid var(--ink); box-shadow: var(--lift); }
:root .map-preview h2 { font-size: 30px; line-height: .95; }
:root .map-preview-kicker { color: var(--accent); }
:root .leaflet-control-zoom { border: 1.5px solid var(--ink) !important; box-shadow: none !important; }
:root .leaflet-control-zoom a { background: var(--paper-hi) !important; color: var(--ink) !important; }
:root .leaflet-control-zoom a:hover { background: var(--wash) !important; color: var(--ink) !important; }
:root .marker-cluster div { background: var(--paper-hi) !important; color: var(--ink) !important; box-shadow: 2px 2px 0 var(--ink); }
:root .active-filter-row { padding-top: 10px; }
:root .map-view .map-preview { bottom: calc(var(--dock-h) + 12px); }
@media (min-width: 760px) { :root .map-view .map-preview { bottom: calc(var(--dock-h) + 32px); } }

/* list: bigger names, quieter cards */
:root .place-row { border: 1.5px solid var(--ink); box-shadow: none; }
:root .place-row:hover { border-color: var(--accent); }
:root .place-row[data-citywide="true"] { border-color: var(--ink); }
:root .place-row h3 { margin: 8px 0 5px; font-size: clamp(27px, 7.6vw, 33px); line-height: .94; }
:root .place-row-top { color: var(--accent); }
:root .row-open { width: auto; height: auto; border: 0; border-radius: 0; background: none; color: var(--ink); font-size: 16px; }
:root .row-open::after { display: none; }
:root .chain-stamp { border: 1px solid var(--ink); background: transparent; color: var(--ink); }
:root .list-head h2 { font-size: 46px; }
:root .list-view { padding-bottom: calc(var(--dock-h) + 40px); }
@media (min-width: 760px) { :root .place-row h3 { font-size: 32px; } :root .list-head h2 { font-size: 64px; } }

/* review sheet */
:root .dossier-close.btn { display: flex; position: sticky; top: 34px; margin: 11px 18px -55px auto; }
:root .dossier-photo .btn.btn { box-shadow: none; }
:root .dossier-photo-nav.btn { font: 400 26px/1 var(--serif); }
:root .dossier-no { background: var(--paper-hi); color: var(--ink); }
:root .dossier h2 { font-size: clamp(40px, 12vw, 54px); line-height: .88; }
:root .dossier-kicker,
:root .order-label,
:root .dossier-vibe { color: var(--accent); }
:root .dossier-actions { grid-template-columns: minmax(0, 1fr) auto var(--btn-h) var(--btn-h); gap: 8px; }
:root .dossier-actions .btn.btn { min-height: var(--btn-h); }
:root .dossier-actions .maps-link.btn { padding: 0 12px; }
:root .share-link.btn { padding: 0 14px; }
/* four keys in a narrow bar (a small phone, or the side panel on a tablet):
   the maps key drops "open in" rather than spilling */
:root .dossier-actions { container-type: inline-size; }
@container (max-width: 390px) { .maps-link .label-long { display: none; } }
:root .slot-tray-head span { overflow-wrap: anywhere; letter-spacing: .06em; }
:root .share-link.btn span { font-size: 15px; }
:root .more-spot { border: 1.5px solid var(--hair); box-shadow: none; background: var(--paper-hi); }
:root .more-spot:hover { border-color: var(--ink); background: var(--wash); color: var(--ink); }
:root .more-spot:hover .more-spot-kicker,
:root .more-spot-kicker { color: var(--accent); }
:root .more-spot b { font-size: 24px; }
:root .must:not(:empty) { background: var(--accent); color: var(--accent-ink); }

/* filter sheet */
:root .facet.chip { font-size: var(--t-label); }
:root .region-facet.chip { display: block; padding: 9px 12px; text-align: left; text-transform: none; letter-spacing: 0; }
:root .region-facet.chip b { display: block; font: 400 17px/1 var(--serif); }
:root .region-facet.chip span { display: block; margin-top: 5px; font: 800 var(--t-micro)/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
:root .filter-sheet { box-shadow: 0 -6px 0 var(--accent); }
:root .filter-kicker { color: var(--accent); }
:root .filter-actions .btn.btn { padding: 0 14px; }

/* the cabinet's own controls follow the system; its LEDs and reels stay theatre */
/* The close sits outside the machine, in the overlay's top-right corner,
   clear of the screen edge and of the cabinet, and stays put while a short
   phone scrolls the cabinet under it. The overlay and the cabinet share one
   grid cell; --slot-top is the room left above the cabinet for crown + close. */
:root .lottery-overlay { --slot-top: 84px; --slot-gap: 14px; padding-top: var(--slot-gap); padding-inline: var(--slot-gap); scroll-padding-bottom: 14px; }
:root .slot-shell { grid-area: 1 / 1; margin-top: calc(var(--slot-top) - var(--slot-gap)); }
:root .slot-close.btn {
  position: sticky;
  z-index: 12;
  top: 0;
  grid-area: 1 / 1;
  justify-self: end;
  align-self: start;
  margin: 0;
  font-size: 17px;
}
:root .slot-marquee { padding-right: 16px; }
@media (max-width: 480px) {
  /* a narrower crown leaves the close its own corner */
  :root .slot-crown { left: 70px; right: 70px; }
  :root .slot-crown-bulbs { left: 9%; right: 9%; }
}
@media (max-height: 720px) and (max-width: 759px) {
  :root .lottery-overlay { --slot-top: 76px; --slot-gap: 12px; }
}
@media (min-width: 760px) {
  :root .lottery-overlay { --slot-gap: 22px; }
}
/* the filter row has nothing to offer while the machine is open — the reels
   hold area, kind and spend — so the dock folds to its tabs and the cabinet
   gets the room */
:root body.is-picking { --dock-h: var(--dock-nav-h); }
:root body.is-picking .dock-context { display: none; }
:root .slot-tray .chip.chip { border-color: #050403; }
:root .slot-tray .chip.chip.active { background: var(--accent); color: var(--accent-ink); }
:root .slot-ticket-actions .btn.btn { min-height: var(--btn-h); padding: 0 10px; font-size: var(--t-micro); }
:root .slot-tray-head .btn.btn { min-height: 40px; height: 40px; padding: 0 12px; font-size: var(--t-micro); }

/* lightbox */
:root .lb-close.btn,
:root .lb-nav.btn { position: fixed; }
:root .lb-nav.btn { font: 400 27px/1 var(--serif); }

/* about */
:root .solo-seal { border: 1.5px solid var(--accent); background: transparent; color: var(--accent); box-shadow: none; transform: none; }
:root .about-card { box-shadow: none; }
:root .about-form { border: 1.5px solid var(--ink); background: var(--paper-hi); color: var(--ink); box-shadow: none; }
:root .about-field input,
:root .about-field textarea,
:root .about-field select { border-color: var(--ink); box-shadow: none; }
:root .about-field input:focus,
:root .about-field textarea:focus,
:root .about-field select:focus { box-shadow: none; outline: 3px solid var(--accent); outline-offset: 1px; }
:root .about-submit.btn { min-height: 48px; }
:root .about-form-status.success { color: #2f7d32; }
:root .about-form-status.error { color: var(--accent); }
html[data-theme="dark"] .about-form-status.success { color: #8fd694; }
:root .about-kicker,
:root .about-card-number,
:root .editorial-list b,
:root .policy-copy h3 { color: var(--accent); }

/* the 777 banner's close */
:root .jackpot-end.btn { width: 100%; height: 100%; border: 0; border-left: 1.5px solid currentColor; }

@media (prefers-reduced-motion: reduce) {
  :root .btn.btn, :root .chip.chip { transition: none; }
}
