/* ==========================================================
   AI 메일 비서 - 디자인 시스템
   밝은 파스텔 톤 · Pretendard · 기본보다 약간 작은 글씨
   ========================================================== */
:root {
    --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
    --bg: #f7f6fc;
    --surface: #ffffff;
    --surface-2: #fbfaff;
    --line: #ebe8f5;
    --line-2: #f1eff8;
    --text: #2b2a3a;
    --muted: #8a87a0;
    --primary: #7c6cf0;
    --primary-600: #6b5ae6;
    --primary-50: #f1eeff;
    --primary-100: #e4deff;
    --mint: #3fbf9b;
    --mint-50: #e3f7f0;
    --peach: #f29a6b;
    --peach-50: #fff0e6;
    --pink: #e66fa0;
    --pink-50: #fdebf3;
    --sky: #4c9be8;
    --sky-50: #e7f2fd;
    --yellow: #e9b53c;
    --yellow-50: #fdf6df;
    --danger: #e0605a;
    --danger-50: #fdeceb;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(60, 50, 120, .04), 0 2px 8px rgba(60, 50, 120, .04);
    --shadow: 0 4px 24px rgba(80, 64, 160, .08);
    --shadow-lg: 0 18px 50px rgba(80, 64, 160, .14);
    --ease: cubic-bezier(.22, .8, .3, 1);
    --sidebar-w: 248px;

    --bs-body-font-family: var(--font);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-primary: var(--primary);
    --bs-primary-rgb: 124, 108, 240;
    --bs-border-color: var(--line);
    --bs-link-color: var(--primary-600);
    --bs-link-color-rgb: 107, 90, 230;
    --bs-link-hover-color: #5546c9;
}

html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
::selection { background: var(--primary-100); }
a { text-decoration: none; }
.min-w-0 { min-width: 0; }
.text-muted { color: var(--muted) !important; }
.small, small { font-size: .857rem; }
.fs-xs { font-size: .786rem; }
h1, h2, h3, h4, h5 { font-weight: 700; letter-spacing: -0.025em; }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: #d9d4ee transparent; }

/* ---------- 배경 블롭 ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span {
    position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
    animation: blob 22s ease-in-out infinite alternate;
}
.bg-blobs span:nth-child(1) { width: 480px; height: 480px; background: #e6defd; top: -120px; left: -100px; }
.bg-blobs span:nth-child(2) { width: 420px; height: 420px; background: #d6f5ea; top: 30%; right: -140px; animation-delay: -6s; }
.bg-blobs span:nth-child(3) { width: 380px; height: 380px; background: #ffe6d6; bottom: -140px; left: 30%; animation-delay: -12s; }
.bg-blobs.soft span { opacity: .35; }
@keyframes blob {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.08); }
    100% { transform: translate(-30px, 30px) scale(.95); }
}

/* ---------- 버튼 ---------- */
.btn { font-weight: 600; border-radius: 10px; font-size: .929rem; padding: .5rem 1rem; transition: all .2s var(--ease); }
.btn-sm { font-size: .857rem; padding: .35rem .75rem; border-radius: 9px; }
.btn-lg { font-size: 1rem; padding: .75rem 1.4rem; border-radius: 12px; }
.btn-primary {
    --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-600); --bs-btn-hover-border-color: var(--primary-600);
    --bs-btn-active-bg: #5d4cdb; --bs-btn-active-border-color: #5d4cdb;
    --bs-btn-disabled-bg: #b9b0f6; --bs-btn-disabled-border-color: #b9b0f6;
    box-shadow: 0 4px 14px rgba(124, 108, 240, .28);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(124, 108, 240, .32); }
.btn-light { --bs-btn-bg: #f3f1fa; --bs-btn-border-color: #f3f1fa; --bs-btn-hover-bg: #e9e6f5; --bs-btn-hover-border-color: #e9e6f5; color: var(--text); }
.btn-soft { background: var(--primary-50); color: var(--primary-600); border: 0; }
.btn-soft:hover { background: var(--primary-100); color: #5546c9; }
.btn-soft-danger { background: var(--danger-50); color: var(--danger); border: 0; }
.btn-soft-danger:hover { background: #fbdcda; color: #c94c46; }
.btn-soft-mint { background: var(--mint-50); color: #239a78; border: 0; }
.btn-soft-mint:hover { background: #cff1e5; color: #1d8467; }
.btn-outline-secondary { --bs-btn-color: #6b6880; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #f5f3fb; --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--line); }
.btn-ai {
    background: linear-gradient(135deg, #8f7cf6, #e88bb6); color: #fff; border: 0;
    box-shadow: 0 4px 14px rgba(200, 120, 200, .3);
}
.btn-ai:hover { color: #fff; filter: brightness(1.05); transform: translateY(-1px); }
.btn-icon {
    width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; color: #6b6880; background: transparent; border: 0;
}
.btn-icon:hover { background: #f1eff8; color: var(--text); }
.btn .spinner-border { width: 1em; height: 1em; border-width: .15em; }

/* ---------- 폼 ---------- */
.form-control, .form-select {
    border-radius: 10px; border-color: var(--line); font-size: .929rem; padding: .55rem .8rem; background-color: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus { border-color: #b8adf7; box-shadow: 0 0 0 4px rgba(124, 108, 240, .12); }
.form-label { font-weight: 600; font-size: .857rem; color: #4a4860; margin-bottom: .35rem; }
.form-text { font-size: .8rem; color: var(--muted); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(124, 108, 240, .15); border-color: #b8adf7; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
/* 상호작용 이후에만 유효성 표시 (:user-invalid) */
.form-control:user-invalid { border-color: #f0a19c; background-color: #fff8f7; }
.form-control:user-valid:not(:placeholder-shown) { border-color: #a9e2cf; }
.field-error { display: none; color: var(--danger); font-size: .8rem; margin-top: .3rem; }
.form-control:user-invalid ~ .field-error, .field-error.show { display: block; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #aaa6c0; pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); }

/* ---------- 카드 ---------- */
.card-x {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card-x.hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-x .card-h { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.15rem .4rem; gap: .5rem; }
.card-x .card-h h2, .card-x .card-h h3 { font-size: 1rem; margin: 0; display: flex; align-items: center; gap: .45rem; }
.card-x .card-b { padding: .8rem 1.15rem 1.15rem; }
.card-x .card-h h2 i, .card-x .card-h h3 i { color: var(--primary); }

.section-title { font-size: 1.43rem; margin-bottom: .2rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.narrow { max-width: 920px; }
.page-head h1 { font-size: 1.43rem; margin: 0; }
.page-head p { margin: .25rem 0 0; color: var(--muted); font-size: .929rem; }

/* ---------- 브랜드 ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.07rem; color: var(--text); letter-spacing: -0.03em; }
.brand img { border-radius: 9px; }
.brand:hover { color: var(--text); }

/* ==========================================================
   게스트 (랜딩 / 인증)
   ========================================================== */
.guest-nav { position: sticky; top: 0; z-index: 50; padding: .85rem 0; transition: background .3s, box-shadow .3s; }
.guest-nav.scrolled { background: rgba(255, 255, 255, .78); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }
.guest-main { min-height: calc(100vh - 220px); }

.hero { padding: 4.5rem 0 3.5rem; text-align: center; position: relative; }
.hero .eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 999px;
    background: rgba(255, 255, 255, .8); border: 1px solid var(--primary-100); color: var(--primary-600); font-weight: 600; font-size: .857rem;
    box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 800; line-height: 1.22; margin: 1.2rem 0 1rem; letter-spacing: -0.04em; }
.grad-text { background: linear-gradient(120deg, #7c6cf0 10%, #e47fae 55%, #f29a6b 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.07rem; color: #6d6a85; max-width: 620px; margin: 0 auto 2rem; line-height: 1.75; }
.hero-cta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

.hero-mock {
    max-width: 900px; margin: 3.2rem auto 0; background: rgba(255, 255, 255, .85); border: 1px solid #fff;
    border-radius: 22px; box-shadow: var(--shadow-lg); padding: 1.1rem; text-align: left;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.mock-bar { display: flex; gap: 6px; padding: 0 .3rem .8rem; }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #f3c3c0; }
.mock-bar i:nth-child(2) { background: #f5dfa5; } .mock-bar i:nth-child(3) { background: #bfe8d6; }
.mock-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: .9rem; }
.mock-mail { display: flex; gap: .75rem; padding: .8rem; border-radius: 14px; background: #fff; border: 1px solid var(--line-2); margin-bottom: .55rem; animation: floatIn .8s var(--ease) both; }
.mock-mail:nth-child(2) { animation-delay: .15s; } .mock-mail:nth-child(3) { animation-delay: .3s; }
.mock-brief { background: linear-gradient(160deg, #f4f0ff, #fff3ec); border-radius: 16px; padding: 1rem 1.1rem; font-size: .9rem; }
.mock-brief h4 { font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.typing::after { content: '▍'; animation: blink 1s steps(1) infinite; color: var(--primary); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes floatIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.logos { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2.6rem; }
.logos .provider-chip { display: inline-flex; align-items: center; gap: .45rem; background: #fff; border: 1px solid var(--line-2); padding: .4rem .85rem .4rem .45rem; border-radius: 999px; font-weight: 600; font-size: .857rem; box-shadow: var(--shadow-sm); }

.section { padding: 4.5rem 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.6rem; }
.section-head .kicker { color: var(--primary-600); font-weight: 700; font-size: .857rem; letter-spacing: .04em; }
.section-head h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; margin: .5rem 0 .7rem; }
.section-head p { color: var(--muted); }

.feature { height: 100%; padding: 1.5rem; }
.feature .f-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 1rem; transition: transform .35s var(--ease); }
.feature:hover .f-icon { transform: rotate(-8deg) scale(1.08); }
.feature h3 { font-size: 1.07rem; margin-bottom: .45rem; }
.feature p { color: var(--muted); margin: 0; font-size: .929rem; line-height: 1.65; }
.tone-1 { background: var(--primary-50); color: var(--primary); }
.tone-2 { background: var(--mint-50); color: var(--mint); }
.tone-3 { background: var(--peach-50); color: var(--peach); }
.tone-4 { background: var(--pink-50); color: var(--pink); }
.tone-5 { background: var(--sky-50); color: var(--sky); }
.tone-6 { background: var(--yellow-50); color: var(--yellow); }

.steps { counter-reset: s; }
.step { position: relative; padding: 1.4rem 1.4rem 1.4rem 4.2rem; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 1.3rem; top: 1.35rem; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, #9d8df7, #e58bb5); }
.step h3 { font-size: 1rem; margin-bottom: .3rem; }
.step p { margin: 0; color: var(--muted); font-size: .929rem; }

.cta-band { border-radius: 26px; padding: 3rem 1.5rem; text-align: center; background: linear-gradient(135deg, #efeaff 0%, #fdeef5 50%, #fff2e8 100%); border: 1px solid #fff; box-shadow: var(--shadow); }
.cta-band h2 { font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.9rem); }

.faq .accordion-item { border: 1px solid var(--line-2); border-radius: 14px !important; margin-bottom: .6rem; overflow: hidden; }
.faq .accordion-button { font-weight: 600; font-size: .95rem; }
.faq .accordion-button:not(.collapsed) { background: var(--primary-50); color: var(--primary-600); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: none; }

.site-footer { padding: 2.2rem 0 2.4rem; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .6); margin-top: 2rem; font-size: .857rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-links a { color: #6d6a85; }
.footer-links a:hover { color: var(--primary-600); }
.copyright { color: var(--muted); margin: 1rem 0 0; text-align: center; }
.recaptcha-note { color: #aaa6c0; font-size: .75rem; text-align: center; margin: .4rem 0 0; }
.recaptcha-note a { color: #9a96b5; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden !important; }

/* 인증 카드 */
.auth-wrap { min-height: calc(100vh - 230px); display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 410px; padding: 2.1rem 1.9rem; border-radius: 22px; background: rgba(255, 255, 255, .92); border: 1px solid #fff; box-shadow: var(--shadow-lg); backdrop-filter: blur(12px); animation: floatIn .6s var(--ease) both; }
.auth-card .auth-logo { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 1rem; box-shadow: 0 8px 22px rgba(124, 108, 240, .25); }
.auth-card h1 { font-size: 1.43rem; font-weight: 800; }
.auth-card .sub { color: var(--muted); font-size: .929rem; margin-bottom: 1.6rem; }
.auth-foot { text-align: center; font-size: .893rem; color: var(--muted); margin-top: 1.4rem; }

/* 법률 문서 */
.legal { max-width: 820px; margin: 2.5rem auto; padding: 2.2rem; }
.legal h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }
.legal h2 { font-size: 1.07rem; margin: 1.6rem 0 .6rem; }
.legal p, .legal li { color: #55526b; line-height: 1.8; font-size: .929rem; }

/* ==========================================================
   앱 레이아웃
   ========================================================== */
.app-body { background: var(--bg); }
.sidebar { width: var(--sidebar-w); }
@media (min-width: 992px) {
    .sidebar { position: fixed !important; inset: 0 auto 0 0; z-index: 30; visibility: visible !important; transform: none !important; background: rgba(255, 255, 255, .78) !important; border-right: 1px solid var(--line) !important; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
    .app-wrap { margin-left: var(--sidebar-w); }
}
.sidebar-inner { height: 100%; display: flex; flex-direction: column; padding: 1.2rem .9rem 1rem; overflow-y: auto; }
.sidebar-close { position: absolute; top: 1.3rem; right: 1rem; }
.side-nav { flex: 1; }
.side-label { font-size: .75rem; font-weight: 700; color: #b0acc6; padding: 1rem .75rem .4rem; letter-spacing: .03em; }
.side-link {
    display: flex; align-items: center; gap: .7rem; padding: .62rem .8rem; border-radius: 11px; color: #5a5770;
    font-weight: 600; font-size: .929rem; margin-bottom: 2px; position: relative; transition: background .2s, color .2s, transform .2s var(--ease);
}
.side-link i { font-size: 1.1rem; width: 20px; text-align: center; color: #a19dba; transition: color .2s; }
.side-link:hover { background: #f4f2fb; color: var(--text); transform: translateX(2px); }
.side-link.active { background: linear-gradient(135deg, var(--primary-50), #fbefff); color: var(--primary-600); }
.side-link.active i { color: var(--primary); }
.side-link.active::before { content: ''; position: absolute; left: -.9rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.side-badge { margin-left: auto; font-style: normal; font-size: .75rem; background: var(--primary); color: #fff; border-radius: 999px; padding: .05rem .5rem; font-weight: 700; }
.side-foot { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .8rem; }
.side-user { display: flex; align-items: center; gap: .6rem; padding: .3rem; }
.ai-working { display: flex; align-items: center; gap: .55rem; font-size: .8rem; color: var(--primary-600); background: var(--primary-50); border-radius: 10px; padding: .55rem .75rem; margin-bottom: .7rem; font-weight: 600; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(124, 108, 240, .6); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(124, 108, 240, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 108, 240, 0); } }

.avatar { width: 36px; height: 36px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 700; color: #4b4566; flex: none; font-size: .95rem; }
.avatar.sm { width: 30px; height: 30px; border-radius: 10px; font-size: .85rem; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 1.3rem; }

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .7rem 1.5rem;
    background: rgba(247, 246, 252, .82); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.top-search { position: relative; flex: 1; max-width: 460px; }
.top-search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: #aaa6c0; }
.top-search .form-control { padding-left: 2.4rem; border-radius: 12px; background: #fff; border-color: var(--line-2); }

.app-main { padding: 1.4rem 1.5rem 2rem; max-width: 1360px; }
.app-footer { padding: 1rem 1.5rem 1.6rem; color: #b0acc6; font-size: .8rem; }
.app-footer a { color: #9c98b6; }
.page-enter { animation: pageIn .45s var(--ease) backwards; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding: .35rem .3rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: .72rem; color: #9c98b6; font-weight: 600; position: relative; padding: .25rem 0; }
.bottom-nav a i { font-size: 1.2rem; transition: transform .2s var(--ease); }
.bottom-nav a.active { color: var(--primary-600); }
.bottom-nav a.active i { transform: translateY(-2px); }
.bottom-nav a em { position: absolute; top: 0; left: calc(50% + 6px); font-style: normal; background: var(--pink); color: #fff; font-size: .65rem; border-radius: 999px; padding: 0 .35rem; line-height: 1.35; }
.bottom-nav a.center i { background: linear-gradient(135deg, #8f7cf6, #e88bb6); color: #fff; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; margin-top: -14px; box-shadow: 0 6px 16px rgba(170, 110, 220, .35); }

@media (max-width: 991.98px) {
    .app-main { padding: 1rem 1rem 6rem; }
    .topbar { padding: .6rem 1rem; }
    .app-footer { padding-bottom: 6rem; }
    .sidebar { background: #fff; }
}

/* ---------- 통계 카드 ---------- */
.stat { padding: 1.05rem 1.15rem; display: flex; align-items: center; gap: .9rem; height: 100%; }
.stat .s-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; flex: none; }
.stat .s-num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.stat .s-label { color: var(--muted); font-size: .82rem; font-weight: 600; }
a.stat-link { color: inherit; display: block; height: 100%; }

/* ---------- 배지 ---------- */
.cat-badge { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: 7px; font-size: .75rem; font-weight: 600; color: var(--cc); background: var(--cb); white-space: nowrap; }
.provider-badge { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; font-weight: 800; font-size: .8rem; color: var(--pc); background: var(--pb); flex: none; }
.provider-badge.lg { width: 40px; height: 40px; border-radius: 12px; font-size: 1.05rem; }
.provider-badge.sm { width: 20px; height: 20px; border-radius: 6px; font-size: .68rem; }
.imp { display: inline-flex; gap: 1px; color: #e6b84a; font-size: .7rem; }
.imp .off { color: #e5e2ef; }
.pill { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; }
.pill-action { background: var(--peach-50); color: #d97a45; }
.pill-spam { background: var(--danger-50); color: var(--danger); }
.pill-pending { background: var(--primary-50); color: var(--primary-600); }
.pill-ok { background: var(--mint-50); color: #239a78; }
.pill-muted { background: #f1f0f6; color: #8a87a0; }

/* ---------- 메일 목록 ---------- */
.mail-filters { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; scrollbar-width: none; }
.mail-filters::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); color: #5a5770; font-weight: 600; font-size: .857rem; white-space: nowrap; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--primary-100); color: var(--primary-600); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(124, 108, 240, .25); }
.chip .cnt { font-size: .75rem; opacity: .75; }

.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-item {
    display: flex; gap: .85rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line-2); position: relative;
    transition: background .2s; animation: rowIn .35s var(--ease) both;
}
.mail-item:last-child { border-bottom: 0; }
.mail-item:hover { background: #fbfaff; }
.mail-item.unread { background: linear-gradient(90deg, rgba(241, 238, 255, .7), transparent 60%); }
.mail-item.unread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.mail-item .m-check { padding-top: .45rem; }
.mail-item .m-body { flex: 1; min-width: 0; }
.mail-item .m-top { display: flex; align-items: center; gap: .45rem; }
.mail-item .m-from { font-weight: 600; font-size: .929rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-item.unread .m-from, .mail-item.unread .m-subject { font-weight: 800; }
.mail-item .m-date { margin-left: auto; font-size: .786rem; color: var(--muted); white-space: nowrap; }
.mail-item .m-subject { font-size: .929rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: .15rem 0; font-weight: 500; }
.mail-item .m-summary { font-size: .857rem; color: #78758f; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; }
.mail-item .m-summary .ai-tag { color: var(--primary); font-weight: 700; margin-right: .2rem; }
.mail-item .m-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; align-items: center; }
.mail-item a.stretched { position: absolute; inset: 0; z-index: 1; }
.mail-item .m-check, .mail-item .m-star { position: relative; z-index: 2; }
.m-star { background: none; border: 0; color: #d6d3e3; padding: 0; font-size: 1rem; line-height: 1; transition: transform .2s var(--ease), color .2s; }
.m-star.on { color: #f0b93a; }
.m-star:hover { transform: scale(1.2); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.mail-item:nth-child(2) { animation-delay: .02s; } .mail-item:nth-child(3) { animation-delay: .04s; } .mail-item:nth-child(4) { animation-delay: .06s; }
.mail-item:nth-child(5) { animation-delay: .08s; } .mail-item:nth-child(6) { animation-delay: .1s; } .mail-item:nth-child(n+7) { animation-delay: .12s; }

.bulk-bar { display: none; align-items: center; gap: .4rem; padding: .6rem 1.1rem; background: var(--primary-50); border-bottom: 1px solid var(--primary-100); flex-wrap: wrap; }
.bulk-bar.show { display: flex; animation: floatIn .25s var(--ease); }

.cat-side a { display: flex; align-items: center; gap: .55rem; padding: .48rem .65rem; border-radius: 10px; color: #5a5770; font-size: .893rem; font-weight: 500; }
.cat-side a:hover { background: #f4f2fb; }
.cat-side a.active { background: var(--primary-50); color: var(--primary-600); font-weight: 700; }
.cat-side a .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .85rem; }
.cat-side a .n { margin-left: auto; font-size: .786rem; color: var(--muted); }

/* ---------- 메일 상세 ---------- */
.mail-head h1 { font-size: 1.36rem; line-height: 1.4; margin: .4rem 0 1rem; }
.mail-from { display: flex; align-items: center; gap: .75rem; }
.ai-panel { background: linear-gradient(160deg, #f6f3ff 0%, #fff6f1 100%); border: 1px solid #efe9ff; border-radius: var(--radius); padding: 1.1rem 1.2rem; position: relative; overflow: hidden; }
.ai-panel::after { content: ''; position: absolute; width: 160px; height: 160px; right: -50px; top: -60px; background: radial-gradient(circle, rgba(232, 139, 182, .22), transparent 70%); }
.ai-panel h2 { font-size: .95rem; display: flex; align-items: center; gap: .4rem; color: var(--primary-600); margin-bottom: .6rem; }
.ai-panel .summary { font-size: .95rem; line-height: 1.75; color: #3d3a52; }
.mail-body-text { white-space: pre-wrap; font-size: .95rem; line-height: 1.8; color: #3d3a52; }
.mail-frame { width: 100%; border: 0; min-height: 300px; display: block; }
.attach { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border-radius: 10px; background: #f6f5fb; font-size: .857rem; margin: 0 .35rem .35rem 0; }
.ai-tools .btn { font-size: .857rem; }
.ai-output { background: #fff; border: 1px dashed #d9d2fb; border-radius: 12px; padding: 1rem; font-size: .929rem; line-height: 1.75; white-space: pre-wrap; position: relative; }
.ai-output .copy-btn { position: absolute; top: .5rem; right: .5rem; }

/* AI 로딩 */
.ai-loading { display: flex; align-items: center; gap: .6rem; color: var(--primary-600); font-weight: 600; font-size: .893rem; padding: .6rem 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: bounce 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; background: #b28cf0; } .dots i:nth-child(3) { animation-delay: .3s; background: #e88bb6; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.skeleton { background: linear-gradient(90deg, #f1eff8 25%, #f8f7fc 50%, #f1eff8 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; height: 12px; margin-bottom: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- 마크다운 (AI 응답) ---------- */
.md { font-size: .929rem; line-height: 1.75; }
.md h2, .md h3, .md h4 { font-size: 1rem; margin: 1rem 0 .4rem; color: #4a3fb0; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 1.2rem; margin-bottom: .6rem; }
.md li { margin-bottom: .2rem; }
.md p { margin-bottom: .6rem; }
.md p:last-child { margin-bottom: 0; }
.md code { background: #f3f1fa; padding: .1rem .35rem; border-radius: 5px; color: #6b5ae6; }
.md a.mail-ref { display: inline-flex; align-items: center; gap: 2px; background: var(--primary-50); color: var(--primary-600); padding: 0 .4rem; border-radius: 6px; font-size: .8rem; font-weight: 700; }

/* ---------- AI 채팅 ---------- */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 480px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 1.2rem; }
.msg { display: flex; gap: .65rem; margin-bottom: 1.1rem; animation: floatIn .35s var(--ease) both; }
.msg .bubble { max-width: min(720px, 86%); padding: .8rem 1rem; border-radius: 16px; font-size: .929rem; line-height: 1.7; }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--line-2); border-bottom-left-radius: 5px; box-shadow: var(--shadow-sm); }
.msg .bot { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, #a597f8, #ef9cc2); color: #fff; display: grid; place-items: center; flex: none; }
.chat-input { border-top: 1px solid var(--line-2); padding: .8rem; display: flex; gap: .5rem; align-items: flex-end; background: #fff; border-radius: 0 0 var(--radius) var(--radius); }
.chat-input textarea { resize: none; max-height: 140px; border-radius: 12px; }
.suggest { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; }
.suggest button { border: 1px solid var(--primary-100); background: #fff; color: var(--primary-600); border-radius: 999px; padding: .45rem .9rem; font-size: .857rem; font-weight: 600; transition: all .2s var(--ease); }
.suggest button:hover { background: var(--primary-50); transform: translateY(-1px); }

/* ---------- 할 일 ---------- */
.task { display: flex; align-items: flex-start; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); transition: background .2s, opacity .3s; }
.task:last-child { border-bottom: 0; }
.task:hover { background: #fbfaff; }
.task .t-check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #cfc9e8; background: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; color: #fff; transition: all .2s var(--ease); cursor: pointer; padding: 0; }
.task .t-check:hover { border-color: var(--primary); }
.task.done .t-check { background: var(--mint); border-color: var(--mint); }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.task .t-title { font-weight: 600; font-size: .929rem; }
.task .t-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .2rem; }
.task .t-del { opacity: 0; transition: opacity .2s; }
.task:hover .t-del { opacity: 1; }
@media (hover: none) { .task .t-del { opacity: 1; } }
.group-title { font-size: .82rem; font-weight: 700; color: #8a87a0; padding: .9rem 1rem .4rem; display: flex; align-items: center; gap: .4rem; }
.group-title.overdue { color: var(--danger); }
.prio-1 { color: var(--danger); } .prio-2 { color: var(--yellow); } .prio-3 { color: #a5a2b8; }

/* ---------- 계정 ---------- */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.provider-opt { position: relative; }
.provider-opt input { position: absolute; opacity: 0; }
.provider-opt label { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .95rem .5rem; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: .857rem; transition: all .2s var(--ease); }
.provider-opt label:hover { border-color: var(--primary-100); transform: translateY(-2px); }
.provider-opt input:checked + label { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 6px 16px rgba(124, 108, 240, .16); }
.provider-opt input:focus-visible + label { outline: 3px solid var(--primary-100); }
.guide-box { background: #faf9ff; border: 1px solid var(--line-2); border-radius: 12px; padding: .9rem 1rem; font-size: .857rem; }
.guide-box ol { margin: 0; padding-left: 1.1rem; }
.guide-box li { margin-bottom: .25rem; color: #5a5770; }
.mode-opt label { display: block; padding: .9rem 1rem; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; transition: all .2s; height: 100%; }
.mode-opt input { position: absolute; opacity: 0; }
.mode-opt input:checked + label { border-color: var(--primary); background: var(--primary-50); }
.acc-card { padding: 1.1rem; }
.acc-card .acc-head { display: flex; align-items: center; gap: .75rem; }
.acc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
.acc-meta div { background: #faf9fe; border-radius: 10px; padding: .55rem .65rem; }
.acc-meta b { display: block; font-size: 1rem; }
.acc-meta span { font-size: .75rem; color: var(--muted); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .e-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.9rem; background: var(--primary-50); color: var(--primary); animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px); } }

/* ---------- 테이블 ---------- */
.table-x { margin: 0; font-size: .893rem; }
.table-x th { font-weight: 700; color: #8a87a0; font-size: .8rem; background: #faf9fe; border-bottom: 1px solid var(--line) !important; white-space: nowrap; padding: .7rem .9rem; }
.table-x td { padding: .75rem .9rem; vertical-align: middle; border-color: var(--line-2); }
.table-x tbody tr { transition: background .15s; }
.table-x tbody tr:hover { background: #fbfaff; }

/* ---------- 공통 모달 ---------- */
.app-modal .modal-content { border: 0; border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; }
.app-modal .modal-dialog { max-width: 380px; }
.app-modal .modal-body { padding: 2rem 1.6rem 1.1rem; }
.app-modal .modal-footer { border: 0; padding: .4rem 1.4rem 1.5rem; gap: .5rem; flex-wrap: nowrap; }
.app-modal .modal-footer > * { margin: 0; }
.app-modal-icon { width: 58px; height: 58px; margin: 0 auto 1rem; border-radius: 18px; display: grid; place-items: center; font-size: 1.6rem; background: var(--primary-50); color: var(--primary); animation: popIn .45s var(--ease) both; }
.app-modal-icon.success { background: var(--mint-50); color: var(--mint); }
.app-modal-icon.error { background: var(--danger-50); color: var(--danger); }
.app-modal-icon.warning { background: var(--yellow-50); color: #d29b1c; }
.app-modal-title { font-size: 1.14rem; font-weight: 800; margin-bottom: .45rem; }
.app-modal-message { color: #6d6a85; font-size: .929rem; line-height: 1.65; word-break: keep-all; white-space: pre-line; }
.app-modal-message code { font-size: 1.1rem; background: #f3f1fa; color: var(--primary-600); padding: .3rem .6rem; border-radius: 8px; user-select: all; }
.app-modal-input { margin-top: 1rem; }
.modal.fade .modal-dialog { transform: scale(.94) translateY(10px); transition: transform .3s var(--ease); }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop.show { opacity: .28; }
.modal-backdrop { background: #2a2350; }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

/* 일반 모달 */
.modal-content { border-radius: 20px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--line-2); }
.modal-title { font-size: 1.07rem; font-weight: 700; }

/* 토스트 */
.toast-container { z-index: 1090; }
.app-toast { display: flex; align-items: center; gap: .6rem; background: #2f2a4a; color: #fff; border-radius: 14px; padding: .75rem 1rem; font-size: .893rem; box-shadow: var(--shadow-lg); margin-top: .5rem; animation: toastIn .35s var(--ease) both; max-width: 360px; }
.app-toast.hide { animation: toastOut .3s var(--ease) forwards; }
.app-toast i { color: #a9e6d2; font-size: 1.05rem; }
.app-toast.error i { color: #ffb4ae; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@media (max-width: 991.98px) { .toast-container { bottom: 70px !important; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; } }

/* 페이지네이션 */
.pagination { --bs-pagination-border-color: transparent; --bs-pagination-color: #6b6880; --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-hover-bg: #f1eff8; --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(124, 108, 240, .15); gap: 4px; }
.pagination .page-link { border-radius: 9px !important; font-weight: 600; font-size: .857rem; min-width: 34px; text-align: center; }

/* 브리핑 */
.brief-card { background: linear-gradient(150deg, #f5f1ff 0%, #fdf2f7 55%, #fff5ee 100%); border: 1px solid #fff; }
.brief-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.2rem .5rem; gap: .6rem; color: #6d6a85; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* 접근성: 움직임 줄이기 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal { opacity: 1; transform: none; }
}

@media (max-width: 767.98px) {
    html { font-size: 13.5px; }
    .hero { padding: 2.6rem 0 2rem; }
    .mock-grid { grid-template-columns: 1fr; }
    .section { padding: 3rem 0; }
    .acc-meta { grid-template-columns: repeat(3, 1fr); }
    .mail-item { padding: .85rem .9rem; gap: .6rem; }
    .auth-card { padding: 1.7rem 1.3rem; }
    .page-head h1 { font-size: 1.29rem; }
}
