:root {
  --bg: #fbfaf7; --card: #fff; --fg: #1d1d1f; --muted: #6b6b70; --line: #e7e4dd;
  --accent: #e4572e; --warn-bg: #fff3cd; --warn-fg: #7a5b00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141416; --card: #1d1d20; --fg: #ececf0; --muted: #9a9aa2; --line: #2e2e33;
          --warn-bg: #3a3012; --warn-fg: #f3d27a; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", sans-serif;
  background: var(--bg); color: var(--fg);
  display: grid; grid-template-columns: 430px 1fr; height: 100dvh; overflow: hidden;
}
#map { grid-column: 2; grid-row: 1; height: 100dvh; }
#panel { grid-column: 1; grid-row: 1; overflow-y: auto; border-right: 1px solid var(--line); }
header { padding: 14px 16px 0; }
h1 { font-size: 18px; margin: 0 0 10px; }
h1 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }

#concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.concept { text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.concept.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.cn { font-weight: 700; font-size: 14px; }
.cp { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.cp .w { color: #c0392b; }

#days { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none;
        position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
#days button { flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 11px; font-size: 13px; white-space: nowrap; }
#days button.on { background: var(--c, var(--fg)); border-color: var(--c, var(--fg)); color: #fff; }

main { padding: 4px 16px 40px; }
.pitch { color: var(--muted); font-size: 13.5px; margin: 10px 0; }
.reset { background: none; border: 1px dashed var(--muted); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.day { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.day h2 { font-size: 16px; margin: 0; cursor: pointer; }
.date { color: var(--c); margin-right: 8px; }
.tag { font-size: 13px; color: var(--muted); margin-top: 2px; }
.memo { font-size: 13.5px; background: var(--bg); border-radius: 8px; padding: 8px 10px; margin: 10px 0 4px; }
.warn { background: var(--warn-bg); color: var(--warn-fg); border-radius: 8px; padding: 6px 10px; margin-top: 8px; font-size: 13px; }
ol { list-style: none; margin: 10px 0 0; padding: 0; }
.stop { display: grid; grid-template-columns: 44px 22px 1fr; gap: 8px; padding: 6px 0; cursor: pointer; border-top: 1px solid var(--line); align-items: start; }
.stop:first-child { border-top: 0; }
.stop .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding-top: 1px; }
.stop .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.day ol .stop .dot:empty { width: 10px; height: 10px; margin: 6px; }
.stop.fixed b { color: var(--accent); }
.stop.closed b { text-decoration: line-through; opacity: .6; }
.mode { margin-right: 2px; }
.imp { font-size: 12px; }
.cat { font-size: 12px; color: var(--muted); margin-left: 2px; }
.note { font-size: 13px; color: var(--muted); margin-top: 1px; }
.gm { font-size: 12px; color: #1a73e8; text-decoration: none; }
.swap { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.swap select { display: block; width: 100%; margin-top: 4px; padding: 7px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
.miss h3 { font-size: 14px; margin: 18px 0 6px; }
.miss ul { padding-left: 18px; margin: 0; font-size: 13.5px; }
.miss a { color: inherit; }
.foot { font-size: 12px; color: var(--muted); margin-top: 20px; }

.pin { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: grid; place-items: center; font: 700 12px/1 sans-serif; }
.pin.fixed { outline: 3px solid #ffd54a; }
.locate { width: 34px; height: 34px; border-radius: 4px; border: 2px solid rgba(0,0,0,.2); background: #fff; font-size: 16px; }
.leaflet-popup-content { font-size: 13.5px; line-height: 1.45; }
.pt { color: #777; }

@media (max-width: 799px) {
  body { display: block; height: auto; overflow: visible; }
  #map { position: sticky; top: 0; height: 42dvh; z-index: 10; }
  #panel { border: 0; overflow: visible; }
  #days { top: 42dvh; }
  #concepts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cp { font-size: 10.5px; }
}
.en { font-size: 12px; color: var(--muted); }
.stop .en { margin-top: -1px; }
