:root {
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --accent-color: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(0, 0, 0, 0.1);
    --font-main: 'Outfit', sans-serif;
    --gradient-text: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    color: var(--text-color);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ═══ Top Navigation Tab Bar ═══ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    padding: 0 1.2rem;
    height: 52px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 200;
}

.tab-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tab-group::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 0.4rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    white-space: nowrap;
}
.tab-btn:hover  { background: rgba(255,255,255,0.1); color: #fff; }
.tab-btn.active { background: rgba(255,255,255,0.15); color: #fff; box-shadow: inset 0 -2px 0 #a5b4fc; }

/* ── Auth Bar ── */
.auth-bar { display: flex; align-items: center; gap: 0.6rem; flex-shrink: 0; }
.auth-btn-login {
    padding: 0.35rem 0.9rem;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem; font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}
.auth-btn-login:hover { background: rgba(255,255,255,0.2); }

.auth-user-name { color: rgba(255,255,255,0.8); font-size: 0.85rem; font-weight: 600; }

.role-badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 20px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
.badge-admin      { background: rgba(167,139,250,0.25); color: #c4b5fd; border: 1px solid rgba(167,139,250,0.4); }
.badge-consultant { background: rgba(56,189,248,0.2);   color: #7dd3fc; border: 1px solid rgba(56,189,248,0.35); }
.badge-user       { background: rgba(52,211,153,0.18);  color: #6ee7b7; border: 1px solid rgba(52,211,153,0.3); }

.auth-btn-admin {
    padding: 0.3rem 0.8rem; background: rgba(167,139,250,0.2); color: #c4b5fd;
    border: 1px solid rgba(167,139,250,0.35); border-radius: 8px;
    font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600;
    text-decoration: none; transition: background 0.2s;
}
.auth-btn-admin:hover { background: rgba(167,139,250,0.35); }

.auth-btn-logout {
    padding: 0.3rem 0.8rem; background: rgba(239,68,68,0.15); color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3); border-radius: 8px;
    font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.auth-btn-logout:hover { background: rgba(239,68,68,0.3); }

/* ── Sidebar Content Switching ── */
.sidebar-content { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.sidebar-content.active { display: flex; }

.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 0.8rem 0.5rem;
}
.sidebar-title { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin: 0; }

.btn-add-famous {
    padding: 0.3rem 0.7rem; background: #6366f1; color: #fff;
    border: none; border-radius: 7px; font-family: 'Outfit', sans-serif;
    font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: opacity 0.2s;
}
.btn-add-famous:hover { opacity: 0.85; }

/* ── Famous Person Card ── */
.famous-card {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.7rem; border-radius: 9px; cursor: pointer;
    border: 1px solid transparent; margin-bottom: 0.35rem;
    transition: background 0.15s, border-color 0.15s;
    background: #fff;
}
.famous-card:hover  { background: #eef2ff; border-color: #c7d2fe; }
.famous-card.active { background: #e0e7ff; border-color: #6366f1; }

.famous-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff; font-weight: 700;
}
.famous-info { flex: 1; min-width: 0; }
.famous-name  { font-size: 0.87rem; font-weight: 700; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.famous-meta  { font-size: 0.72rem; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.famous-actions { display: flex; gap: 0.3rem; flex-shrink: 0; }
.famous-edit-btn {
    padding: 0.2rem 0.5rem; background: #f1f5f9; color: #64748b;
    border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.72rem;
    cursor: pointer; font-family: 'Outfit', sans-serif; transition: background 0.15s;
}
.famous-edit-btn:hover { background: #e2e8f0; }

/* ── Login Required Overlay ── */
.login-required-overlay {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}
.login-required-card {
    text-align: center; padding: 3rem 2.5rem;
    background: #fff; border-radius: 20px;
    box-shadow: 0 8px 30px rgba(99,102,241,0.1);
    border: 1px solid #e0e7ff;
    max-width: 360px;
}
.auth-action-btn {
    display: inline-block; padding: 0.65rem 1.4rem;
    border-radius: 10px; font-family: 'Outfit', sans-serif;
    font-size: 0.95rem; font-weight: 700; text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}
.auth-action-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.auth-action-btn.primary   { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; }
.auth-action-btn.secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

/* ── Theme button ── */
.theme-btn {
    border: none; border-radius: 8px; font-family: 'Outfit', sans-serif;
    font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.theme-btn:hover { opacity: 0.85; }

/* Split Layout */
.split-layout {
    display: flex;
    width: 100vw;
    height: calc(100vh - 52px);
    overflow: hidden;
}

.sidebar {
    width: 22%;
    min-width: 260px;
    max-width: 320px;
    background-color: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.chart-content {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: auto;
    padding: 0.25rem 0.5rem;
}

.right-panel {
    width: 380px;
    min-width: 300px;
    background-color: #f8fafc;
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

.right-panel.hidden {
    display: none !important;
}

.combo-tab {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s;
}

.combo-tab:hover {
    background: #f1f5f9;
}

.combo-tab.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.container {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.highlight {
    background: var(--gradient-text);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px var(--accent-glow);
}

.header p {
    color: #64748b;
    font-weight: 300;
    font-size: 1.1rem;
}

/* Glassmorphism Classes */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.modal-flex-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.search-group {
    display: flex;
    gap: 0.5rem;
}

.search-group.relative {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    list-style: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.autocomplete-list li {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover {
    background: rgba(99, 102, 241, 0.1);
}

.autocomplete-list li strong {
    color: #1e293b;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.2rem;
}

.autocomplete-list li small {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.search-group input {
    flex: 1;
}

.search-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 0 1.2rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--accent-color);
    color: white;
}

.tz-info {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-left: 3px solid #10b981;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge.dst {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.help-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* Button setup */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(123, 66, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 66, 246, 0.6);
}

.submit-btn:active {
    transform: translateY(1px);
}

/* Loader */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

/* Chart Container */
.chart-container-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
    overflow: visible;
}

.svg-container {
    width: 100%;
    max-width: 600px;
}

/* 대운 테이블: PC/모바일 공통 - 고정 높이 + 내부 스크롤 */
.ap-table-scroll {
    max-height: 540px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 대운 테이블 헤더: 스크롤 시 상단 고정 */
.ap-table thead th {
    position: sticky;
    top: 0;
    background: #e0e7ff;
    z-index: 10;
}

.chart-element {
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-element:hover {
    filter: drop-shadow(0 0 5px var(--accent-glow));
    stroke: var(--accent-color);
}

.clickable-item:hover {
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}



.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-height: 85vh;
    overflow-y: auto;
}





#panel-title {
    margin-bottom: 0.2rem;
    font-size: 1.5rem;
    color: #1e293b;
}

.text-gray {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.modal-body textarea {
    width: 100%;
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    padding: 1rem;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.small-btn {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    width: auto;
    margin-top: 0;
}

/* Results Section */
.results-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #1e293b;
}

.ascendant-card {
    background: linear-gradient(to right, rgba(99, 102, 241, 0.05), transparent);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border-top: 1px solid var(--card-border);
    border-right: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

/* Custom Summary Box (Charubel style) */
.cosmic-summary-box {
    background-color: #ffffff;
    text-align: left;
    width: 100%;
    font-family: inherit;
    line-height: 1.2;
    padding: 0.6rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.summary-name {
    color: #2563eb;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.2rem;
}

.summary-name:hover {
    text-decoration: underline;
}

.summary-line {
    color: #334155;
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
}

.ascendant-card h3 {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.sign-display {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sign-display .degree {
    font-size: 1.2rem;
    font-weight: 400;
    color: #64748b;
}

.planets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.planet-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.planet-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--accent-color);
}

.planet-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #334155;
}

.planet-sign {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 0.2rem;
}

.planet-degree {
    font-size: 0.8rem;
    color: #94a3b8;
}

.astro-tooltip {
    position: fixed;
    background: #ffffcc;
    border: 1px solid #a0a096;
    padding: 4px 8px;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    pointer-events: none;
    /* 마우스 이벤트 방해 방지 */
    z-index: 1000;
    white-space: pre-wrap;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.astro-tooltip.hidden {
    display: none;
}

@media (max-width: 600px) {
    .top-nav {
        padding: 0 0.5rem;
    }
    .tab-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    .auth-bar {
        gap: 0.3rem;
    }
    .auth-btn-login, .auth-btn-logout, .auth-btn-admin {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .modal-flex-row {
        flex-direction: row;
        gap: 0.5rem;
    }

    .modal-content {
        padding: 1rem !important;
    }

    .form-group {
        margin-bottom: 0.5rem !important;
    }

    .modal-content label {
        font-size: 0.75rem !important;
        margin-bottom: 0.2rem !important;
    }

    .modal-content input, .modal-content select {
        padding: 0.5rem 0.6rem !important;
        font-size: 0.85rem !important;
    }

    .search-btn {
        padding: 0 0.6rem !important;
        font-size: 0.85rem !important;
    }

    .submit-btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem !important;
        margin-top: 0.5rem !important;
    }

    .tz-info {
        padding: 0.4rem 0.6rem !important;
        margin-top: 0.3rem !important;
        font-size: 0.8rem !important;
    }

    .glass-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }
}

/* Custom Scrollbar for sidebar lists */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Toast Notification Styles */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #3b82f6;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease-in-out, bottom 0.4s ease-in-out;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* Famous Client Prophecy Glow Anim */
.prophecy-glow {
    background: linear-gradient(135deg, #f43f5e 0%, #8b5cf6 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: prophecyPulse 2s ease-in-out infinite alternate;
}

@keyframes prophecyPulse {
    0% {
        transform: scale(0.98);
        text-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
    }
    100% {
        transform: scale(1.03);
        text-shadow: 0 0 25px rgba(139, 92, 246, 0.8), 0 0 10px rgba(244, 63, 94, 0.6);
    }
}

/* Mobile Responsive Layout (Vertical Stack for 3-Column) */
@media (max-width: 900px) {
    /* 1. 전체 레이아웃을 상하 1단 구조로 구조 변경 (가로 스크롤 제거, 세로 스크롤 허용) */
    .split-layout {
        flex-direction: column;
        overflow-y: auto;     
        overflow-x: hidden;
        height: auto;         
        min-height: 100vh;
    }
    
    /* 2. 왼쪽 패널 (고객 목록/정보) - 너비를 꽉 채우고 아래 테두리로 구분 */
    .sidebar {
        width: 100%;          
        min-width: unset;
        max-width: none;
        height: auto;
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }

    /* 모바일에서 리스트가 너무 길면 밑의 차트를 보기 힘드므로 최대 높이 제한 */
    .client-db-section {
        max-height: 350px !important; 
    }

    /* 3. 가운데 메인 차트 패널 - 찌그러짐 방지, 패딩 조절 */
    .chart-content {
        width: 100%;
        padding: 1rem;
        height: auto;
        min-height: unset;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* 4. 오른쪽 패널 (행성 해석) - 중앙 팝업(모달) 배치 */
    .right-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 400px;
        min-width: unset;
        height: auto;
        max-height: 85vh;
        border: none;
        border-radius: 16px;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6), 0 10px 40px rgba(0,0,0,0.2);
        z-index: 2000;
        display: flex;
        flex-direction: column;
    }

    /* 모바일 팝업 시 콘텐츠 스크롤 정상 작동하도록 */
    #interpretation-content {
        max-height: calc(85vh - 150px) !important;
        overflow-y: auto !important;
    }

    /* 대운 리스트: 모바일에서 좌우 여백 제거하여 화면 꽉 채우기 */
    .data-lists-section {
        padding: 0 !important;
        max-width: 100% !important;
    }

    /* 모바일에서 대운 테이블 높이 축소 override */
    .ap-table-scroll {
        max-height: 380px;
    }
}