:root {
  --accent: #14508c;
  --accent-weak: #e8eef6;
  --alert: #b3372a;
  --alert-weak: #faece9;
  --ok: #1e6b45;
  --text: #22252a;
  --text-weak: #616875;
  --line: #d9dde3;
  --bg: #f4f5f7;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.header {
  background: var(--accent);
  color: #fff;
  padding: 14px 16px 12px;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.header-title { margin: 0; font-size: 20px; letter-spacing: 0.04em; }
.header-sub { margin: 2px 0 0; font-size: 12px; opacity: 0.85; }

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

.loading { color: var(--text-weak); }

/* タブバー */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.tabbar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  font-size: 12px;
  color: var(--text-weak);
  text-decoration: none;
  border-top: 3px solid transparent;
}
.tabbar a.active {
  color: var(--accent);
  border-top-color: var(--accent);
  font-weight: 600;
}

/* 共通部品 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card h3 { margin: 14px 0 6px; font-size: 14px; }

.section-note { font-size: 12px; color: var(--text-weak); margin: 6px 0 0; }
.source-note { font-size: 11px; color: var(--text-weak); margin: 8px 0 0; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}
.chips button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
}
.chips button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

select {
  width: 100%;
  min-height: 44px;
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  margin: 4px 0 8px;
}

/* 運行状況 */
.status-banner {
  display: block;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
}
.status-banner .status-label {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  color: var(--ok);
}
.status-banner.is-trouble .status-label { color: var(--alert); }
.status-banner.is-trouble { background: var(--alert-weak); border-color: var(--alert); }
.status-banner .status-msg { margin: 4px 0 0; font-size: 13px; color: var(--text); }
.status-banner .status-time { margin: 4px 0 0; font-size: 11px; color: var(--text-weak); }

.status-history { margin: 0; padding: 0; list-style: none; }
.status-history li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.status-history .time { color: var(--text-weak); font-size: 11px; }

/* ニュース */
.news-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  text-decoration: none;
  color: var(--text);
}
.news-item .news-title { font-size: 14px; font-weight: 600; line-height: 1.5; }
.news-item .news-meta { margin-top: 6px; font-size: 11px; color: var(--text-weak); }
.news-item .news-meta .area-tag {
  display: inline-block;
  background: var(--accent-weak);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
}

/* スポット */
.spot-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
}
.spot-item .spot-head { font-size: 14px; font-weight: 600; }
.spot-item .spot-type {
  display: inline-block;
  font-size: 11px;
  font-weight: 400;
  background: var(--accent-weak);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.spot-item .spot-desc { margin: 6px 0 0; font-size: 13px; }
.spot-item .spot-access { margin: 4px 0 0; font-size: 11px; color: var(--text-weak); }

/* グラフ(縦棒) */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  margin: 10px 0 2px;
}
.bar-chart .bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  position: relative;
}
.bar-chart .bar.is-peak { background: var(--alert); }
.bar-chart .bar .bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-weak);
  white-space: nowrap;
}
.bar-labels { display: flex; gap: 3px; }
.bar-labels span {
  flex: 1;
  text-align: center;
  font-size: 9px;
  color: var(--text-weak);
}

/* グラフ(横棒) */
.hbar-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.hbar-row .hbar-label { flex: 0 0 7.5em; font-size: 11px; text-align: right; color: var(--text); }
.hbar-row .hbar-track { flex: 1; background: var(--accent-weak); border-radius: 3px; height: 14px; }
.hbar-row .hbar-fill { background: var(--accent); height: 100%; border-radius: 3px; min-width: 2px; }
.hbar-row .hbar-value { flex: 0 0 4.5em; font-size: 11px; color: var(--text-weak); }

/* 表 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table { border-collapse: collapse; width: 100%; font-size: 12px; }
table.data-table th, table.data-table td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  white-space: nowrap;
}
table.data-table th { background: var(--accent-weak); font-weight: 600; }
table.data-table td.delay { color: var(--alert); font-weight: 600; }

/* まとめ(ブログ) */
.digest-post { margin-bottom: 20px; }
.digest-post ul { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; }
.digest-post li { margin: 4px 0; }
.digest-post a { color: var(--accent); }

.empty-note { color: var(--text-weak); font-size: 13px; padding: 16px 0; }

footer.app-foot {
  margin: 24px 0 8px;
  font-size: 11px;
  color: var(--text-weak);
}
footer.app-foot p { margin: 4px 0; }

@media (min-width: 720px) {
  .header { text-align: center; }
}
