/* 공통 */
.jg-main {
    max-width: 1200px;
    margin: 20px auto 50px;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        "Noto Sans KR", Arial, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.jg-main,
.jg-main * {
    box-sizing: border-box;
}

.jg-main button,
.jg-main input {
    font: inherit;
}

.jg-main button {
    cursor: pointer;
}

.jg-main button:disabled {
    cursor: not-allowed;
}

.jg-main button:focus-visible,
.jg-main input:focus-visible,
.jg-main a:focus-visible {
    outline: 3px solid #d97706;
    outline-offset: 3px;
}

.jg-main h1,
.jg-main h2,
.jg-main h3,
.jg-main p {
    word-break: keep-all;
    overflow-wrap: anywhere;
}

/* 소개 */
.jg-hero {
    padding: 24px;
    margin-bottom: 24px;
    color: #ffffff;
    background: linear-gradient(135deg, #003366, #001f3f);
    border-radius: 18px;
}

.jg-hero h1 {
    margin: 0 0 8px;
    font-size: 27px;
    line-height: 1.4;
}

.jg-hero p {
    margin: 0;
    color: #cbdff5;
    font-size: 16px;
}

/* 섹션 제목 */
.jg-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px 0 16px;
}

.jg-section-heading h2 {
    margin: 0;
    padding-left: 12px;
    border-left: 5px solid #003366;
    color: #003366;
    font-size: 24px;
    line-height: 1.5;
}

.jg-section-heading a {
    color: #0055aa;
    font-size: 16px;
    text-decoration: underline;
}

/* 동별 무장애 길안내 + 지도 통합 섹션 */
.jg-dong-box {
    margin-bottom: 28px;
    padding: 22px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
}

.jg-dong-box .jg-section-heading {
    margin-top: 0;
}

.jg-dong-badge {
    display: inline-block;
    padding: 5px 12px;
    color: #003366;
    background: #e0f2fe;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
}

/* 제1지역 / 제2지역 상단 탭 */
.jg-region-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 10px;
}

.jg-region-btn {
    min-height: 46px;
    padding: 9px 18px;
    border: 2px solid #003366;
    border-radius: 10px;
    background: #f8fafc;
    color: #003366;
    font-size: 17px;
    font-weight: 800;
}

.jg-region-btn:hover {
    background: #e0f2fe;
}

.jg-region-btn[aria-pressed="true"] {
    background: #003366;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.25);
}

.jg-dong-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 18px;
}

.jg-dong-btn {
    min-height: 44px;
    padding: 8px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #1e293b;
    font-size: 16px;
    font-weight: 700;
}

.jg-dong-btn:hover {
    border-color: #0055aa;
    background: #f0f6fc;
}

.jg-dong-btn[aria-pressed="true"] {
    border-color: #003366;
    background: #003366;
    color: #ffffff;
}

.jg-dong-summary {
    padding: 14px 16px;
    margin-bottom: 18px;
    background: #f8fafc;
    border-left: 4px solid #0055aa;
    border-radius: 8px;
    font-size: 16px;
    color: #1e293b;
}

/* 좌측 지도 + 우측 목록 배치 */
.jg-bf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(310px, 1fr);
    gap: 18px;
    align-items: start;
}

.jg-bf-map-wrap {
    min-width: 0;
}

.jg-bf-map {
    width: 100%;
    height: 460px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

/* 지도 위 라벨 표시 (버스정류장·화장실·맛집) */
.jg-bf-station-label {
    min-height: 40px;
    padding: 6px 11px;
    border: 2px solid #ffffff;
    border-radius: 7px;
    background: #003366;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-size: 14px !important;
    font-weight: 700;
    white-space: nowrap;
}

.jg-bf-station-label.is-bus {
    background: #1d4ed8;
}

.jg-bf-station-label.is-toilet {
    background: #0f766e;
}

.jg-bf-station-label[aria-pressed="true"],
.jg-bf-station-label.is-selected {
    background: #0055aa;
    box-shadow: 0 0 0 3px #fbbf24;
    z-index: 6;
}

.jg-bf-list-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    max-height: 460px;
    overflow-y: auto;
}

.jg-spot-stack {
    display: grid;
    gap: 14px;
}

.jg-spot-group-title {
    margin: 0 0 8px;
    color: #003366;
    font-size: 17px;
    font-weight: 800;
}

.jg-spot-list {
    display: grid;
    gap: 8px;
}

.jg-spot-item-btn {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: left;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
}

.jg-spot-item-btn:hover {
    border-color: #0055aa;
    background: #f0f6fc;
}

.jg-spot-item-btn.is-active {
    border-color: #0055aa;
    background: #eaf3fd;
}

.jg-spot-name {
    display: block;
    margin: 0 0 4px;
    color: #003366;
    font-size: 16px;
    font-weight: 800;
}

.jg-spot-meta {
    display: block;
    margin: 0 0 6px;
    color: #334155;
    font-size: 14px;
}

.jg-spot-access {
    display: inline-block;
    padding: 3px 8px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.jg-spot-actions {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.jg-spot-item-btn.is-active .jg-spot-actions {
    display: flex;
}

.jg-navi-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 7px;
    background: #0055aa;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.jg-navi-btn:hover {
    background: #003366;
}

.jg-show-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid #003366;
    border-radius: 8px;
    background: #ffffff;
    color: #003366;
    font-size: 14px;
    font-weight: 700;
}

.jg-show-all-btn:hover {
    background: #edf4fb;
}

/* 버스 안내 전체 */
.jg-bus {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
}

.jg-bus .jg-section-heading {
    margin-top: 0;
}

.jg-status {
    display: inline-block;
    padding: 5px 10px;
    color: #15803d;
    background: #dcfce7;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
}

.jg-bus-intro {
    margin: 0 0 16px;
    color: #334155;
    font-size: 18px;
}

/* 검색 */
.jg-search-label {
    display: block;
    margin-bottom: 8px;
    color: #003366;
    font-size: 18px;
    font-weight: 700;
}

.jg-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.jg-search-row input {
    flex: 1 1 260px;
    min-width: 0;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid #64748b;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    font-size: 18px;
}

.jg-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid #003366;
    border-radius: 8px;
    background: #ffffff;
    color: #003366;
    font-weight: 700;
    font-size: 17px;
    text-decoration: none;
}

.jg-button-primary {
    background: #003366;
    color: #ffffff;
}

.jg-button:hover {
    background: #edf4fb;
}

.jg-button-primary:hover {
    background: #002244;
}

/* 지도·목록·상세 배치 */
.jg-bus-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr);
    grid-template-areas:
        "map list"
        "map detail";
    gap: 16px;
    align-items: start;
}

.jg-map-panel {
    grid-area: map;
    min-width: 0;
}

.jg-list-panel {
    grid-area: list;
    min-width: 0;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.jg-detail-panel {
    grid-area: detail;
    min-width: 0;
    padding: 18px;
    border: 2px solid #003366;
    border-radius: 12px;
    background: #ffffff;
}

.jg-panel-heading {
    margin: 0 0 12px;
    color: #003366;
    font-size: 20px;
    line-height: 1.5;
}

/* 지도 */
.jg-map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.jg-map-toolbar .jg-panel-heading {
    margin: 0;
}

.jg-map {
    width: 100%;
    height: 520px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.jg-map-message {
    padding: 110px 20px 20px;
    color: #475569;
    text-align: center;
    font-size: 17px;
    line-height: 1.8;
}

.jg-map-message.is-error {
    color: #b91c1c;
}

.jg-map-label {
    min-height: 44px;
    padding: 8px 12px;
    border: 2px solid #ffffff;
    border-radius: 7px;
    background: #003366;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    font-size: 15px !important;
    font-weight: 700;
    white-space: nowrap;
}

.jg-map-label[aria-pressed="true"] {
    background: #0055aa;
    box-shadow: 0 0 0 3px #fbbf24;
}

/* 같은 페이지에서 지도 확대 */
.jg-bus.is-map-large .jg-bus-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "map map"
        "list detail";
}

.jg-bus.is-map-large .jg-map {
    height: 65vh;
    min-height: 360px;
    max-height: 760px;
}

/* 정류장 목록 */
.jg-result-count {
    margin: 0 0 10px;
    color: #475569;
    font-size: 16px;
}

.jg-stop-list {
    display: grid;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}

.jg-stop-button {
    display: block;
    width: 100%;
    min-height: 58px;
    padding: 12px;
    text-align: left;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
}

.jg-stop-button:hover {
    background: #f0f6fc;
}

.jg-stop-button[aria-pressed="true"] {
    border-color: #0055aa;
    background: #eaf3fd;
}

.jg-stop-button strong {
    display: block;
    font-size: 18px;
    line-height: 1.5;
}

.jg-stop-button small {
    display: block;
    margin-top: 5px;
    color: #475569;
    font-size: 14px;
}

/* 선택한 정류장 */
.jg-selected-name {
    margin: 0 0 10px;
    color: #003366;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.5;
}

.jg-detail-text {
    margin: 0 0 14px;
    color: #334155;
    font-size: 17px;
    line-height: 1.8;
}

.jg-arrival-notice {
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.jg-arrival-notice strong {
    display: block;
    margin-bottom: 8px;
    color: #003366;
    font-size: 18px;
}

.jg-arrival-notice p {
    margin: 0;
    color: #475569;
    font-size: 16px;
    line-height: 1.8;
}

/* 생활정보 및 스팟 그리드 */
.jg-life-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.jg-life-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 110px;
    padding: 16px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #1e293b;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
}

.jg-life-link:hover {
    border-color: #003366;
    background: #f0f6fc;
}

.jg-life-icon {
    font-size: 26px;
}

.jg-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.jg-news-card {
    min-width: 0;
    padding: 20px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.jg-news-card h3 {
    margin: 0 0 12px;
    color: #003366;
    font-size: 18px;
}

@media (max-width: 900px) {
    .jg-bf-layout { grid-template-columns: minmax(0, 1fr); }
    .jg-bf-list-panel { max-height: none; overflow-y: visible; }
}

@media (max-width: 768px) {
    .jg-main { padding: 0 12px; }
    .jg-hero { padding: 20px; }
    .jg-hero h1 { font-size: 24px; }
    .jg-dong-box, .jg-bus { padding: 16px; }
    .jg-section-heading h2 { font-size: 22px; }
    .jg-bf-map { height: 340px; }
    .jg-bus-layout,
    .jg-bus.is-map-large .jg-bus-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "list" "map" "detail";
    }
    .jg-map { height: 360px; }
    .jg-life-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .jg-news-grid { grid-template-columns: minmax(0, 1fr); }
}