/* 混雑の目安（トップページ） */

/* ページ上部の「混雑の目安を見る」ボタン */
.keyvisual-congestion-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 22px 12px 18px;
  border-radius: 999px;
  background: #fff;
  color: #274f8c;
  box-shadow: 0 6px 18px rgba(23, 52, 95, 0.22);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-shadow: none;
}

.keyvisual-congestion-link:hover {
  background: #f1f6fd;
}

.keyvisual-congestion-link:focus-visible {
  outline: 3px solid #e77d34;
  outline-offset: 3px;
}

.keyvisual-congestion-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.keyvisual-congestion-icon span {
  width: 5px;
  border-radius: 1px;
}

.keyvisual-congestion-icon span:nth-child(1) {
  height: 7px;
  background: #cfe0f6;
  box-shadow: inset 0 0 0 1px rgba(39, 79, 140, 0.3);
}

.keyvisual-congestion-icon span:nth-child(2) {
  height: 12px;
  background: #7fa3d9;
}

.keyvisual-congestion-icon span:nth-child(3) {
  height: 18px;
  background: #2c5aa0;
}

.keyvisual-congestion-arrow {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  margin: -4px 0 0 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

@media only screen and (max-width: 767.98px) {
  .keyvisual-congestion-link {
    gap: 10px;
    margin-top: 10px;
    padding: 10px 18px 10px 14px;
    font-size: 16px;
  }
}

/* 部品 */
.section-top-congestion {
  --cg-ink: #464d5a;
  --cg-ink-sub: #5d6676;
  --cg-navy: #274f8c;
  --cg-blue: #336abd;
  --cg-line: #cadbf2;
  /* 5 段階は青の明るさだけで順に並べる（色の見分けに頼らず、明暗と文字で読める） */
  --cg-l1: #dde9f8;
  --cg-l2: #aac6ec;
  --cg-l3: #7aa0d8;
  --cg-l4: #4a76bd;
  --cg-l5: #23498a;
  --cg-focus: #e77d34;
  padding: 8px 0 48px;
  background-color: #eff4f9;
  color: var(--cg-ink);
  font-size: 16px;
  line-height: 1.75;
}

.congestion {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 20px;
  border: 1px solid var(--cg-line);
  border-radius: 14px;
  background: #fff;
}

.congestion-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.congestion-eyebrow {
  margin: 0 0 4px;
  color: var(--cg-blue);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.congestion-closed {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #f5f8fc;
  color: var(--cg-navy);
  font-size: 18px;
  font-weight: 700;
}

.congestion-day {
  position: relative;
}

.congestion.is-closed-day .congestion-chart-area,
.congestion.is-closed-day .congestion-note-visit {
  display: none;
}

.congestion-day-closed {
  display: block;
  width: 2.1em;
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.congestion-bar-row.is-closed .congestion-bar-level.is-note {
  grid-column: 2 / -1;
}

.congestion-heading {
  margin: 0 0 16px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: var(--cg-navy);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}

.congestion-days {
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
}

/* 曜日ボタンの使い方の一文。ボタンが出ていないとき（読み込み前・表示できなかったとき）は出さない */
.congestion-days-hint {
  margin: -6px 0 14px;
  color: var(--cg-ink-sub);
  font-size: 14px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.congestion:not(.is-ready) .congestion-days-hint {
  display: none;
}

.congestion-day {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  padding: 18px 0 8px;
  border: 1px solid #b4c9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--cg-navy);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.congestion-day:hover {
  background: #f1f6fd;
}

.congestion-day[aria-pressed="true"] {
  border-color: var(--cg-blue);
  background: var(--cg-blue);
  color: #fff;
}

.congestion-day:focus-visible {
  outline: 3px solid var(--cg-focus);
  outline-offset: 2px;
}

.congestion.is-error .congestion-summary {
  color: var(--cg-ink);
  font-size: 15px;
}

.congestion-chart-area {
  margin-top: 22px;
}

.congestion-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.congestion-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.congestion-swatch {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  background: var(--cg-l1);
  box-shadow: inset 0 0 0 1px rgba(39, 79, 140, 0.25);
}

.is-l2 > .congestion-swatch {
  background: var(--cg-l2);
}

.is-l3 > .congestion-swatch {
  background: var(--cg-l3);
}

.is-l4 > .congestion-swatch {
  background: var(--cg-l4);
}

.is-l5 > .congestion-swatch {
  background: var(--cg-l5);
}

.congestion-chart-caption {
  margin: 0 0 10px;
  color: var(--cg-ink-sub);
  font-size: 13px;
  line-height: 1.7;
}

.congestion-bars {
  margin: 0;
  padding: 0;
  list-style: none;
}

.congestion-bar-row {
  display: grid;
  grid-template-columns: 3.1em minmax(40px, 1fr) 7.2em 3.7em;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  font-size: 15px;
}

.congestion-bar-time {
  color: var(--cg-ink-sub);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.congestion-bar-track {
  position: relative;
  height: 18px;
  border-radius: 3px;
  background: #f2f5fa;
}

.congestion-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 3px;
  background: var(--cg-l1);
  box-shadow: inset 0 0 0 1px rgba(39, 79, 140, 0.25);
}

.is-l2 .congestion-bar-fill {
  background: var(--cg-l2);
}

.is-l3 .congestion-bar-fill {
  background: var(--cg-l3);
}

.is-l4 .congestion-bar-fill {
  background: var(--cg-l4);
}

.is-l5 .congestion-bar-fill {
  background: var(--cg-l5);
}

.congestion-bar-level {
  color: var(--cg-navy);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.is-l1 .congestion-bar-level,
.is-l2 .congestion-bar-level {
  color: #3e6aa8;
  font-weight: 500;
}

.congestion-bar-level.is-note {
  grid-column: 3 / span 2;
  color: var(--cg-ink-sub);
  font-size: 13px;
  font-weight: 400;
  white-space: normal;
}

.congestion-bar-minutes {
  color: var(--cg-ink);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.congestion-bar-row.is-last .congestion-bar-level,
.congestion-bar-row.is-last .congestion-bar-minutes {
  color: var(--cg-ink-sub);
  font-weight: 400;
}

.congestion-bar-row.is-last .congestion-bar-fill {
  opacity: 0.55;
}

.congestion-bar-end {
  grid-column: 2 / -1;
  margin-top: -6px;
  padding-bottom: 4px;
  color: #b4541c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.congestion-gap {
  margin: 6px 0;
  padding: 4px 0 4px calc(3.1em + 8px);
  border-top: 1px dashed #cfdbec;
  border-bottom: 1px dashed #cfdbec;
  color: var(--cg-ink-sub);
  font-size: 13px;
}

.congestion-details {
  margin-top: 22px;
  border-top: 1px solid #e3ebf6;
}

.congestion-table-heading {
  margin: 0;
  padding: 14px 2px 8px;
  color: var(--cg-navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.congestion-table-note {
  margin: 0 0 10px;
  color: var(--cg-ink-sub);
  font-size: 13px;
  line-height: 1.7;
}

.congestion-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 3px;
  table-layout: fixed;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.congestion-table th,
.congestion-table td {
  border: 0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.congestion-table th {
  padding: 4px 0;
  color: var(--cg-ink-sub);
  font-size: 13px;
  font-weight: 700;
}

.congestion-table thead th {
  color: var(--cg-navy);
  font-size: 15px;
}

.congestion-table .congestion-table-corner {
  width: 46px;
  color: var(--cg-ink-sub);
  font-size: 12px;
  font-weight: 400;
}

.congestion-table tbody th {
  padding: 0 4px 0 0;
  font-weight: 500;
  text-align: right;
}

.congestion-table td {
  height: 30px;
  padding: 0;
  font-weight: 500;
  border-radius: 3px;
  background: #f2f5fa;
  color: var(--cg-ink-sub);
}

.congestion-table td.is-l1 {
  background: var(--cg-l1);
  color: #1f4378;
}

.congestion-table td.is-l2 {
  background: var(--cg-l2);
  color: #17345f;
}

.congestion-table td.is-l3 {
  background: var(--cg-l3);
  color: #0f2a52;
}

.congestion-table td.is-l4 {
  background: var(--cg-l4);
  color: #fff;
  font-weight: 700;
}

.congestion-table td.is-l5 {
  background: var(--cg-l5);
  color: #fff;
  font-weight: 700;
}

.congestion-table td.is-closed {
  background: transparent;
  color: #a3abb8;
}

.congestion-table-gap td {
  height: auto;
  padding: 4px 0 4px 50px;
  text-align: left;
  background: transparent;
  color: var(--cg-ink-sub);
  font-size: 12px;
}

.congestion-table-mark {
  margin-left: 1px;
  color: #b4541c;
  font-size: 11px;
}

.congestion-table-end {
  margin: 8px 0 0;
  color: #b4541c;
  font-size: 13px;
  font-weight: 700;
}

.congestion-notes {
  margin-top: 20px;
  padding: 14px 14px 12px;
  border-radius: 10px;
  background: #f5f8fc;
  font-size: 13px;
  line-height: 1.75;
}

.congestion-notes p {
  margin: 0 0 6px;
}

/* 狭い画面で 1〜2 文字だけが次の行に残らないよう、区切り（<wbr>・句読点）で折り返す */
.congestion-chart-caption,
.congestion-table-note,
.congestion-notes .congestion-note-basis {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.congestion-notes .congestion-urgent {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dfe7f2;
  color: var(--cg-ink);
  font-weight: 500;
}

.congestion-urgent a {
  color: var(--cg-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.congestion-urgent a:focus-visible {
  outline: 3px solid var(--cg-focus);
  outline-offset: 2px;
}

.congestion-notes p:last-child {
  margin-bottom: 0;
}

.congestion-notes p {
  color: var(--cg-navy);
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 359.98px) {
  .congestion {
    padding: 20px 12px 16px;
  }

  .congestion-heading {
    font-size: 19px;
  }

  .congestion-days {
    gap: 4px;
  }

  .congestion-bar-row {
    grid-template-columns: 3em minmax(28px, 1fr) 7.4em 3.6em;
    gap: 6px;
    font-size: 14px;
  }

  .congestion-gap {
    padding-left: calc(3.1em + 6px);
  }

  .congestion-bar-level {
    font-size: 13px;
  }
}

@media print, (min-width: 768px) {
  .section-top-congestion {
    padding: 8px 0 72px;
  }

  .congestion {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 0 48px;
    padding: 36px 44px 32px;
    border-radius: 18px;
  }

  .congestion-intro {
    grid-column: 1;
  }

  .congestion-chart-area {
    grid-column: 2;
    grid-row: 1;
    margin-top: 6px;
  }

  .congestion-details,
  .congestion-notes {
    grid-column: 1 / -1;
  }

  .congestion-heading {
    font-size: 26px;
  }

  .congestion-days-hint {
    font-size: 13px;
  }

  .congestion-day {
    min-height: 54px;
  }

  .congestion-table-wrap {
    max-width: 640px;
  }

  .congestion-table {
    font-size: 15px;
  }

  .congestion-table td {
    height: 32px;
  }

  .congestion-notes {
    font-size: 14px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .congestion-day {
    transition: none;
  }
}
