/* Station Page V3 - Premium Bento Design */

.station-hero-v3 {
    background: var(--bg-color);
    padding: 100px 0 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 40px;
}

.kanji-header {
    font-size: 5rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    opacity: 0.15;
    margin-bottom: -20px;
    line-height: 1;
}

.english-title {
    font-size: 4rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -2px;
    color: var(--text-primary);
}

.status-pill-v3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-top: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot-blink {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-info-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    padding: 30px;
    border-radius: 24px;
    min-width: 300px;
    box-shadow: var(--card-shadow);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child { border-bottom: none; }

.info-row span {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.info-row strong {
    color: var(--text-primary);
    font-weight: 800;
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
    gap: 24px;
    margin-top: 40px;
    padding-bottom: 80px;
}

.bento-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.bento-card.large { grid-column: span 2; }
.bento-card.wide { grid-column: span 3; }

.section-title-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.schedule-pdf-btn {
    margin-left: auto;
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    padding: 7px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.schedule-pdf-btn:hover { border-color: #60a5fa; color: #60a5fa; }
.schedule-pdf-btn:disabled { opacity: 0.6; cursor: wait; }

.icon-box {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* LED Board */
.led-container-v3 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* A station with several lines produces one board per line -- on desktop
   there's room to lay them out two-across rather than one long column, which
   for an 8-line station like Shinjuku is the difference between a short
   scroll and several thousand pixels of scrolling. */
/* 769px so this never overlaps the existing max-width:768px mobile block below,
   which keeps .led-container-v3 as a horizontally-scrollable single column. */
@media (min-width: 769px) {
    .led-container-v3 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    /* A grid item's default min-width:auto is its min-content, so the widest
       departure row sized its whole column: 1fr 1fr resolved to 391px/345px
       rather than two equal halves. */
    .led-container-v3 > * { min-width: 0; }

    /* Two boards per row inside the 808px content column (the other 320px is
       the sticky infobox rail) leaves each board ~333px of usable width. The
       base row spends 235px on fixed columns plus 45px of gaps, which left the
       destination 40-77px -- narrow enough that 中野 wrapped to 中 / 野 and
       本厚木 to three lines. Trimming the fixed columns to what their content
       actually needs gives the destination ~123px. */
    /* Scoped to the container so it outranks the base .led-row, which is
       declared later in this file -- a media query adds no specificity. */
    .led-container-v3 .led-row {
        grid-template-columns: 54px 60px minmax(0, 1fr) 66px;
        column-gap: 10px;
    }
}

.led-board-v3 {
    background: #020617;
    border-radius: 12px;
    padding: 14px;
    font-family: 'JetBrains Mono', monospace;
}

/* Line name and bound-for/clock always sit on their own rows -- with boards
   now half-width in the 2-column grid, packing both on one flex row let long
   names like "Shōnan–Shinjuku Line" collide and wrap into the clock. */
.led-header {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* The board's title bar. It doubles as the collapse control on a phone, where
   nine expanded boards run to ~3,500px before anything else on the page --
   collapsed, it still shows the line name and the next departure, so a reader
   finds their line by scanning and only expands that one. */
.led-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 0;
    cursor: pointer;
    list-style: none;
}
.led-summary::-webkit-details-marker { display: none; }
.led-summary::after {
    content: '\25BE';
    color: #64748b;
    font-size: 0.8rem;
    transition: transform 0.15s ease;
}
.led-collapse[open] > .led-summary { margin-bottom: 8px; }
.led-collapse[open] > .led-summary::after { transform: rotate(180deg); }
/* Once open, the full departure list is right there -- repeating the next
   time in the header would just be the same number twice. */
.led-collapse[open] > .led-summary > .led-summary-next { display: none; }

.led-line-name { color: #f8fafc; font-weight: 700; }
.led-summary-next {
    margin-left: auto;
    color: #a3e635;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(163,230,53,0.5);
}

/* Two-column grid: every board fits at once, so they are all open and the
   summary is just a heading. */
@media (min-width: 769px) {
    /* No chevron here, so a click that silently collapsed a board would look
       like a glitch -- take the summary out of the hit-testing entirely. */
    .led-summary { cursor: default; pointer-events: none; }
    .led-summary::after { display: none; }
}
.led-status {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    color: #10b981;
    font-size: 0.8rem;
}
.live-clock {
    color: #a3e635;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1px;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(163,230,53,0.5);
}

.led-firstlast {
    padding: 4px 0 8px;
    font-size: 0.75rem;
    color: #64748b;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 6px;
    min-height: 1em;
}

/* Some lines' two ODPT directions carry identical data, others genuinely
   differ -- rather than guess, always offer both as a toggle so neither
   direction is ever silently hidden. */
.led-toggle {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.led-toggle-btn {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.led-toggle-btn:hover { border-color: rgba(163,230,53,0.4); color: #cbd5e1; }

.led-toggle-btn.active {
    background: rgba(163, 230, 53, 0.12);
    border-color: #a3e635;
    color: #a3e635;
}

.led-same-schedule-note {
    font-size: 0.68rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 8px;
    line-height: 1.3;
}

.led-row {
    display: grid;
    grid-template-columns: 70px 65px 1fr 100px;
    gap: 15px;
    padding: 5px 0;
}

.led-time { color: #fde047; font-weight: 700; }
.led-platform { color: #38bdf8; font-weight: 800; font-size: 0.85rem; text-align: center; }
.led-dest { color: #f8fafc; font-weight: 600; }
.led-type { color: #ef4444; text-align: right; font-size: 0.9rem; }

/* Lines Pill Stack */
.lines-pill-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.line-pill-v3 {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--bg-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.line-pill-v3:hover {
    transform: translateY(-3px);
    border-color: var(--line-color);
    box-shadow: none;
}

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

/* Landmarks */
.landmark-tags-v3 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.landmark-tag-v3 {
    background: var(--bg-color);
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

/* Accessibility */
.accessibility-list-v3 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.acc-item-v3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.acc-check { color: #10b981; font-weight: 900; }

/* Navigation Tips */
.navigation-tips-v3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.nav-tip-v3 {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.nav-tip-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.nav-route { font-weight: 800; color: var(--text-primary); }
.nav-time { font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); background: var(--card-bg); padding: 2px 8px; border-radius: 6px; }
.nav-note { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; margin: 0; }

/* Mobile Responsive */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-card.wide { grid-column: span 2; }
}

@media (max-width: 768px) {
    .station-hero-v3 {
        padding: 80px 0 40px 0;
    }
    .hero-flex { flex-direction: column; align-items: flex-start; gap: 20px; }
    .english-title {
        font-size: 2rem;
        letter-spacing: -1px;
    }
    .kanji-header {
        font-size: 3rem;
        margin-bottom: -15px;
    }
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
    }
    .bento-card { padding: 20px; }
    .bento-card.large, .bento-card.wide { grid-column: span 1; }
    .hero-info-card { min-width: 100%; }

    /* Quick facts: 2-column grid on mobile */
    .quick-facts-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    .quick-facts-bar > div[style*="width: 1px"] {
        display: none !important;
    }
    .quick-facts-bar > a {
        grid-column: span 2;
    }

    /* LED board: horizontal scroll instead of overflow */
    .led-row {
        grid-template-columns: 60px 55px 1fr 80px;
        gap: 8px;
        font-size: 0.85rem;
    }
    .led-container-v3 {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* A grid item defaults to min-width:auto, which is the widest thing inside
       it -- so the departure rows sized the whole card at 463px on a 393px
       phone and the entire page scrolled sideways, instead of the container's
       own overflow-x doing the scrolling. */
    .bento-grid > *,
    .station-body .bento-grid > * { min-width: 0; }
    .led-container-v3, .led-board-v3 { min-width: 0; }

    /* Platform diagram: stack vertically */
    .platform-diagram-container > div {
        flex-direction: column;
    }
    .track-layout {
        height: auto !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    /* Navigation tips: single column */
    .navigation-tips-v3 {
        grid-template-columns: 1fr;
    }

    /* Timeline: tighter */
    .timeline-v3 { padding-left: 20px; }
    .timeline-item-v3 { padding-left: 12px; margin-bottom: 20px; }
    .timeline-dot-v3 { left: -20px; }
    .timeline-date-v3 { font-size: 1rem; }
    .timeline-title-v3 { font-size: 0.95rem; }
    .timeline-desc-v3 { font-size: 0.85rem; }

    /* Status pill */
    .status-pill-v3 { font-size: 0.78rem; padding: 5px 12px; }
}

@media (max-width: 400px) {
    .english-title { font-size: 1.7rem; }
    .kanji-header { font-size: 2.5rem; }
    .bento-card { padding: 14px; }
    .quick-facts-bar > div { font-size: 0.8rem; }
    .led-row {
        grid-template-columns: 50px 45px 1fr;
        font-size: 0.78rem;
    }
}

.contribution-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50px;
  padding: 12px 24px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  border: none;
}

.contribution-button:hover {
  transform: scale(1.05);
}

/* STATION HISTORY TIMELINE */
.timeline-container-v3 {
    position: relative;
    padding: 10px 0;
}

/* Custom scrollbar for timeline */
.timeline-container-v3::-webkit-scrollbar {
    width: 8px;
}
.timeline-container-v3::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.timeline-container-v3::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.timeline-container-v3::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.timeline-v3 {
    position: relative;
    padding-left: 30px;
}

.timeline-v3::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-item-v3 {
    position: relative;
    margin-bottom: 30px;
    padding-left: 20px;
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

/* Staggered animation */
.timeline-item-v3:nth-child(1) { animation-delay: 0.1s; }
.timeline-item-v3:nth-child(2) { animation-delay: 0.2s; }
.timeline-item-v3:nth-child(3) { animation-delay: 0.3s; }
.timeline-item-v3:nth-child(4) { animation-delay: 0.4s; }
.timeline-item-v3:nth-child(5) { animation-delay: 0.5s; }
.timeline-item-v3:nth-child(n+6) { animation-delay: 0.6s; }

.timeline-item-v3:last-child {
    margin-bottom: 0;
}

.timeline-dot-v3 {
    position: absolute;
    left: -29px; /* 30px padding - 8px left - 7px radius */
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--text-muted);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item-v3:hover .timeline-dot-v3 {
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--text-muted);
}

/* Event Types Colors */
.timeline-dot-v3.opening { border-color: #10b981; } /* Emerald */
.timeline-item-v3:hover .timeline-dot-v3.opening { box-shadow: 0 0 10px rgba(16, 185, 129, 0.5); }

.timeline-dot-v3.expansion { border-color: #3b82f6; } /* Blue */
.timeline-item-v3:hover .timeline-dot-v3.expansion { box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }

.timeline-dot-v3.renovation { border-color: #f59e0b; } /* Amber */
.timeline-item-v3:hover .timeline-dot-v3.renovation { box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }

.timeline-dot-v3.incident { border-color: #ef4444; } /* Red */
.timeline-item-v3:hover .timeline-dot-v3.incident { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }

.timeline-dot-v3.closure { border-color: #64748b; } /* Slate */
.timeline-item-v3:hover .timeline-dot-v3.closure { box-shadow: 0 0 10px rgba(100, 116, 139, 0.5); }

.timeline-dot-v3.event { border-color: #8b5cf6; } /* Purple */
.timeline-item-v3:hover .timeline-dot-v3.event { box-shadow: 0 0 10px rgba(139, 92, 246, 0.5); }

.timeline-content-v3 {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    transition: all 0.3s ease;
}

.timeline-item-v3:hover .timeline-content-v3 {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.2);
}

.timeline-date-v3 {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-month-v3 {
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
}

.timeline-title-v3 {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.timeline-desc-v3 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Japanese source text, collapsed by default: available for verification
   without walling an English reader behind text they can't read. */
.timeline-original {
    margin: 6px 0 0;
    font-size: 0.82rem;
}

.timeline-original summary {
    cursor: pointer;
    color: var(--text-muted);
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.timeline-original summary::-webkit-details-marker { display: none; }

.timeline-original summary::before {
    content: '▸';
    font-size: 0.7rem;
    transition: transform 0.15s ease;
}

.timeline-original[open] summary::before { transform: rotate(90deg); }

.timeline-original summary:hover { color: var(--text-secondary); }

.timeline-original p {
    margin: 8px 0 0;
    padding: 10px 12px;
    background: rgba(127, 127, 127, 0.08);
    border-left: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Narrative fallback for stations (Tokyo, Moka...) whose ja.wikipedia history
   is prose subsections rather than a dated bullet list -- same document
   voice as the timeline (title/body/collapsible-original) but read top to
   bottom instead of as discrete dated events. */
.history-prose-chunk {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
}

.history-prose-chunk:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.history-prose-heading {
    margin: 0 0 8px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.history-prose-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Layout C: content column + sticky infobox ───────────────────────────
   The facts sit in a rail that stays visible while the timeline scrolls, so a
   reader checking "wait, which operator?" mid-paragraph doesn't lose their
   place. Wikipedia's pattern, and readers already know how to use it. */
.station-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
    margin-top: 40px;
}

/* The grid is narrower now that the rail takes 320px, so three columns of
   bento cards no longer fit. */
.station-body .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 0;
    padding-bottom: 40px;
    /* The base grid forces every row to minmax(200px, auto) so bento tiles line
       up. A group header is one line of text and takes its own full-width row,
       so that floor stretched it to ~200px and opened a hole under every
       heading. Size rows to content and put the floor on the cards, which are
       what the rule was actually for. */
    grid-auto-rows: auto;
}

.station-body .bento-grid > .bento-card { min-height: 200px; }

/* The base rules size these against a 3-column grid (.large spans 2, .wide
   spans 3). The rail takes 320px, leaving a 2-column grid, so a .wide card
   asks for three tracks that no longer exist and overflows its container.
   Both simply mean "full width" here. */
.station-body .bento-grid > .bento-card.large,
.station-body .bento-grid > .bento-card.wide {
    grid-column: 1 / -1;
}

.station-infobox {
    position: sticky;
    top: 90px;               /* clears the fixed navbar */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    font-size: 0.9rem;
}

.station-infobox h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0 0 3px;
    color: var(--text-primary);
}

.infobox-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0 0 16px;
    line-height: 1.5;
}

.infobox-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
}

.infobox-row dt {
    font-size: 0.76rem;
    color: var(--text-muted);
    flex-shrink: 0;
    padding-top: 1px;
}

.infobox-row dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Where a number is only meaningful with its scope -- 3.6M across all
   operators vs 666,809 for JR East alone -- the scope rides with the number
   rather than being left for the reader to infer. */
.infobox-scope {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 1px;
}

.infobox-ops {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.infobox-ops-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 9px;
}

.infobox-op {
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}
.infobox-op:last-child { border-bottom: none; }

.infobox-op-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.84rem;
}

.infobox-op-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 2px;
}

.infobox-foot {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.infobox-foot a { color: inherit; text-decoration: underline; }

/* Group headers that give the page a spine instead of 14 equal cards. */
.station-group {
    grid-column: 1 / -1;
    margin: 26px 0 -6px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.station-group:first-child { margin-top: 0; }

.station-group h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.station-group span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Below 1100px the rail would squeeze the content column too hard, so it
   stops being sticky and moves above the content -- facts first, which is
   the right order on a phone anyway. */
@media (max-width: 1100px) {
    .station-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .station-infobox {
        position: static;
        order: -1;
    }
    .station-body .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .station-body { margin-top: 24px; }
    .station-body .bento-grid { grid-template-columns: 1fr; }
    .station-group { margin: 18px 0 -8px; }
    .station-group h2 { font-size: 1.1rem; }
}

/* ---- Departure melodies -------------------------------------------------
   Two extractions feed this card: the 発車メロディ overview article (dates,
   the 備考 reason, whether a melody has been retired) and each station's own
   article (wider coverage, platform only). A melody whose documented period
   has ended is still worth recording, but it is visibly separated from the
   ones actually playing today rather than presented as current. */
.melody-entry {
    padding: 12px 16px;
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    border-left: 3px solid #6366f1;
    border-radius: 12px;
}
.melody-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.melody-qualifier {
    margin-left: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.melody-artist {
    margin-top: 2px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.melody-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.melody-meta .melody-plat { color: var(--text-muted); }
.melody-section {
    margin-top: 3px;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-muted);
}
.melody-note {
    margin: 8px 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-muted);
}
.melody-former-head {
    margin-top: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.melody-entry.is-former {
    border-left-color: var(--border-color);
    opacity: 0.72;
}
.melody-entry.is-former .melody-title { font-weight: 700; }
.melody-meta .melody-maker {
    padding: 1px 8px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
