/* JetBrains Mono 폰트는 각 페이지 <head>의 <link>로 로드 (렌더 차단 @import 제거).
   weight 600 mono가 필요하면 페이지 <link>를 wght@500;600 으로 요청할 것. */

/* ============================================================
   Fitrip — common.css  v9
   라이트: Editorial × Calm Modern
   다크:   Deep Atlas

   리디자인 계약:
     - 기존 네오브루탈리즘/시안 글로우 미감 사용 금지
     - 사진/지도/타이포가 주인공, UI chrome은 후퇴
     - 브랜드 시안은 강조에만 제한적으로 사용
   ============================================================ */

/* ── 1. 디자인 토큰(변수)은 tokens.css로 이전됨 (단일 소스) ── */


/* ── 공유 keyframes (페이지 공통 — 인라인 중복 통합) ───────── */
@keyframes ftRise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ftDrift { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(30px); } }
@keyframes ftCardIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ftPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes pdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pdSlide { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* ── 2. 리셋 ──────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}
/* margin/padding 리셋은 디자인시스템 레이아웃(fp)에만 적용 —
   인라인으로 자체완결한 페이지의 UA 기본 마진을 보존(라이트 픽셀 불변) */
body.fp, body.fp *, body.fp *::before, body.fp *::after {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-body);
    transition: background var(--duration-normal) ease;
}

/* ── 3. Body ──────────────────────────────────────────────── */
/* 전역 body — 안전한 속성만(자체완결 페이지가 링크해도 라이트 불변). 폰트/줄바꿈은 페이지도 인라인 지정 */
body {
    font-family: var(--font-sans);
    word-break: keep-all;
    overflow-wrap: break-word;
    overflow-x: clip;
}
/* 디자인시스템 레이아웃 — body.fp 옵트인(고정 navbar 오프셋 + flex 푸터 + 배경/줄간격).
   인라인으로 자체완결한 페이지는 fp를 안 붙이므로 영향 없음 */
body.fp {
    background: var(--bg-body);
    color: var(--text-1);
    padding-top: var(--navbar-h);
    line-height: var(--line-height-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--duration-normal) ease, color var(--duration-normal) ease;
}

/* ── 3-A. 접근성 — 키보드 포커스 ─────────────────────────── */
/* 마우스 클릭 시에는 포커스 링 숨김, 키보드 탐색 시에만 표시 */
:focus { outline: none; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

/* ── 3-B. 접근성 — 모션 감소 선호 ───────────────────────── */
/* 전정 기관 장애 등 모션 민감 사용자를 위해 애니메이션 최소화 */
@media (prefers-reduced-motion: reduce) {
    :root {
        --duration-fast:   0s;
        --duration-normal: 0s;
        --duration-slow:   0s;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 페이지 컨테이너 — footer를 항상 하단에 고정 */
.page { flex: 1 0 auto; }

/* 스크린리더 전용 — 시각적으로 숨기지만 보조기술에는 노출 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 4. Scrollbar — 네이티브 fallback (얇게) ─────────────── */
html, body, [data-scroll], .scroll-y {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
[data-theme="dark"] :is(html, body, [data-scroll], .scroll-y) {
    scrollbar-color: var(--scrollbar-thumb) transparent;
}
/* ft 페이지 공통 웹킷 스크롤바 — 페이지별 복붙 제거, 단일 소스 (P2 #21) */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ft-faint); border-radius: 999px; border: 4px solid var(--ft-bg); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ft-muted); border: 4px solid var(--ft-bg); background-clip: padding-box; }

/* ── 4-A. 모바일 입력창 자동 확대 방지 ───────────────────────── */
/* iOS Safari는 입력창 폰트가 16px 미만이면 포커스 시 화면을 자동 확대함 → 16px로 통일 */
@media (max-width: 768px) {
    input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ── 5. 로고 — 순수 타이포 ────────────────────────────────── */

/* ── 6. 버튼 — Primary ────────────────────────────────────── */
.btn-primary {
    height: var(--button-h);
    min-height: var(--button-h);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--brand);
    color: var(--on-cyan-ink);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
    transition:
        background var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
    box-shadow: var(--shadow-brand-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-cta-glow);
    text-decoration: none;
}

/* 다크 재선언 삭제 — 라이트와 동일 내용이라 불필요(on-cyan-ink가 다크에서 자동 전환) */

/* ── 버튼 크기 변형 ───────────────────────────────────────── */
/* .btn-sm: 작은 버튼 (인라인/태그 용도) */
.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    height: 32px;
    min-height: 32px;
}

.btn-primary.btn-sm:hover {
    box-shadow: var(--brand-cta-glow);
}

/* .btn-lg: 큰 버튼 (CTA 강조 용도) */
.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
    height: 52px;
    min-height: 52px;
}

.btn-primary.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-cta-glow);
}

/* .btn-block: 전체 너비 버튼 */
.btn-block {
    width: 100%;
    justify-content: center;
}

/* ── 7. 버튼 — Danger ────────────────────────────────────── */
.btn-danger {
    height: var(--button-h);
    min-height: var(--button-h);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    border: none;
    background: var(--danger);
    color: var(--brand-text);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
    transition:
        background var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.btn-danger:hover {
    box-shadow: 0 10px 24px -10px var(--ft-danger);
    text-decoration: none;
}

/* ── 8. 버튼 — Secondary ──────────────────────────────────── */
.btn-secondary {
    height: var(--button-h);
    min-height: var(--button-h);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-surface) 84%, white 16%);
    color: var(--text-1);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: 1;
    text-decoration: none;
    transition:
        border-color var(--t-fast) ease,
        background var(--t-fast) ease,
        color var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.btn-secondary:hover {
    border-color: var(--brand-cyan);
    color: var(--ft-cyan-text);
    background: var(--ft-cyan-soft);
    box-shadow: 0 10px 22px -12px var(--brand-shadow-a45);
    text-decoration: none;
}

/* ── 9. 버튼 — 아이콘 사각형 ────────────────────────────── */
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-surface) 90%, white 10%);
    color: var(--text-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.92rem;
    transition:
        background var(--t-fast) ease,
        color var(--t-fast) ease,
        border-color var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.btn-icon:hover {
    border-color: var(--brand-cyan);
    color: var(--ft-cyan-text);
    background: var(--ft-cyan-soft);
    box-shadow: 0 10px 22px -12px var(--brand-shadow-a45);
}

.btn-icon.delete {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger-border);
}

.btn-icon.delete:hover {
    border-color: var(--ft-danger-soft);
    color: var(--ft-danger);
    background: var(--ft-surface);
    box-shadow: none;
}

.btn-icon.active {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand);
}

/* ── 10. 버튼 — 작은 사각형 (btn-circle 대체) ────────────── */
.btn-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    flex-shrink: 0;
    align-self: center;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    background: var(--bg-surface);
    color: var(--text-2);
    transition:
        transform var(--t-fast) ease,
        background var(--t-fast) ease,
        color var(--t-fast) ease,
        border-color var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.btn-circle:hover {
    transform: scale(1.07);
}

.btn-plus {
    background: var(--brand);
    color: var(--brand-text);
    border-color: var(--brand);
}

.btn-plus:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-cta-glow);
}

/* ── 11. 필터 버튼 ────────────────────────────────────────── */


/* ── 12. 입력 필드 ────────────────────────────────────────── */
.input-box {
    width: 100%;
    min-height: 52px;
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--bg-surface);
    font-size: 0.97rem;
    font-family: inherit;
    color: var(--text-1);
    outline: none;
    transition:
        border-color var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.input-box::placeholder {
    color: var(--text-3);
}

.input-box:hover {
    border-color: var(--brand);
}

.input-box:focus {
    border-color: var(--brand);
    box-shadow: var(--brand-focus-glow);
}

.input-box[readonly] {
    background: var(--bg-surface-2);
    border-color: var(--border);
    color: var(--text-3);
    cursor: default;
}

textarea.input-box {
    resize: none;
    min-height: 120px;
    line-height: 1.7;
}

/* ── 13. 검색 박스 ────────────────────────────────────────── */

/* ── 14. Toast 알림 ───────────────────────────────────────── */
/* 전역 단일 토스트 — 모든 페이지가 utils.js showToast()로 이 스타일을 공유한다.
   페이지별 인라인 .toast 재정의 금지(과거 제각각의 원인). 하단 중앙·표면 카드·의미별 컬러 아이콘. */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 13px 18px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 11px;
    z-index: var(--z-toast);
    max-width: min(440px, calc(100vw - 32px));
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
        opacity 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info    { border-color: var(--brand); }

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; line-height: 0; }
.toast-icon svg { width: 100%; height: 100%; display: block; }

.toast.success .toast-icon { color: var(--success); }
.toast.error   .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info    .toast-icon { color: var(--brand); }

.toast-message {
    font-size: 0.93rem;
    color: var(--text-1);
    font-weight: 500;
    line-height: 1.4;
    white-space: pre-line;
}

/* ── 14b. 확인 다이얼로그 (전역 공통 — utils.js showConfirm) ─── */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    background: var(--overlay-scrim);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) ease;
}
.confirm-overlay.show { opacity: 1; pointer-events: auto; }

.confirm-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-6);
    text-align: center;
    transform: translateY(12px) scale(0.98);
    transition: transform var(--duration-normal) cubic-bezier(0.22, 0.61, 0.36, 1);
}
.confirm-overlay.show .confirm-card { transform: translateY(0) scale(1); }

.confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-4);
    border-radius: var(--radius-full);
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
}
.confirm-icon svg { width: 24px; height: 24px; }
.confirm-card.danger .confirm-icon { background: var(--danger-bg); color: var(--danger); }

.confirm-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 var(--space-2);
}
.confirm-desc {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--ink-2);
    margin: 0 0 var(--space-5);
    white-space: pre-line;
}

.confirm-actions { display: flex; gap: var(--space-3); }
.confirm-btn {
    flex: 1;
    min-height: 44px;
    padding: 0 var(--space-4);
    border-radius: var(--radius-full);
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition:
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease,
        background var(--t-fast) ease,
        border-color var(--t-fast) ease,
        color var(--t-fast) ease;
}
.confirm-btn-cancel { border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); }
.confirm-btn-cancel:hover { border-color: var(--line-2); color: var(--ink); }
.confirm-btn-confirm { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); }
.confirm-btn-confirm:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.confirm-card.danger .confirm-btn-confirm { border-color: var(--danger); background: var(--danger); color: var(--brand-text); }
.confirm-card.danger .confirm-btn-confirm:hover { box-shadow: 0 10px 24px -10px var(--ft-danger); }

@media (prefers-reduced-motion: reduce) {
    .confirm-overlay, .confirm-card { transition: none; }
}

/* ── 14c. 빈 상태 (전역 공통 — "아직 ~ 없어요") ───────────── */
.empty-state {
    grid-column: 1 / -1;
    margin-block: auto;
    margin-inline: auto;
    max-width: 440px;
    padding: var(--space-8) var(--space-5);
    text-align: center;
}
.empty-state-icon { font-size: 40px; line-height: 1; opacity: 0.55; }
[data-theme="dark"] .empty-state-icon { opacity: 0.9; }
.empty-state-title {
    margin: var(--space-4) 0 var(--space-2);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.empty-state-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ink-2);
}
.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: var(--space-6);
    padding: 12px 22px;
    border-radius: var(--radius-full);
    background: var(--brand);
    color: var(--on-cyan-ink);
    font-size: 0.9rem;
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.empty-state-cta:hover { transform: translateY(-2px); box-shadow: var(--brand-cta-glow); }

/* ── 14d. 로딩 오버레이 (전역 공통 — AI 생성 진행바) ────────── */
/* 표면(bg/border/radius/shadow)·scrim/blur는 아래 모달 정규화 body :is(.loading-card/.loading-overlay)가 제공 */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
}
.loading-overlay.active { display: flex; }
.loading-card { width: min(480px, 92vw); padding: var(--space-6); }
.loading-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 var(--space-2);
}
.loading-sub {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink-2);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
    white-space: pre-line;
}
.loading-progress { display: flex; align-items: center; gap: var(--space-3); }
.loading-bar { flex: 1; height: 8px; background: var(--bg-tint); border-radius: var(--radius-full); overflow: hidden; }
.loading-bar-fill { height: 100%; width: 0%; border-radius: inherit; background: var(--brand); transition: width 0.35s ease; }
.loading-percent { width: 54px; text-align: right; font-weight: 800; color: var(--ink); }
.loading-hint { margin-top: var(--space-3); font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .loading-bar-fill { transition: none; } }

/* ── 15. 모바일 (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {

    .btn-primary {
        height: var(--button-h);
        min-height: var(--button-h);
        padding: 0 18px;
        font-size: 0.9rem;
    }

    .btn-secondary {
        height: var(--button-h);
        min-height: var(--button-h);
        padding: 0 18px;
        font-size: 0.88rem;
    }

    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .btn-circle {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: 0.88rem;
    }

    .toast {
        bottom: 16px;
        max-width: calc(100vw - 32px);
    }

    .input-box {
        padding: 9px 13px;
        font-size: 0.93rem;
    }
}

/* ── 16. Error Toast ─────────────────────────────────────── */
.error-toast {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(140%);
    opacity: 0;
    pointer-events: none;
    transition:
        transform var(--duration-normal) cubic-bezier(0.34, 1.2, 0.64, 1),
        opacity var(--t-fast) ease;
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    min-width: min(300px, calc(100vw - var(--space-10)));
    max-width: min(520px, calc(100vw - var(--space-10)));
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--ink);
}

.error-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.error-toast-text { flex: 1; min-width: 0; }

.error-toast-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.5;
}

.error-toast-desc {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--ink-2);
    line-height: 1.6;
    margin-top: 2px;
}

.error-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn-toast-retry {
    height: var(--control-h-sm);
    padding: 0 var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid var(--danger-border);
    background: var(--bg);
    color: var(--danger);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background var(--t-fast) ease,
        border-color var(--t-fast) ease,
        color var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
    box-shadow: none;
    white-space: nowrap;
}

.btn-toast-retry:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: var(--shadow-danger);
}

.btn-toast-close {
    width: var(--control-h-sm);
    height: var(--control-h-sm);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--danger-border);
    border-radius: var(--icon-radius);
    background: var(--bg);
    color: var(--danger);
    font-size: 0.95rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: none;
    transition:
        background var(--t-fast) ease,
        border-color var(--t-fast) ease,
        color var(--t-fast) ease,
        transform var(--t-fast) ease,
        box-shadow var(--t-fast) ease;
}

.btn-toast-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--brand-text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-danger);
}

/* ── 17. Notification Modal ──────────────────────────────── */
.notify-modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(12px);
}

.notify-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.notify-modal {
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    padding: var(--space-8);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notify-modal-header { text-align: center; margin-bottom: var(--space-6); }

.notify-modal-icon {
    width: 48px;
    height: 48px;
    background: var(--brand);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 1.2rem;
    color: var(--brand-text);
    box-shadow: none;
}

.notify-modal-title {
    font-family: var(--font-sans);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.notify-modal-desc {
    font-size: 1rem;
    color: var(--ink-2);
    line-height: 1.6;
    text-align: center;
}

.notify-modal-desc strong { color: var(--brand); font-weight: 700; }

.notify-modal-form { margin-bottom: var(--space-6); }

.notify-form-group { margin-bottom: var(--space-5); }

.notify-form-input {
    width: 100%;
    min-height: 56px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    line-height: 1.45;
    transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
    background: var(--bg);
    color: var(--ink);
}

.notify-form-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--brand-focus-glow);
}

.notify-checkbox-group { margin-bottom: var(--space-6); }

.notify-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    cursor: pointer;
    min-height: 36px;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.notify-checkbox-label:hover { background: var(--brand-soft); }

/* 체크박스 표준: 20px · radius 6 · 시안 채움 · 흰 체크 (signin/itinerary 와 동일 스펙) */
.notify-checkbox-label input[type="checkbox"],
.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    margin: 2px 0 0;
    border: 1px solid var(--line-2);
    border-radius: 6px;
    background: var(--bg);
    cursor: pointer;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.notify-checkbox-label input[type="checkbox"]:checked,
.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--brand);
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5.2L4.2 8.4L11 1.2' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    border-color: var(--brand);
    box-shadow: none;
}

.notify-checkbox-label .label-text {
    min-width: 0;
    font-size: 0.95rem;
    color: var(--ink);
    line-height: 1.55;
}

.notify-modal-actions { display: flex; gap: var(--space-3); }

.notify-btn-cancel {
    flex: 1;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.notify-btn-cancel:hover {
    border-color: var(--line-2);
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.notify-btn-submit {
    flex: 1;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--brand-text);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease;
}

.notify-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notify-btn-submit.loading { opacity: 0.7; cursor: not-allowed; }

.notify-form-message {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-align: center;
    margin-top: var(--space-4);
}

.notify-form-message.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.notify-form-message.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger);
}

@media (max-width: 768px) {
    .notify-modal { padding: var(--space-6); }
    .notify-modal-title { font-size: 1.5rem; }
}

/* ── 18. 공통 사이트 푸터 ─────────────────────────────────── */

/* ── 19. 모달 베이스 클래스 ──────────────────────────────── */
/* 페이지별 모달이 이 클래스를 상속받아 일관성 유지 */

/* 오버레이 — 전체 화면 반투명 배경 */
.modal-overlay-base {
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--duration-normal) ease;
    backdrop-filter: blur(12px);
}

.modal-overlay-base.active {
    opacity: 1;
    pointer-events: all;
}

/* 모달 콘텐츠 박스 */
.modal-content-base {
    background: var(--bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    padding: var(--space-8);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn var(--duration-normal) cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (max-width: 768px) {
    .modal-content-base { padding: var(--space-6); }
}

@media (max-width: 480px) {
    .modal-content-base { padding: var(--space-5) var(--space-4); }
}

body :is(.modal, .notify-modal, .psa-modal, .regen-modal, .loading-card, .loading-content, .dest-loading-card, .sort-menu, .tl-time-dropdown, .add-modal-dropdown-menu, .nav-more-menu) {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--surface-radius);
    box-shadow: var(--shadow-lg);
}

body.fp :is(.sort-menu, .tl-time-dropdown, .add-modal-dropdown-menu, .nav-more-menu) {
    border-radius: var(--menu-radius);
    padding: var(--space-2);
    box-shadow: var(--shadow-md);
}

body.fp :is(.sort-option, .tl-time-opt, .add-modal-dropdown-item, .add-modal-dropdown-option, .nav-more-item) {
    min-height: 44px;
    border: 0;
    border-radius: var(--menu-item-radius);
    background: transparent;
    color: var(--ink-2);
}

body.fp :is(.sort-option, .tl-time-opt, .add-modal-dropdown-item, .add-modal-dropdown-option, .nav-more-item):hover {
    background: var(--selection-hover-bg);
    color: var(--selection-active-text);
}

body.fp :is(.sort-option, .tl-time-opt, .add-modal-dropdown-item, .add-modal-dropdown-option, .nav-more-item):is(.active, .selected) {
    background: var(--selection-active-bg);
    color: var(--selection-active-text);
}

body.fp :is(.btn-icon, .btn-circle, .detail-close, .it-dp-close, .it-dp-panel-close, .psa-close, .btn-x) {
    border-radius: var(--icon-radius);
}

body.fp :is(.btn-icon.delete, .trip .btn-icon.delete, .trip-actions .btn-icon.delete):hover {
    border-color: var(--ft-danger-soft);
    color: var(--ft-danger);
    background: var(--ft-surface);
    box-shadow: none;
}

body.fp :is(.tag, .chip, .filt, .mt-chip, .psa-cat, .suggest-chip, .option-pill) {
    border-radius: var(--chip-radius);
}

body.fp :is(.dcard .ph, .trip .ph, .trip-cover) {
    background: var(--media-bg);
}

body :is(.notify-modal-overlay, .modal-overlay, .regen-modal-overlay, .loading-overlay, .dest-loading-overlay) {
    background: var(--overlay-scrim);
    backdrop-filter: blur(12px);
}

body :is(.detail-panel, .checklist-panel, .it-detail-panel) {
    background: var(--bg);
    border-color: var(--line);
    box-shadow: var(--shadow-lg);
}

body :is(.detail-panel, .checklist-panel, .it-detail-panel).open {
    box-shadow: var(--shadow-lg);
}

body :is(.detail-panel-header, .checklist-header, .it-dp-header, .modal-header) {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

body :is(.modal-title, .notify-modal-title, .regen-modal h3, .checklist-title, .detail-name, .it-dp-name) {
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 800;
    letter-spacing: -0.02em;
}

body :is(.modal-desc, .notify-modal-desc, .regen-modal p, .right-copy, .it-dp-desc) {
    color: var(--ink-2);
}

body :is(.detail-close, .it-dp-close, .it-dp-panel-close) {
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--ink);
    box-shadow: none;
}

body :is(.detail-close, .it-dp-close, .it-dp-panel-close):hover {
    border-color: var(--line-2);
    background: var(--bg-soft);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

body :is(.loading-bar, .dest-loading-bar) {
    border-radius: var(--radius-full);
    background: var(--line);
}

body :is(.loading-bar-fill, .dest-loading-bar-fill) {
    border-radius: var(--radius-full);
}

/* v2 product shell from 디자인 방향 v2
 * 색상 토큰(--bg/--ink/--line 등)은 tokens.css :root/[data-theme="dark"]가 단일 소스 — 다크모드 자동 적용
 */
body.fp {
    /* 색상 토큰은 tokens.css :root 에서 이미 동일하게 정의됨 — fp 재-alias 제거(다크모드는 :root 경유로 자동 동작) */
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--bg-soft);
    background-image: none;
    padding-top: 0;
    line-height: 1.5;
}

/* fp 전용 — body :is(...) 공통 규칙에서 다루지 않는 fp 고유 스타일만 */
body.fp .detail-panel,
body.fp .it-detail-panel {
    border-left: 1px solid var(--line);
}

body.fp .checklist-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

body.fp .error-toast {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* 구 로그인 셸(.login-page/.login-shell/.provider-btn/.login-email-*/.login-message) 삭제 —
   login.html·signin.html 이 자체 lg-* 스타일과 페이지 로컬 .login-message 를 사용 (P1 #18) */


/* === 로그인 상태 헤더 FOUC 방지 ===
   <head> 인라인 가드가 캐시(fitrip_authUser)로 html[data-auth]를 '페인트 전'에 설정하고,
   auth.js(renderStandardAccountHeader)가 /me 확인 후 권위 있는 값으로 정정한다.
   로그인 상태에서 첫 페인트부터 로그인 버튼 대신 아바타가 그려져 깜빡임이 없다.
   !important: 헤더 마크업의 인라인 display:none(아바타)·기본 표시(로그인 버튼)를 덮기 위함. */
html[data-auth="in"] .ft-login,
html[data-auth="in"] .ft-cta,
html[data-auth="in"] #itHeaderLogin { display: none !important; }
html[data-auth="in"] #headerAvatar,
html[data-auth="in"] #itHeaderAvatar { display: grid !important; }

/* 헤더 계정 아바타 — 전 페이지 공유. 시안 배경 단일 소스(auth.js 이니셜 span과 동일 페어), hover=scale */
#headerAvatar, #itHeaderAvatar { background: var(--brand-cyan); color: var(--on-brand); transition: transform var(--t-fast) ease; }
#headerAvatar:hover, #itHeaderAvatar:hover { transform: scale(1.07); }

/* === 표준 헤더/푸터 셸 — 내용은 common-chrome.js 가 채우는 단일 소스 ===
   자리표시자(<header id="site-header" class="ft-header">·<footer id="site-footer" class="ft-foot">)에
   높이·배경·테두리를 미리 잡아, JS 로 내용을 채우기 전에도 바(bar)가 자리를 차지해 레이아웃 밀림(CLS)이 없다. */
.ft-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; height: 52px; padding: 0 28px; background: var(--ft-header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--ft-border); }
.ft-foot { margin-top: auto; border-top: 1px solid var(--ft-border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

/* 헤더/푸터 동작·반응형 — 전 페이지 동일(공용 chrome). 렌더 요소엔 inline 스타일이 없어 !important 불필요.
   호버 lift/glow 는 CTA 의 .u-lift 가 담당하므로 .ft-cta 트랜지션은 여기 두지 않는다. */
.ft-nav a { white-space: nowrap; font-size: 14.5px; font-weight: 600; color: var(--ft-ink-2); text-decoration: none; }
.ft-nav a.is-active { font-weight: 700; color: var(--ft-ink); border-bottom: 2px solid var(--brand-cyan); padding-bottom: 2px; }
.ft-login, .ft-cta { white-space: nowrap; }
.ft-nav a:hover { color: var(--ft-ink); }
.ft-login:hover { background: var(--ft-chip); }
.ft-foot a { font-size: 13px; color: var(--ft-ink-2); text-decoration: none; }
.ft-foot a:hover { color: var(--ft-ink); }
/* 푸터: 로고/저작권 span 을 동일 스페이서로 → 가운데 링크 정중앙(데스크탑) */
.ft-foot > span:first-child { flex: 1 1 0; min-width: 0; }
.ft-foot > span:last-child { flex: 1 1 0; min-width: 0; text-align: right; }
@media (max-width: 760px) {
  .ft-header { padding: 0 14px; }
  .ft-header > a:first-child img { height: 25px; }
  .ft-nav { gap: 13px; flex-wrap: nowrap; }
  .ft-nav a { font-size: 12.5px; white-space: nowrap; }
  .ft-cta { display: none; }
  .ft-foot { flex-wrap: nowrap; gap: 8px; padding: 14px 10px; }
  .ft-foot > div { flex-wrap: nowrap; gap: 10px; flex-shrink: 0; }
  .ft-foot a { white-space: nowrap; font-size: 11.5px; }
  .ft-foot > span { white-space: nowrap; font-size: 11px; min-width: 0; overflow: hidden; }
}
@media (max-width: 480px) {
  .ft-foot > div { display: none; }
}

/* ===== 인터랙션 유틸 (.u-*) — hover 단일 소스. 상호작용만 담고 레이아웃/베이스는 요소가 담당 ===== */
.u-lift { transition: transform var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.u-lift:hover:not(:disabled):not(.is-added) { transform: translateY(-2px); box-shadow: var(--brand-cta-glow); }

.u-accent { transition: all var(--t-fast) ease; }
.u-accent:hover { border-color: var(--brand-cyan); color: var(--ft-cyan-text); background: var(--ft-cyan-soft); box-shadow: 0 10px 22px -12px var(--brand-shadow-a45); }

.u-pop { transition: transform var(--t-fast) ease; }
.u-pop:hover { transform: scale(1.07); }

.u-link { transition: color var(--t-fast) ease; }
.u-link:hover { color: var(--brand-cyan-link); }

.u-danger { transition: all var(--t-fast) ease; }
.u-danger:hover:not(:disabled) { border-color: var(--ft-danger-soft); color: var(--ft-danger); background: var(--ft-surface); box-shadow: none; }

.u-danger-mini { transition: color var(--t-fast) ease; }
.u-danger-mini:hover { color: var(--ft-danger); }

.u-danger-solid:hover:not(:disabled) { box-shadow: 0 10px 24px -10px var(--ft-danger); }

.u-card { transition: transform var(--t-card) ease, box-shadow var(--t-card) ease; }
.u-card:hover { transform: translateY(-7px); box-shadow: 0 26px 52px -24px var(--ink-a25); }

.u-card-panel { transition: transform var(--t-card) ease, box-shadow var(--t-card) ease, border-color var(--t-card) ease; }
.u-card-panel:hover { border-color: var(--ft-cyan-border); transform: translateY(-5px); box-shadow: 0 24px 48px -24px var(--brand-shadow-a25); }

.u-row { transition: background var(--t-fast) ease; }
.u-row:hover { background: var(--ft-chip); }

.u-menu { transition: background var(--t-fast) ease, color var(--t-fast) ease; }
.u-menu:hover { background: var(--ft-cyan-soft); color: var(--ft-cyan-text); }

.u-close-overlay { transition: background var(--t-fast) ease; }
.u-close-overlay:hover { background: var(--ink-a80); }
