/* Appraisle. A drafting table at night: graphite paper, a cyanotype blueprint for
   the drawings, and tape-measure yellow for the things you press. */

:root {
  --paper: #edeff2;
  --surface: #ffffff;
  --surface-2: #f4f5f7;
  --ink: #17202b;
  --ink-soft: #5a6474;
  --rule: #d4d9df;
  --accent: #f2bb1d;
  --on-accent: #1d1603;
  --accent-ink: #8a6200;
  --good: #1d8a50;
  --close: #b07d00;
  --bad: #c2412f;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hand: 'Architects Daughter', 'Segoe Print', cursive;
  --stripe: 8px;
  color-scheme: light;
}

/* Dark: the default, set by data-theme="dark" on <html>. Without it, follows the device. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151b;
    --surface: #181d25;
    --surface-2: #1f2530;
    --ink: #eaeef3;
    --ink-soft: #9ba5b3;
    --rule: #2b323e;
    --accent: #f7c948;
    --on-accent: #1d1603;
    --accent-ink: #f7c948;
    --good: #6ad39b;
    --close: #f7c948;
    --bad: #ff8070;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11151b;
  --surface: #181d25;
  --surface-2: #1f2530;
  --ink: #eaeef3;
  --ink-soft: #9ba5b3;
  --rule: #2b323e;
  --accent: #f7c948;
  --on-accent: #1d1603;
  --accent-ink: #f7c948;
  --good: #6ad39b;
  --close: #f7c948;
  --bad: #ff8070;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The ruler: Appraisle's edge, under the Goldfish Water Cooler bar. White ticks on blueprint blue. */
.edge {
  display: block;
  height: var(--stripe);
  background-color: #1c4d8c;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8'%3E%3Cpath d='M.5 0v8M20.5 0v5.5M4.5 0v3M8.5 0v3M12.5 0v3M16.5 0v3M24.5 0v3M28.5 0v3M32.5 0v3M36.5 0v3' stroke='%23eef5ff' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  background-size: 40px 8px;
}

/* --- Header ---------------------------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(16px, 3vw, 28px);
  height: 64px;
}
.wordmark {
  margin: 0;
  font-size: 27px;
  font-weight: 850;
  font-stretch: 125%;
  font-variation-settings: 'wdth' 125;
  letter-spacing: -0.015em;
  line-height: 1;
}
.wordmark span { color: var(--accent-ink); }
.edition {
  margin: 0 0 0 6px;
  flex: 1;
  color: var(--ink-soft);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  font-weight: 750;
  font-size: 17px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn { position: relative; color: var(--ink); }
.icon-btn[hidden] { display: none; }
/* A red dot on What's new until you've opened the latest entry. */
.unread-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--paper);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- The two puzzles ---------------------------------------------------------- */

.modes {
  display: flex;
  gap: 8px;
  padding: 0 clamp(16px, 3vw, 28px) 14px;
}
.mode {
  display: grid;
  gap: 1px;
  min-width: 150px;
  padding: 8px 16px 9px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mode:hover { border-color: var(--ink-soft); }
.mode[aria-current="page"] { border-color: var(--ink); background: var(--surface); }
.mode-name {
  font-weight: 750;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  font-size: 16px;
  line-height: 1.2;
}
.mode-sub { font-size: 13px; color: var(--ink-soft); }
.mode.is-done .mode-sub { color: var(--good); }

/* --- Layout: the sheet on the left, the report on the right --------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  gap: 20px;
  padding: 0 clamp(16px, 3vw, 28px);
  height: calc(100dvh - 36px - var(--stripe) - 64px - 74px - 44px);
  min-height: 600px;
}
.side { min-height: 0; overflow-y: auto; padding: 0 4px 24px 0; scrollbar-gutter: stable; }

/* The sheet: plans on top, the front and the map below, a title block along the bottom. */
.sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 0.72fr) auto;
  min-height: 0;
  padding: 22px 24px 18px;
}
.sheet.is-map-big { grid-template-rows: auto minmax(0, 0.62fr) minmax(0, 1.25fr) auto; }
.sheet.is-map-big .sheet-lower { grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr); }
.sheet-views { display: none; grid-row: 1; }
.sheet-plans { grid-row: 2; }
.sheet-lower { grid-row: 3; }
.title-block { grid-row: 4; }
.sheet-plans {
  position: relative;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  padding: 4px 4px 10px;
}
.sheet-plans figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.sheet-plans figcaption, .sheet-lower figcaption {
  font-family: var(--hand);
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bp-line);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.sheet-plans figcaption small { font-size: 11px; color: var(--bp-soft); text-decoration: none; letter-spacing: 0.06em; }
.sheet-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
  min-height: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--bp-faint);
}
.sheet-lower figure { margin: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 6px; }
.sheet-lower figcaption { justify-self: start; }
.front-box, .map-box { position: relative; min-height: 0; display: grid; place-items: center; }
.front-box svg { max-width: 100%; max-height: 100%; }

.sheet-empty {
  font-family: var(--hand);
  color: var(--bp-soft);
  font-size: 18px;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.5;
}

/* The title block, the strip of boxes every drawing set has in its corner. */
.title-block {
  display: flex;
  flex-wrap: wrap;
  margin-top: 12px;
  border: 1.5px solid var(--bp-soft);
  font-family: var(--hand);
  color: var(--bp-line);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 13px;
  line-height: 1.25;
}
.title-block > div { flex: 1 1 auto; padding: 5px 10px 6px; border-right: 1px solid var(--bp-faint); min-width: 0; }
.title-block > div:last-child { border-right: 0; }
.title-block small { display: block; font-size: 9.5px; color: var(--bp-soft); letter-spacing: 0.1em; }
.title-block .tb-name { font-family: var(--font); font-weight: 850; font-stretch: 125%; font-variation-settings: 'wdth' 125; text-transform: none; letter-spacing: 0; font-size: 15px; }

/* The map's pins: the house, and the comps. */
.bp-map .mp-sea { fill: url(#bp-wave); }
.bp-map .mp-land { fill: var(--bp); stroke: var(--bp-soft); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.bp-map .mp-water { fill: var(--bp-deep); stroke: var(--bp-soft); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.bp-map .mp-area { fill: transparent; stroke: rgba(238, 245, 255, 0.2); stroke-width: 0.8px; vector-effect: non-scaling-stroke; transition: fill 0.25s; }
.bp-map .mp-area.is-lit { fill: rgba(255, 211, 77, 0.13); stroke: rgba(255, 211, 77, 0.45); }
.bp-map .mp-area.is-dim { fill: rgba(9, 25, 50, 0.25); }
.bp-map .mp-area.is-chosen { fill: rgba(255, 211, 77, 0.28); stroke: var(--bp-mark); stroke-width: 1.6px; }
.bp-map.is-interactive .mp-area:not(.is-empty) { cursor: pointer; }
.bp-map.is-interactive .mp-area:not(.is-empty):hover { fill: rgba(238, 245, 255, 0.12); }
.bp-map .mp-limits { fill: none; stroke: var(--bp-line); stroke-width: 1.6px; stroke-dasharray: 7 3 2 3; vector-effect: non-scaling-stroke; opacity: 0.75; }
.bp-map .mp-road-case { fill: none; stroke: var(--bp); stroke-width: 4px; vector-effect: non-scaling-stroke; }
.bp-map .mp-road { fill: none; stroke: rgba(238, 245, 255, 0.62); stroke-width: 1.6px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.bp-map .mp-water-label { font-family: var(--hand); fill: var(--bp-soft); font-size: calc(15px / var(--z, 1)); letter-spacing: 0.12em; }
.bp-map .mp-downtown path { fill: var(--bp-line); }
.bp-map .mp-downtown-label { font-family: var(--hand); fill: var(--bp-line); letter-spacing: 0.08em; text-transform: uppercase; }
.bp-map .mp-scale path, .bp-map .mp-north circle { fill: none; stroke: var(--bp-soft); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.bp-map .mp-north path { fill: var(--bp-line); }
.bp-map .mp-scale text, .bp-map .mp-north text { font-family: var(--hand); fill: var(--bp-soft); }

.mp-pin {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  pointer-events: none;
}
.mp-pin.is-placed { transition: left 0.9s cubic-bezier(0.5, 0, 0.2, 1), top 0.9s cubic-bezier(0.5, 0, 0.2, 1); }
.mp-pin-house {
  background: var(--bp-mark);
  border: 3px solid #0d2a52;
  box-shadow: 0 0 0 2px var(--bp-mark);
}
.mp-pin-house::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid var(--bp-mark);
  opacity: 0;
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.4); opacity: 0.9; } 70%, 100% { transform: scale(1.5); opacity: 0; } }
.mp-pin-comp {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  background: var(--bp-line);
  color: #0d2a52;
  font: 800 11px/20px var(--font);
  text-align: center;
  border: 2px solid #0d2a52;
}

/* --- The report: the panel on the right ------------------------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 20px 22px 22px;
}
.panel + .panel { margin-top: 14px; }
.kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.dots { display: flex; gap: 6px; }
.dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
}
.dots i.is-now { border-color: var(--accent); background: var(--accent); }
.dots i.is-good { background: var(--good); border-color: var(--good); }
.dots i.is-close { background: var(--close); border-color: var(--close); }
.dots i.is-bad { background: var(--bad); border-color: var(--bad); }
.place-name {
  margin: 0;
  font-size: 28px;
  font-weight: 850;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.place-sub { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }
.place-sub b { color: var(--ink); font-weight: 650; }

/* The facts, laid out like the subject section of an appraisal form: two columns
   of label and value. */
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  margin: 14px 0 0;
  border-top: 1px solid var(--rule);
}
.facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 6px 0 7px;
  border-bottom: 1px solid var(--rule);
}
.facts div.wide { grid-column: 1 / -1; display: block; }
.facts dt { flex: none; font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.facts dd { margin: 0; font-weight: 650; font-size: 14.5px; line-height: 1.3; text-align: right; overflow-wrap: anywhere; }
.facts div.wide dd { text-align: left; margin-top: 2px; }
.facts dd small { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.facts .is-blank { visibility: hidden; }

/* Comps. */
.comps { margin-top: 12px; }
.comps h3, .guess h3 { margin: 0 0 8px; font-size: 15px; font-weight: 750; }
.comps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comps-head p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.comp {
  margin-top: 8px;
  padding: 10px 12px 11px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface-2);
}
.comp-top { display: flex; align-items: center; gap: 10px; }
.comp-n {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: #eef5ff;
  color: #0d2a52;
  border: 2px solid #0d2a52;
  font: 800 11px/18px var(--font);
  text-align: center;
}
.comp-price { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.comp-when { margin-left: auto; font-size: 13px; color: var(--ink-soft); text-align: right; line-height: 1.25; }
.comp-facts { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.4; }
.comp-facts b { color: var(--ink); font-weight: 650; }
.comp-facts .more { color: var(--good); }
.comp-facts .less { color: var(--bad); }
.comp .comp-view { margin-top: 4px; font-size: 13px; color: var(--ink-soft); }
.pull {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1.5px dashed var(--rule);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.pull:hover { border-color: var(--ink-soft); border-style: solid; }
.pull .cost { color: var(--ink-soft); font-weight: 600; margin-left: auto; white-space: nowrap; }
.pull small { display: block; font-weight: 450; font-size: 12.5px; color: var(--ink-soft); }
.pull { align-items: center; }

/* Map overlays you can buy. */
.overlays { margin-top: 12px; }
.overlays-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.overlays-head small { font-weight: 450; font-size: 12.5px; color: var(--ink-soft); }
.overlays .choice.buy { border-style: dashed; }
.overlays .choice.buy small { display: inline; margin-left: 6px; font-weight: 600; }
.overlay-note { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.overlay-note b { color: var(--ink); font-weight: 650; }
.mp-legend {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  display: grid;
  gap: 4px;
  max-width: min(260px, 70%);
  padding: 7px 9px 8px;
  border-radius: 8px;
  background: rgba(10, 30, 60, 0.82);
  color: var(--bp-line);
  font: 11px/1.3 var(--font);
}
.mp-legend b { font-weight: 650; }
.mp-swatches { display: flex; gap: 2px; }
.mp-swatches i { flex: 1; height: 9px; border-radius: 2px; }
.mp-ends { display: flex; justify-content: space-between; gap: 8px; color: var(--bp-soft); }
.mp-none { display: flex; align-items: center; gap: 5px; color: var(--bp-soft); }
.mp-none i { width: 12px; height: 9px; border: 1px dashed var(--bp-faint); border-radius: 2px; }
.bp-map .mp-area.is-shaded { stroke: rgba(238, 245, 255, 0.35); }
.bp-map .mp-area.is-nodata { fill: rgba(9, 25, 50, 0.35); }

/* The guess: a price you can type, and a tape measure you can pull. */
.guess { margin-top: 14px; }
.price-field {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}
.price-field span { font-size: 26px; font-weight: 750; color: var(--ink-soft); }
.price-field input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.price-field input:focus { outline: none; }
.price-field:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.tape { position: relative; margin: 12px 0 0; height: 40px; }
.tape input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: grab;
  z-index: 2;
}
.tape-body {
  position: absolute;
  inset: 0 0 12px;
  border-radius: 6px;
  background: var(--accent);
  overflow: hidden;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.tape-ticks {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(29, 22, 3, 0.85) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29, 22, 3, 0.55) 1px, transparent 1px);
  background-size: 50px 13px, 10px 7px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 0;
}
.tape-labels { position: absolute; inset: 0; font: 700 10px/1 var(--font); color: var(--on-accent); }
.tape-labels span { position: absolute; top: 16px; transform: translateX(-50%); white-space: nowrap; }
.tape-hook {
  position: absolute;
  top: -4px;
  bottom: 6px;
  width: 4px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--ink);
  box-shadow: 0 0 0 2px var(--surface);
  pointer-events: none;
  transition: left 0.08s;
}
.tape input:focus-visible + .tape-body { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Fine adjustment under the tape: a dollar amount at a time. */
.nudge { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.nudge button {
  padding: 8px 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: 650 14px/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.nudge button:hover { border-color: var(--ink-soft); }
.nudge button:active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nudge button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tape-note { margin: 0; font-size: 12px; color: var(--ink-soft); display: flex; justify-content: space-between; }

.btn {
  width: 100%;
  margin-top: 14px;
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 750;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  font-size: 17px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.5; cursor: default; filter: none; }
.btn-line {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.note { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.note:empty { display: none; }
.note.is-bad { color: var(--bad); }

/* The reveal. */
.reveal { text-align: left; }
.reveal-label { margin: 0; font-size: 14px; color: var(--ink-soft); }
.reveal-price {
  margin: 0;
  font-size: 44px;
  font-weight: 850;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.reveal-off { margin: 6px 0 0; font-size: 16px; }
.reveal-off b { font-variant-numeric: tabular-nums; }
.is-good { color: var(--good); }
.is-close { color: var(--close); }
.is-bad { color: var(--bad); }
.ruler-result { position: relative; height: 70px; margin: 18px 0 2px; }
.ruler-result .line { position: absolute; left: 0; right: 0; top: 22px; height: 2px; background: var(--rule); }
.ruler-result .mark { position: absolute; top: 14px; transform: translateX(-50%); display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.ruler-result .mark i { width: 2px; height: 16px; background: currentColor; }
.ruler-result .mark.actual { top: 0; color: var(--ink); font-weight: 700; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; }
.ruler-result .mark.actual i { width: 3px; height: 30px; }
.ruler-result .mark.yours { top: 20px; font-weight: 750; font-size: 12px; }
.ruler-result .mark.yours i { width: 4px; height: 22px; border-radius: 2px; }
.ruler-result .span { position: absolute; top: 20px; height: 6px; border-radius: 3px; background: var(--accent); opacity: 0.35; }
.ruler-result .mark.actual { top: -14px; }
.points {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}
.points b { font-size: 30px; font-weight: 850; font-variant-numeric: tabular-nums; }
.points span { color: var(--ink-soft); font-size: 14px; }

/* The day's summary. */
.summary h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  line-height: 1.15;
}
.score-big { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 2px; }
.score-big b { font-size: 52px; font-weight: 850; font-stretch: 112%; font-variation-settings: 'wdth' 112; line-height: 1; font-variant-numeric: tabular-nums; }
.score-big span { color: var(--ink-soft); font-size: 16px; }
.rows { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.rows li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 0 10px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.rows .sw { width: 12px; height: 12px; border-radius: 3px; align-self: center; background: var(--ink-soft); }
.rows .sw.is-good { background: var(--good); }
.rows .sw.is-close { background: var(--close); }
.rows .sw.is-bad { background: var(--bad); }
.rows .what b { font-weight: 650; }
.rows .what small { display: block; color: var(--ink-soft); font-size: 13px; }
.rows .pts { font-weight: 750; font-variant-numeric: tabular-nums; }
.share-text {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  white-space: pre-wrap;
  user-select: all;
}
.next { margin: 12px 0 0; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* --- Build ----------------------------------------------------------------------------- */

.brief { margin: 0; }
.brief .budget {
  display: block;
  font-size: 40px;
  font-weight: 850;
  font-stretch: 112%;
  font-variation-settings: 'wdth' 112;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.brief .where { display: block; margin-top: 4px; font-size: 18px; font-weight: 650; }
.brief-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }

.questions { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: q; }
.q {
  counter-increment: q;
  padding: 12px 0 13px;
  border-top: 1px solid var(--rule);
}
.q[hidden] { display: none; }
.q.is-new { animation: arrive 0.35s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.q-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 8px; }
.q-head label, .q-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.q-head label::before, .q-head h3::before { content: counter(q) '. '; color: var(--ink-soft); font-weight: 600; }
.q-head output { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.q-hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice {
  padding: 7px 12px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.2;
}
.choice:hover { border-color: var(--ink-soft); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.choice small { display: block; font-weight: 500; font-size: 11.5px; opacity: 0.8; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--rule); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 36px; border: 0; background: transparent; font-size: 20px; font-weight: 600; cursor: pointer; }
.stepper button:hover:not(:disabled) { background: var(--surface-2); }
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.steppers { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.steppers .pair { display: inline-flex; align-items: center; gap: 8px; }
.steppers .pair > span { font-size: 13px; color: var(--ink-soft); }
.range { width: 100%; accent-color: var(--accent); }
.q-next { margin-top: 10px; padding: 7px 14px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 750; font-size: 14px; cursor: pointer; }
.spot { margin: 8px 0 0; font-size: 14px; }
.spot b { font-weight: 700; }
.spot small { display: block; color: var(--ink-soft); font-size: 13px; }
.effects { list-style: none; margin: 12px 0 0; padding: 0; }
.effects li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.effects li span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.effects .up { color: var(--good); }
.effects .down { color: var(--bad); }

/* --- Dialogs ----------------------------------------------------------------------------- */

dialog {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 26px 26px 22px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: rgba(9, 12, 16, 0.55); }
dialog h2 { margin: 0 0 12px; font-size: 24px; font-weight: 800; font-stretch: 112%; font-variation-settings: 'wdth' 112; }
dialog h3 { margin: 20px 0 6px; font-size: 16px; font-weight: 750; }
dialog p, dialog li { font-size: 15px; }
dialog ul { padding-left: 1.1em; margin: 6px 0; }
dialog li { margin: 6px 0; }
dialog .small { font-size: 13px; color: var(--ink-soft); }
dialog.news { width: min(540px, calc(100vw - 32px)); }

/* How everyone did: a chart for each puzzle. */
dialog.everyone { width: min(560px, calc(100vw - 32px)); }
.ev-section + .ev-section { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 4px; }
.ev-section h3 { margin-top: 14px; }
.ev-quiet { color: var(--ink-soft); }
.ev-head b { font-variant-numeric: tabular-nums; }
.ev-teaser { margin: 0 0 4px; font-weight: 650; }
.ev-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.ev-figures div { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 10px; }
.ev-figures dt { font-size: 12px; color: var(--ink-soft); }
.ev-figures dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ev-figures dd small { font-size: 13px; font-weight: 700; }
.ev-chart { position: relative; margin: 16px 0 6px; }
.ev-plot {
  position: relative;
  display: grid;
  column-gap: 2px;
  height: 156px;
  padding-top: 40px;
  border-bottom: 1px solid var(--ink-soft);
}
.ev-slot { position: relative; display: flex; align-items: flex-end; justify-content: center; border-radius: 3px; }
.ev-slot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ev-col { display: block; width: 100%; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--ink-soft) 55%, transparent); }
.ev-slot:hover .ev-col, .ev-slot:focus-visible .ev-col { background: var(--ink-soft); }
.ev-slot.mine .ev-col { background: var(--accent); }
.ev-you { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800; color: var(--ink); white-space: nowrap; pointer-events: none; }
.ev-you.start { left: 0; transform: none; }
.ev-you.end { left: auto; right: 0; transform: none; }
.ev-average { position: absolute; top: 6px; bottom: 0; width: 0; border-left: 2px dashed var(--ink); opacity: 0.7; pointer-events: none; }
.ev-average span { position: absolute; top: -4px; left: 5px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.ev-average.flip span { left: auto; right: 7px; }
.ev-axis { position: relative; height: 20px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ev-tick { position: absolute; top: 0; width: 1px; height: 4px; background: var(--ink-soft); }
.ev-label { position: absolute; top: 5px; transform: translateX(-50%); }
.ev-label.first { transform: none; }
.ev-label.last { transform: translateX(-100%); }
.ev-chart figcaption { font-size: 12px; color: var(--ink-soft); }
.ev-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -100%);
  display: grid;
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.5);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}
.ev-tip[hidden] { display: none; }
.ev-tip b { font-size: 14px; }
.ev-tip span { color: var(--ink-soft); }
.changes { list-style: none; margin: 0; padding: 0; }
.changes > li { border-top: 1px solid var(--rule); padding: 14px 0 4px; margin: 0; }
.changes > li:first-child { border-top: 0; padding-top: 2px; }
.changes h3 { margin: 2px 0 6px; }
.changes ul { color: var(--ink-soft); }
.change-date { margin: 0; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.close:hover { background: var(--paper); }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.figures dt { font-size: 12px; color: var(--ink-soft); line-height: 1.25; }
.figures dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { text-decoration-color: currentColor; }
.colophon { margin: 14px clamp(16px, 3vw, 28px) 22px; font-size: 13px; color: var(--ink-soft); }
.colophon a { color: var(--ink); text-underline-offset: 3px; }

/* --- Phones and narrow windows ------------------------------------------------------------- */

@media (max-width: 900px) {
  .layout { display: block; height: auto; min-height: 0; padding: 0 12px; }
  .sheet { display: block; padding: 14px 14px 12px; }
  .sheet-views { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; position: relative; z-index: 1; }
  .sheet-views button {
    padding: 5px 10px;
    border: 1px solid var(--bp-faint);
    border-radius: 8px;
    background: transparent;
    color: var(--bp-soft);
    font-family: var(--hand);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .sheet-views button[aria-selected="true"] { border-color: var(--bp-line); color: var(--bp-line); background: rgba(238, 245, 255, 0.1); }
  .sheet-plans { height: min(58vh, 420px); flex-wrap: nowrap; }
  .sheet-plans figcaption { display: none; }
  .sheet-lower { display: block; border-top: 0; padding: 0; }
  .sheet-lower figure { height: min(58vh, 420px); grid-template-rows: minmax(0, 1fr); }
  .sheet-lower figcaption { display: none; }
  .sheet[data-view] .sheet-plans, .sheet[data-view] .sheet-front, .sheet[data-view] .sheet-map { display: none; }
  .sheet[data-view="plans"] .sheet-plans { display: flex; }
  .sheet[data-view="front"] .sheet-front { display: grid; }
  .sheet[data-view="map"] .sheet-map { display: grid; }
  .title-block { font-size: 11px; }
  .title-block > div:nth-child(n + 4) { display: none; }
  .side { padding: 14px 0 20px; overflow: visible; }
  .panel { padding: 18px 16px 18px; }
  .modes { padding-bottom: 12px; }
  .mode { flex: 1; min-width: 0; }
  .bar { height: 56px; }
  .wordmark { font-size: 23px; }
  .place-name { font-size: 26px; }
}

@media (max-width: 380px) {
  .edition { display: none; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(even) { padding-left: 0; border-left: 0; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --- Goldfish Water Cooler bar ----------------------------------------------
   Copied unchanged from goldfishwatercooler.com's brand/gwc-bar.css. */

/* Goldfish Water Cooler: the bar every game wears at the very top.
   Copy this file into a game unchanged and paste gwc-bar.html as the first
   thing in <body>. It brings its own colors, so it looks the same in every game
   whatever the game's palette. It uses Gabarito and Archivo (see README.md) and
   falls back to system fonts without them. */

.gwc-bar {
  --gwc-water: #072b3d;
  --gwc-ink: #cfe6ef;
  --gwc-fish: #f26a1b;
  --gwc-fish-light: #ff9a4d;
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 36px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: var(--gwc-water);
  color: var(--gwc-ink);
  font: 600 13px/1 "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: 0.01em;
}

.gwc-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.gwc-bar .gwc-fish {
  width: 26px;
  height: 16px;
  margin-right: 2px;
  flex: none;
}

/* The hub's own wordmark: lowercase Gabarito. */
.gwc-bar .gwc-name {
  font: 800 15px/1 "Gabarito", "Archivo", system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: #fff;
}

.gwc-bar .gwc-more {
  color: var(--gwc-fish-light);
  font-weight: 750;
}

.gwc-bar .gwc-short {
  display: none;
}

.gwc-bar a:hover .gwc-name,
.gwc-bar .gwc-more:hover {
  text-decoration: underline;
  text-decoration-color: var(--gwc-fish);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.gwc-bar a:focus-visible {
  outline: 2px solid var(--gwc-fish-light);
  outline-offset: 3px;
  border-radius: 4px;
}

/* On a phone: the fish, the name, and "More games". */
@media (max-width: 480px) {
  .gwc-bar .gwc-long {
    display: none;
  }

  .gwc-bar .gwc-short {
    display: inline;
  }
}

@media print {
  .gwc-bar {
    display: none;
  }
}

.map-frame { position: relative; overflow: hidden; touch-action: pan-y; }
.map-frame svg { display: block; width: 100%; height: 100%; }
.map-frame svg.bp-furniture { position: absolute; inset: 0; pointer-events: none; }
.map-frame.is-zoomed { touch-action: none; cursor: grab; }
.map-frame.is-zoomed:active { cursor: grabbing; }
.map-frame.is-moving .mp-pin { transition: none; }
.mp-pin.is-off { visibility: hidden; }

/* Zoom buttons in the map's corner. */
.map-zoom { position: absolute; top: 6px; right: 6px; z-index: 3; display: flex; flex-direction: column; gap: 3px; }
.map-zoom button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--bp-soft);
  border-radius: 7px;
  background: rgba(22, 63, 117, 0.88);
  color: var(--bp-line);
  font: 600 17px/1 var(--font);
  cursor: pointer;
  touch-action: manipulation;
}
.map-zoom button:hover { border-color: var(--bp-line); }
.map-zoom button:disabled { opacity: 0.4; cursor: default; }
.map-zoom button:focus-visible { outline: 2px solid var(--bp-mark); outline-offset: 1px; }
@media (max-width: 900px) { .map-zoom button { width: 34px; height: 34px; font-size: 20px; } }
.map-frame:not(.is-zoomed) .map-zoom-reset { display: none; }
