:root {
  --blue: #1565c0;
  --blue-dark: #0d47a1;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #667085;
  --line: #d8dde5;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}
.hidden { display: none !important; }

header {
  background: var(--blue);
  color: #fff;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
  text-align: center;
}
header h1 { font-size: 22px; font-weight: 800; }

main { max-width: 560px; margin: 0 auto; padding: 16px; }

.stopBar { display: flex; align-items: center; gap: 10px; }
.stopLabel { font-size: 16px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
#stopSel {
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
}

.fareLine {
  margin: 12px 0 4px;
  font-size: 17px;
  text-align: center;
  color: var(--text);
}
.fareLine strong { font-size: 20px; color: var(--blue-dark); }

.nextCard {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-top: 14px;
  text-align: center;
}
.nextCard.first { border-color: var(--blue); border-width: 3px; }
.nextCard .lead { font-size: 18px; color: var(--muted); font-weight: 700; }
.nextCard .countdown { font-size: 56px; font-weight: 900; color: var(--blue-dark); line-height: 1.2; }
.nextCard .countdown small { font-size: 26px; font-weight: 800; }
.nextCard.first .countdown { font-size: 72px; }
.nextCard .depTime { font-size: 22px; font-weight: 700; margin-top: 2px; }
.nextCard .arr { font-size: 16px; color: var(--muted); margin-top: 2px; }

.noBus {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 28px 18px;
  margin-top: 14px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
}

.bigBtn {
  display: block;
  width: 100%;
  margin-top: 20px;
  font-size: 21px;
  font-weight: 800;
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.bigBtn:active { background: var(--blue-dark); }

#ttView h2 { font-size: 20px; margin: 16px 0 10px; text-align: center; }

.hourBlock { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.hourLabel {
  width: 64px;
  flex-shrink: 0;
  background: #eef3fa;
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hourLabel small { font-size: 13px; font-weight: 700; margin-left: 2px; }
.mins { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; align-items: center; }
.mins span {
  font-size: 22px;
  font-weight: 800;
  min-width: 52px;
  text-align: center;
  background: #f2f5f9;
  border-radius: 8px;
  padding: 4px 6px;
}
.mins span.passed { opacity: .38; font-weight: 600; }
.mins span.next { background: var(--blue); color: #fff; }

.mapBtn {
  display: block;
  margin-top: 14px;
  font-size: 19px;
  font-weight: 800;
  padding: 16px;
  border: 2px solid var(--blue);
  border-radius: 14px;
  background: var(--card);
  color: var(--blue-dark);
  text-align: center;
  text-decoration: none;
}
.mapBtn:active { background: #eef3fa; }

.dataNote { margin-top: 24px; font-size: 13px; color: var(--muted); text-align: center; }
.notice {
  margin-top: 12px;
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #7a5b00;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.brandCredit {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 16px 20px;
}
