
        :root { 
            --m-red: #800000; --kitaq-maroon: #663300; 
            --bg: #f8f9fa; --kitaq-ivory: #f2ebd9; }
        * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
        body { font-family: "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: #333; transition: background 0.3s; }
        body.kitaq-bg { background: var(--kitaq-ivory) !important; }
        body.line-hkkob { background: var(--line-hkkob-bg); }
        body.line-hkta { background: var(--line-hkta-bg); }
        body.line-hk-kyo { background: var(--line-hk-kyo-bg); }
        body.line-hk-ara { background: var(--line-hk-ara-bg); }
        :root {
            --line-hkkob: rgba(25, 77, 164, 0.85);
            --line-hkta: rgba(217, 115, 29, 0.85);
            --line-hk-kyo: rgba(60, 120, 70, 0.85);
             --line-hk-ara: rgba(79, 64, 45, 0.85);
            --line-hkkob-bg: rgba(25, 77, 164, 0.08);
            --line-hkta-bg: rgba(217, 115, 29, 0.08);
            --line-hk-kyo-bg: rgba(60, 120, 70, 0.08);
            --line-hk-ara-bg: rgba(113, 55, 32, 0.18);
        }

        header { 
            display: flex; justify-content: space-between; align-items: center; 
            padding: 8px 15px; background: #fff; position: sticky; top: 0; z-index: 100; 
            box-shadow: 0 2px 10px rgba(0,0,0,0.1); border-bottom: 5px solid var(--m-red);
            min-height: 60px; transition: 0.3s;
        }
        header.line-hkkob { border-bottom-color: var(--line-hkkob); background: rgba(25, 77, 164, 0.18); }
        header.line-hkta { border-bottom-color: var(--line-hkta); background: rgba(217, 115, 29, 0.18); }
        header.line-hk-kyo { border-bottom-color: var(--line-hk-kyo); background: rgba(60, 120, 70, 0.18); }
        header.line-hk-ara { border-bottom-color: var(--line-hk-ara); background: rgba(113, 55, 32, 0.18); }
        header.kitaq-style { background: var(--kitaq-ivory) !important; border-bottom: none !important; padding-bottom: 20px; }
        header.kitaq-style::after {
            content: ""; position: absolute; bottom: 0; left: 0; width: 100%; height: 14px;
            background: linear-gradient(to bottom, var(--m-red) 50%, var(--kitaq-maroon) 50%);
        }

        .select-area { display: flex; align-items: center; gap: 8px; flex: 1; }
        .h-logo {
            width: 32px; height: 32px; background: var(--m-red); border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: #fff; font-weight: 900; font-size: 20px; flex-shrink: 0;
        }
        select { font-size: 16px; font-weight: 900; border: 2px solid #ddd; border-radius: 8px; padding: 6px 10px; background: #fff; width: 100%; max-width: 160px; outline: none; }
        
        .datetime-container { display: flex; flex-direction: column; align-items: flex-end; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
        #date { font-size: 12px; margin-bottom: 2px; }
        #clock { font-size: 20px; min-width: 85px; text-align: right; }

        .main-container { display: flex; flex-direction: column; width: 100%; max-width: 1100px; margin: 0 auto; padding: 15px; position: relative; }
        .side { flex: 1; background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.05); display: flex; flex-direction: column; }

        
        @media (min-width: 768px) {
            .main-container { flex-direction: row; gap: 0; }
            .side { border-radius: 0; box-shadow: none; }
            .main-container.has-both::before {
                content: ""; position: absolute; left: 50%; top: 20px; bottom: 20px; width: 4px; background-color: var(--m-red); transform: translateX(-50%); z-index: 5;
            }
            #panel-up { padding-right: 40px; }
            #panel-down { padding-left: 40px; }
        }

        .dir-label { font-size: 12px; font-weight: bold; color: #888; text-align: center; margin-bottom: 8px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
        .main-time { font-size: 60px; font-weight: 900; color: #111; text-align: center; line-height: 1.1; letter-spacing: -2px; }
        .main-dest { font-size: 32px; font-weight: 900; color: var(--m-red); text-align: center; margin-bottom: 10px; }
        
        .owner-container { display: flex; align-items: center; justify-content: center; min-height: 36px; margin-bottom: 15px; }
        .owner-badge-kitakyu {
            background: #e51718; color: #fff; padding: 5px 12px; border-radius: 4px; 
            font-size: 16px; font-weight: 900; display: flex; align-items: center; line-height: 1.2;
        }
        .owner-badge-kitakyu img { height: 1.3em; margin-right: 6px; }

        .owner-text-metro {
            background: linear-gradient(135deg, #fff 0%, #e0e0e0 45%, #bdbdbd 55%, #f5f5f5 100%);
            color: #000; padding: 5px 12px; border-radius: 4px; font-size: 16px; font-weight: 900;
            display: flex; align-items: center; line-height: 1.2; border: 1px solid #a0a0a0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .next-info { background: #f1f3f5; padding: 10px; border-radius: 10px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; font-size: 15px; margin-bottom: 15px; }
        .next-dest-box { display: flex; align-items: center; gap: 8px; }
        .next-badge-kitakyu { background: #e51718; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; display: inline-flex; align-items: center; }
        .next-badge-kitakyu img { height: 1.1em; margin-right: 3px; }
        .next-text-metro { background: #cccccc; color: #000; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 900; }
        
        .eta-list { display: flex; flex-direction: column; gap: 8px; }
        .eta-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f8f9fa; border-radius: 8px; font-weight: 800; font-size: 14px; }
        .eta-val { color: var(--m-red); font-size: 16px; }

        @media (max-width: 767px) {
            #panel-up { border-bottom: 5px solid var(--m-red); padding-bottom: 30px; margin-bottom: 30px; border-radius: 0; }
        }

        /* 到着予想の見出しボックス */
.eta-header-box {
    background: #f1f3f5; /* next-infoと同じ薄いグレー */
    padding: 5px 15px;
    border-radius: 5px;
    font-weight: 900;
    font-size: 15px;
    margin-bottom: 8px; /* リストとの隙間 */
    color: #333;
    display: flex;
    align-items: center;
}



/* 枠内：リストの間隔調整 */
.eta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* リスト一行の背景を少し薄くして赤枠を目立たせる */
.eta-row {
    background: #fdfdfd; 
    border: 1px solid #f0f0f0;
}

/* 同時発車対応のためのCSS拡張（完全版） */

/* 到着予想を横並びするコンテナ */
.eta-list-parallel {
    display: flex;
    gap: 10px;
    width: 100%;
}

/* 左右の到着予想を半分ずつ */
.eta-list-parallel .eta-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-train-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    margin-bottom: 15px;
    width: 100%;
    position: relative;
}

.top-train-row {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 10px 15px;
    box-sizing: border-box;
    min-width: 0;
}

/* 2個目以降の列車の左側に、縦線を引く */
.top-train-container .top-train-row:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 20px;
    bottom: 20px;
    width: 1px;
    background-color: #ddd;
    transform: translateX(-50%);
}

/* 左右に並んだ時も、1個の時と同じフォントサイズを保つ */
.top-train-row .main-time {
    font-size: 60px !important;
    font-weight: 900;
    color: #111;
    text-align: center;
    line-height: 1.1;
    letter-spacing: -2px;
}

.top-train-row .main-dest {
    font-size: 32px !important;
    font-weight: 900;
    color: var(--m-red);
    text-align: center;
    margin-bottom: 10px !important;
    margin-top: 0;
}

.top-train-row .owner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    margin-bottom: 15px;
    width: 100%;
}
