/* Paris Flats Board. Tokens inherited from the DDiB auction system,
   recolored semantically. No DDiB pattern, no UZH wordmark. */

@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-It.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/SourceSans3-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #575760;
  --faint: #b2b2be;
  --line: #111111;
  --navy: #0028a5;
  --navy-hover: #334fbb;
  --fav: #f2c235;
  --flash: #dce3f8;
  --highlight: #eef1fb;
  --accent: var(--navy);
  --error: #bf0d3e;
  --ok: #2a7f62;
  --photo-bg: #e3e2df;
  --font: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
  --max: min(72rem, 90vw);
  --narrow: 34rem;
  --rail: 4px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.topbar-inner,
.main,
.foot-inner {
  width: min(100% - 4rem, var(--max));
  margin: 0 auto;
}

.topbar {
  background: var(--bg);
  border-top: 4px solid var(--fav);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.75rem;
  padding: 1.15rem 0;
  font-size: 0.95rem;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.65rem;
}
.brand-org, .brand-unit { font-weight: 600; }
.brand-sub { color: var(--muted); }

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 1.1rem;
}

.topbar a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.topbar a:hover { text-decoration-thickness: 2px; }
.topbar a[aria-current="page"] { font-weight: 600; text-decoration-thickness: 2px; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.main { flex: 1; padding: 2.5rem 0 3.5rem; }

h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  text-wrap: balance;
}

h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

.lede {
  font-size: 1.02em;
  color: var(--muted);
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

hr.hairline {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

footer {
  margin-top: auto;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 4px solid var(--fav);
}
footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
footer a:hover { color: var(--navy); }
.foot-inner {
  padding: 1.15rem 0 1.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  justify-content: space-between;
}

.btn {
  appearance: none;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: 1px solid var(--navy);
  border-radius: 0;
  background: var(--navy);
  color: #ffffff;
  padding: 0.65rem 1.35rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn:hover:not(:disabled) { background: var(--navy-hover); border-color: var(--navy-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover:not(:disabled) {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
.btn-danger:hover:not(:disabled) { background: var(--error); border-color: var(--error); color: #fff; }
.btn-sm { font-size: 0.9rem; padding: 0.42rem 0.85rem; }

.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.field input:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.form-error {
  color: var(--error);
  font-size: 0.95rem;
  min-height: 1.3em;
  margin: 0.5rem 0 0.85rem;
}
.form-error:empty { min-height: 0; margin: 0; }

.form-note {
  margin: 0.15rem 0 1.15rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--fav);
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 42rem;
}
.form-narrow { max-width: var(--narrow); }

.kicker {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stagebar, .facts-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 1.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.95em;
  margin-bottom: 1.75rem;
}
.stagebar .meta, .facts-strip .meta { color: var(--muted); }
.stagebar .meta strong, .facts-strip .meta strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.facts-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  container-type: scroll-state;
  background: transparent;
}
@container scroll-state(stuck: top) {
  .facts-strip {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
}

.panel {
  border: 1px solid var(--line);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: #fff;
}
.panel-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.9rem; }

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  flex-wrap: wrap;
}
.seg button {
  appearance: none;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: #fff;
  color: var(--ink);
  border: none;
  border-right: 1px solid var(--line);
  padding: 0.5rem 1.05rem;
  cursor: pointer;
}
.seg button:last-child { border-right: none; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.seg button:hover:not([aria-pressed="true"]) { color: var(--navy); }

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0 2rem;
}
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}
.toolbar-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 4.5rem;
}

.photo-frame {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--photo-bg);
  overflow: hidden;
  padding: 0;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2.5rem;
}
.listing-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem 0 1.75rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: transparent;
}
.listing-card .card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.listing-card .photo-frame {
  aspect-ratio: 3 / 2;
}
.listing-card h2, .listing-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.listing-card .card-facts {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.listing-card .fact-line {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.listing-card .price {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  white-space: nowrap;
}

[data-state="fav"] {
  box-shadow: inset var(--rail) 0 0 var(--fav);
  background: linear-gradient(90deg, rgba(242, 194, 53, 0.13), #fff 45%);
  padding-left: 0.85rem;
}
[data-state="flagged"] { box-shadow: inset var(--rail) 0 0 var(--error); padding-left: 0.85rem; }
[data-state="flagged"] img { filter: grayscale(1); opacity: 0.55; }
[data-state="flagged"] h2, [data-state="flagged"] h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.pill-new {
  display: inline-block;
  font: 600 0.75rem/1 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ok);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
}

.icon-btn {
  appearance: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0;
  padding: 0;
}
.icon-btn svg { width: 1rem; height: 1rem; display: block; }
.icon-btn:hover { color: var(--navy); border-color: var(--navy); }
.icon-btn[aria-pressed="true"].is-fav {
  background: var(--fav);
  border-color: var(--ink);
  color: var(--ink);
}
.icon-btn.is-flag[aria-pressed="true"] {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.icon-pair { display: inline-flex; gap: 0.35rem; }

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--ink);
  text-underline-offset: 0.15em;
}

.diashow { margin: 1.25rem 0 1.75rem; }
.diashow-main {
  aspect-ratio: 3 / 2;
  max-height: 72vh;
  width: 100%;
}
.diashow-main img { object-fit: cover; }
.diashow-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
}
.diashow-count {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  color: var(--muted);
}
.diashow-nav { display: flex; gap: 0.35rem; }
.thumbs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
}
.thumbs button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--photo-bg);
  padding: 0;
  width: 4.25rem;
  height: 2.85rem;
  cursor: pointer;
  flex: 0 0 auto;
  border-radius: 0;
}
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button[aria-current="true"] {
  box-shadow: inset 0 -4px 0 var(--accent);
}

.split-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.note-block { padding-left: 0.85rem; }
.note-block.why { border-left: 3px solid var(--accent); }
.note-block.trade { border-left: 3px solid var(--muted); }
.note-block .kicker { margin-bottom: 0.55rem; }
.note-block.why .kicker { color: var(--navy); }
.note-block ul { list-style: none; }
.note-block.why li { padding-left: 1rem; position: relative; margin-bottom: 0.4rem; }
.note-block.why li::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  background: var(--navy);
  position: absolute;
  left: 0;
  top: 0.45em;
}
.note-block.trade li { padding-left: 1rem; position: relative; margin-bottom: 0.4rem; }
.note-block.trade li::before {
  content: "-";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.value-panel { margin: 2rem 0; }
.value-panel .countdown {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 700;
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.value-panel .countdown-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.35rem;
}
.value-chart { width: 100%; max-width: 28rem; margin-top: 1rem; }
.value-chart text {
  font-family: var(--font);
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums;
}

.map-frame {
  border: 1px solid var(--line);
  height: 22rem;
  margin: 1.25rem 0 0.65rem;
  background: var(--photo-bg);
}
.map-frame .maplibregl-map { width: 100%; height: 100%; }
.map-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}
.map-caption a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1rem;
}

.meta-rows { margin: 1.5rem 0; }
.meta-rows .pw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.meta-rows .pw-round { color: var(--muted); font-weight: 600; min-width: 6rem; }

.waiting {
  padding: 1.75rem 0 2.25rem;
  color: var(--muted);
}
.waiting-big { font-size: 1.3rem; font-weight: 600; color: var(--ink); }

.spin {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  border: 1.5px solid var(--faint);
  border-top-color: var(--muted);
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: mhm-spin 0.8s linear infinite;
}
@keyframes mhm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 2.4s; }
}

[popover] {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 0.85rem 1rem;
  color: var(--ink);
  font: inherit;
  inset: unset;
  top: anchor(bottom);
  left: anchor(left);
  margin-top: 0.4rem;
  box-shadow: none;
}
[popover] p { margin-bottom: 0.75rem; font-size: 0.95rem; }
[popover] .modal-actions { display: flex; gap: 0.5rem; justify-content: space-between; }

.undo-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.7rem 1rem;
  z-index: 20;
}

@media (max-width: 640px) {
  .topbar-inner, .main, .foot-inner { width: min(100% - 2rem, var(--max)); }
  .main { padding: 2rem 0 2.75rem; }
  .listing-grid { grid-template-columns: 1fr; }
  .split-notes { grid-template-columns: 1fr; }
  .form-narrow .btn, #login-form .btn { width: 100%; min-height: 2.9rem; padding: 0.8rem 1.35rem; }
  .listing-card .price { font-size: 1.25rem; }
}
