:root {
    --color-white: #ffffff;
    --color-black: #2d2d2d;

    /* 파스텔 팔레트 */
    --pastel-bg:       #f4f6fb;
    --pastel-card:     #ffffff;
    --pastel-blue:     #a8c4e0;
    --pastel-blue-dark:#6fa3cc;
    --pastel-mint:     #b8ddd4;
    --pastel-lavender: #c9c3e8;
    --pastel-peach:    #f5cfc4;
    --pastel-yellow:   #f5e6a3;
    --pastel-gray:     #e8ecf0;
    --pastel-text:     #1a1a2e;
    --pastel-text-sub: #555e6e;
    --pastel-border:   #dce4ee;
    --pastel-shadow:   rgba(100, 130, 170, 0.12);

    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;
}

/* ── 기본 ── */
::placeholder                { color: var(--pastel-text-sub); }
::-webkit-input-placeholder  { color: var(--pastel-text-sub); }
:-ms-input-placeholder       { color: var(--pastel-text-sub); }
::-ms-input-placeholder      { color: var(--pastel-text-sub); }

.mar-left-10 { margin-left: 10px; }

body {
    box-sizing: border-box;
    font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;        /* 가로 스크롤 제거 */
    min-height: 100vh;
    width: 100%;
    background-color: var(--pastel-bg);
    color: var(--pastel-text);
    overflow-y: auto;
}

/* ── 전체 보드 ── */
.display-board {
    background-color: var(--pastel-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    width: 100%;
    min-height: 100vh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;        /* 가로 스크롤 방지 */
    overflow-y: visible;
}

/* ── 헤더 ── */
.header {
    height: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    background: linear-gradient(135deg, #edf4fa 0%, #f2f0fb 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(100, 130, 200, 0.25), 0 2px 6px rgba(100, 130, 200, 0.15);
    border: 1px solid rgba(168, 196, 224, 0.5);
}

.header #dateNsettings {
    width: 17%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

#dateNsettings-inner {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

#download-docs { width: 100%; }

#download-docs a { text-decoration: none; }

#download-docs a span {
    padding: 6px 12px 6px 14px;
    color: #fff;
    background-color: var(--pastel-blue-dark);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

#settings-form { width: 100%; }

.header #date-time {
    font-size: 0.85rem;
    color: var(--pastel-text-sub);
    margin-bottom: 2%;
    margin-right: 2%;
    letter-spacing: 0.03em;
}

.header a {
    margin: 0 auto;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1a1a2e;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.header #logo {
    width: 75px !important;
    height: 58px !important;
    object-fit: contain;
}

.header #download-docs a {
    width: 100%;
    display: inline-block;
}

.header #logo {
    width: 200px;
    height: 30px;
    margin-left: 0;
    opacity: 0.9;
}

.header h1 {
    font-size: 1.9rem;
    margin: 0 0 1% 0;
    color: var(--pastel-text);
    font-weight: 700;
    letter-spacing: -0.02em;
}

#settings-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--pastel-text-sub);
    transition: color 0.2s;
}
#settings-btn:hover { color: var(--pastel-blue-dark); }

/* ── 공지 ── */
.notice {
    height: 10%;
    background-color: var(--pastel-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    box-sizing: border-box;
    border-radius: var(--radius-md);
    border: 1px solid var(--pastel-border);
    box-shadow: 0 2px 8px var(--pastel-shadow);
}

#notice-display { font-size: 2rem; }

/* ── 정류소명 헤더 바 ── */
.stopName {
    height: 6%;
    display: flex;
    background-color: var(--pastel-card);
    color: var(--pastel-text);
    padding: 6px 12px;
    margin-bottom: 4px;
    vertical-align: bottom;
    border-radius: var(--radius-sm);
}

.subTitle {
    display: flex;
    justify-content: space-between;
    padding-top: 1%;
}

.subTitle span {
    width: 25%;
    display: flex;
    justify-content: center;
    color: var(--pastel-text-sub);
    font-size: 0.85rem;
}

/* ── 타이틀 설정 ── */
#title-setting {
    width: 100%;
    display: flex;
    margin-bottom: 3%;
}

#title-input { display: flex; }

#board-title-input {
    width: 70%;
    height: 40px;
    margin-right: 1%;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--pastel-border);
    padding: 0 12px;
    font-size: 15px;
    color: var(--pastel-text);
    background: var(--pastel-card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
#board-title-input:focus {
    outline: none;
    border-color: var(--pastel-blue);
    box-shadow: 0 0 0 3px rgba(168, 196, 224, 0.3);
}

/* ── 정류소 컨테이너 ── */
.stops {
    margin: 0 8px 8px;
    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.stops .stop {
    box-sizing: border-box;
    overflow: visible;
}

.stop {
    box-sizing: border-box;
    flex: 1 1 100%;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background-color: var(--pastel-card);
    box-shadow: 0 4px 16px var(--pastel-shadow);
    overflow: visible;
}

.stop h2 {
    bottom: 0;
    margin: 0;
}

.stop .stopName {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;            /* 검은색 */
    background: linear-gradient(135deg, #eaf2fb 0%, #f0eefb 100%);
    border-bottom: 2px solid var(--pastel-border);
    padding: 0.75rem 1rem;
    border-radius: 0;
    letter-spacing: 0.01em;
}

.stop .bus-info {
    flex-grow: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
    height: 100%;
    background-color: var(--pastel-gray);
    padding: 4px;
}

.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) {
    flex-grow: 1;
    max-height: 8.5%;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--pastel-border);
    background-color: var(--pastel-card);
    transition: background-color 0.15s;
}
.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right):hover { background-color: #f7f9ff; }

.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) span {
    flex-grow: 25;
    display: flex;
    justify-content: flex-start;
    font-size: 0.92rem;
    color: #1a1a2e;
    font-weight: 500;
}

/* ── 버스 유형 헤더 (일반 / 직행좌석 등) ── */
.stop .bus-info h3 {
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 2px 0;
    padding: 5px 12px;
    font-size: 13px;           /* #1 1pt 크게 */
    font-weight: 700;
    color: #1a1a2e;
    background: linear-gradient(to right, #dce8f5, #e8e4f5);
    border-left: 3px solid var(--pastel-blue-dark);
    border-radius: 0;
    letter-spacing: 0.02em;
}


/* ── 4정류소 컨테이너 ── */
.stops.stops-container-4 {
    flex-grow: 1;
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 24px;
    background-color: transparent;
}

.stops-container-4 .stop .stopName {
    height: 7%;
    display: flex;
    font-weight: 600;
    padding: 0% 5%;
    border-bottom: 2px solid var(--pastel-border);
    background: linear-gradient(135deg, #eaf2fb 0%, #f0eefb 100%);
}

.stops-container-4 .stop .bus-info div {
    flex-grow: 1;
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 2px;
    background-color: var(--pastel-card);
}

.stops.stops-container-4 .stopsContChild {
    flex-grow: 1;
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 2px;
    background-color: var(--pastel-card);
}

/* ── 페이징 ── */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 6px;
}

.page-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--pastel-border);
    border-radius: 50px;
    cursor: pointer;
    background: var(--pastel-card);
    color: var(--pastel-text);
    font-size: 0.9rem;
    transition: all 0.2s;
}
.page-btn:hover { background: var(--pastel-gray); }

.page-btn.active {
    background-color: var(--pastel-blue-dark);
    border-color: var(--pastel-blue-dark);
    color: #fff;
    font-weight: 600;
}

/* ── 초기화면 모달 ── */
.modal-first {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(100, 120, 160, 0.35);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content-first {
    background-color: var(--pastel-card);
    padding: 28px 24px;
    border-radius: var(--radius-xl);
    width: 70%; height: 70%;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(100, 130, 170, 0.2);
    color: var(--pastel-text);
}

#comment {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 13% 7%;
    line-height: 1.8;
}

#check-dontShow {
    display: flex;
    justify-content: center;
}

#check-dontShow label {
    display: flex;
    justify-content: center;
    margin-right: 2%;
}

#check-dontShow label span { width: 100%; }

/* ── 공통 모달 ── */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(80, 100, 140, 0.38);
    padding-top: 60px;
    backdrop-filter: blur(3px);
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: var(--pastel-card);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--pastel-border);
    width: 80%;
    border-radius: var(--radius-xl);
    position: relative;
    box-shadow: 0 8px 32px rgba(100, 130, 170, 0.18);
}

.modal-content-station {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--pastel-card);
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid var(--pastel-border);
    width: 50%;
    border-radius: var(--radius-xl);
    box-shadow: 0 8px 32px rgba(100, 130, 170, 0.18);
}

#titleNclose {
    width: 98%;
    padding: 1%;
    background: linear-gradient(135deg, #eaf2fb 0%, #f0eefb 100%);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
#titleNclose h2 {
    text-align: center;
    margin: 0;
    color: var(--pastel-blue-dark);
    font-size: 1.1rem;
    font-weight: 700;
}

.close {
    color: var(--pastel-text-sub);
    float: right;
    font-size: 28px;
    font-weight: bold;
    margin-right: 2%;
    line-height: 1;
    transition: color 0.2s;
}
.close:hover, .close:focus {
    color: var(--pastel-text);
    text-decoration: none;
    cursor: pointer;
}

.stop-setting {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 0%;
}

.stop-setting label {
    margin-right: 3%;
    line-height: 0px;
    font-weight: 600;
    color: var(--pastel-text);
}

.close-map {
    font-size: 28px;
    position: absolute;
    top: 12px; right: 14px;
    color: var(--pastel-text-sub);
    transition: color 0.2s;
}
.close-map:hover { color: var(--pastel-text); cursor: pointer; }

#map_div { margin-top: 20px; }

#stop-settings {
    margin-top: 16px;
    padding: 0 2%;
    box-sizing: border-box;
    width: 100%;
}

/* ── 정류소 설정 카드 ── */
.stop-setting {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--pastel-border);
    box-shadow: 0 2px 8px var(--pastel-shadow);
    padding: 10px 14px;
}

.stop-setting label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pastel-blue-dark);
    white-space: nowrap;
    line-height: normal;
}

/* ── 검색 입력 ── */
.inputNsearchBtn {
    width: 100%;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
}

.inputNsearchBtn input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding-left: 14px;
    border-radius: var(--radius-md);
    background-color: var(--pastel-bg);
    font-size: 1rem;
    border: 1.5px solid var(--pastel-border);
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--pastel-text);
    box-sizing: border-box;
}

.inputNsearchBtn input:focus {
    outline: none;
    border-color: var(--pastel-blue);
    box-shadow: 0 0 0 3px rgba(168, 196, 224, 0.3);
    background-color: #fff;
}

#last {
    width: 70%;
    margin-top: 1%;
    display: flex;
    justify-content: space-between;
}

#resetNfull {
    width: 65%;
    display: flex;
    justify-content: flex-start;
}

/* ── 공통 버튼 스타일 ── */
#save-setting {
    display: flex;
    flex-direction: column;
}


#save-btn,
#save-iphone,
#reset-btn {
    padding: 12px 28px;
    font-size: 15px;
    cursor: pointer;
    width: 35%;
    border: none;
    color: #fff;
    border-radius: 50px;
    margin: 20px auto;
    transition: all 0.25s ease;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 14px rgba(111, 163, 204, 0.35);
    background: linear-gradient(135deg, var(--pastel-blue-dark) 0%, #8ab8d8 100%);
}

#save-btn:hover,
#save-iphone:hover,
#reset-btn:hover {
    background: linear-gradient(135deg, #5a90bb 0%, var(--pastel-blue-dark) 100%);
    box-shadow: 0 6px 18px rgba(111, 163, 204, 0.45);
    transform: translateY(-1px);
}

#save-exp,
#exp-iphone {
    font-size: 14px;
    border: 0;
    color: #c47a7a;
    border-radius: var(--radius-sm);
    margin-left: 10%;
    margin-top: 0%;
    background: #fff5f5;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.header #display-iphone {
    font-size: 14px;
    border: 0;
    color: var(--pastel-blue-dark);
    margin-right: 0%;
    margin-bottom: 0%;
}

/* ── 검색 결과 모달 ── */
.close-search {
    color: var(--pastel-text-sub);
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 32px;
    font-weight: bold;
    transition: color 0.2s;
}
.close-search:hover, .close-search:focus {
    color: var(--pastel-text);
    text-decoration: none;
    cursor: pointer;
}

#search-results {
    margin-top: 20px;
    min-width: 70%;
}

.search-result-item {
    display: flex;
    padding: 10px 12px;
    border: 1.5px solid var(--pastel-border);
    margin-top: 6px;
    border-radius: var(--radius-sm);
    justify-content: space-between;
    background: var(--pastel-card);
    transition: background 0.15s, box-shadow 0.15s;
}
.search-result-item > span { cursor: pointer; }
.search-result-item:hover {
    background-color: #f0f6ff;
    box-shadow: 0 2px 8px var(--pastel-shadow);
}

/* ── button-like ── */
.button-like {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    background-image: none;
    border: 1.5px solid var(--pastel-border);
    border-radius: var(--radius-sm);
    color: var(--pastel-text);
    background-color: var(--pastel-gray);
    transition: all 0.2s;
}
.button-like:hover {
    background-color: var(--pastel-blue);
    border-color: var(--pastel-blue);
    color: #fff;
}
.button-like:focus,
.button-like.focus,
.button-like:active,
.button-like.active {
    color: #fff;
    background-color: var(--pastel-blue-dark);
    border-color: var(--pastel-blue-dark);
}
.button-like:active,
.button-like.active { background-image: none; }

/* ── 검색 버튼 ── */
.searchButton {
    flex-shrink: 0;
    border: none;
    background: var(--pastel-blue-dark);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    margin-left: 4px;
}
.searchButton::after {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background-color: #fff;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.searchButton:hover {
    background: #5a90bb;
    transform: scale(1.05);
}

.searChBtnImg {
    display: none;
}

/* ── span 배치 (레거시 nth-child 규칙 — 새 bus-row 구조에선 무효화) ── */
.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) span:first-child  { flex-grow: 0; flex-basis: 9%; }
.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) span:nth-child(2) { flex-grow: 0; flex-basis: 12%; font-weight: 700; color: var(--pastel-blue-dark); }
.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) span:nth-child(3) { flex-grow: 0; flex-basis: 30%; }
.bus-info div:not(.bus-row):not(.bus-main-row):not(.bus-next-row):not(.bus-content):not(.bus-right) span:nth-child(4) { flex-grow: 0; flex-basis: 10%; }

/* ── 차량 아이콘 (정류소 1~2개) ── */
span.icon.green_double  {background: url(/images/media/i_bus-gen_gn_dup.svg)  no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.green_low     {background: url(/images/media/i_bus-low_gn.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.green_second  {background: url(/images/media/i_bus-dbl_gn.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.green_trolley {background: url(/images/media/i_bus-tro_gn.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.green_jeonse  {background: url(/images/media/i_bus-jeonse_gn.svg)    no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.green         {background: url(/images/media/i_bus-gen_gn.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.red_double    {background: url(/images/media/i_bus-gen_rd_dup.svg)   no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.red_low       {background: url(/images/media/i_bus-low_rd.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.red_second    {background: url(/images/media/i_bus-dbl_rd.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.red_trolley   {background: url(/images/media/i_bus-tro_rd.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.red_jeonse    {background: url(/images/media/i_bus-jeonse_rd.svg)     no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.red           {background: url(/images/media/i_bus-gen_rd.svg)         no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.sky_double    {background: url(/images/media/i_bus-gen_bl_dup.svg)   no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.sky_low       {background: url(/images/media/i_bus-low_bl.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.sky_second    {background: url(/images/media/i_bus-dbl_bl.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.sky_trolley   {background: url(/images/media/i_bus-tro_bl.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.sky_jeonse    {background: url(/images/media/i_bus-jeonse_bl.svg)     no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.sky           {background: url(/images/media/i_bus-gen_bl.svg)         no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.yellow_double  {background: url(/images/media/i_bus-gen_yl_dup.svg)  no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.yellow_low     {background: url(/images/media/i_bus-low_yl.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.yellow_second  {background: url(/images/media/i_bus-dbl_yl.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.yellow_trolley {background: url(/images/media/i_bus-tro_yl.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.yellow_jeonse  {background: url(/images/media/i_bus-jeonse_yl.svg)    no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.yellow         {background: url(/images/media/i_bus-gen_yl.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.purple_double  {background: url(/images/media/i_bus-gen_pp_dup.svg)  no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.purple_low     {background: url(/images/media/i_bus-low_pp.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.purple_second  {background: url(/images/media/i_bus-dbl_pp.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.purple_trolley {background: url(/images/media/i_bus-tro_pp.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.purple_jeonse  {background: url(/images/media/i_bus-jeonse_pp.svg)    no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.purple         {background: url(/images/media/i_bus-gen_pp.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.gray_double    {background: url(/images/media/i_bus-gen_gy_dup.svg)  no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.gray_low       {background: url(/images/media/i_bus-low_gy.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.gray_second    {background: url(/images/media/i_bus-dbl_gy.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.gray_trolley   {background: url(/images/media/i_bus-tro_gy.svg)       no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.gray_jeonse    {background: url(/images/media/i_bus-jeonse_gy.svg)    no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}
span.icon.gray           {background: url(/images/media/i_bus-gen_gy.svg)        no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

span.icon.navy           {background: url(/images/media/i_bus-gen_navy.svg)     no-repeat center; background-size: 35px auto; width: 35px; height: 115%;}

/* ── 차량 아이콘 (정류소 3~4개) ── */
.stops-container-3 .stop .bus-info span.icon.green_double,  .stops-container-4 .stop .bus-info span.icon.green_double  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.green_low,     .stops-container-4 .stop .bus-info span.icon.green_low     {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.green_second,  .stops-container-4 .stop .bus-info span.icon.green_second  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.green_trolley, .stops-container-4 .stop .bus-info span.icon.green_trolley {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.green_jeonse,  .stops-container-4 .stop .bus-info span.icon.green_jeonse  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.green,         .stops-container-4 .stop .bus-info span.icon.green         {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.red_double,    .stops-container-4 .stop .bus-info span.icon.red_double    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.red_low,       .stops-container-4 .stop .bus-info span.icon.red_low       {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.red_second,    .stops-container-4 .stop .bus-info span.icon.red_second    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.red_trolley,   .stops-container-4 .stop .bus-info span.icon.red_trolley   {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.red_jeonse,    .stops-container-4 .stop .bus-info span.icon.red_jeonse    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.red,           .stops-container-4 .stop .bus-info span.icon.red           {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.sky_double,    .stops-container-4 .stop .bus-info span.icon.sky_double    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.sky_low,       .stops-container-4 .stop .bus-info span.icon.sky_low       {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.sky_second,    .stops-container-4 .stop .bus-info span.icon.sky_second    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.sky_trolley,   .stops-container-4 .stop .bus-info span.icon.sky_trolley   {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.sky_jeonse,    .stops-container-4 .stop .bus-info span.icon.sky_jeonse    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.sky,           .stops-container-4 .stop .bus-info span.icon.sky           {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.yellow_double,  .stops-container-4 .stop .bus-info span.icon.yellow_double  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.yellow_low,     .stops-container-4 .stop .bus-info span.icon.yellow_low     {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.yellow_second,  .stops-container-4 .stop .bus-info span.icon.yellow_second  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.yellow_trolley, .stops-container-4 .stop .bus-info span.icon.yellow_trolley {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.yellow_jeonse,  .stops-container-4 .stop .bus-info span.icon.yellow_jeonse  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.yellow,         .stops-container-4 .stop .bus-info span.icon.yellow         {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.purple_double,  .stops-container-4 .stop .bus-info span.icon.purple_double  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.purple_low,     .stops-container-4 .stop .bus-info span.icon.purple_low     {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.purple_second,  .stops-container-4 .stop .bus-info span.icon.purple_second  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.purple_trolley, .stops-container-4 .stop .bus-info span.icon.purple_trolley {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.purple_jeonse,  .stops-container-4 .stop .bus-info span.icon.purple_jeonse  {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.purple,         .stops-container-4 .stop .bus-info span.icon.purple         {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.gray_double,    .stops-container-4 .stop .bus-info span.icon.gray_double    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.gray_low,       .stops-container-4 .stop .bus-info span.icon.gray_low       {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.gray_second,    .stops-container-4 .stop .bus-info span.icon.gray_second    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.gray_trolley,   .stops-container-4 .stop .bus-info span.icon.gray_trolley   {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.gray_jeonse,    .stops-container-4 .stop .bus-info span.icon.gray_jeonse    {width: 35px !important; height: 158% !important;}
.stops-container-3 .stop .bus-info span.icon.gray,           .stops-container-4 .stop .bus-info span.icon.gray           {width: 35px !important; height: 158% !important;}

.stops-container-3 .stop .bus-info span.icon.navy, .stops-container-4 .stop .bus-info span.icon.navy {width: 35px !important; height: 158% !important;}

/* ── 혼잡도 컬러 (하단 .seat-badge 알약 스타일로 통합) ── */

/* ── 설정화면 ── */
.input-with-history {
    display: flex;
    width: 80%;
}
#title-setting label {
    margin-right: 10px;
    width: 145px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--pastel-text);
}
#history-title { width: 100%; }

input[type="checkbox"] {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--pastel-blue);
    border-radius: 4px;
    position: relative;
    accent-color: var(--pastel-blue-dark);
}

/* ── 지도 버튼 ── */
.map-button {
    background: var(--pastel-gray);
    border: 1.5px solid var(--pastel-border);
    box-shadow: none;
    border-radius: var(--radius-sm);
    padding: 0.3rem;
    overflow: visible;
    cursor: pointer;
    margin-left: 2%;
    min-width: 60px;
    max-width: 60px;
    box-sizing: border-box;
    height: 30px;
    font-size: 12px;
    color: var(--pastel-text);
    transition: all 0.2s;
}
.map-button:hover,
.map-button:focus {
    background: var(--pastel-blue);
    border-color: var(--pastel-blue);
    color: #fff;
    cursor: pointer;
}

/* ── 폰트 크기 설정 ── */
#font-size-settings {
    display: flex;
    background-color: var(--pastel-gray);
    margin-top: 2%;
    padding: 0 2% 2%;
    border-radius: var(--radius-md);
    border: 1px solid var(--pastel-border);
}
#font-size-settings-left {
    width: 40%;
    margin-right: 1%;
}
#font-size-settings-right {
    padding-top: 2rem;
    color: var(--pastel-text-sub);
    font-size: 0.9rem;
}
.font-size-setting { margin-top: 1rem; }

/* ════════════════════════════════════
   버스 행 CSS 클래스 (JS 인라인 대체)
════════════════════════════════════ */
/* ══════════════════════════════════
   버스 카드 레이아웃
══════════════════════════════════ */

/* ────────────────────────────────────
   버스 카드 구조:
   [bus-row]
     [bus-icon]  [bus-content]
                   [route-info-span] | [bus-right]
                                          [bus-main-row]
                                            [arrival-info] [seat-badge]
                                          [bus-next-row]
──────────────────────────────────── */

/* 카드 전체 */
.bus-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: var(--pastel-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--pastel-border);
    overflow: hidden;
}

/* 버스 아이콘 — #3 크기 고정 (가로/세로 전환시 변하지 않도록) */
.bus-icon {
    flex-shrink: 0;
    flex-grow: 0;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    margin-right: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    overflow: hidden;          /* 아이콘 클리핑 방지 */
}
/* SVG 아이콘 높이를 고정값으로 덮어씀 */
.bus-icon.icon {
    overflow: hidden;
    height: 36px !important;
}
span.icon { height: 36px !important; }

/* [아이콘 오른쪽] 노선번호 + 정보 영역 */
.bus-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;        /* 노선번호 | 정보 수평 배치 */
    align-items: stretch;       /* 세로선이 카드 전체 높이로 */
}

/* 노선번호 열: 세로선 오른쪽, 카드 전체 높이 */
/* #2 노선명 옆 여백 5칸: padding-right 넓게 */
.route-info-span {
    flex: 0 0 50px;
    min-width: 50px;            /* flex 무력화 방지 */
    white-space: nowrap;        /* 줄바꿈 금지 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    color: #1a1a2e;
    text-align: center;
    padding-right: 14px;       /* 여백 5칸 */
    border-right: 1px solid var(--pastel-border);
    margin-right: 12px;
}
.route-sub {
    font-size: 10px;
    font-weight: 400;
    color: var(--pastel-text-sub);
}

/* 도착정보 + 다음버스 세로 묶음 */
.bus-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 1줄: 도착정보 | 혼잡도 */
.bus-main-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

/* 도착 정보 */
.arrival-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
}

/* "xxx 방면" */
.dest-info {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 혼잡도: 도착정보 바로 옆, 테두리 알약 */
.seat-badge {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700 !important;
    white-space: nowrap;
    margin-left: 8px;
    align-self: center;
    padding: 2px 8px;
    border-radius: 99px;
    border: 1.5px solid currentColor;
    background: transparent;
    text-align: center;
    line-height: 1.4;
}

/* 혼잡도 알약 텍스트+테두리 색상 */
.seat-density-0 { color: #190ea8 !important; }
.seat-density-1 { color: #1e7a28 !important; }
.seat-density-2 { color: #0055cc !important; }
.seat-density-3 { color: #cc6600 !important; }
.seat-density-4 { color: #cc0000 !important; }

/* 2줄: 다음 버스 */
.bus-next-row {
    margin-top: 5px;
    padding-top: 4px;
    padding-left: 0;
    border-top: 1px dashed #c8d6e8;
    font-size: 12px;
    font-weight: 400;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 정류소명 길이별 폰트 */
.stopName-short { font-size: clamp(16px, 3.5vw, 30px); }
.stopName-long  { font-size: clamp(13px, 2.2vw, 18px); }

/* ════════════════════════════════════
   반응형 미디어 쿼리
════════════════════════════════════ */

/* ── 모바일 세로 (~ 480px) ── */
@media (max-width: 480px) {
    .display-board { padding: 10px; }

    .header { height: auto; padding: 10px 0; margin-bottom: 8px; }
    .header a { font-size: 1.1rem; gap: 8px; }
    .header #logo { width: 50px !important; height: 40px !important; }

    #stop-settings { padding: 0 1%; margin-top: 10px; }
    .stop-setting { padding: 8px 10px; margin-bottom: 8px; }
    .stop-setting label { font-size: 0.88rem; }
    .inputNsearchBtn input { height: 40px; font-size: 0.95rem; }
    .searchButton { width: 40px; height: 40px; }

    #save-btn, #save-iphone { width: 70%; font-size: 15px; }
    #reset-btn { width: 55%; }

    /* 버스 정보 - 세로 모드에서 컬럼 축소 */
    .bus-info div span:first-child  { flex-basis: 8%; }
    .bus-info div span:nth-child(2) { flex-basis: 14%; font-size: 0.85rem; }
    .bus-info div span:nth-child(3) { flex-basis: 35%; font-size: 0.82rem; }
    .bus-info div span:nth-child(4) { flex-basis: 12%; font-size: 0.82rem; }

    .bus-icon { width: 28px; height: 36px; font-size: 28px; }
    span.icon { background-size: 28px auto !important; width: 28px !important; }

    .stops { margin: 2%; gap: 10px; flex-direction: column; }
    .stop .stopName { padding: 8px 10px; }
    .stopName-short { font-size: clamp(14px, 5vw, 22px); }
    .stopName-long  { font-size: clamp(12px, 3.5vw, 16px); }
}

/* ── 모바일 가로 / 소형 태블릿 (481px ~ 768px) ── */
@media (min-width: 481px) and (max-width: 768px) {
    .display-board { padding: 12px 16px; }

    .header a { font-size: 1.3rem; }
    .header #logo { width: 60px !important; height: 48px !important; }

    .stop-setting label { font-size: 0.95rem; }
    .inputNsearchBtn input { height: 42px; }

    #save-btn, #save-iphone { width: 55%; }

    .bus-info div span:nth-child(3) { flex-basis: 32%; font-size: 0.88rem; }
    .bus-info div span:nth-child(4) { flex-basis: 11%; }

    .stops { margin: 2%; gap: 14px; }
}

/* ── 태블릿 (769px ~ 1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {
    .display-board { padding: 16px 24px; }

    .header a { font-size: 1.4rem; }

    #save-btn, #save-iphone { width: 45%; }

    .bus-info div span:nth-child(2) { flex-basis: 11%; }
    .bus-info div span:nth-child(3) { flex-basis: 28%; }
}

/* ── PC (1025px ~) ── */
@media (min-width: 1025px) {
    .display-board { padding: 20px 32px; max-width: 1400px; margin: 0 auto; }

    .header a { font-size: 1.6rem; }
    .header #logo { width: 80px !important; height: 62px !important; }

    #save-btn, #save-iphone { width: 35%; }
    #stop-settings { padding: 0 5%; }

    .bus-info div span:nth-child(2) { flex-basis: 10%; }
    .bus-info div span:nth-child(3) { flex-basis: 28%; }
    .bus-info div span:nth-child(4) { flex-basis: 9%; }

    .stops { margin: 1.5% 2%; gap: 24px; }
}

@media (orientation: landscape) {
    .seat-badge { font-size: 15px; }
    .stop .stopName { font-size: 1.25rem; }
    .stop .bus-info h3 { font-size: 17px; }
    .route-info-span { font-size: 15px; }

    /* 다음버스 정보를 첫번째 도착정보 옆으로 정렬 */
    .bus-right {
        flex-direction: row !important;
        justify-content: flex-start;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 0;
    }
    .bus-main-row {
        /* flex: 0 0 auto !important;
        width: auto !important; */
        flex: 0 0 250px !important;
        width: 250px !important;
        min-width: 250px !important;
    }
    .bus-next-row {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        border-left: 1px dashed #c8d6e8;
        margin-left: 12px;
        padding-left: 12px;
        padding-top: 0;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 14px;
        align-self: center;
    }
}

/* ── Route Filter ── */
.route-filter-checkbox {
    width: 18px;
    height: 18px;
    margin: 0 6px 0 2px;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    accent-color: #00478f;
}
.filter-btn-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 4px;
}
.filter-save-btn {
    padding: 5px 20px;
    font-size: 15px !important;
    background: linear-gradient(135deg, var(--pastel-blue-dark) 0%, #8ab8d8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 4px 14px rgba(111, 163, 204, 0.35);
    transition: all 0.25s ease;
}
.filter-save-btn:hover {
    background: linear-gradient(135deg, #5a90bb 0%, var(--pastel-blue-dark) 100%);
    box-shadow: 0 6px 18px rgba(111, 163, 204, 0.45);
    transform: translateY(-1px);
}
#route-filter-reset-btn {
    padding: 5px 20px;
    font-size: 15px !important;
    background: var(--pastel-gray);
    color: var(--pastel-text-sub);
    border: 1px solid var(--pastel-border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 8px var(--pastel-shadow);
    transition: all 0.25s ease;
}
#route-filter-reset-btn:hover {
    background: #d8dfe8;
    box-shadow: 0 4px 12px var(--pastel-shadow);
    transform: translateY(-1px);
}
.bus-row-hidden {
    display: none !important;
}
