/* ==========================================================================
   ひとまわり — styles.css
   Map-first, sporty, light. Orange = route / primary action. Ink = selection.
   See DESIGN.md for the rationale and DOM-CONTRACT.md for the class list.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Route (read by JS via getComputedStyle → trim() the value) */
  --route: #F4510B;
  --route-casing: #FFFFFF;

  /* Colour */
  --accent: #F4510B;          /* primary button, route, focus */
  --accent-press: #D94306;
  --accent-ink: #C2410C;      /* orange text on white (AA) */
  --accent-tint: #FFF1EA;
  --ink: #16181D;             /* text, selected chips */
  --ink-2: #3B4049;
  --muted: #6B717C;
  --line: #E7E8EB;
  --surface: #FFFFFF;
  --surface-2: #F2F3F5;
  --surface-3: #E9EAED;
  --ok: #157A3B;
  --ok-tint: #E6F5EB;
  --rain: #1F5FBF;
  --rain-tint: #EAF2FD;
  --danger: #C62828;
  --danger-tint: #FDECEC;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;

  /* Shape & depth */
  --r-sheet: 20px;
  --r-card: 16px;
  --r-btn: 14px;
  --r-chip: 11px;
  --shadow-float: 0 2px 6px rgba(22, 24, 29, .10), 0 6px 18px rgba(22, 24, 29, .12);
  --shadow-sheet: 0 -6px 28px rgba(22, 24, 29, .16);

  /* Space */
  --gutter: 20px;
  --edge: 12px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: 200ms;

  /* Layout (JS overwrites --sheet-h in px on <html>) */
  --sheet-h: 260px;
  --sheet-max: 62vh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);

  color-scheme: light;
}
@supports (height: 100dvh) {
  :root { --sheet-max: 62dvh; }
}
/* Short screens (iPhone SE 375×667 etc.): let the sheet grow a bit and tighten. */
@media (max-height: 700px) {
  :root { --sheet-max: 68vh; --gutter: 18px; }
  @supports (height: 100dvh) { :root { --sheet-max: 68dvh; } }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: #ECECEA;            /* close to positron land colour while tiles load */
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Status-bar scrim: keeps the (white) iOS status bar legible over the light map
   in standalone mode. Height is 0 when there is no top inset. */
body::before {
  content: "";
  position: fixed;
  z-index: 25;
  top: 0; left: 0; right: 0;
  height: var(--safe-t);
  background: linear-gradient(rgba(22, 24, 29, .42), rgba(22, 24, 29, 0));
  pointer-events: none;
}

button, a, input, select, textarea { font: inherit; color: inherit; }
button {
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
:focus-visible {
  outline: 3px solid rgba(244, 81, 11, .55);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Map ---------- */
.map {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 0;
  background: #ECECEA;
}

/* MapLibre controls: never under the topbar or the sheet. Attribution stays
   visible, compact, bottom-left just above the sheet. */
.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right {
  top: calc(var(--safe-t) + 64px);
}
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  bottom: calc(var(--sheet-h, 260px) + 8px);
  transition: bottom var(--dur) var(--ease);
}
.maplibregl-ctrl-bottom-left { left: calc(var(--safe-l) + 4px); }
/* If JS keeps the default (bottom-right) attribution, move it left so it never
   sits under .map-tools. */
.maplibregl-ctrl-bottom-right { right: auto; left: calc(var(--safe-l) + 4px); }
.maplibregl-ctrl.maplibregl-ctrl-attrib {
  max-width: calc(100vw - 96px);
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.maplibregl-ctrl-attrib a { color: var(--ink-2); }
.maplibregl-ctrl-attrib.maplibregl-compact { min-height: 24px; }
/* Expanded (incl. the first seconds before JS collapses it): a single-line
   strip that scrolls sideways instead of a 3-line block over the map. */
.maplibregl-ctrl-attrib-inner {
  display: block;
  max-width: calc(100vw - 120px);
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  font-size: 10px;
  line-height: 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.maplibregl-ctrl-attrib-inner::-webkit-scrollbar { display: none; }
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-inner { display: none; }
.maplibregl-ctrl-attrib-button { touch-action: manipulation; }

/* ---------- Crosshair (pin view only) ---------- */
.crosshair {
  display: none;
  position: fixed;
  z-index: 10;
  left: 50%;
  /* centre of the map area visible above the sheet (JS pads the map by --sheet-h in pin view) */
  top: calc((100% - var(--sheet-h, 0px)) / 2);
  width: 0;
  height: 0;
  pointer-events: none;
}
/* Teardrop: a 32px square with one sharp corner, rotated -45° so the sharp
   corner points down. Its tip is 32·√2/2 ≈ 22.63px below the box centre, so
   the box centre sits 22.63px above the anchor → the tip is the exact
   viewport centre (= map centre). */
.crosshair-pin {
  position: absolute;
  left: -16px;
  top: calc(-16px - 22.63px);
  width: 32px;
  height: 32px;
  border: 3px solid #FFFFFF;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  box-shadow: -2px 2px 8px rgba(22, 24, 29, .28);
  transform: rotate(-45deg);
  transition: translate 180ms var(--ease);
}
.crosshair-pin::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #FFFFFF;
}
.crosshair-shadow {
  position: absolute;
  left: -8px;
  top: -3px;
  width: 16px;
  height: 6px;
  border-radius: 50%;
  background: rgba(22, 24, 29, .30);
  filter: blur(1.5px);
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}
body[data-view="pin"] .crosshair {
  display: block;
  animation: pin-drop 320ms var(--ease) both;
}
/* Optional: JS toggles .is-moving while the map is dragged (movestart/moveend). */
.crosshair.is-moving .crosshair-pin { translate: 0 -8px; }
.crosshair.is-moving .crosshair-shadow { transform: scale(1.35); opacity: .55; }
@keyframes pin-drop {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  z-index: 20;
  top: calc(var(--safe-t) + 10px);
  left: calc(var(--safe-l) + var(--edge));
  right: calc(var(--safe-r) + var(--edge));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand,
.wx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-float);
  transition: transform 120ms var(--ease);
}
.brand:active, .wx-chip:active { transform: scale(.96); }

.brand { flex: none; padding: 6px 14px 6px 6px; }
.brand-mark {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink) no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 22C7.5 19.9 7 14.75 9.75 11.6C12.5 8.5 17.9 7.5 21.25 9.4C24.6 11.25 25.25 15.9 23.25 19C21.25 22.1 16.75 23.5 13.5 22.9C12.5 22.7 11.75 22.4 11 22Z' fill='none' stroke='%23F4510B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='11' cy='22' r='2.3' fill='%23fff' stroke='%23F4510B' stroke-width='1.2'/%3E%3C/svg%3E");
}
.brand-word {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}

.wx-chip {
  flex: 0 1 auto;
  min-width: 0;
  padding: 6px 14px 6px 10px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wx-icon {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-size: 18px;
  line-height: 1;
}
.wx-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wx-chip[data-state="loading"] .wx-label { color: var(--muted); }
.wx-chip[data-state="loading"] .wx-icon:empty::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
.wx-chip[data-state="error"] .wx-label { color: var(--muted); }
.wx-chip[data-state="error"]::after,
.wx-chip[data-state="manual"]::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}
.wx-chip[data-state="manual"]::after { background: var(--accent); }

/* ---------- Map tools ---------- */
.map-tools {
  position: fixed;
  z-index: 15;
  right: calc(var(--safe-r) + var(--edge));
  bottom: calc(var(--sheet-h, 260px) + 12px);
  display: none;
  flex-direction: column;
  gap: 10px;
  transition: bottom var(--dur) var(--ease);
}
body[data-view="pin"] .map-tools,
body[data-view="plan"] .map-tools,
body[data-view="loading"] .map-tools,
body[data-view="route"] .map-tools,
body[data-view="rain"] .map-tools { display: flex; }

.map-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  transition: transform 120ms var(--ease), color 120ms;
}
.map-btn:active { transform: scale(.92); }
.map-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-btn svg .fill { fill: currentColor; stroke: none; }
.map-btn[aria-pressed="true"],
.map-btn.is-active { color: var(--accent); }

/* ---------- Map status ---------- */
.map-status {
  position: fixed;
  z-index: 18;
  top: calc(var(--safe-t) + 64px);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(22, 24, 29, .88);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-float);
}

/* ---------- Sheet ---------- */
.sheet {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  max-width: 560px;
  max-height: var(--sheet-max);
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  transform: translateY(0);
  transition: transform 280ms var(--ease);
}
/* Nothing to show yet (boot) → park the sheet below the screen. */
.sheet:has(> .sheet-body:empty) {
  transform: translateY(calc(100% + 24px));
  box-shadow: none;
}
.grabber {
  flex: none;
  width: 36px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 3px;
  background: #D4D6DA;
}
.sheet-body {
  overflow-anchor: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px calc(var(--gutter) + var(--safe-r)) 14px calc(var(--gutter) + var(--safe-l));
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar { display: none; }
/* Map views: the map is the hero. Keep the result sheet at ≈45% of the screen;
   fine print and extras sit below the sticky actions (scroll to read). */
body[data-view="route"] .sheet,
body[data-view="rain"] .sheet { max-height: min(var(--sheet-max), max(45vh, 340px)); }
@supports (height: 100dvh) {
  body[data-view="route"] .sheet,
  body[data-view="rain"] .sheet { max-height: min(var(--sheet-max), max(45dvh, 340px)); }
}
body[data-view="route"] .sheet-body,
body[data-view="rain"] .sheet-body { padding-top: 8px; }
/* View switch: every new view's content rises in. */
/* fill-mode backwards: after the entrance no transform is held, so :active scale still works */
.sheet-body > * { animation: rise var(--dur) var(--ease) backwards; }
.sheet-body > *:nth-child(2) { animation-delay: 20ms; }
.sheet-body > *:nth-child(3) { animation-delay: 40ms; }
.sheet-body > *:nth-child(n+4) { animation-delay: 60ms; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.sheet-body > :last-child { margin-bottom: 0; }

/* Keep the primary action reachable when the sheet scrolls (short screens). */
.sheet-body > .btn-primary {
  position: sticky;
  bottom: 8px;
  z-index: 2;
  box-shadow: 0 6px 16px rgba(244, 81, 11, .30), 0 0 0 8px var(--surface);
}
.sheet-body > .actions:has(.btn-primary) {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-block: 4px 2px;
  background: var(--surface);
}

/* ---------- Common typography ---------- */
.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.lede {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}
.sheet-body p { margin: 0 0 10px; }
.sheet-body a:not(.btn) { color: var(--accent-ink); text-underline-offset: 2px; }
.sheet-body ul, .sheet-body ol { margin: 0 0 12px; padding-left: 1.2em; }
.sheet-body li { margin-bottom: 4px; }

/* ---------- Fields & chips ---------- */
.field {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);   /* label | segment — one row per field */
  align-items: center;
  column-gap: 8px;
  margin: 0 0 8px;
}
.field-label {
  display: block;
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}
.field > .chips { grid-column: 2; }
.field-hint {
  grid-column: 1 / -1;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Fields without a label still span the row */
.field > :only-child { grid-column: 1 / -1; }

/* Segmented control */
.chips {
  display: flex;
  gap: 4px;
  margin: 0 0 14px;
  padding: 4px;
  border-radius: calc(var(--r-chip) + 4px);
  background: var(--surface-2);
}
.field .chips { margin-bottom: 0; }
.chip {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 6px;
  border-radius: var(--r-chip);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}
.chip:active { transform: scale(.96); }
.chip[aria-checked="true"],
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(22, 24, 29, .22);
}
.chip:disabled,
.chip[aria-disabled="true"] { opacity: .4; cursor: default; }

/* wrap + align-content centres the line; baseline aligns number and unit */
.chips-distance .chip { gap: 2px; flex-wrap: wrap; align-content: center; align-items: baseline; }
.chip-num {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.chip-unit {
  font-size: 12px;
  font-weight: 700;
  opacity: .7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-btn);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms var(--ease), transform 120ms var(--ease), box-shadow 140ms var(--ease);
}
.btn:active { transform: scale(.98); }
.btn:disabled,
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-primary {
  width: 100%;
  min-height: 56px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 17px;
  letter-spacing: .02em;
  box-shadow: 0 6px 16px rgba(244, 81, 11, .30);
}
.btn-primary:active { background: var(--accent-press); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-secondary:active { background: var(--surface-3); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-ghost:active { background: var(--surface-2); }
.btn-icon {
  flex: none;
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 20px;
}
.btn-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Navigation arrow on the Maps button (decorative, mask so it inherits colour) */
.btn-maps::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11 21 3l-8 18-2-8z'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11 21 3l-8 18-2-8z'/%3E%3C/svg%3E");
}

.actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 12px;
}
.actions > .btn { flex: 1 1 0; min-width: 0; white-space: normal; }
/* Two buttons side by side must fit 335px (375 − gutters): tighter type/padding,
   and text may wrap to 2 lines as a last resort instead of overflowing. */
.actions > .btn-primary { flex: 1 1 auto; width: auto; padding: 0 12px; font-size: 16px; gap: 6px; }
.actions > .btn-primary.btn-maps::before { width: 16px; height: 16px; }
.actions > .btn-secondary,
.actions > .btn-ghost { flex: 0 1 auto; min-height: 56px; padding: 0 12px; font-size: 15px; }
@media (max-width: 340px) {
  .actions { flex-wrap: wrap; }
  .actions > .btn { flex: 1 1 100%; }
}
.actions-stack { flex-direction: column; }
.actions-stack > .btn { flex: none; width: 100%; }

.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(59, 64, 73, .35);
  text-underline-offset: 3px;
}
.text-btn:active { color: var(--ink); }
.sheet-foot {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.sheet-body > .text-btn { display: flex; margin: 2px auto 0; }

/* ---------- Small print, badges, notices ---------- */
.fineprint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.fineprint a { color: var(--ink-2); text-underline-offset: 2px; }
body[data-view="route"] .fineprint,
body[data-view="rain"] .fineprint { margin-top: 10px; font-size: 11.5px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.badge-verified { background: var(--ok-tint); color: var(--ok); }
.badge-approx { background: var(--surface-2); color: var(--muted); }
.badge-outdoor { background: var(--rain-tint); color: var(--rain); }

.notice {
  position: relative;
  margin: 0 0 14px;
  padding: 10px 12px 10px 34px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
}
.notice::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 12px;
  width: 14px;
  height: 14px;
  background: currentColor;
  opacity: .7;
  /* info glyph */
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-6h2zm0-8h-2V7h2z'/%3E%3C/svg%3E");
}
.notice p { margin: 0; }
.notice p + p { margin-top: 4px; }
.notice-privacy { font-size: 12.5px; line-height: 1.5; padding-block: 8px; }
.notice-privacy::before {
  /* lock glyph */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 0 1 6 0v3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a5 5 0 0 0-5 5v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7a5 5 0 0 0-5-5zm-3 8V7a3 3 0 0 1 6 0v3z'/%3E%3C/svg%3E");
}
.notice-rain {
  margin-bottom: 10px;
  padding: 8px 10px 8px 30px;
  background: var(--rain-tint);
  color: #1A3F73;
  font-size: 12.5px;
  line-height: 1.5;
}
.notice-rain::before { left: 10px; top: 10px; }
.notice-rain::before {
  /* umbrella glyph */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.5 2 2 6 2 11h9v7a1.5 1.5 0 0 1-3 0h-2a3.5 3.5 0 0 0 7 0v-7h9c0-5-4.5-9-10-9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.5 2 2 6 2 11h9v7a1.5 1.5 0 0 1-3 0h-2a3.5 3.5 0 0 0 7 0v-7h9c0-5-4.5-9-10-9z'/%3E%3C/svg%3E");
  opacity: .85;
}

/* ---------- Loading ---------- */
.loading { padding: 8px 0 6px; }
.loading-bar {
  position: relative;
  height: 6px;
  margin: 0 0 16px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--accent-tint);
}
.loading-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  /* stripe period along x = 20px / sin45° ≈ 28.28px */
  background: repeating-linear-gradient(-45deg, var(--accent) 0 10px, #FF8A57 10px 20px);
  background-size: 28.28px 100%;
  animation: stripes .7s linear infinite;
}
@keyframes stripes {
  from { background-position: 0 0; }
  to   { background-position: 28.28px 0; }
}
.loading-text {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}
.loading-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Route / rain header ---------- */
.route-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
}
.route-head .btn-back {
  margin-left: -10px;
  background: transparent;
  font-size: 22px;
}
.route-head .btn-back:active { background: var(--surface-2); }
.route-head .title { margin: 0; font-size: 20px; flex: 1 1 auto; min-width: 0; }
.route-dir {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.route-head .badge { margin-left: auto; }

/* ---------- Stats (Strava-style activity numbers) ---------- */
/* No boxes, no top/bottom rules: three columns split by hairlines, numbers do the talking. */
.stats {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr);
  margin: 0 0 12px;
  padding: 2px 0 0;
}
.stat {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: flex-end;
  column-gap: 3px;
  padding: 0 4px 0 9px;
  border-left: 1px solid var(--line);
}
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-unit {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.stat-label {
  flex: 0 0 100%;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;   /* wraps to a 2nd line rather than hiding words */
}
.stat-hero .stat-value {
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.03em;
}
.stat-hero .stat-unit { color: var(--accent-ink); font-size: 15px; font-weight: 800; }
@media (max-width: 359px) {
  .stat { padding: 0 7px; }
  .stat-hero .stat-value { font-size: 34px; }
  .stat-value { font-size: 22px; }
}

/* ---------- Stop / facility cards (compact) ----------
   Grid: [icon] [name / meta ........ ]
         [links ............] [badge ]          */
.stop-card,
.facility-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
  margin: 0 0 10px;
  padding: 10px 12px 0;
  border-radius: var(--r-card);
  background: var(--surface-2);
  /* sparse auto-flow: .badge comes right after .stop-links in the DOM, so it lands on the same row */
}
.stop-card > *,
.facility-card > * { grid-column: 2 / -1; min-width: 0; }
.stop-icon {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 19px;
  line-height: 1;
}
.stop-body { min-width: 0; }
.stop-name {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stop-meta,
.stop-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.stop-meta {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.stop-note {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}
/* On the map views the sheet must stay low: the note is extra. */
body[data-view="route"] .stop-note,
body[data-view="rain"] .stop-note { display: none; }
/* Rain: .route-dir already shows the facility name. */
body[data-view="rain"] .facility-card .stop-name { display: none; }
.stop-links {
  grid-column: 1 / 3;
  display: flex;
  flex-wrap: wrap;
  column-gap: 14px;
  min-width: 0;
}
.stop-links .link { font-size: 14px; }
.stop-card > .badge,
.facility-card > .badge { height: 22px; padding: 0 7px; font-size: 11px; }
.stop-card > .badge,
.facility-card > .badge {
  grid-column: 3;
  align-self: center;
  justify-self: end;
  margin: 0;
}
.facility-card { grid-template-columns: 36px minmax(0, 1fr) auto; }
/* No icon in the card → let the content take the full width. */
.facility-card:not(:has(> .stop-icon)),
.stop-card:not(:has(> .stop-icon)) { grid-template-columns: 0 minmax(0, 1fr) auto; column-gap: 0; }
.facility-card:not(:has(> .stop-icon)) > .badge,
.stop-card:not(:has(> .stop-icon)) > .badge { margin-left: 12px; }
.facility-card:not(:has(> .stop-icon)) > .stop-links,
.stop-card:not(:has(> .stop-icon)) > .stop-links { grid-column: 2; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.link::after {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E");
}
.link:active { opacity: .6; }

/* ---------- Rain: shop list ---------- */
.shop-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.shop-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.shop-row:last-child { border-bottom: 0; }
.shop-name {
  grid-column: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.shop-meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.shop-row > .link {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* ---------- Error ---------- */
.error-card {
  padding: 6px 0 0;
  text-align: center;
}
.error-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--danger-tint);
  color: var(--danger);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.error-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
}
.error-text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.error-card .actions { margin-bottom: 0; }

/* ---------- Places list ---------- */
.place-list {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.place-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background-color 140ms var(--ease);
}
.place-row:active { background: var(--surface-2); }
.place-row.is-active,
.place-row[aria-pressed="true"],
.place-row[aria-current="true"] {
  background: var(--accent-tint);
  box-shadow: inset 3px 0 0 var(--accent);
}
.place-name {
  grid-column: 1;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.place-meta {
  grid-column: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
/* Places: the coverage note is reference info, not the headline. */
body[data-view="places"] .sheet-body > .lede {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.5;
}
body[data-view="places"] .sheet-body > .chips { margin-bottom: 6px; }
.place-area {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- About ---------- */
body[data-view="about"] .sheet-body { font-size: 15px; }
.about-list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 14px;
  margin: 0 0 12px;
  font-size: 14px;
}
.about-list dt { color: var(--muted); font-weight: 700; }
.about-list dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Pin view: keep the sheet low so the pin stays visible ---------- */
body[data-view="pin"] .title { font-size: 22px; }
body[data-view="pin"] .lede { margin-bottom: 12px; }

/* ---------- Short screens ---------- */
@media (max-height: 700px) {
  .title { font-size: 21px; margin-bottom: 4px; }
  body[data-view="plan"] .eyebrow { display: none; }
  .field { margin-bottom: 6px; }
  .lede { margin-bottom: 10px; }
  .stats { padding: 8px 0 10px; margin-bottom: 10px; }
  .stop-card { padding: 10px; margin-bottom: 10px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(var(--sheet-h, 260px) + 16px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(420px, calc(100vw - 144px));
  margin: 0;
  padding: 11px 16px;
  border-radius: 14px;
  background: rgba(22, 24, 29, .94);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--shadow-float);
  animation: toast-in 220ms var(--ease) both;
  pointer-events: none;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.noscript {
  position: fixed;
  z-index: 60;
  left: 16px; right: 16px; bottom: calc(var(--safe-b) + 16px);
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Map markers (MapLibre Marker elements) ----------
   NOTE: MapLibre positions markers with an inline `transform` on the root
   element. Never set transform / transition:transform on .mk-* roots — size
   changes use width/height so the centre anchor stays put. */
.mk-start,
.mk-stop,
.mk-place,
.mk-way {
  display: block;
  border-radius: 50%;
  cursor: pointer;
}
.mk-start {
  width: 26px;
  height: 26px;
  border: 5px solid var(--accent);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px #FFFFFF, 0 2px 8px rgba(22, 24, 29, .35);
}
.mk-start::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--ink);
}
.mk-stop {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2.5px solid var(--ink);
  background: #FFFFFF;
  box-shadow: 0 3px 10px rgba(22, 24, 29, .28);
}
.mk-stop-glyph { font-size: 18px; line-height: 1; }
.mk-stop.is-active {
  width: 46px;
  height: 46px;
  border-color: var(--accent);
}
.mk-stop.is-active .mk-stop-glyph { font-size: 22px; }
.mk-place {
  width: 12px;
  height: 12px;
  border: 2px solid #FFFFFF;
  background: var(--ink);
  box-shadow: 0 1px 4px rgba(22, 24, 29, .35);
}
.mk-place.is-active {
  width: 22px;
  height: 22px;
  border-width: 4px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(244, 81, 11, .22), 0 2px 8px rgba(22, 24, 29, .35);
  z-index: 2;
}
.mk-way {
  width: 9px;
  height: 9px;
  border: 2px solid var(--ink-2);
  background: #FFFFFF;
  opacity: .85;
  cursor: default;
}

/* ==========================================================================
   v2 — 個人店のはしご (candidates → pick up to 3 → re-route)
   ========================================================================== */

/* Plan: multi-select stop chips look exactly like the single-select ones */
.chips-multi .chip[aria-pressed="true"] {
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(22, 24, 29, .22);
}

/* Route with candidates: the sheet may grow (still well under the map) and
   scrolls inside; .actions (and .btn-apply when shown) stay pinned at the
   bottom. 667px tall → 430px sheet ≈ 3–4 rows (2.5 with the apply button). */
body[data-view="route"] .sheet:has(.cand-section, .via-list) {
  max-height: min(var(--sheet-max), max(56vh, 430px));
}
@supports (height: 100dvh) {
  body[data-view="route"] .sheet:has(.cand-section, .via-list) {
    max-height: min(var(--sheet-max), max(56dvh, 430px));
  }
}

/* Candidate section — a tight, Strava-segment-like list */
.cand-section { margin: 0 0 10px; }
.cand-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 2px;
}
.cand-head .field-label { margin: 0; }
.cand-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}
.cand-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cand-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 6px 8px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  text-align: left;
  transition: background-color 140ms var(--ease);
}
.cand-row:last-child { border-bottom: 0; }
.cand-row:active { background: var(--surface-2); }
.cand-row[aria-pressed="true"] {
  background: var(--accent-tint);
  border-bottom-color: transparent;
  border-radius: 12px;
}
.cand-row[aria-pressed="true"] + .cand-row[aria-pressed="true"] { margin-top: 2px; }
.cand-row:disabled,
.cand-row[aria-disabled="true"] { opacity: .45; cursor: default; }

/* Number disc — same number as the map marker. Outline = not chosen, orange fill = chosen */
.cand-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.cand-row[aria-pressed="true"] .cand-num,
.via-row .cand-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFFFFF;
}
.cand-body { min-width: 0; }
.cand-name,
.cand-meta {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cand-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}
.cand-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.cand-tag {
  flex: none;
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.cand-row[aria-pressed="true"] .cand-tag { background: var(--surface); }
.cand-empty {
  margin: 2px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Apply: strong but secondary to the orange Maps button → ink fill.
   Sticky just above the pinned .actions so it is always reachable. */
.btn-apply {
  width: 100%;
  min-height: 52px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(22, 24, 29, .22);
}
.btn-apply:active { background: #2A2E36; }
.sheet-body > .btn-apply {
  position: sticky;
  bottom: 66px;               /* height of the sticky .actions row */
  z-index: 3;
  margin: 0 0 10px;
  box-shadow: 0 4px 12px rgba(22, 24, 29, .22), 0 0 0 6px var(--surface);
}

/* After re-routing: the chosen shops in visiting order, joined by a line */
.via-list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.via-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  padding: 6px 0 4px;
}
.via-row > * { grid-column: 2; min-width: 0; }
.via-row > .cand-num { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
.via-row:not(:last-child)::before {          /* route connector between numbers */
  content: "";
  position: absolute;
  left: 13px;
  top: 38px;
  bottom: -6px;
  width: 2px;
  border-radius: 1px;
  background: rgba(244, 81, 11, .35);
}
.via-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.via-meta {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
/* Links keep a 44px tap height but overlap the row padding to stay compact */
.via-row .stop-links { margin: -6px 0 -8px; }
.via-row .link { font-size: 14px; }

/* Places: chain badge — present but quiet */
.badge-chain {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 700;
}
.place-row > .badge-chain { grid-column: 1; justify-self: start; height: 20px; margin-top: 3px; font-size: 11px; }
.place-name .badge-chain,
.stop-name .badge-chain { height: 20px; margin-left: 6px; font-size: 11px; vertical-align: 2px; }

/* Map marker: numbered candidate. Distinct from .mk-stop (emoji, 38px).
   No transform here — MapLibre owns it; selection grows via width/height. */
.mk-cand {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(22, 24, 29, .30);
  font-family: var(--font);
  cursor: pointer;
}
.mk-cand-num {
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mk-cand.is-selected {
  width: 32px;
  height: 32px;
  border: 2.5px solid #FFFFFF;
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--accent), 0 3px 10px rgba(22, 24, 29, .35);
  z-index: 3;
}
.mk-cand.is-selected .mk-cand-num { font-size: 15px; }

/* ---------- Shared keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
  .loading-bar::before { animation: none; }
  .wx-chip[data-state="loading"] .wx-icon:empty::before { animation: none; }
}
