/* 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;
}

/* ── 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. 로고 — 순수 타이포 ────────────────────────────────── */
.logo {
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--text-1);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    text-transform: lowercase;
}

/* ── 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: 1px solid color-mix(in srgb, var(--brand) 75%, white 25%);
    background: var(--brand);
    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 0.15s ease,
        transform 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.15s ease;
    box-shadow: var(--shadow-brand-sm);
}

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

[data-theme="dark"] .btn-primary {
    color: var(--brand-text);
}

[data-theme="dark"] .btn-primary:hover {
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

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

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

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

.btn-primary.btn-lg:hover {
    transform: translateY(-1px);
}

/* .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: 1px solid transparent;
    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 0.15s ease,
        transform 0.15s cubic-bezier(0.22, 0.61, 0.36, 1),
        box-shadow 0.15s ease;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-danger-md);
    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 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
    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 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-icon:hover {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
}

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

.btn-icon.delete:hover {
    background: var(--danger);
    color: var(--brand-text);
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: var(--shadow-danger);
}

.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 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-circle:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
}

.btn-circle:active {
    transform: translateY(0);
}

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

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

/* ── 11. 필터 버튼 ────────────────────────────────────────── */
.pill {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--bg-surface);
    color: var(--text-2);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    gap: 7px;
    white-space: nowrap;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease,
        box-shadow 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.pill:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
}

.pill.active {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-text);
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
}

.pill.active:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-brand-sm);
}


/* ── 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 0.15s ease,
        box-shadow 0.15s 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(--shadow-brand);
}

.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. 검색 박스 ────────────────────────────────────────── */
.search-box {
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    height: 48px;
    box-sizing: border-box;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

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

.search-box:focus-within {
    border-color: var(--brand);
    box-shadow: var(--shadow-brand);
}

.search-box i {
    color: var(--text-3);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.97rem;
    font-family: inherit;
    color: var(--text-1);
}

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

.btn-clear {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--bg-surface-3);
    color: var(--text-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.78rem;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.btn-clear:hover {
    background: var(--border-strong);
    color: var(--text-1);
}

/* ── 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(--duration-fast) ease,
        box-shadow var(--duration-fast) ease,
        background var(--duration-fast) ease,
        border-color var(--duration-fast) ease,
        color var(--duration-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(-1px); 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: var(--shadow-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(--duration-fast) ease, box-shadow var(--duration-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) {
    .logo {
        font-size: 1.15rem;
    }

    .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-icon:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-brand-sm);
    }

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

    .btn-circle:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-brand-sm);
    }

    .btn-secondary:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-brand-sm);
    }

    .pill {
        padding: 9px 12px;
        font-size: 0.82rem;
    }

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

    .search-box {
        min-width: unset;
        width: 100%;
        height: 44px;
        padding: 8px 12px;
    }

    .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(--duration-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(--duration-fast) ease,
        border-color var(--duration-fast) ease,
        color var(--duration-fast) ease,
        transform var(--duration-fast) ease,
        box-shadow var(--duration-fast) ease;
    box-shadow: none;
    white-space: nowrap;
}

.btn-toast-retry:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    transform: translateY(-1px);
    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(--duration-fast) ease,
        border-color var(--duration-fast) ease,
        color var(--duration-fast) ease,
        transform var(--duration-fast) ease,
        box-shadow var(--duration-fast) ease;
}

.btn-toast-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--brand-text);
    transform: translateY(-1px);
    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-sm);
    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: 400;
    letter-spacing: 0;
    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 0.15s ease, box-shadow 0.15s ease;
    background: var(--bg);
    color: var(--ink);
}

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

.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); }

.notify-checkbox-label input[type="checkbox"],
.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin: 2px 0 0;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.notify-checkbox-label input[type="checkbox"]:checked,
.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--ink);
    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(--ink);
    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 0.15s ease, color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.notify-btn-cancel:hover {
    border-color: var(--line-2);
    color: var(--ink);
    transform: translateY(-1px);
    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 0.15s ease, box-shadow 0.15s ease;
}

.notify-btn-submit:hover {
    transform: translateY(-1px);
    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. 공통 사이트 푸터 ─────────────────────────────────── */
.site-footer {
    height: 52px;
    padding: 0 var(--space-6);
    background: var(--bg);
    border-top: 1px solid var(--line);
    flex-shrink: 0;
    box-shadow: none;
    box-sizing: border-box;
}

.site-footer-content {
    width: min(960px, 100%);
    height: 100%;
    max-width: none;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-5);
    min-width: 0;
}

.site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: lowercase;
}
.site-footer-logo::after { content: ""; }

.site-footer-mark {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-text);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
}

.site-footer-links {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
}

.site-footer-links a {
    font-size: 0.84rem;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}
.site-footer-links a:hover { color: var(--ink); }

.site-footer-note {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0 auto 0 0;
    color: var(--ink-3);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .site-footer { height: 52px; padding: 0 var(--space-5); flex-shrink: 0; }
    .site-footer-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 0;
        flex-wrap: nowrap;
    }
    .site-footer-links { gap: 16px; }
}

@media (max-width: 480px) {
    .site-footer { height: 52px; padding: 0 var(--space-4); flex-shrink: 0; }
    .site-footer-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 0;
    }
    .site-footer-note { display: none; }
    .site-footer-links { gap: 14px; }
    .site-footer-links a { font-size: 0.85rem; }
}

/* ── 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 {
    background: var(--danger);
    color: var(--brand-text);
    border-color: var(--danger);
}

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 .serif {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.fp .mono {
    font-family: var(--font-mono);
}

.fp .topbar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    height: var(--navbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
}

.fp .topbar .left,
.fp .topbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.fp .topbar .logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 0.96rem;
    letter-spacing: 0;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.fp .topbar .logo .mark {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    display: grid;
    place-items: center;
    color: var(--brand-text);
    font-size: 0.8rem;
}

body.fp .site-footer {
    margin-top: auto;
    height: 52px;
    padding: 0 var(--space-6);
    background: var(--bg);
    border-top: 1px solid var(--line);
    box-shadow: none;
    box-sizing: border-box;
}

body.fp .site-footer-content {
    width: min(960px, 100%);
    max-width: none;
    height: 100%;
    margin-bottom: 0;
}

body.fp .site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: lowercase;
}

body.fp .site-footer-logo::after {
    content: "";
}

body.fp .site-footer-mark {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--brand-text);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
}

body.fp .site-footer-links {
    gap: 18px;
}

body.fp .site-footer-links a {
    color: var(--ink-2);
    font-size: 0.84rem;
}

body.fp .site-footer-links a:hover {
    color: var(--ink);
}

/* 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);
}

.fp .topbar nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.fp .topbar nav a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 0 1px;
    border-radius: 0;
    font-size: 0.82rem;
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: box-shadow 0.15s ease, color 0.15s ease;
}

.fp .topbar nav a.active {
    color: var(--ink);
    box-shadow: inset 0 -2px 0 var(--brand);
}

.fp .topbar .right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fp .btn-ghost,
.fp .btn-primary,
.fp .btn-brand {
    height: var(--button-h);
    min-height: var(--button-h);
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0 var(--space-5);
    box-sizing: border-box;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: var(--radius-full);
    text-decoration: none;
    box-shadow: none;
    transform: none;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
}

.fp .topbar .right :is(.btn-ghost, .btn-primary, .btn-brand) {
    min-width: 0;
    height: var(--topbar-action-h);
    min-height: var(--topbar-action-h);
    padding: 0 var(--space-4);
    font-size: 0.86rem;
    justify-content: center;
}

.fp .topbar .right .btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-2);
    padding: 0 var(--space-3);
}

.fp .topbar .right .btn-ghost:hover {
    background: var(--selection-hover-bg);
    border-color: transparent;
    color: var(--selection-active-text);
    box-shadow: none;
}

.fp .btn-ghost {
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 600;
}

/* .fp 페이지 컨텍스트: editorial/brutalist 톤에서 CTA를 잉크(검정) 배경으로 표현.
   글로벌 .btn-primary(시안 배경)를 의도적으로 오버라이드. 시안 CTA는 .fp .btn-brand 사용. */
.fp .btn-primary {
    background: var(--ink);
    color: var(--brand-text);
    border: 1px solid var(--ink);
    font-weight: 700;
}

.fp .btn-brand {
    background: var(--brand);
    color: var(--brand-text);
    border: none;
    font-weight: 700;
}

.fp .btn-ghost:hover,
.fp .btn-primary:hover,
.fp .btn-brand:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.fp .btn-ghost:hover {
    background: var(--selection-hover-bg);
    border-color: var(--selection-active-border);
    color: var(--selection-active-text);
}

.fp .btn-primary:hover {
    color: var(--brand-text);
    box-shadow: var(--shadow-md);
}

.fp .btn-brand:hover {
    color: var(--brand-text);
}

.auth-header {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.auth-login-btn i {
    width: 1rem;
    text-align: center;
}

.auth-menu {
    position: relative;
}

.auth-avatar-btn {
    height: var(--topbar-action-h);
    min-height: var(--topbar-action-h);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3) 0 var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease;
}

.auth-avatar-btn:hover,
.auth-avatar-btn:focus-visible {
    border-color: var(--selection-active-border);
    background: var(--selection-hover-bg);
    color: var(--selection-active-text);
    outline: none;
}

.auth-avatar-btn:focus-visible,
.provider-btn:focus-visible,
.login-email-control:focus-visible {
    box-shadow: var(--focus-ring);
}

.auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--brand);
    color: var(--brand-text);
    font-size: 0.78rem;
    font-weight: 800;
}

.auth-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-name {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-menu-popover {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: 184px;
    display: none;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--menu-radius);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    z-index: 120;
}

.auth-menu-popover.open {
    display: flex;
}

.auth-menu-popover :is(a, button) {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--menu-item-radius);
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 650;
    text-align: left;
}

.auth-menu-popover :is(a, button):hover,
.auth-menu-popover :is(a, button):focus-visible {
    background: var(--selection-hover-bg);
    color: var(--selection-active-text);
    outline: none;
}

.login-page {
    flex: 1 0 auto;
    display: grid;
    align-items: center;
    padding: var(--space-10) var(--space-5) 88px;
    background: var(--bg-soft);
}

.login-shell {
    width: min(960px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.8fr);
    gap: var(--space-8);
    align-items: center;
}

.login-copy {
    min-width: 0;
}

.login-eyebrow {
    margin: 0 0 var(--space-2);
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-copy h1 {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(2.7rem, 6vw, 4.2rem);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: var(--letter-spacing-heading);
}

.login-copy p:not(.login-eyebrow) {
    max-width: 30rem;
    margin: var(--space-4) 0 0;
    color: var(--ink-2);
    font-size: 1rem;
    line-height: 1.75;
}

.login-panel {
    min-width: 0;
    padding: var(--space-8);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: var(--shadow-md);
}

.login-provider-stack {
    display: grid;
    gap: var(--space-3);
}

.provider-btn {
    min-height: 44px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 14px;
    cursor: pointer;
    transition: filter var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.provider-btn:hover {
    filter: brightness(0.97);
}

.provider-btn:disabled,
.login-email-form button:disabled {
    cursor: wait;
    opacity: 0.62;
}

.provider-icon {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.google-g-mark svg {
    width: 18px;
    height: 18px;
    display: block;
}

.provider-btn-google {
    border: 1px solid #747775;
    border-radius: 4px;
    background: #ffffff;
    color: #1f1f1f;
    font-family: Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.provider-btn-apple {
    border: 1px solid #000000;
    border-radius: 6px;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.provider-btn-apple i {
    width: 18px;
    font-size: 1.08rem;
    line-height: 1;
}

.login-separator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    color: var(--ink-3);
    font-size: 0.8rem;
    font-weight: 700;
}

.login-separator::before,
.login-separator::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.login-email-form {
    display: grid;
    gap: var(--space-2);
}

.login-email-form label {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 750;
}

.login-email-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-2);
}

.login-email-control {
    min-width: 0;
    height: var(--control-h);
    padding: 0 var(--space-4);
    border: 1px solid var(--line);
    border-radius: var(--field-radius);
    background: var(--bg-tint);
    color: var(--ink);
    font: inherit;
}

.login-email-control:focus-visible {
    border-color: var(--brand);
    outline: none;
}

.login-message {
    min-height: 1.35rem;
    margin: var(--space-4) 0 0;
    color: var(--ink-3);
    font-size: 0.86rem;
}

.login-message[data-type="success"] {
    color: var(--success);
}

.login-message[data-type="error"] {
    color: var(--danger);
}

.login-message[data-type="warning"] {
    color: var(--warning);
}

@media (max-width: 720px) {
    .fp .topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .fp .topbar nav {
        display: none;
    }

    .fp .topbar .right {
        gap: 6px;
    }

    .fp .topbar .right :is(.btn-ghost, .btn-primary, .btn-brand) {
        min-width: 0;
        height: var(--topbar-action-h);
        min-height: var(--topbar-action-h);
        padding: 0 var(--space-4);
        font-size: 0.8rem;
    }

    .auth-name,
    .auth-login-btn span {
        display: none;
    }

    .login-page {
        padding: var(--space-8) var(--space-4) 76px;
        align-items: start;
    }

    .login-shell {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .login-panel {
        padding: var(--space-6);
    }

    .login-email-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .fp .topbar {
        padding: 0 10px;
    }

    .fp .topbar .right :is(.btn-ghost, .btn-primary, .btn-brand) {
        padding: 0 var(--space-3);
        font-size: 0.78rem;
    }

    .login-page {
        padding-inline: var(--space-3);
    }

    .login-panel {
        padding: var(--space-5);
    }
}

@media (prefers-reduced-motion: reduce) {
    .provider-btn,
    .auth-avatar-btn {
        transition: none;
    }
}
