/* Styled to match lammertsma.dev (see /assets/css/main.css): dark glass
   surfaces, Inter body text, Outfit headings, electric-blue accent. The dark
   palette mirrors the site's tokens exactly; the light palette is an opt-in
   counterpart built from the same accent, radii and fonts. */
:root {
  --primary: hsl(200, 100%, 50%);
  --primary-dark: hsl(200, 100%, 40%);
  --primary-glow: hsla(200, 100%, 50%, 0.3);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-blur: blur(16px);
  --font-body: "Inter", system-ui, sans-serif;
  --font-heading: "Outfit", "Inter", system-ui, sans-serif;

  /* Dark (site default) */
  --bg: hsl(222, 47%, 11%);
  --bg-glow-1: hsla(210, 100%, 20%, 0.15);
  --bg-glow-2: hsla(200, 100%, 20%, 0.15);
  --fg: hsl(210, 20%, 98%);
  --muted-fg: hsl(210, 10%, 70%);
  --border: rgba(255, 255, 255, 0.1);
  --card-bg: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --log-bg: rgba(0, 0, 0, 0.25);
  --accent-bg: rgba(255, 255, 255, 0.1);
  --link: var(--primary);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --zone-blue: #5b9bff;
  --zone-white: #c8c8c8;
  --spot-white: #f1f5f9;
  --spot-rejected-fill: #4b5563;
  --spot-rejected-stroke: #6b7280;
  --map-tile-filter: invert(1) hue-rotate(180deg) brightness(0.95) contrast(0.9);
  color-scheme: dark;
}

/* "Match system": app.js removes data-theme entirely for this choice. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: hsl(210, 33%, 98%);
    --bg-glow-1: hsla(210, 100%, 80%, 0.25);
    --bg-glow-2: hsla(200, 100%, 80%, 0.2);
    --fg: hsl(222, 47%, 11%);
    --muted-fg: hsl(215, 16%, 38%);
    --border: rgba(15, 23, 42, 0.14);
    --card-bg: rgba(255, 255, 255, 0.75);
    --surface-hover: rgba(15, 23, 42, 0.05);
    --log-bg: rgba(15, 23, 42, 0.04);
    --accent-bg: rgba(15, 23, 42, 0.08);
    --link: hsl(200, 100%, 36%);
    --shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
    --zone-blue: #1560bd;
    --zone-white: #555555;
    --spot-white: #555555;
    --spot-rejected-fill: #bbbbbb;
    --spot-rejected-stroke: #999999;
    --map-tile-filter: none;
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: hsl(210, 33%, 98%);
  --bg-glow-1: hsla(210, 100%, 80%, 0.25);
  --bg-glow-2: hsla(200, 100%, 80%, 0.2);
  --fg: hsl(222, 47%, 11%);
  --muted-fg: hsl(215, 16%, 38%);
  --border: rgba(15, 23, 42, 0.14);
  --card-bg: rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(15, 23, 42, 0.05);
  --log-bg: rgba(15, 23, 42, 0.04);
  --accent-bg: rgba(15, 23, 42, 0.08);
  --link: hsl(200, 100%, 36%);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
  --zone-blue: #1560bd;
  --zone-white: #555555;
  --spot-white: #555555;
  --spot-rejected-fill: #bbbbbb;
  --spot-rejected-stroke: #999999;
  --map-tile-filter: none;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  margin: 0;
  color: var(--muted-fg);
  background: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, var(--bg-glow-1) 0px, transparent 50%),
    radial-gradient(at 100% 100%, var(--bg-glow-2) 0px, transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--fg);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-shadow: 0 0 10px var(--primary-glow);
}

p {
  margin: 10px 0 4px;
}

/* ---- Top bar -------------------------------------------------------- */

/* The header and footer span the full page width; the content between them
   sits in a centered 720px column, wrapped in the unstyled .page-main so it
   can flex-grow to fill the remaining height (flex-column body) without
   stretching .legal's own card background on the legal pages. That's what
   lands .site-footer, below, at the very bottom of the viewport on short
   pages instead of floating right under a short results list or a short
   legal page -- the classic "sticky footer" layout, achieved without
   position: fixed so it never overlaps content while scrolling. */
.page-main {
  flex: 1 0 auto;
  width: min(720px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.topbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

/* Site icon linking back to the lammertsma.dev homepage. */
.site-home {
  display: flex;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.site-home:hover {
  border-color: var(--primary);
}

.site-home img {
  display: block;
  width: 32px;
  height: 32px;
}

.topbar h1 {
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar h1 a {
  color: inherit;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
}

.theme-toggle button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted-fg);
}

.theme-toggle button:first-child {
  border-left: none;
}

.theme-toggle button:hover {
  background: var(--surface-hover);
  color: var(--fg);
  transform: none;
  box-shadow: none;
}

.theme-toggle button[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--primary);
}

.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Controls ------------------------------------------------------- */

button {
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
  color: var(--fg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}

button:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--primary);
}

button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

#start,
#expand {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

#start:hover:not(:disabled),
#expand:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: transparent;
}

/* ---- Header search ---------------------------------------------------
   Collapsed: just the toggle icon. Expanded (.topbar.search-expanded):
   .search-row grows from 0 width to show the input (with its clear button
   overlaid inside it) and the toggle hides -- so there's exactly one
   affordance for "search" at a time, not a button sitting next to its own
   open field. #use-geolocation lives outside .search-row -- see its own
   comment in index.html -- so it isn't part of that collapse and stays
   visible either way. */

.header-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar.search-expanded #search-toggle {
  display: none;
}

.search-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 0;
  overflow: hidden;
  opacity: 0;
  transition: width 0.2s ease, opacity 0.15s ease;
}

.topbar.search-expanded .search-row {
  width: 17rem;
  opacity: 1;
  /* Collapsed .search-row clips via overflow: hidden so it can animate from
     width: 0 without the (currently invisible) input poking out; expanded,
     #suggestions -- an absolutely positioned child extending below this
     box -- needs to actually be visible instead of clipped. */
  overflow: visible;
}

/* Wraps the input so #search-clear can sit inside it instead of as a
   separate button alongside the field. */
.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-field input {
  width: 100%;
}

/* Replaces the browser's own type="search" cancel icon -- without this
   they'd both render, one inside the input and one outside it. */
.search-field input::-webkit-search-cancel-button {
  display: none;
}

/* Overlaid inside .search-field's right edge rather than taking its own
   slot next to the input -- visible once there's text to clear (not
   hover-gated like a native ::-webkit-search-cancel-button, and
   consistent across browsers). */
.search-clear {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-fg);
}

.search-clear:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: transparent;
  color: var(--fg);
}

.search-clear svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

@media (max-width: 600px) {
  /* The search field takes over the whole header while in use, instead of
     competing for space with the brand, account button and overflow menu.
     #use-geolocation stays visible (see its own comment above). */
  .topbar.search-expanded .topbar-brand,
  .topbar.search-expanded .account,
  .topbar.search-expanded .overflow-menu {
    display: none;
  }

  .topbar.search-expanded .topbar-actions {
    flex: 1;
  }

  .topbar.search-expanded .header-search {
    flex: 1;
  }

  /* flex: 1 (not width: 100%) so #use-geolocation, a flex sibling outside
     .search-row, keeps its own width instead of being pushed off-screen. */
  .topbar.search-expanded .search-row {
    width: auto;
    flex: 1;
  }
}

/* ---- Optional sign-in ------------------------------------------------ */

.account {
  position: relative;
}

#account-btn {
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The signed-in state: a round avatar (initials) instead of a truncated
   name -- see renderAccount() in app.js. */
#account-btn.avatar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  max-width: none;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.account-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  /* Leaflet's own controls (zoom, fullscreen) sit at z-index 1000 too and
     come later in the DOM, so at the same z-index they'd render on top of
     this panel -- matches #suggestions' z-index below for the same reason. */
  z-index: 1100;
  width: 16rem;
  max-width: calc(100vw - 2rem);
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg); /* opaque: the glass surfaces would let the map show through */
  box-shadow: var(--shadow);
}

.account-panel p {
  margin: 0 0 0.6rem;
}

.account-panel .account-name {
  font-weight: 600;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.account-panel .hint {
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.account-panel button {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
}

.account-panel .danger {
  color: #ef5350;
}

/* ---- Overflow menu (theme) -------------------------------------------- */

.overflow-menu {
  position: relative;
}

.overflow-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  /* Leaflet's own controls (zoom, fullscreen) sit at z-index 1000 too and
     come later in the DOM, so at the same z-index they'd render on top of
     this panel -- matches #suggestions' z-index below for the same reason. */
  z-index: 1100;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg); /* opaque: the glass surfaces would let the map show through */
  box-shadow: var(--shadow);
}

.overflow-panel p {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
}

.reset-btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .topbar {
    padding: 0.75rem 0.9rem;
    gap: 0.5rem;
  }

  .topbar-brand {
    gap: 0.5rem;
  }

  .theme-toggle button {
    width: 1.9rem;
  }

  .topbar h1 {
    font-size: 1.15rem;
  }

  .topbar-actions {
    gap: 0.35rem;
  }

  #account-btn {
    max-width: 5rem;
  }
}

select {
  font-family: var(--font-body);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--fg);
}

/* The popup list is drawn by the browser and ignores the select's translucent
   background, so give the options an opaque one or they turn white-on-white. */
select option {
  background-color: var(--bg);
  color: var(--fg);
}

select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

input[type="radio"] {
  accent-color: var(--primary);
}

.hint {
  color: var(--muted-fg);
  font-size: 0.9rem;
}

/* ---- Setup / session ------------------------------------------------ */

#setup,
#session {
  margin-top: 1.5rem;
}

#setup h2,
#session h2 {
  font-size: 1.3rem;
  margin: 0 0 0.75rem;
}

#session h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0 0.5rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  margin: 0 0 0.75rem;
  padding: 0.5rem 1rem 0.75rem;
}

legend {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--fg);
  padding: 0 0.4rem;
}

/* One look for every control in the search form: the same height, text size
   and corner radius, so the radios, the dropdown and the two buttons read as
   one set. The compact header buttons keep their own sizes. */
:root {
  --control-height: 2.75rem;
  --control-font: 1rem;
}

#setup button,
#setup select,
#session button {
  min-height: var(--control-height);
  font-size: var(--control-font);
}

#setup button,
#session button {
  padding: 0 1.4rem;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.25rem 0 0;
  font-size: var(--control-font);
  cursor: pointer;
}

/* The chosen option reads as a value (bright), the others as options (muted),
   like the dropdown's selected text. */
fieldset label:has(input:checked) {
  color: var(--fg);
}

input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}

.duration-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: var(--control-font);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.25rem 0 0.25rem;
}

#map {
  height: 350px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  /* Keeps Leaflet's panes inside the rounded corners. */
  overflow: hidden;
}

/* The map tiles are CARTO's light basemap; invert them in the dark theme
   rather than switching tile sets, so markers and popups are untouched. */
/* The label sits right on its marker, so Leaflet's little pointer is redundant. */
.leaflet-tooltip::before {
  display: none;
}

.leaflet-tile-pane {
  filter: var(--map-tile-filter);
}

.you-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d62728;
  border: 2px solid white;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
}

.card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

/* Not scoped to .card: also used inside map popups (segmentDetailsHtml in
   app.js), which aren't .card elements. */
.zone-blue { color: var(--zone-blue); font-weight: bold; }
.zone-white { color: var(--zone-white); font-weight: bold; }

.popup-note {
  color: var(--muted-fg);
  font-size: 0.85rem;
}

/* Leaflet's own popup chrome is theme-unaware (always light) -- override it
   so the richer content segmentDetailsHtml puts in there stays legible in
   dark mode instead of white-box-on-dark-page. */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
}

.leaflet-popup-content-wrapper {
  border-radius: 12px;
  font-family: var(--font-body);
}

.leaflet-popup-close-button {
  color: var(--muted-fg) !important;
}

.leaflet-container a {
  color: var(--link);
}

.leaflet-control-attribution {
  background: var(--card-bg) !important;
  color: var(--muted-fg) !important;
}

/* Leaflet's default zoom buttons are 26px -- too small to tap reliably, let
   alone precisely, on a touchscreen. 44px matches Apple's and Android's own
   minimum touch-target guidance. */
.leaflet-control-zoom a {
  width: 2.75rem !important;
  height: 2.75rem !important;
  line-height: 2.75rem !important;
  font-size: 1.25rem !important;
}

/* Long result lists scroll inside their own block instead of stretching the page. */
#upcoming {
  max-height: 11rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

#upcoming li {
  margin: 0.35rem 0;
}

/* Map marker colors. Rejected ("already checked") spots must read as fainter
   than live ones in both themes: lighter than white-zone spots on the light
   map, darker than them on the dark map. */
.spot-blue {
  stroke: var(--zone-blue);
  fill: var(--zone-blue);
}

.spot-white {
  stroke: var(--spot-white);
  fill: var(--spot-white);
}

.spot-rejected {
  stroke: var(--spot-rejected-stroke);
  fill: var(--spot-rejected-fill);
}

.status {
  background: var(--log-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--fg);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
}

/* ---- Privacy policy and terms of use -------------------------------- */

.legal-nav a {
  font-weight: 600;
}

.legal {
  background: var(--card-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  line-height: 1.7;
}

.legal h2 {
  font-size: 2rem;
  letter-spacing: 0.5px;
  margin: 0 0 0.25rem;
}

.legal h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.4rem;
}

.legal h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.25rem;
}

.legal .meta {
  color: var(--muted-fg);
  margin-top: 0;
}

.legal strong {
  color: var(--fg);
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin: 0.35rem 0;
}

.legal li::marker {
  color: var(--primary);
}

.retention {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.retention th,
.retention td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.retention th {
  font-family: var(--font-heading);
  color: var(--fg);
}

/* Wide tables scroll inside the card instead of the page on narrow screens. */
.legal .table-wrap {
  overflow-x: auto;
}

/* ---- Footer --------------------------------------------------------- */

/* Full width and flex-shrink: 0 (not the centered 720px column, and never
   compressed by .page-main's flex-grow above) -- see the flex-column body
   rule near the top of this file for how this ends up pinned to the very
   bottom of the viewport on short pages. */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted-fg);
  font-size: 13px;
  text-align: center;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .site-footer {
    padding: 0.5rem 1rem;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .legal {
    padding: 1.25rem 1.1rem;
    border-radius: 16px;
  }
}

/* ---- Nearby parking: filters, areas ---------------------------- */

/* .search-row/.search-field's own layout (position/display/width/
   transition) is defined with the rest of the header search near
   .header-search, above -- it now lives in the header, not here, but its
   *visual* input styling stays. Right padding leaves room for #search-clear,
   overlaid inside the field -- see .search-clear. */
.search-field input {
  min-height: 2.75rem;
  padding: 0 2.4rem 0 0.9rem;
  font: inherit;
  color: var(--fg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.search-field input::placeholder {
  color: var(--muted-fg);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
}

.icon-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

#suggestions {
  position: absolute;
  z-index: 1100; /* above the Leaflet controls */
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--bg); /* opaque: the glass surfaces would show the map */
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

#suggestions li {
  padding: 0.6rem 0.75rem;
  color: var(--fg);
  border-radius: 8px;
  cursor: pointer;
}

#suggestions li:hover,
#suggestions li[aria-selected="true"] {
  background: var(--surface-hover);
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.zone-filter {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.zone-filter button {
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: none;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted-fg);
}

.zone-filter button:first-child {
  border-left: none;
}

.zone-filter button[aria-pressed="true"] {
  background: var(--accent-bg);
  color: var(--primary);
}

.stay-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stay-filter select {
  min-height: 2.5rem;
}

.status {
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  color: var(--fg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.disc-card {
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  color: var(--fg);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--zone-blue);
  border-radius: 8px;
}

.areas-heading {
  margin: 1.1rem 0 0.4rem;
  font-size: 1rem;
  color: var(--muted-fg);
  font-weight: 600;
}

.areas {
  margin: 0;
  padding: 0;
  list-style: none;
}

.areas[aria-busy="true"] {
  opacity: 0.55;
}

.area {
  margin-bottom: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.area-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.6rem 0.8rem;
  text-align: left;
  border: none;
  border-radius: 0;
  background: transparent;
}

.area-row:hover:not(:disabled) {
  background: var(--surface-hover);
}

.area-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.area-title {
  color: var(--fg);
  font-weight: 600;
}

.area-sub {
  color: var(--muted-fg);
  font-size: 0.9rem;
  font-weight: 400;
}

.area-details {
  padding: 0.2rem 0.8rem 0.8rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.4rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
}

.button-link.primary {
  background: var(--primary);
  border-color: transparent;
  color: #fff;
}

.zone-icon-wrap,
.destination-wrap,
.you-wrap {
  background: none;
  border: none;
}

/* The app's P square, with the area's rank on a small badge. */
.zone-icon {
  position: relative;
  display: inline-block;
  flex: none;
  width: 30px;
  height: 30px;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.zone-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.zone-rank {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #1a1a1a;
  border: 1.5px solid #fff;
  border-radius: 8px;
}

.zone-icon.selected {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  transform: scale(1.15);
}

.area-row .zone-icon {
  width: 34px;
  height: 34px;
}

.destination-arrow svg,
.you-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
}

.destination-arrow {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.you-arrow {
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

@media (max-width: 600px) {
  #map {
    height: clamp(240px, 38vh, 380px);
  }
}

/* ---- Full-screen map --------------------------------------------------- */

.fullscreen-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #1a1a1a;
}

.fullscreen-control svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The overlay fallback (iPhone Safari, or a refused request): the whole viewport,
   no margins. The native :fullscreen state needs the same, because #map has its
   own fixed height and the page column's width. */
#map.map-fullscreen,
#map:fullscreen,
#map:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 3000;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#map.map-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
}

body.map-fullscreen-open {
  overflow: hidden;
}
