/* =====================================================
   BiUm — landing.css
   첫 화면(index.html) 전용 달빛 테마
   style.css 다음에 불러옵니다. 약관 페이지에는 영향이 없습니다.
   (약관 페이지는 이 파일을 불러오지 않습니다)
===================================================== */

:root {
    /* 달빛 팔레트 — 레퍼런스의 보랏빛 밤 + 잎사귀 금빛 */
    --m-deep: #2a2347;
    --m-base: #332b53;
    --m-rise: #3d3460;

    /* 잎사귀 색 */
    --m-leaf: #c9a87c;
    --m-leaf-2: #e8d3ae;
    --m-veil: rgba(255, 255, 255, 0.05);
    --m-veil-2: rgba(255, 255, 255, 0.08);
    --m-line: rgba(232, 211, 174, 0.15);
    --m-line-2: rgba(232, 211, 174, 0.28);

    --m-text: #f6f1e8;
    --m-sub: #c3b6d8;
    --m-dim: #9a8db5;

    --m-moon: #f0e2c6;
    --m-lilac: #c3add8;
    --m-lilac-soft: rgba(185, 163, 255, 0.16);

    /* 섹션 상하 여백 */
    --m-gap: clamp(90px, 11vw, 170px);
}

/* 첫 화면에서만 적용 */
body.moonlit {
    background: var(--m-deep);
    color: var(--m-text);
}

body.moonlit {
    overflow-x: hidden;
}

body.moonlit main {
    overflow-x: hidden;
}

/* -----------------------------------------------------
   상단 메뉴 — 달빛용으로 덮어쓰기
----------------------------------------------------- */

body.moonlit .header {
    background: rgba(20, 16, 48, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--m-line);
}

body.moonlit .header.header-scrolled {
    background: rgba(20, 16, 48, 0.92);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

body.moonlit .navigation a {
    color: var(--m-sub);
}

body.moonlit .navigation a:hover {
    color: var(--m-text);
}

body.moonlit .language-switch {
    color: var(--m-dim);
}

body.moonlit .language-button {
    color: var(--m-dim);
}

body.moonlit .language-button.active {
    color: var(--m-text);
}

body.moonlit .brand-logo-piece {
    filter: brightness(0) invert(1);
}

/* -----------------------------------------------------
   공통 틀
----------------------------------------------------- */

.m-wrap {
    width: min(1180px, calc(100% - 44px));
    margin: 0 auto;
}

.m-section {
    position: relative;
    padding: var(--m-gap) 0;
}

/* 한 단계 밝은 띠 — 섹션끼리 호흡을 끊어줍니다 */
.m-section.m-rise {
    background: linear-gradient(180deg, var(--m-base) 0%, var(--m-rise) 50%, var(--m-base) 100%);
}

.m-section.m-rise::before,
.m-section.m-rise::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--m-line);
}

.m-section.m-rise::before {
    top: 0;
}

.m-section.m-rise::after {
    bottom: 0;
}

/* 달빛 번짐 */
.m-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
    opacity: 0.5;
}

.m-glow-lilac {
    background: radial-gradient(circle, rgba(176, 148, 206, 0.4), transparent 68%);
}

.m-glow-moon {
    background: radial-gradient(circle, rgba(240, 226, 198, 0.28), transparent 68%);
}

/* 섹션 머리말 */
.m-eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--m-line-2);
    background: var(--m-lilac-soft);
    color: #cdbcff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.m-title {
    margin: 0;
    color: var(--m-text);
    font-size: clamp(30px, 4.4vw, 52px);
    font-weight: 800;
    line-height: 1.24;
    letter-spacing: -0.035em;
    word-break: keep-all;
}

.m-lead {
    max-width: 620px;
    margin: 20px 0 0;
    color: var(--m-sub);
    font-size: clamp(15px, 1.4vw, 17.5px);
    line-height: 1.85;
    word-break: keep-all;
}

.m-head {
    margin-bottom: 58px;
}

.m-head-center {
    text-align: center;
}

.m-head-center .m-lead {
    margin-left: auto;
    margin-right: auto;
}

/* -----------------------------------------------------
   휴대폰 틀
----------------------------------------------------- */

.m-phone {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 9px;
    border-radius: 42px;
    background: linear-gradient(160deg, #3b3268, #1b1640 60%);
    border: 1px solid rgba(206, 194, 255, 0.22);
    box-shadow:
        0 40px 90px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.4) inset,
        0 0 70px rgba(150, 120, 255, 0.14);
}

.m-phone-screen {
    position: relative;
    overflow: hidden;
    border-radius: 34px;
    background: #0f0c22;
    aspect-ratio: 640 / 1232;
}

/* 휴대폰 안의 화면은 .ap 목업이 채웁니다 (아래 "앱 화면 목업" 참고) */

/* -----------------------------------------------------
   첫 화면 — 원래 구조를 그대로 두고 색만 달빛으로
   (제목 계단 배치, 떠다니는 캐릭터, 휴대폰 목업은 style.css 그대로)
----------------------------------------------------- */

body.moonlit .hero {
    background:
        /* 위에서 비껴 들어오는 달빛 */
        linear-gradient(168deg, rgba(246, 236, 214, 0.2) 0%, transparent 34%),
        radial-gradient(ellipse 70% 48% at 54% -6%, rgba(240, 226, 198, 0.3), transparent 58%),
        radial-gradient(circle at 14% 72%, rgba(170, 140, 210, 0.22), transparent 44%),
        linear-gradient(180deg, #3a3160 0%, #2c2549 52%, var(--m-deep) 100%);
}

/* 흐린 달빛 두 덩이 */
body.moonlit .hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(100px);
    z-index: 1;
}

body.moonlit .hero-glow-left {
    width: 560px;
    height: 560px;
    top: -170px;
    left: -150px;
    background: radial-gradient(circle, rgba(201, 168, 124, 0.3), transparent 68%);
}

body.moonlit .hero-glow-right {
    width: 440px;
    height: 440px;
    top: 160px;
    right: -130px;
    background: radial-gradient(circle, rgba(240, 226, 198, 0.24), transparent 68%);
}

/* 글자 */
body.moonlit .hero-label {
    color: #cdbcff;
}

body.moonlit .hero .hero-title {
    color: #ffffff;
}

body.moonlit .hero-space-word {
    color: #ffffff;
}

body.moonlit .hero-bium-word {
    color: var(--m-moon);
    text-shadow:
        0 2px 0 rgba(255, 255, 255, 0.12),
        0 18px 44px rgba(233, 220, 192, 0.3);
}

body.moonlit .hero-description {
    color: var(--m-sub);
}

body.moonlit .hero-emphasis {
    color: var(--m-moon);
}

body.moonlit .availability {
    color: var(--m-dim);
}

/* 버튼 두 개 */
body.moonlit .button-primary {
    color: #1a1333;
    background: linear-gradient(180deg, #f6eedd, #ddcba6);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 16px 40px rgba(233, 220, 192, 0.22);
}

body.moonlit .button-secondary {
    color: var(--m-text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--m-line-2);
    box-shadow: none;
}

/* 떠다니는 캐릭터 — 어두운 배경에서는 그림자를 달빛으로 */
body.moonlit .floating-character {
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.45));
}

body.moonlit .floating-effect {
    color: rgba(233, 220, 192, 0.75);
}

/* -----------------------------------------------------
   지원 언어 표기
   언어 이름을 그 언어로 적습니다. "Three languages" 라고
   영어로만 쓰면 스페인어 사용자는 본인이 포함되는지 모릅니다.
----------------------------------------------------- */

.m-langs {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--m-moon);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.m-langs i {
    font-style: normal;
    color: rgba(233, 220, 192, 0.4);
}

.m-note-langs {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin: 0 0 10px;
    color: var(--m-text);
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.m-note-langs i {
    font-style: normal;
    color: var(--m-dim);
    font-weight: 600;
}

/* -----------------------------------------------------
   휴대폰 두 대
   --duo-scale 한 줄로 두 대가 같이 커지고 작아집니다.
----------------------------------------------------- */

body.moonlit .hero {
    overflow: hidden;
}

body.moonlit .hero-visual {
    --duo-scale: 0.62;
    --duo-w: 680px;   /* 휴대폰 330px 두 대 + 사이 간격 20px */
    min-height: calc(650px * var(--duo-scale) + 60px);
    overflow: hidden;
}

body.moonlit .m-duo {
    width: var(--duo-w);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transform: scale(var(--duo-scale));
    transform-origin: center;

    /* 보이는 크기만 줄이면 자리는 그대로 남아 화면이 옆으로 늘어납니다.
       줄어든 만큼 양옆을 당겨서 실제 자리도 같이 줄입니다. */
    margin-left: calc(var(--duo-w) * (var(--duo-scale) - 1) / 2);
    margin-right: calc(var(--duo-w) * (var(--duo-scale) - 1) / 2);
}

body.moonlit .m-duo .phone {
    flex: 0 0 auto;
    box-shadow:
        0 42px 90px rgba(0, 0, 0, 0.55),
        inset 0 0 0 2px rgba(255, 255, 255, 0.12),
        0 0 80px rgba(150, 120, 255, 0.16);
}

/* 케어 휴대폰 — 아직 열리지 않은 화면 */
body.moonlit .phone-care {
    transform: rotate(-3deg);
    opacity: 0.96;
}

body.moonlit .phone-care .phone-screen {
    background: #1a1540;
}

/* 아직 열리지 않은 화면 — 사진 없이 코드로 흐린 모양만 만듭니다 */
.care-blur {
    position: absolute;
    inset: -12%;
    display: block;
    filter: blur(20px);
    opacity: 0.5;
    background:
        linear-gradient(180deg, transparent 0 14%, rgba(255, 255, 255, 0.22) 14% 30%, transparent 30% 36%,
            rgba(255, 255, 255, 0.18) 36% 54%, transparent 54% 60%,
            rgba(255, 255, 255, 0.14) 60% 78%, transparent 78%),
        radial-gradient(circle at 30% 12%, rgba(185, 163, 255, 0.5), transparent 52%),
        linear-gradient(180deg, #3a2f72, #1d1740);
}

.care-veil {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 34px;
    text-align: center;
    background: linear-gradient(180deg, rgba(26, 21, 64, 0.58), rgba(16, 12, 40, 0.78));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.care-ring {
    width: 108px;
    height: 108px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(233, 220, 192, 0.34);
    background: radial-gradient(circle, rgba(233, 220, 192, 0.16), rgba(233, 220, 192, 0.03) 70%);
    box-shadow: 0 0 60px rgba(233, 220, 192, 0.2);
}

.care-mark {
    width: 54px;
    height: 54px;
    display: block;
    object-fit: contain;
}

.care-veil strong {
    color: #ffffff;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.care-soon {
    margin-top: 2px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(233, 220, 192, 0.34);
    background: rgba(233, 220, 192, 0.1);
    color: var(--m-moon);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.care-veil p {
    margin: 14px 0 0;
    color: rgba(226, 217, 250, 0.82);
    font-size: 15px;
    line-height: 1.7;
    word-break: keep-all;
}

/* -----------------------------------------------------
   기능 전환기 (토스식 세로 목록 + 폰 화면)
----------------------------------------------------- */

.m-switch {
    display: grid;
    grid-template-columns: 1fr 0.78fr;
    gap: clamp(36px, 6vw, 90px);
    align-items: center;
}

.m-switch.m-switch-flip {
    grid-template-columns: 0.78fr 1fr;
}

.m-switch.m-switch-flip .m-switch-list {
    order: 2;
}

.m-switch.m-switch-flip .m-switch-visual {
    order: 1;
}

.m-switch-list {
    border-top: 1px solid var(--m-line);
}

.m-switch-item {
    width: 100%;
    padding: 26px 4px;
    display: block;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--m-line);
    background: none;
    cursor: pointer;
}

.m-switch-item h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--m-dim);
    font-size: clamp(18px, 2vw, 23px);
    font-weight: 800;
    letter-spacing: -0.03em;
    transition: color 0.25s ease;
    word-break: keep-all;
}

.m-switch-item:hover h3 {
    color: var(--m-sub);
}

.m-switch-item.is-on h3 {
    color: var(--m-text);
}

.m-switch-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.m-switch-item.is-on .m-switch-body {
    grid-template-rows: 1fr;
}

.m-switch-body > div {
    overflow: hidden;
}

.m-switch-body p {
    margin: 14px 0 0;
    color: var(--m-sub);
    font-size: 15.5px;
    line-height: 1.85;
    word-break: keep-all;
}

.m-switch-visual {
    position: relative;
}

/* -----------------------------------------------------
   테마 — 폰 두 대
----------------------------------------------------- */

.m-pair {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(20px, 5vw, 70px);
    flex-wrap: wrap;
}

.m-pair-one {
    flex: 0 1 300px;
    text-align: center;
}

.m-pair-label {
    margin: 24px 0 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid var(--m-line-2);
    background: var(--m-veil);
    color: var(--m-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.m-pair-note {
    margin: 10px auto 0;
    max-width: 270px;
    color: var(--m-sub);
    font-size: 14px;
    line-height: 1.75;
    word-break: keep-all;
}

/* 폰 두 대일 때는 전환 없이 바로 보입니다 */
.m-pair .ap {
    opacity: 1;
}

/* -----------------------------------------------------
   작은 카드 줄
----------------------------------------------------- */

.m-notes {
    margin-top: 56px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.m-note {
    padding: 26px 24px;
    border-radius: 22px;
    border: 1px solid var(--m-line);
    background: var(--m-veil);
}

.m-note h4 {
    margin: 0 0 10px;
    color: var(--m-text);
    font-size: 16.5px;
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: keep-all;
}

.m-note p {
    margin: 0;
    color: var(--m-sub);
    font-size: 14.5px;
    line-height: 1.8;
    word-break: keep-all;
}

/* 아직 나오지 않은 기능 */
.m-soon {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(233, 220, 192, 0.3);
    background: rgba(233, 220, 192, 0.1);
    color: var(--m-moon);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.07em;
}

/* 짚고 가는 한 줄 */
.m-disclaim {
    margin-top: 40px;
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid var(--m-line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--m-dim);
    font-size: 13.5px;
    line-height: 1.8;
    word-break: keep-all;
}

/* -----------------------------------------------------
   다운로드
----------------------------------------------------- */

.m-download {
    position: relative;
    text-align: center;
    background:
        radial-gradient(ellipse 70% 70% at 50% 110%, rgba(201, 168, 124, 0.26), transparent 62%),
        linear-gradient(180deg, var(--m-deep), #241e3e);
}

/* -----------------------------------------------------
   푸터 — 달빛용
----------------------------------------------------- */

body.moonlit .footer {
    background: #241e3e;
    border-top: 1px solid var(--m-line);
}

/* -----------------------------------------------------
   화면 올라오는 효과
----------------------------------------------------- */

/* 화면에 들어올 때 올라오는 효과.
   transform 을 쓰므로, 크기 조절이 필요한 요소에는
   이 클래스를 붙이지 말고 안쪽 자식에 거세요. */
.m-rise-in {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.m-rise-in.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .m-rise-in {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .m-phone-screen img {
        transition: none;
    }
}

/* -----------------------------------------------------
   태블릿
----------------------------------------------------- */

@media (max-width: 980px) {

    body.moonlit .hero-visual {
        --duo-scale: 0.52;
        min-height: calc(650px * 0.52 + 40px);
    }

    .m-switch,
    .m-switch.m-switch-flip {
        grid-template-columns: 1fr;
    }

    /* 좁은 화면에서는 어느 섹션이든 휴대폰이 먼저, 버튼이 그 아래로 */
    .m-switch .m-switch-visual,
    .m-switch.m-switch-flip .m-switch-visual {
        order: -1;
        margin-bottom: 20px;
    }

    .m-switch .m-switch-list,
    .m-switch.m-switch-flip .m-switch-list {
        order: 1;
    }

    .m-head {
        margin-bottom: 42px;
    }
}

/* -----------------------------------------------------
   휴대폰 화면
----------------------------------------------------- */

@media (max-width: 620px) {
    .m-wrap {
        width: calc(100% - 32px);
    }

    body.moonlit .hero-visual {
        --duo-scale: 0.44;
        --duo-w: 672px;
        min-height: calc(650px * 0.44 + 30px);
        margin-top: 10px;
    }

    body.moonlit .m-duo {
        gap: 12px;
    }

    .m-langs {
        justify-content: center;
    }

    /* 섹션 제목·설명도 가운데로 모읍니다 */
    .m-head {
        text-align: center;
    }

    .m-lead {
        margin-left: auto;
        margin-right: auto;
    }

    .m-switch-item {
        padding: 18px 2px;
    }

    .m-switch-item h3 {
        font-size: 17px;
    }

    .m-switch-body p {
        font-size: 14.5px;
    }

    .m-section {
        padding: clamp(64px, 14vw, 100px) 0;
    }

    .m-phone {
        max-width: 260px;
        padding: 7px;
        border-radius: 34px;
    }

    .m-phone-screen {
        border-radius: 28px;
    }

    .m-switch-item {
        padding: 20px 2px;
    }

    .m-btn {
        width: 100%;
    }

    .m-pair-one {
        flex: 0 1 240px;
    }
}


/* =====================================================
   앱 화면 목업
   실제 캡처 대신 코드로 그린 화면입니다.
   개인정보가 들어가지 않고, 문구는 전부 여기서 고칠 수 있습니다.
===================================================== */

.ap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.ap.is-on {
    opacity: 1;
}

/* 낮 테마 */
.ap-light {
    --c-bg: #f8f1e7;
    --c-bg-2: #fdf8f1;
    --c-card: #fffaf4;
    --c-line: rgba(140, 108, 82, 0.13);
    --c-text: #4a3729;
    --c-sub: #9a8371;
    --c-accent: #8a6a52;
    --c-accent-soft: rgba(138, 106, 82, 0.1);
    color: var(--c-text);
    background:
        radial-gradient(circle at 78% 4%, rgba(255, 255, 255, 0.9), transparent 42%),
        linear-gradient(180deg, #faf3ea 0%, #f4e9dc 100%);
}

/* 밤 테마 */
.ap-dark {
    --c-bg: #251e4c;
    --c-bg-2: #2b2358;
    --c-card: rgba(255, 255, 255, 0.07);
    --c-line: rgba(190, 176, 255, 0.18);
    --c-text: #eee9ff;
    --c-sub: #a99ed2;
    --c-accent: #b9a3ff;
    --c-accent-soft: rgba(185, 163, 255, 0.16);
    color: var(--c-text);
    background:
        radial-gradient(circle at 20% 6%, rgba(150, 120, 255, 0.3), transparent 46%),
        linear-gradient(180deg, #2a2258 0%, #1d1740 100%);
}

/* 머리 */
.ap-top {
    flex: 0 0 auto;
    padding: 16px 16px 10px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.ap-top .ap-name {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ap-toggle {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    background: var(--c-accent-soft);
    font-size: 10px;
    font-weight: 800;
}

.ap-toggle span {
    padding: 4px 9px;
    border-radius: 999px;
    color: var(--c-sub);
}

.ap-toggle span.on {
    color: #fffaf4;
    background: var(--c-accent);
}

.ap-dark .ap-toggle span.on {
    color: #221b47;
}

.ap-ico {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    opacity: 0.6;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
}

/* 본문 */
.ap-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 14px 14px;
    overflow: hidden;
}

.ap-search {
    margin-bottom: 11px;
    padding: 9px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
    color: var(--c-sub);
    font-size: 11.5px;
}

.ap-chips {
    margin-bottom: 11px;
    display: flex;
    gap: 6px;
}

.ap-chip {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    color: var(--c-sub);
    font-size: 10.5px;
    font-weight: 700;
}

.ap-chip.on {
    color: #fffaf4;
    border-color: transparent;
    background: var(--c-accent);
}

.ap-dark .ap-chip.on {
    color: #221b47;
}

/* 카드 */
.ap-card {
    margin-bottom: 10px;
    padding: 13px 14px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-card-top {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.ap-face {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    border: 1.4px solid #3b2d22;
}

.ap-who {
    color: var(--c-text);
    font-size: 11.5px;
    font-weight: 800;
}

.ap-when {
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-card h5 {
    margin: 0 0 4px;
    color: var(--c-text);
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ap-card p {
    margin: 0;
    color: var(--c-sub);
    font-size: 11.5px;
    line-height: 1.62;
}

.ap-card-foot {
    margin-top: 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--c-accent);
    font-size: 10.5px;
    font-weight: 700;
}

.ap-dark .ap-card-foot {
    color: var(--c-accent);
}

/* 아래 탭 */
.ap-tab {
    flex: 0 0 auto;
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-tab .ap-ico {
    width: 18px;
    height: 18px;
    opacity: 0.45;
}

.ap-pen {
    position: absolute;
    left: 50%;
    top: -16px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-accent);
    transform: translateX(-50%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.ap-pen .ap-ico {
    width: 19px;
    height: 19px;
    opacity: 1;
    color: #fffaf4;
}

.ap-dark .ap-pen .ap-ico {
    color: #221b47;
}

/* -----------------------------------------------------
   찬스봇 대화 화면
----------------------------------------------------- */

.ap-chat-head {
    flex: 0 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid var(--c-line);
}

.ap-chat-head img {
    width: 26px;
    height: 26px;
}

.ap-chat-head strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.ap-chat-head span {
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-chat {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.ap-msg {
    max-width: 82%;
    padding: 10px 13px;
    font-size: 11.5px;
    line-height: 1.62;
}

.ap-msg-me {
    align-self: flex-end;
    border-radius: 16px 16px 5px 16px;
    background: var(--c-accent);
    color: #fffaf4;
}

.ap-dark .ap-msg-me {
    color: #221b47;
}

.ap-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 7px;
}

.ap-msg-row img {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
}

.ap-msg-bot {
    border-radius: 16px 16px 16px 5px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
    color: var(--c-text);
}

.ap-input {
    flex: 0 0 auto;
    margin: 0 14px 14px;
    padding: 9px 9px 9px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
    color: var(--c-sub);
    font-size: 11px;
}

.ap-input b {
    flex: 1;
    font-weight: 400;
}

.ap-send {
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-accent);
    color: #fffaf4;
    font-size: 13px;
}

.ap-dark .ap-send {
    color: #221b47;
}

/* -----------------------------------------------------
   달력
----------------------------------------------------- */

.ap-cal {
    padding: 14px 12px;
    border-radius: 18px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-cal-head {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 800;
}

.ap-cal-head i {
    color: var(--c-sub);
    font-style: normal;
}

.ap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px 0;
    text-align: center;
}

.ap-grid b {
    padding-bottom: 7px;
    color: var(--c-sub);
    font-size: 9.5px;
    font-weight: 700;
}

.ap-day {
    min-height: 34px;
    padding-top: 3px;
    color: var(--c-text);
    font-size: 10.5px;
}

.ap-day s {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    text-decoration: none;
    line-height: 1.15;
}

.ap-note-line {
    margin-top: 12px;
    color: var(--c-sub);
    font-size: 10.5px;
    line-height: 1.7;
}

/* -----------------------------------------------------
   리포트 — 길게 흐르는 화면
----------------------------------------------------- */

.ap-scroll {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    overflow: hidden;
    padding: 0 14px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.ap-roll {
    /* 리포트가 흐르는 속도. 숫자를 줄이면 빨라집니다. */
    animation: apRoll 15s cubic-bezier(0.42, 0, 0.58, 1) infinite alternate;
}

@keyframes apRoll {
    0%,
    4% {
        transform: translateY(0);
    }

    96%,
    100% {
        transform: translateY(calc(-100% + 420px));
    }
}

/* 보이지 않는 화면은 흐름을 멈춥니다 */
.ap:not(.is-on) .ap-roll {
    animation-play-state: paused;
}

.ap-h {
    margin: 16px 0 9px;
    color: var(--c-text);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ap-h:first-child {
    margin-top: 4px;
}

.ap-panel {
    padding: 14px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-panel-top {
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 800;
}

.ap-tag {
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--c-accent-soft);
    color: var(--c-accent);
    font-size: 9.5px;
    font-weight: 800;
}

.ap-meter {
    height: 9px;
    margin-bottom: 11px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6fc08b, #e8c35f 48%, #e08a5a 72%, #d8604f);
}

.ap-score {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.ap-score b {
    color: #d6894f;
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
}

.ap-score b i {
    color: var(--c-sub);
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
}

.ap-pill {
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(224, 138, 90, 0.14);
    color: #d6894f;
    font-size: 10.5px;
    font-weight: 800;
}

.ap-delta {
    margin-top: 8px;
    color: #5fa97a;
    font-size: 10.5px;
    font-weight: 700;
}

/* 막대 */
.ap-bars {
    display: grid;
    gap: 9px;
}

.ap-bar {
    display: grid;
    grid-template-columns: 56px 1fr 34px;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
}

.ap-bar span:first-child {
    color: var(--c-sub);
}

.ap-bar u {
    height: 8px;
    display: block;
    border-radius: 999px;
    background: var(--c-accent-soft);
    text-decoration: none;
    overflow: hidden;
}

.ap-bar u i {
    height: 100%;
    display: block;
    border-radius: 999px;
    background: var(--c-accent);
    font-style: normal;
}

.ap-bar em {
    color: var(--c-text);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
    text-align: right;
}

.ap-bar.b1 u i { background: #6fa98a; }
.ap-bar.b2 u i { background: #6f94d8; }
.ap-bar.b3 u i { background: #d8705f; }
.ap-bar.b4 u i { background: #e3b355; }
.ap-bar.b5 u i { background: #9a8ad8; }
.ap-bar.b6 u i { background: #d88aa8; }

/* 꺾은선 */
.ap-chart {
    width: 100%;
    height: 92px;
    display: block;
    overflow: visible;
}

.ap-chart .ln {
    fill: none;
    stroke: var(--c-accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ap-chart .ar {
    fill: var(--c-accent-soft);
    stroke: none;
}

.ap-chart .dt {
    fill: var(--c-card);
    stroke: var(--c-accent);
    stroke-width: 2;
}

.ap-chart .tx {
    fill: var(--c-sub);
    font-size: 8.5px;
    text-anchor: middle;
}

/* 도넛 */
.ap-donut {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ap-donut svg {
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
}

.ap-legend {
    flex: 1;
    display: grid;
    gap: 6px;
    font-size: 10.5px;
}

.ap-legend div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.ap-legend i {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.ap-legend span {
    flex: 1;
    color: var(--c-sub);
}

.ap-legend b {
    color: var(--c-text);
    font-weight: 800;
}

/* 흐름 */
.ap-flow {
    display: flex;
    align-items: center;
    justify-content: space-around;
    text-align: center;
}

.ap-flow div {
    flex: 1;
}

.ap-flow s {
    display: block;
    font-size: 21px;
    text-decoration: none;
}

.ap-flow b {
    display: block;
    margin-top: 5px;
    color: var(--c-sub);
    font-size: 10px;
    font-weight: 700;
}

.ap-flow em {
    display: block;
    margin-top: 3px;
    color: var(--c-text);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.ap-arrow {
    flex: 0 0 auto !important;
    color: var(--c-sub);
    font-size: 15px;
}

/* 한마디 */
.ap-say {
    padding: 13px 14px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-bg-2);
}

.ap-dark .ap-say {
    background: rgba(255, 255, 255, 0.1);
}

.ap-say-top {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--c-accent);
    font-size: 11px;
    font-weight: 800;
}

.ap-say-top img {
    width: 19px;
    height: 19px;
}

.ap-say p {
    margin: 0;
    color: var(--c-text);
    font-size: 11.5px;
    line-height: 1.68;
}

.ap-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 9px;
}

.ap-list li {
    display: flex;
    gap: 8px;
    color: var(--c-text);
    font-size: 11.5px;
    line-height: 1.6;
}

.ap-list li s {
    flex: 0 0 auto;
    text-decoration: none;
}

.ap-fine {
    margin: 14px 0 20px;
    color: var(--c-sub);
    font-size: 9.5px;
    line-height: 1.7;
}

/* -----------------------------------------------------
   친구 · 쪽지 · 방명록
----------------------------------------------------- */

.ap-row {
    margin-bottom: 9px;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-row .ap-face {
    width: 31px;
    height: 31px;
}

.ap-row div {
    flex: 1;
    min-width: 0;
}

.ap-row strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
}

.ap-row span {
    display: block;
    margin-top: 2px;
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-hint {
    margin-bottom: 11px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    border: 1px solid var(--c-line);
    background: var(--c-accent-soft);
    color: var(--c-sub);
    font-size: 10.5px;
    line-height: 1.55;
}

.ap-note-card {
    margin-bottom: 9px;
    padding: 12px 13px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-note-card p {
    margin: 7px 0 0;
    color: var(--c-text);
    font-size: 11.5px;
    line-height: 1.6;
}

/* 프로필 */
.ap-profile {
    padding-top: 6px;
    text-align: center;
}

.ap-avatar {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    display: block;
    border-radius: 50%;
    border: 2px solid #3b2d22;
    background: #fff;
    object-fit: contain;
}

.ap-profile h5 {
    margin: 9px 0 1px;
    font-size: 15px;
    font-weight: 800;
}

.ap-profile .ap-id {
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-profile .ap-bio {
    margin: 7px 0 13px;
    color: var(--c-text);
    font-size: 11px;
}

.ap-quick {
    margin-bottom: 13px;
    display: flex;
    justify-content: center;
    gap: 7px;
}

.ap-quick span {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-quick .ap-ico {
    width: 14px;
    height: 14px;
    opacity: 0.65;
}

.ap-block {
    margin-bottom: 10px;
    padding: 13px;
    text-align: left;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-block-top {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ap-block-top strong {
    font-size: 12px;
    font-weight: 800;
}

.ap-lock {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--c-accent-soft);
    color: var(--c-sub);
    font-size: 9px;
    font-weight: 800;
}

.ap-block > p {
    margin: 0 0 9px;
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-ask {
    margin: 9px 0;
    text-align: center;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 800;
}

.ap-guest {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 7px;
}

.ap-guest li {
    display: flex;
    gap: 7px;
    font-size: 10.5px;
    line-height: 1.5;
}

.ap-guest b {
    flex: 0 0 auto;
    color: var(--c-accent);
    font-weight: 800;
}

.ap-guest span {
    color: var(--c-text);
}

/* 움직임을 줄이는 설정이면 흐름을 멈춥니다 */
@media (prefers-reduced-motion: reduce) {
    .ap-roll {
        animation: none;
    }

    .ap {
        transition: none;
    }
}

/* -----------------------------------------------------
   비공개 일기 화면
----------------------------------------------------- */

.ap-datecard {
    margin-bottom: 10px;
    padding: 13px 14px;
}

.ap-date-top {
    margin-bottom: 11px;
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.ap-date-top b {
    color: var(--c-accent);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ap-date-top em {
    flex: 1;
    color: var(--c-sub);
    font-size: 11px;
    font-style: normal;
}

.ap-month {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text);
    font-size: 11px;
    font-weight: 700;
}

.ap-month i {
    color: var(--c-sub);
    font-style: normal;
}

.ap-daystrip {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 2px;
    text-align: center;
}

.ap-daystrip .dy {
    padding: 3px 0;
    border-radius: 50%;
    color: var(--c-sub);
    font-size: 8.5px;
}

.ap-daystrip .dy.on {
    color: #fffaf4;
    background: var(--c-accent);
    font-weight: 800;
}

.ap-entry {
    margin-bottom: 11px;
}

.ap-entry-top {
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ap-entry-date {
    color: var(--c-sub);
    font-size: 10px;
}

.ap-entry-date s {
    text-decoration: none;
}

.ap-mood {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ap-mood s {
    text-decoration: none;
    font-size: 12px;
}

.ap-mood em {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(154, 138, 216, 0.18);
    color: #6f5fa8;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 800;
}

.ap-entry-title {
    margin: 0 0 9px;
    display: inline;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 800;
    box-shadow: inset 0 -7px 0 rgba(154, 138, 216, 0.28);
}

.ap-entry-body {
    margin: 9px 0 0;
    color: var(--c-text);
    font-size: 11px;
    line-height: 1.75;
}

.ap-translate {
    margin-top: 11px;
    display: block;
    text-align: right;
    color: var(--c-sub);
    font-size: 10px;
}

.ap-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    border-radius: 999px;
    border: 1.4px solid var(--c-accent);
    color: var(--c-accent);
    font-size: 11.5px;
    font-weight: 800;
}

.ap-cta img {
    width: 17px;
    height: 17px;
}

.ap-cta em {
    font-style: normal;
}

/* -----------------------------------------------------
   찬스봇 대화 화면
----------------------------------------------------- */

.ap-chat-head .ap-back {
    opacity: 0.75;
}

.ap-chat-name {
    flex: 1;
    font-size: 14px;
    font-weight: 800;
}

.ap-daydiv {
    margin: 2px auto 6px;
    color: var(--c-sub);
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.ap-turn {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ap-turn-me {
    align-items: flex-end;
}

.ap-bot-name {
    margin-left: 28px;
    color: var(--c-sub);
    font-size: 10px;
    font-weight: 700;
}

.ap-time {
    color: var(--c-sub);
    font-size: 9px;
}

.ap-time-r {
    align-self: flex-end;
}

.ap-input s {
    text-decoration: none;
    font-size: 13px;
    opacity: 0.6;
}

/* -----------------------------------------------------
   케어 휴대폰 — 밝은 테마
----------------------------------------------------- */

body.moonlit .phone-care .phone-screen {
    background: linear-gradient(180deg, #fbf5ec 0%, #f3e8da 100%);
}

.care-blur {
    position: absolute;
    inset: -12%;
    display: block;
    filter: blur(20px);
    opacity: 0.75;
    background:
        linear-gradient(180deg, transparent 0 14%, rgba(255, 255, 255, 0.85) 14% 30%, transparent 30% 36%,
            rgba(255, 255, 255, 0.8) 36% 54%, transparent 54% 60%,
            rgba(255, 255, 255, 0.72) 60% 78%, transparent 78%),
        radial-gradient(circle at 76% 8%, rgba(255, 255, 255, 0.95), transparent 46%),
        linear-gradient(180deg, #fbf4ea, #f0e3d2);
}

.care-veil {
    background: linear-gradient(180deg, rgba(251, 245, 236, 0.62), rgba(240, 227, 210, 0.78));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.care-ring {
    border: 1px solid rgba(138, 106, 82, 0.22);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.5) 70%);
    box-shadow: 0 10px 30px rgba(138, 106, 82, 0.16);
}

.care-veil strong {
    color: #4a3729;
}

.care-soon {
    border: 1px solid rgba(138, 106, 82, 0.28);
    background: rgba(138, 106, 82, 0.1);
    color: #8a6a52;
}

.care-veil p {
    color: #7d6553;
}

/* -----------------------------------------------------
   흩날리는 잎사귀
   사진이 아니라 CSS로 그립니다. 용량 0.
   잎 모양: border-radius 로 한쪽만 둥글게 → 나뭇잎 실루엣
----------------------------------------------------- */

.m-leaves {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.lf {
    position: absolute;
    display: block;
    border-radius: 0 100% 0 100%;
    background: linear-gradient(135deg, var(--m-leaf-2), var(--m-leaf) 48%, #8d6f49);
    box-shadow: inset -2px -3px 6px rgba(0, 0, 0, 0.18);
    opacity: 0.34;
    animation: lfDrift 16s ease-in-out infinite;
}

/* 앞쪽 — 크고 흐리게 (레퍼런스의 가장자리 잎) */
.lf-near {
    opacity: 0.3;
    filter: blur(7px);
}

/* 뒤쪽 — 작고 더 흐리게 */
.lf-far {
    opacity: 0.18;
    filter: blur(3px);
}

.lf1 { width: 190px; height: 190px; top: -42px;  left: -58px;  transform: rotate(28deg);  animation-duration: 19s; }
.lf2 { width: 150px; height: 150px; bottom: -40px; left: 4%;   transform: rotate(-16deg); animation-duration: 23s; animation-delay: -6s; }
.lf3 { width: 54px;  height: 54px;  top: 15%;  left: 31%;  transform: rotate(42deg);   animation-duration: 15s; animation-delay: -3s; }
.lf4 { width: 38px;  height: 38px;  top: 62%;  left: 22%;  transform: rotate(-34deg);  animation-duration: 18s; animation-delay: -9s; }
.lf5 { width: 46px;  height: 46px;  top: 8%;   right: 16%; transform: rotate(-58deg);  animation-duration: 21s; animation-delay: -4s; }
.lf6 { width: 30px;  height: 30px;  top: 46%;  right: 7%;  transform: rotate(18deg);   animation-duration: 14s; animation-delay: -11s; }
.lf7 { width: 120px; height: 120px; top: 34%;  right: -44px; transform: rotate(64deg); animation-duration: 25s; animation-delay: -7s; }
.lf8 { width: 86px;  height: 86px;  bottom: 8%; right: 27%; transform: rotate(-24deg); animation-duration: 20s; animation-delay: -13s; }
.lf9 { width: 24px;  height: 24px;  top: 74%;  left: 54%;  transform: rotate(50deg);   animation-duration: 17s; animation-delay: -2s; }

@keyframes lfDrift {
    0%, 100% {
        translate: 0 0;
    }
    50% {
        translate: 14px -20px;
    }
}

/* 글자와 휴대폰은 잎사귀 위에 */
body.moonlit .hero-inner {
    z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
    .lf {
        animation: none;
    }
}

/* 좁은 화면에서는 큰 잎만 남깁니다 */
@media (max-width: 620px) {
    .lf3, .lf4, .lf6, .lf8, .lf9 {
        display: none;
    }
}

/* -----------------------------------------------------
   자동으로 넘어가는 표시
   켜진 항목 아래에 시간 막대가 차오릅니다.
   사람이 한 번 누르면 (.is-held) 막대가 사라지고 멈춥니다.
----------------------------------------------------- */

.m-switch-item {
    position: relative;
}

/* 차오르는 막대 */
.m-switch-item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--m-leaf-2), var(--m-leaf));
    border-radius: 999px;
    opacity: 0;
}

.m-switch-item.is-on::after {
    opacity: 1;
    animation: mFill 5s linear forwards;
}

/* 리포트처럼 긴 화면은 더 오래 머뭅니다 */
.m-switch-item.is-on.m-slow::after {
    animation-duration: 10s;
}

@keyframes mFill {
    from { width: 0; }
    to   { width: 100%; }
}

/* 사람이 누른 동안에는 막대를 멈춥니다.
   잠시 뒤 자동으로 다시 돌아가면 막대도 같이 되살아납니다. */
.m-switch.is-held .m-switch-item::after {
    animation-play-state: paused;
    opacity: 0.25;
}

@media (prefers-reduced-motion: reduce) {
    .m-switch-item.is-on::after {
        animation: none;
        width: 100%;
    }
}

/* -----------------------------------------------------
   마음 비우기 — 쓰기 / 버튼 화면
----------------------------------------------------- */

.ap-post {
    color: var(--c-accent);
    font-size: 11.5px;
    font-weight: 800;
}

.ap-top .ap-back {
    opacity: 0.7;
}

/* 쓰기 / 버튼 탭 */
.ap-modes {
    margin-bottom: 11px;
    padding: 3px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    border-radius: 999px;
    background: rgba(138, 106, 82, 0.1);
}

.ap-modes span {
    padding: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    color: var(--c-sub);
    font-size: 11.5px;
    font-weight: 800;
}

.ap-modes span.on {
    color: #fffaf4;
    background: var(--c-accent);
}

.ap-modes svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ap-modes em {
    font-style: normal;
}

/* 날짜 · 날씨 · 공개 범위 */
.ap-meta {
    margin-bottom: 12px;
    padding: 11px 13px;
    border-radius: 17px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-meta-row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--c-text);
    font-size: 11px;
    font-weight: 700;
}

.ap-meta-row i {
    color: var(--c-sub);
    font-style: normal;
    font-size: 9px;
}

.ap-meta-row-2 {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--c-line);
    justify-content: space-between;
}

.ap-meta-row-2 b {
    flex: 1;
}

.ap-wx,
.ap-priv {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ap-wx s,
.ap-priv s,
.ap-wx-ico {
    text-decoration: none;
    font-size: 12px;
    opacity: 0.75;
}

.ap-wx em,
.ap-priv em {
    font-style: normal;
}

/* 첨부 네 가지 — 핵심 기능 */
.ap-media {
    margin-bottom: 13px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mb {
    padding: 9px 4px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border-radius: 14px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
    text-align: center;
}

.mb svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mb-photo svg { stroke: #4b7bec; }
.mb-video svg { stroke: #8c6ae0; }
.mb-music svg { stroke: #e0648f; }
.mb-voice svg { stroke: #3fb57a; }

.mb em {
    color: var(--c-text);
    font-size: 9.5px;
    font-style: normal;
    font-weight: 800;
}

.mb i {
    color: var(--c-sub);
    font-size: 8px;
    font-style: normal;
    line-height: 1.3;
}

/* 쓰기 */
.ap-write {
    flex: 1;
    padding: 4px 2px;
}

.ap-ph-title {
    margin: 0 0 9px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-sub);
    font-size: 14px;
    font-weight: 700;
}

.ap-ph-body {
    margin: 0;
    color: var(--c-sub);
    font-size: 11.5px;
    line-height: 1.7;
}

.ap-tagline {
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--c-line);
    color: var(--c-sub);
    font-size: 10.5px;
}

.ap-tagline b {
    color: var(--c-accent);
    font-size: 13px;
}

/* 버튼으로 고르기 */
.ap-ask h6 {
    margin: 13px 0 8px;
    color: var(--c-text);
    font-size: 12.5px;
    font-weight: 800;
}

.ap-ask h6:first-child {
    margin-top: 2px;
}

.ap-chipwrap {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ck {
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(138, 106, 82, 0.09);
    color: var(--c-text);
    font-size: 10.5px;
    font-weight: 700;
}

.ck.on {
    color: #fffaf4;
    background: var(--c-accent);
}

.ck-add {
    border: 1px solid var(--c-accent);
    background: none;
    color: var(--c-accent);
    font-weight: 800;
}

/* -----------------------------------------------------
   히어로 찬스봇 휴대폰 — 앱의 낮(AM) 테마 톤으로
   (오른쪽 케어 휴대폰과 짝이 맞도록)
   style.css 의 목업 색만 덮어씁니다.
----------------------------------------------------- */

body.moonlit .phone-screen {
    background:
        radial-gradient(circle at 78% 4%, rgba(255, 255, 255, 0.9), transparent 42%),
        linear-gradient(180deg, #faf3ea 0%, #f2e7d9 100%);
}

body.moonlit .chat-header {
    border-bottom: 1px solid rgba(140, 108, 82, 0.13);
    background: rgba(255, 250, 244, 0.86);
}

body.moonlit .chat-header strong {
    color: #4a3729;
}

body.moonlit .chat-header span {
    color: #9a8371;
}

body.moonlit .online-dot {
    background: #7fb795;
    box-shadow: 0 0 0 4px rgba(127, 183, 149, 0.14);
}

body.moonlit .message-avatar,
body.moonlit .chance-avatar {
    background: #fffaf4;
}

/* 내가 쓴 말 */
body.moonlit .message-user {
    color: #fffaf4;
    background: linear-gradient(150deg, #9a7a60, #7d6049);
}

/* 찬스가 한 말 */
body.moonlit .message-chance {
    color: #4a3729;
    border: 1px solid rgba(140, 108, 82, 0.13);
    background: rgba(255, 250, 244, 0.96);
}

body.moonlit .message-highlight {
    background: linear-gradient(145deg, #fffaf4, #f6ece0);
}

/* 입력 중 표시 */
body.moonlit .typing-bubble {
    background: #fffaf4;
    box-shadow: 0 8px 22px rgba(120, 92, 66, 0.1);
}

body.moonlit .typing-bubble i {
    background: #b5a08c;
}

/* 아래 입력창 */
body.moonlit .chat-input {
    background: #fffaf4;
    box-shadow: 0 10px 28px rgba(120, 92, 66, 0.14);
}

body.moonlit .chat-input span {
    color: #a99581;
}

body.moonlit .chat-input button {
    color: #fffaf4;
    background: #8a6a52;
}

/* -----------------------------------------------------
   찬스봇이 답을 쓰는 중 — 점 세 개
----------------------------------------------------- */

.ap-typing {
    padding: 13px 15px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 16px 16px 16px 5px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-typing i {
    width: 6px;
    height: 6px;
    display: block;
    border-radius: 50%;
    background: #b5a08c;
    animation: apType 1.2s ease-in-out infinite;
}

.ap-typing i:nth-child(2) { animation-delay: 0.18s; }
.ap-typing i:nth-child(3) { animation-delay: 0.36s; }

@keyframes apType {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* 보이지 않는 화면에서는 멈춥니다 */
.ap:not(.is-on) .ap-typing i {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .ap-typing i {
        animation: none;
        opacity: 0.55;
    }
}

/* -----------------------------------------------------
   좁은 화면 마무리
----------------------------------------------------- */

@media (max-width: 620px) {

    /* 떠다니는 캐릭터가 화면 밖으로 나가서 잘리던 것 — 안으로 들입니다 */
    body.moonlit .character-one {
        width: 62px;
        left: 4%;
        top: 58px;
    }

    body.moonlit .character-two {
        width: 56px;
        right: 4%;
        top: 160px;
    }

    body.moonlit .character-three {
        width: 50px;
        left: 7%;
        bottom: 64px;
    }

    /* 반짝임·하트도 가장자리에서 띄웁니다 */
    body.moonlit .floating-effect {
        margin: 0 6px;
    }

    /* -------------------------------------------------
       AM · PM 두 대를 한 줄에 나란히

       주의: .m-pair 에는 화면에 나타날 때 올라오는 효과(.m-rise-in)가
       붙어 있어서 transform 을 쓰면 서로 덮어씁니다.
       그래서 크기 조절은 안쪽 휴대폰(.m-phone)에만 겁니다.
    ------------------------------------------------- */
    .m-pair {
        flex-wrap: nowrap;
        align-items: flex-start;
        justify-content: center;
        gap: 12px;
    }

    .m-pair-one {
        flex: 0 0 152px;   /* 240px × 0.633 */
        min-width: 0;
    }

    .m-pair .m-phone {
        width: 240px;
        max-width: none;

        /* 줄어든 만큼 자리도 같이 줄입니다 */
        margin-left: -44px;
        margin-right: -44px;
        margin-bottom: -163px;

        transform: scale(0.633);
        transform-origin: top center;
    }

    .m-pair-label {
        margin-top: 14px;
        padding: 5px 13px;
        font-size: 11.5px;
    }

    .m-pair-note {
        max-width: 150px;
        margin-top: 8px;
        font-size: 12px;
        line-height: 1.6;
    }
}

/* =====================================================
   케어 · 습관 화면
===================================================== */

/* 위쪽 케어 / 습관 탭 */
.ap-caretabs {
    flex: 0 0 auto;
    padding: 14px 16px 0;
    display: flex;
    gap: 6px;
}

.ap-caretabs span {
    padding: 9px 16px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 14px 14px 0 0;
    color: var(--c-sub);
    font-size: 11.5px;
    font-weight: 800;
}

.ap-caretabs span.on {
    color: var(--c-text);
    background: var(--c-card);
    box-shadow: 0 -2px 0 var(--c-accent) inset;
}

.ap-caretabs em {
    font-style: normal;
}

.ap-caresub {
    margin: 12px 0 14px;
    color: var(--c-sub);
    font-size: 11px;
}

/* 카드 제목 */
.ap-carehead {
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--c-text);
    font-size: 13.5px;
    font-weight: 800;
}

.ap-carehead s {
    text-decoration: none;
    font-size: 14px;
}

.ap-carehead em {
    font-style: normal;
}

.ap-fine2 {
    margin: 0 0 12px;
    color: var(--c-sub);
    font-size: 10.5px;
    line-height: 1.6;
}

/* 질문 넘기기 */
.ap-ask-row {
    margin: 14px 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ap-ask-row i {
    color: var(--c-sub);
    font-style: normal;
    font-size: 15px;
}

.ap-ask-row strong {
    flex: 1;
    text-align: center;
    color: var(--c-text);
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.5;
}

/* 입력칸 + 저장 */
.ap-field {
    display: flex;
    align-items: center;
    gap: 9px;
}

.ap-field > span {
    flex: 1;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--c-line);
    color: var(--c-sub);
    font-size: 11px;
}

.ap-field b {
    flex: 0 0 auto;
    padding: 7px 15px;
    border-radius: 999px;
    background: var(--c-accent);
    color: #fffaf4;
    font-size: 10.5px;
    font-weight: 800;
}

.ap-field u {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--c-accent);
    color: #fffaf4;
    font-size: 15px;
    text-decoration: none;
}

.ap-field-end > span {
    flex: none;
    border: 0;
    padding: 0;
}

.ap-field-end {
    justify-content: space-between;
}

/* 오늘의 마음 노트 */
.ap-note-item {
    margin-top: 15px;
    padding-top: 14px;
    border-top: 1px solid var(--c-line);
}

.ap-note-item h6 {
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text);
    font-size: 12px;
    font-weight: 800;
}

.ap-note-item h6 s {
    text-decoration: none;
}

.ap-note-item h6 em {
    font-style: normal;
}

.ap-note-item p {
    margin: 0 0 9px;
    color: var(--c-sub);
    font-size: 10px;
    line-height: 1.55;
}

/* 필사 */
.ap-quote {
    margin: 14px 0 11px;
    padding: 14px 4px;
    border-top: 1px solid var(--c-line);
    border-bottom: 1px solid var(--c-line);
    text-align: center;
}

.ap-quote p {
    margin: 0 0 7px;
    color: var(--c-text);
    font-size: 11.5px;
    line-height: 1.7;
}

.ap-quote span {
    color: var(--c-sub);
    font-size: 9.5px;
}

.ap-dots {
    margin-bottom: 11px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.ap-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(138, 106, 82, 0.25);
}

.ap-dots i.on {
    width: 16px;
    border-radius: 999px;
    background: var(--c-accent);
}

.ap-ghost {
    margin: 0 0 13px;
    color: rgba(138, 106, 82, 0.3);
    font-size: 11.5px;
    line-height: 1.7;
    text-align: center;
}

/* 습관 */
.ap-empty {
    margin-bottom: 11px;
    padding: 15px;
    border-radius: 15px;
    border: 1px dashed var(--c-line);
    color: var(--c-sub);
    font-size: 10.5px;
    text-align: center;
}

.ap-divline {
    margin: 13px 0 9px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--c-sub);
    font-size: 9.5px;
    font-weight: 700;
}

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

.ap-mission {
    margin-bottom: 4px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-radius: 13px;
    background: rgba(138, 106, 82, 0.07);
}

.ap-check {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 4px;
    border: 1.5px solid var(--c-sub);
}

.ap-mission span {
    flex: 1;
    color: var(--c-text);
    font-size: 11px;
}

.ap-mission b {
    color: var(--c-sub);
    font-size: 10px;
}

.ap-habit {
    margin-bottom: 8px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    border: 1px solid var(--c-line);
    background: var(--c-card);
}

.ap-habit .ap-hemo {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(138, 106, 82, 0.08);
    color: inherit;
    font-size: 15px;
    line-height: 1;
}

.ap-habit div {
    flex: 1;
    min-width: 0;
}

.ap-habit strong {
    display: block;
    color: var(--c-text);
    font-size: 11.5px;
    font-weight: 800;
}

/* 설명 글씨. .ap-hemo 도 span 이라 범위를 div 안으로 좁힙니다. */
.ap-habit div span {
    display: block;
    margin-top: 2px;
    color: var(--c-sub);
    font-size: 9.5px;
    line-height: 1.5;
}

.ap-habit i {
    flex: 0 0 auto;
    color: var(--c-sub);
    font-style: normal;
    font-size: 16px;
}

/* 이모지는 기기 기본 이모지 글꼴로 그립니다.
   본문 글꼴만 쓰면 일부 기기에서 네모로 보입니다. */
.ap-hemo,
.ap-carehead s,
.ap-note-item h6 s,
.ap-quote + .ap-dots ~ *,
.ap-mood s,
.ap-flow s,
.ap-list li s,
.ap-day s,
.ap-entry-date s,
.ap-wx s,
.ap-priv s,
.ap-wx-ico,
.ap-caretabs span {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
        "Twemoji Mozilla", sans-serif;
}

/* 탭 글자는 본문 글꼴로 되돌립니다 */
.ap-caretabs em {
    font-family: inherit;
}

/* 아래 탭의 케어 아이콘 */
.ap-leaf-on {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-leaf-on img {
    width: 19px;
    height: 19px;
    object-fit: contain;
}


/* =====================================================
   찬스봇 섹션 — 휴대폰 한 대 + 작은 카드
===================================================== */

.m-solo {
    display: grid;
    grid-template-columns: 0.78fr 1fr;
    gap: clamp(36px, 6vw, 80px);
    align-items: center;
}

.m-notes-solo {
    margin-top: 0;
    grid-template-columns: 1fr;
}

@media (max-width: 980px) {
    .m-solo {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .m-notes-solo {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* 자바스크립트가 꺼졌을 때만 보이는 한국어 요약 */
.m-noscript {
    width: min(860px, calc(100% - 40px));
    margin: 120px auto 40px;
    padding: 32px 28px;
    border-radius: 24px;
    border: 1px solid var(--m-line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--m-text);
}

.m-noscript h1 {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 800;
}

.m-noscript h2 {
    margin: 26px 0 10px;
    font-size: 17px;
    font-weight: 800;
}

.m-noscript p,
.m-noscript li {
    color: var(--m-sub);
    font-size: 15px;
    line-height: 1.85;
    word-break: keep-all;
}

.m-noscript ul {
    margin: 0;
    padding-left: 20px;
}

.m-noscript li {
    margin-bottom: 10px;
}

.m-noscript a {
    color: var(--m-moon);
}
