/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    max-width: 100%;
    margin: auto;
    background: white;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    overflow: hidden;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    font-size: 12px;
}

::-webkit-scrollbar { height: 0; width: 0; }

/* ===== Top Navigation (#111 검정) ===== */
#app-header {
    background-color: #111;
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 0;
}
#app-header h1 {
    font-size: 12px;
    font-weight: 700;
    color: #f2f2f2;
    padding: 10px;
    text-decoration: none;
}
#app-header h1 a {
    color: #f2f2f2;
    text-decoration: none;
}
#auth-area {
    display: flex;
    align-items: center;
    gap: 0;
}
#auth-area a, #auth-area button {
    float: left;
    color: #f2f2f2;
    text-align: center;
    padding: 10px;
    text-decoration: none;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
}
#auth-area a:hover, #auth-area button:hover {
    background-color: #FABD02;
    color: black;
}
#auth-area .legacy-link {
    color: #888;
}
#auth-area .legacy-link:hover {
    background-color: #444;
    color: #ccc;
}

/* ===== Tab Navigation (#333 다크그레이, 가로스크롤) ===== */
#tab-nav {
    background-color: #333;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    font-size: 12px;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.tab-btn {
    display: inline-block;
    color: white;
    text-align: center;
    padding: 10px 14px;
    text-decoration: none;
    border: none;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab-btn:hover {
    background-color: #777;
}
.tab-btn.active {
    background-color: #555;
    color: #FABD02;
    border-bottom-color: #FABD02;
}

/* ===== Main / Tab Content ===== */
main {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.tab-content {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    overflow: hidden;
}
.tab-content.active {
    display: flex;
}

/* ===== Floating Bar (하단 글래스모피즘) ===== */
#floating-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.80);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
    white-space: nowrap;
}
#floating-bar select {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 2px 22px 2px 8px;
    font-size: 11px;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 6px center;
    color: #333;
    min-width: 110px;
    cursor: pointer;
}
#floating-bar select:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
}
.float-search {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    width: 90px;
    color: #333;
    background: transparent;
}
.float-search:focus {
    outline: none;
    border-color: rgba(0, 0, 0, 0.3);
}
#floating-bar button {
    padding: 0 18px;
    height: 24px;
    line-height: 24px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
#floating-bar button:hover {
    background: rgba(0, 0, 0, 0.9);
}
#floating-bar button:active {
    transform: scale(0.97);
}
.float-col-btns {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ===== Floating Bar 버튼 통일 (스크롤 ▲▼◀▶ / I·F·Y·S / hide) =====
   기본 #floating-bar button (id+element, 0,1,0,1) 보다 specificity 우선이 필요해 #floating-bar 접두 사용. */
#floating-bar .scroll-btn,
#floating-bar .col-btn,
#floating-bar .meta-toggle-btn {
    height: 22px;
    padding: 0 9px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.55);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}
#floating-bar .scroll-btn:hover,
#floating-bar .col-btn:hover,
#floating-bar .meta-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.85);
    border-color: rgba(0, 0, 0, 0.12);
}
#floating-bar .scroll-btn:active,
#floating-bar .col-btn:active,
#floating-bar .meta-toggle-btn:active {
    transform: scale(0.96);
}
#floating-bar .col-btn.active,
#floating-bar .meta-toggle-btn.active {
    background: rgba(0, 0, 0, 0.78);
    color: white;
    border-color: rgba(0, 0, 0, 0.78);
}
#floating-bar .meta-toggle-btn {
    margin-left: 4px;
}

/* 데스크탑: 상하좌우 스크롤 버튼 정사각형 (height 22px → width 22px) */
#floating-bar .scroll-btn {
    width: 22px;
    padding: 0;
}
/* ◀▶ (U+25C0/25B6) 글리프가 ▲▼ (U+25B2/25BC) 보다 폰트상 크게 그려짐 → 좌우만 살짝 축소 */
#floating-bar .scroll-btn-h {
    font-size: 8px;
}

/* ag-grid 즐겨찾기 ★ 셀 */
.fav-star {
    display: inline-block;
    width: 100%;
    height: 100%;
    line-height: inherit;
    color: rgba(0, 0, 0, 0.25);
    font-size: 14px;
    user-select: none;
}
.fav-star:hover {
    color: rgba(0, 0, 0, 0.55);
}
.fav-star.on {
    color: #f5b800;
}

/* 즐겨찾기 탭 하단 캡션 */
.fav-caption {
    padding: 6px 10px;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    text-align: right;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#float-elapsed,
.float-status {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.5);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 데스크탑: 줄바꿈 마커는 무시 */
.fb-break { display: none; }

/* 모바일 판별: 세로가 가로보다 길 때 (portrait) */
@media (orientation: portrait) {
    #floating-bar {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 4px 6px;
        gap: 4px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        flex-shrink: 0;
    }
    /* 모바일: 마커가 한 줄 100% 차지 → 다음 항목 강제 줄바꿈 (최대 2줄) */
    .fb-break {
        display: block;
        flex-basis: 100%;
        width: 100%;
        height: 0;
    }
    /* 1줄: select(남는폭) + search(남는폭) + up + down */
    #floating-bar select {
        flex: 1 1 0;
        min-width: 0;
        font-size: 10px;
        padding: 2px 18px 2px 6px;
    }
    .float-search {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        font-size: 10px;
    }
    /* 스크롤 버튼: 데스크탑의 정사각형(width:22) 해제 + 가로형 직사각 */
    #floating-bar .scroll-btn {
        width: auto;
        padding: 0 8px;
        height: 22px;
        font-size: 11px;
        flex: 0 0 auto;
    }
    /* 모바일에서 좌우 스크롤 버튼은 숨김 */
    #floating-bar .scroll-btn-h {
        display: none;
    }
    /* 2줄: meta-toggle + I/F/Y/S + status(남는폭, 우측정렬) */
    #floating-bar .meta-toggle-btn {
        padding: 0 8px;
        height: 22px;
        font-size: 10px;
        flex: 0 0 auto;
    }
    .float-col-btns {
        flex: 0 0 auto;
        gap: 3px;
    }
    #floating-bar .col-btn {
        padding: 0 8px;
        height: 22px;
        font-size: 10px;
    }
    .float-status {
        font-size: 10px;
        max-width: none;
        flex: 1 1 0;
        min-width: 0;
        text-align: right;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ===== Grid Container ===== */
.grid-wrap {
    flex: 1;
    overflow: hidden;
}

/* ===== 설정 탭 ===== */
.settings-wrap {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.settings-section {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 20px 24px;
}
.settings-section h3 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #111;
}
.settings-help {
    margin: 0 0 16px;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}
.settings-grouplist {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.settings-group-item {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.settings-field-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.settings-field-btn {
    height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(0, 0, 0, 0.7);
    font-size: 11px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    cursor: pointer;
    transition: all 0.12s ease;
}
.settings-field-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.18);
}
.settings-field-btn.off {
    background: transparent;
    color: rgba(0, 0, 0, 0.3);
    border-style: dashed;
    border-color: rgba(0, 0, 0, 0.15);
    text-decoration: line-through;
}
.settings-field-btn.dim {
    opacity: 0.4;
    cursor: not-allowed;
}
.settings-field-btn.locked {
    background: rgba(0, 0, 0, 0.65);
    color: white;
    border-color: rgba(0, 0, 0, 0.65);
    cursor: not-allowed;
    font-weight: 600;
}
.settings-field-btn.locked:hover {
    background: rgba(0, 0, 0, 0.65);  /* hover override 안 함 — 잠금 상태 유지 */
}
.settings-group-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.settings-group-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.settings-group-label {
    font-weight: 500;
    color: #222;
}
.settings-group-fields {
    font-size: 11px;
    color: #888;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.settings-group-actions {
    display: inline-flex;
    gap: 4px;
}
.settings-group-actions button {
    width: 28px;
    height: 26px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: #fff;
    color: #444;
    cursor: pointer;
    font-size: 12px;
}
.settings-group-actions button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}
.settings-group-actions button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}
.settings-btn-primary,
.settings-btn-secondary {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.settings-btn-primary {
    border: none;
    background: #333;
    color: #fff;
}
.settings-btn-primary:hover {
    background: #555;
}
.settings-btn-secondary {
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: #fff;
    color: #444;
}
.settings-btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* ===== 개별종목 탭 — 상단 헤더 + 섹션 헤더 + 재무 테이블 ===== */
.stock-section-header {
    flex-shrink: 0;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #f2f2f2;
    background: #555;
    border-bottom: 1px solid #444;
}
.stock-header {
    flex-shrink: 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    background: #f7f7f7;
    border-bottom: 1px solid #d0d0d0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.stock-financial-wrap {
    flex-shrink: 0;
    overflow: auto;
    border-bottom: 1px solid #d0d0d0;
    max-height: 36vh;
}
.stock-financial-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: white;
}
.stock-financial-table thead th {
    position: sticky;
    top: 0;
    background: #333;
    color: #fff;
    font-weight: 700;
    padding: 5px 6px;
    text-align: right;
    border-right: 1px solid #555;
    z-index: 1;
}
.stock-financial-table thead th:first-child {
    text-align: left;
}
.stock-financial-table tbody td {
    padding: 4px 6px;
    text-align: right;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    font-variant-numeric: tabular-nums;
}
.stock-financial-table tbody td.stock-fin-q {
    text-align: left;
    font-weight: 600;
    background: #fafafa;
}
.stock-financial-table tbody td.stock-fin-empty {
    text-align: center;
    color: #999;
    padding: 12px;
}
.stock-financial-table tbody tr:hover td {
    background: #f4f8fc;
}
@media (max-width: 800px) {
    .stock-header { font-size: 12px; padding: 6px 10px; }
    .stock-financial-table { font-size: 10px; }
    .stock-financial-wrap { max-height: 40vh; }
}

/* ===== AG Grid 커스텀: jazzstock 스타일 ===== */
.ag-theme-alpine {
    --ag-font-size: 11px;
    --ag-row-height: 24px;
    --ag-header-height: 26px;
    --ag-header-background-color: #333333;
    --ag-header-foreground-color: #ffffff;
    --ag-odd-row-background-color: #ffffff;
    --ag-row-border-color: #636363;
    --ag-border-color: #636363;
    --ag-cell-horizontal-padding: 4px;
    --ag-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.ag-theme-alpine .ag-header-cell-label {
    font-size: 11px;
    font-weight: bold;
}
.ag-theme-alpine .ag-cell {
    font-size: 11px;
    padding: 1px 4px;
    line-height: 1.4;
    border-right: 1px solid #636363;
}

/* ===== 로그인 모달 ===== */
#login-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#login-modal.open {
    display: block;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 320px;
    max-width: 90vw;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}
.modal-field {
    margin-bottom: 14px;
}
.modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}
.modal-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #f9f9f9;
    transition: border-color 0.15s;
}
.modal-field input:focus {
    border-color: #333;
    background: #fff;
    outline: none;
}
.modal-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}
.modal-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #333;
}
.modal-check label {
    font-size: 12px;
    color: #666;
    cursor: pointer;
}
.modal-error {
    color: #d32f2f;
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 8px;
}
.modal-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: #333;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.modal-submit:hover {
    background: #555;
}
.modal-submit:disabled {
    background: #999;
    cursor: not-allowed;
}
.modal-link-row {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}
.modal-link-row a {
    color: #666;
    text-decoration: none;
    border-bottom: 1px dotted #aaa;
    padding-bottom: 1px;
}
.modal-link-row a:hover {
    color: #2e6ba2;
    border-bottom-color: #2e6ba2;
}
.modal-link-row a:only-child {
    margin-left: auto;  /* 단독 링크 (재설정 모달 등) 는 우측 정렬 */
}

/* ===== Notice / Manual 모달 (마크다운 컨텐츠 공용) ===== */
#notice-modal,
#manual-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#notice-modal.open,
#manual-modal.open {
    display: block;
}
#notice-modal .modal-dialog {
    width: 420px;
}
#manual-modal .modal-dialog {
    width: 560px;
}
#notice-modal-body,
#manual-modal-body {
    font-size: 13px;
    line-height: 1.8;
    color: #333;
}
#notice-modal-body h1, #notice-modal-body h2, #notice-modal-body h3,
#manual-modal-body h1, #manual-modal-body h2, #manual-modal-body h3 {
    margin: 12px 0 6px;
    color: #111;
}
#notice-modal-body h1, #manual-modal-body h1 { font-size: 16px; }
#notice-modal-body h2, #manual-modal-body h2 { font-size: 14px; }
#notice-modal-body h3, #manual-modal-body h3 { font-size: 13px; }
#notice-modal-body p, #manual-modal-body p { margin: 6px 0; }
#notice-modal-body ul, #notice-modal-body ol,
#manual-modal-body ul, #manual-modal-body ol {
    margin: 4px 0 4px 18px;
}
#notice-modal-body a,
#manual-modal-body a {
    color: #2e6ba2;
    text-decoration: underline;
}
#notice-modal-body strong,
#manual-modal-body strong {
    font-weight: 700;
}
#manual-modal-body table {
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 12px;
}
#manual-modal-body th, #manual-modal-body td {
    border: 1px solid rgba(0,0,0,0.12);
    padding: 4px 8px;
    text-align: left;
}
#manual-modal-body th {
    background: rgba(0,0,0,0.04);
    font-weight: 600;
}
#manual-modal-body code {
    background: rgba(0,0,0,0.05);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11.5px;
}

/* ===== 다운로드 모달 ===== */
#download-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#download-modal.open {
    display: block;
}
#download-modal .modal-dialog {
    width: 400px;
}
#download-modal a {
    color: #2e6ba2;
    text-decoration: none;
    font-size: 12px;
}
#download-modal a:hover {
    text-decoration: underline;
}

/* ===== 회원가입 / 비밀번호 재설정 모달 (login 모달 기본 스타일 상속) ===== */
#register-modal,
#forgot-password-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#register-modal.open,
#forgot-password-modal.open {
    display: block;
}
#register-modal .modal-dialog,
#forgot-password-modal .modal-dialog {
    width: 360px;
}

/* ===== 회원정보 모달 (Info) ===== */
#modify-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
#modify-modal.open {
    display: block;
}
#modify-modal .modal-dialog {
    width: 360px;
}
.modal-inline {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.modal-inline input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #f9f9f9;
    transition: border-color 0.15s;
}
.modal-inline input:focus {
    border-color: #333;
    background: #fff;
    outline: none;
}
.modal-check-btn {
    padding: 0 10px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.modal-check-btn:hover:not(:disabled) {
    background: #333;
    color: #fff;
}
.modal-check-btn:disabled {
    border-color: #ccc;
    color: #aaa;
    cursor: not-allowed;
}
.modal-hint {
    font-size: 11px;
    margin-top: 4px;
    min-height: 14px;
}

/* ===== Alert Modal (공용 알림 — register/login 등에서 재사용) =====
   - 최상단 z-index 로 하위 모달(9999) 위에 뜸
   - 백드롭으로 아래 레이어 디밍
   - 정중앙 약간 하단 (top:55%) 에 배치
   - 자동 dismiss + 탭 즉시 dismiss (JS)
*/
.alert-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}
.alert-modal.show {
    display: block;
}
.alert-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.alert-modal.show .alert-modal-backdrop {
    opacity: 1;
}
.alert-modal-dialog {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%) scale(0.96);
    max-width: min(86vw, 360px);
    padding: 18px 22px;
    border-radius: 16px;
    background: rgba(17, 17, 17, 0.94);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
    -webkit-backdrop-filter: blur(16px) saturate(170%);
    backdrop-filter: blur(16px) saturate(170%);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1.1);
    white-space: pre-wrap;
    word-break: keep-all;
    cursor: pointer;
}
.alert-modal.show .alert-modal-dialog {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
@media (max-width: 800px) {
    .alert-modal-dialog {
        max-width: 84vw;
        font-size: 13px;
        padding: 16px 18px;
        border-radius: 14px;
    }
}

/* ===== User Info (로그인 후) ===== */
.user-info {
    color: #f2f2f2;
    font-size: 11px;
    padding: 0 8px;
    white-space: nowrap;
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #666;
    font-size: 12px;
}

/* ===== Signal (로딩 애니메이션) ===== */
.signal {
    border: 5px solid #333;
    border-radius: 30px;
    height: 20px;
    width: 20px;
    margin: 0 auto;
    opacity: 0;
    animation: pulsate 1s ease-out infinite;
}
@keyframes pulsate {
    0%   { transform: scale(.1); opacity: 0; }
    50%  { opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* ===== Mobile ===== */
@media (max-width: 800px) {
    #app-header h1 { font-size: 11px; padding: 8px; }
    #auth-area a, #auth-area button { padding: 8px 6px; font-size: 11px; }
    .login-form input { width: 80px; padding: 4px 6px; }
    .tab-toolbar { padding: 3px 6px; }
    .tab-btn { padding: 8px 10px; font-size: 11px; }
}

/* ===== 테마 탭 split ===== */
.theme-split {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.theme-split > div {
    min-width: 0;
}
@media (max-width: 800px) {
    .theme-split {
        flex-direction: column;
    }
}
