:root {
  --ink: #123044;
  --muted: #5a7280;
  --paper: #f3fafb;
  --card: #ffffff;
  --line: #d5e8ee;
  --sea: #0c7490;
  --sea-deep: #08485c;
  --foam: #e5f6f8;
  --sand: #f6f0e4;
  --purple: #5c2a86;
  --purple-deep: #431274;
  --purple-soft: #f4eaf8;
  --blue: #1a7ec4;
  --blue-deep: #0f629c;
  --blue-soft: #e8f4fb;
  --shadow: 0 18px 50px rgba(8, 48, 68, 0.2);
  --rail: 392px;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(255, 255, 255, 0.45), transparent 50%),
    linear-gradient(180deg, #8ec9d8 0%, #d5eef3 42%, #f4efe4 100%);
  min-height: 100%;
}
button, input { font: inherit; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app { height: 100vh; position: relative; }

.rail {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 16px;
  bottom: 16px;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.rail::before {
  content: "";
  height: 6px;
  background: linear-gradient(90deg, #083b4d 0%, #0e8eab 42%, #7fd0e2 68%, #f2d7a4 100%);
}

.brand {
  position: relative;
  padding: 18px 22px 0;
  background: linear-gradient(180deg, #e7f7fa 0%, #ffffff 78%);
}
.wave { display: block; width: calc(100% + 44px); height: 28px; margin: 10px -22px 0; }
.brand-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: #431274;
  color: white;
  box-sizing: border-box;
  height: 44px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0.02em;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(67, 18, 116, 0.28);
  white-space: nowrap;
}
.official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #431274;
  color: white;
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.02em;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(67, 18, 116, 0.28);
}
.official:hover { background: #5a1d96; }
.lede {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.6;
}

.tabs {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 6px;
  padding: 12px 16px 0;
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #f7fafc;
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 8px;
  cursor: pointer;
  font-weight: 650;
}
.tab span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.tab.is-on[data-tier="all"] {
  background: var(--sea);
  border-color: var(--sea);
  color: white;
  box-shadow: 0 8px 18px rgba(12, 116, 144, 0.28);
}
.tab.is-on[data-tier="purple"] {
  background: var(--purple);
  border-color: var(--purple);
  color: white;
  box-shadow: 0 8px 18px rgba(67, 18, 116, 0.28);
}
.tab.is-on[data-tier="blue"] {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(31, 122, 224, 0.28);
}
.tab.is-on span { color: white; background: transparent; }

.search { display: block; padding: 12px 16px 0; position: relative; }
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #f7fafc;
  border-radius: 12px;
  padding: 11px 14px;
  color: var(--ink);
  outline: none;
}
.search input:focus { border-color: #b9cbe0; background: white; }

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 4px 22px;
}
.count {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.plan-chip {
  border: 1px solid #b7dbe4;
  background: var(--foam);
  color: var(--sea-deep);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.plan-chip b {
  display: inline-block;
  min-width: 1.2em;
  margin-left: 4px;
  text-align: center;
}

#list {
  list-style: none;
  margin: 0;
  padding: 4px 10px 12px;
  overflow: auto;
  flex: 1;
}
.maker {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 16px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  background: #fff;
}
#list::-webkit-scrollbar { width: 10px; }
#list::-webkit-scrollbar-thumb { background: #d5e0ea; border-radius: 99px; border: 2px solid white; }

.row { position: relative; }
.row.is-done .spot { opacity: 0.62; }
.pick {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 48, 64, 0.08);
}
.pick input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}
.pick:has(input:checked) {
  background: var(--sea);
  color: white;
}
.row.is-done .pick {
  background: #146c3a;
  color: white;
}
.spot {
  position: relative;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 16px;
  padding: 8px 72px 8px 8px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}
.spot:hover { background: #f5f8fb; }
.spot.is-on[data-tier="purple"] {
  background: var(--purple-soft);
  border-color: #ffd0d4;
}
.spot.is-on[data-tier="blue"] {
  background: var(--blue-soft);
  border-color: #d3e6fa;
}
.thumb {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  background: #e7eef4;
  display: block;
}
.spot h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.meta { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.spot-price {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink);
  font-weight: 650;
}
.spot-uses {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 750;
}
.spot-close {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 750;
  color: var(--sea-deep);
}
.clear-picks {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  padding: 4px 2px;
  white-space: nowrap;
}
.clear-picks[hidden] { display: none; }
.group {
  margin: 12px 10px 2px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.45;
}
.group.purple { color: var(--purple-deep); }
.group.blue { color: var(--blue-deep); }
.tier-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 750;
  vertical-align: 1px;
}
.tier-tag.purple { background: var(--purple-soft); color: var(--purple-deep); }
.tier-tag.blue { background: var(--blue-soft); color: var(--blue-deep); }
.note {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff4df;
  color: #8a5a12;
  font-style: normal;
  font-size: 11px;
  font-weight: 650;
  vertical-align: 1px;
}
.empty { padding: 28px 12px; color: var(--muted); text-align: center; }

.stage { position: absolute; inset: 0; }
.pass-banner {
  position: absolute;
  z-index: 550;
  top: 18px;
  left: calc(var(--rail) + 32px);
  right: 28px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.pass-banner[hidden] { display: none; }
.pass-banner button {
  pointer-events: auto;
  border: 0;
  cursor: pointer;
  color: white;
  background: #123044;
  border-radius: 22px;
  padding: 12px 26px 14px;
  box-shadow: 0 16px 40px rgba(8, 32, 48, 0.32);
  text-align: center;
}
.pass-banner-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  opacity: 0.72;
}
.pass-banner-time {
  margin: 2px 0 0;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.pass-banner-time span {
  margin: 0 8px 0 2px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.82;
}
.pass-banner-time span:last-child { margin-right: 0; }
.pass-banner-end {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 750;
}
.pass-banner.is-soon button { background: #8a4b12; }
.pass-banner.is-urgent button {
  background: #9a2340;
  animation: banner-pulse 1.4s ease-in-out infinite;
}
.pass-banner.is-over button { background: #3d4654; }
@keyframes banner-pulse {
  50% { box-shadow: 0 0 0 8px rgba(154, 35, 64, 0.28), 0 16px 40px rgba(8, 32, 48, 0.32); }
}
.stage.has-detail .pass-banner,
.stage.has-plan .pass-banner { right: 420px; }
#map { height: 100%; width: 100%; background: #d5e3ee; }
.leaflet-container { font: inherit; }
.leaflet-div-icon { background: transparent; border: 0; }
.leaflet-control-zoom {
  border: 0 !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(16, 32, 54, 0.16) !important;
}
.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  color: var(--ink) !important;
}
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.8) !important;
  border-radius: 8px 0 0 0;
  font-size: 11px !important;
}

.pin {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 2px 8px rgba(16, 32, 54, 0.35);
}
.pin.purple { background: var(--purple); }
.pin.blue { background: var(--blue); }
.pin.is-picked { transform: scale(1.7); }
.pin.purple.is-picked { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--purple); }
.pin.blue.is-picked { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--blue); }
.pin.is-done::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 3px;
  height: 6px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}
.pin.is-on {
  transform: scale(1.45);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.72), 0 4px 14px rgba(16, 32, 54, 0.35);
}
.pin.is-picked.is-on { transform: scale(1.95); }

.detail {
  position: absolute;
  z-index: 600;
  top: 16px;
  right: 16px;
  width: 380px;
  max-height: calc(100% - 32px);
  overflow: auto;
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.detail[hidden] { display: none; }
.detail figure { margin: 0; position: relative; background: #102033; }
.detail img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
}
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}
.detail-body { padding: 18px 20px 20px; }
.sheet-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.detail[data-tier="purple"] .sheet-kicker { color: var(--purple-deep); }
.detail[data-tier="blue"] .sheet-kicker { color: var(--blue-deep); }
.detail-body h2 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.ko { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.open-hours {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 650;
  color: var(--sea-deep);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.price, .uses, .benefit {
  display: inline-flex;
  align-items: center;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.price { background: #142033; color: white; }
.uses { background: var(--foam); color: var(--sea-deep); }
.benefit { background: #e8f7ee; color: #146c3a; }
.blurb { margin: 14px 0 0; line-height: 1.65; font-size: 14.5px; }
.addr { margin: 12px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.jump, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  border: 0;
}
.detail[data-tier="purple"] .jump { background: var(--purple); color: white; }
.detail[data-tier="blue"] .jump { background: var(--blue); color: white; }
.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.plan .detail-body { padding-top: 16px; }
.plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plan .detail-body h2 { margin: 0; font-size: 20px; }
.plan .close {
  position: static;
  flex: 0 0 auto;
  box-shadow: none;
  background: var(--paper);
}
.plan .jump { background: var(--sea); color: white; }
.fine { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.journey {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: white;
}
.beat { padding: 14px 16px 16px; }
.beat + .beat { border-top: 1px solid var(--line); }
.beat-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 3px 8px 3px 3px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--sea-deep);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.06em;
}
.beat-kicker span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sea);
  color: white;
  letter-spacing: 0;
}
.beat-done .beat-kicker { background: #e8f7ee; color: #146c3a; }
.beat-done .beat-kicker span { background: #146c3a; }
.beat-next .beat-kicker { background: var(--purple-soft); color: var(--purple-deep); }
.beat-next .beat-kicker span { background: var(--purple); }
.beat-title { margin: 10px 0 0; font-size: 15px; font-weight: 700; }
.beat-hours {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.beat-hours button {
  border: 0;
  background: transparent;
  padding: 0;
  color: #c5d3da;
  font-size: 42px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  cursor: pointer;
}
.beat-hours button.is-on { color: var(--ink); }
.beat-hours button:hover { color: var(--sea-deep); }
.beat-hours button.is-on:hover { color: var(--ink); }
.beat-slash, .beat-unit {
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.beat-slash { font-size: 28px; }
.beat-unit { font-size: 22px; }
.beat-figure {
  margin: 2px 0 0;
  font-size: 40px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.beat-figure.is-fresh { animation: figure-in 0.28s ease; }
@keyframes figure-in {
  from { transform: translateY(6px); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}
.beat-done .beat-figure { color: #146c3a; }
.beat-of, .beat-unit-sm { color: var(--ink); }
.beat-of { font-size: 0.62em; }
.beat-unit-sm {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}
.beat-note { margin: 6px 0 0; font-size: 13.5px; line-height: 1.45; }
.beat-pass {
  margin: 8px 0 0;
  color: #146c3a;
  font-size: 13.5px;
  font-weight: 750;
}
.beat-pass[hidden] { display: none; }
.start-label { display: block; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 700; }
.start-label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
}
.clock { margin: 10px 0 0; font-size: 18px; font-weight: 750; letter-spacing: -0.03em; color: var(--sea-deep); }
.clock:empty { display: none; }
.ends { margin: 2px 0 0; font-size: 14px; font-weight: 750; color: var(--ink); }
.ends:empty { display: none; }
#clear-start {
  margin-top: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#clear-start[hidden] { display: none; }
#plan-places { margin-top: 16px; }
#plan-places[hidden] { display: none; }
.plan-places-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.plan-places-head p { margin: 0; font-size: 13px; font-weight: 750; }
#clear-picks-plan {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--sea-deep);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.plan-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.plan-item:has(.done-flag.is-on) strong { color: #146c3a; }
.plan-item button {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.plan-item .meta { margin: 2px 0 0; }
.done-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  color: var(--ink);
}
.done-flag input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #146c3a;
  cursor: pointer;
}
.done-flag.is-on { background: #e8f7ee; border-color: #b7e4c7; color: #146c3a; }
#copy-plan { margin-top: 14px; }
.stage.has-detail .leaflet-right,
.stage.has-plan .leaflet-right { margin-right: 404px; }

@media (max-width: 900px) {
  .rail {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    height: 44vh;
    border-radius: 20px;
  }
  .app:has(.has-detail) .rail,
  .app:has(.has-plan) .rail { display: none; }
  .brand { padding: 14px 14px 0; }
  h1 { height: 38px; font-size: 12px; letter-spacing: 0.02em; padding: 0 12px; }
  .official { font-size: 13px; padding: 10px 12px; }
  .lede { font-size: 12px; }
  .detail {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 68vh;
  }
  .detail.plan { max-height: 88vh; }
  .detail img { height: 180px; }
  .leaflet-bottom.leaflet-right {
    bottom: auto;
    top: 12px;
    margin-right: 8px;
  }
  .pass-banner,
  .stage.has-detail .pass-banner,
  .stage.has-plan .pass-banner {
    left: 12px;
    right: 12px;
    top: 12px;
  }
  .pass-banner-time { font-size: 26px; }
}
