:root {
  --ink: #1d1a16;
  --muted: #6d645b;
  --line: #e4dcd0;
  --paper: #f6f1e8;
  --paper-2: #fffdf8;
  --red: #c5362b;
  --shadow: 0 10px 30px rgba(40, 28, 16, 0.08);
  color: var(--ink);
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", sans-serif;
  background: var(--paper);
}

* { box-sizing: border-box; }

html, body, .app, #map { height: 100%; margin: 0; }

.app {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 100%;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 18px 16px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  overflow: hidden;
  min-height: 0;
}

.kicker {
  margin: 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

h1 {
  margin: 2px 0 0;
  font-size: 42px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.sub, .fine {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.clock-block {
  padding: 14px 14px 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.clock {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 40px;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.clock-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  margin: 12px 0 0;
  accent-color: var(--red);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

button {
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

button.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.lines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lines button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.detail {
  padding: 12px;
  border-radius: 14px;
  background: #1d1a16;
  color: #f6f1e8;
}

.detail h2 {
  margin: 0;
  font-size: 16px;
}

.detail p { margin: 4px 0 0; color: #d9d0c4; font-size: 13px; }

.stops {
  display: grid;
  gap: 3px;
  margin-top: 10px;
  max-height: 180px;
  overflow: auto;
}

.stop {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  font-size: 12px;
  color: #cfc6ba;
}

.stop.now { color: #fff; font-weight: 600; }

.list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
  flex: 1;
}

.train-row {
  display: grid;
  grid-template-columns: 8px 52px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
}

.train-row strong {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 500;
}

.train-row span, .train-row em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.train-row.on { background: var(--paper-2); border-color: var(--line); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.train-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.train-pin.selected {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

.leaflet-container {
  background: #e7eef2;
  font-family: inherit;
}

.station-tip {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #1d1a16;
  font-weight: 600;
  font-size: 12px;
  text-shadow:
    0 0 2px #fff,
    0 1px 0 #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff,
    0 -1px 0 #fff;
}

.station-tip::before { display: none; }

@media (max-width: 800px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 46vh) minmax(0, 1fr);
    height: 100%;
  }
  .panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }
  #map { min-height: 0; height: 100%; }
  h1 { font-size: 32px; }
  .clock { font-size: 32px; }
}
