@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrainsmono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url(/fonts/jetbrainsmono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/fonts/spacegrotesk-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(/fonts/spacegrotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Colours only through these variables, so dark mode is one block. */
:root {
  color-scheme: light dark;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --line: #DCE1E7;
  --line-strong: #C8D0D9;
  /* Borders that mark a control: at least 3:1 against the surface (WCAG 1.4.11). */
  --control: #86909B;
  --text: #151B22;
  --text-2: #3E4753;
  --muted: #5A6370;
  --accent: #2C4A6B;
  --accent-strong: #1F3650;
  --on-accent: #FFFFFF;
  --accent-soft: #E4EBF2;
  --chip: #ECEEF1;
  --code: #F1F3F6;
  --empty: #E9ECF0;
  --dashed: #A9B2BD;
  --warn: #7A4A08;
  --warn-soft: #FBF0DC;
  --brand: #F2B33D;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
/* Dark: the OS setting, unless the theme picker chose light; or the picker chose dark.
   The two blocks hold the same values: change both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F131A;
    --surface: #161B23;
    --line: #262D37;
    --line-strong: #363F4B;
    --control: #66707D;
    --text: #E6E9EE;
    --text-2: #C2C8D0;
    --muted: #98A0AB;
    --accent: #93AAD6;
    --accent-strong: #B4C6E6;
    --on-accent: #0F131A;
    --accent-soft: #1C2A42;
    --chip: #222832;
    --code: #1B212A;
    --empty: #1C222B;
    --dashed: #4A535F;
    --warn: #F2C46B;
    --warn-soft: #2E2613;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F131A;
  --surface: #161B23;
  --line: #262D37;
  --line-strong: #363F4B;
  --control: #66707D;
  --text: #E6E9EE;
  --text-2: #C2C8D0;
  --muted: #98A0AB;
  --accent: #93AAD6;
  --accent-strong: #B4C6E6;
  --on-accent: #0F131A;
  --accent-soft: #1C2A42;
  --chip: #222832;
  --code: #1B212A;
  --empty: #1C222B;
  --dashed: #4A535F;
  --warn: #F2C46B;
  --warn-soft: #2E2613;
}
:root[data-theme="light"] { color-scheme: light; }
/* Users who ask for more contrast get the soft lines and grey text pushed up. */
@media (prefers-contrast: more) {
  /* :root:root weighs as much as the dark blocks above and comes later, so it wins. */
  :root:root { --line: var(--control); --line-strong: var(--control); --dashed: var(--control); --muted: var(--text-2); }
}

/* Font sizes in rem and no size on html: the browser's and the OS's text size win. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
code, .mono { font-family: var(--mono); font-size: 0.8125rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { margin-right: auto; display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.01em; }
.lang-switch, .header-link { font-size: 0.875rem; padding: 10px 4px; }
.header-link { font-weight: 600; }
/* Shown by theme.js: without JavaScript the picker could not do anything. */
.theme:not([hidden]) { display: flex; align-items: center; gap: 6px; font-size: 0.875rem; color: var(--muted); }
.theme select {
  font: inherit; color: var(--text); background: var(--surface); min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--control); border-radius: 8px; cursor: pointer;
}
main { flex: 1 0 auto; padding: 24px 0 64px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 0.875rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; padding-bottom: 20px; }

/* Station title */
.operator { margin: 0 0 6px; font-size: 0.875rem; color: var(--muted); }
.title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 24px; }
.title-row h1 { margin: 0; font-size: clamp(1.625rem, 1.2rem + 1.5vw, 2.125rem); letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.subtitle { margin: 6px 0 0; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* The transparent border shows up in forced colours, where backgrounds are dropped. */
.chip { font-size: 0.8125rem; font-weight: 500; padding: 6px 10px; border-radius: 999px; background: var(--chip); color: var(--text-2); border: 1px solid transparent; }
.chip.ok { background: var(--accent-soft); color: var(--accent-strong); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.notice { background: var(--warn-soft); color: var(--warn); border: 1px solid transparent; border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; font-size: 0.9375rem; }

/* Layout: photos left, details right; stacks on narrow screens */
.columns { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.photos { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.empty-photo {
  aspect-ratio: 4 / 3; border-radius: 12px; background: var(--empty); border: 1px dashed var(--dashed);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); text-align: center; padding: 24px;
}
.empty-photo svg { width: 48px; height: 48px; }
.empty-photo strong { color: var(--text-2); font-weight: 600; }
.hint { margin: 0; font-size: 0.875rem; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.125rem; }
.card h3 { margin: 16px 0 4px; font-size: 1rem; }
.card > p { margin: 0 0 14px; font-size: 0.875rem; color: var(--muted); }

/* Static links */
.sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.sizes button {
  font: inherit; font-size: 0.875rem; min-height: 44px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--control); background: var(--surface); color: var(--text-2);
}
/* Pressed is a thicker border as well as a colour, so it does not rest on colour alone. */
.sizes button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.links { display: flex; flex-direction: column; gap: 10px; }

/* See also */
.also { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.links .label { font-size: 0.8125rem; color: var(--muted); margin-bottom: 4px; }
.copy-row { display: flex; gap: 6px; align-items: flex-start; }
/* Long links wrap instead of scrolling: a scroll box here would be out of reach by keyboard. */
.copy-row code {
  flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere;
  background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 11px 10px;
}
.copy {
  flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--control); border-radius: 6px; cursor: pointer;
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center;
}
.copy svg { width: 18px; height: 18px; }
.copy .done { display: none; }
.copy[data-done] { border-color: var(--accent); color: var(--accent); }
.copy[data-done] .idle { display: none; }
.copy[data-done] .done { display: block; }

/* Sockets */
.sockets { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.socket { display: flex; gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 8px; scroll-margin-top: 16px; }
.socket:target { background: var(--accent-soft); outline: 2px solid var(--accent); }
.socket .thumb {
  width: 64px; min-height: 48px; flex: none; border-radius: 6px; border: 1px dashed var(--dashed);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem; text-align: center;
}
.socket .info { flex: 1 1 auto; min-width: 0; }
.socket .code { overflow-wrap: anywhere; }
.socket .send-socket { display: inline-block; margin-top: 0.25rem; font-size: 0.875rem; }
.socket .meta { font-size: 0.8125rem; color: var(--muted); }

/* Search */
.search { margin: 24px 0; }
.search label { display: block; font-weight: 600; margin-bottom: 6px; }
.search-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search input {
  flex: 1 1 14rem; min-width: 0; min-height: 48px; padding: 10px 14px; font: inherit;
  color: var(--text); background: var(--surface); border: 1px solid var(--control); border-radius: 10px;
}
/* The search button, the sign-in link and the sign-out button look the same. */
.search button, .button {
  flex: none; min-height: 48px; padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer;
  color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); border-radius: 10px;
}
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.search button:hover, .button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
@media (forced-colors: active) { .search button, .button { border-color: ButtonText; } }
.search .hint { margin-top: 6px; }
/* The «sem foto» filters: one full-width box per line. */
.filters input { display: block; width: 100%; }
.filters .hint { display: block; }
.results { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.result { padding: 10px 0; border-bottom: 1px solid var(--line); }
.result a { font-weight: 500; overflow-wrap: anywhere; }
.result .meta { font-size: 0.8125rem; color: var(--muted); }

.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { margin: 6px 0; }
.page-msg { max-width: 40rem; }
.page-msg h1 { font-size: 1.875rem; margin: 0 0 8px; }
/* Long text pages (privacy): readable line length, room between sections. */
.prose h2 { font-size: 1.25rem; margin: 32px 0 8px; }
.prose p, .prose li { line-height: 1.6; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose code { overflow-wrap: anywhere; }

/* Upload: one column of cards, one per step. */
.upload-page { max-width: 48rem; }
.upload-page h1 { font-size: 1.875rem; margin: 0 0 8px; }
.upload { display: flex; flex-direction: column; gap: 16px; accent-color: var(--accent); }
.upload h3 { font-size: 1rem; margin: 16px 0 4px; }
label[for="photo"], .station-search label { font-weight: 600; }
.upload input[type="file"] { display: block; margin: 6px 0; font: inherit; font-size: max(1rem, 1em); max-width: 100%; }
.upload fieldset { border: 0; margin: 12px 0 0; padding: 0; min-width: 0; }
.upload legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
/* Live regions stay in the page when empty, or a screen reader may miss the first message. */
.status:empty { margin: 0; }
.status { margin: 8px 0 0; font-size: 0.9375rem; }
.station-search { margin-top: 16px; }
.station-search label { display: block; margin-bottom: 6px; }
.station-search input {
  flex: 1 1 14rem; min-width: 0; min-height: 48px; padding: 10px 14px; font: inherit; font-size: max(1rem, 1em);
  color: var(--text); background: var(--surface); border: 1px solid var(--control); border-radius: 10px;
}
.station-search .hint { margin-top: 6px; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice {
  display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 12px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface);
}
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0; }
.choice-text { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; overflow-wrap: anywhere; }
.choice .meta, .choice .dist { font-size: 0.875rem; color: var(--muted); }
.choice .dist { flex: none; font-variant-numeric: tabular-nums; }
#target-link { overflow-wrap: anywhere; }
.button.secondary { color: var(--accent-strong); background: var(--surface); border-color: var(--control); }
.button.secondary:hover { color: var(--accent-strong); background: var(--accent-soft); border-color: var(--accent); }
.button.secondary[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.zone-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* The canvas is the photo that will be sent; the areas sit on top of it. */
/* The stage shrinks to the canvas, so the areas line up with the photo even
   when a portrait photo is capped at 70% of the screen height. */
.stage { position: relative; margin-top: 8px; line-height: 0; width: fit-content; max-width: 100%; }
.stage canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; border-radius: 8px; background: var(--empty); }
.zones { position: absolute; inset: 0; }
.zones.drawing { cursor: crosshair; touch-action: none; }
.zones.drawing .zone { pointer-events: none; }
.zone {
  position: absolute; padding: 0; margin: 0; cursor: pointer; border-radius: 4px;
  background: transparent; border: 2px solid #FFFFFF; outline: 2px solid #2C4A6B;
}
.zone[aria-pressed="false"] { border: 2px dashed #FFFFFF; outline: 2px dashed #9A3F00; }
.zone:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.zone .tag {
  position: absolute; left: -2px; bottom: 100%; margin-bottom: 4px; white-space: nowrap; line-height: 1.3;
  font: 600 0.75rem/1.3 var(--sans); padding: 3px 7px; border-radius: 4px; background: #2C4A6B; color: #FFFFFF;
}
.zone[aria-pressed="false"] .tag { background: #FFF1E6; color: #8A3A00; }
.zone.ghost { pointer-events: none; border-style: dashed; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 2px 0 0; }
.upload button[type="submit"] { margin-top: 8px; width: 100%; }
.upload button:disabled { opacity: 0.6; cursor: progress; }

/* The public removal form (/report). */
.takedown { max-width: 40rem; accent-color: var(--accent); }
.takedown > p { color: inherit; font-size: inherit; }
.takedown fieldset { border: 0; margin: 12px 0; padding: 0; min-width: 0; }
.takedown legend { padding: 0; margin-bottom: 4px; }
.takedown input:not([type="radio"]), .takedown textarea {
  box-sizing: border-box; width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 14px; font: inherit; font-size: max(1rem, 1em);
  color: var(--text); background: var(--surface); border: 1px solid var(--control); border-radius: 10px;
}
.takedown textarea { resize: vertical; }
.takedown .hint { margin-top: -8px; }
.takedown button[type="submit"] { width: 100%; }
.result-photo { margin-top: 16px; }
.result-photo img { display: block; max-width: 100%; height: auto; border-radius: 8px; }
.result-photo .plain-list { margin-top: 8px; font-size: 0.875rem; }

/* em, not px: the layout switches when the text no longer fits, whatever its size. */
@media (max-width: 37.5em) {
  .wrap { padding: 0 16px; }
  /* Room for the picker and the language link on one line; screen readers still get the label. */
  .theme label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  /* While there are no photos, the empty box should not push the links off screen. */
  .empty-photo { aspect-ratio: 16 / 9; }
}

@media (forced-colors: active) {
  .zone, .zone[aria-pressed="false"] { border-color: CanvasText; outline-color: Highlight; }
  .choice:has(input:checked) { border: 2px solid Highlight; }
  /* The inset shadow is dropped here: mark the pressed size with a thicker system-colour border. */
  .sizes button[aria-pressed="true"] { border: 3px solid Highlight; }
  .socket:target { outline-color: Highlight; }
}

/* Admin: users and roles */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table.users { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
table.users th, table.users td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.users th { font-weight: 600; color: var(--muted); font-size: 0.875rem; }
.role-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.role-form select {
  font: inherit; color: var(--text); background: var(--surface); min-height: 44px; padding: 6px 8px;
  border: 1px solid var(--control); border-radius: 8px;
}

/* Admin: moderation queue */
.queue-item { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 16px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.queue-item img { width: 100%; height: auto; border-radius: 8px; display: block; background: var(--line); }
.queue-item p { margin: 0 0 6px; }
.queue-item .notice { margin: 8px 0; }
.queue-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.queue-actions form { margin: 0; }
@media (max-width: 560px) { .queue-item { grid-template-columns: minmax(0, 1fr); } }

/* Admin: targets without a main photo */
.lost-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.lost-item p { margin: 0 0 6px; }
.lost-item fieldset { border: 0; margin: 12px 0; padding: 0; min-width: 0; }
.lost-item legend { font-weight: 600; padding: 0; margin-bottom: 8px; }
.lost-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.lost-choice { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 0.875rem; }
.lost-choice:has(input:checked) { border-color: var(--accent); outline: 2px solid var(--accent); }
.lost-choice img { width: 100%; height: auto; border-radius: 6px; display: block; background: var(--line); }
.lost-choice input { min-width: 24px; min-height: 24px; margin: 0; }
.muted { color: var(--muted); }

/* Station main photo */
.main-photo { margin: 0; }
.main-photo img { display: block; width: 100%; height: auto; border-radius: 12px; background: var(--empty); }
.main-photo figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--muted); }
img.thumb { object-fit: cover; height: 48px; border-style: solid; }

/* Ranking */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table.ranking { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.ranking th, table.ranking td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.ranking thead th { color: var(--muted); font-weight: 600; font-size: 0.8125rem; }
table.ranking tbody th { font-weight: 600; overflow-wrap: anywhere; }
table.ranking .num { text-align: right; font-variant-numeric: tabular-nums; }
.medal { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 0.8125rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--text); }
.medal::before { content: "●"; margin-right: 6px; }
.medal-gold::before { color: #C9971C; }
.medal-silver::before { color: #8E99A6; }
.medal-bronze::before { color: #A8642F; }

/* Account: points and API tokens */
.account-section { text-align: left; margin: 0 0 20px; }
.account-section h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tokens { margin: 0 0 16px; }
.token-item { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.token-item form { margin: 4px 0 0; }
.token-new { display: block; overflow-wrap: anywhere; user-select: all; font-family: var(--mono); padding: 8px; background: var(--code); border-radius: 8px; color: var(--text); }
.token-form { display: grid; gap: 6px; }
.token-form fieldset { border: 0; padding: 0; margin: 8px 0; }
.account-section > p { color: var(--text); font-size: 1rem; }

/* Upload: map */
.station-map { margin: 16px 0 0; }
.map { height: 320px; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0; }
/* The group (/grupo): each site's mascot beside a speech bubble, alternating sides,
   as on the other sites of the group. --c is that site's colour, only for the circle
   behind the mascot and the dot before its address: text keeps the page's colours. */
.group-hero { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px 48px; align-items: center; margin: 8px 0 48px; }
.group-hero h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); line-height: 1.15; margin: 0 0 12px; }
.eyebrow { display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--accent-strong); background: var(--accent-soft); }
.lead { font-size: 1.125rem; line-height: 1.6; color: var(--text-2); max-width: 40rem; margin: 0; }
.group-stage { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.group-stage::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: color-mix(in srgb, var(--brand) 26%, var(--bg)); }
.group-stage img { position: relative; width: 64%; height: auto; }
.group-bubble { position: absolute; top: 2%; right: 0; max-width: 11rem; margin: 0; padding: 10px 14px; font-weight: 600; font-size: 0.9375rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.m-carro { --c: #ff6b4a; } .m-ohmigo { --c: #22c55e; } .m-voltaria { --c: #2f5bd0; } .m-ceme { --c: #db2777; }
.m-nap { --c: #0284c7; } .m-oop { --c: #f2b33d; } .m-pano { --c: #8f2a85; } .m-ampere { --c: #8b5cf6; }
.mates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 32px; }
.mate { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; align-items: center; max-width: 860px; }
.mate:nth-child(even) { grid-template-columns: minmax(0, 1fr) 160px; margin-left: auto; }
.mate:nth-child(even) .mate-pic { order: 2; }
.mate-pic { position: relative; display: grid; place-items: center; aspect-ratio: 1; }
.mate-pic::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, var(--bg)); }
.mate-pic img { position: relative; width: 74%; height: auto; max-height: 84%; object-fit: contain; }
.mate-bubble { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
/* The tail points at the mascot. */
.mate-bubble::before { content: ""; position: absolute; top: 50%; left: -9px; width: 16px; height: 16px; margin-top: -8px; background: var(--surface);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.mate:nth-child(even) .mate-bubble::before { left: auto; right: -9px; transform: rotate(-135deg); }
.mate-bubble h2 { font-size: 1.5rem; margin: 2px 0 6px; }
.mate-bubble p { margin: 0 0 10px; line-height: 1.6; }
.mate-host { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; font-weight: 600; color: var(--muted); overflow-wrap: anywhere; }
.mate-host::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.mate-bubble .mate-note { font-size: 0.9375rem; color: var(--muted); }
.mate-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 0 !important; }
.mate-links svg { width: 18px; height: 18px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mate-links .here { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 10px; font-weight: 600;
  color: var(--warn); background: var(--warn-soft); }
.group-back { margin-top: 40px; }
@media (max-width: 45em) {
  .group-hero { grid-template-columns: minmax(0, 1fr); }
  .group-stage { width: 200px; margin: 0 auto; }
  .group-bubble { right: -25%; }
  .mate, .mate:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-left: 0; }
  .mate .mate-pic, .mate:nth-child(even) .mate-pic { order: 0; width: 130px; margin: 0 auto; }
  .mate-bubble::before, .mate:nth-child(even) .mate-bubble::before { top: -9px; left: 50%; right: auto; margin: 0 0 0 -8px; transform: rotate(135deg); }
}
@media (forced-colors: active) {
  .mate-pic::before, .group-stage::before, .mate-bubble::before { display: none; }
  .mate-host::before { background: CanvasText; }
}

/* Moderation: refusing a photo needs a reason; the author's uploads list. */
.reject-form { display: grid; gap: 6px; margin-top: 12px; max-width: 32rem; }
.reject-form select, .reject-form input { width: 100%; }
ul.uploads { padding: 0; margin: 0 0 16px; }
ul.uploads > .queue-item { list-style: none; }

/* Credit page of a photo */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 0.9375rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* Photos at their origin (Panoramax, Commons): small, marked as external */
.external h2 { font-size: 1rem; margin: 8px 0 4px; }
.external-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.external-photo { margin: 0; display: grid; gap: 6px; font-size: 0.8125rem; color: var(--muted); }
.external-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--empty); }
.external-photo figcaption { display: grid; gap: 4px; justify-items: start; }

/* Home: the latest stations with new photos */
.recent h2 { font-size: 1rem; margin: 24px 0 4px; }
.recent > ul { list-style: none; margin: 0; padding: 0; }
.recent > ul > li { padding: 12px 0; border-top: 1px solid var(--line); }
.recent-photos { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.recent-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.recent .meta { font-size: 0.8125rem; color: var(--muted); }

/* Instalar app (install.js): footer button, phone banner and the steps dialog. */
.linkbtn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--accent-strong); }
.linkbtn[data-install-open] { display: none; }
:root[data-install="ready"] .linkbtn[data-install-open] { display: inline; }
.install-bar[hidden], .install-dlg [hidden] { display: none; }
.install-btn { font: inherit; font-size: 0.875rem; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--control); background: var(--surface); color: var(--text); }
.install-btn.primary { background: var(--brand); border-color: var(--brand); color: #151B22; }
.install-bar { position: fixed; z-index: 50; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 28px rgb(21 27 34 / .16); }
.install-bar img { display: block; border-radius: 22%; }
.install-bar p { margin: 0; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.install-bar strong { display: block; color: var(--text); font-family: var(--display); font-size: 1rem; }
.install-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.install-x:hover { color: var(--text); background: var(--chip); }
.install-dlg { width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px 22px 18px; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); }
.install-dlg::backdrop { background: rgb(15 19 26 / .5); }
.install-dlg h2 { margin: 14px 0 6px; font-family: var(--display); font-size: 1.25rem; }
/* A slice of a home screen: the icon and its name as the phone will show them. */
.install-tile { display: grid; justify-items: center; gap: 6px; padding: 18px 0 12px; border-radius: 8px; background: var(--accent-soft); }
.install-tile img { border-radius: 22%; box-shadow: 0 6px 16px rgb(21 27 34 / .18); }
.install-tile span { font-size: 0.75rem; font-weight: 600; color: var(--accent-strong); }
.install-lede { margin: 0 0 14px; color: var(--muted); }
.install-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; }
.install-steps li { counter-increment: step; position: relative; min-height: 28px; padding: 3px 0 0 38px; }
.install-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #151B22; font-weight: 700; font-size: 0.875rem; }
.install-list { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; }
.install-note { margin: 12px 0 0; font-size: 0.875rem; color: var(--muted); }
.install-note:first-child { margin: 0 0 12px; }
.install-glyph { width: 1.25em; height: 1.25em; vertical-align: -.25em; padding: 1px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--accent); }
.install-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.install-copy code { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; font: 0.8125rem var(--mono); padding: 6px 8px; border-radius: 6px; background: var(--code); }
.install-actions { margin: 18px 0 0; display: flex; justify-content: flex-end; }
/* On a narrow phone the banner keeps the title and the button; the dialog says the rest. */
@media (max-width: 420px) { .install-bar { gap: 10px; } .install-bar p span { display: none; } }
@media (max-width: 600px) {
  .install-dlg { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 12px 12px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
  .install-dlg[open] { transition: translate .22s ease-out; @starting-style { translate: 0 24px; } }
}

/* Station photos for moderators (src/stationadmin.ts). */
.admin-photos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.admin-photo { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 8px; align-content: start; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.875rem; }
.admin-photo.is-main { border-color: var(--accent); outline: 2px solid var(--accent); }
.admin-photo img { width: 100%; height: auto; border-radius: 6px; display: block; background: var(--line); }
.admin-photo p { margin: 0; }
.admin-photo form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 0; }
.admin-photo select, .admin-photo input { width: 100%; min-width: 0; box-sizing: border-box; }
/* The other photos of a socket, under its links. */
.socket-more { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.socket-more img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; background: var(--line); }
.admin-photo .move-photo select { max-width: 100%; }
