/* ==== 테마 색상 변수 (라이트/다크) ==== */
:root {
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    /* 모바일 앱 셸의 실제 하단 내비 높이. JS가 열기 직전에 실측값으로 동기화하며,
       스크립트 초기화 전에도 자연 높이(상단 8 + 버튼 44 + safe-area)를 보수적으로 예약한다. */
    --oru-mobile-bottom-nav-inset: calc(52px + max(var(--sab), 12px));
    /* 달력 셀 높이 — PC는 고정. 모바일은 아래 미디어쿼리에서 가시 높이에 맞춰 줄어든다. */
    --oru-cal-cell: 54px;
    --oru-badge-date: #F0EDE4;
    --oru-on-primary: #ffffff;
    --oru-error: #ba1a1a;
    --oru-surface-variant: #e4e2dd;
    --oru-surface-container: #f0eee9;
    --oru-on-error: #ffffff;
    --oru-inverse-surface: #30312e;
    --oru-surface: #FAF6EE;
    --oru-on-primary-fixed-variant: #394b40;
    --oru-on-secondary: #ffffff;
    --oru-on-secondary-container: #68645b;
    --oru-surface-dim: #dbdad5;
    --oru-surface-container-lowest: #ffffff;
    --oru-on-tertiary: #ffffff;
    --oru-background: #FAF6EE;
    --oru-secondary-container: #e8e2d6;
    --oru-on-tertiary-container: #faf0e1;
    --oru-surface-container-low: #f5f3ee;
    --oru-text-main: #2D312E;
    --oru-primary: #48594e;
    --oru-on-surface: #1b1c19;
    --oru-on-tertiary-fixed-variant: #4c463b;
    --oru-surface-bright: #fbf9f4;
    --oru-surface-tint: #516257;
    --oru-on-secondary-fixed-variant: #4a473e;
    --oru-on-error-container: #93000a;
    --oru-primary-container: #607266;
    --oru-tertiary-fixed: #ebe1d2;
    --oru-on-secondary-fixed: #1e1c14;
    --oru-secondary: #625e55;
    --oru-surface-ivory: #FFFDF8;
    --oru-on-primary-fixed: #0f1f16;
    --oru-primary-fixed-dim: #b8cbbd;
    --oru-surface-container-high: #eae8e3;
    --oru-on-surface-variant: #434844;
    --oru-secondary-fixed-dim: #cbc6ba;
    --oru-on-background: #1b1c19;
    --oru-error-container: #ffdad6;
    --oru-outline-variant: #c3c8c2;
    --oru-primary-fixed: #d4e7d9;
    --oru-tertiary-fixed-dim: #cec5b7;
    --oru-text-muted: #727874;
    --oru-on-primary-container: #e2f6e7;
    --oru-inverse-on-surface: #f2f1ec;
    --oru-tertiary: #5b5549;
    --oru-surface-container-highest: #e4e2dd;
    --oru-secondary-fixed: #e8e2d6;
    --oru-border-subtle: #E2DDD3;
    --oru-on-tertiary-fixed: #1f1b12;
    --oru-tertiary-container: #746d61;
    --oru-inverse-primary: #b8cbbd;
    --oru-outline: #737873;
    --oru-placeholder: #cbc6ba;
    /* 발견의 빛 — 앰버 강조 (2026-07 브랜드 리뉴얼) */
    --oru-accent: #BC842F;
    --oru-accent-ink: #875B1D;
    --oru-accent-soft: #F8EFD9;
    --oru-accent-line: #E7D2A6;
    /* 대표 마크 — 새싹 (2026-08 브랜드 복귀). 잎은 테마 무관 브랜드색, 줄기만 다크에서 뒤집는다. */
    --oru-mark-leaf: #94B24A;
    --oru-mark-stem: #3F4A43;
}
html.dark {
    --oru-badge-date: #2f322c;
    --oru-on-primary: #1d2a20;
    --oru-error: #ffb4ab;
    --oru-surface-variant: #383b36;
    --oru-surface-container: #2a2d29;
    --oru-on-error: #690005;
    --oru-inverse-surface: #e4e6e0;
    --oru-surface: #1d1f1c;
    --oru-on-primary-fixed-variant: #b8cbbd;
    --oru-on-secondary: #232019;
    --oru-on-secondary-container: #cfc9bc;
    --oru-surface-dim: #4a4d47;
    --oru-surface-container-lowest: #1a1c19;
    --oru-on-tertiary: #231f16;
    --oru-background: #1d1f1c;
    --oru-secondary-container: #3a372e;
    --oru-on-tertiary-container: #ebe1d2;
    --oru-surface-container-low: #262923;
    --oru-text-main: #e4e6e0;
    --oru-primary: #a8c5ad;
    --oru-on-surface: #e4e6e0;
    --oru-on-tertiary-fixed-variant: #cec5b7;
    --oru-surface-bright: #33362f;
    --oru-surface-tint: #b8d5bd;
    --oru-on-secondary-fixed-variant: #cbc6ba;
    --oru-on-error-container: #ffdad6;
    --oru-primary-container: #3a4a3f;
    --oru-tertiary-fixed: #3f3a30;
    --oru-on-secondary-fixed: #e8e2d6;
    --oru-secondary: #b0aa9c;
    --oru-surface-ivory: #242723;
    --oru-on-primary-fixed: #d4e7d9;
    --oru-primary-fixed-dim: #4a5a4f;
    --oru-surface-container-high: #31342f;
    --oru-on-surface-variant: #c3c8c1;
    --oru-secondary-fixed-dim: #57534a;
    --oru-on-background: #e4e6e0;
    --oru-error-container: #93000a;
    --oru-outline-variant: #43473f;
    --oru-primary-fixed: #334237;
    --oru-tertiary-fixed-dim: #59534a;
    --oru-text-muted: #9aa19b;
    --oru-on-primary-container: #d4e7d9;
    --oru-inverse-on-surface: #2d312e;
    --oru-tertiary: #b5ac9c;
    --oru-surface-container-highest: #383b36;
    --oru-secondary-fixed: #3a372e;
    --oru-border-subtle: #3c3f39;
    --oru-on-tertiary-fixed: #ebe1d2;
    --oru-tertiary-container: #4c463b;
    --oru-inverse-primary: #48594e;
    --oru-outline: #8b918b;
    --oru-placeholder: #6b6f66;
    /* 발견의 빛 — 앰버 강조 (다크: Night Archive는 후속 트랙) */
    --oru-accent: #D9A441;
    --oru-accent-ink: #E7C77A;
    --oru-accent-soft: #33301F;
    --oru-accent-line: #574A2B;
    /* 대표 마크 — 잎은 라이트와 동일(어두운 종이 위에서도 선명), 줄기는 밝게 뒤집어 실루엣 유지 */
    --oru-mark-leaf: #94B24A;
    --oru-mark-stem: #C3C8C1;
    color-scheme: dark;
}
body {
    background-color: var(--oru-background);
    color: var(--oru-text-main);
    word-break: keep-all;
    overflow-wrap: break-word;
}
.material-symbols-outlined {
    /* URL이 wght·FILL 축만 요청하므로 GRAD·opsz는 no-op → 제거(design-system §5-2) */
    font-variation-settings: 'FILL' 0, 'wght' 300;
    vertical-align: middle;
}
.material-symbols-outlined[data-weight="fill"] {
    font-variation-settings: 'FILL' 1, 'wght' 300;
}
/* 키보드 포커스 표시 — 아이콘-only 버튼 등에서 포커스 위치를 명확히 */
:focus-visible {
    outline: 2px solid var(--oru-primary);
    outline-offset: 2px;
}
.soft-shadow {
    box-shadow: 0 4px 20px rgba(96, 114, 102, 0.04);
}
.soft-shadow-hover:hover {
    box-shadow: 0 8px 24px -4px rgba(96,114,102,0.08);
    transform: translateY(-1px);
}

/* ===== 홈 캘린더 하단 적응형 기록 허브 =====
   미작성은 짧은 안내+단일 CTA, 조건 충족 시 다시 만난 기록, 완료 뒤에는 편지 진행도를 보여 준다.
   사용자 본문·AI 한마디는 JS가 textContent로 주입하며 행동 타깃은 44px 기준을 지킨다. */
.home-daily-hub {
    width: 100%;
    padding: 18px 18px 15px;
    border: 1px solid var(--oru-border-subtle);
    border-radius: 16px;
    background: var(--oru-surface-ivory);
    box-shadow: none;
    color: var(--oru-on-surface);
    text-align: left;
}
.home-daily-hub-main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}
.home-daily-hub-complete-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--oru-accent-ink);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.home-daily-hub-invitation,
.home-daily-hub-reaction {
    margin: 0;
    font-family: "Maru Buri", MaruBuri, Lora, AppleMyungjo, serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: -0.025em;
    color: var(--oru-on-surface);
}
.home-returned-memory-heading {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--oru-accent-ink);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: -0.01em;
}
.home-returned-memory-preview {
    display: flex;
    align-items: stretch;
    gap: 13px;
    min-width: 0;
}
.home-returned-memory-copy {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}
.home-returned-memory-date {
    margin: 0;
    color: var(--oru-text-muted);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.4;
}
.home-returned-memory-body {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--oru-on-surface);
    font-family: "Maru Buri", MaruBuri, Lora, AppleMyungjo, serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.home-returned-memory-image {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    align-self: center;
    border: 1px solid var(--oru-border-subtle);
    border-radius: 12px;
    background: var(--oru-surface-container);
    object-fit: cover;
}
.home-daily-hub-helper {
    margin: -3px 0 0;
    color: var(--oru-text-muted);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 11.5px;
    line-height: 1.4;
    text-align: center;
}
.home-daily-hub-primary {
    width: 100%;
    min-height: 45px;
    margin-top: 2px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--oru-primary);
    color: var(--oru-on-primary);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    transition: opacity 160ms ease, transform 120ms ease, background-color 160ms ease;
}
.home-daily-hub-primary:hover { opacity: 0.94; }
.home-daily-hub-primary:active { transform: scale(0.985); }
.home-daily-hub-primary-outline {
    border-color: var(--oru-outline-variant);
    background: transparent;
    color: var(--oru-primary);
}
.home-daily-hub-primary-outline:hover {
    background: var(--oru-surface-container-low);
    opacity: 1;
}
.home-daily-hub-complete-title {
    font-size: 13px;
}
.home-daily-hub-complete-title .material-symbols-outlined {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--oru-accent-soft);
    color: var(--oru-accent-ink);
    font-size: 16px;
    font-variation-settings: 'FILL' 0, 'wght' 500;
}
.home-daily-hub-reaction {
    display: -webkit-box;
    overflow: hidden;
    padding-left: 12px;
    border-left: 2px solid var(--oru-accent-line);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}
.home-daily-hub-progress {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--oru-border-subtle);
}
.home-daily-hub-progress-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--oru-on-surface-variant);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}
.home-daily-hub-progress-heading p { margin: 0; }
.home-daily-hub-progress-heading span {
    flex: 0 0 auto;
    color: var(--oru-accent-ink);
    font-variant-numeric: tabular-nums;
}
.home-daily-hub-progress-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 8px;
}
.home-daily-hub-progress-track span {
    height: 6px;
    border-radius: 999px;
    background: var(--oru-surface-container-highest);
    transition: background-color 180ms ease;
}
.home-daily-hub-progress-track span.is-filled { background: var(--oru-accent); }
.home-daily-hub-progress-note {
    color: var(--oru-text-muted);
    font-family: Pretendard, "Noto Sans KR", sans-serif;
    font-size: 11.5px;
    line-height: 1.55;
}
.home-daily-hub-progress-note { margin: 8px 0 0; }

@media (max-width: 359px) {
    .home-daily-hub { padding-right: 15px; padding-left: 15px; }
    .home-daily-hub-invitation { font-size: 17px; }
    .home-returned-memory-image { width: 72px; height: 72px; flex-basis: 72px; }
}

/* 360×800 안드로이드처럼 폭과 높이가 함께 빠듯한 화면만 여백을 한 단계 압축한다.
   날짜 셀 44px·CTA 45px는 그대로 두고, 장식 여백만 줄여 핵심 안내가 내비 뒤로 밀리지 않게 한다. */
@media (max-width: 389px) and (max-height: 820px) {
    #home-calendar-card { padding-top: 10px; padding-bottom: 10px; }
    #home-calendar-card > div:first-child { margin-bottom: 4px; }
    .home-daily-hub { padding-top: 15px; padding-bottom: 12px; }
    .home-daily-hub-main { gap: 8px; }
    .home-daily-hub-progress { margin-top: 12px; padding-top: 10px; }
    .home-daily-hub-progress-note { margin-top: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    .home-daily-hub-primary,
    .home-daily-hub-progress-track span { transition: none; }
}

/* 다시 만난 기록 상세의 오늘 이어쓰기. 일반 캘린더 상세에서는 JS가 통째로 숨긴다. */
.returned-memory-continue {
    margin-top: 4px;
    padding-top: 18px;
    border-top: 1px solid var(--oru-border-subtle);
    text-align: center;
}
.returned-memory-continue-title {
    margin: 0;
    color: var(--oru-on-surface);
    font-family: "Maru Buri", MaruBuri, Lora, AppleMyungjo, serif;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.5;
}
.returned-memory-continue-copy {
    margin: 5px 0 12px;
    color: var(--oru-on-surface-variant);
    font-size: 13px;
    line-height: 1.55;
}
.returned-memory-continue-note {
    margin: 7px 0 0;
    color: var(--oru-text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
/* 달력 셀 높이는 CSS 변수 단일 소유 — Tailwind 임의값(h-[54px])을 쓰면 CDN 주입 CSS가
   반응형 규칙을 덮어써 모바일 축소가 무력화된다(2026-07-23 pb-safe 사고와 같은 원인). */
.cal-cell { height: var(--oru-cal-cell); }
.stamp {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 9999px;
}
/* 무드 캘린더 감정 이모지 — 셀 정중앙에 크게 (날짜 숫자는 좌상단 배지로 비켜남) */
.stamp-emoji {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    pointer-events: none;
}
.stamp-emoji svg { width: 100%; height: 100%; display: block; }
/* 스티커(사진·이모지·플레이스홀더)가 있는 날의 날짜 숫자 — 중앙 글리프와 겹치지 않게 좌상단 작은 배지 */
.cal-day-corner {
    position: absolute;
    top: 3px;
    left: 6px;
    z-index: 2;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}
.cal-day-corner.on-photo { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
/* 사진 모드에서 사진이 없는 기록일 — '글이 있는 날'을 은은한 글줄 아이콘으로 표시(사진 없음=오류 아님) */
.cal-no-photo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--oru-on-surface-variant);
    opacity: 0.5;
    pointer-events: none;
}
.cal-no-photo svg { display: block; }
/* 저장 축하 연출(게스트·회원 공용) — 셀 펄스 링 + 바운스 + 이모지/사진 팝 + 반짝이 버스트 + 말풍선 콜아웃 */
@keyframes celebrateRing { 0% { box-shadow: 0 0 0 0 rgba(96,114,102,.5); } 100% { box-shadow: 0 0 0 16px rgba(96,114,102,0); } }
@keyframes cellBounce { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 65% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes emojiPop { 0% { transform: translate(-50%,-50%) scale(0) rotate(-14deg); } 55% { transform: translate(-50%,-50%) scale(1.6) rotate(8deg); } 75% { transform: translate(-50%,-50%) scale(.9) rotate(-4deg); } 100% { transform: translate(-50%,-50%) scale(1) rotate(0deg); } }
@keyframes thumbPop { 0% { transform: scale(0) rotate(-6deg); opacity:.4; } 60% { transform: scale(1.12) rotate(2deg); opacity:1; } 100% { transform: scale(1) rotate(0deg); } }
.cell-celebrate { animation: celebrateRing .8s ease-out 2, cellBounce .7s cubic-bezier(.34,1.56,.64,1) 1; z-index: 5; }
.cell-celebrate .stamp-emoji { animation: emojiPop .85s cubic-bezier(.34,1.56,.64,1) both; }
.cell-celebrate .stamp-thumb { animation: thumbPop .7s .15s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes sparkleFly { 0% { transform: translate(-50%,-50%) scale(.4); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1); opacity: 0; } }
.cell-sparkle { position: absolute; left: 50%; top: 50%; font-size: 13px; pointer-events: none; z-index: 6; animation: sparkleFly .95s ease-out both; }
@keyframes calloutPop { 0% { transform: translateX(-50%) scale(.5); opacity: 0; } 60% { transform: translateX(-50%) scale(1.08); opacity: 1; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
.cell-callout { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; z-index: 30; animation: calloutPop .5s cubic-bezier(.34,1.56,.64,1) both; background: var(--oru-primary); color: var(--oru-on-primary); box-shadow: 0 4px 14px rgba(20,24,20,.22); }
/* 말풍선 아래(대상 셀 쪽) 꼬리 — 배경을 물려받는 회전 사각형 (emotion-bubble 방식) */
.cell-callout::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; margin-top: -4px; width: 8px; height: 8px; background: inherit; transform: rotate(45deg); border-radius: 0 0 2px 0; }
.cell-callout-below { bottom: auto; top: calc(100% + 8px); }
.cell-callout-below::after { top: auto; bottom: 100%; margin-top: 0; margin-bottom: -4px; border-radius: 2px 0 0 0; }
@keyframes reactionGlow { 0% { box-shadow: 0 0 0 0 rgba(96,114,102,.38); } 70% { box-shadow: 0 0 0 12px rgba(96,114,102,0); } 100% { box-shadow: 0 0 0 0 rgba(96,114,102,0); } }
.reaction-spotlight { animation: reactionGlow 1.8s ease-out 2; }
/* 회고 배너 NEW 배지 — 아주 은은한 상하 바운스(주의 환기, 과하지 않게) */
@keyframes oruBadgeBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
.oru-badge-bounce { animation: oruBadgeBounce 1.6s ease-in-out infinite; }
/* 갤러리 기간 이동 점프 — 대상 월 헤더 하이라이트 펄스(배경이 서서히 사라짐) */
@keyframes galleryMonthPulse { 0% { background: var(--oru-badge-date); } 100% { background: transparent; } }
.gallery-month-pulse { animation: galleryMonthPulse 1.2s ease-out; border-radius: 0.5rem; }
/* 저장 보상 — '오루의 한마디' 스포트라이트 암막.
   카드 자체의 box-shadow를 vmax로 확장해 주변을 어둡게(오버레이 금지 — 카드가 sticky 보드
   스태킹 컨텍스트 안이라 fixed 오버레이 위로 승격 불가). 상위 z 크롬은 body 클래스로 디밍.
   게스트 보상 시퀀스(guestRewardSequence)와 회원 저장 직후 '한마디 모먼트'(startReactionMoment)가
   이 두 클래스를 공유해 재사용한다. */
.reaction-spotlight-darken {
    position: relative;
    z-index: 1;                 /* 보드 내 후행 형제 배경이 암막 위로 뚫고 나오는 것 방지 */
    box-shadow: 0 0 0 200vmax rgba(20, 24, 20, 0.45);
    transition: box-shadow .6s ease;
}
/* '오루의 한마디' 카드 등장 — 툭 나타나지 않고 아래에서 천천히 떠오른다.
   (hidden 토글로는 static animate-fade-in 이 재생되지 않아 카드가 즉시 팝인했다) */
@keyframes oruReactionRise {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.reaction-rise-in { animation: oruReactionRise .72s cubic-bezier(.22,.61,.36,1) both; }
/* 저장 직후 한마디는 스크롤이 목표 위치에 도착한 뒤에만 공개한다.
   레이아웃 자리는 유지해야 보이지 않는 카드를 정확한 목표로 스크롤할 수 있다. */
.reaction-preparing {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    animation: none !important;
}
/* 마음 남기기·케어 피드백 칩이 접힐 때 — 답을 남긴 뒤에도 버튼이 그대로 남아
   '대답을 기다리는 폼'처럼 보이던 어색함을 없앤다(오너 피드백 2026-08-08).
   display 는 건드리지 않는다 — 표시의 단일 소유자는 .hidden 토글이고, 여기는 사라지는
   '연출'만 맡는다(트랜지션이 끝난 뒤 JS 가 .hidden 을 붙여 포커스 대상에서도 뺀다). */
.chip-fading {
    opacity: 0;
    transform: scale(.96);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}
/* 오루의 케어 카드가 '다음에요'로 접힐 때 — 툭 사라지지 않고 조용히 물러난다.
   display 는 건드리지 않는다(.hidden 토글이 표시의 단일 소유자다 — 특이도 싸움 금지). */
.care-collapsing {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .22s ease, transform .22s ease;
    pointer-events: none;
}
body.guest-seq-darken header.app-header,
body.guest-seq-darken #mobile-bottom-nav,
body.guest-seq-darken #today-fab,
body.guest-seq-darken #pc-sidebar,
body.tutorial-darken header.app-header,
body.tutorial-darken #mobile-bottom-nav,
body.tutorial-darken #today-fab,
body.tutorial-darken #pc-sidebar { opacity: .25; transition: opacity .5s ease; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    .cell-celebrate, .cell-celebrate .stamp-emoji, .cell-celebrate .stamp-thumb, .cell-sparkle, .cell-callout, .reaction-spotlight, .oru-badge-bounce, .reaction-rise-in { animation: none !important; }
    .care-collapsing { transition: none !important; transform: none !important; }
    .chip-fading { transition: none !important; transform: none !important; }
}
/* 캘린더 셀의 첨부 사진 — 셀 사각형을 꽉 채우는 커버(이모지 대신 사진이 그날의 얼굴) */
.stamp-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}
/* 사진 위 날짜 숫자 가독성용 상단 그라데이션 스크림 */
.stamp-thumb-scrim {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(to bottom, rgba(20, 24, 20, 0.38), rgba(20, 24, 20, 0) 55%);
    pointer-events: none;
}
/* 읽기 카드 감정 말풍선 — 이모지+감정 라벨을 항상 보여주는 탭 가능한 칩 (탭하면 감정 변경) */
.emotion-bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px 5px 7px;
    border-radius: 14px;
    background: var(--oru-secondary-container);
    border: 1px solid rgba(72, 89, 78, 0.16);
    transition: background-color .15s ease, transform .15s ease;
}
.emotion-bubble:hover { background: var(--oru-primary-fixed); }
.emotion-bubble:active { transform: scale(0.96); }
/* 말풍선 꼬리 — 배경·테두리를 그대로 물려받는 회전 사각형 */
.emotion-bubble::after {
    content: "";
    position: absolute;
    bottom: -4.5px;
    left: 13px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-right: 1px solid rgba(72, 89, 78, 0.16);
    border-bottom: 1px solid rgba(72, 89, 78, 0.16);
    border-bottom-right-radius: 2px;
    transform: rotate(45deg);
}
/* 읽기 카드처럼 말풍선이 대상(날짜) 아래에 놓일 때 — 꼬리를 위로 뒤집는다 */
.emotion-bubble.emotion-bubble-tail-top::after {
    bottom: auto;
    top: -4.5px;
    border-right: none;
    border-bottom: none;
    border-left: 1px solid rgba(72, 89, 78, 0.16);
    border-top: 1px solid rgba(72, 89, 78, 0.16);
    border-bottom-right-radius: 0;
    border-top-left-radius: 2px;
}
.emotion-bubble .emotion-bubble-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--oru-on-secondary-container);
    line-height: 1;
    white-space: nowrap;
}
/* 커스텀 말풍선 툴팁 — 감정 이모지 위에 라벨(기쁨 등)을 보여준다.
   터치 기기에서는 완전 비활성(hover/fine 포인터에서만 동작). */
@media (hover: hover) and (pointer: fine) {
    /* 호스트에 positioning 컨텍스트 필요. .stamp-emoji 는 이미 absolute 이므로 제외
       (relative 강제 시 셀 내 절대배치가 깨짐) */
    .emo-tip:not(.stamp-emoji) { position: relative; }
    /* 캘린더 이모지는 기본 pointer-events:none 이라 호버가 안 잡힘 → 툴팁 호스트일 때만 허용 */
    .stamp-emoji.emo-tip { pointer-events: auto; }
    .emo-tip[data-tip]::after {
        content: attr(data-tip);
        position: absolute;
        bottom: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%) translateY(3px);
        background: var(--oru-on-surface);
        color: var(--oru-surface-ivory);
        border-radius: 9999px;
        padding: 3px 10px;
        font-size: 11px;
        line-height: 1.4;
        font-weight: 600;
        white-space: nowrap;
        pointer-events: none;
        opacity: 0;
        z-index: 40;
        box-shadow: 0 2px 8px rgba(96, 114, 102, 0.22);
        transition: opacity .15s ease .12s, transform .15s ease .12s;
    }
    .emo-tip[data-tip]::before {
        content: "";
        position: absolute;
        bottom: calc(100% + 2px);
        left: 50%;
        transform: translateX(-50%) translateY(3px);
        border: 4px solid transparent;
        border-top-color: var(--oru-on-surface);
        pointer-events: none;
        opacity: 0;
        z-index: 40;
        transition: opacity .15s ease .12s, transform .15s ease .12s;
    }
    .emo-tip[data-tip]:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    .emo-tip[data-tip]:hover::before {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    /* 첫 주(캘린더 최상단) 셀은 말풍선이 스크롤 조상에 잘리지 않도록 아래쪽에 표시 */
    .emo-tip-below[data-tip]::after {
        bottom: auto;
        top: calc(100% + 6px);
    }
    .emo-tip-below[data-tip]::before {
        bottom: auto;
        top: calc(100% + 2px);
        border-top-color: transparent;
        border-bottom-color: var(--oru-on-surface);
    }
    @media (prefers-reduced-motion: reduce) {
        .emo-tip[data-tip]::after,
        .emo-tip[data-tip]::before {
            transform: translateX(-50%);
            transition: opacity .15s ease .12s;
        }
        .emo-tip[data-tip]:hover::after,
        .emo-tip[data-tip]:hover::before {
            transform: translateX(-50%);
        }
    }
}
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--oru-surface-dim);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--oru-outline);
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}
/* 데모 모달 카드 전용 등장 — opacity 페이드 없이 transform만.
   반투명 구간에 뒤 텍스트가 비쳐 '문구 겹침'으로 인지되는 문제 원천 차단(툴팁과 동일 원칙). */
@keyframes demoCardIn {
    from { transform: translateY(10px) scale(0.97); }
    to { transform: translateY(0) scale(1); }
}
.demo-card-in { animation: demoCardIn 0.26s cubic-bezier(0.24, 0, 0.38, 1) both; }
.journal-input::placeholder {
    color: var(--oru-placeholder);
}
/* Spinner animation for loading indicator */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin-custom {
    animation: spin 1s linear infinite;
}
/* 로딩 — 줄기가 자라고 잎이 차례로 펼쳐지는 2.1s 발아 루프.
   회전은 안쪽 <ellipse>의 transform 속성이 갖고, 애니메이션은 바깥 <g>에 건다.
   한 요소에 겹치면 CSS transform이 SVG transform 속성을 덮어써 회전이 사라진다.
   잎의 변형 기준점은 줄기 끝(32,30) — transform-box: view-box 라야 viewBox 좌표로 해석된다. */
.oru-arrival { display: inline-block; }
.oru-arrival .oru-sprout-stem { fill: var(--oru-mark-stem); transform-box: fill-box; transform-origin: bottom center; }
.oru-arrival .oru-sprout-leaf { fill: var(--oru-mark-leaf); transform-box: view-box; transform-origin: 32px 30px; }
.oru-arrival-anim { animation: oruMarkBreathe 2.1s ease-in-out infinite; }
.oru-arrival-anim .oru-sprout-stem { animation: oruStemGrow 2.1s ease-in-out infinite; }
.oru-arrival-anim .oru-sprout-leaf-a { animation: oruLeafOpen 2.1s ease-out infinite; }
.oru-arrival-anim .oru-sprout-leaf-b { animation: oruLeafOpen 2.1s .16s ease-out infinite; }
/* 무한 루프 연출은 '숨쉬기'지 '깜빡임'이 아니다 — 마크가 매 주기 사라지면 화면이 깜빡이는 것으로 읽힌다.
   (2026-08-02 회귀: 잎이 opacity 0 + 8% 크기까지 접혔다가 되살아나 초당 깜빡임처럼 보였다.
    옛 도착 모션은 stroke-dashoffset 로 선을 그릴 뿐 마크가 사라지지는 않았다.)
   → opacity 를 0 까지 내리지 않고 크기도 완전히 접지 않는다. 일회성 진입 연출(oruIntro*)은 예외다. */
@keyframes oruMarkBreathe { 0%, 100% { opacity: .62; } 26%, 84% { opacity: 1; } }
@keyframes oruStemGrow { 0%, 8% { transform: scaleY(.55); } 44%, 100% { transform: scaleY(1); } }
@keyframes oruLeafOpen { 0%, 32% { transform: scale(.82); } 64%, 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
    /* 리듀스 모션: 애니메이션 없이 다 자란 새싹 */
    .oru-arrival-anim,
    .oru-arrival-anim .oru-sprout-stem,
    .oru-arrival-anim .oru-sprout-leaf { animation: none !important; opacity: 1; transform: none; }
}
/* iOS 홈 인디케이터(safe area) 대응 — 하단 네비바가 가려지지 않도록 */
.pb-safe {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}
/* '오늘 쓰기' FAB 펄스 — 오늘 미작성 시 은은한 유도 */
@keyframes fabPulse {
    0%   { box-shadow: 0 8px 20px rgba(63,74,67,.34), 0 0 0 0 rgba(90,107,95,.45); }
    70%  { box-shadow: 0 8px 20px rgba(63,74,67,.34), 0 0 0 14px rgba(90,107,95,0); }
    100% { box-shadow: 0 8px 20px rgba(63,74,67,.34), 0 0 0 0 rgba(90,107,95,0); }
}
.fab-pulse { animation: fabPulse 2.2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
    .fab-pulse { animation: none; }
    .demo-card-in,
    .animate-fade-in,
    .animate-spin-custom,
    #busy-bar .busy-fill,
    .today-highlight::after { animation: none !important; }
}
/* 백엔드 작업 진행 표시 (상단 바 + 라벨) */
/* 상단 세이프 에어리어 브랜드 스트립 — inset 0 이면 height 0 으로 무해.
   2026-08-04 이후 iOS standalone 은 status-bar-style=default 라 --sat 가 0 이므로 이 스트립은
   사실상 랜드스케이프 등 inset 이 실제로 생기는 경우에만 그려진다(제거하지 않고 남겨 둔다). */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sat);
    background: #607266;   /* manifest theme_color 와 동일 — Android 상태바와 톤 통일 */
    z-index: 110;
    pointer-events: none;
}
/* 상단 헤더를 상태바(세이프 에어리어) 아래로 내림 (기존 py-4 = 1rem 유지).
   Tailwind .py-4(0,1,0)를 이기도록 셀렉터 특이도를 높인다. */
main > header.app-header { padding-top: calc(var(--sat) + 1rem); }
/* 인앱 브라우저 안내 배너도 상태바 아래로 (기존 py-3 = 0.75rem 유지) */
#inapp-notice { padding-top: calc(var(--sat) + 0.75rem); }
/* PWA 설치 유도 배너도 상태바 아래로 (inapp-notice 와 동일 패턴, 둘은 상호배타) */
#pwa-install-banner { padding-top: calc(var(--sat) + 0.75rem); }
#busy-bar { position: fixed; top: var(--sat); left: 0; right: 0; height: 3px; z-index: 120; display: none; background: var(--oru-surface-container-high); overflow: hidden; }
#busy-bar .busy-fill { width: 40%; height: 100%; background: var(--oru-primary); border-radius: 2px; animation: busy-slide 1.1s ease-in-out infinite; }
@keyframes busy-slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }
/* 시간 선택 드롭다운 — 기본 화살표를 커스텀으로 교체해 값(예: 21:00)과 겹치지 않게 */
.oru-time-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8f87' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px;
    padding-right: 2rem;
}
#busy-label { position: fixed; top: calc(var(--sat) + 10px); left: 50%; transform: translateX(-50%); z-index: 120; display: none; background: var(--oru-surface-ivory); color: var(--oru-on-surface-variant); border: 1px solid var(--oru-border-subtle); border-radius: 9999px; padding: 5px 14px; font-size: 12px; font-weight: 600; box-shadow: 0 4px 14px rgba(96,114,102,0.14); }
/* 스탠드얼론 상태바 스트립·홈 인디케이터를 피해 모달 배치.
   ID 특이도로 Tailwind p-* 의 padding-top/bottom만 덮어씀 — sat=0 환경에선 기존과 픽셀 동일. */
#archive-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem); }
/* 튜토리얼 오버레이(웰컴·전환) — PWA 엣지-투-엣지(안드로이드 상태바·제스처바)에서 위아래 짤림 방지 */
#tutorial-welcome-modal, #demo-transition-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); }
/* 새소식 홈 팝업 — 소형 기기에서 이미지 포함 카드가 상태바·홈 인디케이터에 짤리지 않도록 안전영역 확보 */
#notice-popup-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); }
@media (min-width: 768px) { #archive-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); } }
#weekly-report-modal, #monthly-report-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); }
/* 오루의 월간 편지 — 주간 편지의 종이 질감을 확장한 전용 레이아웃 */
.monthly-letter-paper {
    background: var(--oru-surface-ivory);
    border: 1px solid var(--oru-border-subtle);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0,0,0,.07);
    padding: 36px 32px;
    position: relative;
}
.monthly-letter-paper::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    width: 70px; height: 4px;
    transform: translateX(-50%);
    background: var(--oru-border-subtle);
    border-radius: 0 0 4px 4px;
}
.monthly-letter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px dashed var(--oru-border-subtle);
}
.monthly-bgm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    background: var(--oru-accent-soft);
    border: 1px solid var(--oru-accent-line);
    color: var(--oru-accent-ink);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.monthly-bgm-btn:focus-visible { outline: 2px solid var(--oru-primary); outline-offset: 2px; }
.monthly-sound-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.monthly-sound-wave span {
    width: 2.5px;
    border-radius: 2px;
    background: currentColor;
    animation: monthlyWave 1s ease-in-out infinite;
}
.monthly-sound-wave span:nth-child(1) { height: 60%; animation-delay: .1s; }
.monthly-sound-wave span:nth-child(2) { height: 100%; animation-delay: .3s; }
.monthly-sound-wave span:nth-child(3) { height: 40%; animation-delay: .2s; }
@keyframes monthlyWave { 0%, 100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }
.monthly-summary-caption {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 7px 14px;
    border-radius: 18px;
    background: var(--oru-surface-container);
    border: 1px solid var(--oru-border-subtle);
    color: var(--oru-text-muted);
    font-size: 12px;
    line-height: 1.5;
}
.monthly-hexagon-box {
    background: var(--oru-surface-container-lowest);
    border: 1px solid var(--oru-border-subtle);
    border-radius: 20px;
    padding: 24px 18px 18px;
    text-align: center;
}
.monthly-hexagon-svg { width: 100%; max-width: 430px; height: auto; overflow: visible; margin: 0 auto; }
.monthly-commentary {
    background: var(--oru-accent-soft);
    border: 1px solid var(--oru-accent-line);
    color: var(--oru-accent-ink);
    border-radius: 14px;
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    line-height: 1.7;
}
.monthly-paragraph-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--oru-primary);
    background: var(--oru-badge-date);
    border: 1px solid var(--oru-border-subtle);
    border-radius: 18px;
    padding: 4px 12px;
    margin-bottom: 10px;
    font-size: 12.5px;
    font-weight: 700;
}
.monthly-prescription {
    background: color-mix(in srgb, var(--oru-primary) 9%, var(--oru-surface-ivory));
    border: 1px solid color-mix(in srgb, var(--oru-primary) 28%, var(--oru-border-subtle));
    color: var(--oru-primary);
    border-radius: 16px;
    padding: 18px 20px;
}
@media (max-width: 600px) {
    .monthly-letter-paper { padding: 30px 18px; border-radius: 20px; }
    .monthly-hexagon-box { padding-left: 8px; padding-right: 8px; }
    .monthly-hexagon-svg text { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .monthly-sound-wave span { animation: none !important; }
}
/* 갤러리 스크러버 — 위치만. display는 .hidden 토글이 소유
   ⚠️ 이 ID 셀렉터에 display 를 넣지 말 것: 특이도가 .hidden 을 이겨 토글이 무력화된다(실제 사고 이력). */
#gallery-scrubber { top: calc(var(--oru-header-h, 68px) + 12px); bottom: calc(env(safe-area-inset-bottom, 0px) + 88px); }
@media (min-width: 768px) { #gallery-scrubber { bottom: 24px; } }
#gallery-detail-modal { padding-top: calc(var(--sat) + 0.75rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem); }
@media (min-width: 768px) { #gallery-detail-modal { padding-top: calc(var(--sat) + 1.25rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); } }
#share-modal { padding-top: calc(var(--sat) + 0.75rem); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.75rem); }
/* FAQ 접이식 항목 */
details.faq-item summary { cursor: pointer; list-style: none; }
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary .faq-chevron { transition: transform 0.2s; }
details.faq-item[open] summary .faq-chevron { transform: rotate(180deg); }
/* 정보 아이콘 툴팁 (호버/포커스 시 표시) */
.tooltip-wrap { position: relative; }
.tooltip-wrap .tooltip { display: none; position: absolute; right: 0; top: 130%; z-index: 40; width: 280px; }
.tooltip-wrap:hover .tooltip, .tooltip-wrap:focus-within .tooltip { display: block; }

/* Unified Slide-in Panel Transitions & Mobile Bottom-sheet adaptations */
#journal-side-panel {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}
@media (max-width: 767px) {
    /* ===== 모바일 앱 셸 (2026-08-04) =====
       예전에는 모바일만 문서 스크롤로 되돌리고(body height:auto·overflow:auto) 하단 내비를
       `position: fixed; bottom: 0` 으로 띄웠다. 그런데 iOS 홈 화면 앱(standalone)에서는
       첫 페인트의 레이아웃 뷰포트가 실제 화면보다 짧게 잡혔다가 뒤늦게 확장돼, 그 짧은 기준에
       걸린 하단 내비가 상태바 높이만큼 떠 보였다(탭을 옮기면 그제야 제자리를 찾음).
       고정 요소를 JS 로 밀어 내리는 보정은 더 큰 회귀를 냈다(v1.4.17 → v1.5.2 철회).

       그래서 데스크톱과 같은 표준 앱 셸로 통일한다 — PWA 의 일반적인 구조다:
         body(100dvh·overflow hidden·세로 flex) → main(flex:1, 내부 스크롤) + 하단 내비(일반 흐름)
       하단 내비가 `fixed` 가 아니라 셸의 마지막 행이므로 레이아웃 엔진이 위치를 정한다.
       기준 뷰포트가 흔들려도 내비는 언제나 셸 바닥에 붙어 있다 — 원인 자체가 사라진다.
       덤으로 '고정 내비를 비켜가려고' 두던 main 하단 패딩 상수들(96/160/80/76px)이 필요 없어진다. */
    body {
        flex-direction: column;
    }
    main {
        height: auto !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        /* 내비를 비켜갈 필요가 없으니 숨 고를 여백만 남긴다 */
        padding-bottom: 16px !important;
    }
    #mobile-bottom-nav {
        position: static;
        flex-shrink: 0;
    }
    /* FAB(홈 탭 한정, 뷰포트 바닥 기준 +84px)는 여전히 fixed 라 main 하단을 덮는다 —
       그 상태에서만 마지막 줄이 가리지 않도록 여백을 준다(FAB 없는 탭엔 빈 공간이 생기므로 조건부). */
    body.oru-fab-room main {
        padding-bottom: 96px !important;
    }
    /* 한 화면 완결 탭(홈·더보기)의 고무줄 반동 제거 — 넘칠 내용이 0 인데도 화면이 딸려 움직이면
       사용자에게는 '스크롤되는 화면'으로 읽힌다. 콘텐츠를 잘라내는 overflow:hidden 이 아니라
       '넘침이 없을 때 튕기지 않게'만 하는 것이라, 실제로 넘치는 환경(작은 높이·글자 확대)에서는
       그대로 스크롤된다. 클래스는 switchTab 이 documentElement 에 토글한다 —
       overscroll-behavior 는 루트에서만 뷰포트로 전파되고 body 값은 전파되지 않는다. */
    html.oru-no-bounce,
    html.oru-no-bounce body,
    html.oru-no-bounce main {
        overscroll-behavior-y: none;
    }
    /* 아주 낮은 화면(사파리 툴바 펼친 375×553 등)에서 '더보기'까지 한 화면에 넣는다.
       일반적인 폰 높이(620px 초과)에서는 위의 넉넉한 여백을 그대로 쓴다 — 높이 조건부다.
       줄이는 대상은 여백과 장식(푸터 브랜드 아이콘)뿐이고, 항목·설명·법적 링크는 그대로 둔다.
       행 높이는 57px 로 줄어도 터치 타깃 44px 기준을 넘는다. */
    @media (max-height: 620px) {
        #tab-content-more { padding-top: 0.25rem; gap: 0.25rem; }
        #my-tab-records { gap: 0.25rem; margin-top: 0; }
        #tab-content-more button.rounded-2xl { padding-top: 0.375rem; padding-bottom: 0.375rem; }
        #more-login-btn { padding-top: 0.5rem; padding-bottom: 0.5rem; margin-top: 0.25rem; }
        #tab-content-more .mt-auto { padding-top: 0.25rem; gap: 0.25rem; }
        #tab-content-more .mt-auto > .material-symbols-outlined { display: none; }
    }
    /* 좁은 화면(375px)에서 달력 셀 폭을 넓혀 터치 타깃 확보 */
    .calendar-grid {
        gap: 4px;
    }
    /* ===== 적응형 기록 허브와 함께 쓰는 모바일 달력 밀도 =====
       달력 셀을 뺀 고정 크롬에 기록 허브의 최대 상태(완료+편지 진행도)를 함께 예약하고,
       세이프에어리어를 더해 뺀 나머지를 6주로 나눈다.
       6주(최대) 기준으로 나눠 달의 주 수가 5↔6 으로 바뀌어도 셀 크기가 출렁이지 않는다 — 5주 달은
       아래 여백만 넉넉해진다.
       날짜 터치 영역은 44px 아래로 줄이지 않고 상한을 52px로 낮춰 허브가 들어올 자리를 만든다.
       작은 높이·글자 확대 환경에서는
       잘라내기(overflow:hidden)가 아니라 네이티브 스크롤로 콘텐츠를 보존하는 것이 규칙이다.
       svh(툴바 펼친 상태의 작은 뷰포트)를 쓰는 이유: 주소창이 접혔다 펴질 때 달력이 들썩이지 않고,
       첫 화면의 밀도가 안정되기 때문이다. */
    :root {
        --oru-cal-cell: clamp(44px, calc((100vh - var(--sat) - var(--sab) - 566px) / 6), 52px);
        --oru-cal-cell: clamp(44px, calc((100svh - var(--sat) - var(--sab) - 566px) / 6), 52px);
    }
    /* 좁은 폭(360·375)에서 '2024년 12월' 같은 최대 길이 제목이 표시 토글과 붙는다.
       한 줄 배치를 유지하려면 제목이 먼저 양보한다(id 셀렉터로 Tailwind text-[20px] 를 이긴다). */
    @media (max-width: 389px) {
        #calendar-title-display { font-size: 18px; }
    }
    /* 아주 좁은 화면(320px 등)에서는 월 이동과 표시 토글이 한 줄에서 겹친다.
       라벨만 접고 아이콘은 남긴다 — 선택 상태는 알약 배경으로 계속 읽히고, 이름은 aria-label/title 이 안내한다. */
    @media (max-width: 359px) {
        .cal-sticker-label { display: none; }
    }
    /* 감정 이모지는 셀 안에 머물러야 한다 — 셀이 줄면 함께 줄인다(잘림·겹침 방지) */
    .stamp-emoji {
        width: min(34px, calc(var(--oru-cal-cell) - 8px));
        height: min(34px, calc(var(--oru-cal-cell) - 8px));
    }
    #journal-side-panel {
        width: 100% !important;
        height: 85vh !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        border-left: none !important;
        border-top: 1px solid var(--md-sys-color-outline-variant) !important;
        border-radius: 24px 24px 0 0 !important;
        transform: translateY(100%) !important;
    }
    #journal-side-panel.open {
        transform: translateY(0) !important;
    }
}
@media (min-width: 768px) {
    #journal-side-panel.open {
        transform: translateX(0) !important;
    }
}

/* ===== 모바일 풀스크린 일기 표면 (B-2안: 홈=달력 주인공, 일기 읽기/쓰기=풀스크린 몰입) =====
   데스크톱(md+)은 2컬럼 인플레이스 유지 — openJournalFs 가 isMobileViewport 로 게이팅해
   #journal-bottom-board 는 우측 컬럼에 그대로 흐른다. 아래 규칙은 모바일에서만 적용된다.
   z-index 70 은 데모 스포트라이트(#demo-spotlight-svg, JS z-80) 아래라 데모 암전이 그대로 덮인다. */
#journal-fs-close { display: none; }

@media (max-width: 767px) {
    /* 뒷배경(달력) 스크롤 잠금 — 모바일 body 의 overflow:auto!important 를 이겨야 함 */
    body.journal-fs-open { overflow: hidden !important; }
    /* 보드의 기본 transition-all(300ms)이 FS 승격 순간 배경(투명→아이보리)·패딩(0→56px)을
       페이드시켜, 슬라이드업 위에 '반투명 찰나 플래시 + 콘텐츠 내려앉음'으로 겹쳐 보였다
       (2026-07-22 오너 제보). 표면 전환 연출은 journalFsIn 슬라이드 하나만 담당하도록
       모바일에선 보드 transition 을 끈다(진입·복귀 양방향 — 인플로 보드에선 쓰임 없음). */
    #journal-bottom-board { transition: none; }
    /* 보드를 100% 풀스크린 표면으로 승격 */
    body.journal-fs-open #journal-bottom-board {
        position: fixed;
        top: 0; right: 0; bottom: var(--oru-mobile-bottom-nav-inset); left: 0;
        z-index: 70; margin: 0; min-height: 0;
        background: var(--oru-surface-ivory);
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        padding: calc(var(--sat) + 44px) 0 0;
        animation: journalFsIn 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    }
    /* 읽기/쓰기 카드는 풀스크린에서 카드 크롬을 벗고 페이지처럼 흐른다(중첩 카드 느낌 제거).
       하단 여백은 스크롤 컨테이너(보드)의 padding-bottom 이 아니라 이 카드가 갖는다 —
       스크롤 컨테이너의 아래 패딩은 스크롤 가능 영역에 포함되지 않아(크롬) 끝까지 내려도
       마지막 요소(오루의 한마디)가 화면 아래끝에 붙어 잘려 보였다. */
    body.journal-fs-open #panel-mode-read,
    body.journal-fs-open #panel-mode-write {
        max-width: 700px; margin: 0 auto;
        border: none; box-shadow: none; border-radius: 0;
        background: transparent;
        padding: 0 20px calc(env(safe-area-inset-bottom, 0px) + 28px);
    }
    /* 긴 글에서도 완료 액션은 항상 손이 닿는 곳에 둔다. 풀스크린 보드와 액션 바 모두
       일반 흐름의 하단 내비 상단에서 끝나게 해, 앱 셸 내비가 저장 버튼을 덮지 못하게 한다. */
    body.journal-fs-open #panel-mode-write {
        padding-bottom: 92px;
        /* animate-fade-in 의 최종 transform 이 fixed 자식의 기준을 카드 전체 높이로 바꾸므로
           모바일은 보드 자체의 슬라이드만 사용한다. */
        animation: none;
        transform: none;
    }
    body.journal-fs-open .journal-write-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: var(--oru-mobile-bottom-nav-inset);
        z-index: 71;
        box-sizing: border-box;
        min-height: 64px;
        padding: 10px 20px;
        background: var(--oru-surface-ivory);
        border-top: 1px solid var(--oru-border-subtle);
        box-shadow: 0 -8px 24px rgba(20, 24, 20, 0.08);
    }
    body.journal-fs-open .journal-write-actions > button {
        min-height: 44px;
    }
    /* main 기준 풀스크린 닫기 버튼. 줄인 상단 여백에 맞춰 세로 위치만 12px 당긴다. */
    body.journal-fs-open #journal-fs-close {
        display: flex; position: fixed; top: calc(var(--sat) + 36px); right: 14px; z-index: 72;
        width: 40px; height: 40px; align-items: center; justify-content: center;
        border-radius: 9999px; background: var(--oru-surface-container);
        color: var(--oru-on-surface-variant); border: 1px solid var(--oru-border-subtle);
        box-shadow: 0 2px 10px rgba(96, 114, 102, 0.12);
        transition: transform 0.12s ease;
    }
    body.journal-fs-open #journal-fs-close:active { transform: scale(0.94); }
    body.journal-fs-open.journal-fs-from-search #journal-bottom-board {
        padding-top: calc(var(--sat) + 6px);
    }
    body.journal-fs-open.journal-fs-from-search #panel-search-return {
        min-height: 40px;
        margin-top: 0;
    }
    body.journal-fs-open #panel-write-inline-close { display: none; }
    /* 스크립티드 데모 중엔 닫기 버튼 숨김(데모가 자체 흐름 제어) */
    body.oru-demo-on #journal-fs-close { display: none !important; }
}

/* 모달이 열려 있는 동안 실제 페이지 스크롤러(main)와 모바일 일기 표면을 함께 잠근다.
   body 자체는 앱 셸 구조상 원래 overflow:hidden 이므로 두 내부 스크롤러를 직접 막아야 한다. */
body.oru-modal-open main,
body.oru-modal-open #journal-bottom-board {
    overflow: hidden !important;
    overscroll-behavior: none;
}
@keyframes journalFsIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    body.journal-fs-open #journal-bottom-board { animation: none; }
}

/* 오늘 날짜 세련된 맥박(Pulse) 링 효과 */
.today-highlight {
    position: relative;
    border: 2px solid var(--oru-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(63, 74, 67, 0.15) !important;
}
.today-highlight::after {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid var(--oru-primary);
    border-radius: 10px;
    opacity: 0.6;
    animation: today-pulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    pointer-events: none;
}
@keyframes today-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 0.2; }
    100% { transform: scale(1.1); opacity: 0; }
}

/* ==== 게스트 온보딩 튜토리얼 (말풍선 워크스루) ==== */
/* 대상 강조 링 — 움직임 없이 얇은 세이지 테두리만 남겨 실제 기능보다 튜토리얼이 더 튀지 않게 한다. */
.tutorial-glow {
    outline: 1px solid var(--oru-primary);
    outline-offset: 3px;
    border-radius: 12px;
    box-shadow: 0 0 0 3px var(--oru-surface-ivory);
}
#oru-tutorial-tooltip {
    position: absolute;
    z-index: 100;
    width: min(312px, calc(100vw - 24px));
    box-sizing: border-box;
    padding: 13px 14px 14px;
    border-radius: 1rem;
    /* v3 문구 겹침 근절: 완전 불투명 단색 토큰 배경(반투명/블러 제거 — 뒤 텍스트 비침 방지) */
    background: var(--oru-surface-ivory);
    border: 1px solid var(--oru-border-subtle);
    box-shadow: 0 16px 32px -14px rgba(20, 24, 20, 0.28), 0 4px 12px -8px rgba(20, 24, 20, 0.18);
    font-size: 13px;
    line-height: 1.6;
    color: var(--oru-on-surface);
    /* v3.3 등장은 JS revealTooltip 이 구동(스포트라이트 정착 250ms 뒤 transform: scale .96→1·translateY 10→0, 260ms).
       opacity 는 계속 1 — 반투명 구간 없음(문구 겹침 재발 방지). CSS 진입 애니 제거(즉시 등장 방지). */
}
/* @keyframes tutorial-tip-in 은 .oru-seq-tip(보상 시퀀스 말풍선)이 계속 사용하므로 유지. */
@keyframes tutorial-tip-in {
    0% { transform: translateY(8px); }
    100% { transform: translateY(0); }
}
#oru-tutorial-tooltip .oru-tut-head {
    display: flex; align-items: center; justify-content: flex-start; margin-bottom: 8px;
}
#oru-tutorial-tooltip .oru-tut-step {
    font-size: 12px; font-weight: 700; color: var(--oru-primary); letter-spacing: 0.02em;
}
#oru-tutorial-tooltip .oru-tut-skip {
    min-width: 104px; min-height: 44px; padding: 8px 4px;
    border: 0; border-radius: 10px;
    background: transparent; color: var(--oru-on-surface-variant);
    font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer;
    transition: color .15s ease, background-color .15s ease, transform .1s ease;
}
#oru-tutorial-tooltip .oru-tut-skip:hover {
    color: var(--oru-primary); background: var(--oru-surface-container-low);
}
#oru-tutorial-tooltip .oru-tut-skip:active { transform: scale(0.96); }
#oru-tutorial-tooltip .oru-tut-body { color: var(--oru-on-surface); font-size: 14px; line-height: 1.65; }
#oru-tutorial-tooltip .oru-tut-arrow {
    position: absolute;
    width: 12px; height: 12px;
    background: var(--oru-surface-ivory);
    transform: rotate(45deg);
    pointer-events: none;
}
#oru-tutorial-tooltip[data-placement="top"] .oru-tut-arrow {
    bottom: -6px;
    border-right: 1px solid var(--oru-border-subtle);
    border-bottom: 1px solid var(--oru-border-subtle);
}
#oru-tutorial-tooltip[data-placement="bottom"] .oru-tut-arrow {
    top: -6px;
    border-left: 1px solid var(--oru-border-subtle);
    border-top: 1px solid var(--oru-border-subtle);
}
/* 빠른 사용자는 [다음], 읽을 시간이 필요한 사용자는 단계별 계약 시간 뒤 자동 진행. */
/* 표시 여부는 JS 인라인 style.display 로 제어 — 여기선 flex 정렬 속성만(인라인 display:flex 시 적용) */
#oru-tutorial-tooltip .oru-tut-foot { align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
#oru-tutorial-tooltip .oru-tut-next {
    min-height: 44px; font-size: 13px; font-weight: 700; color: var(--oru-on-primary);
    background: var(--oru-primary); border: 0; cursor: pointer;
    min-width: 88px; margin-left: auto; padding: 7px 16px; border-radius: 12px; line-height: 1.4;
    transition: background-color .15s ease, transform .1s ease;
}
#oru-tutorial-tooltip .oru-tut-next:hover { background: var(--oru-surface-tint); }
#oru-tutorial-tooltip .oru-tut-next:active { transform: scale(0.96); }
#oru-tutorial-tooltip .oru-tut-skip:focus-visible,
#oru-tutorial-tooltip .oru-tut-next:focus-visible {
    outline: 2px solid var(--oru-accent);
    outline-offset: 2px;
}
/* 진행 버튼 비활성 상태 — :disabled 규칙이 hover/active 뒤에 와서 이긴다. */
#oru-tutorial-tooltip .oru-tut-next:disabled {
    background: var(--oru-surface-container-high); color: var(--oru-on-surface-variant);
    cursor: not-allowed; transform: none;
}
/* 모바일 전환 튜토리얼: 대상과 설명을 한 장면으로 읽되, 터치 목표는 44px 이상 유지한다.
   위치는 JS가 safe-area 안에서 대상 위/아래를 고르고 필요할 때만 묶음 단위로 스크롤한다. */
@media (max-width: 767px) {
    #oru-tutorial-tooltip {
        width: min(328px, calc(100vw - 32px));
        padding: 14px 15px 15px;
        border-radius: 16px;
        box-shadow: 0 14px 28px -14px rgba(20, 24, 20, 0.26), 0 4px 10px -8px rgba(20, 24, 20, 0.16);
    }
    #oru-tutorial-tooltip .oru-tut-head {
        gap: 8px;
        margin-bottom: 7px;
    }
    #oru-tutorial-tooltip .oru-tut-step {
        font-size: 12px;
        line-height: 1.35;
    }
    #oru-tutorial-tooltip .oru-tut-skip {
        min-width: 108px;
        min-height: 44px;
        padding: 8px 4px;
        font-size: 12px;
        flex-shrink: 0;
    }
    #oru-tutorial-tooltip .oru-tut-body {
        font-size: 14px;
        line-height: 1.55;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }
    #oru-tutorial-tooltip .oru-tut-foot {
        margin-top: 12px;
    }
    #oru-tutorial-tooltip .oru-tut-next {
        width: auto;
        min-width: 96px;
        min-height: 44px;
        padding: 10px 16px;
        border-radius: 12px;
        font-size: 14px;
    }
}
@media (max-width: 374px) {
    #oru-tutorial-tooltip {
        width: calc(100vw - 24px);
        padding: 13px 14px 14px;
    }
}
/* AI 다듬기 제안 diff — 원문 대비 달라진 어절 강조(회원·게스트·데모 공통 renderRefineDiff). 단색 팔레트 토큰만.
   #about-refine-demo-text: 소개 탭 다듬기 예시 카드도 같은 하이라이트를 공유(하드코딩 예시, renderRefineDiff 미사용). */
/* AI 다듬기 선택 칩 강조(v3: 칩=선택, 실행은 별도 버튼). 단색 팔레트 토큰만. */
.style-chip.refine-selected {
    border-color: var(--oru-primary);
    color: var(--oru-primary);
    background: var(--oru-primary-fixed);
    box-shadow: inset 0 0 0 1px var(--oru-primary);
}
#ai-suggest-text mark.refine-diff,
#about-refine-demo-text mark.refine-diff {
    background: var(--oru-badge-date);
    color: var(--oru-on-surface);
    border-radius: 4px;
    padding: 0 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
/* 검색 v2 근거 카드 스니펫 하이라이트 — refine-diff 와 동일 단색 팔레트 토큰(마킹은 DOM 전용) */
mark.search-hl {
    background: var(--oru-badge-date);
    color: var(--oru-on-surface);
    border-radius: 4px;
    padding: 0 2px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
/* ==== 저장 보상 시퀀스 안내 말풍선 (guest-seq-shield z-80 위·모달 z-95 아래) ==== */
.oru-seq-tip {
    position: absolute;
    z-index: 90;
    width: min(300px, calc(100vw - 24px));
    padding: 14px 16px;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--oru-surface-container-high) 96%, transparent);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid color-mix(in srgb, var(--oru-primary) 22%, transparent);
    box-shadow: 0 22px 44px -12px rgba(20, 24, 20, 0.4), 0 6px 16px -8px rgba(20, 24, 20, 0.28);
    font-size: 13px; line-height: 1.6; color: var(--oru-on-surface);
    animation: tutorial-tip-in 0.24s cubic-bezier(0.24, 0, 0.38, 1) both;
}
.oru-seq-tip .oru-seq-tip-body { color: var(--oru-on-surface); margin-bottom: 12px; }
.oru-seq-tip .oru-seq-tip-btn {
    display: block; width: 100%; text-align: center;
    font-size: 13px; font-weight: 700; color: var(--oru-on-primary);
    background: var(--oru-primary); border: 0; cursor: pointer;
    padding: 9px 14px; border-radius: 12px; line-height: 1.4;
    transition: background-color .15s ease, transform .1s ease;
}
.oru-seq-tip .oru-seq-tip-btn:hover { background: var(--oru-surface-tint); }
.oru-seq-tip .oru-seq-tip-btn:active { transform: scale(0.98); }
.oru-seq-tip .oru-seq-tip-arrow {
    position: absolute; width: 12px; height: 12px;
    background: color-mix(in srgb, var(--oru-surface-container-high) 96%, transparent);
    transform: rotate(45deg); pointer-events: none;
}
.oru-seq-tip[data-placement="top"] .oru-seq-tip-arrow {
    bottom: -6px;
    border-right: 1px solid color-mix(in srgb, var(--oru-primary) 22%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--oru-primary) 22%, transparent);
}
.oru-seq-tip[data-placement="bottom"] .oru-seq-tip-arrow {
    top: -6px;
    border-left: 1px solid color-mix(in srgb, var(--oru-primary) 22%, transparent);
    border-top: 1px solid color-mix(in srgb, var(--oru-primary) 22%, transparent);
}
@media (prefers-reduced-motion: reduce) {
    .tutorial-glow { animation: none; }
    #oru-tutorial-tooltip { animation: none; }
    .oru-seq-tip { animation: none; }
}
/* ==== 스크립티드 데모(OruDemo) 전용 시각 요소 — 단색 팔레트 토큰만(불투명도 변형 금지) ==== */
/* 보드 비활성화 — 포커스·롱프레스 셀렉션·오조작 원천 차단(실드와 별개의 보강층) */
.demo-inert { pointer-events: none; -webkit-user-select: none; user-select: none; }
/* 다듬기 '다정하게' 칩 데모 하이라이트 — 데모는 실제 다듬기(requestAIRefine) 미호출(시각 연출 전용, 전역 selectedRefineStyle 불변) */
.demo-chip-active {
    background: var(--oru-primary) !important;
    color: var(--oru-on-primary) !important;
    border-color: var(--oru-primary) !important;
    animation: demoChipShimmer 0.7s ease-in-out;
}
@keyframes demoChipShimmer {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--oru-primary) 40%, transparent); }
    50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--oru-primary) 22%, transparent); }
}
/* AI 다듬기 칩셋 — 줄바꿈 배치(flex-wrap): 모바일 2줄·PC 1줄, 잘림/스크롤 없음
   (가로 스크롤 시안은 실기기에서 5번째 칩이 잘려 미완성처럼 보여 폐기 — 오너 피드백 2026-07-21) */
#oru-tutorial-tooltip .oru-tut-body { white-space: pre-line; }
/* v3.1 시선 집중 스포트라이트 — SVG 구멍 오버레이(#demo-spotlight-svg, JS 렌더).
   iOS Safari에서 box-shadow 200vmax가 미렌더되던 v3 결함을 대체(fixed z-80 evenodd path). CSS 불필요. */
/* '눌리는' 프레스 펄스 — 드롭존·아코디언 토글·칩·저장 버튼(transform+링, 단색 토큰) */
@keyframes demoPress {
    0% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--oru-primary) 30%, transparent); }
    45% { transform: scale(0.94); box-shadow: 0 0 0 6px color-mix(in srgb, var(--oru-primary) 22%, transparent); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 color-mix(in srgb, var(--oru-primary) 0%, transparent); }
}
.demo-press { animation: demoPress 0.6s cubic-bezier(0.34, 0, 0.3, 1); }
/* [반영] 직후 본문 하이라이트 플래시(링) */
@keyframes demoFlash {
    0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--oru-primary) 45%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--oru-primary) 0%, transparent); }
}
.demo-flash { animation: demoFlash 0.9s ease-out; border-radius: 12px; }
/* v3.2 반영 확인 스윕 — 본문이 다듬어진 순간을 1.4s 은은한 하이라이트로 인지시킴 */
@keyframes demoFlashSweep {
    0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--oru-primary) 42%, transparent); background-color: color-mix(in srgb, var(--oru-primary) 12%, transparent); }
    60% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--oru-primary) 20%, transparent); }
    100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--oru-primary) 0%, transparent); background-color: transparent; }
}
.demo-flash-sweep { animation: demoFlashSweep 1.4s ease-out; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) {
    .demo-chip-active, .demo-press, .demo-flash, .demo-flash-sweep { animation: none !important; }
}
/* 일기장 속지 스타일 — 소개 탭 다이어리 카드 */
.diary-page-card {
    position: relative;
    background-color: #FAF9F6;
    border: 1px solid #E5E2DA;
    border-radius: 16px;
    padding: 24px 24px 24px 38px; /* 왼쪽에 바인더 스프링용 패딩 확보 */
    box-shadow: 0 4px 12px rgba(90, 107, 95, 0.06);
    overflow: hidden;
    /* 은은한 가로줄 줄노트 텍스처 */
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        rgba(90, 107, 95, 0.035) 27px,
        rgba(90, 107, 95, 0.035) 28px
    );
    background-size: 100% 28px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}
.diary-page-card:hover {
    transform: translateY(-4px);
    border-color: var(--oru-primary-fixed-dim);
    box-shadow: 0 12px 24px -8px rgba(74, 90, 80, 0.12);
}
/* 바인더 타공(구멍) 묘사 */
.diary-page-card::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 10%;
    bottom: 10%;
    width: 14px;
    background-image: radial-gradient(
        circle,
        #E5E2DA 3px,
        transparent 4px
    );
    background-size: 14px 40px;
    opacity: 0.85;
}
/* 바인더 금속 링 효과 */
.diary-page-card::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 10%;
    bottom: 10%;
    width: 12px;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 15px,
        #BAC5BE 15px,
        #A8B5AE 18px,
        transparent 18px,
        transparent 40px
    );
    opacity: 0.7;
}
/* 다크모드 대응 */
html.dark .diary-page-card {
    background-color: #242723;
    border-color: #383b36;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        rgba(255, 255, 255, 0.02) 27px,
        rgba(255, 255, 255, 0.02) 28px
    );
}
html.dark .diary-page-card::before {
    background-image: radial-gradient(
        circle,
        #383b36 3px,
        transparent 4px
    );
}
html.dark .diary-page-card::after {
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 15px,
        #4A5A50 15px,
        #3A4A3F 18px,
        transparent 18px,
        transparent 40px
    );
}
/* 다크모드 — 체험 예시 패널(반투명 흰 배경)이 다크 카드 위에서 눈부시지 않게 톤 다운
   (밝은 muted 텍스트가 밝은 패널에 묻히는 가독성 문제 방지. 아이콘 원(bg-white/70)은 스티커 느낌으로 유지) */
html.dark .diary-page-card .bg-white\/60 {
    background-color: rgba(255, 255, 255, 0.05);
}
html.dark .diary-page-card .bg-white\/80 {
    background-color: rgba(255, 255, 255, 0.07);
}
/* 불투명 흰 데모 카드(bg-white)도 다크에선 카드 표면색으로 — 밝은 text-on-surface 가
   순백 배경 위에서 사라지던 문제(cr 1.26) 해소. 반투명 /60·/70·/80 스티커는 위에서 별도 처리. */
html.dark .diary-page-card .bg-white {
    background-color: var(--oru-surface-container-low);
}
@media (prefers-reduced-motion: reduce) {
    .diary-page-card {
        transition: none;
    }
    .diary-page-card:hover {
        transform: none;
    }
}
/* 관리자 대시보드 진입 버튼 — PC(md+) & 어드민에게만 노출.
   switchTab이 사이드바 버튼의 className 을 통째로 교체하므로 Tailwind 클래스 토글로는
   숨김 상태가 깨진다. ID 셀렉터(특이성이 .flex 등 유틸 클래스보다 높음)로 결정적으로 제어한다. */
#menu-btn-admin { display: none; }
@media (min-width: 768px) {
    body.is-admin #menu-btn-admin { display: flex; }
}

/* ── 설정 화면 IA (2026-08-04) — 목록 ↔ 상세 ─────────────────────────────
   모바일: 설정 목록 한 화면 → 항목을 누르면 그 항목만 있는 상세 화면(드릴다운).
   PC(md+): 왼쪽 목록 레일 + 오른쪽 상세를 동시에 보는 마스터-디테일.
   표시/숨김은 이 블록이 단독으로 소유한다. 컨테이너에 Tailwind `hidden` 을 함께 쓰면
   ID 특이도 싸움이 나므로(설정 탭 자체의 .hidden 과 별개) 상태 클래스로만 제어한다. */
.oru-settings-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    /* 설정 탭(flex-1)의 남은 높이를 그대로 물려받는다 — 내용이 짧아도 마지막 항목과
       하단 내비 사이 여백이 공통 main 여백(내비 높이 + 15px)으로 유지된다(E2E 계약). */
    flex: 1 0 auto;
}
.oru-settings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.oru-settings-detail {
    display: none;
}
/* 상세 전용 뒤로가기 — 목록에서는 감춘다(하단 내비가 최상위 이동을 담당).
   Tailwind hidden 과 특이도 싸움이 나지 않도록 ID 규칙이 단독으로 소유한다. */
#settings-back-btn {
    display: none;
}
#tab-content-settings.settings-detail-open #settings-back-btn {
    display: flex;
}
#tab-content-settings.settings-detail-open .oru-settings-list {
    display: none;
}
#tab-content-settings.settings-detail-open .oru-settings-detail {
    display: block;
}

/* 그룹(계정·오루 맞춤·앱·데이터) — 캡션 + 행 묶음 카드 */
.oru-settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.oru-settings-group-title {
    padding: 0 4px;
    font-family: 'Outfit', 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--oru-text-muted);
}
.oru-settings-card {
    background-color: var(--oru-surface-ivory);
    border: 1px solid var(--oru-border-subtle);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(96, 114, 102, 0.04);
}
.oru-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 12px 14px;
    text-align: left;
    background-color: transparent;
    transition: background-color 0.15s ease;
}
.oru-settings-row + .oru-settings-row {
    border-top: 1px solid var(--oru-border-subtle);
}
/* 조건부로 접히는 행(예: 알림) — Tailwind hidden 과 특이도가 같아 순서 싸움이 나므로 전용 클래스로 잠근다 */
.oru-settings-row.is-hidden {
    display: none;
}
.oru-settings-row:hover {
    background-color: var(--oru-surface-container);
}
.oru-settings-row:active {
    background-color: var(--oru-surface-container-high);
}
.oru-settings-row-icon {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--oru-primary);
}
.oru-settings-row-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--oru-on-surface);
    line-height: 1.4;
}
.oru-settings-row-value {
    margin-left: auto;
    min-width: 0;
    max-width: 46%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-size: 12px;
    color: var(--oru-text-muted);
}
.oru-settings-row-chevron {
    flex-shrink: 0;
    font-size: 20px;
    color: var(--oru-text-muted);
}
.oru-settings-foot {
    padding: 2px 4px 0;
    text-align: center;
}

/* 상세 지면 — 한 번에 한 항목만 활성 */
.oru-settings-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
}
.oru-settings-panel.is-active {
    display: flex;
}
.oru-settings-panel-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.oru-settings-panel-title {
    font-family: 'Outfit', 'Pretendard', 'Noto Sans KR', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--oru-on-surface);
}
.oru-settings-panel-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--oru-text-muted);
}

/* 2단(레일 + 상세)은 lg(1024) 부터. 768~1023 은 사이드바 260px 때문에 본문이 508px 뿐이라
   레일을 세우면 상세가 204px 로 눌린다 — 그 구간은 모바일과 같은 드릴다운을 쓴다. */
@media (min-width: 1024px) {
    .oru-settings-shell {
        flex-direction: row;
        align-items: flex-start;
        gap: 28px;
    }
    /* PC 는 목록과 상세를 항상 함께 보여준다 — 상세 열림 상태 규칙과 같은 특이도로 덮는다 */
    #tab-content-settings .oru-settings-list,
    #tab-content-settings.settings-detail-open .oru-settings-list {
        display: flex;
        position: sticky;
        top: 4px;
        width: 240px;
        flex-shrink: 0;
    }
    #tab-content-settings .oru-settings-detail,
    #tab-content-settings.settings-detail-open .oru-settings-detail {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
    }
    /* PC 는 목록이 늘 곁에 있어 뒤로가기가 필요 없다 */
    #tab-content-settings.settings-detail-open #settings-back-btn {
        display: none;
    }
    /* 레일에서는 현재 값·꺾쇠를 접는다 — 값은 오른쪽 상세 지면이 그대로 보여준다 */
    .oru-settings-row-value,
    .oru-settings-row-chevron {
        display: none;
    }
    .oru-settings-row.is-active {
        background-color: var(--oru-secondary-container);
    }
    .oru-settings-row.is-active .oru-settings-row-label,
    .oru-settings-row.is-active .oru-settings-row-icon {
        color: var(--oru-on-secondary-container);
    }
    .oru-settings-panel-title {
        font-size: 22px;
    }
}

@media (min-width: 1280px) {
    /* 폭에 여유가 생기면 레일을 조금 넓혀 긴 항목 이름이 두 줄로 접히지 않게 한다 */
    #tab-content-settings .oru-settings-list,
    #tab-content-settings.settings-detail-open .oru-settings-list {
        width: 276px;
    }
}
