* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f6f8;
    color: #17212b;
    font: 15px/1.5 system-ui, sans-serif;
}

header {
    display: flex;
    gap: 20px;
    padding: 14px 5%;
    background: #083b66;
    align-items: center;
    min-height: 49px;
    box-sizing: border-box;
}

header a {
    color: white;
    text-decoration: none;
    font-weight: 650;
}

header a:hover,
header a:focus {
    text-decoration: underline;
}

main {
    max-width: 1180px;
    margin: 28px auto;
    padding: 0 20px;
}

h1 {
    font-size: 30px;
}

.filters,
.card,
.report-section,
.report-head {
    background: white;
    border: 1px solid #d9e1e7;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.filters label {
    display: grid;
    gap: 6px;
    font-weight: 650;
}

.filters select,
.filters input,
.filters button {
    padding: 10px;
    border: 1px solid #aebbc5;
    border-radius: 6px;
    background: white;
}

.filters button {
    background: #0b609e;
    color: white;
    border: 0;
    font-weight: 700;
}

.timeline {
    border-left: 3px solid #0b609e;
    margin-left: 12px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 190px 180px 1fr;
    gap: 12px;
    margin: 0 0 16px 18px;
    padding: 15px;
    background: #f8fafb;
    border: 1px solid #d9e1e7;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.timeline-item:before {
    content: '';
    width: 13px;
    height: 13px;
    background: #0b609e;
    border-radius: 50%;
    position: absolute;
    margin-left: -26px;
    margin-top: 5px;
}

.report-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    border-top: 6px solid #0b609e;
}

.report-head small {
    display: block;
    text-align: right;
}

.eyebrow {
    color: #0b609e;
    font-weight: 800;
    letter-spacing: .12em;
}


/*
 * Report data grid
 *
 * - 外枠は表示しない
 * - 項目間だけ #d9e1e7 の 1px 罫線を表示
 * - 次の行が存在する場合は前行の全列に横罫線を表示
 * - 最終行の空き領域は白
 */

.grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    background: white;
}

.field {
    background: white;
    padding: 12px;
}

/* 縦方向の内部罫線 */
.grid > .field:not(:nth-child(5n)) {
    border-right: 1px solid #d9e1e7;
}

/*
 * 6項目以上ある場合は2行目が存在する。
 * その場合、1行目の5列すべての下に横罫線を表示。
 */
.grid:has(> .field:nth-child(6)) > .field:nth-child(-n+5) {
    border-bottom: 1px solid #d9e1e7;
}

/*
 * 11項目以上ある場合は3行目が存在する。
 * その場合、2行目の5列すべての下に横罫線を表示。
 */
.grid:has(> .field:nth-child(11)) > .field:nth-child(n+6):nth-child(-n+10) {
    border-bottom: 1px solid #d9e1e7;
}

/*
 * 16項目以上ある場合は4行目が存在する。
 * その場合、3行目の5列すべての下に横罫線を表示。
 */
.grid:has(> .field:nth-child(16)) > .field:nth-child(n+11):nth-child(-n+15) {
    border-bottom: 1px solid #d9e1e7;
}

.field dt {
    color: #5b6873;
    font-size: 12px;
    text-transform: uppercase;
}

.field dd {
    margin: 4px 0 0;
    font-weight: 650;
}


.event-list > div {
    display: grid;
    grid-template-columns: 160px 210px 1fr;
    padding: 10px;
    border-bottom: 1px solid #e1e7eb;
}

.notice {
    padding: 15px;
    background: #edf4f8;
}

.error {
    background: #fff0f0;
    color: #9b1c1c;
}

.report-voyage {
    font-size: 17px;
    font-weight: 650;
    margin: .35rem 0 0;
}

.report-dates {
    text-align: right;
}

.report-dates strong {
    display: block;
    font-size: 17px;
}

.report-dates small {
    font-size: 12px;
    color: #5b6873;
}

.simple-list > div {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 15px;
    padding: 10px;
    border-bottom: 1px solid #e1e7eb;
}

.stoppage-list > div {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr .7fr;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #e1e7eb;
}


/*
 * Tablet
 * Report gridを2列にする。
 */
@media (max-width: 1100px) {

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

    /* Desktop用の罫線をリセット */
    .grid > .field {
        border-right: 0;
        border-top: 0;
    }

    /* 左列だけ縦罫線 */
    .grid > .field:nth-child(odd) {
        border-right: 1px solid #d9e1e7;
    }

    /* 2行目以降だけ横罫線 */
    .grid > .field:nth-child(n+3) {
        border-top: 1px solid #d9e1e7;
    }
}


/*
 * Report page responsive layout
 */
@media (max-width: 700px) {

    .timeline-item,
    .event-list > div {
        grid-template-columns: 1fr;
    }

    .report-head {
        display: block;
    }

    .report-head small {
        text-align: left;
    }

    .report-dates {
        text-align: left;
        margin-top: 12px;
    }

    .simple-list > div,
    .stoppage-list > div {
        grid-template-columns: 1fr;
    }
}


/*
 * Smartphone
 * Report gridを1列にする。
 */
@media (max-width: 440px) {

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

    .grid > .field {
        border-right: 0;
        border-top: 0;
    }

    /* 2項目目以降だけ横罫線 */
    .grid > .field:nth-child(n+2) {
        border-top: 1px solid #d9e1e7;
    }
}


@media (max-width: 520px) {

    header {
        gap: 14px;
        padding: 12px 16px;
        flex-wrap: wrap;
    }
}