/* finn-finn. One file, no build step.

   A triage tool for two people, so it stays dense: several ads per screen and
   a map that never leaves the viewport. The loud things are the star rating,
   the "Ny i dag" badge, and the coloured rail down the left edge of a card,
   which is the same colour as that ad's pin on the map.

   Numbers are set in a mono face with tabular figures. Rent, area and distance
   are read down a column, not across a sentence. */

:root {
  --paper: #ffffff;
  --sunk: #f3f5f8;
  --bg: #e7ebf0;
  --ink: #0f1620;
  --ink-2: #5a6675;
  --ink-3: #8a95a3;
  --line: #d6dce4;
  --line-2: #e6eaef;

  --accent: #0a55c8;
  --accent-ink: #0a4aa8;
  --accent-soft: #e8f0fd;
  --accent-line: #c3d8f7;

  --up: #14764a;
  --up-soft: #e4f3ea;
  --down: #bf3222;
  --down-soft: #fceae6;
  --new: #0c7a86;
  --new-soft: #e0f3f5;
  --star: #dd9412;
  --star-off: #c4cad3;
  --warn: #b23a1e;

  /* One colour per kind of place. These only ever appear on the detail map and
     in its legend, so they are free to be their own set. */
  --poi-grocery: #b4700c;
  --poi-train: #6a3cb0;
  --poi-bus: #1e7a55;
  --poi-cafe: #8a5230;

  --shadow: 0 1px 2px rgba(16, 26, 40, .06), 0 4px 14px rgba(16, 26, 40, .05);
  --shadow-up: 0 2px 6px rgba(16, 26, 40, .10), 0 12px 28px rgba(16, 26, 40, .10);

  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  --topH: 54px;
  --r: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161c25;
    --sunk: #1c2331;
    --bg: #0d1219;
    --ink: #e7edf5;
    --ink-2: #9aa6b6;
    --ink-3: #6f7c8c;
    --line: #2b3543;
    --line-2: #222b37;

    --accent: #6ea8ff;
    --accent-ink: #a8caff;
    --accent-soft: #16273f;
    --accent-line: #294366;

    --up: #45b783;
    --up-soft: #12291f;
    --down: #f0705f;
    --down-soft: #2d1a17;
    --new: #3fbfcb;
    --new-soft: #102a2d;
    --star: #e8ac3f;
    --star-off: #444e5c;
    --warn: #e2795e;

    --poi-grocery: #d99331;
    --poi-train: #9a72e6;
    --poi-bus: #3fae7d;
    --poi-cafe: #bb8055;

    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-up: 0 8px 26px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

h1 { font-size: 23px; line-height: 1.2; letter-spacing: -.015em; font-weight: 600; margin: 0; }

/* Section headings are labels, not titles. Small and quiet, so the content
   under them is what the eye lands on. */
h2 {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 8px;
}

h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-2);
  margin: 12px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.muted { color: var(--ink-2); font-weight: 400; }

.num, .rent, .scorenum {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.14em;
}

/* Header and filters */

.top {
  position: sticky;
  top: 0;
  z-index: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  min-height: var(--topH);
  padding: 8px 18px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
}

.brand span { color: var(--accent); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  margin-left: auto;
}

.filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.filters select {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 6px;
}

.filters select:hover { border-color: var(--ink-3); }

.filters button, .filters .reset {
  font: inherit;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.filters .reset { color: var(--ink-2); }
.filters button:hover, .filters .reset:hover { border-color: var(--ink-3); }

/* With JavaScript the selects submit themselves, so the button is noise. */
.js .filters .go { display: none; }

/* Page frame: list on the left, map parked on the right */

.page { padding: 14px 18px 40px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 36vw, 560px);
  gap: 16px;
  align-items: start;
}

.detail-split { grid-template-columns: minmax(0, 1fr) clamp(320px, 32vw, 440px); }

/* The list map fills the viewport height and is pinned there: the list is the
   only thing that scrolls on that page. */
.mapcol {
  position: sticky;
  top: calc(var(--topH) + 14px);
  height: calc(100vh - var(--topH) - 28px);
  display: flex;
}

.mapcol .mapbox { flex: 1 1 auto; }

/* The detail sidebar is pinned the same way and scrolls inside itself.
   `.sidecol > * { flex: none }` is the whole point of this block: a flex child
   shrinks by default, so a long "I nærheten" squeezed the map box, and since
   .mapbox hides its overflow the legend and the footer were cut away — on the
   worst ads the map came out at almost nothing. Nothing here shrinks now; the
   column scrolls instead.

   The map then sticks to the top of that scroll, so working down a long list of
   places never pushes the map out of sight. */
.sidecol {
  position: sticky;
  top: calc(var(--topH) + 14px);
  max-height: calc(100vh - var(--topH) - 28px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.sidecol > * { flex: none; }

.sidecol .mapbox {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* Growing to fill the column is only wanted where the column is the viewport
   height, which is the list page and the full-screen map. It is set there, not
   here: as a rule on .mapbox it also applied in the detail sidebar, where it
   let a long "I nærheten" squash the map. */
.mapbox {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map { flex: 1 1 auto; min-height: 260px; background: var(--sunk); }
.sidecol .map { height: 380px; flex: none; }

.mapfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

.mapfoot a { display: inline-flex; align-items: center; gap: 5px; }

.mapbig {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12.5px;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.mapbig:hover { border-color: var(--accent); color: var(--accent); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  padding: 8px 12px;
  list-style: none;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-2);
}

.legend li { display: flex; align-items: center; gap: 5px; }

.key {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .18);
}

.key-none { background: var(--ink-3); }
.key-new { background: var(--new); }
.key-up { background: var(--up); }
.key-down { background: var(--down); }
.key-home { background: var(--accent); }
.key-grocery { background: var(--poi-grocery); }
.key-train { background: var(--poi-train); }
.key-bus { background: var(--poi-bus); }
.key-cafe { background: var(--poi-cafe); }
.key-dot { background: var(--ink-3); position: relative; }
.key-dot::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 50%;
  background: var(--paper);
}

/* List column */

.listbar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.listbar .count { font-weight: 600; color: var(--ink); font-family: var(--mono); }
.listbar .sort a { margin-left: 10px; }
.listbar .sort a.on { color: var(--ink); font-weight: 600; text-decoration: none; }

.cards { display: flex; flex-direction: column; gap: 10px; }

/* Cards */

.card {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px 10px 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .16s ease, border-color .16s ease, opacity .16s ease;
}

/* The rail is the card's link to its pin: same colour, same meaning. */
.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--rail, var(--line));
}

.card[data-status="none"] { --rail: var(--ink-3); }
.card[data-status="new"] { --rail: var(--new); }
.card[data-status="up"] { --rail: var(--up); }
.card[data-status="down"] { --rail: var(--down); }

.card:hover, .card.is-hot {
  box-shadow: var(--shadow-up);
  border-color: var(--accent-line);
}

.card.is-hot { outline: 2px solid var(--accent); outline-offset: -1px; }

/* A thumbs-down card stays in the list when the filter allows it, but steps
   back. Hovering brings it fully back, so undoing is easy. */
.card.is-down { opacity: .55; }
.card.is-down:hover { opacity: 1; }

.card .shot {
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sunk);
  border-radius: 7px;
}

.card .shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.card:hover .shot img { transform: scale(1.03); }

/* Neutral placeholder for an ad with no photo. Never hide such an ad: a hidden
   ad is a missed apartment. */
.noimg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--ink-2);
  font-size: 12px;
}

.noimg::before {
  content: "▤";
  font-size: 26px;
  color: var(--star-off);
}

.card .body { min-width: 0; }

.line1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.line1 h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--ink);
  margin: 0;
}
.line1 h2 a { text-decoration: none; color: inherit; }
.line1 h2 a:hover { color: var(--accent); }

.badge {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 20px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.badge.new { background: var(--new-soft); border-color: var(--new); color: var(--new); }

/* Stars: a grey star with a gold one clipped over it. A half step is exactly
   half the width. Drawn, not typed, so the rating does not depend on which
   symbol font a machine happens to have. */

.rating { display: flex; align-items: center; gap: 8px; margin: 5px 0 3px; }

.stars { display: inline-flex; gap: 1px; }

.star { position: relative; display: inline-block; width: 17px; height: 17px; }

.star i {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 17px 17px;
}

.star .bg {
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon fill='%23c4cad3' points='12,1.5 15.2,8.9 23,9.6 17,14.9 18.8,22.5 12,18.4 5.2,22.5 7,14.9 1,9.6 8.8,8.9'/%3E%3C/svg%3E");
}

.star .fg {
  width: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolygon fill='%23dd9412' points='12,1.5 15.2,8.9 23,9.6 17,14.9 18.8,22.5 12,18.4 5.2,22.5 7,14.9 1,9.6 8.8,8.9'/%3E%3C/svg%3E");
}

.star.full .fg { width: 100%; }
.star.half .fg { width: 50%; }

.scorenum { font-size: 12px; color: var(--ink-2); }

/* Facts, address, tags */

.facts {
  margin: 2px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  font-size: 14px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.facts .rent { font-weight: 500; font-size: 15px; }
.facts span + span { color: var(--ink-2); }

.addr {
  margin: 3px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-2);
}

.addr .ico { color: var(--ink-3); }

/* Only a control once a map exists to point at. app.js adds the class. */
.addr.can-locate { cursor: pointer; width: fit-content; border-radius: 5px; }
.addr.can-locate:hover { color: var(--accent); }
.addr.can-locate:hover .ico { color: var(--accent); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; padding: 0; }

.tags li {
  font-size: 11.5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  border-radius: 20px;
  padding: 2px 9px;
}

.reason { margin: 5px 0; font-size: 13px; max-width: 88ch; }
.snippet { margin: 5px 0; font-size: 12.5px; color: var(--ink-2); max-width: 88ch; }
.warn { margin: 5px 0; font-size: 13px; color: var(--warn); }

.poi {
  margin: 5px 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
}

.poi .ico { color: var(--ink-3); }

/* Transit: one chip per hop. The walk is dashed and quiet, the ride is solid
   and coloured — the walk is the requirement, the ride is what you scan for. */

.transit { display: flex; flex-wrap: wrap; gap: 6px; margin: 5px 0; }

.hop {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.hop.walk { border-style: dashed; color: var(--ink-2); }
.hop.ride {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
  font-weight: 500;
}
.hop.plain { color: var(--ink-2); }

/* Card footer: marks and links */

.cardfoot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions form { display: flex; gap: 6px; margin: 0; }

.mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.2;
  padding: 5px 11px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.mark .ico { font-size: 15px; }
.mark:hover { border-color: var(--ink-3); color: var(--ink); }

.mark.up.on { background: var(--up-soft); border-color: var(--up); color: var(--up); font-weight: 600; }
.mark.down.on { background: var(--down-soft); border-color: var(--down); color: var(--down); font-weight: 600; }
.mark.contacted.on { background: var(--up-soft); border-color: var(--up); color: var(--up); font-weight: 600; }

.links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; font-size: 12px; }
.links a { display: inline-flex; align-items: center; gap: 4px; }

/* Empty states. The class is "emptylist", not "empty": ".empty" also matches
   the empty stars in .star.empty, and boxed every one of them. */

.emptylist {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
  font-size: 14px;
}

.emptylist p { margin: 0 0 6px; }
.emptylist code {
  font-family: var(--mono);
  background: var(--sunk);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}

/* Detail page */

.detail {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px 20px 22px;
  min-width: 0;
}

.detail.is-new { border-top: 3px solid var(--new); }

.detail section { margin-top: 22px; border-top: 1px solid var(--line-2); padding-top: 14px; }

/* The top block: pictures on the left, the facts you decide on to the right of
   them. Only when there are pictures — otherwise the facts take the full width
   rather than sitting in a half-empty grid. */
.adtop.withshots {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.adtop.withshots .gallery { grid-column: 1; grid-row: 1; }
.adtop.withshots .adhead { grid-column: 2; grid-row: 1; }

/* The gallery is a <section>, and .detail section carries a rule above. Inside
   the top block it is a column, not a new part of the page. */
.adtop .gallery { margin-top: 0; border-top: 0; padding-top: 0; }
.adtop.withshots .hero { height: 340px; }
.adtop.withshots .gshot { height: 66px; }

.adhead .line1 { margin-bottom: 4px; }
.adhead .facts { font-size: 15px; margin: 6px 0 2px; }
.adhead .facts .rent { font-size: 18px; font-weight: 600; }
.adhead .actions { margin: 12px 0 10px; }
.adhead .links { color: var(--ink-2); }

/* Gallery: one big image, the rest as a strip. Clicking any of them opens the
   carousel rather than dumping the raw file in a new tab. */

.gallery .hero,
.gallery .gshot {
  display: block;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--sunk);
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
}

/* Whole image, never a crop. Ad photos are a mix of landscape and portrait, and
   filling a wide box with a portrait shot cut the room in half.

   The box is sized by the image rather than the other way round: fixed height,
   width from the photo. That shows all of it without leaving grey bars down
   both sides of every portrait shot. */
.gallery .hero { height: 400px; width: fit-content; max-width: 100%; margin: 0 auto; }
.gallery .hero img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }

.heronote {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(10, 14, 20, .72);
  color: #fff;
  backdrop-filter: blur(4px);
}

.shots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.gallery .gshot { height: 84px; width: auto; }
.gallery .gshot img { height: 100%; width: auto; display: block; }
.gallery .hero:hover, .gallery .gshot:hover { border-color: var(--accent); }

/* Nøkkelinfo: one fact per box, label above value. The old two-column list ran
   twenty rows deep and every value started at a different place. */

.kvs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin: 0 0 6px;
}

.kv {
  background: var(--sunk);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
}

.kv.wide { grid-column: 1 / -1; }

.kv dt {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-2);
}

.kv dd { margin: 3px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.kv.strong { background: var(--accent-soft); border-color: var(--accent-line); }
.kv.strong dd { font-size: 19px; font-weight: 600; }
.kv dd a { display: inline-flex; align-items: center; gap: 5px; }

.description p { margin: 0 0 10px; font-size: 14px; max-width: 68ch; }

/* Trip: a timeline. Walk legs are dimmed, rides carry the weight. */

.legs { list-style: none; margin: 12px 0 0; padding: 0; }

.leg {
  display: grid;
  grid-template-columns: 28px minmax(96px, auto) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
}

.leg + .leg { border-top: 1px dashed var(--line-2); }

.legicon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 15px;
}

.leg.ride .legicon {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-ink);
}

.leg.walk { color: var(--ink-3); font-size: 12.5px; }
.leg.ride .legmode { font-weight: 600; font-size: 13.5px; }
.legmode { display: flex; align-items: center; gap: 6px; }

.legmode .line {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-ink);
  border-radius: 5px;
  padding: 0 6px;
}

.legwhere { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.leg.walk .legwhere { font-size: 12.5px; }
.legmeta { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }

.tripnote { font-size: 12px; margin: 10px 0 0; }

/* Nearby places */

.poilists { display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.poigroup ul { list-style: none; margin: 0; padding: 0; }
.poigroup li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
  border-bottom: 1px solid var(--line-2);
}
.poigroup li:last-child { border-bottom: 0; }
.poigroup .num { font-size: 12px; }

/* A row is only a control once its marker exists. app.js adds the class, so a
   place stored before we kept coordinates stays plain text. */
.poigroup li.can-locate { cursor: pointer; border-radius: 5px; padding: 2px 6px; margin: 0 -6px; }
.poigroup li.can-locate:hover, .poigroup li.is-hot { background: var(--accent-soft); }
.poigroup li.is-hot { color: var(--accent-ink); }

/* The kind's colour, matching its marker. */
.poigroup h3 .ico { color: var(--dot, var(--ink-2)); }
.poigroup[data-kind="grocery"] h3 { --dot: var(--poi-grocery); }
.poigroup[data-kind="train"] h3 { --dot: var(--poi-train); }
.poigroup[data-kind="bus"] h3 { --dot: var(--poi-bus); }
.poigroup[data-kind="cafe"] h3 { --dot: var(--poi-cafe); }

.places { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.sidecol .places h2 { margin-bottom: 4px; }

.history .tablewrap { overflow-x: auto; }
.history table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.history th, .history td { text-align: left; vertical-align: top; padding: 5px 10px 5px 0; border-bottom: 1px solid var(--line-2); }
.history th { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* Map pins. The pin colour is the card rail colour: one legend for both. */

.leaflet-container { font: 13px/1.4 var(--sans); background: var(--sunk); }
.leaflet-div-icon { background: none; border: none; }

.pin {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--ink-3);
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}

.pin-new { background: var(--new); }
.pin-up { background: var(--up); }
.pin-down { background: var(--down); }

/* Contacted keeps its thumb colour and adds a dot, so one pin can say both. */
.pin.done::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 4.5px auto 0;
  border-radius: 50%;
  background: var(--paper);
}

.pin.is-hot {
  transform: rotate(-45deg) scale(1.35);
  z-index: 500;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

.pin-home {
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-width: 3px;
}

/* Our own places, not the ones printed on the tiles. A white circle with a grey
   glyph is exactly what OpenStreetMap draws itself, so this one is inverted:
   filled disc, white glyph, white ring. The fill says which kind it is — at
   24 px the colour reads before the glyph does. */
.dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--dot, var(--ink));
  border: 2px solid var(--paper);
  color: var(--paper);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45);
  transition: transform .12s ease;
}

.dot .ico { width: 13px; height: 13px; stroke-width: 2; }

.dot.k-grocery { --dot: var(--poi-grocery); }
.dot.k-train { --dot: var(--poi-train); }
.dot.k-bus { --dot: var(--poi-bus); }
.dot.k-cafe { --dot: var(--poi-cafe); }

.dot.is-hot {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
}

.leaflet-popup-content-wrapper {
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-up);
}

.leaflet-popup-tip { background: var(--paper); }
.leaflet-popup-content { margin: 10px 12px; min-width: 190px; }

.pop { display: block; text-decoration: none; color: inherit; }
.pop img { width: 100%; height: 92px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; }
.pop b { display: block; font-size: 13.5px; line-height: 1.3; margin-bottom: 3px; }
.pop .popfacts { font-family: var(--mono); font-size: 12px; }
.pop .popaddr { font-size: 12px; color: var(--ink-2); }
.pop:hover b { color: var(--accent); }

.leaflet-control-attribution {
  font-size: 10px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  color: var(--ink-2);
}

.leaflet-control-attribution a { color: var(--accent); }

@media (prefers-color-scheme: dark) {
  /* The OSM raster tiles are light. Invert and re-rotate the hue so the map
     sits in the page instead of glowing out of it. */
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.9); }
}

/* The map, full screen. The small map is moved in here rather than a second one
   being built, so the markers and the current view carry over. */

.mapfull {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr;
  background: rgba(9, 12, 17, .97);
}

.mf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #e8ecf2;
  font-size: 14px;
  font-weight: 600;
}

.mf-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  padding: 0 16px 16px;
  min-height: 0;
}

.mf-map { display: flex; min-height: 0; }
.mf-map .mapbox { flex: 1 1 auto; }
.mf-side { min-height: 0; overflow: auto; }
.mf-side .places { margin: 0; }

/* Already full screen: the button would do nothing. */
.mapfull .mapbig { display: none; }

/* Room for more of the list once there is room for it. */
.mf-side .poilists { gap: 16px; }

/* Image carousel */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: rgba(9, 12, 17, .97);
}

.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: #e8ecf2;
  font-size: 13px;
  font-family: var(--mono);
}

/* The cap is in viewport units, not "max-height: 100%". A percentage here is
   measured against the grid row, and the browser did not resolve it: a portrait
   photo rendered 1371 px tall in a 756 px row and the overflow was cut off.
   100vh minus the bar and the thumbnail strip is a number that always works. */
.lb-stage { display: grid; place-items: center; padding: 0 16px; min-height: 0; }
.lb-stage img {
  max-width: min(1100px, 92vw);
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  border-radius: 8px;
}

.lb-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; }
.lb-thumbs button {
  flex: none;
  height: 56px;
  width: auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: .55;
}
.lb-thumbs button.on { opacity: 1; border-color: #fff; }
.lb-thumbs img { height: 100%; width: auto; display: block; }

.lb-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.lb-btn:hover { background: rgba(255, 255, 255, .18); }
.lb-btn[disabled] { opacity: .3; cursor: default; }

.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }

body.lb-open { overflow: hidden; }

/* Narrow screens: one column, the map on top as a fixed-height band. */

@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .mapcol, .sidecol {
    position: static;
    max-height: none;
    height: auto;
    order: -1;
  }
  .mapcol .map { height: 280px; }
  .sidecol { order: 0; }
  .sidecol .map { height: 260px; }
  /* Nothing to stick to in one column. */
  .sidecol .mapbox { position: static; }
}

@media (max-width: 720px) {
  .page { padding: 12px 12px 32px; }
  .top { gap: 10px; }
  .filters { margin-left: 0; width: 100%; }
  .card { grid-template-columns: minmax(0, 1fr); }
  .card .shot { height: 170px; }
  .detail { padding: 14px; }
  /* Two columns stop paying at this width: the photo gets too small to judge
     and the facts wrap to one word a line. */
  .mf-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(200px, 1fr) auto; }
  .mf-side { max-height: 40vh; }
  .adtop.withshots { grid-template-columns: minmax(0, 1fr); }
  .adtop.withshots .gallery, .adtop.withshots .adhead { grid-column: 1; grid-row: auto; }
  .adtop.withshots .gallery { margin-top: 16px; }
  .gallery .hero, .adtop.withshots .hero { height: 220px; }
  .leg { grid-template-columns: 28px minmax(0, 1fr); row-gap: 2px; }
  .leg .legwhere, .leg .legmeta { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
