@charset "UTF-8";

/* ==========================================================================

   列車走行位置・ダイヤグラム・時刻表 専用スタイル

   ========================================================================== */

:root {
  --rail-color: #64748b;
  --rail-color-soft: rgba(100, 116, 139, 0.18);
  /* 列車種別カラー（従来様式） */
  --train-local: #007aff;
  --train-sl: #f08c00;
  --train-extra: #ff3b30;
  --train-empty: #6e6e73;
  /* ダイヤグラム描画カラー */
  --svg-grid-line: #eaedf2;
  --svg-grid-line-major: #cbd5e1;
  --svg-grid-text: #64748b;
  --svg-station-line: #cbd5e1;
  --svg-station-line-alt: #e8edf4;
  --svg-station-text: #18181b;
  --svg-station-text-alt: #64748b;
  --svg-train-text: #18181b;
  --svg-now-line: #ff3b30;
}

.container,

.header-inner,

.footer-inner {
  max-width: 1080px;
}

main.container {
  padding-top: 20px;
}

.header-clock {
  text-align: right;
  font-size: 0.76rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.header-clock strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-fg);
}

/* ===== バナー & 公式運行情報バー ===== */

.offline-banner,

.irregular-banner {
  padding: 8px 16px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 600;
}

.offline-banner {
  background-color: #fff3cd;
  color: #856404;
  border-bottom: 1px solid #ffe69c;
}

.irregular-banner {
  background-color: #d93025;
  color: #ffffff;
  border-bottom: 1px solid #b3261e;
}

.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  margin-bottom: 16px;
  background-color: #ffffff;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}

.notice-bar.status-normal {
  background-color: #ffffff;
  border-color: var(--c-border);
}

.notice-bar.status-delay {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.notice-bar.status-unknown,

.notice-bar.status-loading {
  background-color: #ffffff;
  border-color: var(--c-border);
}

.notice-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.notice-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  background-color: #94a3b8;
  flex-shrink: 0;
}

.status-normal .notice-icon {
  background-color: #2fb344;
}

.status-delay .notice-icon {
  background-color: #f97316;
}

.status-unknown .notice-icon,

.status-loading .notice-icon {
  background-color: #94a3b8;
}

.notice-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.notice-copy strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-fg);
}

.status-delay .notice-copy strong {
  color: #9a3412;
  font-weight: 700;
}

.notice-copy span {
  font-size: 0.72rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.notice-link {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-accent);
}

.notice-link:hover {
  text-decoration: underline;
}

/* ===== 日付・時刻ツールバー ===== */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-fg);
  font-variant-numeric: tabular-nums;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  background-color: var(--c-bg);
}

.date-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 28px 6px 11px;
  background-color: var(--c-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: 5px;
  font-size: 0.8rem;
  color: var(--c-muted);
  cursor: pointer;
}

.date-picker-control::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23525866" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,4H18V2H16V4H8V2H6V4H5A2,2 0 0,0 3,6V20A2,2 0 0,0 5,22H19A2,2 0 0,0 21,20V6A2,2 0 0,0 19,4M19,20H5V10H19V20M19,8H5V6H19V8M7,12H12V17H7V12Z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.time-picker-control::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23525866" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.date-control input {
  border: none;
  background: transparent;
  color: var(--c-fg);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  outline: none;
  cursor: pointer;
}

.date-control input[data-is-datepicker] {
  width: 88px;
}

.date-control input[type="time"] {
  width: 48px;
}

input[type="date"]::-webkit-calendar-picker-indicator,

input[type="time"]::-webkit-calendar-picker-indicator {
  display: none !important;
}

/* ===== ビュー切替タブ ===== */

.view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background-color: var(--surface3, #edf2f7);
  border: 1px solid var(--border, #dcdce4);
  border-radius: var(--radius-sm, 6px);
  margin-bottom: 18px;
}

.view-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-xs, 4px);
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text2, #475569);
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-tab:hover {
  color: var(--text, #1e293b);
  background-color: rgba(255, 255, 255, 0.6);
}

.view-tab.active {
  background-color: var(--surface, #ffffff);
  color: var(--text, #1e293b);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

/* ===== パネルヘッダ & 凡例 & セグメントボタン ===== */

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--c-fg);
}

.diagram-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: #475569;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: var(--radius-xs, 4px);
}

.dot.local {
  background-color: var(--train-local);
}

.dot.sl {
  background-color: var(--train-sl);
}

.dot.extra {
  background-color: var(--train-extra);
}

.dot.empty {
  background-color: var(--train-empty);
}

.leg-line {
  display: inline-block;
  width: 20px;
  height: 0;
}

.leg-line.local {
  border-top: 2.5px solid var(--train-local);
}

.leg-line.sl {
  border-top: 3.5px solid var(--train-sl);
}

.leg-line.extra {
  border-top: 2.5px solid var(--train-extra);
}

.leg-line.empty {
  border-top: 2px dashed var(--train-empty);
}

.seg-group {
  display: inline-flex;
  border: 1px solid var(--c-border-strong);
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--c-bg);
}

.seg-btn {
  background-color: var(--c-bg);
  border: none;
  border-right: 1px solid var(--c-border);
  padding: 5px 13px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-muted);
  cursor: pointer;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  color: var(--c-fg);
  background-color: var(--c-surface);
}

.seg-btn.active {
  background-color: var(--c-accent);
  color: #ffffff;
}

/* ==========================================================================

   1. 列車走行位置ビュー（洗練されたモダン交通インフォメーション設計）

   ========================================================================== */

.position-card {
  background-color: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  overflow: hidden;
}

.position-time {
  padding: 9px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  border-bottom: 1px solid var(--c-border);
  background-color: #ffffff;
}

.position-time strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.position-time small {
  font-size: 0.74rem;
  color: #64748b;
}

/* トラック見出し行（4カラムGrid：駅名列＋下り1fr＋レール＋上り1frで下り/上り幅を完全対称化） */

.position-track-head {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  padding: 7px 0;
  background-color: #ffffff;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
}

.pth-station {
  grid-column: 1;
  padding-left: 14px;
  color: #64748b;
}

.pth-down {
  grid-column: 2;
  text-align: right;
  padding-right: 8px;
  color: #64748b;
}

.pth-rail {
  grid-column: 3;
}

.pth-up {
  grid-column: 4;
  text-align: left;
  padding-left: 8px;
  padding-right: 12px;
  color: #64748b;
}

.position-body {
  padding: 6px 0 14px;
  position: relative;
  background-color: #ffffff;
}

.pos-station-row,

.pos-between-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  position: relative;
  padding: 0;
}

/* 駅行：枠線を一切引かず、ごく淡い面のみで駅位置を自然に示す */

.pos-station-row {
  min-height: 46px;
  background-color: #f8fafc;
}

/* 駅間行：清潔な白背景 */

.pos-between-row {
  min-height: 38px;
  background-color: #ffffff;
}

/* 駅名列（第1カラム・余計な色文字なし） */

.pos-station-name-col {
  grid-column: 1;
  padding-left: 14px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

/* 交換可能駅・起終点のみ文字ウェイトで強調 */

.pos-station-row.can-exchange .pos-station-name-col {
  font-weight: 700;
  color: #0f172a;
}

/* 中央路線レール（下り列と上り列の完全中央に固定） */

.pos-rail-area {
  grid-column: 3;
  position: relative;
  width: 28px;
  height: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-rail-area::before {
  content: "";
  position: absolute;
  width: 4px;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  background-color: var(--rail-color);
  z-index: 1;
}

.pos-rail-area.rail-first::before {
  top: 50%;
  border-radius: 2px 2px 0 0;
}

.pos-rail-area.rail-last::before {
  bottom: 50%;
  border-radius: 0 0 2px 2px;
}

/* 駅ノード（丸） */

.pos-station-dot {
  width: 11px;
  height: 11px;
  background-color: #ffffff;
  border: 2.5px solid var(--rail-color);
  border-radius: 50%;
  z-index: 2;
  flex-shrink: 0;
}

.pos-station-row.can-exchange .pos-station-dot {
  width: 14px;
  height: 14px;
  border-width: 3px;
}

.pos-station-row.is-exchanging .pos-station-dot {
  background-color: var(--rail-color);
  box-shadow: 0 0 0 4px var(--rail-color-soft);
}

/* 列車カード配置コンテナ */

.pos-trains-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 34px;
  min-width: 0;
}

.pos-trains-down {
  grid-column: 2;
  justify-content: flex-end;
  padding: 4px 6px 4px 4px;
}

.pos-trains-up {
  grid-column: 4;
  justify-content: flex-start;
  padding: 4px 12px 4px 6px;
}

/* 列車カード：五角形方向アイコンを常にレール側へ固定し、ステッカー部のみ折り返し許容 */

.pos-train-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}

.pos-train-card.dir-down {
  justify-content: flex-end;
}

.pos-train-card.dir-up {
  justify-content: flex-start;
}

/* 進行方向＆種別を示す五角形アイコン（レール脇に固定・縮小禁止） */

.pos-train-shield {
  width: 22px;
  height: 25px;
  flex: 0 0 22px;
}

.pos-train-shield svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 列車情報ボディ（幅不足時は内部で自然に折り返し、五角形アイコンを決して押し出さない） */

.pos-train-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 6px;
  padding: 4px 8px;
  min-width: 0;
  flex: 0 1 auto;
  background-color: #ffffff;
  border: 1px solid #d5dce6;
  border-radius: 4px;
  transition: border-color 0.12s, background-color 0.12s;
}

.pos-train-card.dir-down .pos-train-info {
  justify-content: flex-end;
}

.pos-train-card:hover .pos-train-info {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.pos-train-no {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pos-train-dest {
  font-size: 0.72rem;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

/* 状態タグ：枠線・色付きを廃止し、控えめなグレースケールピルに統一 */

.pos-stopped-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.65rem;
  font-weight: 600;
  background-color: #eef2f6;
  color: #475569;
  white-space: nowrap;
}

/* 遅延時のみ赤バッジで注意喚起 */

.pos-delay-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.65rem;
  font-weight: 700;
  background-color: #fee2e2;
  color: #dc2626;
  white-space: nowrap;
}

/* ==========================================================================

   2. ダイヤグラムビュー

   ========================================================================== */

.diagram-shell {
  display: flex;
  align-items: flex-start;
  background-color: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
}

#diagram-axis {
  display: block;
  flex-shrink: 0;
  background-color: #f8fafc;
  border-right: 1px solid var(--c-border-strong);
  z-index: 2;
}

.table-card {
  background-color: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  overflow: hidden;
}

.diagram-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

#diagram-svg {
  display: block;
  background-color: #ffffff;
}

.helper {
  font-size: 0.78rem;
  color: var(--c-muted);
  margin-top: 8px;
}

/* ==========================================================================

   3. 路線時刻表ビュー

   ========================================================================== */

#timetable-table {
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  width: max-content;
  min-width: 100%;
}

#timetable-table th,

#timetable-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--c-border);
  border-right: 1px solid #eef2f6;
  font-size: 0.76rem;
  white-space: nowrap;
  text-align: center;
}

#timetable-table th {
  position: sticky;
  top: 0;
  background-color: #f8fafc;
  color: var(--c-muted);
  font-weight: 600;
  z-index: 2;
}

#timetable-table tr.tt-dest th {
  border-bottom: 2px solid var(--c-border-strong);
}

#timetable-table th:first-child,

#timetable-table td:first-child {
  position: sticky;
  left: 0;
  background-color: #ffffff;
  text-align: left;
  z-index: 3;
  font-weight: 700;
  min-width: 96px;
  border-right: 2px solid var(--c-border-strong);
}

#timetable-table thead th:first-child {
  background-color: #f1f5f9;
  z-index: 4;
}

#timetable-table tbody tr.tt-exchange-row td {
  background-color: #f8fafc;
}

#timetable-table tbody tr.tt-exchange-row td:first-child {
  background-color: #f1f5f9;
}

#timetable-table tbody tr:hover td,

#timetable-table tbody tr:hover td:first-child {
  background-color: #edf5ff;
}

.tt-header-row.tt-type th {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
}

.tt-type-local {
  color: var(--train-local) !important;
}

.tt-type-sl {
  color: #c2410c !important;
  background-color: #fff7ed !important;
}

.tt-type-extra {
  color: var(--train-extra) !important;
  background-color: #fff5f5 !important;
}

.tt-type-empty {
  color: var(--train-empty) !important;
}

.tt-header-row.tt-trainno th {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--c-fg);
}

.tt-header-row.tt-dest th {
  font-size: 0.7rem;
  color: var(--c-muted);
}

.tt-st-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tt-st-labels {
  display: flex;
  flex-direction: column;
  font-size: 0.62rem;
  color: var(--c-muted);
  line-height: 1.3;
  font-weight: 500;
}

.tt-times {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.35;
}

.tt-arr {
  font-size: 0.68rem;
  color: var(--c-muted);
}

.tt-dep {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--c-fg);
}

.tt-pass {
  color: var(--c-muted);
  font-size: 0.72rem;
}

.tt-cancel {
  color: var(--train-extra);
  font-size: 0.7rem;
  font-weight: 600;
  text-decoration: line-through;
}

/* ==========================================================================

   4. 列車詳細モーダル

   ========================================================================== */

.train-modal-content {
  position: relative;
  max-width: 460px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 8px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background-color: var(--c-surface);
  color: var(--c-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--c-fg);
  background-color: var(--c-surface-hover);
}

.modal-kicker {
  color: var(--c-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 2px 0 10px;
}

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

.badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  background-color: var(--c-surface);
  color: var(--c-fg);
}

.badge.blue {
  border-color: rgba(0, 122, 255, 0.35);
  background-color: rgba(0, 122, 255, 0.1);
  color: #0062cc;
}

.badge.green {
  border-color: rgba(47, 179, 68, 0.4);
  background-color: #ebfbee;
  color: #1b7a2e;
}

.badge.orange {
  border-color: rgba(240, 140, 0, 0.45);
  background-color: #fff4e6;
  color: #c2410c;
}

.badge.red {
  border-color: rgba(255, 59, 48, 0.4);
  background-color: #fff5f5;
  color: #c92a2a;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.detail-cell {
  border: 1px solid var(--c-border);
  background-color: var(--c-surface);
  border-radius: 5px;
  padding: 8px 10px;
}

.detail-cell small {
  display: block;
  color: var(--c-muted);
  font-size: 0.7rem;
}

.detail-cell strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
}

.formation {
  margin-top: 14px;
}

.formation h4,

.station-detail h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-muted);
  margin-bottom: 6px;
}

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

.formation-list span {
  padding: 4px 9px;
  border: 1px solid var(--c-border);
  background-color: var(--c-surface);
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
}

.memo {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #ffd8a8;
  background-color: #fff9db;
  border-radius: 5px;
  color: var(--c-fg);
  font-size: 0.78rem;
  line-height: 1.5;
}

.station-detail {
  margin-top: 14px;
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
}

.stop-row {
  display: grid;
  grid-template-columns: 1fr 64px 64px;
  gap: 6px;
  padding: 5px 6px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--c-border);
  font-variant-numeric: tabular-nums;
}

.stop-row.cancel {
  color: var(--train-extra);
  text-decoration: line-through;
}

@media (max-width: 720px) {

  main.container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
  }

  .view-tabs {
    display: flex;
    width: 100%;
  }

  .view-tab {
    flex: 1;
    padding: 7px 8px;
    text-align: center;
  }

  .pos-station-row,

  .pos-between-row,

  .position-track-head {
    grid-template-columns: 42px minmax(0, 1fr) 16px minmax(0, 1fr);
  }

  .pth-station,

  .pos-station-name-col {
    padding-left: 5px;
    font-size: 0.74rem;
  }

  .pth-down {
    padding-right: 4px;
    font-size: 0.64rem;
  }

  .pth-rail,

  .pos-rail-area {
    width: 16px;
  }

  .pth-up {
    font-size: 0.64rem;
    padding-left: 4px;
    padding-right: 4px;
  }

  .pos-trains-down {
    padding: 3px 3px 3px 2px;
  }

  .pos-trains-up {
    padding: 3px 2px 3px 3px;
  }

  .pos-train-card {
    gap: 3px;
    max-width: 100%;
  }

  .pos-train-shield {
    width: 16px;
    height: 19px;
    flex: 0 0 16px;
  }

  .pos-train-info {
    padding: 2px 5px;
    gap: 2px 3px;
  }

  .pos-train-no {
    font-size: 0.72rem;
  }

  .pos-train-dest {
    font-size: 0.62rem;
  }

  .pos-stopped-badge,

  .pos-delay-badge {
    font-size: 0.56rem;
    padding: 0 3px;
  }

  .diagram-legend {
    display: none;
  }

}

/* ==========================================================================

   充当車両表示・各駅時刻表 & 駅情報ビュー スタイル (2026 Light Theme & Modern Design)

   ========================================================================== */

/* 1. 走行位置：駅名クリック可能表示 */

.clickable-station {
  cursor: pointer;
  transition: color 0.15s ease, text-decoration 0.15s ease;
  user-select: none;
}

.clickable-station:hover {
  color: #006633 !important;
  text-decoration: underline;
}

/* 2. 走行位置：列車カード内の充当車両バッジ */

.pos-veh-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs, 4px);
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.4);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.pos-veh-badge--op {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* 3. 路線時刻表：充当車両行 */

.tt-veh-cell {
  font-size: 0.72rem;
  font-weight: 700;
  color: #047857;
  line-height: 1.3;
  white-space: nowrap;
  padding: 6px 4px !important;
  background: rgba(16, 185, 129, 0.08);
}

.tt-op-badge {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
}

/* 4. モーダル：編成・車両アイコン */

.formation-car {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xs, 4px);
  margin-right: 6px;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: #1e293b;
}

.formation-icon {
  width: 26px;
  height: 18px;
  object-fit: contain;
}

/* 5. 各駅時刻表・駅情報ビュー (#view-station) */

#view-station {
  padding-bottom: 24px;
}

.st-nav-controls {
  display: flex;
  gap: 8px;
}

.st-nav-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-xs, 4px);
  border: 1px solid var(--c-border, #dce2ea);
  background: #ffffff;
  color: var(--c-fg, #18181b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.st-nav-btn:hover:not(:disabled) {
  background: var(--c-surface-hover, #eef2f7);
  border-color: #006633;
  color: #006633;
}

.st-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 駅セレクターバー */

.station-selector-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 14px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.station-selector-bar {
  display: flex;
  gap: 6px;
  min-width: max-content;
}

.st-sel-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  min-width: 58px;
  background: #ffffff;
  border: 1px solid var(--c-border, #dce2ea);
  border-radius: var(--radius-xs, 4px);
  cursor: pointer;
  color: var(--c-muted, #525866);
  transition: all 0.15s ease;
  user-select: none;
}

.st-sel-btn:hover {
  border-color: #006633;
  color: #006633;
  background: #f0fdf4;
}

.st-sel-btn.active {
  background: #006633;
  color: #ffffff !important;
  border-color: #006633;
  box-shadow: 0 2px 6px rgba(0, 102, 51, 0.25);
}

.st-sel-btn.active .st-sel-code,

.st-sel-btn.active .st-sel-name {
  color: #ffffff !important;
}

.st-sel-code {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.st-sel-name {
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 1px;
  white-space: nowrap;
}

/* ===== 次の列車カウントダウンカード ===== */

.station-next-trains-card {
  margin-bottom: 16px;
}

.next-trains-card-inner {
  background: #ffffff;
  border: 1px solid var(--c-border, #dce2ea);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.next-trains-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--c-border, #dce2ea);
}

.next-trains-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.02em;
}

.next-trains-clock-sync {
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
}

.next-trains-clock-sync::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.next-trains-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.next-trains-card-inner.single-col .next-trains-grid {
  grid-template-columns: 1fr;
}

.next-col {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.next-col:not(:last-child) {
  border-right: 1px solid var(--c-border, #dce2ea);
}

.next-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
}

.next-col.dir-down .next-col-arrow {
  color: #006633;
  font-weight: 800;
}

.next-col.dir-up .next-col-arrow {
  color: #2563eb;
  font-weight: 800;
}

.next-train-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.next-time-box {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.next-dep-time {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.next-dep-unit {
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
}

.next-dest-box {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.next-dest-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.next-dest-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

.next-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #64748b;
}

.next-train-no {
  font-weight: 600;
  color: #334155;
}

.next-veh-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.72rem;
  color: #334155;
}

.mini-veh-icon {
  height: 14px;
  width: auto;
  vertical-align: middle;
}

.next-countdown-box {
  text-align: right;
}

.cd-chip {
  display: inline-block;
  padding: 4px 9px;
  border-radius: var(--radius-xs, 4px);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cd-normal {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.cd-urgent {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.cd-imminent {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  animation: pulse-cd 1.5s infinite;
}

.cd-departing {
  background: #f3f4f6;
  color: #6b7280;
}

@keyframes pulse-cd {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.following-train-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #64748b;
  padding-top: 6px;
  border-top: 1px dashed var(--c-border, #dce2ea);
}

.fol-tag {
  font-size: 0.68rem;
  padding: 1px 4px;
  background: #f1f5f9;
  border-radius: var(--radius-xs, 4px);
  color: #475569;
}

.fol-time {
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.fol-dest {
  color: #334155;
}

.fol-diff {
  color: #94a3b8;
}

.next-train-empty {
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .next-trains-grid {
    grid-template-columns: 1fr;
  }
  .next-col:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--c-border, #dce2ea);
  }
  .next-dep-time {
    font-size: 1.45rem;
  }
}

/* 駅情報カード */

.station-info-card {
  background: #ffffff;
  border: 1px solid var(--c-border, #dce2ea);
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.st-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border, #dce2ea);
  margin-bottom: 14px;
}

.st-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.st-code-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 32px;
  background: #006633;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  border-radius: var(--radius-xs, 4px);
  letter-spacing: 0.5px;
}

.st-names {
  display: flex;
  flex-direction: column;
}

.st-main-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.st-main-name {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  color: #0f172a;
  line-height: 1.2;
}

.st-telegram-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xs, 4px);
  color: #475569;
  letter-spacing: 0.5px;
}

.st-sub-name {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 2px;
  font-weight: 500;
}

.st-header-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.st-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  width: 100%;
}

.st-type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs, 4px);
}

.st-type-pill.type-manned {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.st-type-pill.type-unmanned {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.st-exchange-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs, 4px);
}

.st-exchange-badge.exchange-yes {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.st-exchange-badge.exchange-no {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.st-sl-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs, 4px);
}

.st-sl-badge.sl-stops {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.st-sl-badge.sl-passes {
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}

.st-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.st-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.st-meta-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

.st-meta-val {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 500;
}

.st-meta-val strong {
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 700;
}

.st-meta-val.muted {
  color: #94a3b8;
}

.st-tag-conn {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-xs, 4px);
  word-break: break-word;
  line-height: 1.4;
}

.st-tag-yes {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-xs, 4px);
  margin-right: 4px;
}

.st-tag-no {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 7px;
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-xs, 4px);
  margin-right: 4px;
}

.st-desc-box {
  padding: 10px 14px;
  border-radius: var(--radius-xs, 4px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.st-features-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.st-highlights-box {
  background: var(--surface2, #f8fafc);
  border: 1px solid var(--border, #dcdce4);
  border-radius: var(--radius-sm, 6px);
}

.st-box-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #006633;
}

.st-box-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: #334155;
}

/* 発車時刻表セクション */

.station-timetable-section {
  margin-top: 14px;
}

.st-tt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.st-tt-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.st-tt-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0;
  color: #0f172a;
}

.st-tt-date {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

.station-timetable-wrap {
  background: #ffffff;
  border: 1px solid var(--c-border, #dce2ea);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.st-tt-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.st-tt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.st-tt-table th {
  background: #f8fafc;
  padding: 10px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--c-border, #dce2ea);
  white-space: nowrap;
}

.st-tt-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.st-tt-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.st-tt-row:hover {
  background: #edf5ff;
}

.st-tt-row:last-child td {
  border-bottom: none;
}

.st-tt-time {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.st-dir-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-xs, 4px);
  margin-right: 6px;
}

.st-dir-badge.dir-down {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.st-dir-badge.dir-up {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.st-dest-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
}

.st-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs, 4px);
}

.st-type-badge.type-local {
  background: #f1f5f9;
  color: #475569;
}

.st-type-badge.type-sl {
  background: #b45309;
  color: #ffffff;
}

.st-type-badge.type-extra {
  background: #b91c1c;
  color: #ffffff;
}

.st-trainno-text {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.st-op-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xs, 4px);
  color: #475569;
}

.st-tt-veh-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-xs, 4px);
  color: #047857;
  white-space: nowrap;
  margin-right: 4px;
}

.st-tt-veh-icon {
  width: 22px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.st-tt-veh-unassigned {
  font-size: 0.75rem;
  color: #94a3b8;
}

.st-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs, 4px);
  white-space: nowrap;
}

.st-status-badge.status-normal {
  background: #f1f5f9;
  color: #64748b;
}

.st-status-badge.status-current {
  background: #059669;
  color: #ffffff;
}

.st-status-badge.status-current.pulse {
  animation: stPulse 1.8s infinite;
}

@keyframes stPulse {

  0% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.6); }

  70% { box-shadow: 0 0 0 6px rgba(5, 150, 105, 0); }

  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }

}

.st-status-badge.status-running {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.st-status-badge.status-departed {
  background: #f8fafc;
  color: #94a3b8;
  font-weight: 500;
}

.st-status-badge.status-cancel {
  background: #fee2e2;
  color: #dc2626;
}

.st-tt-empty {
  padding: 36px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.88rem;
}

/* モバイル対応最適化 (max-width: 600px) */

@media (max-width: 600px) {

  .view-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .view-tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .station-info-card {
    padding: 14px 12px;
  }

  .st-info-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .st-header-badges {
    width: 100%;
  }

  .st-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .st-meta-val {
    word-break: break-word;
  }

  .st-tt-table th, .st-tt-table td {
    padding: 8px 8px;
    font-size: 0.75rem;
  }

  .st-tt-time {
    font-size: 0.9rem;
  }

}

