/* Loaded after the shared shell styles, including before the first paint. */
@import url("/forms.css");
:root { --bottom-clearance: 0px; --effective-bottom-clearance: max(var(--bottom-clearance), var(--lf-places-dock-h, 0px)); }
html { scroll-padding-bottom: calc(var(--effective-bottom-clearance) + 24px); }
body { padding-bottom: var(--effective-bottom-clearance); }
:where(a,button,input,select,textarea,summary):focus-visible { outline: 3px solid #1f5fbf !important; outline-offset: 4px !important; }
:where(button,summary,select,input:not([type=checkbox]):not([type=radio]),.rd-tap-link) { min-height:44px; min-width:44px; }
:where(main,footer,nav) a { overflow-wrap:anywhere; }
html[data-ll-theme=dark] { color-scheme:dark; --cal:#221a20; --cal-2:#3a2f35; --cal-3:#4a3f45; --white:#3a2f35; --line:#82737b; --line-2:#a99ba2; }
.rd-place-visit a { color:#1f5fbf; }

html[data-ll-theme=dark] :focus-visible { outline-color:#f4c542 !important; }
@media (max-width:600px) { main { min-width:0; } img,video { max-width:100%; } dialog { max-width:calc(100vw - 16px); } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; transition:none !important; scroll-behavior:auto !important; } }
.rd-place-mini-map a { color:#8e341e; }
/* These compact controls override page-specific sizes below the shared minimum. */
.sp-quick-dates button,.sp-moods button,.ll-map-sheet-handle { min-height:44px !important; }
.rd-logo { min-height:44px; align-items:center; }
.ll-now-inner a:not([hidden]),.rd-event-pages a,.sp-preview-link,.rd-detail-photo>a,.rd-facts dd>a,[data-saved-plans]>a { display:inline-flex; align-items:center; justify-content:center; min-width:44px !important; min-height:44px !important; }
.ll-now-inner { min-height:44px; }
/* Standalone links also need a finger-sized target when inserted after load. */
main :where(a[href]:not(p a):not(figcaption a):not(small a):not(nav[aria-label="Breadcrumb"] a)) { display:inline-flex; align-items:center; min-width:44px !important; min-height:44px !important; }
/* Breadcrumbs, every template: crumbs and the "/" between them sit 8 px apart, and each link is still a 44 x 44 px target.
   The rule above left-aligned a short first crumb in its 44 px box ("Home   / Eat & drink"); here the box grows by 7 px
   on each side and a -7 px margin takes that back, so the target is 44 px wide but the text keeps the 8 px gap.
   A trail written as a paragraph (Nightlife) is inline text with its own spacing, as links in a paragraph are elsewhere. */
nav[aria-label="Breadcrumb"]:not(:has(> p)) { display:flex; flex-wrap:wrap; align-items:center; column-gap:8px; row-gap:0; }
nav[aria-label="Breadcrumb"] a[href]:not(p a) { display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; box-sizing:border-box; padding-inline:7px; margin-inline:-7px; }
/* Card links (a link wrapping a heading, image or block) keep their own layout: centring only suits one-line text links. */
main :where(a[href]:not(p a):not(figcaption a):not(small a):has(div,p,h2,h3,h4,picture,img,ul,figure,strong)) { align-items:normal; }

/* Display type wraps at word boundaries. Keep the longest guide titles on the grid. */
:where(body) :is(h1,h2,h3,h4,h5,h6) {
  overflow-wrap:normal !important;
  word-break:normal !important;
  hyphens:none !important;
  text-wrap:balance;
}
@media (max-width:420px) {
  body main h1 { font-size:clamp(30px, 9vw, 38px) !important; }
}
.maplibregl-cooperative-gesture-screen {
  background:#221a20ed !important;
  color:#fff !important;
}
@media (pointer:coarse) {
  .maplibregl-cooperative-gesture-screen .maplibregl-desktop-message { display:none !important; }
}

/* Map artwork uses the map's own day/night style. Theme its controls separately. */
html[data-ll-theme=dark] :is(.maplibregl-popup-content,.maplibregl-ctrl-group,.leaflet-popup-content-wrapper){
  background:#302730;
  color:#f7eee5;
}
html[data-ll-theme=dark] :is(.maplibregl-popup-content,.leaflet-popup-content-wrapper) a{color:#f0b79e}
html[data-ll-theme=dark] .maplibregl-ctrl-group .maplibregl-ctrl-icon{filter:invert(1)}
html[data-ll-theme=dark] ::placeholder{color:#c8b9c0;opacity:1}
html[data-ll-theme=dark] .ll-venue-actions .ll-thumb-primary{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}

/* Night theme (generated by scripts/build-night.mjs) */
html[data-ll-theme="dark"] :where(a,button,input,select,textarea,summary):focus-visible{outline-color:#a9c8fa!important}
html[data-ll-theme="dark"] .rd-place-visit a{color:#a9c8fa}
html[data-ll-theme="dark"] .rd-place-mini-map a{color:#f4b1a0}
html[data-ll-theme="dark"] .maplibregl-cooperative-gesture-screen{background-color:rgba(42,35,39,0.929)!important;background-image:none!important;color:#ffffff!important}

/* Lisbonline night palette — "Lisboa à noite".
   Hand-designed dark tokens and refinements. At build time this file is
   appended to /brand/tokens.css and every stylesheet receives generated night
   rules (scripts/build-night.mjs). Everything here is scoped to
   [data-ll-theme="dark"], which the head boot script sets before first paint. */
:root[data-ll-theme="dark"]{
  color-scheme:dark;
  /* elevation: warm near-black, never #000 */
  --n-0:#171214;   /* page ground */
  --n-1:#201A1D;   /* cards, header */
  --n-2:#2A2327;   /* chips, bands */
  --n-3:#352D32;   /* menus, dialogs, active pills */
  --n-line:#40373C; --n-line-2:#5A4E54; --n-control:#8F8288;
  --n-text:#F2EBE3;    /* ~87% */
  --n-text-2:#E2D9D0; --n-text-3:#CFC3BB;
  --n-muted:#B0A39C;   /* ~60%, AA on every elevation */
  --n-link:#A9C8FA; --n-focus:#8DB6FF;
  --n-sol:#D9AE45; --n-sol-text:#F2CF6B; --n-now:#2E2617;
  /* the old tokens, for inline styles and scripts that read them */
  --cal:var(--n-0); --cal-2:var(--n-2); --cal-3:var(--n-3); --white:var(--n-1);
  --ink:var(--n-text); --ink-2:var(--n-text-2); --ink-3:var(--n-text-3); --muted:var(--n-muted);
  --line:var(--n-line); --line-2:var(--n-line-2); --ceu:#1B2633; --tejo:#1F2B3D;
  --telha-soft:#33201B; --jardim-soft:#17291F; --jacaranda-soft:#251F33; --vinho-soft:#301A22; --azulejo-soft:#19233A; --fachada-soft:#311B25;
  --shadow-card:0 16px 40px rgba(0,0,0,.45); --e-1:0 6px 18px rgba(0,0,0,.35); --e-2:0 18px 48px rgba(0,0,0,.5);
  --scrim:linear-gradient(180deg,rgba(0,0,0,0) 40%,rgba(10,7,9,.86) 100%);
  --ll-focus-ink:var(--n-text);
  --telha-link:#F2B49B; --jardim-link:#9FD8B3; --accent-link:var(--n-accent-text);
  /* section accent, re-tuned for night (default: Telha) */
  --n-accent-surface:#B8553A; --n-accent-text:#F2B49B; --n-accent-line:#B8553A;
  --n-accent-soft-surface:#33201B; --n-accent-soft-text:#F2B49B; --n-accent-soft-line:#B8553A;
  --n-accent-deep-surface:#2C1A15; --n-accent-deep-text:#F2B49B; --n-accent-deep-line:#B8553A;
  --n-accent-on-dark-surface:#33201B; --n-accent-on-dark-text:#F2B49B; --n-accent-on-dark-line:#F2B49B;
  background:var(--n-0);
}
:root[data-ll-theme="dark"] body{--accent-link:var(--n-accent-text);--n-accent-link-text:var(--n-accent-text);--n-accent-link-surface:var(--n-accent-surface);--n-accent-link-line:var(--n-accent-line)}
:root[data-ll-theme="dark"] body[data-section="neighbourhoods"]{--n-accent-surface:#2F7D50;--n-accent-text:#9FD8B3;--n-accent-line:#2F7D50;--n-accent-soft-surface:#17291F;--n-accent-soft-text:#9FD8B3;--n-accent-soft-line:#2F7D50;--n-accent-deep-surface:#13241A;--n-accent-deep-text:#9FD8B3;--n-accent-deep-line:#2F7D50;--n-accent-on-dark-surface:#17291F;--n-accent-on-dark-text:#9FD8B3;--n-accent-on-dark-line:#9FD8B3}
:root[data-ll-theme="dark"] body[data-section="events"]{--n-accent-surface:#7356A8;--n-accent-text:#CDB8F2;--n-accent-line:#7356A8;--n-accent-soft-surface:#251F33;--n-accent-soft-text:#CDB8F2;--n-accent-soft-line:#7356A8;--n-accent-deep-surface:#211A2E;--n-accent-deep-text:#CDB8F2;--n-accent-deep-line:#7356A8;--n-accent-on-dark-surface:#251F33;--n-accent-on-dark-text:#CDB8F2;--n-accent-on-dark-line:#CDB8F2}
:root[data-ll-theme="dark"] body[data-section="wine"]{--n-accent-surface:#9A3A57;--n-accent-text:#F2AEC2;--n-accent-line:#9A3A57;--n-accent-soft-surface:#301A22;--n-accent-soft-text:#F2AEC2;--n-accent-soft-line:#9A3A57;--n-accent-deep-surface:#2A161D;--n-accent-deep-text:#F2AEC2;--n-accent-deep-line:#9A3A57;--n-accent-on-dark-surface:#301A22;--n-accent-on-dark-text:#F2AEC2;--n-accent-on-dark-line:#F2AEC2}
:root[data-ll-theme="dark"] body[data-section="plan"]{--n-accent-surface:#3F6FC4;--n-accent-text:#A9C8FA;--n-accent-line:#3F6FC4;--n-accent-soft-surface:#19233A;--n-accent-soft-text:#A9C8FA;--n-accent-soft-line:#3F6FC4;--n-accent-deep-surface:#162036;--n-accent-deep-text:#A9C8FA;--n-accent-deep-line:#3F6FC4;--n-accent-on-dark-surface:#19233A;--n-accent-on-dark-text:#A9C8FA;--n-accent-on-dark-line:#A9C8FA}
:root[data-ll-theme="dark"] body[data-section="stay"]{--n-accent-surface:#A94A68;--n-accent-text:#F4B3C7;--n-accent-line:#A94A68;--n-accent-soft-surface:#311B25;--n-accent-soft-text:#F4B3C7;--n-accent-soft-line:#A94A68;--n-accent-deep-surface:#2B1720;--n-accent-deep-text:#F4B3C7;--n-accent-deep-line:#A94A68;--n-accent-on-dark-surface:#311B25;--n-accent-on-dark-text:#F4B3C7;--n-accent-on-dark-line:#F4B3C7}

/* ---------- base ---------- */
:root[data-ll-theme="dark"] body{background-color:var(--n-0);color:var(--n-text)}
:root[data-ll-theme="dark"] ::selection{background:#3F6FC4;color:#fff}
:root[data-ll-theme="dark"] :focus-visible{outline-color:var(--n-focus)!important}
:root[data-ll-theme="dark"] ::placeholder{color:var(--n-muted);opacity:1}
:root[data-ll-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){color-scheme:dark}
:root[data-ll-theme="dark"] hr{border-color:var(--n-line)}

/* Photos: never inverted. Decorative photos are dimmed a touch so they sit in the night. */
:root[data-ll-theme="dark"] img[alt=""]:not([src$=".svg"]):not([data-ll-keep-bright]){filter:brightness(.9)}
:root[data-ll-theme="dark"] picture>img{filter:brightness(.92)}
:root[data-ll-theme="dark"] img[src$=".svg"][src*="/brand/"]{filter:none}

/* The yellow "now" bar: a warm amber band instead of a glare at night. */
:root[data-ll-theme="dark"] .ll-now{background:var(--n-now)!important;color:var(--n-sol-text)!important;border-bottom-color:#4A3C1E!important}
:root[data-ll-theme="dark"] .ll-now :is(a,strong,span,time,b){color:inherit}

/* ---------- theme switch (header utilities + display preferences) ---------- */
.ll-theme-switch{position:relative;display:inline-flex;flex:none}
.ll-theme-switch--mobile{display:none}
@media(max-width:900px){.ll-theme-switch--mobile{display:inline-flex}.ll-theme-switch--desktop{display:none}}
.ll-theme-switch>button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;margin:0;border:0;border-radius:10px;background:transparent;color:inherit;cursor:pointer}
.ll-theme-switch>button:hover{background:color-mix(in srgb,currentColor 10%,transparent)}
.ll-theme-switch svg{width:22px;height:22px}
.ll-theme-menu{position:absolute;top:calc(100% + 6px);right:0;z-index:60;display:grid;gap:2px;min-width:210px;white-space:nowrap;padding:6px;margin:0;border:1px solid var(--line,#E2D8CA);border-radius:14px;background:var(--white,#fff);color:var(--ink,#221A20);box-shadow:0 18px 48px rgba(34,26,32,.18);list-style:none}
.ll-theme-menu[hidden]{display:none}
.ll-theme-menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px 12px;border:0;border-radius:10px;background:transparent;color:inherit;font:600 15px/1.2 var(--font-body);text-align:left;cursor:pointer}
.ll-theme-menu button:hover{background:var(--cal-2,#EFE8DD)}
.ll-theme-menu button[aria-checked=true]{background:var(--selected-soft-bg);color:var(--selected-soft-fg)}
.ll-theme-menu button[aria-checked=true]::after{content:"";margin-left:auto;width:8px;height:8px;border-radius:50%;background:currentColor}
.ll-theme-menu svg{width:18px;height:18px;flex:none}
:root[data-ll-theme="dark"] .ll-theme-menu{background:var(--n-3);color:var(--n-text);border-color:var(--n-line-2);box-shadow:0 18px 48px rgba(0,0,0,.55)}
:root[data-ll-theme="dark"] .ll-theme-menu button:hover{background:#40373C}
:root[data-ll-theme="dark"] .ll-theme-menu button[aria-checked=true]{background:var(--selected-soft-bg);color:var(--selected-soft-fg)}
.ll-theme-picker{display:grid;gap:10px;margin:0 0 20px;padding:0;border:0}
.ll-theme-picker legend{padding:0;margin-bottom:6px;font-weight:700}
.ll-theme-picker>div{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.ll-theme-picker label{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:8px 10px;border:1.5px solid var(--line-2,#CFC2B2);border-radius:14px;font-weight:700;cursor:pointer}
.ll-theme-picker input{position:absolute;opacity:0;width:1px;height:1px}
.ll-theme-picker label:has(input:checked){border-color:var(--selected-soft-fg);background:var(--selected-soft-bg);color:var(--selected-soft-fg)}
.ll-theme-picker label:has(input:focus-visible){outline:3px solid var(--azulejo,#1F5FBF);outline-offset:2px}
:root[data-ll-theme="dark"] .ll-theme-picker label{border-color:var(--n-line-2)}
:root[data-ll-theme="dark"] .ll-theme-picker label:has(input:checked){border-color:var(--selected-soft-fg);background:var(--selected-soft-bg);color:var(--selected-soft-fg)}
:root[data-ll-theme="dark"] .ll-theme-picker label:has(input:focus-visible){outline-color:var(--n-focus)}
@media (prefers-reduced-motion:no-preference){:root[data-ll-theme-ready] body{transition:background-color .2s ease,color .2s ease}}

/* Home: the day-cycle hero keeps the real sky, softened; its words follow the night palette. */
:root[data-ll-theme="dark"] .ll-live-hero{--lh-ink:var(--n-text)!important;--lh-accent:#F2B49B!important}
:root[data-ll-theme="dark"] .ll-live-hero svg{filter:brightness(.86) saturate(.9)}

/* Inline SVG diagrams and overview maps: their light-paper colours are attributes,
   so they are re-tuned here (photos and the home sky illustration are left alone). */
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) :is([fill="#EFE9DD" i],[fill="#EFE8DD" i],[fill="#F4F1EB" i],[fill="#F7F3EC" i],[fill="#FFF4D4" i]){fill:var(--n-2)}
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) :is([stroke="#E2D8CA" i],[stroke="#CFC2B2" i],[stroke="#E6D3B2" i],[stroke="#F5DEC2" i]){stroke:var(--n-line-2)}
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) :is([fill="#5E5258" i]){fill:var(--n-muted)}
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) :is([stroke="#5E5258" i]){stroke:var(--n-muted)}
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) :is(text[fill="#221A20" i],[stroke="#221A20" i]){fill:var(--n-text);stroke:var(--n-text)}
:root[data-ll-theme="dark"] :is(main,dialog) svg:not(.ll-live-hero svg,[data-ll-no-theme] svg) text[stroke="#221A20" i]{stroke:none}
/* Static map previews are pictures of the light map; soften them so they do not glow. */
:root[data-ll-theme="dark"] img[src*="/map-thumbnails/"],:root[data-ll-theme="dark"] img[src*="/map-previews/"]{filter:brightness(.78) contrast(1.05)}
