/* Component-level styles. Most Bootstrap classes are used directly in components;
   only Koorda-specific atoms (wordmark, code pill, eyebrow) live here. */

.koorda-wordmark {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  font-size: var(--text-xl);
  color: var(--color-fg);
  display: inline-flex;
  align-items: center;
  text-transform: lowercase; /* the logo writes « koorda. » */
}
.koorda-wordmark .dot {
  color: var(--color-accent);
}
/* The symbol before the word (brand/logo). */
.koorda-wordmark .koorda-symbole {
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.4em;
  flex: none;
}

/* Eyebrow label — same shape Bootstrap doesn't ship. */
.koorda-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

/* Koorda code coloration applied on top of font-monospace. */
.koorda-code-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.koorda-code-pill .domain {
  color: var(--color-brand);
}
.koorda-code-pill .sep {
  color: var(--color-accent);
}
.koorda-code-pill .cell {
  color: var(--color-fg);
}

/* MapLibre's controls — slight visual harmonisation with Bootstrap. */
.maplibregl-ctrl-group {
  box-shadow: 0 2px 6px rgba(14, 15, 18, 0.06) !important;
  border-radius: var(--radius-md) !important;
}
.maplibregl-ctrl-attrib {
  font-size: 11px;
}

/* The bottom-right corner holds three things and they are stacked in the
   order somebody reaches for them: the buttons within a thumb's reach of the
   corner, the attribution — a licence condition, not decoration — under them.
   `column-reverse` because MapLibre appends the attribution first and the
   controls after it, and a stack that put the credit line above the buttons
   would read as a caption for them. */
.maplibregl-ctrl-bottom-right {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
}

/* A button somebody presses while holding a phone one-handed. MapLibre's own
   size is 29px, which is under every touch-target guideline there is and
   under what a thumb actually hits on a bus. */
.maplibregl-ctrl-group button {
  width: 36px !important;
  height: 36px !important;
}

/* ============ Koorda Loader ============
   Branded loader. The picto rotates continuously while a forest aura pulses
   behind it. Two synchronised keyframes give the impression of a slow,
   confident heartbeat rather than a generic spinner. */
.koorda-loader__halo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.koorda-loader__halo::before,
.koorda-loader__halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--koorda-moss) 35%, transparent) 0%,
    transparent 70%
  );
  animation: koordaPulse 1.6s var(--ease-out, ease) infinite;
}
.koorda-loader__halo::after {
  animation-delay: 0.8s;
}
.koorda-loader__picto {
  position: relative;
  z-index: 1;
  animation:
    koordaSpin 2s linear infinite,
    koordaBreathe 1.6s var(--ease-out, ease) infinite;
  transform-origin: center;
}
.koorda-loader__label {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

@keyframes koordaSpin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes koordaBreathe {
  0%,
  100% {
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    filter: drop-shadow(
      0 2px 6px color-mix(in srgb, var(--koorda-forest) 40%, transparent)
    );
  }
}
@keyframes koordaPulse {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .koorda-loader__picto,
  .koorda-loader__halo::before,
  .koorda-loader__halo::after {
    animation: none;
  }
}

/* =================================================================
   THE APPLICATION — the map is the page
   There is one page in this product. The rail on the left is a
   reading of the frame, the sheet on the right is the detail of
   whatever is selected, and both float on the map rather than
   taking a share of it: a map cut down to a column is a map you
   cannot read, and this one is the whole point.
   ================================================================= */

.koorda-app {
  /* The rail's width, named once. The ground switcher centres itself in the
     map left over beside the rail, and would drift under it the day this
     number changed in one place only. */
  --rail-width: min(360px, calc(100vw - var(--dock-width) - var(--space-8)));
  /* Everything the panels take on the left, which is what the ground switcher
     measures from. */
  --panels-left: calc(var(--dock-width) + var(--rail-width) + var(--space-4) * 2);
  /* What the dock takes on the left. The rail sits beside it and the map's
     furniture measures from the far side of both. */
  --dock-width: 76px;
  /* What the dock takes on a phone, where it lies along the bottom edge. */
  --dock-height: 60px;
  position: relative;
  /* `dvh`, not `vh`: a phone browser's address bar retracts as you scroll,
     and `vh` measures the viewport as if it never does — the bottom sheet
     ends up cut off by a bar that is no longer there. */
  height: 100dvh;
  overflow: hidden;
}

.koorda-app__map {
  position: absolute;
  inset: 0;
}

.koorda-app__map .map-container {
  width: 100%;
  height: 100%;
}

/* --- the rail: what the frame holds ------------------------------ */

.koorda-rail {
  /* Rows are buttons; dragging across them should not paint a selection. */
  user-select: none;
  position: absolute;
  z-index: 3;
  top: var(--space-4);
  /* Beside the dock, never under it. */
  left: calc(var(--dock-width) + var(--space-4) * 2);
  bottom: var(--space-4);
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  /* Square but for one corner: the rail reads as a tag pinned to the map. */
  border-radius: var(--radius-sm) var(--radius-sm) var(--radius-sm)
    var(--radius-xl);
}

.koorda-rail__top {
  flex: none;
}

.koorda-rail__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.rail-head {
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.rail-head__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.rail-head__signin {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.rail-head__signin:hover {
  border-bottom-color: var(--color-accent);
}

.rail-head__lede {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-fg);
}

.rail-count {
  margin: var(--space-2) 0 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

.rail-filters {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.rail-filters__search {
  width: 100%;
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--color-border-strong);
  border-radius: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-fg);
}

.rail-filters__search::placeholder {
  color: var(--color-fg-muted);
}

.rail-filters__search:focus {
  outline: none;
  border-bottom-color: var(--color-accent);
}

/* One line, scrolled sideways. Wrapping eleven categories cost four rows of
   the rail — space the list needs more than the filter does. */
.chip-row {
  display: flex;
  gap: var(--space-1);
  margin-top: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 88%, transparent);
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  white-space: nowrap;
}

.chip {
  padding: 3px var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--color-fg-muted);
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out);
}

.chip:hover {
  color: var(--color-fg);
}

.chip--active {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.rail-list {
  padding: var(--space-2) var(--space-3) var(--space-4);
  margin: 0;
}

.rail-empty {
  padding: var(--space-8) var(--space-4);
  margin: 0;
  text-align: center;
  color: var(--color-fg-muted);
  font-size: var(--text-sm);
}



/* How the journey was made, printed beside how long it took — the figure is
   only checkable with the mode next to it. */
.route-mode {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

/* The ways of getting there, as a list of decisions. Each row is a radio
   wearing a card: the chosen one is marked, the others are offers. */
.route-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.route-option {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.route-option:hover {
  border-color: var(--color-border-strong);
}

/* The chosen one carries the accent. Blue is the line's alone, on the map:
   the interface keeps the site's own colours. */
.route-option--chosen {
  border-color: var(--color-accent);
  background: var(--color-bg-alt);
}

.route-option__time {
  font-size: var(--text-md);
  color: var(--color-fg);
}

.route-option__distance {
  color: var(--color-fg-muted);
}

.route-option__gap {
  margin-left: auto;
  color: var(--color-fg-muted);
}

/* The part of the journey nobody drives: the walk between an address and the
   road its route runs on. Set apart from the note below it, because it is an
   instruction rather than a remark — somebody has to act on it. */
.route-access {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--color-accent);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-fg);
}

.route-option--chosen .route-option__gap {
  color: var(--color-accent-text);
}

@media (prefers-reduced-motion: reduce) {
  .route-option {
    transition: none;
  }
}

/* --- a tool over the rail ---------------------------------------- */

/* Over it, not beside it. There is nowhere else for it to go: the map is the
   page and the rail is the only column. Covering the list is honest — while
   you are choosing a destination, what is in the frame is not what you are
   reading. */


.koorda-panel__back {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-fg-muted);
  text-align: left;
  cursor: pointer;
}

.koorda-panel__back:hover {
  color: var(--color-brand);
}

/* --- signing in: one narrow column ------------------------------- */

/* Every `allauth` page — sign in, sign up, confirm an address, reset a
   password — lands in this column. Narrow on purpose: a form of two fields
   stretched across a 1500-pixel window reads as a page that has lost its
   layout, which is what it was.

   Set on `main` through `main_class` rather than as a wrapper inside a
   `content` block: `allauth`'s pages fill `content` themselves, so a
   container written there is replaced by theirs and disappears. */
/* One column, centred, and everything in it stacked. Laid out as a row — the
   first attempt — the title, the sentence under it and the form sat side by
   side in three columns, which is not a sign-in page, it is three fragments
   of one. */
.auth-shell {
  display: block;
  max-width: 26rem;
  margin: 0 auto;
  padding: var(--space-10) var(--space-4) var(--space-12);
}

/* The card. It gives the form an edge to sit against, which is what makes it
   read as one thing to fill in rather than as loose furniture on a page. */
.auth-shell form {
  margin-top: var(--space-5);
  padding: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.auth-shell h1 {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
  color: var(--color-brand);
}

/* The sentence under the title — "no account yet? register" — is a way in for
   somebody who took the wrong door, not part of the form. */
.auth-shell > p {
  margin: 0;
  color: var(--color-fg-muted);
  font-size: var(--text-sm);
}

/* Bootstrap's `.form-control` is the input everywhere else in this product;
   allauth renders bare inputs, so they are given the same shape here rather
   than a second look nobody chose. */
.auth-shell input:not([type="checkbox"]):not([type="radio"]) {
  display: block;
  width: 100%;
  margin-bottom: var(--space-3);
  padding: 10px 12px;
  font: inherit;
  color: var(--color-fg);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
}

.auth-shell input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.auth-shell button[type="submit"] {
  width: 100%;
  margin-top: var(--space-4);
}

/* The links under the form — forgotten password, sign up instead — are a way
   out, not a second call to action. */
.auth-shell a {
  color: var(--color-brand);
}

/* --- what the ground is doing ------------------------------------ */

/* The catalogue is worldwide and its zones arrive as people look at them, so
   a reader who pans onto one we do not hold yet gets blank ground for a
   moment. A blank map that says nothing is indistinguishable from a broken
   one, and the difference matters: one is worth waiting four seconds for.

   Top centre of the map, over everything, small. It is a status line, not an
   announcement — it appears rarely and leaves on its own. */
.map-notice {
  position: absolute;
  z-index: 5;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
}

/* On a phone the rail's head owns the top of the screen, so it sits under it
   rather than over the search box. */
@media (max-width: 768px) {
  .map-notice {
    top: calc(var(--space-4) + 96px);
  }
}

/* --- the card over a marker --------------------------------------- */

/* Tapping a pin used to open the panel beside the map: the answer to "what is
   this" appeared somewhere other than where the finger was, and what appeared
   was a name in large type and nothing else. This says what the place is,
   what it is called, when it is open and how to ring it — where it was
   asked. */
.place-card .maplibregl-popup-content {
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
}

/* The tail, on whichever side the card ended up. MapLibre flips the anchor
   to keep a card on screen, and colouring only two sides leaves the card
   floating with nothing saying which pin it belongs to — which is the one
   thing a card over a marker has to say. */
.place-card .maplibregl-popup-tip {
  border-top-color: var(--color-bg);
  border-right-color: var(--color-bg);
  border-bottom-color: var(--color-bg);
  border-left-color: var(--color-bg);
}

.place-card .maplibregl-popup-close-button {
  padding: 0 var(--space-2);
  color: var(--color-fg-muted);
  font-size: var(--text-lg);
  line-height: 1;
}

.place-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.place-card__head {
  padding-right: var(--space-4); /* clear of the close button */
}

/* The kind of place, before its name. Small and quiet: it is what tells
   somebody whether to keep reading, not what they came for. */
.place-card__kind {
  margin: 0 0 2px;
  color: var(--color-fg-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The name, at a size a card can hold. The panel's own heading is display
   type meant to open a page; the same face at the same size inside a 280 px
   card is what made a marker's answer look like a poster. */
.place-card__name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
}

.place-card__lead {
  margin: 0;
  color: var(--color-fg);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.place-card__fact {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  margin: 0;
  color: var(--color-fg-muted);
  font-size: var(--text-sm);
}

.place-card__fact i {
  flex: 0 0 auto;
  color: var(--color-fg-subtle, var(--color-fg-muted));
}

.place-card__fact a {
  color: inherit;
}

.place-card__rating i {
  color: var(--color-brand);
}

/* The way out of the card and into the panel, where there is room for the
   photographs, the reviews and the whole description. */
.place-card__more {
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-fg);
  font-size: var(--text-sm);
  cursor: pointer;
}

.place-card__more:hover {
  background: var(--color-bg-subtle, transparent);
}

/* --- choosing an end of a journey -------------------------------- */

/* A mode you cannot see is what the two sheet buttons were, and they were
   unusable. This one is stated three times over, which is not too many for a
   state that changes what a tap does: the map wears a crosshair, the field
   that will receive the answer is outlined, and the form says in words which
   end is being chosen. */
.map-container--picking .maplibregl-canvas-container,
.map-container--picking .maplibregl-canvas {
  cursor: crosshair;
}

.route-field--picking {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand) 22%, transparent);
}

/* The no-JavaScript button, once the script has taken over.
   `hidden` alone does not do it: the block carries Bootstrap's `d-grid`,
   which is `display: grid !important` and outranks the attribute. The button
   stayed on screen doing what had already happened — which is a button
   somebody presses and then wonders about. */
#route-submit[hidden] {
  display: none !important;
}

/* Where the form says what is happening: waiting for a touch, or looking for
   a road. One place, because they are answers to the same question and a
   reader who has just touched the map is already looking at it. */
.route-status:empty {
  display: none;
}

.route-working {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
  color: var(--color-fg-muted);
  font-size: var(--text-sm);
}

/* The sentence, under the two fields and above everything else in the form —
   where the eye already is, having just touched one of them. */
.route-picking {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-brand) 10%, transparent);
  color: var(--color-fg);
  font-size: var(--text-sm);
}

/* --- the dock: what can be done, always in sight ------------------ */

/* A column of icons on the left edge, before the panel — the shape Google
   Maps, Figma and every editor with more than three tools has settled on.

   It replaced a row of three actions at the *bottom of a scrolling list*,
   which is how "Emprise" could exist for a week without being findable. The
   dock costs 76 pixels of a screen and is never scrolled past.

   Labels under the icons rather than tooltips: a pentagon means nothing to
   somebody who has not been told what it does, and a product shown to people
   who have never seen it cannot rely on hovering. */
.koorda-dock {
  position: absolute;
  z-index: 5;
  top: var(--space-4);
  bottom: var(--space-4);
  left: var(--space-4);
  width: var(--dock-width);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: var(--space-2) 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl) var(--radius-sm) var(--radius-sm)
    var(--radius-xl);
  overflow-y: auto;
  scrollbar-width: none;
}

.koorda-dock::-webkit-scrollbar {
  display: none;
}

.koorda-dock__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-bottom: var(--space-2);
  font-family: var(--font-display, var(--font-sans));
  font-size: 22px;
  font-weight: 700;
  color: var(--color-brand);
  text-decoration: none;
}

.koorda-dock__item {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: var(--space-2) 2px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  /* 11 px is the floor for a label that is also the only name a button has
     to somebody who does not read its icon. */
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  color: var(--color-fg-muted);
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.koorda-dock__item i {
  font-size: 1.15rem;
}

.koorda-dock__item:hover {
  background: var(--color-bg-alt);
  color: var(--color-brand);
}

/* The one showing, named in colour rather than filled: the dock sits on the
   page's own paper, and a filled block would read as a button waiting to be
   pressed rather than as where you already are. */
.koorda-dock__item--on {
  color: var(--color-brand);
  background: var(--color-bg-alt);
}

/* Pushed to the bottom edge. Who you are is not a tool. */
.koorda-dock__item--foot {
  margin-top: auto;
}

/* --- the one panel, over the list ------------------------------- */

/* A place, a point, an itinerary, a shape being drawn: all of them here, one
   at a time, over the list of what the frame holds.

   It used to be two — a tool on the left and a detail card on the right — and
   the two of them left 259 pixels of map on a 1075-pixel window, with the
   map's own zoom buttons behind the card. Two columns describing a subject
   that has none left is not a layout, it is a page arguing with itself. */
/* The box the list and the panel share. The panel covers the list, never the
   search above it. */
.koorda-rail__stack {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.koorda-rail__panel {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-radius: inherit;
}

/* The list stays laid out under an open panel (going back to it keeps its
   scroll), but out of sight and out of reach: it was still read aloud and
   still took the Tab key behind the panel that covered it. */
.koorda-rail:has(.koorda-rail__panel:not([hidden])) .koorda-rail__body {
  visibility: hidden;
}

.koorda-rail__panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5);
}

/* The height handle. Only ever on a narrow screen, where the panel rises from
   the bottom edge and how much of the map it covers is the reader's choice. */
.koorda-rail__grip {
  display: none;
}

.sheet-flag {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding: var(--space-2) var(--space-3);
  border-left: 2px solid var(--color-brand-soft);
  background: var(--color-bg-alt);
  font-size: var(--text-sm);
  color: var(--color-brand);
}

.sheet-near {
  margin: var(--space-4) 0 0;
  font-size: var(--text-sm);
  color: var(--color-fg);
}

.sheet-near a {
  color: var(--color-brand);
  text-decoration: none;
  border-bottom: 1px solid var(--color-accent);
}

/* What you can do with the thing on the sheet. A row of equals: none of them
   is the obvious next step, because which one is depends entirely on why
   somebody touched the map. */
.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.sheet-actions__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-fg);
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.sheet-actions__item:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-fg-inverse);
}

/* The clipboard said yes. A code is made to be sent, and the whole reason
   this button exists is that retyping one is where it gets sent wrong — so
   the confirmation has to be visible, not assumed. */
.sheet-actions__item--done {
  background: var(--color-brand-soft);
  border-color: var(--color-brand-soft);
  color: var(--color-fg-inverse);
}

/* --- one addressed place ---------------------------------------- */

.place-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-2);
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.place-row:last-child {
  border-bottom: 0;
}

.place-row:hover {
  background: var(--color-bg-alt);
}

.place-row--selected {
  background: var(--color-bg-alt);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.place-row__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.place-row__name {
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--color-fg);
  overflow-wrap: anywhere;
}

.place-row__kind {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
}

/* --- the signature: a code, set as the address it is -------------- */

.code-mark {
  display: inline-flex;
  align-items: stretch;
  flex: none;
  font-family: var(--font-mono);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-mono);
  /* A code never breaks across lines: half an address is not an address. */
  white-space: nowrap;
}

.code-mark__domain {
  padding: 2px var(--space-2);
  background: var(--color-brand);
  color: var(--koorda-sand);
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
}

.code-mark__cell {
  padding: 2px var(--space-2);
  background: var(--koorda-sand);
  color: var(--color-fg);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.code-mark--sm {
  font-size: var(--text-xs);
}

.code-mark--lg {
  font-size: var(--text-lg);
}

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

/* --- one column, on a phone --------------------------------------
   The same three regions, stacked the way every map application on a
   phone stacks them: the search at the top, what is in the frame
   rising from the bottom, and the detail of one thing over both.
   Nobody has to learn this layout — that is the entire reason it is
   this layout.
   ----------------------------------------------------------------- */

@media (max-width: 768px) {
  /* The rail stops being a box and becomes the space its parts are
     positioned in. Transparent and untouchable, so the map underneath keeps
     every gesture that is not aimed at one of the parts. */
  .koorda-rail {
    inset: 0;
    width: auto;
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    pointer-events: none;
    display: block;
  }

  .koorda-rail__top,
  .koorda-rail__body,
  .koorda-rail__panel {
    pointer-events: auto;
  }

  /* The dock lies along the bottom edge, the way a phone application's
     navigation does — a column of icons down the side of a 390-pixel screen
     would take a sixth of it and leave the map a letterbox. */
  .koorda-dock {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--dock-height);
    flex-direction: row;
    align-items: stretch;
    padding: 4px var(--space-1);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    overflow-x: auto;
  }

  .koorda-dock__brand {
    display: none;
  }

  .koorda-dock__item {
    flex: 1 0 auto;
    min-width: 60px;
  }

  /* Nothing is pushed anywhere: a row reads left to right and the account is
     simply last. */
  .koorda-dock__item--foot {
    margin-top: 0;
  }


  .koorda-rail__top {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  /* The lede is a sentence for a column that has room for one. Here it costs
     a line of the map to say what the list below it already shows. */
  .rail-head__lede {
    display: none;
  }

  .koorda-rail__body {
    position: absolute;
    left: 0;
    right: 0;
    /* Clear of the dock, which owns the very bottom edge here. */
    bottom: var(--dock-height);
    max-height: 38dvh;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
  }

  /* The panel rises from the bottom, over everything, and how far it rises is
     the reader's to choose: a phone screen is one column, and the map and what
     is being read are competing for it. `data-height` is set by the grip. */
  .koorda-rail__panel {
    position: fixed;
    inset: auto 0 var(--dock-height) 0;
    width: 100%;
    height: 55dvh;
    padding-top: var(--space-6);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-lg);
    transition: height var(--duration-base) var(--ease-out);
  }

  .koorda-rail__panel[data-height="peek"] {
    height: 24dvh;
  }

  .koorda-rail__panel[data-height="half"] {
    height: 55dvh;
  }

  .koorda-rail__panel[data-height="full"] {
    height: 92dvh;
  }

  .koorda-rail__grip {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /* A wide, invisible target over a narrow, visible bar: the bar says where
       to press and the target is what a thumb actually hits. */
    height: var(--space-5);
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .koorda-rail__grip::after {
    content: "";
    position: absolute;
    top: var(--space-2);
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
  }
}

@media (prefers-reduced-motion: reduce) {
  .koorda-rail__panel {
    transition: none;
  }
}

/* --- category glyphs -------------------------------------------- */

.place-row__kind i,
.chip i {
  margin-right: 5px;
  font-size: 11px;
  /* Optical: Bootstrap Icons sit slightly high next to uppercase mono. */
  vertical-align: -1px;
}

.place-row__kind {
  /* One line, whatever the kind is called: « Pôle de transport » wrapped
     under the code and made its row taller than its neighbours. */
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chip {
  display: inline-flex;
  align-items: center;
}

/* --- which ground the information sits on ------------------------ */

/* Resting on the map's bottom edge, against the rail rather than centred.

   Centring was tried and it loses: the free ground between the rail and an
   open sheet is a moving target, and a strip centred in it drifted onto the
   zoom buttons — measured at 102x64 of overlap, then 70x64 after a first
   correction. Anchored to the left of that free ground, the bottom edge reads
   left to right in a fixed order: grounds, then a gap, then the controls, and
   the attribution under them.

   Clear of MapLibre's attribution, which keeps the corner it is in: naming the
   tile publisher is a licence condition for all four sources, not decoration
   to sit on top of. */
.map-basemap {
  position: absolute;
  z-index: 4;
  bottom: var(--space-6);
  left: calc(var(--panels-left, 0px) + var(--space-4));
  /* Never wider than the ground actually left. Past that it scrolls sideways
     rather than climbing over the buttons: the controls are how the map is
     moved and never yield; the ground is a choice of decor and yields first. */
  max-width: calc(
    100% - var(--panels-left, 0px) - var(--space-8) - 88px
  );
  transition:
    left var(--duration-base) var(--ease-out),
    max-width var(--duration-base) var(--ease-out);
}

.basemap-switcher {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  /* A screen narrower than the four scrolls them sideways. Wrapping would
     grow a second row upward into the map, which is what the strip is
     floating over in order not to take. */
  overflow-x: auto;
  scrollbar-width: none;
}

.basemap-switcher::-webkit-scrollbar {
  display: none;
}

/* A tile: what the ground looks like, with its name under it. */
.basemap-switcher__option {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  width: 66px;
  padding: var(--space-1);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1;
  color: var(--color-fg-muted);
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out);
}

.basemap-switcher__option:hover {
  background: var(--color-bg-alt);
  color: var(--color-fg);
}

.basemap-switcher__option:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* The one showing is named in the text and ringed on the swatch, rather than
   filled in brand green: the swatch has to keep showing its own ground, which
   is the only thing on the tile that says what it is. */
.basemap-switcher__option--active {
  color: var(--color-brand);
}

.basemap-switcher__option--active .basemap-switcher__chip {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px var(--color-brand);
}

/* A swatch of what the ground looks like, rather than a fetched preview of
   it: four thumbnails would be four requests to foreign hosts before the
   reader has asked for any of them. */
.basemap-switcher__chip {
  flex: none;
  width: 100%;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
}

/* Ours: the charter's paper and its forest, which is what the style draws. */
.basemap-switcher__chip--koorda {
  background: linear-gradient(135deg, var(--koorda-paper) 55%, var(--koorda-moss) 55%);
}

.basemap-switcher__chip--plan {
  background: linear-gradient(135deg, #f2efe9 55%, #cdd9c8 55%);
}

.basemap-switcher__chip--satellite {
  background: linear-gradient(135deg, #3d5240 45%, #1f2d24 45%);
}

.basemap-switcher__chip--topo {
  background: linear-gradient(135deg, #efe4cf 50%, #c9ab7c 50%);
}

@media (prefers-reduced-motion: reduce) {
  .basemap-switcher__option {
    transition: none;
  }
}

/* On a phone the rail is a transparent overlay, so the strip centres on the
   window like everything else — and rises clear of the list sheet and the
   action bar, which own the bottom edge there. */
@media (max-width: 768px) {
  .map-basemap {
    /* No rail column on a phone — the rail is an overlay — so the strip is
       centred on the window again, and rises clear of the list and the dock,
       which own the bottom edge here. */
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(38dvh + var(--dock-height) + var(--space-2));
    max-width: calc(100% - var(--space-4));
    /* Under the rail here, not over it: an open sheet rises past the strip,
       and the strip sat on the sheet's heading. The sheet covers the map;
       the strip is part of the map. */
    z-index: 2;
  }

  .maplibregl-ctrl-bottom-right {
    /* The list sheet and the dock own the bottom edge on a phone, so the
       furniture moves up rather than sideways. */
    margin-bottom: calc(38dvh + var(--dock-height, 60px) + var(--space-4));
  }
}

/* --- what a kind of place looks like ----------------------------- */

/* One row, one decision. The swatch first, at the size a marker is actually
   read at, because the row exists to answer "what will this look like on the
   map" before it offers to change it. */
.appearance-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
}

.appearance-row:last-child {
  border-bottom: 0;
}

.appearance-row__swatch {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--pin-color);
  color: var(--pin-glyph);
  border: 2px solid #fbf8f2;
  box-shadow: var(--shadow-sm);
  font-size: 17px;
}

.appearance-row__logo {
  width: 68%;
  height: 68%;
  object-fit: contain;
  border-radius: var(--radius-pill);
}

.appearance-row__name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Wraps rather than scrolls: the fields are a sentence about one category,
   and a row you have to scroll sideways to finish is a row you finish wrong. */
.appearance-row__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.appearance-row__icon,
.appearance-row__colour {
  width: 9rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.appearance-row__logo-input {
  width: 13rem;
  font-size: var(--text-xs);
}

/* --- an emprise: the outline, its answer, its codes --------------- */

/* The cursor is the only thing that says the map is listening for corners
   once the button has been pressed and the eye has moved to the map.

   `!important` because MapLibre sets `grab` on the same element from its own
   stylesheet, with the same specificity and later in the cascade — so the
   crosshair never appeared, and the one signal that drawing had started was
   missing at exactly the moment somebody looks for it. */
.map-container--drawing .maplibregl-canvas-container,
.map-container--drawing .maplibregl-canvas {
  cursor: crosshair !important;
}

/* While a shape is being traced, the markers stop taking clicks.
   They are DOM elements sitting over the canvas, so a corner dropped on a
   pharmacy opened the pharmacy instead of placing a corner — and on the map
   this product draws, sixty of them cover the part of town somebody most
   wants to draw around. */
.map-container--drawing .maplibregl-marker {
  pointer-events: none;
}

/* The surface, read as one number. It is the first thing asked of a shape and
   it deserves the size of an answer, not of a caption. */
.selection__area {
  font-family: var(--font-sans);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-fg);
}

.selection__stop {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  color: var(--color-fg-muted);
  font-size: var(--text-sm);
}

/* The codes, boxed and scrollable. Hundreds of them is a normal answer, and a
   panel that grew to fit would push the rest of the reading off the screen. */
.selection__codes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  max-height: 12rem;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.selection__code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-fg);
  white-space: nowrap;
}

/* =================================================================
   THE SYSTEM — one panel, one switch, one note.
   Written once here so the map page and Explore are the same object.
   ================================================================= */

.panel {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-tight);
  color: var(--color-fg);
}

.panel__title i {
  color: var(--color-brand);
}

.panel__body {
  padding: var(--space-4);
}

/* A line of explanation, never a boxed alert: the panel is small enough that
   a coloured rectangle inside it shouts. */
.panel__note {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
}

.panel__body > .panel__note:first-child {
  margin-top: 0;
}

.panel__note--warn {
  color: var(--color-danger);
}

.panel__note a {
  color: var(--color-brand);
}

/* --- a switch, written once --------------------------------------- */

.switch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-fg);
  cursor: pointer;
}

.switch input {
  appearance: none;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: var(--radius-pill);
  background: var(--koorda-mist);
  border: 1px solid var(--color-border-strong);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}

.switch input::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 2px;
  border-radius: 50%;
  background: var(--color-bg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--duration-fast) var(--ease-out);
}

.switch input:checked {
  background: var(--color-brand-soft);
  border-color: var(--color-brand);
}

.switch input:checked::after {
  transform: translateX(14px);
}

.switch input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.switch span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* A second switch under the panel's main content, set off from it. */
.switch--divided {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* --- the map page reads as the same product ----------------------- */

.map-page__sidebar {
  background: var(--color-bg-alt);
  border-right: 1px solid var(--color-border);
}

.map-page__sidebar .chip-row {
  margin-top: var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  .switch input,
  .switch input::after {
    transition: none;
  }
}

/* --- what the shopfront says -------------------------------------- */

/* One fact per line, the glyph in its own column so the text of a long
   address wraps under itself rather than under the icon. */
.place-facts__row {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: var(--space-2);
  align-items: start;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-fg);
}

.place-facts__row:last-child {
  border-bottom: 0;
}

.place-facts__row i {
  color: var(--color-fg-muted);
  line-height: 1.5;
}

/* A phone number is dialled, not read: it stays on one line even when the
   column is narrow, which is where it is most likely to be tapped. */
.place-facts__row a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}

.place-facts__row a:hover {
  border-bottom-color: var(--color-brand);
  color: var(--color-brand);
}

/* =========================================================
   The card that opens over a marker.

   Before this, a place could only be read by finding its row in the left
   panel — the map itself answered nothing, and on a phone the panel is not
   even on screen. This is the map answering: name, what it is, how to reach
   it, what people said. Enough to decide, not enough to replace the page.

   Sized so it never covers the marker it belongs to, and never grows past a
   readable measure however long an address turns out to be.
   ========================================================= */

.koorda-popup .maplibregl-popup-content {
  background: var(--color-bg);
  color: var(--color-fg);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0;
  max-width: 17rem;
  overflow: hidden;
}

.koorda-popup .maplibregl-popup-tip {
  border-top-color: var(--color-bg);
  border-bottom-color: var(--color-bg);
}

.koorda-popup .maplibregl-popup-close-button {
  color: var(--color-fg-muted);
  font-size: 1.1rem;
  padding: 0 0.4rem;
}

/* The whole card is the link. A tooltip you have to aim inside of is a
   tooltip people give up on, especially with a thumb. */
.place-card {
  display: block;
  padding: 0.75rem 0.85rem;
  text-decoration: none;
  color: inherit;
}

.place-card:hover,
.place-card:focus-visible {
  background: var(--color-bg-alt);
}

.place-card__name {
  /* Every line of the card is its own block. They are spans because the card
     itself is the <a> and an anchor may not contain block-level flow content
     — so the display has to say what the markup cannot. */
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--color-fg);
}

.place-card__line {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--color-fg-muted);
  margin-top: 0.2rem;
}

/* The code in the family it is always set in, so it is recognisable as a
   code rather than as more prose. */
.place-card__code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  color: var(--color-brand);
  margin-top: 0.35rem;
}

.place-card__rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--color-fg-muted);
  margin-top: 0.35rem;
}

.place-card__stars {
  color: var(--color-accent);
  letter-spacing: 0.06em;
}

.place-card__more {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-top: 0.5rem;
}

/* =========================================================
   A name search result.

   The other half of the search field: a code names one point, a name names a
   handful. Each row is the whole target — a row you have to aim inside of is
   a row people mis-tap, and this list is read on a phone as often as not.
   ========================================================= */

.place-hit + .place-hit {
  border-top: 1px solid var(--color-border);
}

.place-hit__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-2);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
}

.place-hit__link:hover,
.place-hit__link:focus-visible {
  background: var(--color-bg-alt);
}

/* The category's colour, from the same table the markers read. */
.place-hit__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--pin-color) 16%, transparent);
  color: var(--pin-color);
  font-size: 1rem;
}

.place-hit__text {
  flex: 1;
  min-width: 0;
}

.place-hit__name {
  display: block;
  font-weight: 600;
  line-height: 1.3;
}

.place-hit__meta {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
  /* One line: a landmark can be a sentence, and a search result is scanned,
     not read. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The map is listening for a point. The cursor is the only thing that says
   so once the button has been pressed and the eye has moved to the map. */
.map-container--picking .maplibregl-canvas-container {
  cursor: crosshair;
}

/* The name of where a point is, under its code: what makes the code
   something a person can check before trusting it. */
.sheet-locality {
  margin: var(--space-3) 0 0;
  font-size: var(--text-lg);
  color: var(--color-fg);
}

/* The sheet while its answer is on the way: its own shape, not a spinner,
   so the answer lands in place. */
.sheet-skeleton__bar {
  display: block;
  height: 0.9rem;
  margin-top: var(--space-3);
  border-radius: var(--radius-pill);
  background: linear-gradient(
    90deg,
    var(--color-bg-alt) 0%,
    var(--color-border) 50%,
    var(--color-bg-alt) 100%
  );
  background-size: 200% 100%;
  animation: sheet-skeleton 1.2s ease-in-out infinite;
}

.sheet-skeleton__bar--code {
  width: 11rem;
  height: 2.2rem;
}

.sheet-skeleton__bar--line {
  width: 70%;
}

.sheet-skeleton__bar--short {
  width: 45%;
}

@keyframes sheet-skeleton {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-skeleton__bar {
    animation: none;
  }
}

/* --- the landing page -------------------------------------------- */

.home-locate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* A real address, computed when the page is drawn: the product shown by
   using it rather than described. */
.home-example {
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
}

.home-example__place {
  margin: var(--space-3) 0 var(--space-1);
  font-size: var(--text-lg);
  color: var(--color-fg);
}

.home-band {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Each prefix of one code, from the region to the door. The part already
   read is in the brand colour; what is left to read stays faint, so the eye
   follows the code getting longer down the list. */
.code-anatomy__row {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr auto;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}

.code-anatomy__row:last-child {
  border-bottom: 0;
}

.code-anatomy__code {
  font-size: var(--text-lg);
  letter-spacing: 0.04em;
}

.code-anatomy__domain {
  color: var(--color-fg-muted, var(--color-border-strong));
}

.code-anatomy__known {
  color: var(--color-brand);
  font-weight: 600;
}

.code-anatomy__label {
  color: var(--color-fg);
}

.code-anatomy__size {
  color: var(--color-accent-text);
}

.home-steps__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: var(--color-fg-inverse);
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .code-anatomy__row {
    grid-template-columns: 1fr auto;
  }

  .code-anatomy__label {
    grid-column: 1 / -1;
    order: 3;
  }
}


/* --- The turns of a route, and the journey under way ----------------------
   The list is the route panel's; the banner, the bar and the two map buttons
   belong to the guided journey (koorda-guide.js). Only the line on the map
   is blue; everything here wears the site's own colours. */

.route-start {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  justify-content: center;
}

.route-steps summary {
  cursor: pointer;
  color: var(--color-fg-muted);
}

.route-steps__list {
  margin-top: var(--space-2);
}

.route-step {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  align-items: baseline;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-fg);
  text-align: left;
  cursor: pointer;
}

.route-step:hover .route-step__text {
  text-decoration: underline;
}

.route-step__icon {
  color: var(--color-fg-muted);
  font-size: var(--text-md);
}

.route-step__distance {
  color: var(--color-fg-muted);
  white-space: nowrap;
}

/* Recentrer: beside the map's own buttons, left of them, so it never sits
   on them whatever the height of the screen. */
.map-recentre {
  position: absolute;
  right: 3.75rem;
  bottom: var(--space-3);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  color: var(--color-fg);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
}

.map-recentre .bi {
  color: var(--color-fg);
}

.guide-banner {
  position: absolute;
  top: var(--space-3);
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: min(32rem, calc(100% - 2 * var(--space-3)));
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg-inverse);
  color: var(--color-fg-inverse);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.guide-banner p {
  margin: 0;
}

.guide-banner__icon {
  font-size: 2.25rem;
  line-height: 1;
}

.guide-banner__distance {
  font-size: var(--text-lg);
  font-weight: 600;
}

.guide-banner__text {
  font-size: var(--text-md);
}

.guide-bar {
  position: absolute;
  left: 50%;
  bottom: var(--space-4);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: min(32rem, calc(100% - 2 * var(--space-3)));
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.guide-bar__left {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.guide-bar__time {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-fg);
}

.guide-bar__rest {
  color: var(--color-fg-muted);
}

.guide-bar__stop {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* The reader: a dark arrow on a white disc, pointing the way they go. Laid
   flat on the ground and turned by the script. */
.guide-position {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.guide-position svg {
  display: block;
  width: 100%;
  height: 100%;
}

.guide-position circle {
  fill: #fff;
}

.guide-position path {
  fill: var(--color-fg);
}

/* Under way, the screen is the road's: the panel, the rail and the ground
   strip go, the banner and the bar stay. « Arrêter » brings them back. */
.is-guiding .koorda-rail,
.is-guiding .koorda-dock,
.is-guiding .basemap-switcher {
  display: none !important;
}

/* 2D / 3D, under way: a round button on the right, under the banner. */
.guide-view {
  position: absolute;
  top: 6.5rem;
  right: var(--space-3);
  z-index: 4;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-fg);
  box-shadow: var(--shadow-md);
  font-weight: 700;
  font-size: var(--text-sm);
}

/* Fonds, under way: the same round button, under 2D / 3D. It opens the
   ground strip beside it; choosing a ground, or Escape, closes it. */
.guide-ground {
  position: absolute;
  top: calc(6.5rem + 3rem + var(--space-2));
  right: var(--space-3);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-fg);
  box-shadow: var(--shadow-md);
  font-size: var(--text-lg);
}

.guide-ground[aria-expanded="true"] {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 2px var(--color-brand), var(--shadow-md);
}

.guide-ground:focus-visible,
.guide-view:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.is-guiding.is-choosing-ground .basemap-switcher {
  display: flex !important;
}

/* Left of the round buttons, level with Fonds, whatever the screen: the
   rail's column is gone under way, so nothing is measured from it. */
.is-guiding .map-basemap {
  top: calc(6.5rem + 3rem + var(--space-2));
  right: calc(var(--space-3) + 3rem + var(--space-2));
  bottom: auto;
  left: auto;
  z-index: 5;
  transform: none;
  max-width: calc(100% - 3rem - var(--space-3) * 2 - var(--space-2));
}

/* Under way the bar holds the bottom: Recentrer goes above it. */
.is-guiding .map-recentre {
  bottom: 6.5rem;
}

/* « 2D / 3D », with the map's own buttons: same box, a word instead of a
   glyph, because a glyph for "tilt" is one more thing to guess. */
.map-view-control__button {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-fg);
}

/* Under way the guide has its own 2D / 3D button by the banner. */
.is-guiding .map-view-control {
  display: none;
}
