:root {
    --bg: #f8fafc;
    --panel: #ffffff;
    --accent: #2e7df6;
    --accent-soft: #e6f0ff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    --radius: 18px;
    --font: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

.app-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    max-width: 1390px;   /* ← 이 값으로 좌우 퍼짐 정도 조절 */
    margin: 0 auto;      /* ← 가운데 정렬 */
    border-radius: 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
}

.brand-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.status-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.status-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: #0b2c6f;
    background: var(--accent-soft);
    border: 1px solid rgba(46, 125, 246, 0.2);
}

.status-pill.live {
    color: #0f5132;
    background: #e9f8f0;
    border-color: #b5e4c6;
}

.status-pill.healthy {
    color: #1d4ed8;
    background: #e8f0ff;
}

.status-pill.neutral {
    color: #0f172a;
    background: #eef2f7;
    border-color: #dbe3ed;
}

.nav-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.02em;
}

.nav-footnote {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.section-header {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    margin: 0;
    color: #2e7df6;
    font-weight: 700;
    letter-spacing: 0.02em;
    font-size: 12px;
}

.section-header h1 {
    margin: 6px 0 4px;
    font-size: 28px;
}

.subtext {
    margin: 0;
    color: var(--muted);
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    border: 1px solid #d7e3f6;
    background: #f6f9ff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    color: #1e3a8a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(30, 58, 138, 0.15);
}

.chip.active {
    background: linear-gradient(135deg, #2e7df6, #5b9dff);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(46, 125, 246, 0.35);
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    transition: all 0.22s ease;
    cursor: pointer;
    position: relative;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    border-color: #cdd9ed;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    background: #eef3fc;
    color: #1d4ed8;
}

.badge.secondary {
    background: #f3f4f6;
    color: #475569;
}

.card h3 {
    margin: 10px 0 8px;
    font-size: 20px;
}

.card p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
    margin-top: 10px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f0f4ff;
    color: #1e3a8a;
    font-weight: 600;
    font-size: 12px;
}

.timestamp {
    color: var(--muted);
    font-size: 13px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    animation: fadeIn 0.25s forwards;
}

.modal-card {
    position: relative;
    width: min(720px, 90vw);
    background: var(--panel);
    border-radius: 20px;
    border: 1px solid var(--border);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.22);
    padding: 26px 28px 28px;
    transform: translateY(24px);
    opacity: 0;
    animation: popIn 0.3s forwards ease;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.modal h2 {
    margin: 6px 0 12px;
    font-size: 24px;
}

.modal-body {
    color: #334155;
    line-height: 1.7;
}

.link-out {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
    padding: 10px 12px;
    background: #f1f5ff;
    border-radius: 12px;
    border: 1px solid #d5e3ff;
}

.link-out:hover {
    background: #e4edff;
}

.close-modal {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 기사 카드 내 레이아웃 (텍스트 ↔ 이미지 가로 배치) */
.card-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.card-text {
    flex: 1;
    min-width: 0;
}

.card-thumb img {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
}

.modal-body-thumb {
    text-align: center;
}

.modal-body-thumb img {
    /*width:160px;
    height:120px;*/
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

.modal-body-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
}

.modal-body-text .modal-body-title {
    display: block;
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 8px;
}

.modal-body-text .modal-body-note {
    font-size: 13px;
    opacity: 0.8;
}


.logo-chip {
    width: 54px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(145deg, #2e7df6, #5da6ff);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    font-weight: 800;
}

.logo-chip .logo-text {
    font-size: 18px;
    letter-spacing: 1.5px;   /* 이게 중요 */
    line-height: 1;
    transform: translateY(1px); /* 시각적 중앙 보정 */
}

.nav-item {
    border: none;
    background: #f2f6fb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;

}

.nav-item:hover {
    background: #e3edfb;
}

.nav-item.active {
    background: linear-gradient(135deg, #2e7df6, #74a9ff);
    color: white;
    box-shadow: 0 12px 25px rgba(46, 125, 246, 0.25);
}

#news-modal {
    align-items: center; /* ← flex-start 에서 center 로 변경 */
    justify-content: center;
    padding: 16px; /* 화면 가장자리 여백 */
    box-sizing: border-box;
}

/* 실제 모달 카드 */
#news-modal .modal-card {
    width: 30%;
    max-width: 30%;

    /* 화면 높이를 넘지 않도록 제한 */
    max-height: calc(100vh - 32px);

    /* 가운데 딱 맞추려면 위아래 마진 제거 */
    margin-top: 0;
    margin-bottom: 0;


    /* 내용이 길면 모달 내부에서만 스크롤 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    box-sizing: border-box;
}