:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    color: #172033;
    background: #eef3f9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef3f9;
}

button,
input,
select {
    font: inherit;
}

.page-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.site-header,
.search-panel,
.timetable-sheet,
.notice,
footer {
    background: #ffffff;
    border: 1px solid #c9d5e4;
}

.site-header {
    padding: 24px;
    border-bottom: 6px solid #7f9dc2;
}

.site-header h1 {
    margin: 4px 0 8px;
}

.site-header p {
    margin: 0;
}

.eyebrow {
    color: #526b8c;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.search-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    align-items: end;
}

.search-panel label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.search-panel input,
.search-panel select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #9dacbf;
    border-radius: 4px;
    background: #ffffff;
}

.search-panel select[aria-invalid="true"] {
    border-color: #a63f3f;
    box-shadow: 0 0 0 2px rgb(166 63 63 / 15%);
}

.search-panel button {
    padding: 11px 16px;
    border: 0;
    border-radius: 4px;
    background: #2d5f91;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.search-panel button:hover {
    background: #244f78;
}

.form-error {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    padding: 9px 12px;
    border-left: 4px solid #a63f3f;
    background: #fff4f4;
    color: #7d2525;
    font-weight: 700;
}

.form-error[hidden] {
    display: none;
}

.page-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.page-controls a,
.page-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid #73869d;
    border-radius: 4px;
    background: #ffffff;
    color: #274e7b;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.page-controls a:hover,
.page-controls button:hover {
    background: #e8eff7;
}

.timetable-sheet,
.notice {
    margin-top: 16px;
    padding: 20px;
}

.timetable-sheet {
    border-color: #8090a3;
    background: #f5f6f8;
    box-shadow: 0 2px 8px rgb(38 58 82 / 12%);
}

.sheet-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: -20px -20px 0;
    padding: 10px 14px;
    border: 2px solid #24364b;
    background: #8da8ca;
    color: #ffffff;
}

.sheet-heading > div {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.sheet-heading span {
    padding: 3px 7px;
    background: #ffffff;
    color: #314d70;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.sheet-heading strong {
    font-size: 1.28rem;
    line-height: 1.2;
    text-shadow: 0 1px 0 rgb(0 0 0 / 18%);
}

.sheet-heading p {
    margin: 0;
    padding: 4px 8px;
    border: 1px solid rgb(255 255 255 / 70%);
    background: rgb(255 255 255 / 16%);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.directions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
    align-items: start;
}

.direction-panel {
    min-width: 0;
    border: 2px solid #273443;
    background: #ffffff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
}

.route-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
    min-height: 58px;
    border-bottom: 2px solid #273443;
    background: #8da8ca;
    color: #ffffff;
}

.route-header > div:not(.route-arrow) {
    display: flex;
    flex-direction: column-reverse;
    justify-content: center;
    gap: 1px;
    padding: 7px 9px;
}

.route-header > div:first-child {
    border-right: 0;
}

.route-header > div:last-child {
    border-left: 0;
    text-align: right;
}

.route-header strong {
    overflow-wrap: anywhere;
    font-size: 1.12rem;
    font-weight: 900;
    line-height: 1.15;
    text-shadow: 0 1px 0 rgb(0 0 0 / 18%);
}

.airport-code {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    opacity: 0.95;
}

.route-arrow {
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #ffffff;
    color: #5f7fa7;
    clip-path: polygon(0 0, 74% 0, 100% 50%, 74% 100%, 0 100%, 24% 50%);
}

.route-plane {
    --plane-start: -10px;
    --plane-end: 30px;
    display: block;
    font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 1px 0 rgb(255 255 255 / 70%);
    transform: translateX(var(--plane-start));
    animation: route-plane-flight 2.8s ease-in-out infinite;
}

@keyframes route-plane-flight {
    0%, 12% {
        transform: translateX(var(--plane-start));
        opacity: 0.45;
    }

    45%, 55% {
        opacity: 1;
    }

    88%, 100% {
        transform: translateX(var(--plane-end));
        opacity: 0.45;
    }
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    color: #111820;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

th,
td {
    padding: 4px 5px;
    border: 1px solid #59636e;
    text-align: left;
    vertical-align: middle;
}

th {
    padding-top: 3px;
    padding-bottom: 3px;
    background: #f2f3f4;
    color: #26313d;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
    white-space: nowrap;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2),
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5) {
    white-space: nowrap;
}

tbody tr:nth-child(even) td {
    background: #fafafa;
}

tbody td:first-child {
    width: 18%;
    background: #dceee8;
    font-size: 0.86rem;
    font-weight: 900;
    text-align: center;
}

tbody tr:nth-child(even) td:first-child {
    background: #d3e8e1;
}

tbody td:nth-child(2) {
    width: 10%;
    color: #34404d;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
}

tbody td:nth-child(3) {
    width: 12%;
    color: #424b55;
    font-size: 0.7rem;
    text-align: center;
}

tbody td:nth-child(4),
tbody td:nth-child(5) {
    width: 22%;
    text-align: center;
}

.note-column,
.note-cell {
    width: 34px;
    min-width: 34px;
    text-align: center;
    white-space: nowrap;
}

.note-ref {
    display: inline-grid;
    width: 1.4em;
    height: 1.4em;
    place-items: center;
    border: 1px solid #9f3d4b;
    border-radius: 50%;
    color: #8f2435;
    background: #fff8f9;
    font-size: 0.7rem;
    font-weight: 900;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
}

.time {
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}

.footnotes {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #8795a5;
    border-left: 5px solid #6f8fb7;
    background: #ffffff;
    font-size: 0.78rem;
}

.footnotes h2 {
    margin: 0 0 7px;
    color: #2b405c;
    font-size: 0.88rem;
}

.footnotes ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 24px;
    margin: 0;
    padding-left: 2.1em;
}

.footnotes li {
    padding-left: 0.15em;
}

.footnotes li::marker {
    color: #8f2435;
    font-weight: 900;
}

.footnotes p {
    margin: 8px 0 0;
    color: #596779;
}

.empty {
    text-align: center;
    padding: 24px;
}

.notice-error {
    border-left: 6px solid #a63f3f;
}

.notice h2 {
    margin-top: 0;
}

footer {
    margin-top: 16px;
    padding: 14px 18px;
    font-size: 0.9rem;
    color: #4b596a;
}

footer p {
    margin: 4px 0;
}

code {
    word-break: break-all;
}

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

@media (prefers-reduced-motion: reduce) {
    .route-plane {
        animation: none;
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 1050px) {
    .directions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 16px, 1480px);
        margin-top: 8px;
    }

    .search-panel {
        grid-template-columns: 1fr;
    }

    .page-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timetable-sheet,
    .notice {
        padding: 10px;
    }

    .sheet-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        margin: -10px -10px 0;
    }

    .sheet-heading > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .route-header {
        grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    }

    .route-plane {
        --plane-start: -6px;
        --plane-end: 20px;
        font-size: 1.6rem;
    }

    table {
        min-width: 560px;
    }

    .footnotes ol {
        grid-template-columns: 1fr;
    }
}
