/* ===== Reset & tokens ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);

  /* 다크 (봄날의 냥이) */
  --bg: #0c0c0c;
  --text: #eef2f5;
  --muted: rgba(238, 242, 245, 0.5);
  --line: rgba(238, 242, 245, 0.16);
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.12);
  --panel: #16130f;
  --heading-from: #7a7f88;
  --heading-to: #cdd6de;
  --heading-shadow: #23272e;
  --accent: #ff7a59;
  --accent-2: #ff5c8a;
  --btn-grad: linear-gradient(135deg, #ff8a5b 0%, #ff5c8a 100%);
  --on-accent: #ffffff;
  --praise: #ffd0a8;
  --warn: #ff8a9c;
  --scrim-1: rgba(0, 0, 0, 0.3);
  --scrim-2: rgba(0, 0, 0, 0.42);
  --scrim-3: rgba(0, 0, 0, 0.52);
  --topbar-scrim: rgba(12, 12, 12, 0.10);
  /* 헤더·도크 공통 프로스티드 배경(같은 값 → 두 영역이 하나처럼 이어짐) */
  --bar-bg: rgba(10, 10, 10, 0.72);
}

/* 라이트 (숲으로 냥이) */
:root[data-theme="light"] {
  --bg: #e9f2ec;
  --text: #14532d;
  --muted: rgba(20, 83, 45, 0.82);
  --line: rgba(20, 83, 45, 0.2);
  --surface: rgba(255, 255, 255, 0.68);
  --surface-2: rgba(255, 255, 255, 0.9);
  --panel: #f6faf7;
  --heading-from: #0f4429;
  --heading-to: #2f7a4a;
  --heading-shadow: #0a3b22;
  --accent: #1e9e4b;
  --accent-2: #6fce8a;
  --btn-grad: linear-gradient(135deg, #2fbf60 0%, #148a42 100%);
  --on-accent: #ffffff;
  --praise: #146c37;
  --warn: #d84860;
  /* 흰 레이어는 아주 살짝만 → 영상 색감 유지 (하단만 조금 더) */
  --scrim-1: rgba(255, 255, 255, 0.08);
  --scrim-2: rgba(255, 255, 255, 0.14);
  --scrim-3: rgba(255, 255, 255, 0.3);
  --topbar-scrim: rgba(240, 247, 242, 0.10);
  --bar-bg: rgba(255, 255, 255, 0.78); /* 라이트=흰색 */
}

html,
body {
  min-height: 100%;
}

/* Theme background while image assets load. */
html {
  background: var(--bg);
}

/* The Android system navigation area can reveal the document background below
   the WebView viewport while the full-screen intro dialog is open. */
:root:has(.brand-splash[open]) {
  background: #fff8e8;
}

body {
  font-family: "Jua", sans-serif;
  color: var(--text);
  background: transparent;
  overflow-x: clip;
  /* 상단: 헤더+상태바 / 하단: 탭바+홈 인디케이터 만큼 여백 */
  padding: calc(4.75rem + env(safe-area-inset-top)) 1.25rem calc(5.25rem + env(safe-area-inset-bottom));
}

.bg-image {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: center / cover no-repeat;
  overflow: hidden;
}
/* 원본 배경을 아주 느리게 움직여 사진 같은 깊이감을 유지한다. */
.bg-image[data-motion="light"] { animation: bg-drift-light 14s ease-in-out infinite alternate; }
.bg-image[data-motion="dark"] { animation: bg-drift-dark 20s ease-in-out infinite alternate; }
.bg-image::before,
.bg-image::after {
  content: ""; position: absolute; inset: -12%; pointer-events: none;
}
/* 낙하 레이어: 기본 냥의 꽃잎. 라이트·다크 양쪽에 같은 계절감을 쓴다. */
.bg-image[data-scene="hanya-yellow-light"]::before,
.bg-image[data-scene="hanya-yellow-dark"]::before {
  /* 작은 꽃잎을 넉넉히 배치해, 배경 사진 위에서도 흐드러지는 느낌이 난다. */
  background:
    radial-gradient(ellipse 4px 9px at 12% 10%, rgba(255,241,151,.94) 0 52%, transparent 58%),
    radial-gradient(ellipse 4px 8px at 27% 4%, rgba(255,234,118,.95) 0 52%, transparent 58%),
    radial-gradient(ellipse 5px 9px at 34% 21%, rgba(255,220,63,.9) 0 52%, transparent 58%),
    radial-gradient(ellipse 6px 10px at 51% 7%, rgba(255,211,48,.9) 0 52%, transparent 58%),
    radial-gradient(ellipse 4px 9px at 58% 29%, rgba(255,239,140,.92) 0 52%, transparent 58%),
    radial-gradient(ellipse 5px 9px at 66% 52%, rgba(255,221,71,.86) 0 52%, transparent 58%),
    radial-gradient(ellipse 6px 10px at 81% 35%, rgba(255,213,54,.9) 0 52%, transparent 58%),
    radial-gradient(ellipse 4px 9px at 88% 5%, rgba(255,239,138,.92) 0 52%, transparent 58%),
    radial-gradient(ellipse 5px 10px at 95% 59%, rgba(255,217,66,.84) 0 52%, transparent 58%),
    radial-gradient(ellipse 4px 8px at 15% 73%, rgba(255,240,149,.88) 0 52%, transparent 58%),
    radial-gradient(ellipse 5px 9px at 39% 68%, rgba(255,220,68,.86) 0 52%, transparent 58%),
    radial-gradient(ellipse 5px 9px at 85% 76%, rgba(255,217,66,.84) 0 52%, transparent 58%);
  animation: flower-fall 20s linear infinite;
}
/* 가을 단풍: 여우냥 전용 라이트·다크. */
.bg-image[data-scene="fox-autumn-light"]::before,
.bg-image[data-scene="fox-autumn-dark"]::before {
  background:
    radial-gradient(ellipse 6px 9px at 10% 5%, rgba(214,82,27,.9) 0 54%, transparent 58%),
    radial-gradient(ellipse 5px 8px at 28% 25%, rgba(248,159,47,.9) 0 54%, transparent 58%),
    radial-gradient(ellipse 6px 9px at 52% 9%, rgba(181,58,25,.86) 0 54%, transparent 58%),
    radial-gradient(ellipse 5px 8px at 77% 19%, rgba(241,128,32,.88) 0 54%, transparent 58%),
    radial-gradient(ellipse 6px 9px at 90% 52%, rgba(206,75,24,.78) 0 54%, transparent 58%),
    radial-gradient(ellipse 5px 8px at 38% 63%, rgba(245,150,41,.84) 0 54%, transparent 58%);
  animation: autumn-leaf-fall 15s ease-in-out infinite;
}
/* 남산 산책길: 나뭇잎은 양쪽 모드에서 흩날린다. */
.bg-image[data-scene="rangyi-namsan-light"]::before,
.bg-image[data-scene="rangyi-namsan-dark"]::before {
  background:
    radial-gradient(ellipse 5px 10px at 14% 2%, rgba(113,141,65,.8) 0 53%, transparent 57%),
    radial-gradient(ellipse 6px 9px at 35% 21%, rgba(179,145,63,.82) 0 53%, transparent 57%),
    radial-gradient(ellipse 5px 9px at 65% 8%, rgba(87,123,64,.82) 0 53%, transparent 57%),
    radial-gradient(ellipse 6px 10px at 86% 27%, rgba(163,125,51,.78) 0 53%, transparent 57%),
    radial-gradient(ellipse 5px 8px at 52% 55%, rgba(92,127,65,.76) 0 53%, transparent 57%),
    radial-gradient(ellipse 5px 9px at 9% 68%, rgba(173,142,63,.74) 0 53%, transparent 57%);
  animation: namsan-leaf-fall 16s ease-in-out infinite;
}
/* 라이트 배경의 얇은 구름: 기본 냥과 멍이뇽의 열린 하늘에만 적용한다. */
.bg-image[data-scene="hanya-yellow-light"]::after,
.bg-image[data-scene="rangyi-namsan-light"]::after {
  /* 구름은 넓고 흐린 덩어리로 만들어 사진 안에서도 움직임을 바로 알아볼 수 있게 한다. */
  background:
    radial-gradient(ellipse 25% 9% at 5% 16%, rgba(255,255,255,.56) 0 42%, transparent 50%),
    radial-gradient(ellipse 18% 8% at 18% 13%, rgba(255,255,255,.45) 0 42%, transparent 50%),
    radial-gradient(ellipse 29% 10% at 68% 26%, rgba(255,255,255,.48) 0 42%, transparent 50%),
    radial-gradient(ellipse 20% 8% at 83% 21%, rgba(255,255,255,.38) 0 42%, transparent 50%),
    radial-gradient(ellipse 19% 7% at 40% 7%, rgba(255,255,255,.38) 0 42%, transparent 50%);
  filter: blur(7px);
  animation: cloud-drift 11s ease-in-out infinite alternate;
}
/* 모든 다크 배경에는 별빛만 은은하게 깜빡인다. */
.bg-image[data-motion="dark"]::after {
  /* 별은 화면 전체에 흩뿌리고, 밝기·크기·광채를 함께 펄스한다. */
  background-image:
    radial-gradient(circle at 7% 13%, rgba(255,255,255,1) 0 1px, transparent 2.1px),
    radial-gradient(circle at 16% 20%, rgba(255,238,166,1) 0 1.4px, transparent 3px),
    radial-gradient(circle at 24% 8%, rgba(255,247,207,.95) 0 1px, transparent 2.2px),
    radial-gradient(circle at 33% 35%, rgba(255,255,255,.92) 0 1.2px, transparent 2.5px),
    radial-gradient(circle at 43% 13%, rgba(255,246,202,.95) 0 1.7px, transparent 3.5px),
    radial-gradient(circle at 51% 23%, rgba(255,255,255,.9) 0 1px, transparent 2.2px),
    radial-gradient(circle at 58% 31%, rgba(255,255,255,.9) 0 1.3px, transparent 2.7px),
    radial-gradient(circle at 66% 7%, rgba(255,241,180,.94) 0 1px, transparent 2.2px),
    radial-gradient(circle at 74% 17%, rgba(255,238,166,.98) 0 1.8px, transparent 3.8px),
    radial-gradient(circle at 83% 28%, rgba(255,255,255,.92) 0 1.1px, transparent 2.4px),
    radial-gradient(circle at 93% 12%, rgba(255,241,180,.9) 0 1px, transparent 2.2px),
    radial-gradient(circle at 11% 48%, rgba(255,247,211,.9) 0 1.1px, transparent 2.4px),
    radial-gradient(circle at 26% 63%, rgba(255,238,166,.9) 0 1.3px, transparent 2.8px),
    radial-gradient(circle at 41% 53%, rgba(255,255,255,.9) 0 1px, transparent 2.2px),
    radial-gradient(circle at 57% 69%, rgba(255,242,183,.95) 0 1.7px, transparent 3.5px),
    radial-gradient(circle at 72% 56%, rgba(255,255,255,.9) 0 1.1px, transparent 2.4px),
    radial-gradient(circle at 88% 42%, rgba(255,255,255,.96) 0 1.5px, transparent 3px),
    radial-gradient(circle at 95% 73%, rgba(255,238,166,.9) 0 1px, transparent 2.2px);
  filter: drop-shadow(0 0 3px rgba(255,231,137,.8));
  animation: star-twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes bg-drift-light { from { background-position: 50% 50%; } to { background-position: 52% 45%; } }
@keyframes bg-drift-dark { from { background-position: 50% 50%; } to { background-position: 47% 45%; } }
@keyframes star-twinkle { from { opacity: .35; filter: drop-shadow(0 0 1px rgba(255,231,137,.25)); } to { opacity: 1; filter: drop-shadow(0 0 7px rgba(255,231,137,1)); } }
@keyframes flower-fall { 0% { transform: translate3d(-6%, -24%, 0) rotate(-18deg); opacity: .75; } 45% { transform: translate3d(8%, 14%, 0) rotate(22deg); opacity: 1; } 100% { transform: translate3d(-5%, 44%, 0) rotate(48deg); opacity: .62; } }
@keyframes autumn-leaf-fall { 0% { transform: translate3d(-4%, -16%, 0) rotate(-18deg); } 50% { transform: translate3d(7%, 11%, 0) rotate(18deg); } 100% { transform: translate3d(-3%, 31%, 0) rotate(42deg); } }
@keyframes namsan-leaf-fall { 0% { transform: translate3d(3%, -18%, 0) rotate(12deg); } 50% { transform: translate3d(-6%, 13%, 0) rotate(-16deg); } 100% { transform: translate3d(4%, 32%, 0) rotate(26deg); } }
@keyframes cloud-drift { from { transform: translate3d(-11%, -1%, 0) scale(1); opacity: .56; } to { transform: translate3d(12%, 3%, 0) scale(1.04); opacity: .9; } }
@media (prefers-reduced-motion: reduce) {
  .bg-image[data-motion],
  .bg-image::before,
  .bg-image::after { animation: none; }
  .bg-image[data-motion="dark"]::after { opacity: .45; }
}


/* Background overlay for text readability. */
.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    var(--scrim-1) 0%,
    var(--scrim-2) 50%,
    var(--scrim-3) 100%
  );
}

.debug-package-tools {
  margin-top: 1rem;
  padding: .8rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.debug-bg-label { display: grid; gap: .4rem; margin-top: .8rem; color: var(--muted); font-size: .9rem; }
.debug-package-tools p { color: var(--muted); font-size: .84rem; margin-bottom: .55rem; }
.debug-package-tools div { display: flex; flex-wrap: wrap; gap: .45rem; }
.debug-package-tools .btn-ghost { min-height: 40px; padding: .45rem .7rem; font-size: .9rem; }

/* iOS WKWebView는 음수 z-index의 동영상 합성 레이어를 콘텐츠 위로 올리는 경우가 있다.
   콘텐츠만 영상 위로 올리고, 고정 탭바의 position은 그대로 보존한다. */
.topbar-wrap,
.wrap {
  z-index: 2;
}



/* ===== Layout ===== */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 0.9rem;
}

.eyebrow {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.8rem;
  color: var(--text);
  opacity: 0.7;
}

/* Liquid Glass heading: 속은 완전 투명(배경이 그대로 비침),
   유리감은 밝은 테두리 림 + 얇은 사선 광택 + 떠 있는 깊이 그림자로만 표현 */
.hero-heading {
  /* 대부분 투명, 위쪽에 가는 광택 한 줄만 (배경이 비쳐 보이도록) */
  background: linear-gradient(
    122deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 255, 255, 0.28) 46%,
    rgba(255, 255, 255, 0) 54%,
    rgba(255, 255, 255, 0.08) 74%,
    rgba(255, 255, 255, 0) 90%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.85); /* 유리 테두리 림 */
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 1;
  font-size: clamp(1.25rem, 5.5vw, 2rem); /* 컴팩트: 기능(할 일)이 첫 화면에 보이도록 */
  margin: 0.55rem 0 0.55rem; /* 헤더~부제 사이 균형 있게 */
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),      /* 림 선명하게 */
    0 1px 2px rgba(255, 255, 255, 0.25),   /* 하단 굴절광 */
    0 5px 14px rgba(0, 0, 0, 0.24);        /* 떠 있는 깊이 그림자 */
}
/* 라이트(숲) 배경: 밝은 바탕 → 살짝 어두운 그림자로 투명 유리의 윤곽 유지 */
:root[data-theme="light"] .hero-heading {
  -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.95);
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.9),
    0 2px 3px rgba(0, 0, 0, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.14);
}

.subtitle {
  font-weight: 300;
  letter-spacing: 0.02em;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  color: var(--text);
  opacity: 0.65;
}

/* ===== Add form ===== */
#add-form {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}
/* 입력이 무의미할 때(3개 미완료 / 4개 꽉 참) JS가 hidden 처리 → 완전히 감춤
   ([hidden] 기본값은 위 display:flex에 밀리므로 명시적으로 재정의) */
#add-form[hidden] { display: none; }

/* 보너스까지 4개를 다 채우면 [추가] 버튼을 부드럽게 접고 인풋을 끝까지 확장 */
#add-form .btn-gradient {
  max-width: 8rem;
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease),
    max-width 0.35s var(--ease), padding 0.35s var(--ease), opacity 0.3s var(--ease);
}
#add-form.bonus-full { gap: 0; }
#add-form.bonus-full .btn-gradient {
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

#input {
  flex: 1;
  min-width: 0; /* flex 아이템이 고유폭(기본 size=20) 아래로 줄어 버튼 잘림 방지 */
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 300;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

#input::placeholder {
  color: var(--muted);
}

/* 비활성(입력 불가) 상태: 흐려지지 않게 유지 — 메시지만 보여주는 용도 */
#input:disabled {
  opacity: 1;
  cursor: default;
  -webkit-text-fill-color: var(--muted);
}

/* 모바일(≤400px): 패딩만 줄임. 폰트는 16px 유지 — 16px 미만이면 iOS가 포커스 시 자동 확대함 */
@media (max-width: 400px) {
  #input { padding: 0.9rem 0.95rem; }
}

#input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}

/* Gradient pill button (spec ContactButton) */
.btn-gradient {
  flex-shrink: 0;
  padding: 0.9rem 1.75rem;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.8rem;
  cursor: pointer;
  background: var(--btn-grad);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s var(--ease), filter 0.25s var(--ease);
}

.btn-gradient:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

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

/* ===== Count + limit hint ===== */
.todo-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.todo-count {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.todo-count b {
  color: var(--text);
  transition: color 0.25s var(--ease);
}

.todo-count.full b {
  color: var(--accent);
}

.progress-msg {
  min-height: 1.4rem;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--praise);
}

.progress-msg.warn {
  color: var(--warn);
}

.progress-msg.typing::after {
  content: "▋";
  margin-left: 1px;
  color: var(--accent);
  animation: caret-blink 0.9s step-end infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-msg.typing::after { animation: none; }
}

/* ===== List ===== */
#list {
  list-style: none;
}

#list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 0.25rem;
  border-bottom: 1px solid var(--line);
}

#list li:last-child {
  border-bottom: none;
}

/* item entrance pop */
#list li.pop {
  animation: popIn 0.5s var(--ease) both;
}

#list input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

#list .text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 300;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  transition: color 0.25s var(--ease), opacity 0.25s var(--ease);
}

#list li.done .text {
  text-decoration: line-through;
  opacity: 0.4;
}

#list .todo-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.35rem;
  width: 100%;
  padding-top: 0.15rem;
}

#list .todo-action,
#list .remove {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

#list .todo-action:hover,
#list .remove:hover {
  background: var(--surface-2);
  border-color: var(--muted);
}

#list .todo-action.repeat.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

@media (max-width: 400px) {
  #list li { gap: 0.6rem; }
  #list .todo-action,
  #list .remove { font-size: 0.62rem; padding: 0.36rem 0.5rem; }
}

.empty {
  text-align: center;
  color: var(--muted);
  font-weight: 300;
  padding: 2rem 0;
}

/* ===== Entrance animations ===== */
.anim {
  opacity: 0;
  animation: fadeInUp 0.7s var(--ease) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .anim,
  #list li.pop {
    animation: none;
    opacity: 1;
  }
}

/* ===== Mascot ===== */
#mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
}
/* 마스코트: mood별 표정 이미지(사용자 액션 → persona가 data-mood 설정) */
.cat {
  position: relative;
  width: 150px;
  height: 150px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  animation: bob 3s var(--ease) infinite;
}
/* 이미지 출처는 JS(applyCharacter)가 --cat-* 변수로 주입 → 캐릭터 교체가 데이터 구동 */
.cat[data-mood="idle"]      { background-image: var(--cat-idle); }
.cat[data-mood="happy"]     { background-image: var(--cat-happy); }
.cat[data-mood="proud"]     { background-image: var(--cat-proud); }
.cat[data-mood="party"]     { background-image: var(--cat-party); }
.cat[data-mood="sad"]       { background-image: var(--cat-sad); }
.cat[data-mood="angry"]     { background-image: var(--cat-angry); }
.cat[data-mood="surprised"] { background-image: var(--cat-surprised); }

.streak {
  position: absolute; top: -6px; right: -10px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.15rem 0.6rem; font-size: 0.8rem; font-weight: 500;
}

.bubble {
  max-width: 300px; text-align: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  border-radius: 18px; padding: 0.7rem 1rem;
  font-weight: 300; font-size: 1rem; line-height: 1.4;
  animation: popIn 0.4s var(--ease) both;
  /* 명언/문구는 최대 3줄까지만 (길면 사용자 피로) */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 스크롤 도크(미니 마스코트 + 말풍선) — 배경/블러는 .topbar-wrap이 담당 ===== */
.mascot-dock {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.2rem 0.9rem 0.6rem;
  background: transparent;
  animation: dockIn 0.25s var(--ease);
}
.mascot-dock[hidden] { display: none; }
.cat--mini {
  width: 48px; height: 48px;
  animation: none;
  flex-shrink: 0;
}
.bubble--mini {
  margin: 0;
  flex: 1;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.3;
  padding: 0.4rem 0.75rem;
  animation: none;
  -webkit-line-clamp: 2; /* 도크에선 2줄로 더 짧게 */
}
@keyframes dockIn {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

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

/* 캐릭터 칩(계정 패널): 좁은 폭에서 줄바꿈 */
.chips {
  display: flex; gap: 0.5rem;
  flex-wrap: wrap;
  padding: 2px 0;
}
/* 입력 중에도 진행 상태와 기존 할 일을 보여줘서, 목록을 확인하며 다음 할 일을 적을 수 있게 한다. */
.chip {
  flex: 0 0 auto; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  font-family: inherit; font-weight: 500; font-size: 0.8rem;
  padding: 0.3rem 0.75rem; border-radius: 999px; cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { background: var(--surface); }
.chip.active { border-color: var(--accent); background: var(--surface-2); }
.chip.locked { opacity: 0.7; }
/* 칩 앞 미니 캐릭터 이미지 */
.chip-cat {
  width: 20px; height: 20px; flex: 0 0 auto;
  background-size: contain; background-repeat: no-repeat; background-position: center;
}

/* 상단 우측 토스트 — 다크/라이트 공통 어두운 배경 */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  right: calc(env(safe-area-inset-right, 0px) + 1rem);
  transform: translateY(-0.5rem);
  box-sizing: border-box; width: max-content;
  max-width: min(26rem, calc(100vw - 2rem)); text-align: left;
  background: rgba(20, 18, 15, 0.94); color: #fff;
  padding: 0.75rem 1rem; border-radius: 14px;
  font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none; z-index: 1101;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== 하단 탭바 ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex;
  padding-bottom: max(8px, calc(env(safe-area-inset-bottom) - 10px));
  background: var(--bar-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0.55rem 0 0.5rem; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-family: inherit; font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.02em; transition: color 0.15s var(--ease), transform 0.1s var(--ease);
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent); }
.tab:active { transform: scale(0.94); }
body.kb-open .tabbar { display: none; } /* 타이핑 중엔 탭바 숨김 */

/* Keep the illustrated scene light on Android WebView, especially on foldables. */
.platform-android .bg-image[data-motion],
.platform-android .bg-image::before,
.platform-android .bg-image::after { animation: none !important; }
.platform-android .tabbar { backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Keep the page still on Android. Lift only the composer when Gboard would cover it. */
:root.platform-android body.kb-input-lifted #add-form:not([hidden]) {
  position: fixed;
  inset-inline: max(1rem, calc((100vw - 560px) / 2));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 20;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* 설정형 뷰(상점·프로필) */
.settings { display: flex; flex-direction: column; gap: 1rem; }
.settings[hidden] { display: none; } /* [hidden]가 display:flex에 밀리는 문제 방지 */
.profile-tour-area {
  display: flex; flex-direction: column; gap: 1rem;
  scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 64px);
}
.backup-status-card {
  display: flex; flex-direction: column; gap: .35rem;
  padding: 1rem; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface-2); color: var(--text);
}
.backup-status-card[hidden] { display: none; }
.backup-status-card strong { font-size: .9rem; font-weight: 700; }
.backup-status-card p { font-size: .78rem; line-height: 1.55; color: var(--muted); }
.backup-status-card .backup-last-line { margin-top: .25rem; color: var(--text); }
.backup-last-line time { font-weight: 700; }
.backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.backup-actions .btn-ghost {
  width: 100%; min-width: 0; min-height: 58px; margin: 0; padding: .65rem .35rem;
  border-width: 1.5px; border-radius: 18px; font-size: .78rem; line-height: 1.35;
}
.backup-file-button {
  align-self: center; margin: -.25rem 0 0; padding: .3rem .5rem;
  border: 0; background: transparent; color: var(--muted); font: inherit;
  font-size: .75rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.backup-restore-card { max-width: 560px; text-align: left; }
.backup-restore-card h2 { text-align: left; text-transform: none; letter-spacing: 0; }
.backup-restore-card .confirm-actions { flex-direction: column; }
#backup-paste-area {
  width: 100%; min-height: 10rem; resize: vertical; padding: .75rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--text); font: 400 .78rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
#backup-paste-area:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.view-title {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  font-size: 1.1rem; margin-bottom: 0.1rem;
}

.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); z-index: 100; padding: 1rem; }
.modal[hidden] { display: none; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  padding: 2rem 1.75rem; max-width: 340px; width: 100%; text-align: center;
  display: flex; flex-direction: column; gap: 0.9rem; }
.modal-card h2 { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.modal-card .price { font-size: 1.6rem; font-weight: 700; }
.modal-card .price span { font-size: 0.9rem; font-weight: 300; opacity: 0.6; }
.modal-card .perks { list-style: none; text-align: left; display: flex; flex-direction: column; gap: 0.4rem;
  font-weight: 300; font-size: 0.9rem; opacity: 0.85; }
.modal-card .perks li::before { content: "✦ "; color: var(--accent); }
.modal-close { background: none; border: none; color: var(--muted); font-family: inherit;
  font-size: 0.85rem; cursor: pointer; }
.mock-note { font-size: 0.72rem; color: var(--muted); }

/* 페이월: 캐릭터 잠금 해제 2택(패키지 vs 올액세스) */
.paywall-sub { font-size: 0.85rem; color: var(--muted); margin-top: -0.4rem; }
.plans { display: flex; flex-direction: column; gap: 0.7rem; text-align: left; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  text-align: left; /* 버튼 기본 가운데정렬 → 설명 2줄 좌측 정렬 */
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.1s var(--ease);
}
/* hover는 마우스 기기에만 — 터치에선 :hover가 고착돼 '둘 다 선택된 듯' 보이는 문제 방지 */
@media (hover: hover) { .plan:hover { border-color: var(--accent); } }
.plan:active { transform: scale(0.98); }
.plan--best { border-color: var(--accent); background: var(--surface-2); }
.plan-badge {
  position: absolute; top: -10px; right: 14px;
  background: var(--btn-grad); color: #fff;
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.05em;
  padding: 0.12rem 0.55rem; border-radius: 999px;
}
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.plan-name { font-weight: 700; font-size: 0.98rem; }
.plan-price b { font-size: 1.25rem; font-weight: 800; }
.plan-price small { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.plan-desc { font-size: 0.78rem; font-weight: 300; color: var(--muted); line-height: 1.35; }
/* 둘째 줄: 핵심 셀링 포인트(영구 소유 / 무료체험) 강조 */
.plan-extra { display: block; font-size: 0.78rem; font-weight: 700; color: var(--accent); }
.plan-extra::before { content: "✓ "; }

/* 확인 모달 액션(좋아요/아니요) */
.confirm-actions { display: flex; gap: 0.6rem; margin-top: 0.3rem; }
.confirm-actions .btn-gradient,
.confirm-actions .btn-ghost { flex: 1; margin-top: 0; }

/* ===== Top bar ===== */
/* 헤더+도크를 감싼 단일 프로스티드 컨테이너 → 배경/블러를 한 번만 적용(이음새 없음) */
.topbar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 7;
  /* 상태바(노치) 영역만큼 아래로 밀되, 그 영역은 헤더와 동일한 프로스티드 배경으로 채움 */
  padding-top: env(safe-area-inset-top);
  background: transparent; /* 헤더 배경은 0% 투명도 */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center; /* 타이틀만 남아 가운데 정렬 (네비는 하단 탭바) */
  padding: 0 1rem;
  background: transparent; /* 배경/블러는 wrap이 담당 */
}
.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .055em;
  line-height: 1;
  color: #fff5e8;
  opacity: 1;
  text-shadow: none;
  white-space: nowrap;
}
.topbar-brand-count {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: .8rem;
  letter-spacing: 0;
  color: #ffba94;
}
:root[data-theme="light"] .topbar-brand { color: #24583b; }
:root[data-theme="light"] .topbar-brand-count { color: #35714c; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.92); }

/* ===== Ghost button ===== */
.btn-ghost {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-ghost:hover { background: var(--surface); }
.btn-ghost.danger { color: var(--warn); border-color: var(--line); }
.btn-ghost.danger:hover { background: rgba(255, 124, 163, 0.12); }

/* ===== Weekly calendar ===== */
#view-calendar { text-align: center; padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
#view-calendar[hidden] { display: none; }
.calendar-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0.25rem 0 1.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.calendar-journey { color: var(--text); font-size: 0.92rem; font-weight: 600; }
.calendar-clover-totals { display: flex; justify-content: center; gap: clamp(1.5rem, 12vw, 3rem); }
.calendar-clover-total { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text); font-size: 0.88rem; }
.calendar-clover-total .clover { width: 25px; height: 28px; }
#cal-back {
  margin-left: auto;
}
.cal-today-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.cal-today-button svg { width: 1.05rem; height: 1.05rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cal-today-button:hover { background: var(--surface-2); }
.cal-today-button[hidden] { display: none; }
.guided-tour-setting { padding: 0.2rem 0; }
.guided-tour-setting .reminder-top { color: var(--text); font-size: 0.9rem; }
.guided-tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.guided-tour[hidden] { display: none; }
.guided-tour-shade { position: fixed; z-index: 1000; background: rgba(4, 8, 19, 0.7); pointer-events: auto; }
.guided-tour-shade-top, .guided-tour-shade-bottom { left: 0; right: 0; }
.guided-tour-shade-left, .guided-tour-shade-right { top: 0; bottom: 0; }
.guided-tour-focus {
  position: fixed;
  z-index: 1001;
  pointer-events: none;
  transition: top .22s ease, left .22s ease;
}
.guided-tour-focus[hidden] { display: none; }
.guided-tour-hand {
  position: absolute;
  right: -15px;
  bottom: -26px;
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.8));
  animation: guided-hand-tap 1.15s ease-in-out infinite;
}
@keyframes guided-hand-tap { 0%, 100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-7px) scale(.94); } }
.guided-tour-card {
  position: fixed;
  z-index: 1003;
  left: 1rem;
  top: 1rem;
  width: min(25rem, calc(100vw - 2rem));
  box-sizing: border-box;
  max-height: min(calc(100vh - 2rem), 28rem);
  max-height: min(calc(100dvh - 2rem), 28rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel, #191b24) 96%, transparent);
  color: var(--text);
  box-shadow: 0 16px 50px rgba(0,0,0,.48);
  pointer-events: auto;
}
.guided-tour-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.guided-tour-progress { margin-bottom: .45rem; color: var(--accent); font-size: .76rem; font-weight: 700; letter-spacing: .04em; }
.guided-tour-card h2 { margin-bottom: .55rem; font-size: 1.2rem; line-height: 1.35; }
.guided-tour-content > p:not(.guided-tour-progress) { color: var(--muted); line-height: 1.55; }
.guided-tour-content > p.guided-tour-action { margin-top: .7rem; color: var(--text); font-weight: 800; }
.guided-tour-content > .guided-tour-action[hidden] { display: none; }
.guided-tour-example-acts { display: block; width: 100%; margin-top: .85rem; border-color: var(--accent); color: var(--text); font-weight: 700; }
.guided-tour-example-acts[hidden] { display: none; }
.guided-tour-actions {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
  padding-top: .75rem;
  padding-bottom: .1rem;
  border-top: 1px solid var(--line);
}
.guided-tour-actions .btn-ghost, .guided-tour-actions .btn-gradient { margin-top: 0; }
.guided-tour-actions button { flex: 0 0 auto; }
.guided-tour-next { min-width: 7rem; }
.guided-tour-next:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.55); }
@media (min-width: 700px) {
  .guided-tour-card { width: min(28rem, calc(100vw - 4rem)); }
}
@media (prefers-reduced-motion: reduce) {
  .guided-tour-hand, .guided-tour-focus { animation: none; transition: none; }
}

/* 과거/미래 상세 (읽기 전용) */
.day-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  text-align: left;
}
.day-detail[hidden] { display: none; }
.dd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.7rem; }
.dd-head span { color: var(--muted); font-size: 0.85rem; }
.dd-empty { color: var(--muted); font-weight: 300; padding: 0.4rem 0; }
.dd-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.dd-list li { display: flex; align-items: center; gap: 0.6rem; font-weight: 300; }
.dd-list li.done .dd-text { text-decoration: line-through; opacity: 0.5; }
.dd-check { color: var(--muted); width: 1rem; text-align: center; }
.dd-list li.done .dd-check { color: #6bd39a; }

/* ===== Account panel ===== */
.panel-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.5); }
.panel-backdrop[hidden] { display: none; }
.account-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 21;
  width: min(320px, 82vw);
  background: var(--panel);
  border-right: 1px solid var(--line);
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
}
.account-panel.open { transform: translateX(0); }
.account-panel[hidden] { display: none; }
.account-inner { padding: calc(1.5rem + env(safe-area-inset-top)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1rem; min-height: 100%; box-sizing: border-box; }
.account-top { display: flex; align-items: center; justify-content: space-between; }
.account-top h2 { font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.acc-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
.version-info { margin-top: -.3rem; color: var(--muted); font-size: .78rem; }
.version-info span:last-child { margin-left: .3rem; color: var(--text); font-weight: 700; }
.acc-field input {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}
.acc-field input:focus { outline: none; border-color: var(--accent); }

/* 리마인더(로컬 알림) 설정 */
.reminder-top { display: flex; align-items: center; justify-content: space-between; }
.reminder-hint { font-size: 0.72rem; color: var(--muted); }
.reminder-label { font-weight: 600; }
.reminder-row { display: flex; align-items: center; gap: 10px; }
/* 시간 표시 버튼(앱 언어 형식) — 네이티브 time은 숨기고 선택기만 사용 */
.reminder-time-btn {
  width: auto; min-width: 0; flex: 1; box-sizing: border-box; text-align: left;
  padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 1rem; cursor: pointer;
}
.acc-reminder.off .reminder-time-btn { opacity: 0.5; }
.reminder-time-modal { z-index: 300; }
.reminder-time-card {
  max-width: 340px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: 1.3rem 1.15rem;
  gap: .8rem;
  background: var(--panel);
  color: var(--text);
}
.reminder-time-card h2 { margin: 0; font-size: 1.15rem; text-transform: none; letter-spacing: 0; }
.reminder-time-hint { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.reminder-time-display {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface-2); color: var(--text);
}
.reminder-time-display > span { color: var(--accent); font-size: .9rem; font-weight: 700; }
.reminder-time-display > div { display: flex; align-items: center; gap: .12rem; font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.reminder-time-display strong { min-width: 2ch; font-weight: 800; }
.reminder-time-units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.reminder-time-unit {
  display: grid; grid-template-rows: auto 2.35rem auto 2.35rem; justify-items: center; align-items: center; gap: .28rem;
  padding: .65rem .4rem; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.reminder-time-unit > span { color: var(--muted); font-size: .75rem; }
.reminder-time-unit > output { color: var(--text); font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.reminder-time-unit > button {
  width: 2.4rem; height: 2.35rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.reminder-time-unit > button:hover { border-color: var(--accent); }
.reminder-period-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; padding: .25rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.reminder-period-options button { min-height: 2.5rem; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; }
.reminder-period-options button[aria-pressed="true"] { background: var(--surface-2); color: var(--accent); font-weight: 800; }
.reminder-time-actions { margin-top: .15rem; }
.reminder-time-actions .btn-ghost, .reminder-time-actions .btn-gradient { min-height: 46px; margin: 0; }
.reminder-time-card :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-switch {
  width: 46px; height: 28px; flex-shrink: 0;
  border: none; border-radius: 999px; padding: 0;
  background: var(--line); position: relative; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.toggle-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease);
}
.toggle-switch[aria-checked="true"] { background: var(--accent); }
.toggle-switch[aria-checked="true"]::after { transform: translateX(18px); }

.acc-stats { display: flex; flex-direction: column; gap: 0.5rem; }
.acc-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.acc-stat span { color: var(--muted); font-size: 0.85rem; }
.acc-stat b { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .account-panel { transition: none; }
}

/* ===== Month calendar UI ===== */
.cal-header { text-align: left; margin: .83em 0 1.25rem; }
/* Match the first heading's top offset to Profile's default heading margin. */
.cal-month-nav { display: flex; align-items: center; gap: clamp(0.3rem, 1.8vw, 0.7rem); width: 100%; min-width: 0; }
.cal-title { font-weight: 800; font-size: 1.45rem; letter-spacing: -0.01em; margin: 0; }
.cal-month-arrow {
  display: inline-grid; place-items: center; box-sizing: border-box; flex: 0 0 2.5rem; width: 2.5rem; min-width: 2.5rem; height: 2.5rem; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--text); font: inherit; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.cal-month-arrow:disabled { opacity: 0.3; cursor: default; }
.cal-month-nav .cal-title { min-width: 0; flex: 0 1 auto; }

.cal { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1.25rem; }
/* minmax(0,1fr): fr의 기본 최소폭(auto)이 셀 콘텐츠보다 커져 넘치는 것 방지 → 375px에서도 딱 맞음 */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-head .cal-dow {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--muted);
  padding: 2px 0;
}
.cal-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--cal-cell-bg, var(--surface)); /* 라이트에서 --cal-cell-bg로 또렷하게 override */
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 2px;
  box-sizing: border-box;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
}
.cal-cell.before-start { opacity: 0.28; cursor: default; }
/* 호버는 그림자 + 살짝 떠오름으로 강조 */
.cal-cell:hover:not(.blank):not(:disabled) {
  background: var(--surface-2);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}
.cal-cell:active:not(.blank):not(:disabled) { transform: scale(0.95); }
.cal-cell.blank { border: none; background: transparent; cursor: default; }
.cal-cell:disabled, .cal-cell.future { opacity: 0.35; cursor: default; }
.cal-num { font-size: 0.72rem; font-weight: 500; line-height: 1; }
.cal-cell.today { border-color: var(--accent); background: var(--surface-2); }
.cal-cell.selected-date { box-shadow: 0 0 0 2px var(--accent); }
.cal-today-dot {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.cal-yn { font-size: 0.78rem; font-weight: 800; line-height: 1; }
.cal-yn.none { color: var(--muted); font-weight: 400; }

/* 계정 패널 select (배경 선택) */
.acc-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.7rem 2.4rem 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.acc-select:focus { outline: none; border-color: var(--accent); }
.acc-select option { background: var(--panel); color: var(--text); }

/* 캐릭터 클릭 → 명언 (터치 어포던스) */
.cat { cursor: pointer; }

/* 라이트 모드에서 흰 고양이 분리용 그림자 */
:root[data-theme="light"] .cat { filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.22)); }

/* 달력 클로버 (완료 개수 = 잎 개수) */
.cal-clover { display: inline-flex; align-items: center; justify-content: center; }
.clover .cl-leaves path { fill: #43c86a; }
.clover .cl-stem { stroke: #2f9e57; stroke-width: 1.4; }
.cal-cell.clover-full { background: rgba(67, 200, 106, 0.16); border-color: rgba(67, 200, 106, 0.45); }
.cal-cell.clover-full .clover .cl-leaves path { fill: #37c46a; }
/* 보너스(네잎=행운): 살짝 금빛 강조 */
.cal-cell.clover-bonus { background: rgba(240, 193, 75, 0.18); border-color: rgba(226, 170, 44, 0.55); }
.cal-cell.clover-bonus .clover .cl-leaves path { fill: #2fbf63; }

/* 라이트: 기본 셀을 또렷한 흰색으로(이미지 배경에 안 묻히게) + 은은한 그림자, 호버는 더 강한 그림자 */
:root[data-theme="light"] {
  --cal-cell-bg: rgba(255, 255, 255, 0.9);
}
:root[data-theme="light"] .cal-cell:not(.blank) { box-shadow: 0 2px 6px rgba(20, 83, 45, 0.08); }
:root[data-theme="light"] .cal-cell:hover:not(.blank):not(:disabled) {
  background: #fff;
  box-shadow: 0 7px 18px rgba(20, 83, 45, 0.2);
}
/* 완료(클로버) 셀도 라이트에선 흰 배경 + 컬러 테두리 → 클로버 가독성 확보 */
:root[data-theme="light"] .cal-cell.clover-full,
:root[data-theme="light"] .cal-cell.clover-bonus {
  background: rgba(255, 255, 255, 0.95);
}

/* 라이트: 흰 레이어를 줄인 대신, 말풍선은 더 하얗게 + 영상 위 텍스트 미세 가독성 보정 */
:root[data-theme="light"] .bubble {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(20, 83, 45, 0.14);
}
:root[data-theme="light"] .subtitle,
:root[data-theme="light"] .todo-count,
:root[data-theme="light"] .progress-msg,
:root[data-theme="light"] #list .text,
:root[data-theme="light"] #list .remove,
:root[data-theme="light"] .empty {
  font-weight: 600;
  text-shadow:
    0 1px 1px rgba(255, 255, 255, 1),
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 14px rgba(255, 255, 255, 0.8);
}
:root[data-theme="light"] .todo-count b { font-weight: 800; }

/* Keep light-scene text readable over bright skies and scenery in settings and
   the character catalog, where there is no solid card behind each label. */
:root[data-theme="light"] #view-profile :is(.view-title, label, .acc-field > span, .acc-stat span, .reminder-top span, .reminder-hint, .backup-status-card strong, .backup-status-card p, .mock-note, .lang-label, .version-info, .oss),
:root[data-theme="light"] #decorate-catalog :is(h3, .package-intro, .owned-character strong, .owned-character small, .package-copy small, .package-copy strong, .package-copy span, .package-copy b) {
  text-shadow: 0 1px 0 rgba(255, 255, 255, .96), 0 0 8px rgba(255, 255, 255, .9);
}

/* 계정 패널: 오픈소스 라이선스 */
.oss { margin-top: 0.4rem; font-size: 0.75rem; color: var(--muted); }
.oss summary {
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0;
  letter-spacing: 0.02em;
}
.oss summary::-webkit-details-marker { display: none; }
.oss summary::before { content: "▸ "; }
.oss[open] summary::before { content: "▾ "; }
.oss ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding-left: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  line-height: 1.5;
}
.oss b { color: var(--text); font-weight: 700; }

.oss a { color: var(--accent); text-decoration: underline; }

/* 계정 패널: 팀 크레딧 */
/* 계정 하단 푸터: 언어 토글 + 팀 크레딧 */
.acc-footer { margin-top: auto; padding-top: 1.4rem; }
.lang-toggle, .profile-appearance {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 좌측 정렬 */
  gap: 0.45rem;
  margin: 0.5rem 0 0.2rem;
}
.lang-label { font-size: 0.72rem; color: var(--muted); margin-right: 0.15rem; }
.lang-btn, .appearance-options button {
  width: 42px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  filter: grayscale(0.7);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    opacity 0.15s var(--ease), filter 0.15s var(--ease), transform 0.1s var(--ease);
}
.lang-btn.active, .appearance-options button[aria-pressed="true"] {
  opacity: 1;
  filter: none;
  border-color: var(--accent);
  background: var(--surface-2);
}
.lang-btn:active, .appearance-options button:active { transform: scale(0.92); }

.made-by {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.made-by b { color: var(--text); font-weight: 700; }

/* 꾸미기: 상품 카드와 구성 미리보기 */
#decorate-catalog h3 { margin: 1.4rem 0 .7rem; text-transform: uppercase; }
.package-intro { color: var(--muted); font-size: .9rem; margin: .6rem 0 1rem; }
.package-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.package-card { display:flex; flex-direction:column; align-items:stretch; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.package-art { display: flex; flex:none; height: 180px; background-size: cover; background-position: center; align-items: center; justify-content: center; }
.package-art img { width: 78%; height: 150px; object-fit: contain; filter: drop-shadow(0 6px 8px #0002); }
.package-copy { display: grid; align-content:start; gap: .45rem; padding: 1rem; }
.package-copy small { color: var(--accent); }
.package-copy span { font-size: .8rem; color: var(--muted); }
.package-copy b { font-size: .85rem; }
.paywall-card { max-height: 88dvh; overflow-y: auto; position: relative; }
.package-scene { height: clamp(320px, 48dvh, 440px); background-size: cover; background-position: center; border-radius: 18px; display: grid; place-items: center; margin: 0 0 1rem; }
.package-scene img { height: 190px; max-width: 90%; object-fit: contain; }
.package-card.is-coming-soon .package-art,
.package-scene.is-coming-soon { position: relative; isolation: isolate; overflow: hidden; }
.package-card.is-coming-soon .package-art::before,
.package-scene.is-coming-soon::before { content: ""; position: absolute; inset: 0; background: rgba(9, 18, 32, .18); z-index: 0; }
.package-card.is-coming-soon .package-art img,
.package-scene.is-coming-soon img { position: relative; z-index: 1; }
.package-art img.coming-soon-silhouette,
.package-scene img.coming-soon-silhouette { filter: brightness(0) opacity(.42); }
.package-themes { display:flex; gap:.5rem; margin-bottom: 1rem; }
.package-themes button { flex:1; padding:.65rem; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); font:inherit; cursor:pointer; }
.package-themes button[aria-pressed="true"] { border-color:var(--accent); outline:1px solid var(--accent); }
#package-action { width:100%; }
#package-action:disabled { opacity:.65; cursor:default; }
#package-status { margin:0; font-size:.9rem; }
#package-status:empty { display:none; }
#package-detail > .package-intro:last-child { margin-bottom:0; }
@media(max-width:360px) { .package-grid { grid-template-columns:1fr; } }

.owned-characters { display:flex; gap:1rem; overflow-x:auto; padding:.35rem .25rem .8rem; }
.owned-character { flex:0 0 112px; display:flex; flex-direction:column; align-items:center; gap:.5rem; border:0; padding:0; background:transparent; color:var(--text); font:inherit; cursor:pointer; }
.owned-avatar { width:94px; height:94px; display:grid; place-items:center; border-radius:50%; background:var(--surface); border:2px solid var(--line); }
.owned-avatar img { width:80px; height:80px; object-fit:contain; }
.owned-character.is-active .owned-avatar { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent); }
.owned-character strong { font-size:.85rem; }
.owned-character small { color:var(--muted); font-size:.75rem; }
.owned-character.is-active small { color:var(--accent); }
.package-section-heading { display:flex; align-items:center; justify-content:space-between; gap:.5rem; margin-top:1rem; }
#decorate-catalog .package-section-heading h3 { margin:.4rem 0; }
.package-restore { margin-top: 1rem; text-align: center; }
.package-restore .btn-ghost { min-height: 44px; margin: 0; padding: .5rem .8rem; border: 0; border-radius: 8px; font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.package-restore #restore-status { margin-top: .4rem; font-size: .85rem; color: var(--muted); }
#decorate-catalog .decorate-collection > h3:first-child { margin-top: .83em; }
#restore-status:empty { display:none; }
.decorate-collection .package-intro { margin-top:.35rem; }
.decorate-discover { margin-top:1.35rem; }
.package-card.is-coming-soon { cursor:pointer; }
.package-card.is-coming-soon .package-copy small { color:var(--muted); }
.package-card.is-coming-soon .package-copy b { color:var(--accent); }

/* 홈 마스코트: 꼬리와 표정 장식에 충분한 가로 여백 */
#mascot > .cat { width: min(260px, 100%); height: 180px; background-size: contain; }
#mascot > .cat .streak { right: 8px; }

#view-shop { min-height: calc(100dvh - 11rem); }
.decorate-footer { margin-top: 4rem; padding: 1.5rem 0 1rem; }

.package-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.package-dialog-header h2 { text-align: left; min-width: 0; text-transform: none; letter-spacing: 0; }
.package-dialog-header .modal-close { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 2rem; line-height: 1; border-radius: 50%; }
.package-dialog-header .modal-close:hover { background: var(--surface); color: var(--text); }
.package-dialog-header .modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Jindori's countryside: independent wingbeats and low grass fireflies. */
.rural-butterfly,.rural-firefly { position:absolute; pointer-events:none; }
.rural-butterfly { width:3px;height:13px;background:#705431;border-radius:50%;animation:butterfly-flight var(--duration) ease-in-out infinite;animation-delay:var(--delay); }
.rural-butterfly::before,.rural-butterfly::after { content:'';position:absolute;top:-3px;width:12px;height:16px;background:linear-gradient(140deg,#fffbd6,#efb661);border-radius:80% 30% 65% 35%;transform-origin:right center;left:-11px;animation:wingbeat .65s ease-in-out infinite alternate; }
.rural-butterfly::after { left:2px;transform-origin:left center;border-radius:30% 80% 35% 65%;animation-delay:-.3s; }
.rural-firefly { width:4px;height:4px;border-radius:50%;background:#eeff9a;box-shadow:0 0 7px 3px #d9ef7788;animation:firefly-glow 4s ease-in-out infinite;animation-delay:var(--delay); }
@keyframes butterfly-flight { 0%,100%{transform:translate(0,0) rotate(-15deg)} 35%{transform:translate(40px,-65px) rotate(12deg)} 70%{transform:translate(-25px,-20px) rotate(-8deg)} }
@keyframes wingbeat { from{transform:scaleX(1)} to{transform:scaleX(.2)} }
@keyframes firefly-glow { 0%,100%{opacity:.12} 45%{opacity:1;box-shadow:0 0 12px 5px #e5ff87aa} }
.bg-image[data-scene="jindori-rural-dark"]::after { bottom:35%; }
@media(prefers-reduced-motion:reduce){.rural-butterfly,.rural-butterfly::before,.rural-butterfly::after,.rural-firefly{animation:none}.rural-firefly{opacity:.6}}

.package-personality { white-space:normal; word-break:keep-all; overflow-wrap:break-word; line-height:1.55; text-wrap:pretty; }
.package-copy strong, .package-copy b { word-break:keep-all; overflow-wrap:break-word; }
:root[lang="en"] .package-personality { word-break:normal; }
.topbar { position:relative; }
/* Clover and wordmark form one left-aligned brand lockup. */
.topbar { justify-content:flex-start; }
.topbar-brand { position:static;transform:none;margin:0;gap:.4rem; }
.brand-logo { display:block;width:36px;height:36px;object-fit:contain;flex-shrink:0; }
/* Both profile settings use the same individual pill buttons. */
.lang-toggle > .lang-label, .profile-appearance > .lang-label { min-width:3.6rem; }
.appearance-options { display:flex;gap:.45rem; }
.appearance-options button { display:grid;place-items:center;color:var(--text); }
.appearance-options svg { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }
.lang-btn:focus-visible, .appearance-options button:focus-visible { outline:2px solid var(--accent);outline-offset:3px; }

/* Mobile collection: two full cards plus 70% of the next card. */
@media (max-width:600px) {
  .owned-characters { gap:1rem;scroll-snap-type:x proximity;scroll-padding-inline:.25rem; }
  .owned-character { flex-basis:calc((100% - 2rem) / 2.7);min-width:0;scroll-snap-align:start; }
  .owned-avatar { width:88%;height:auto;aspect-ratio:1;flex-shrink:0; }
  .owned-avatar img { width:86%;height:86%; }
  .owned-character strong { text-align:center;overflow-wrap:anywhere; }
}

/* Branded web-view splash; native launch remains a static system screen. */
.brand-splash { position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:none;height:100%;height:100dvh;max-height:none;margin:0;border:0;padding:env(safe-area-inset-top) 24px env(safe-area-inset-bottom);background:#fff8e8;color:#24583b;overflow:auto; }
.brand-splash[open] { display:flex;flex-direction:column;align-items:center;justify-content:center; }
.brand-splash::backdrop { background:#fff8e8; }
.splash-center { width:100%;max-width:460px;text-align:center;margin:auto 0;padding:40px 0 24px; }
.splash-center > img { width:80px;height:80px;object-fit:contain;margin-bottom:20px; }
.splash-wordmark { display:flex;justify-content:center;align-items:baseline;gap:.24em;font-size:clamp(28px,8vw,40px);font-weight:400;letter-spacing:.01em;margin:0 0 32px; }
.splash-copy { font-size:clamp(15px,4vw,18px);line-height:1.8; }
.splash-copy p { margin:.6em 0;text-align:center;word-break:keep-all;overflow-wrap:break-word;text-wrap:pretty; }
.splash-copy p:first-child { font-size:1.12em;color:#367449; }
.splash-char { visibility:hidden; }
.splash-char.is-visible { visibility:visible; }
.splash-skip { flex-shrink:0;min-height:44px;margin:0 0 24px;padding:8px 24px;border:1px solid #91b59a;border-radius:999px;background:transparent;color:inherit;font:inherit;cursor:pointer; }
.splash-skip:focus-visible { outline:2px solid currentColor;outline-offset:4px; }
.splash-readable { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%); }

.splash-skip { margin:28px 0 0;min-width:112px;background:#528d65;color:#fff;border:0;letter-spacing:.08em; }
.splash-credit { flex-shrink:0;text-align:center;font-size:13px;color:#75947c;padding:0 0 24px; }

.splash-skip.is-ready { animation:go-glow 1s ease-in-out 2; }
@keyframes go-glow {
  0%,100% { background:#528d65;box-shadow:0 0 0 0 transparent; }
  50% { background:#72af82;box-shadow:0 0 16px 4px #91cf9b66; }
}
@media(prefers-reduced-motion:reduce){.splash-skip.is-ready{animation:none}}

.legal-links{display:flex;flex-wrap:wrap;gap:12px 20px;margin:20px 0}.legal-links a{font-size:13px;color:var(--muted);text-underline-offset:4px;padding:8px 0}.legal-view{position:fixed;inset:0;margin:0;padding:0;border:0;width:100%;height:100%;max-width:none;max-height:none;background:#fff8e8}.legal-view iframe{display:block;width:100%;height:100%;border:0}
.analytics-field { border-top: 1px solid var(--line); padding-top: 1rem; }
.analytics-prompt-card { max-width: 420px; text-align: left; }
.analytics-prompt-card h2 { text-align: left; text-transform: none; letter-spacing: 0; margin: 0; }
.analytics-prompt-card .confirm-actions { flex-direction: column; }
.modal#analytics-consent-prompt { background: rgba(3, 8, 6, .68); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.analytics-prompt-card {
  gap: 1rem;
  padding: clamp(1.25rem, 5vw, 1.75rem);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel) 55%);
  box-shadow: 0 20px 64px rgba(0, 0, 0, .34);
}
.analytics-prompt-heading { display: flex; align-items: center; gap: .85rem; }
.analytics-prompt-icon {
  display: grid;
  place-items: center;
  flex: 0 0 2.8rem;
  width: 2.8rem;
  height: 2.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 1rem;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--accent);
}
.analytics-prompt-icon svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.analytics-prompt-card h2 { font-size: 1.2rem; line-height: 1.35; }
.analytics-prompt-card .mock-note { color: color-mix(in srgb, var(--text) 86%, var(--muted)); font-size: .88rem; line-height: 1.6; }
.analytics-prompt-card > a[data-legal="privacy"] { width: fit-content; color: var(--accent); font-size: .86rem; font-weight: 700; text-underline-offset: 3px; }
.analytics-prompt-card #analytics-prompt-status { color: var(--warn); font-size: .85rem; line-height: 1.4; }
.analytics-prompt-card .confirm-actions { gap: .65rem; margin-top: .1rem; }
.analytics-prompt-card .confirm-actions button { min-height: 3rem; }
:root[data-theme="light"] .modal#analytics-consent-prompt { background: rgba(15, 42, 27, .42); }
:root[data-theme="light"] .analytics-prompt-card { box-shadow: 0 20px 64px rgba(20, 83, 45, .22); }

.topbar-wrap, .topbar { background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;box-shadow:none;border:0; }
.nickname-row{display:flex;align-items:stretch;gap:10px}.nickname-row input{flex:1;min-width:0}.nickname-row button{flex:none;width:auto;min-width:64px;padding:0 18px;border-radius:16px;box-shadow:none}.nickname-row button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
