/* ============================================================
   피클 비서실 — 스타일
   모바일 PWA(안드로이드 '홈 화면에 추가') 기준, 최대 폭 480px
   ============================================================ */

:root {
  --cream: #F6F1E7;
  --cream-2: #FBF7EF;
  --paper: #FFFDF9;
  --ink: #2E2A25;
  --ink-2: #4C453D;
  --muted: #8E8479;
  --line: rgba(46, 42, 37, .07);
  --green: #4F8A4B;
  --green-deep: #3B7138;
  --green-soft: #E9F2E4;
  --badge-1: #6FAF67;
  --badge-2: #4F8A4B;
  --badge-3: #3E7A3A;
  --badge-shadow: rgba(63, 122, 58, .7);
  --live: #4CC25B;
  --hero-1: #EFF6EA;
  --hero-2: #E2EFDD;
  --ring-track: rgba(79, 138, 75, .16);
  --box-line: rgba(79, 138, 75, .32);
  --shadow: 0 12px 28px -18px rgba(88, 68, 44, .55);
  --shadow-soft: 0 6px 18px -12px rgba(88, 68, 44, .45);
  --radius: 20px;
}

/* 방 색 — 피클 초록 / 뮤즈 보라 (한 화면에서 섹션·뱃지로 구분) */
:root {
  --pickle: #4F8A4B;
  --pickle-deep: #3B7138;
  --pickle-soft: #E9F2E4;
  --muse: #8B6BC4;
  --muse-deep: #6A4A9E;
  --muse-soft: #EFE7FA;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 8% 0%, #FDF6E9 0%, rgba(253, 246, 233, 0) 60%),
    radial-gradient(90% 50% at 100% 6%, #F0F6EA 0%, rgba(240, 246, 234, 0) 55%),
    var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.2px;
}

p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }

.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(104px + env(safe-area-inset-bottom));
}

/* ---------- 상단 헤더 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 2px 12px;
}

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }

.brand-badges { display: flex; flex: none; align-items: center; }
.brand-badges .brand-badge + .brand-badge { margin-left: -7px; }

.brand-badge {
  width: 27px; height: 27px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  padding-bottom: 1px;
  border: 1.6px solid rgba(255, 253, 249, .95);
  box-shadow: 0 4px 10px -4px var(--badge-shadow), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.brand-badge.bb-pickle {
  background: linear-gradient(160deg, #6FAF67 0%, #4F8A4B 55%, #3E7A3A 100%);
  box-shadow: 0 4px 10px -4px rgba(63, 122, 58, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.brand-badge.bb-muse {
  background: linear-gradient(160deg, #A98AD6 0%, #8B6BC4 55%, #7556AE 100%);
  box-shadow: 0 4px 10px -4px rgba(117, 86, 174, .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.topbar h1 {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--green-deep);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(79, 138, 75, .18);
  border-radius: 999px;
  padding: 5px 8px;
  box-shadow: 0 2px 8px -6px rgba(63, 122, 58, .8);
}

.live-pill .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(76, 194, 91, .55);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 194, 91, .5); }
  60%  { box-shadow: 0 0 0 5px rgba(76, 194, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 194, 91, 0); }
}

/* ---------- 방 섹션 (한 화면 통합) ---------- */
.room-sec { padding-top: 2px; }

.room-sec + .room-sec {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(46, 42, 37, .1);
}

.room-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 4px 8px;
}

.room-sec:first-child .room-head { padding-top: 14px; }

.room-sec .kpi-strip { margin-top: 0; }
.room-sec .cards { margin-top: 10px; }

.room-emoji { font-size: 10px; line-height: 1; flex: none; }

.room-head h2 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.55px;
  color: #2C2823;
  white-space: nowrap;
}

.room-tag {
  margin-left: auto;
  min-width: 0;
  font-size: 8.8px;
  font-weight: 700;
  letter-spacing: -0.25px;
  color: #A29789;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-sec.is-pickle .room-head h2 { color: var(--pickle-deep); }
.room-sec.is-muse .room-head h2 { color: var(--muse-deep); }
.room-sec.is-pickle .room-tag { color: #7E9A78; }
.room-sec.is-muse .room-tag { color: #9480B6; }

/* 방 뱃지 — 일정·체크 항목 앞에 붙는 작은 표식 */
.rbadge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  vertical-align: 1px;
  margin-right: 4px;
  padding: 1.5px 5px 1.5px 4px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.15px;
  line-height: 1.25;
  white-space: nowrap;
}

.rbadge-dot {
  width: 4.5px; height: 4.5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.rbadge.is-pickle { color: var(--pickle-deep); background: var(--pickle-soft); }
.rbadge.is-muse { color: var(--muse-deep); background: var(--muse-soft); }

/* ---------- 패널 · 탭 ---------- */
.panel { display: none; }
.panel.is-active { display: block; animation: rise .34s cubic-bezier(.2, .8, .3, 1) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 배너 ---------- */
.banner-wrap {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 30px -20px rgba(70, 52, 30, .8);
  background: #E9E0CF;
}

.banner {
  display: block;
  width: 100%;
  aspect-ratio: 1690 / 931;
  object-fit: cover;
}

/* ---------- 말풍선 (배너 아래 별도 행) ---------- */
.bubble-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  align-items: stretch;
}

.bubble {
  position: relative;
  min-width: 0;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 7px 10px 8px;
  box-shadow: 0 6px 16px -10px rgba(60, 44, 24, .7), inset 0 0 0 1px rgba(255, 255, 255, .7);
  border: 1px solid rgba(79, 138, 75, .16);
}

.bubble-muse { border-color: rgba(139, 107, 196, .22); }

/* 꼬리 — 배너 쪽(위)을 향하게 */
.bubble::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, .95);
  border-left: 1px solid rgba(79, 138, 75, .16);
  border-top: 1px solid rgba(79, 138, 75, .16);
  transform: rotate(45deg);
  border-radius: 2px;
}

.bubble-pickle::after { left: 22px; }
.bubble-muse::after { right: 22px; border-color: rgba(139, 107, 196, .22); }

/* 겹침 없이 항상 같은 순서 — 데이터의 pos 클래스는 무시 */
.bubble.pos-top-left, .bubble.pos-top-right,
.bubble.pos-bottom-left, .bubble.pos-bottom-right { left: auto; right: auto; top: auto; bottom: auto; }

.bubble-chip {
  display: inline-grid;
  place-items: center;
  width: 14px; height: 14px;
  border-radius: 5px;
  background: linear-gradient(160deg, var(--badge-1), var(--badge-2));
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  vertical-align: -3px;
  margin-right: 3px;
  padding-bottom: 1px;
}

.bubble-who {
  display: inline-block;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 800;
  color: var(--pickle-deep);
  letter-spacing: -0.2px;
}

.bubble-muse .bubble-chip { background: linear-gradient(160deg, #A98AD6, #8B6BC4); }
.bubble-muse .bubble-who { color: var(--muse-deep); }

.bubble p {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: #38322B;
  letter-spacing: -0.3px;
  word-break: keep-all;
}

/* ---------- KPI ---------- */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 11px;
  padding: 13px 2px 12px;
  background: rgba(255, 253, 249, .92);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .8);
}

.kpi { text-align: center; padding: 0 2px; }
.kpi + .kpi { border-left: 1px solid var(--line); }

.kpi-v {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.7px;
  line-height: 1.1;
  white-space: nowrap;
  color: #2C2823;
}

.kpi-v small {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-left: 1px;
  color: #857A6F;
}

.kpi-l {
  margin-top: 3px;
  font-size: 9.4px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 카드 그리드 ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 11px;
}

.card {
  --c1: #FDEEF3;
  --c2: #FBE1EA;
  --accent: #D2517F;
  --accent-2: #B43E6A;
  --tint: #8E3A5C;

  position: relative;
  display: flex;
  flex-direction: column;
  padding: 11px 11px 10px;
  border-radius: 19px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .75) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, var(--c1) 0%, var(--c2) 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .72);
  overflow: hidden;
  animation: rise .4s cubic-bezier(.2, .8, .3, 1) both;
}

.card:nth-child(1) { animation-delay: .04s; }
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .16s; }

.card[data-accent="sky"]  { --c1: #EAF3FE; --c2: #DCECFD; --accent: #4E8BD8; --accent-2: #3A72BD; --tint: #2F5F9E; }
.card[data-accent="leaf"] { --c1: #EAF5EC; --c2: #DEEFE2; --accent: #3F8C57; --accent-2: #2F7445; --tint: #2C6B40; }
.card[data-accent="violet"]{ --c1: #EFE9FA; --c2: #E3D8F7; --accent: #7C5CB0; --accent-2: #6849A0; --tint: #5F4394; }
.card[data-accent="amber"]{ --c1: #FBF2E2; --c2: #F8EAD3; --accent: #B9802C; --accent-2: #9C6A1F; --tint: #8A601F; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  padding-right: 2px;
  margin-bottom: 9px;
}

.card-title {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  min-height: 2.64em;
  font-size: 11.3px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.32;
  color: #3A332C;
  word-break: keep-all;
}

.card-title .e { font-size: 12px; line-height: 1.2; flex: none; }

.card-badge {
  flex: none;
  font-size: 8.2px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--tint);
  background: rgba(255, 255, 255, .78);
  border-radius: 999px;
  padding: 3px 6px;
  white-space: nowrap;
}

.card-rows {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
  margin-bottom: 10px;
  font-size: 10.4px;
  line-height: 1.42;
  color: #564E46;
  letter-spacing: -0.35px;
}

.card-rows span {
  display: flex;
  gap: 4px;
  word-break: keep-all;
}

.card-rows span::before {
  content: "";
  flex: none;
  width: 3px; height: 3px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.card-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 8px 10px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 8px 14px -10px var(--accent-2), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .12s ease, filter .12s ease;
}

.card-btn .arrow { font-size: 11px; opacity: .9; }
.card-btn:active { transform: translateY(1px) scale(.985); filter: brightness(.96); }

.data-stamp {
  margin-top: 11px;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: -0.2px;
  color: #A29789;
}

/* ---------- 일정 ---------- */
.today-head,
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
}

.today-head h2, .week-head h2 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.today-date {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 3px 8px;
}

.timeline {
  background: rgba(255, 253, 249, .95);
  border-radius: var(--radius);
  padding: 4px 13px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .8);
}

.tl-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.tl-item:last-child { border-bottom: 0; }

.tl-time {
  font-size: 10.5px;
  font-weight: 800;
  color: #7D7266;
  letter-spacing: -0.2px;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
}

.tl-item.is-key .tl-time { color: var(--green-deep); }

.tl-main { min-width: 0; }

.tl-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.3;
  color: #332E28;
  word-break: keep-all;
}

.tl-item.is-key .tl-title { font-weight: 800; }
.tl-title-text { min-width: 0; word-break: keep-all; }

.tl-note {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.35;
  color: #8B8176;
  letter-spacing: -0.3px;
  word-break: keep-all;
}

.tag {
  flex: none;
  align-self: start;
  margin-top: 1px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: -0.1px;
  color: #7A6F63;
  background: #F2EDE4;
  border-radius: 999px;
  padding: 3px 5px;
  white-space: nowrap;
}

.tl-item.is-key .tag { color: var(--green-deep); background: var(--green-soft); }

/* 같은 시각·같은 강조에서도 방 색은 섞지 않는다 */
.tl-item.is-key.is-muse .tl-time { color: var(--muse-deep); }
.tl-item.is-key.is-muse .tag { color: var(--muse-deep); background: var(--muse-soft); }

.switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #EDE5D8;
  border-radius: 999px;
}

.switch button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 9.5px;
  font-weight: 700;
  color: #857A6C;
  transition: background .15s ease, color .15s ease;
}

.switch button.is-on {
  background: #fff;
  color: #3D3730;
  box-shadow: 0 2px 6px -4px rgba(70, 54, 32, .7);
}

.week-list { display: flex; flex-direction: column; gap: 8px; }

.day-card {
  background: rgba(255, 253, 249, .95);
  border-radius: 17px;
  padding: 11px 12px 8px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, .8);
}

.day-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.day-date {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #2F2A25;
}

.day-weekday {
  font-size: 10px;
  font-weight: 700;
  color: #8B8074;
}

.day-weekday.is-sun { color: #C4676B; }
.day-weekday.is-sat { color: #5C7FB4; }

.day-count {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  color: #9A8F82;
}

.day-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
  padding: 4px 0;
  align-items: baseline;
}

.day-main { min-width: 0; }

.day-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}

.day-time {
  font-size: 9.8px;
  font-weight: 700;
  color: #8B8074;
  font-variant-numeric: tabular-nums;
}

.day-item.is-key .day-time { color: var(--green-deep); }
.day-item.is-key.is-muse .day-time { color: var(--muse-deep); }

.day-title {
  font-size: 11.2px;
  letter-spacing: -0.35px;
  line-height: 1.35;
  color: #423B33;
  word-break: keep-all;
}

.day-item.is-key .day-title { font-weight: 800; color: #2F2A25; }

.day-note {
  display: block;
  font-size: 9.3px;
  color: #9B9083;
  letter-spacing: -0.2px;
  margin-top: 1px;
}

.day-title { word-break: keep-all; }

/* 일정 하단 범례 */
.legend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
  color: #8E8479;
}

.lg {
  width: 5px; height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.lg-pickle { background: var(--pickle); }
.lg-muse { background: var(--muse); }

.day-empty { font-size: 10px; color: #A79C8E; padding: 4px 0 6px; }

/* ---------- 완료 항목 — 취소선 + 흐리게 ----------
   data.js / muse-data.js 의 done: true (또는 state:"done") 항목에 적용.
   글자만 흐리게 해서 완료·상태 칩은 또렷하게 남깁니다.
   일정 타임라인 · 주간 카드 · 홈 카드 요약줄 · 상세 시트까지 같은 표기 */
.tl-item.is-done .tl-time,
.tl-item.is-done .tl-main,
.day-item.is-done .day-time,
.day-item.is-done .day-main { opacity: 0.55; }

.tl-item.is-done .tl-title-text,
.tl-item.is-done .tl-note,
.day-item.is-done .day-title,
.day-item.is-done .day-note {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.card-rows span.is-done {
  opacity: 0.55;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.item.is-done .item-name,
.item.is-done .item-meta,
.item.is-done .item-note { opacity: 0.55; }

.item.is-done .item-name {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* ---------- 체크 ---------- */
.check-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(150deg, var(--hero-1) 0%, var(--hero-2) 100%);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-soft);
}

.check-ring { position: relative; width: 44px; height: 44px; flex: none; }
.check-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.check-ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.ring-bg { stroke: var(--ring-track); }
.ring-fg {
  stroke: var(--green);
  stroke-dasharray: 113.1;
  stroke-dashoffset: 113.1;
  transition: stroke-dashoffset .5s cubic-bezier(.3, .8, .3, 1);
}

.check-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--green-deep);
  letter-spacing: -0.3px;
}

.check-hero-text h2 { font-size: 12.5px; font-weight: 800; letter-spacing: -0.4px; }
.check-hero-text p { margin-top: 3px; font-size: 10.5px; color: #6D7A63; letter-spacing: -0.3px; }

.check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 11px; }

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: rgba(255, 253, 249, .95);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 16px;
  padding: 12px 13px;
  box-shadow: var(--shadow-soft);
  transition: opacity .2s ease, background .2s ease;
}

.check-box {
  flex: none;
  width: 19px; height: 19px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1.6px solid var(--box-line);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  background: #fff;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.check-text { min-width: 0; flex: 1; }
.check-text b {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.35;
  color: #332E28;
  word-break: keep-all;
}

.check-title { min-width: 0; flex: 1; word-break: keep-all; }
.check-text small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #93887B;
  letter-spacing: -0.3px;
  word-break: keep-all;
}

.check-due {
  flex: none;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: -0.2px;
  color: var(--green-deep);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 3px 6px;
  margin-top: 1px;
}

.check-item.is-done { opacity: .58; background: rgba(246, 245, 240, .9); }
.check-item.is-done .check-box {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.check-item.is-muse.is-done .check-box { background: var(--muse); border-color: var(--muse); }
.check-item.is-done .check-text b { text-decoration: line-through; text-decoration-thickness: 1px; }

.check-item.is-today:not(.is-done) { border-color: var(--box-line); }
.check-item.is-muse.is-today:not(.is-done) { border-color: rgba(124, 92, 176, .34); }
.check-item.is-muse .check-due { color: var(--muse-deep); background: var(--muse-soft); }
.check-item.is-muse .check-box { border-color: rgba(124, 92, 176, .34); }

.check-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 0 4px;
}

.check-foot span { font-size: 9.3px; color: #A29789; letter-spacing: -0.2px; }

.reset-btn {
  border: 0;
  background: transparent;
  color: #9A8F82;
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 2px 0;
}

/* ---------- 하단 탭바 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  border-radius: 22px;
  background: rgba(255, 252, 246, .88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 14px 34px -16px rgba(78, 60, 36, .5);
  z-index: 20;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px 6px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #8E8375;
  transition: background .18s ease, color .18s ease;
}

.tab .tab-ico {
  font-size: 16px;
  line-height: 1;
  transition: transform .18s ease;
}

.tab.is-active {
  background: linear-gradient(160deg, var(--hero-1), var(--hero-2));
  color: var(--green-deep);
  font-weight: 800;
}

.tab.is-active .tab-ico { transform: translateY(-1px) scale(1.06); }

/* ---------- 바텀시트 ---------- */
.sheet-backdrop[hidden], .sheet[hidden] { display: none !important; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 26, .4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .26s ease;
  z-index: 40;
}

.sheet-backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  max-height: 84dvh;
  transform: translate(-50%, 102%);
  transition: transform .32s cubic-bezier(.22, .9, .28, 1);
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -18px 50px -24px rgba(46, 34, 20, .65);
  z-index: 41;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}

.sheet.is-open { transform: translate(-50%, 0); }

.sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: #DED5C7;
  margin: 8px auto 4px;
  flex: none;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 18px 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.sheet-emoji { font-size: 17px; line-height: 1.2; margin-top: 1px; }
.sheet-titles { min-width: 0; flex: 1; }
.sheet-titles h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.6px; }
.sheet-titles p {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  color: #8C8175;
  letter-spacing: -0.3px;
}

.sheet-close {
  flex: none;
  width: 27px; height: 27px;
  border: 0;
  border-radius: 50%;
  background: #F1EAE0;
  color: #7E7365;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
}

.sheet-note {
  font-size: 10.8px;
  line-height: 1.55;
  letter-spacing: -0.3px;
  color: #6F6558;
  background: #F7F2E8;
  border-radius: 12px;
  padding: 9px 11px;
  margin-bottom: 14px;
  word-break: keep-all;
}

.group { margin-bottom: 16px; }
.group:last-child { margin-bottom: 4px; }

.group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.group-head h4 {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #423A32;
}

.group-count {
  font-size: 8.5px;
  font-weight: 800;
  color: #8B7F71;
  background: #F1EAE0;
  border-radius: 999px;
  padding: 2px 6px;
}

.item {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child { border-bottom: 0; }

.item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.item-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.35;
  color: #312C26;
  word-break: keep-all;
}

.item-tag {
  flex: none;
  font-size: 8px;
  font-weight: 800;
  color: #6F6558;
  background: #F3EDE3;
  border-radius: 999px;
  padding: 2px 5px;
  white-space: nowrap;
}

.item-meta {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--green-deep);
}

.item-note {
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: -0.3px;
  color: #918679;
  word-break: keep-all;
}

/* ---------- 넓은 화면 ---------- */
@media (min-width: 520px) {
  .app { padding-left: 20px; padding-right: 20px; }
  .card-title { font-size: 11.5px; }
  .card-rows { font-size: 10.4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
}

/* 스크롤 잠금 */
body.is-locked { overflow: hidden; }
