/* Tokens. White pages and navy ink; the only colour comes from metro lines,
   which are data. One typeface, Onest, carries every level of hierarchy. */
:root {
  --page: #FFFFFF;
  --tile: #F2F4F7;
  --plate: #FFFFFF;
  --ink: #13213D;
  --ink-hover: #22365E;
  --ink-soft: #5E6A7E;
  --rule: #E2E6EC;
  --pulled: #E9ECF1;
  --ok: #17663F;
  --bad: #B3261E;
  --wait: #1F4E8C;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --gutter: clamp(16px, 3vw, 40px);
  --body: "Onest", "Segoe UI", system-ui, sans-serif;
  --display: var(--body);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* No double-tap zoom: taps on buttons answer at once; pinching still zooms. */
body { touch-action: manipulation; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
[hidden] { display: none !important; }
small { font-size: 0.8125rem; color: var(--ink-soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.muted, .note { color: var(--ink-soft); font-size: 0.875rem; }
.pre { white-space: pre-line; }
.prose { max-width: 68ch; line-height: 1.6; }

/* Header */
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: var(--plate);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 1.1875rem/1 var(--body);
  letter-spacing: -0.015em;
  color: inherit;
  text-decoration: none;
}
/* A line with a station on it, the site's only ornament. */
.brand-mark {
  position: relative;
  width: 28px;
  height: 4px;
  background: var(--ink);
  border-radius: 2px;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  top: -5px;
  width: 14px;
  height: 14px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--plate);
}
.head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
/* Shown to logged-in agents only: back to the panel. */
.to-admin {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.9375rem;
  text-decoration: none;
}
.to-admin:hover { background: var(--ink-hover); }
.lang-switch { font-size: 0.9375rem; }
.head-logout .link-button { color: var(--ink-soft); font-size: 0.9375rem; }
.head-login {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9375rem;
  text-decoration: none;
}
.head-login:hover { border-color: var(--ink); }
/* Shown to agents and staff only. */
.flat-address { margin-top: 8px; font-size: 1.0625rem; }

/* Sign-in and invite pages. */
.auth-box { display: grid; gap: 16px; width: min(400px, calc(100% - 2 * var(--gutter))); margin: 48px auto; padding: 28px; border: 1px solid var(--rule); border-radius: var(--r-lg); }
.auth-box h1 { font: 700 1.5rem/1.2 var(--body); letter-spacing: -0.01em; }
.auth-box .notice-bad { padding: 10px 14px; border-radius: var(--r-sm); background: #FBE9E7; color: var(--bad); }
.auth-form { display: grid; gap: 14px; }
.auth-box .or { color: var(--ink-soft); font-size: 0.875rem; text-align: center; }
.lang-switch a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
}
.lang-switch a:hover { border-color: var(--ink); }

/* Onest has no Chinese: on Chinese pages the characters come from the
   system's own font, while digits, Latin and Cyrillic stay in Onest. */
html[lang|="zh"] { --body: "Onest", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

/* Controls */
/* Phones zoom into a field with text under 16px and stay zoomed in. */
@media (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em) !important; }
}
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--plate);
  color: var(--ink);
  font: inherit;
}
input:hover, select:hover, textarea:hover { border-color: #C8CFD9; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: var(--ink);
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { box-shadow: none; outline: 2px solid var(--ink); }
input[type="file"] { padding: 8px; }
.field > .affix { font-size: 1rem; font-weight: 400; }

.field { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 500; }
.field > input, .field > select, .field > textarea { font-size: 1rem; font-weight: 400; }
.field > small { font-weight: 400; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 9px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--plate);
  color: var(--ink);
  font: 500 0.9375rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-main { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-main:hover { border-color: var(--ink-hover); background: var(--ink-hover); }
.btn-wide { width: 100%; }
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.link-button:disabled { opacity: 0.5; cursor: default; }
.link-danger { color: var(--bad); }
.link-quiet { display: block; text-align: center; font-size: 0.875rem; color: var(--ink-soft); }

/* Metro line colours next to a station name: one dot per line, so an
   interchange shows them side by side, slightly overlapping. */
.dots { display: inline-flex; flex: none; align-items: center; }
.dot {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line, #8391A5);
}
.dot + .dot { margin-left: -2px; box-shadow: 0 0 0 1.5px var(--plate); }

/* Catalog */
.catalog {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 40px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px var(--gutter) 72px;
  align-items: start;
}
.filters {
  position: sticky;
  top: 20px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--tile);
}
.filters summary { display: none; }
.filters form { display: grid; gap: 20px; }
.filters legend { padding: 0 0 6px; font-size: 0.875rem; font-weight: 500; }
.filters .btn-main { margin-top: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: grid; grid-template-columns: auto repeat(4, minmax(0, 1fr)); gap: 4px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--plate);
  text-align: center;
  font-size: 0.9375rem;
}
.chips label:hover span { border-color: #C8CFD9; }
.chips input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.checks { display: grid; gap: 10px; font-size: 0.9375rem; }
.checks label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checks input { margin-top: 3px; }

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.results-head h1 { font: 700 1.75rem/1.2 var(--body); letter-spacing: -0.02em; }
.sort label { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--ink-soft); white-space: nowrap; }
.sort select { width: auto; min-height: 38px; padding: 6px 10px; color: var(--ink); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 36px 24px;
}
.flat { position: relative; display: grid; align-content: start; gap: 14px; }
.flat-photo {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--pulled);
}
.flat-photo img { width: 100%; height: 100%; object-fit: cover; }
.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--pulled);
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.no-photo-large { aspect-ratio: 16 / 10; border-radius: var(--r-lg); }
.flat-body { display: grid; align-content: start; gap: 4px; }
.price {
  font: 700 1.375rem/1.2 var(--body);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.price a { text-decoration: none; }
/* The whole card opens the flat; the price link stretches over it. */
.flat .price a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-md); }
.flat:hover .price a { text-decoration: underline; }
.price small { margin-left: 2px; font: 400 0.875rem var(--body); letter-spacing: 0; white-space: nowrap; }
.flat-body h2 { font-size: 1rem; font-weight: 500; }

/* Stations: the line colour, the name, and the walk as the figure that
   matters most. */
.stops { display: grid; gap: 6px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--rule); }
.stops li { display: flex; align-items: center; gap: 8px; font-size: 0.9375rem; }
.stop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-time { margin-left: auto; color: var(--ink-soft); font-size: 0.875rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.facts span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tile);
  font-size: 0.8125rem;
}
.facts:empty { display: none; }

.empty { padding: 48px 0; display: grid; gap: 10px; justify-items: start; }
.empty h2, .empty h1 { font: 700 1.375rem/1.3 var(--body); letter-spacing: -0.01em; }
.empty p { color: var(--ink-soft); }
.empty .btn { margin-top: 6px; }
.empty-page { max-width: 640px; margin: 0 auto; padding: 72px 16px; }
.pager { display: flex; justify-content: space-between; gap: 12px; padding-top: 40px; }

/* Flat page: on a computer everything fits one screen, photos on the left
   and the facts on the right; on a phone it is one column. */
.card-page { max-width: 1280px; margin: 0 auto; padding: 14px var(--gutter) 16px; }
.back { display: inline-block; margin-bottom: 8px; font-size: 0.875rem; color: var(--ink-soft); }
.back::before { content: "‹ "; }
.card-page h1 { font: 700 clamp(1.5rem, 2.6vw, 2.125rem)/1.15 var(--body); letter-spacing: -0.025em; }
.flat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  grid-template-rows: auto 1fr;
  gap: 14px 32px;
  margin-top: 16px;
  align-items: start;
}
.flat-media { grid-column: 1; grid-row: 1; display: grid; gap: 10px; min-width: 0; }
.flat-info { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: 10px; min-width: 0; }

.gallery { position: relative; }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--r-lg);
  background: var(--tile);
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-shot {
  flex: 0 0 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  scroll-snap-align: start;
}
/* The frame has the shape of the photos (4:3 until the first one loads),
   so they show without bands; it is never taller than what the screen has
   left under the title and above the thumbnails, so the page fits without
   scrolling. */
.gallery-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--shot-ratio, 4 / 3);
  max-height: clamp(260px, calc(100vh - 320px), 640px);
  object-fit: contain;
}
/* With the staff box under the photos there is less height for them. */
.flat-layout:has(> .staff-box) .gallery-shot img { max-height: clamp(240px, calc(100vh - 400px), 580px); }
.gallery-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(19, 33, 61, 0.16);
}
.gallery-nav:hover { background: #fff; }
.gallery-prev { left: 14px; }
.gallery-next { right: 14px; }
.gallery-count {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(19, 33, 61, 0.78);
  color: #fff;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* Thumbnails: a strip under the photo; the current one is outlined. */
.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}
/* Five fill the row; more scroll. */
.thumb {
  flex: 0 0 calc((100% - 32px) / 5);
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--tile);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--ink); }

/* Full-screen viewer: swipe or arrows, Esc closes. */
.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 16, 30, 0.96);
}
.viewer::backdrop { background: rgba(10, 16, 30, 0.96); }
.viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  scroll-snap-align: start;
}
.viewer-close, .viewer-nav {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.viewer-close { top: 14px; right: 14px; }
.viewer-nav { top: 50%; transform: translateY(-50%); }
.viewer-prev { left: 14px; }
.viewer-next { right: 14px; }
.viewer-close:hover, .viewer-nav:hover { background: rgba(255, 255, 255, 0.26); }

.flat-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 14px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  background: var(--plate);
}
.flat-summary .avail { grid-column: 1; }
.price-large { font-size: 1.875rem; letter-spacing: -0.02em; }
.avail { font-weight: 500; }
.flat-id {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: var(--tile);
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-align: center;
}
.flat-id b {
  color: var(--ink);
  font: 700 1.375rem/1.2 var(--body);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

/* The facts as icons with a short line each, two per row. */
.icon { flex: none; width: 22px; height: 22px; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.facts-grid li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--tile);
  font-size: 0.9375rem;
  line-height: 1.3;
}
.facts-grid li > span { display: grid; gap: 1px; min-width: 0; }
.facts-grid small { font-size: 0.75rem; }
.facts-grid em { color: var(--ink-soft); font-size: 0.8125rem; font-style: normal; }
.facts-grid .unknown { color: var(--ink-soft); }

/* Metro: the line colour, the name, minutes on foot and by car. */
.route { padding: 14px 20px 6px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--plate); }
.route h2 { margin-bottom: 4px; font: 700 1.0625rem/1.3 var(--body); }
.route-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.route-list li:first-child { border-top: 0; }
.route .st { display: flex; align-items: flex-start; gap: 8px; min-width: 0; font-weight: 500; }
.route .st .dots { margin-top: 0.42em; }
.route .native { display: block; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 400; }
.route-time { display: flex; gap: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.route-time > span { display: inline-flex; align-items: center; gap: 3px; }
.route-time .icon { width: 17px; height: 17px; }
.route-time .walk { font-weight: 600; }
.route-time .car { color: var(--ink-soft); }
.route .none { color: var(--ink-soft); font-size: 0.875rem; }

/* Longer texts: a card like the metro one, a row each, two lines of each
   and the rest on one tap. */
.details { padding: 12px 20px 6px; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--plate); }
.details h2 { margin-bottom: 2px; font: 700 1.0625rem/1.3 var(--body); }
.flat-texts > div { padding: 9px 0; border-top: 1px solid var(--rule); }
.flat-texts > div:first-child { border-top: 0; }
.flat-texts dt { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; color: var(--ink-soft); font-size: 0.8125rem; }
.flat-texts dt .icon { width: 17px; height: 17px; }
.flat-texts dd { padding-left: 23px; font-size: 0.9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.details .clamp-toggle { margin: 0 0 4px; }
/* On a low screen each text shows one line, so the page still fits. */
@media (min-width: 901px) and (max-height: 820px) {
  .details .clamp.is-clamped { -webkit-line-clamp: 1; }
}
.clamp.is-clamped { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clamp-toggle {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 0.875rem var(--body);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* Only staff and agents see this box. */
/* On a computer it sits under the photos, where there is room. */
.flat-layout > .staff-box { grid-column: 1; grid-row: 2; }
.staff-box { padding: 10px 14px; border: 1px dashed #C8CFD9; border-radius: var(--r-md); }
.staff-note { margin-bottom: 6px; color: var(--ink-soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.staff-box dl { display: grid; gap: 3px; }
.staff-box dl > div { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.9375rem; }
.staff-box dt { color: var(--ink-soft); }
.staff-box dd { font-weight: 500; overflow-wrap: anywhere; }

/* Metro picker in the filters: chips of the chosen stations, the map in a
   full-screen dialog. */
.metro-pick { display: grid; gap: 8px; }
.metro-pick legend { margin-bottom: 6px; font-size: 0.875rem; font-weight: 500; }
.metro-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.metro-chips:empty { display: none; }
.metro-chip { cursor: pointer; }
.metro-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.metro-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
}
.metro-chip span::after { content: "×"; font-size: 1.05rem; line-height: 1; opacity: 0.75; }
.metro-chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.metro-open { justify-self: start; }

.metro-dialog {
  width: min(1100px, 100vw - 32px);
  height: min(820px, 100vh - 32px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--plate);
  color: var(--ink);
}
.metro-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.metro-dialog::backdrop { background: rgba(19, 33, 61, 0.45); }
.metro-dialog-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.metro-count { color: var(--ink-soft); font-size: 0.875rem; }
.metro-close {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--tile);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.metro-stage { position: relative; min-height: 0; overflow: hidden; background: #fff; }
.metro-zoom { position: absolute; right: 12px; bottom: 12px; display: grid; gap: 6px; }
.metro-zoom button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--plate);
  color: var(--ink);
  font-size: 1.25rem;
  cursor: pointer;
}
.metro-dialog-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-top: 1px solid var(--rule); }
.metro-hint { flex: 1 1 260px; color: var(--ink-soft); font-size: 0.8125rem; }
.metro-dialog-foot button.link-quiet { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* The scheme: a name is the button; a plate behind it shows whether it is
   chosen, a number by it how many flats are near the station. */
.mscheme { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; cursor: grab; }
.mscheme:active { cursor: grabbing; }
.msl { cursor: pointer; }
.msl-plate { fill: transparent; }
.msl:hover .msl-plate { fill: #E2E6EC; }
.msl.sel .msl-plate { fill: var(--ink); }
.msl.sel text, .msl.sel tspan { fill: #fff !important; }
/* The number of flats near a station. */
.msl-n rect { fill: var(--ink); }
.msl-n text { fill: #fff !important; font-size: 9px; font-weight: 700 !important; }
.msl.sel .msl-n rect { fill: #fff; }
.msl.sel .msl-n text { fill: var(--ink) !important; }
.metro-credit { display: block; margin-top: 2px; font-size: 0.75rem; }
.metro-credit a { color: inherit; }

@media (max-width: 900px) {
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .filters { position: static; padding: 14px 16px; border-radius: var(--r-md); }
  .filters summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 500; list-style: none; }
  .filters summary::-webkit-details-marker { display: none; }
  .filters summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin: 0 4px 4px 0;
    border: solid var(--ink);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .filters[open] summary::after { margin-bottom: -4px; transform: rotate(-135deg); }
  .filters[open] summary { margin-bottom: 16px; }
  .flat-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 16px; margin-top: 14px; }
  .flat-media, .flat-info, .flat-layout > .staff-box { grid-column: 1; grid-row: auto; }
  .gallery-shot img, .flat-layout:has(> .staff-box) .gallery-shot img { max-height: none; }
  .thumb { flex-basis: 84px; }
}
@media (max-width: 560px) {
  .gallery-nav { display: none; }
  .results-head h1 { font-size: 1.5rem; }
  /* The name and the buttons stay on one line on a phone. */
  .site-head { flex-wrap: nowrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .brand { flex: none; gap: 8px; font-size: 1.0625rem; }
  .head-actions { gap: 6px; }
  .to-admin, .head-login, .lang-switch a { padding: 6px 12px; font-size: 0.875rem; white-space: nowrap; }
  .head-actions { min-width: 0; }
  .head-logout .link-button { font-size: 0.875rem; white-space: nowrap; }
  .auth-box { margin-top: 28px; padding: 22px 20px; }
  .price-large { font-size: 1.625rem; }
  .metro-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .metro-dialog-foot .btn { flex: 1 1 auto; }
}
@media (max-width: 360px) {
  .site-head { gap: 8px; }
  .brand { gap: 6px; font-size: 1rem; }
  .brand-mark { width: 22px; }
  .brand-mark::after { left: 5px; }
  .to-admin, .head-login, .lang-switch a { padding: 5px 10px; font-size: 0.8125rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* Selections for clients: the button on cards and flat pages, the agent's
   page of picks and links, and the client's page. */
.pick-form { position: relative; z-index: 1; justify-self: start; margin-top: 6px; }
.pick-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--plate);
  color: var(--ink);
  font: 500 0.9375rem var(--body);
  cursor: pointer;
}
.pick-btn:hover { border-color: var(--ink); }
.pick-btn.is-on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pick-btn:disabled { opacity: 0.6; cursor: default; }
.flat-pick { margin: -4px 0 14px; }
.head-picks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.9375rem;
  text-decoration: none;
}
.head-picks:hover { border-color: var(--ink); }
.head-picks-icon { display: none; width: 18px; height: 18px; flex: none; }
.picks-count {
  min-width: 1.5em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.picks-page { display: grid; gap: 18px; max-width: 860px; }
.picks-page .notice { padding: 14px 16px; border-radius: var(--r-md); background: var(--tile); }
.picks-page .notice-bad { background: #FBE9E7; color: var(--bad); }
.share-created { display: grid; gap: 8px; }
.share-created h2, .picks-block h2 { font: 700 1.125rem/1.3 var(--body); }
.picks-block { display: grid; gap: 12px; }
.pick-rows, .selection-rows { display: grid; gap: 8px; }
.pick-row, .selection-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
}
.pick-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.pick-row-main img, .pick-row-main .no-photo { flex: none; width: 88px; height: 66px; border-radius: var(--r-sm); object-fit: cover; }
.pick-row-main > span, .selection-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.create-selection { display: grid; gap: 10px; max-width: 520px; }
.create-selection .btn { justify-self: start; }
.clear-picks { justify-self: start; }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.copy-input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--plate);
  color: var(--ink);
  font: 400 0.9375rem var(--body);
}

.share-head { justify-content: space-between; }
.share-title { font-weight: 700; }
.share-page { max-width: 1280px; margin: 0 auto; padding: 8px var(--gutter) 40px; display: grid; gap: 28px; }
.share-count { color: var(--ink-soft); }
.share-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.share-index-item { display: grid; gap: 6px; text-decoration: none; }
.share-index-item img, .share-index-item .no-photo { aspect-ratio: 4 / 3; width: 100%; height: auto; border-radius: var(--r-sm); object-fit: cover; }
.share-index-item span { display: grid; }
.share-flat { padding: 20px 0 0; border-top: 1px solid var(--rule); scroll-margin-top: 12px; }
.share-flat.card-page { padding-left: 0; padding-right: 0; }
.share-flat-title { display: flex; align-items: baseline; gap: 10px; font: 700 clamp(1.25rem, 2.2vw, 1.75rem)/1.2 var(--body); }
.share-no {
  flex: none;
  min-width: 1.8em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8em;
  text-align: center;
}

/* On a phone the selection is an icon with its count, so the header stays on
   one line; the word stays for screen readers. */
@media (max-width: 560px) {
  .head-picks { gap: 4px; min-height: 34px; padding: 6px 10px; white-space: nowrap; }
  .head-picks-icon { display: block; }
  .head-picks-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 360px) {
  .head-picks { padding: 5px 8px; }
}
/* With the selection button there is no room for the name on a phone: the
   mark alone leads home, and the name stays for screen readers. */
@media (max-width: 480px) {
  .site-head.has-picks .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-head.has-picks .brand { padding: 8px 0; }
}
