/* 민주의 체크리스트 — 따뜻한 크림 바탕 + 단계별 파스텔 */

:root {
  color-scheme: light dark;
  --bg: #f6f3ee;
  --card: #ffffff;
  --card-2: #f8f5f0;
  --ink: #2c2824;
  --ink-2: #6f675e;
  --ink-3: #a59c92;
  --line: #ebe4da;
  --accent: #5f9b7e;
  --accent-soft: #e2efe7;
  --accent-ink: #ffffff;
  --danger: #c9604f;
  --shadow: 0 1px 2px rgba(70, 50, 30, 0.04), 0 8px 24px rgba(70, 50, 30, 0.06);
  --tabbar-bg: rgba(246, 243, 238, 0.86);
  --slump: #e4e3e0; /* 외식(돈 나간 날) 칸 배경 */

  --pre: #f0a875;   --pre-soft: #fdeee2;
  --work: #6fb8a3;  --work-soft: #e2f3ed;
  --lunch: #e3b546; --lunch-soft: #fbf2d6;
  --eve: #e88d7f;   --eve-soft: #fbe4df;
  --night: #9d8ed8; --night-soft: #ece8f9;

  --radius: 22px;
  --tabbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --card: #221f1c;
    --card-2: #2a2723;
    --ink: #f1ece5;
    --ink-2: #b9b0a5;
    --ink-3: #7f776e;
    --line: #36312b;
    --accent: #7dbb9c;
    --accent-soft: #23342b;
    --accent-ink: #10201a;
    --danger: #e58979;
    --shadow: none;
    --tabbar-bg: rgba(22, 21, 19, 0.86);
    --slump: #363431;

    --pre-soft: #3b2b1f;
    --work-soft: #1c342d;
    --lunch-soft: #3a3119;
    --eve-soft: #3d2521;
    --night-soft: #2b2642;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input { font: inherit; color: inherit; }
button {
  background: none;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { display: block; }

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 22px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 32px);
  animation: fade-in 0.25s ease;
}

@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } }

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

.top { padding: 4px 4px 18px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--ink-2); }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; margin-top: 2px; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 17px; font-weight: 700; }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 4px 12px;
}
.section-head .link { color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 700;
}

.empty { color: var(--ink-3); font-size: 14px; text-align: center; padding: 6px 0 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  transition: transform 0.15s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; }
.btn.ghost { background: var(--card-2); color: var(--ink); }
.btn.small { padding: 9px 14px; font-size: 14px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 14px; }
.btn.danger { color: var(--danger); }

/* ---------- 진행 링 ---------- */

.ring-track { fill: none; stroke: var(--line); }
.ring-bar {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
}

/* ---------- 오늘 ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: linear-gradient(135deg, var(--accent-soft), var(--card) 72%);
}
.ring-wrap { position: relative; flex: none; width: 108px; height: 108px; }
.ring-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring-center strong { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.ring-center strong span { font-size: 16px; color: var(--ink-3); font-weight: 700; }
.ring-center small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.hero-text { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.hero-title { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.hero-msg { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 6px; }

.banner {
  margin-top: 12px;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--ink-2);
}

.phases { display: grid; gap: 12px; margin-top: 16px; }

.phase {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: calc(env(safe-area-inset-top) + 16px);
}
.phase-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-align: left;
}
.phase-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--tint-soft);
  font-size: 23px;
}
.phase-meta { flex: 1; min-width: 0; display: grid; }
.phase-title { display: flex; align-items: center; gap: 7px; font-size: 17px; font-weight: 800; }
.phase-sub { font-size: 13px; color: var(--ink-2); }
.phase-sub b { font-weight: 700; color: var(--ink); }
.now {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tint);
  color: #fff;
}
.phase-status { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.phase-status .ring-bar { stroke: var(--tint); }
.done-badge {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  place-items: center;
  background: var(--tint);
  color: #fff;
}
.phase.just .done-badge { animation: pop 0.35s ease; }
.done-badge svg { width: 16px; height: 16px; }
.phase.complete .ring.mini { display: none; }
.phase.complete .done-badge { display: grid; }

.phase-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.phase.open .phase-body { grid-template-rows: 1fr; }
.phase-body > div { overflow: hidden; }

.tasks { list-style: none; display: grid; gap: 6px; padding: 0 12px 12px; }
.task {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border-radius: 16px;
  background: var(--card-2);
  text-align: left;
  transition: background 0.25s;
}
.task .box {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background 0.2s, border-color 0.2s;
}
.task .box svg { width: 15px; height: 15px; opacity: 0; transform: scale(0.4); transition: opacity 0.2s, transform 0.25s; }
.task .label { flex: 1; font-size: 16px; font-weight: 600; transition: color 0.2s; }
.task.done { background: var(--tint-soft); }
.task.done .box { background: var(--tint); border-color: var(--tint); }
.task.done .box svg { opacity: 1; transform: scale(1); }
.task.done .label { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.task.pop .box { animation: pop 0.35s ease; }

@keyframes pop { 50% { transform: scale(1.22); } }

.tag, .time-chip {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--card);
}
.tag.due { color: #fff; background: var(--tint); }
.time-chip { font-variant-numeric: tabular-nums; }
.task.done .time-chip { opacity: 0.6; }
.task.later { opacity: 0.55; }

/* 묶음 (스트레칭, 물 마시기) */
.group {
  padding: 10px 8px 8px;
  border-radius: 18px;
  border: 1.5px dashed var(--line);
}
.group.done { border-style: solid; border-color: var(--tint-soft); background: var(--tint-soft); }
.group-head {
  display: flex;
  justify-content: space-between;
  padding: 0 6px 8px;
  font-size: 14px;
  font-weight: 800;
}
.group-head b { color: var(--ink-2); font-weight: 700; }
.group-head small { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }
.rotation { display: grid; gap: 8px; margin-bottom: 12px; }
.tasks.sub { padding: 0; }

/* 숫자 기록 (귤) */
.task.counter { padding: 8px 8px 8px 14px; }
.task.counter.done { background: var(--tint-soft); }
.task.counter.done .label { text-decoration: none; color: var(--ink); }
.counter-ctl { flex: none; display: flex; align-items: center; gap: 4px; }
.step {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--card);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  box-shadow: var(--shadow);
}
.step:active { transform: scale(0.94); }
.step:disabled { opacity: 0.35; }
.count-num { min-width: 46px; text-align: center; font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-num small { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-left: 1px; }
.count-num.pop { display: inline-block; animation: pop 0.3s ease; }

/* 선택 (음료) */
.task.choice { flex-wrap: wrap; row-gap: 10px; }
.task.choice .options { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-left: 39px; }
.opt {
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.opt.on { background: var(--tint); border-color: var(--tint); color: #fff; }
.task.choice.done .label { text-decoration: none; color: var(--ink); }

/* ---------- 주간 ---------- */

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--ink-2);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:disabled { opacity: 0.3; }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.bar-col { display: grid; justify-items: center; gap: 6px; }
.bar {
  width: 100%;
  max-width: 32px;
  height: 104px;
  border-radius: 11px;
  background: var(--card-2);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar span { width: 100%; border-radius: 11px; background: var(--accent); opacity: 0.55; }
.bar span.full { opacity: 1; }
.bar-col.rest .bar { background: repeating-linear-gradient(-45deg, var(--card-2) 0 6px, transparent 6px 10px); }
.bar-col.rest .bar span { background: var(--ink-3); }
.bar-day { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.bar-col.today .bar-day {
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 0 7px;
}
.bar-val { font-size: 11px; color: var(--ink-3); min-height: 16px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.stats strong { display: block; font-size: 20px; font-weight: 800; }
.stats span { font-size: 12px; color: var(--ink-2); }

/* 주중 통합 트래커 */
.section-head.first { margin-top: 8px; }
.trackers { display: grid; gap: 12px; }
.tracker { display: grid; gap: 12px; }
.tracker-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tracker-count { font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.tracker-count strong { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-right: 2px; }

.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.slot {
  display: grid;
  place-items: center;
  padding: 6px 2px;
  border-radius: 16px;
  background: var(--card-2);
  transition: background 0.25s;
}
.slot svg { width: 100%; height: auto; overflow: visible; }
.tracker[data-kind="fish"] .slot { aspect-ratio: 1; }
.tracker[data-kind="fish"] .slot svg { max-width: 54px; }
.tracker[data-kind="fish"] .slot.on { background: #f3eee5; }
.tracker[data-kind="yoga"] .slot { aspect-ratio: 3 / 4; }
.tracker[data-kind="yoga"] .slot svg { max-width: 46px; max-height: 100%; }
.tracker[data-kind="yoga"] .slot.on { background: var(--night-soft); }
.tracker[data-kind="money"] .slot { aspect-ratio: 1; }
.tracker[data-kind="money"] .slot svg { max-width: 52px; }
.tracker[data-kind="money"] .slot.on { background: var(--slump); }
.tracker[data-kind="money"] .spark i.hit { background: var(--ink-3); }

/* 아이콘이 바뀌는 순간 애니메이션 */
.tracker[data-kind="fish"] .slot.just svg { animation: chomp 0.45s ease; }
.tracker[data-kind="yoga"] .slot.just.on svg { animation: grow 0.5s cubic-bezier(0.3, 1.4, 0.5, 1); transform-origin: 50% 100%; }
.tracker[data-kind="yoga"] .slot.just:not(.on) svg { animation: shrink 0.4s ease; transform-origin: 50% 100%; }
/* 외식: 위에서 툭 떨어진 뒤, 바닥에서 힘없이 버둥거린다 */
.tracker[data-kind="money"] .flail { transform-box: fill-box; transform-origin: 50% 100%; }
.tracker[data-kind="money"] .slot.on .flail { animation: flail 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * -0.41s); }
.tracker[data-kind="money"] .slot.just.on .flail { animation: plummet 0.5s cubic-bezier(0.55, 0, 1, 0.45), flail 2.8s ease-in-out 0.5s infinite; }
.tracker[data-kind="money"] .slot.just:not(.on) svg { animation: pop 0.35s ease; }

@keyframes chomp {
  30% { transform: scale(0.8) rotate(-10deg); }
  60% { transform: scale(1.1) rotate(5deg); }
}
@keyframes grow { from { transform: scale(0.75, 0.45); } }
@keyframes shrink { from { transform: scale(0.9, 1.4); } }
@keyframes plummet { from { transform: translateY(-24px) rotate(-12deg); opacity: 0.3; } }
@keyframes flail { 50% { transform: rotate(-4deg); } }

.goal-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-2); }
.goal-foot b { color: var(--ink); }
.spark-wrap { display: flex; align-items: flex-end; gap: 8px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.spark i { width: 7px; min-height: 3px; border-radius: 3px; background: var(--line); }
.spark i.hit { background: var(--accent); }

/* 평일 기록 모아보기 */
.records { display: grid; gap: 14px; margin-top: 12px; }
.rec { display: grid; gap: 8px; }
.rec + .rec { padding-top: 14px; border-top: 1px solid var(--line); }
.rec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-weight: 700; }
.rec-head small { color: var(--ink-3); font-weight: 600; }
.rec-head strong { font-size: 20px; font-weight: 800; }
.rec-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 12px; color: var(--ink-3); }
.rec-days span { display: grid; gap: 2px; padding: 6px 0; border-radius: 10px; background: var(--card-2); }
.rec-days b { font-size: 15px; color: var(--ink-3); }
.rec-days .on { background: var(--lunch-soft); color: var(--ink-2); }
.rec-days .on b { color: var(--ink); }
.rec-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-chips span { padding: 6px 12px; border-radius: 999px; background: var(--card-2); font-size: 14px; color: var(--ink-3); }
.rec-chips span.on { background: var(--work-soft); color: var(--ink); }
.rec-chips b { margin-left: 2px; }

/* ---------- 설정 ---------- */

.notify-head { display: flex; align-items: center; gap: 14px; }
.notify-icon {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  font-size: 22px;
}
.notify-icon.on { background: var(--accent-soft); }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row .btn { flex: 1; }
.steps { margin: 14px 0 0 20px; display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.steps b { color: var(--ink); }
.steps svg { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }

.set-phase { margin-bottom: 12px; padding: 14px; }
.set-head { display: flex; align-items: center; gap: 10px; }
.set-head .phase-icon { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; }
.set-name { flex: 1; font-size: 16px; font-weight: 800; }

.time-input {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-2);
  font-size: 16px;
  font-weight: 700;
  min-width: 92px;
}

.switch {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }

.edit-list { list-style: none; display: grid; gap: 6px; margin-top: 12px; }
.edit-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 12px;
  border-radius: 14px;
  background: var(--card-2);
}
.edit-row input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
}
.edit-row input:focus { color: var(--accent); }
.mini-btn {
  flex: none;
  width: 32px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.mini-btn svg { width: 17px; height: 17px; }
.mini-btn:disabled { opacity: 0.25; }
.mini-btn.del { color: var(--danger); opacity: 0.75; }

.add-row { display: flex; gap: 8px; margin-top: 8px; }
.add-row input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: transparent;
  font-size: 16px;
  outline: none;
}
.add-row input:focus { border-color: var(--accent); border-style: solid; }
.add-row input[type="date"] { flex: 1.3; }

.hint { margin: -4px 4px 12px; font-size: 13px; color: var(--ink-2); }

.edit-item { border-radius: 14px; }
.edit-item.open { background: var(--card-2); }
.edit-main { flex: 1; min-width: 0; display: grid; }
.edit-tags { display: flex; flex-wrap: wrap; gap: 4px; padding-bottom: 7px; margin-top: -3px; }
.edit-tags span {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--tint-soft, var(--accent-soft));
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
}
.mini-btn.active { color: var(--accent); background: var(--card); }
.edit-more { display: grid; gap: 8px; padding: 4px 12px 12px; }
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.field > input:not(.switch), .field select {
  flex: 1;
  max-width: 62%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.field-ctl { display: flex; align-items: center; gap: 4px; }

.tracker-row { padding-left: 6px; }
.tracker-mini { flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.tracker-mini svg { max-width: 100%; max-height: 100%; }
.stepper { flex: none; display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.stepper .mini-btn { color: var(--ink-2); font-size: 20px; }

.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.off-list { list-style: none; display: grid; gap: 2px; margin: 12px 0 4px; }
.off-list li { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; }
.off-list .date { font-weight: 700; min-width: 92px; }
.off-list .name { flex: 1; color: var(--ink-2); }
.off-list .more { color: var(--ink-3); }

.data-actions { display: grid; gap: 8px; }
.data-actions label { cursor: pointer; }
.data-actions p { margin-top: 4px; }

.foot { margin-top: 24px; text-align: center; color: var(--ink-3); font-size: 12px; }

/* ---------- 탭바 / 토스트 ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px calc(6px + env(safe-area-inset-bottom));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1;
  max-width: 140px;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a.active { color: var(--accent); }
.tabbar svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.toast button { color: var(--accent); font-weight: 800; white-space: nowrap; }

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