/* ---------- Tokens ---------- */
:root {
    --tc-primary: #3b82f6;
    --tc-accent: #10b981;
    --tc-muted: #6b7280;

    /* 로고(전역 기본값) — 마지막에 Comfy Patch로 재정의됨 */
    --tc-logo-size: 42px;
    --tc-logo-size-sm: 36px;

    /* Bootstrap link tweak */
    --bs-link-color: var(--tc-primary);
    --bs-link-hover-color: #1d4ed8;
}

/* ---------- Layout / Cards ---------- */
#app {
    min-height: 100dvh;
}

.card {
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .06);
}

/* ---------- Navbar (base) ----------
   초기엔 컴팩트하게 정의하지만, 파일 맨 아래 Comfy Patch에서 높이/패딩을 키웁니다.
------------------------------------- */
nav.ws-navbar {
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;

    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 6px 20px rgba(2, 6, 23, .06);
}

nav.ws-navbar .container-fluid {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Brand */
.ws-brand {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    text-decoration: none;
    color: inherit;
}

.ws-brand img {
    height: var(--tc-logo-size) !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

/* Links */
nav.ws-navbar .nav-link {
    font-weight: 600;
    color: #475569;
    padding: .38rem .6rem;
    border-radius: .5rem;
}

nav.ws-navbar .nav-link.active,
nav.ws-navbar .nav-link:hover {
    color: var(--tc-primary);
}

/* Dropdowns */
nav.ws-navbar .dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(2, 6, 23, .12);
    padding: 8px;
    margin-top: .35rem;
    animation: tc-fade-in .12s ease-out;
}

nav.ws-navbar .dropdown-item {
    border-radius: 8px;
    padding: .5rem .75rem;
}

nav.ws-navbar .dropdown-item:hover,
nav.ws-navbar .dropdown-item.active {
    background: rgba(59, 130, 246, .08);
    color: #0f172a;
}

/* Desktop hover-open */
@media (hover: hover) and (pointer: fine) {
    nav.ws-navbar .dropdown:hover > .dropdown-menu {
        display: block;
    }

    nav.ws-navbar .dropdown:hover > .nav-link {
        color: var(--tc-primary);
    }
}

/* ---------- Hero ---------- */
.tc-hero {
    background: radial-gradient(1200px 400px at 10% -10%, rgba(59, 130, 246, .08), transparent 60%),
    radial-gradient(900px 300px at 110% 10%, rgba(16, 185, 129, .08), transparent 50%),
    #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(2, 6, 23, .06);
}

.tc-hero h1 {
    letter-spacing: -.02em;
}

.tc-hero p {
    color: var(--tc-muted);
}

/* Buttons (brand feel) */
.btn-primary {
    background: var(--tc-primary);
    border-color: var(--tc-primary);
}

.btn-outline-primary {
    color: var(--tc-primary);
    border-color: var(--tc-primary);
}

.btn-outline-primary:hover {
    background: var(--tc-primary);
    color: #fff;
}

/* ---------- Hero Visual Card ---------- */
.ws-hero {
    position: relative;
    overflow: hidden;
}

.ws-hero-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 16px;
}

.ws-hero-item {
    display: grid;
    grid-template-columns:14px 1fr;
    gap: .6rem;
    align-items: start;
    padding: .5rem 0;
    border-bottom: 1px dashed #e5e7eb;
}

.ws-hero-item:last-child {
    border-bottom: 0;
}

.ws-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
    top: .42rem;
}

/* Background blobs */
.ws-blob {
    position: absolute;
    filter: blur(42px);
    opacity: .25;
    z-index: 0;
    pointer-events: none;
}

.ws-blob-1 {
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(59, 130, 246, .45), transparent 70%);
    top: -120px;
    left: -80px;
}

.ws-blob-2 {
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(16, 185, 129, .45), transparent 70%);
    bottom: -140px;
    right: -100px;
}

/* ---------- Footer ---------- */
footer {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(6px);
    border-top: 1px solid #e2e8f0 !important;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 991.98px) {
    .ws-brand img {
        height: var(--tc-logo-size-sm) !important;
    }

    nav.ws-navbar {
        background: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 1050;
    }

    .ws-nav-spacer {
        height: 64px;
    }

    /* comfy patch에서 상향 */
    .ws-navbar .navbar-collapse {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: .6rem;
        margin-top: .5rem;
        box-shadow: 0 18px 40px rgba(2, 6, 23, .10);
    }
}

/* ---------- Dark mode ---------- */
@media (prefers-color-scheme: dark) {
    .ws-hero-card {
        background: #0f172a;
        border-color: #1f2937;
    }

    .ws-hero-item {
        border-bottom-color: #1f2937;
    }
}

html[data-bs-theme="dark"] nav.ws-navbar .nav-link {
    color: #cbd5e1;
}

html[data-bs-theme="dark"] nav.ws-navbar .nav-link.active,
html[data-bs-theme="dark"] nav.ws-navbar .nav-link:hover {
    color: var(--tc-accent);
}

html[data-bs-theme="dark"] .tc-hero {
    background: #0b1220;
    border-color: #0f172a;
}

/* ---------- Anim ---------- */
@keyframes tc-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   Navbar Comfy Patch (must be LAST) — 실제 높이/여백을 키우는 오버라이드
   ========================================================================== */

/* 0) 로고 사이즈 상향(전역 재정의) */
:root {
    --tc-logo-size: 56px; /* 데스크톱: 42 → 56 */
    --tc-logo-size-sm: 46px; /* 모바일 : 36 → 46 */
}

/* 1) 네비바 높이/패딩 (초기의 min-height:0, padding:0 를 덮어씀) */
nav.ws-navbar {
    padding-top: .6rem !important;
    padding-bottom: .6rem !important;
    min-height: 84px !important; /* 80~88px로 더 키워도 OK */
    display: flex;
    align-items: center; /* 수직 중앙정렬 */
}

/* 2) 컨테이너 내부도 살짝 여백 */
nav.ws-navbar .container-fluid {
    padding-top: .2rem !important;
    padding-bottom: .2rem !important;
}

/* 3) 링크 클릭영역 확대 */
nav.ws-navbar .nav-link {
    padding: .55rem .7rem !important; /* .38 → .55 */
    line-height: 1.25;
}

/* 4) 모바일 겹침 방지 스페이서 상향 */
@media (max-width: 991.98px) {
    .ws-nav-spacer {
        height: 76px;
    }

    /* 64 → 76 (72~84 사이 조절) */
}

/* =========================================================
   Match bodyHeader(nav.ws-navbar) height to ws-login-header
   - Place this at the VERY END of your app.css
   - Makes nav.ws-navbar look/feel exactly like the login header
   ========================================================= */

/* 1) 공통 토큰: 로그인 헤더와 동일 수치 */
:root {
    --ws-head-logo: 48px; /* 데스크톱 로고 높이 (로그인 헤더와 동일) */
    --ws-head-pad: .35rem; /* 위/아래 패딩 (로그인 헤더와 동일) */
}

/* 2) 네비바(본문 헤더) 높이/패딩/배경 스타일을 로그인 헤더와 동일화 */
nav.ws-navbar {
    /* 높이/패딩 */
    padding-top: var(--ws-head-pad) !important;
    padding-bottom: var(--ws-head-pad) !important;
    min-height: calc(var(--ws-head-logo) + (var(--ws-head-pad) * 2)) !important;

    /* 배경/경계(로그인 헤더와 동일) */
    background: rgba(255, 255, 255, .9) !important;
    backdrop-filter: saturate(140%) blur(6px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(6px) !important;
    border-bottom: 1px solid #E2E8F0 !important;

    /* 정렬 */
    display: flex;
    align-items: center;
}

/* 3) 브랜드 로고 사이즈(로그인 헤더와 동일) */
.ws-brand img {
    height: var(--ws-head-logo) !important;
    width: auto !important;
    display: block;
    object-fit: contain;
}

/* 4) 컨테이너 내부 여백: 로그인 헤더는 아주 얇아서 0 유지 */
nav.ws-navbar .container-fluid {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 5) 링크 클릭영역은 살짝만(로그인 헤더 느낌 해치지 않게) */
nav.ws-navbar .nav-link {
    padding: .38rem .6rem !important;
    line-height: 1.25;
}

/* 6) 모바일(≤992px)에서 로그인 헤더와 동일한 축소 로고(40px) 적용 */
@media (max-width: 991.98px) {
    :root {
        --ws-head-logo: 40px; /* 로그인 헤더 모바일 로고 높이 */
    }

    /* sticky-top 겹침 방지 스페이서도 같은 높이로 */
    .ws-nav-spacer {
        height: calc(var(--ws-head-logo) + (var(--ws-head-pad) * 2));
    }
}

/* ====== BODY HEADER HEIGHT HARD-LOCK (put this at the VERY END) ====== */

/* 로그인 헤더와 동일 수치 */
:root {
    --ws-head-logo: 48px; /* 로고 높이 */
    --ws-head-pad: .35rem; /* 위/아래 패딩 */
}

/* 높이/패딩/정렬을 '강제'로 통일 */
body > nav.ws-navbar,
.ws-navbar.navbar.sticky-top {
    padding-top: var(--ws-head-pad) !important;
    padding-bottom: var(--ws-head-pad) !important;
    min-height: calc(var(--ws-head-logo) + (var(--ws-head-pad) * 2)) !important;
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, .9) !important;
    backdrop-filter: saturate(140%) blur(6px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(6px) !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

/* 브랜드 로고 크기 고정 */
body > nav.ws-navbar .ws-brand img {
    height: var(--ws-head-logo) !important;
    width: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* 컨테이너 내부 여백(로그인 헤더처럼 0) */
body > nav.ws-navbar .container-fluid {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 네비 링크 클릭영역(너무 커지지 않게 로그인 헤더 느낌 유지) */
body > nav.ws-navbar .nav-link {
    padding: .38rem .6rem !important;
    line-height: 1.25 !important;
}

/* sticky-top 겹침 방지 spacer를 같은 높이로 (모바일에서만 쓰신다면 조건부로 써도 됨) */
.ws-nav-spacer {
    height: calc(var(--ws-head-logo) + (var(--ws-head-pad) * 2)) !important;
}

/* 모바일일 때 로그인 헤더와 동일 축소 규격 */
@media (max-width: 991.98px) {
    :root {
        --ws-head-logo: 40px;
    }

    /* 로그인 헤더 모바일과 동일 */
    .ws-nav-spacer {
        height: calc(var(--ws-head-logo) + (var(--ws-head-pad) * 2)) !important;
    }
}

/* ===== Hero: App Preview (Phone Mock) ================================== */
.ws-hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
}

.ws-phone {
    width: 320px;
    aspect-ratio: 9/19.5;
    border-radius: 32px;
    padding: 10px;
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    box-shadow: 0 30px 60px rgba(2, 6, 23, .16);
}

.ws-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 18px;
    border-radius: 9px;
    background: #e5e7eb;
}

.ws-screen {
    background: #ffffff;
    width: 100%;
    height: 100%;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ws-screen-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(2, 6, 23, .06);
}

.ws-chip {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .08);
    color: #1e293b;
    display: inline-flex;
    align-items: center;
}

.ws-badge-floating {
    position: absolute;
    right: -6px;
    bottom: -10px;
    padding: 8px 12px;
    background: #10b981;
    color: #fff;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, .35);
}

/* 다크 모드 보정 */
@media (prefers-color-scheme: dark) {
    .ws-phone {
        background: linear-gradient(145deg, #0f172a, #0b1220);
        border-color: #1f2937;
    }

    .ws-notch {
        background: #1f2937;
    }

    .ws-screen {
        background: #0f172a;
    }

    .ws-screen-card {
        background: #0f172a;
        border-color: #1f2937;
    }

    .ws-chip {
        background: rgba(52, 211, 153, .15);
        color: #e5e7eb;
    }
}

/* === App Preview: 살짝 축소(오버라이드) — 파일 맨 끝에 추가 === */
.ws-phone {
    width: 260px;
}

/* 데스크톱 기본 320 → 260 */
.ws-notch {
    width: 96px;
    height: 14px;
    top: 10px;
}

/* 노치도 비율 맞춰 축소 */
.ws-screen {
    gap: 8px;
}

/* 내부 간격 살짝 줄임 */
.ws-screen-card {
    padding: 8px;
}

/* 카드 패딩 살짝 줄임 */
.ws-badge-floating { /* 떠 있는 배지도 살짝 축소 */
    font-size: .9rem;
    padding: 6px 10px;
    right: -4px;
    bottom: -8px;
}

/* 화면 폭별 반응형 보정 */
@media (max-width: 1200px) {
    .ws-phone {
        width: 240px;
    }

    .ws-notch {
        width: 90px;
        height: 14px;
        top: 9px;
    }
}

@media (max-width: 992px) {
    .ws-phone {
        width: 220px;
    }

    .ws-notch {
        width: 84px;
        height: 12px;
        top: 8px;
    }
}

@media (max-width: 576px) {
    .ws-phone {
        width: 200px;
    }

    /* 모바일일 때 더 아담하게 */
}

/* === App Preview — downsized (FINAL override) ============================ */
.ws-phone {
    width: 230px !important;
}

/* 데스크톱 260 → 230 */
.ws-notch {
    width: 88px !important;
    height: 12px !important;
    top: 8px !important;
}

.ws-screen {
    gap: 6px !important;
}

.ws-screen-card {
    padding: 8px !important;
}

.ws-badge-floating {
    font-size: .85rem !important;
    padding: 5px 9px !important;
    right: -4px;
    bottom: -8px;
}

/* 반응형: 화면 작아질수록 한 단계 더 축소 */
@media (max-width: 1200px) {
    .ws-phone {
        width: 215px !important;
    }

    /* 240 → 215 */
    .ws-notch {
        width: 84px !important;
        height: 12px !important;
    }
}

@media (max-width: 992px) {
    .ws-phone {
        width: 200px !important;
    }

    /* 220 → 200 */
    .ws-notch {
        width: 80px !important;
        height: 11px !important;
    }
}

@media (max-width: 576px) {
    .ws-phone {
        width: 180px !important;
    }

    /* 200 → 180 */
    .ws-notch {
        width: 72px !important;
        height: 10px !important;
    }
}

.btn-light.rounded-circle {
    box-shadow: 0 4px 10px rgba(2, 6, 23, .06);
}

.btn-light.rounded-circle:hover {
    transform: translateY(-1px);
    transition: transform .12s ease;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border-radius: 50%;
}

/* 클릭 가능한 느낌 강화 */
.btn-icon {
    position: relative; /* 라벨 버블용 기준점 */
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border-radius: 50%;
    cursor: pointer; /* 손가락 커서 */
    transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
}

.btn-icon:hover,
.btn-icon:focus-visible {
    background: #eef2ff; /* 아주 옅은 하이라이트 */
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .12); /* 링 */
    transform: translateY(-1px); /* 살짝 튀는 느낌 */
    outline: none;
}

.btn-icon svg {
    transition: transform .12s ease;
}

.btn-icon:hover svg,
.btn-icon:focus-visible svg {
    transform: scale(1.04);
}

/* (옵션) 호버 시 라벨 말풍선 노출: data-label 사용 */
.btn-icon[data-label]::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + .35rem);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #0f172a;
    color: #fff;
    font-size: .72rem;
    line-height: 1;
    border-radius: 999px;
    padding: .18rem .46rem;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(2, 6, 23, .16);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

.btn-icon:hover::after,
.btn-icon:focus-visible::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.cal-subtitle {
    white-space: nowrap;
}

/* 오늘 셀 강조 배경/테두리 */
.cal-cell.today {
    background: linear-gradient(0deg, rgba(16, 185, 129, .06), rgba(16, 185, 129, .06));
    box-shadow: inset 0 0 0 2px rgba(16, 185, 129, .25);
}

/* 오늘 날짜 숫자를 동그란 버블로 */
.cal-date-bubble {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: .9rem;
    background: #10b981;
    color: #fff;
}

/* 기존 날짜 숫자 */
.cal-date {
    position: absolute;
    top: 8px;
    right: 10px;
    font-weight: 700;
    font-size: .9rem;
    color: #0f172a;
}

.cal-cell.muted .cal-date {
    color: #9ca3af;
}

/* 오늘 뱃지(좌측 상단) */
.cal-badge-today {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: .65rem;
    font-weight: 700;
    color: #065f46;
    background: #d1fae5;
    border-radius: 999px;
    padding: 2px 6px;
}

/* 다크 모드 보정(선택) */
@media (prefers-color-scheme: dark) {
    .cal-cell.today {
        background: linear-gradient(0deg, rgba(34, 197, 94, .15), rgba(34, 197, 94, .15));
        box-shadow: inset 0 0 0 2px rgba(34, 197, 94, .28);
    }

    .cal-badge-today {
        color: #d1fae5;
        background: rgba(34, 197, 94, .28);
    }
}

/* === WeStory bodyHeader size FIX ===================================== */
/* #app 안에 들어오는 프래그먼트 nav에만 정확히 적용 */
#app nav.ws-navbar {
    /* 로그인 헤더 느낌: 얇은 패딩 + 낮은 최소 높이 */
    padding-top: .35rem !important;
    padding-bottom: .35rem !important;
    min-height: 60px !important; /* 56~64px 사이로 취향 조절 */
    display: flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, .9) !important;
    backdrop-filter: saturate(140%) blur(6px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(6px) !important;
    border-bottom: 1px solid #E2E8F0 !important;
}

/* 로고 크기: 데스크톱 44px, 모바일 38px */
#app nav.ws-navbar .ws-brand img {
    height: 44px !important;
    width: auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* 링크 클릭 영역(너무 두껍지 않게) */
#app nav.ws-navbar .nav-link {
    padding: .38rem .6rem !important;
    line-height: 1.25 !important;
}

/* 모바일 축소 규격 */
@media (max-width: 991.98px) {
    #app nav.ws-navbar {
        min-height: 54px !important;
    }

    #app nav.ws-navbar .ws-brand img {
        height: 38px !important;
    }

    .ws-nav-spacer {
        height: 54px !important;
    }

    /* sticky-top 겹침 방지 */
}

.chat-date-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: .5rem 0;
    color: var(--bs-secondary);
    font-size: .875rem;
}

.chat-date-divider::before, .chat-date-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--bs-border-color);
}

.chat-date-chip {
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 999px;
    padding: .15rem .6rem;
}

/* ===== Chat FAB — pill style with label ===== */
.chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    height: 56px;
    border-radius: 9999px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, .16);
}

.btn-chat {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem .95rem; /* 아이콘 + 라벨 간격 고려 */
}

.chat-fab-label {
    font-weight: 700;
    letter-spacing: .02em;
}

/* 새 메시지 뱃지 */
.chat-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: var(--tc-accent, #10b981);
    box-shadow: 0 4px 10px rgba(2, 6, 23, .18);
    border: 2px solid rgba(255, 255, 255, .9);
}

/* 모바일(라벨 감춤 → 원형 버튼로) */
@media (max-width: 576px) {
    .btn-chat {
        padding: 0;
        width: 56px;
        justify-content: center;
    }

    .chat-fab-label {
        display: none;
    }
}

.daylist-icon-btn {
    color: #6b7280; /* 회색 */
    line-height: 1;
}

.daylist-icon-btn:hover {
    color: #111827; /* 진한 회색 */
}

/* ===== Floating Chat FAB — Modern pill (FINAL OVERRIDE) ===== */
.chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    border: 0;
    outline: 0;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .68rem 1rem;
    height: 56px;
    border-radius: 9999px;
    background: linear-gradient(135deg, #4f8df9, #3b82f6); /* 더 세련된 그라데이션 */
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
    box-shadow: 0 14px 32px rgba(2, 6, 23, .24), 0 2px 6px rgba(2, 6, 23, .12);
    transform: translateZ(0); /* GPU hint */
    transition: box-shadow .18s ease, transform .18s ease, background .18s ease;
    user-select: none;
}

/* 호버/포커스 상호작용 */
.chat-fab:hover,
.chat-fab:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(2, 6, 23, .28), 0 4px 10px rgba(2, 6, 23, .16);
}

/* 아이콘/라벨 */
.chat-fab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-fab__icon i {
    font-size: 1.15rem;
    line-height: 1;
}

.chat-fab__label {
    font-size: .95rem;
}

/* 새 메시지 뱃지 */
.chat-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: var(--tc-accent, #10b981);
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: 0 6px 14px rgba(16, 185, 129, .35);
}

/* 다크모드에서 살짝 더 진하게 */
@media (prefers-color-scheme: dark) {
    .chat-fab {
        background: linear-gradient(135deg, #467ee0, #3b82f6);
    }
}

/* 모바일(≤576px): 원형로 자동 축소 */
@media (max-width: 576px) {
    .chat-fab {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .chat-fab__label {
        display: none;
    }
}

/* 만약 기존 .btn, .btn-primary 가 남아있다면 강제 무력화 */
.chat-fab.btn, .chat-fab.btn-primary {
    background: inherit !important;
    border: 0 !important;
    color: #fff !important;
    padding: inherit !important;
}

/* 대체 테마: 글래스 */
.chat-fab.chat-fab--pill {
    background: rgba(15, 23, 42, .65);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
}

.chat-fab.chat-fab--pill:hover,
.chat-fab.chat-fab--pill:focus-visible {
    background: rgba(15, 23, 42, .78);
}

/* === CHAT FAB - FINAL PATCH (paste at very end) ===================== */
/* 기존의 원형(56x56) 규칙을 무력화하고 알약형 + 배지 표시를 강제 */

#chatFab.chat-fab {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    z-index: 1080 !important;

    /* 알약형 버튼 */
    display: inline-flex !important;
    align-items: center !important;
    gap: .55rem !important;
    padding: .68rem 1rem !important;
    height: 56px !important;
    width: auto !important;
    border-radius: 9999px !important;

    /* 기본 테마(그라데이션) */
    background: linear-gradient(135deg, #4f8df9, #3b82f6) !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;

    border: 0 !important;
    outline: 0 !important;
    box-shadow: 0 14px 32px rgba(2, 6, 23, .24), 0 2px 6px rgba(2, 6, 23, .12) !important;
    transform: translateZ(0) !important;
    transition: box-shadow .18s ease, transform .18s ease, background .18s ease !important;
    user-select: none !important;
}

#chatFab.chat-fab:hover,
#chatFab.chat-fab:focus-visible {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 40px rgba(2, 6, 23, .28), 0 4px 10px rgba(2, 6, 23, .16) !important;
}

/* 아이콘/라벨 */
#chatFab .chat-fab__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#chatFab .chat-fab__icon i {
    font-size: 1.15rem;
    line-height: 1;
}

#chatFab .chat-fab__label {
    font-size: .95rem;
}

/* 배지: 기본은 숨김, 클래스 토글로 표시 */
#chatFab .chat-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    background: var(--tc-accent, #10b981);
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: 0 6px 14px rgba(16, 185, 129, .35);
    display: none;
}

#chatFab.--has-badge .chat-fab__badge {
    display: block;
}

/* 글래스(어두운 반투명) 테마가 필요하면 .chat-fab--pill 클래스로 오버라이드 */
#chatFab.chat-fab--pill {
    background: rgba(15, 23, 42, .65) !important;
    backdrop-filter: saturate(140%) blur(10px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(10px) !important;
}

#chatFab.chat-fab--pill:hover,
#chatFab.chat-fab--pill:focus-visible {
    background: rgba(15, 23, 42, .78) !important;
}

/* 모바일(≤576px): 원형으로 자동 축소 */
@media (max-width: 576px) {
    #chatFab.chat-fab {
        width: 56px !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 50% !important;
    }

    #chatFab .chat-fab__label {
        display: none !important;
    }
}

/* 부트스트랩 .btn 규칙이 붙어도 영향 없게 */
#chatFab.chat-fab.btn,
#chatFab.chat-fab.btn-primary {
    background: inherit !important;
    border: 0 !important;
    color: #fff !important;
    padding: inherit !important;
}

.card[h-100]:hover {
    transform: translateY(-3px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 보내기 버튼: 한 줄 유지 + 크기 살짝 축소 */
.chat-input form {
    flex-wrap: nowrap;
}

.chat-input form .btn {
    white-space: nowrap; /* 줄바꿈 방지 */
    font-size: .875rem; /* 글씨 약간 작게 */
    line-height: 1.25rem;
    padding: .375rem .6rem; /* 높이도 살짝 줄임 */
    flex: 0 0 auto; /* 버튼이 줄바꿈되지 않도록 고정폭 성격 */
}

/* ==== WeStory Home (Calendar + Right Icon Rail) ========================= */
/* 토큰 사용(색/링/호버 등) */
:root {
    --home-rail-w: 56px;
    --home-panel-w: 360px;
    --home-gap: 16px;
    --home-cell-border: #eef2f7;
    --home-dow-bg: #f8fafc;
}

/* 전체 3+1열 (좌/중/레일/패널) — 가로 스크롤 방지 */
.layout {
    display: grid;
    grid-template-columns: 300px 1fr var(--home-rail-w) var(--home-panel-w);
    gap: var(--home-gap);
    align-items: start;
    max-width: 100%;
    overflow-x: hidden; /* 절대 가로 스크롤 금지 */
}

/* 모바일 1열 */
@media (max-width: 991.98px) {
    .layout {
        grid-template-columns:1fr;
        gap: 12px;
    }
}

/* 좌측 카드 공통(이미 카드 스타일 전역 존재 → 보더만 살짝) */
.ws-card {
    border: 1px solid #e5e7eb;
}

/* 미니 캘린더 */
.mini-grid {
    display: grid;
    grid-template-columns:repeat(7, 1fr);
    gap: 4px;
}

.mini-cell {
    font-size: .8rem;
    text-align: center;
    padding: .25rem .15rem;
    border-radius: 8px;
}

.mini-cell.muted {
    color: #9ca3af;
}

.mini-cell.today {
    background: var(--tc-accent);
    color: #fff;
    font-weight: 700;
}

/* 메인 캘린더 */
.cal-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(2, 6, 23, .06);
}

.cal-grid {
    display: grid;
    grid-template-columns:repeat(7, 1fr);
}

.cal-dow {
    padding: .5rem .75rem;
    font-weight: 600;
    font-size: .85rem;
    color: #64748b;
    background: var(--home-dow-bg);
    text-align: center;
}

.cal-cell {
    position: relative;
    min-height: 120px;
    padding: 8px 8px 6px;
    border-right: 1px solid var(--home-cell-border);
    border-bottom: 1px solid var(--home-cell-border);
    background: #fff;
}

.cal-cell:nth-child(7n) {
    border-right: none;
}

.cal-cell.muted .cal-date {
    color: #9ca3af;
}

.cal-cell.today {
    background: linear-gradient(0deg, color-mix(in srgb, var(--tc-accent) 12%, transparent), color-mix(in srgb, var(--tc-accent) 12%, transparent));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tc-accent) 28%, transparent);
}

.cal-date {
    position: absolute;
    top: 8px;
    right: 10px;
    font-weight: 700;
    font-size: .9rem;
    color: #0f172a;
}

.cal-date-bubble {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 999px;
    font-weight: 800;
    font-size: .9rem;
    background: var(--tc-accent);
    color: #fff;
}

.cal-list {
    margin: 24px 2px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cal-ev {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .83rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
}

.ev-blue {
    background: #3b82f6;
}

.ev-indigo {
    background: #6366f1;
}

.ev-amber {
    background: #f59e0b;
}

.ev-green {
    background: #10b981;
}

.ev-gray {
    background: #64748b;
}

.ev-holiday {
    background: #ef4444;
}

.cal-ev.holiday a, .cal-ev.holiday span {
    color: #ef4444;
    font-weight: 700;
    text-decoration: none;
}

/* 오른쪽 아이콘 레일 + 패널 */
.side-wrap {
    display: grid;
    grid-template-columns: var(--home-rail-w) var(--home-panel-w);
    gap: var(--home-gap);
}

@media (min-width: 992px) {
    .side-wrap.collapsed {
        grid-template-columns: var(--home-rail-w) 0;
    }
}

@media (max-width: 991.98px) {
    .side-wrap {
        display: block;
    }

    /* 모바일은 위아래 배치 */
}

.rail {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    position: sticky;
    top: 12px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s;
}

.icon-btn:hover {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tc-primary) 15%, transparent);
}

.icon-btn.active {
    border-color: var(--tc-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc-primary) 18%, transparent);
}

.rail svg {
    width: 22px;
    height: 22px;
    fill: #0f172a;
}

.side-panel {
    position: relative;
    min-height: 300px;
}

.side-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}

/* 다크모드 보정 */
@media (prefers-color-scheme: dark) {
    .cal-wrap {
        background: #0f172a;
        border-color: #1f2937;
    }

    .cal-dow {
        background: #0b1220;
        color: #9ca3af;
    }

    .cal-cell {
        background: #0f172a;
        border-color: #1f2937;
    }

    .rail .icon-btn {
        background: #0f172a;
        border-color: #1f2937;
    }
}

