/* ============================================================================
   기상 합의 · ENSEMBLE — probabilistic weather as an operable instrument.
   Light editorial discipline carried from the 위드씨에이 report system (유진분석):
   single white surface, NO boxed cards / borders / shadows — separation by
   hairlines (#e5e7ea) and whitespace only. But composed as an APP SHELL, not a
   document: a control rail + a live instrument canvas, day tabs, a "right now"
   readout, load-in motion. Lavender (#5e6ad2) is the brand mark alone. Precip
   ramp validated on white; monospaced numerics.

   2026-07 "공기(Air)" revision: the active day's forecast tints the screen's
   atmosphere — an ultra-low-chroma sky wash at the top (clear=warm ivory,
   unsettled=neutral mist, rainy=cool blue-grey), rounded geometry, breathing
   motion. Decorative gradients stay banned; this wash is data-driven air, the
   one sanctioned exception (spec: docs/superpowers/specs/2026-07-10-air-design.md).
   ============================================================================ */

/* Registered so the sky can cross-fade when the mood changes (falls back to an
   instant switch in browsers without @property). */
@property --air {
  syntax: "<color>";
  inherits: true;
  initial-value: #f9fafb;
}
@property --air-deep {
  syntax: "<color>";
  inherits: true;
  initial-value: #f4f5f7;
}

:root {
  --surface: #ffffff;
  --ink: #17181c;
  --ink-muted: #4a4e57;
  --ink-subtle: #7c828d;
  --ink-faint: #a4a9b2;

  --hairline: #e5e7ea;
  --hairline-strong: #d3d6db;

  --brand: #5e6ad2;
  --brand-soft: rgba(94, 106, 210, 0.09);

  --p-dry: #aeb7c2; /* must read against both white and the #eef0f3 track */
  --track: #eef0f3;
  --p-light: #6fa8e0;
  --p-mod: #2f7fe0;
  --p-heavy: #143a86;

  /* sky wash — neutral mist until data says otherwise */
  --air: #f9fafb;
  --air-deep: #f4f5f7;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

/* the day's air: data-mood is set by main.js from the active day's forecast */
:root[data-mood="clear"] {
  --air: #faf4e7;
  --air-deep: #f6edda;
}
:root[data-mood="unsettled"] {
  --air: #f1f3f6;
  --air-deep: #e9ecf1;
}
:root[data-mood="rainy"] {
  --air: #e9f0f8;
  --air-deep: #dde8f4;
}
:root {
  transition: --air 0.9s ease, --air-deep 0.9s ease;
}

* {
  box-sizing: border-box;
}
/* the [hidden] attribute must always win — a class like .overlay{display:grid}
   would otherwise override it and keep hidden elements visible. */
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
html,
body {
  max-width: 100%;
  overflow-x: hidden; /* nothing should ever push the page sideways */
}
body {
  margin: 0;
  /* one sheet of sky: the day's air fills the page and settles into white
     toward the ground — the data decides the weather of the screen itself */
  background: linear-gradient(to bottom, var(--air-deep) 0, var(--air) 46%, var(--surface) 100%)
    no-repeat var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

.num,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.eyebrow {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============================================================ Page = sky */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1; /* content rides above the ambient sky layers (body::before/after) */
}

/* Ambient sky: a slow swell of the deep air — the screen breathes (~22s). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, var(--air-deep), transparent 60%);
  animation: breathe 22s ease-in-out infinite alternate;
}
/* Weather grain: the mood gets a texture, not just a color.
   Rain = barely-there streaks drifting down the upper sky; clear = a soft
   sun bloom in the top corner. Unsettled keeps only the breathing mist. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
:root[data-mood="clear"]:not([data-rain]) body::after {
  background: radial-gradient(56rem 36rem at 80% -10%, rgba(255, 199, 110, 0.26), transparent 70%);
  animation: bloom 14s ease-in-out infinite alternate;
}
/* Media-art rain, keyed to the SELECTED hour's leading scenario (main.js sets
   data-rain). Light rain falls thin and slow; heavy rain dense and fast.
   Tapping across the strip plays the day's weather like an instrument. */
/* Rain lives on a dedicated canvas (js/rain.js) — drop-by-drop, not a tiled
   pattern. data-rain stays on <html> as the state hook. */
.rainfx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* --------------------------------------------------------------- Top bar */
.top {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  /* respect phone notches/home bars (viewport-fit=cover) */
  padding: calc(18px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-right, 0px)) 0
    calc(24px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.top__loc {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  align-self: center;
}
.brand__name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
}
.brand__sub {
  font-size: 12px;
  color: var(--ink-subtle);
}

.loc__name {
  margin: 0;
  font-size: 29px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.favs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  background: none;
  border: none;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.chip:hover {
  color: var(--ink);
  background: rgba(23, 24, 28, 0.06);
}
.chip[aria-pressed="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}
.search {
  position: relative;
}
.search__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  pointer-events: none;
}
.search__input {
  width: 150px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(23, 24, 28, 0.09);
  border-radius: 9px;
  padding: 7px 12px 7px 31px;
  transition: border-color 0.15s, background 0.15s, width 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.search__input::placeholder {
  color: var(--ink-faint);
}
.search__input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(23, 24, 28, 0.18);
  width: 200px;
}
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 24, 28, 0.13);
  max-height: 320px;
  overflow-y: auto;
  z-index: 40;
}
.suggest__item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.suggest__item:hover,
.suggest__item[aria-selected="true"] {
  background: var(--brand-soft);
}
.suggest__sido {
  color: var(--ink-subtle);
  font-size: 12px;
}
.suggest__empty {
  padding: 10px;
  color: var(--ink-faint);
  font-size: 13px;
}
.geo {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(23, 24, 28, 0.09);
  border-radius: 9px;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.geo:hover {
  color: var(--ink);
  background: #fff;
}
.geo svg {
  width: 15px;
  height: 15px;
}

/* ------------------------------------------------------- Sheet (content) */
.sheet {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 30px calc(24px + env(safe-area-inset-right, 0px)) calc(48px + env(safe-area-inset-bottom, 0px))
    calc(24px + env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
/* Day tabs — quiet editorial text tabs; the active day simply carries the ink */
.daytabs {
  display: flex;
  gap: 22px;
  flex: none;
}
.daytab {
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-faint);
  background: none;
  border: none;
  padding: 6px 1px 8px;
  position: relative;
  cursor: pointer;
  transition: color 0.25s;
}
.daytab:hover {
  color: var(--ink-muted);
}
.daytab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 650;
}
.daytab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1.5px;
  background: var(--ink);
}

/* Legend — round dots under the strip so the stack colors read without hover
   (phones have no tooltip) */
.legend {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 10px 0 0;
  padding: 0 0 0 36px;
  flex-wrap: wrap;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-subtle);
}
.legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* Strip — the protagonist */
.stripwrap {
  position: relative;
  display: flex;
  gap: 10px;
}
.strip {
  margin-top: 46px;
}
/* clearance so the "지금" marker above the current column clears the label above */
.strip .stripwrap {
  padding-top: 16px;
}
.strip__label {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.strip__axis {
  position: relative;
  width: 26px;
  flex: none;
  height: 140px;
}
.strip__axis span {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
}
.strip__cols {
  position: relative;
  display: flex;
  gap: 5px;
  align-items: flex-end;
  height: 140px;
  flex: 1;
  min-width: 0;
}
.strip__cols::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to top,
    rgba(23, 24, 28, 0.06) 0,
    rgba(23, 24, 28, 0.06) 1px,
    transparent 1px,
    transparent 25%
  );
  pointer-events: none;
}
.col {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.col__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  transform-origin: bottom;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  animation: grow 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.col:hover .col__stack {
  transform: translateY(-3px);
}
.col__seg {
  width: 100%;
}
.col__seg--dry {
  background: var(--p-dry);
}
.col__seg--light {
  background: var(--p-light);
}
.col__seg--mod {
  background: var(--p-mod);
}
.col__seg--heavy {
  background: var(--p-heavy);
}
.col[aria-pressed="true"] .col__stack {
  box-shadow: 0 0 0 2px rgba(47, 127, 224, 0.75); /* data blue, softened */
  transform: translateY(-3px);
}
.col--now::after {
  content: "지금";
  position: absolute;
  top: -19px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--p-mod); /* a time-on-data marker, not a brand mark */
  white-space: nowrap;
}
.strip__times {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  padding-left: 36px;
}
.strip__times span {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}
/* a small tick above labeled hours so each bar's time is traceable */
.strip__times span.tick--on::before {
  content: "";
  display: block;
  width: 1px;
  height: 4px;
  margin: 0 auto 3px;
  background: var(--hairline-strong);
}
.strip__times span.tick--day {
  color: var(--ink-muted);
  font-weight: 600;
}

.tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(23, 24, 28, 0.28);
  min-width: 128px;
}
.tooltip__t {
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}
.tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.tooltip__row .num {
  color: #fff;
}

/* ===== Board — the scenario hero ===== */
.board {
  margin: 0 0 10px;
}
/* re-rendered content settles in with a small breath rather than snapping */
.board > * {
  animation: fadeup 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.board > :nth-child(2) {
  animation-delay: 0.04s;
}
.board > :nth-child(3) {
  animation-delay: 0.08s;
}
.board__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.board__when {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.board__sub {
  font-size: 13px;
  color: var(--ink-subtle);
}
.board__scenarios {
  display: flex;
  flex-direction: column;
}
/* Editorial rows: no boxes, no bubbles. Hairlines and type hierarchy carry the
   structure; the probability bar is a thin, precise instrument line. The lead
   scenario is louder only in ink — restraint is the point. */
.scenario {
  display: grid;
  grid-template-columns: 84px 1fr 76px;
  align-items: center;
  gap: 18px;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid rgba(23, 24, 28, 0.08);
  padding: 15px 6px;
  border-radius: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  transition: background 0.25s;
}
.scenario:first-child {
  border-top: none;
}
.scenario:hover {
  background: rgba(255, 255, 255, 0.45);
}
.scenario__labelcell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scenario__label {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-subtle);
  letter-spacing: -0.005em;
}
/* the Korean baseline: which scenario the KMA numerical model sits on */
.scenario__kma {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--p-mod);
  white-space: nowrap;
}
.scenario.is-lead .scenario__label {
  color: var(--ink);
  font-weight: 650;
  font-size: 15.5px;
}
.scenario__track {
  height: 5px;
  background: rgba(23, 24, 28, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.scenario__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  /* no minimum — 0% must be an honestly empty track */
  transform-origin: left;
  animation: growx 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.scenario__pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  color: var(--ink-subtle);
}
.scenario.is-lead .scenario__pct {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
}
/* picked = a quiet pool of the data's own blue */
.scenario.is-picked,
.scenario.is-picked:hover {
  background: rgba(47, 127, 224, 0.08);
  border-radius: 10px;
  border-top-color: transparent;
}
.scenario.is-picked + .scenario {
  border-top-color: transparent;
}
.scenario.is-picked .scenario__label {
  color: var(--ink);
}
.board__cond {
  margin: 18px 4px 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--ink-subtle);
}

/* 돌아보기 — the app's other half: a dashboard in the same grammar as the
   forecast board (day tabs, tappable hour strip, per-hour scenario rows),
   still no boxes — hairlines, type hierarchy and quiet gauges carry it */
.retro {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid rgba(23, 24, 28, 0.07);
}
.retro__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.retro__title {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.retro__days {
  gap: 16px;
}
.retro__days .daytab {
  font-size: 13.5px;
  padding-bottom: 6px;
}
.retro__stats {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--ink-subtle);
}
.retro__empty {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--ink-subtle);
  max-width: 52ch;
}
.retro__line {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-muted);
  max-width: 62ch;
  text-wrap: pretty;
}
.retro__line strong {
  color: var(--ink);
  font-weight: 650;
}
/* yesterday rendered exactly like today: a mini scenario strip, with the
   actual outcome as a one-line color ribbon aligned hour-for-hour below */
.retro__cap {
  margin: 12px 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.retro__strip {
  display: flex;
  gap: 4px;
  align-items: flex-end;
  height: 108px;
  max-width: calc(640px - 36px); /* caption offset: stays hour-aligned with ribbon cells */
  margin-left: 36px;
}
/* hour columns are buttons now — same instrument language as the main strip */
.retro__col {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.retro__colstack {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.retro__col:hover .retro__colstack {
  transform: translateY(-3px);
}
.retro__col.is-sel .retro__colstack {
  box-shadow: 0 0 0 2px rgba(47, 127, 224, 0.75);
  transform: translateY(-3px);
}
/* hours before this device first saw that day: honestly empty, not guessed */
.retro__nopred {
  height: 100%;
  background: rgba(23, 24, 28, 0.045);
}
.retro__ribbonrow {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin-top: 6px;
}
.retro__cap--ribbon {
  margin: 0;
  flex: none;
  width: 28px;
}
.retro__ribbon {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.retro__cell {
  flex: 1 1 0;
  min-width: 0;
  height: 7px;
  border-radius: 2px;
}
.retro__cell--pick {
  background: none;
  display: grid;
  place-items: center;
}
.retro__pickdot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px #fff;
}
.retro__pct {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.retro__cap--strip {
  margin-top: 14px;
  margin-left: 36px;
}
.retro__ticks {
  display: flex;
  gap: 4px;
  max-width: 640px;
  margin-top: 4px;
  padding-left: 36px; /* clears the '실제' caption so ticks align with cells */
}
.retro__ticks span {
  flex: 1 1 0;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}
/* selected hour's detail — yesterday read through today's board grammar */
.retro__cap--board {
  margin-top: 20px;
}
.retro__board {
  max-width: 640px;
}
.retro__brow {
  display: grid;
  grid-template-columns: 148px 1fr 56px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.retro__brow + .retro__brow {
  border-top: 1px solid rgba(23, 24, 28, 0.06);
}
.retro__blabelcell {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.retro__blabel {
  font-size: 13.5px;
  color: var(--ink-subtle);
}
.retro__brow.is-actual .retro__blabel {
  color: var(--ink);
  font-weight: 650;
}
.retro__tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.retro__tag--actual {
  color: var(--ink);
}
.retro__tag--pick {
  color: var(--p-mod);
}
.retro__btrack {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.07);
}
.retro__bfill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
}
.retro__bpct {
  font-size: 12.5px;
  text-align: right;
  color: var(--ink-subtle);
}
.retro__brow.is-actual .retro__bpct {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
/* 기관별 적중 — which agency read that day best; same quiet gauge language */
.mrank {
  max-width: 640px;
}
.mrank__row {
  display: grid;
  grid-template-columns: 14px 128px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.mrank__row + .mrank__row {
  border-top: 1px solid rgba(23, 24, 28, 0.06);
}
.mrank__rank {
  font-size: 11.5px;
  color: var(--ink-faint);
}
.mrank__row:first-child .mrank__rank,
.mrank__row:first-child .mrank__name {
  color: var(--ink);
  font-weight: 650;
}
.mrank__name {
  font-size: 13px;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrank__track {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.07);
}
.mrank__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--p-mod);
}
.mrank__result {
  font-size: 12px;
  color: var(--ink-subtle);
  white-space: nowrap;
}
.mrank__row:first-child .mrank__result {
  color: var(--ink);
  font-weight: 600;
}
.mrank__note {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  max-width: 56ch;
}
.retro__hunches {
  margin-top: 14px;
}
.retro__hunch {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.retro__hunch .is-hit {
  color: var(--p-mod);
  font-weight: 650;
}
.retro__hunch .is-miss {
  color: var(--ink-subtle);
  font-weight: 650;
}
.retro__tally {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
}
.retro__sub {
  margin: 16px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
}

/* 확률 성적표 — said probability vs what actually happened, one gauge per bin.
   Same quiet instrument language as the scenario board: hairline rows, a thin
   track, no boxes. The tick (said) sitting on the fill (actual) IS the message. */
.calib {
  margin-top: 4px;
  max-width: 640px;
}
.calib__row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  border-top: 1px solid rgba(23, 24, 28, 0.06);
}
.calib__row:first-child {
  border-top: none;
}
.calib__row--thin {
  opacity: 0.45;
}
.calib__said {
  font-size: 12.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.calib__track {
  position: relative;
  display: block;
  height: 5px;
  border-radius: 999px;
  background: rgba(23, 24, 28, 0.07);
}
.calib__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--p-mod);
}
.calib__tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink);
}
.calib__result {
  font-size: 12px;
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.calib__brier {
  margin-top: 12px;
  font-size: 13.5px;
}
.calib__how {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
  max-width: 56ch;
}
.calib__wait {
  font-size: 13.5px;
  color: var(--ink-subtle);
}
@media (max-width: 560px) {
  .calib__row {
    grid-template-columns: 56px 1fr;
    gap: 10px 14px;
  }
  .calib__result {
    grid-column: 2;
    margin-top: -2px;
  }
}

/* Method footer */
.method {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid rgba(23, 24, 28, 0.07);
}
.method__src {
  margin: 0 0 10px;
  max-width: 74ch;
  color: var(--ink-subtle);
  font-size: 13px;
  line-height: 1.65;
}
.method__src b {
  color: var(--ink-muted);
  font-weight: 600;
}
/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
}
.overlay__box {
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
}
.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid var(--hairline);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
.overlay__msg {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  max-width: 30ch;
}
.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 7px;
  padding: 9px 16px;
  cursor: pointer;
}
.btn:hover {
  background: #4d59c4;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes growx {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes fadeup {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes breathe {
  from {
    opacity: 0.05;
  }
  to {
    opacity: 0.5;
  }
}
@keyframes bloom {
  from {
    opacity: 0.6;
  }
  to {
    opacity: 1;
  }
}
/* ---------------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .top {
    padding: calc(14px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) 0
      calc(16px + env(safe-area-inset-left, 0px));
  }
  .sheet {
    padding: 20px calc(16px + env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px))
      calc(16px + env(safe-area-inset-left, 0px));
  }
  .loc__name {
    font-size: 24px;
  }
  .board__when {
    font-size: 20px;
  }
  .strip__axis,
  .strip__cols {
    height: 116px;
  }
}
@media (max-width: 560px) {
  .brand__sub {
    display: none;
  }
  /* thumb-sized hour bars: the strip keeps ~24px columns and scrolls sideways,
     bleeding to the screen edge so the gesture feels native */
  .stripscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .stripscroll::-webkit-scrollbar {
    display: none;
  }
  .stripscroll .stripwrap,
  .stripscroll .strip__times {
    min-width: 640px;
  }
  /* 돌아보기 graph block scrolls the same way — strip, pick row, actual ribbon
     and ticks stay hour-aligned inside one shared inner width */
  .retroscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .retroscroll::-webkit-scrollbar {
    display: none;
  }
  .retroscroll .retroinner {
    min-width: 640px;
  }
  .retro__strip {
    height: 92px;
  }
  .retro__brow {
    grid-template-columns: 118px 1fr 48px;
    gap: 10px;
  }
  .mrank__row {
    grid-template-columns: 14px 118px 1fr;
    gap: 8px 10px;
  }
  .mrank__result {
    grid-column: 2 / 4;
    margin-top: -3px;
  }
  .sheet__head {
    align-items: baseline;
  }
  .loc__name {
    font-size: 21px;
  }
  .scenario {
    grid-template-columns: 64px 1fr 60px;
    gap: 12px;
    padding: 13px 4px;
  }
  .scenario.is-lead .scenario__pct {
    font-size: 21px;
  }
  .search__input {
    width: 118px;
  }
  .search__input:focus {
    width: 150px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
