/* ===========================================================
   打卡 · 健身  —  styles
   配色：十月拾光 / Swan Lake / making a wish / 早春晴朗
   风格：水彩纸品 · 手账 · 请柬
   =========================================================== */

:root {
  /* 纸 */
  --paper: #faf3ea;
  --paper-2: #f4e8da;
  --card: #fffcf7;
  --card-2: #fffaf2;

  /* 墨 */
  --ink: #4b3a31;
  --ink-soft: #6e5a4d;
  --muted: #85705f;

  /* 线 */
  --line: #e9d8c5;
  --line-soft: #f4eade;

  /* 色卡 */
  --berry: #b64a54;
  --berry-deep: #8e3b44;
  --blush: #f9d0cd;
  --blush-pale: #fbe7e0;
  --gold: #c9a05a;
  --gold-deep: #a57c39;
  --sage: #8fb3a4;
  --teal: #5e9c90;
  --blue: #a9c2d9;
  --danger: #a0453a;

  --radius: 20px;
  --shadow: 0 1px 2px rgba(122, 88, 66, .05), 0 12px 28px rgba(122, 88, 66, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font-serif: "STFangsong", "FangSong", "仿宋", "FangSong_GB2312", "Songti SC",
    "Noto Serif SC", "SimSun", serif;
  /* 数字：iPhone 上是 Didot Italic，Windows 退到 Times / Georgia */
  --font-num: "Didot", "Bodoni 72", "Baskerville", "Times New Roman", Georgia, serif;

  /* 纸纹（内联 SVG 噪点，不依赖外部资源） */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");

  /* 小树枝 */
  --sprig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fb3a4' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M12 21.5V8.5'/%3E%3Cpath d='M12 14.5c-3.2 0-5.4-2.1-5.4-5.3 3.2 0 5.4 2.1 5.4 5.3Z'/%3E%3Cpath d='M12 11c3.2 0 5.4-2.1 5.4-5.3-3.2 0-5.4 2.1-5.4 5.3Z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  background-color: var(--paper);
  background-image: var(--noise);
  background-size: 160px 160px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body.sheet-open { overflow: hidden; }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------------- layout ---------------- */

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(96px + var(--safe-b));
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 14px;
  border-bottom: 2px dashed rgba(201, 160, 90, .32);
  margin-bottom: 16px;
}

.brand h1 {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.2;
}

.brand h1::before {
  content: "";
  width: 22px;
  height: 22px;
  background: var(--sprig) no-repeat center / contain;
  flex: 0 0 auto;
  opacity: .9;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
}

.streak {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: var(--blush-pale);
  color: var(--berry-deep);
  font-size: 12.5px;
  box-shadow: inset 0 0 0 1px #f1cbc5;
}
.streak b { font-size: 15px; font-weight: 700; }
.streak .flame { margin-right: 1px; font-size: 13px; }
.streak-label { opacity: .72; }

.view { display: none; }
.view.active { display: block; animation: fadeUp .3s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------------- cards ---------------- */

.card {
  position: relative;
  background: var(--card);
  background-image: linear-gradient(180deg, #fffdf9, #fffcf7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-title, .card h3 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--ink-soft);
}

.label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 4px 6px 0;
}
.hint.center { text-align: center; padding: 10px 0 0; }

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 24px 8px;
}

/* ---------------- calendar ---------------- */

.calendar-card {
  padding: 20px 14px 14px;
  overflow: hidden;
}

/* 顶部丝带条纹：呼应请柬里的粉白条纹 */
.calendar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: repeating-linear-gradient(90deg,
    var(--blush) 0 8px, var(--blush-pale) 8px 16px);
  opacity: .9;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 12px;
}

.cal-title { text-align: center; }
.cal-title h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .08em;
}

.today-btn {
  display: block;
  margin: 2px auto 0;
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--berry);
  padding: 1px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-style: dotted;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 21px;
  line-height: 1;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  box-shadow: 0 1px 0 rgba(122, 88, 66, .06);
  transition: background .15s, transform .1s;
  flex: 0 0 auto;
}
.icon-btn:active { transform: scale(.94); background: #ebdcc9; }

.weekdays, .grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.weekdays {
  padding-bottom: 6px;
}
.weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .14em;
}

.day {
  position: relative;
  min-height: 54px;
  padding: 3px 0 4px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  transition: background .15s, transform .1s;
}
.day:active { transform: scale(.95); }

.day .num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-num);
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
}

.day.other .num { color: #ccbfb0; }
.day.other .mark { opacity: .3; }

.day.today .num {
  background: var(--berry);
  color: #fff8f0;
  font-weight: 600;
}

.day.has { background: var(--blush-pale); box-shadow: inset 0 0 0 1px #f2d4ce; }
.day.has.other { background: #fdf1ed; box-shadow: inset 0 0 0 1px #f7e3de; }

.day .mark {
  height: 20px;
  width: 100%;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
}
.day .mark img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
.day .mark .tick {
  color: var(--berry);
  font-size: 11px;
  font-weight: 700;
  background: #fffaf4;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1px #eec6c0;
}
.day .mark.wdot::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  display: block;
}

.legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--muted);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot.checked { background: var(--blush-pale); box-shadow: inset 0 0 0 1px #f0cdc6; }
.dot.weight { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }

.cal-foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  padding: 4px 0;
}

/* ---------------- weight ---------------- */

.big-weight {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 0;
}
.big-weight #wNow {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 50px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}
.big-weight .unit { font-size: 15px; color: var(--muted); }

.weight-meta { font-size: 13px; color: var(--muted); }
.weight-meta .down { color: var(--teal); font-weight: 600; }
.weight-meta .up { color: #c07350; font-weight: 600; }

.target-block { margin-top: 14px; }
.target-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.bar {
  height: 8px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(122, 88, 66, .05);
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg,
    var(--blush) 0 8px, #fbdcd8 8px 16px);
  transition: width .5s cubic-bezier(.2, .8, .3, 1);
}

.chart-wrap { margin-top: 14px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }

.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-top: 1px dashed var(--line);
}
.list li:first-child { border-top: 0; }
.li-date { font-size: 12.5px; color: var(--ink-soft); flex: 1; letter-spacing: .02em; }
.li-kg {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 18px;
  font-weight: 400;
}
.li-delta {
  font-size: 12px;
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.li-delta.down { color: var(--teal); }
.li-delta.up { color: #c07350; }
.li-delta.flat { color: var(--muted); }
.li-del {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #bfae9d;
  font-size: 17px;
  display: grid;
  place-items: center;
  margin-left: 2px;
}
.li-del:active { background: var(--paper-2); }

/* ---------------- fields ---------------- */

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px dashed var(--line);
}
.field:first-of-type { border-top: 0; }
.field.column { flex-direction: column; align-items: stretch; gap: 8px; }
.field label { color: var(--ink-soft); font-size: 14.5px; }

.input-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  border-radius: 10px;
  padding: 2px 6px;
  transition: background .15s;
}
.input-wrap:focus-within { background: var(--paper-2); }
.input-wrap input {
  width: 92px;
  border: 0;
  background: none;
  text-align: right;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  outline: none;
  padding: 2px 0;
}
.input-wrap input::-webkit-outer-spin-button,
.input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input-wrap .unit { color: var(--muted); font-size: 12.5px; min-width: 20px; }
.input-wrap input[type=date] { width: 170px; max-width: 100%; font-size: 16px; }

.field textarea {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--card-2);
  padding: 11px 12px;
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.field textarea:focus { border-color: var(--blush); background: #fffdf9; }

/* ---------------- buttons ---------------- */

.btn {
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.975); }
.btn.block { width: 100%; margin-top: 16px; }
.btn.primary {
  background: var(--berry);
  color: #fff8f1;
  box-shadow: 0 2px 0 rgba(142, 59, 68, .22);
}
.btn.primary:disabled { opacity: .5; }
.btn.ghost {
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px dashed #e3d0bb;
}
.btn.soft {
  background: var(--blush-pale);
  color: var(--berry-deep);
  border: 1px solid #f2cfc8;
}
.btn.danger-text {
  width: 100%;
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  padding: 12px;
  margin-top: 10px;
}
.btn-text {
  color: var(--berry);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 4px;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.btn-row .btn { flex: 1; }

/* ---------------- stats ---------------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  padding: 6px 0 14px;
}
.stat-row > div { display: flex; flex-direction: column; gap: 2px; }
.stat-row b {
  font-family: var(--font-num);
  font-style: italic;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.15;
}
.stat-row span { font-size: 11.5px; color: var(--muted); letter-spacing: .08em; }

/* ---------------- sticker / stamp grids ---------------- */

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 0 2px;
}
.stamp-grid.manage { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.stamp-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--card-2);
  border: 1.5px dashed #e4d2bd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: border-color .15s, background .15s, transform .1s;
  overflow: hidden;
  padding: 4px;
}
.stamp-tile:active { transform: scale(.95); }
.stamp-tile .em { font-size: 27px; line-height: 1; }
.stamp-tile img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.stamp-tile .nm {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stamp-tile.selected {
  border-style: solid;
  border-color: var(--berry);
  background: var(--blush-pale);
  box-shadow: inset 0 0 0 1px #f2cfc8;
}
.stamp-tile.upload .plus { font-size: 24px; color: var(--muted); line-height: 1; }
.stamp-tile .del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(75, 58, 49, .72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
}

/* ---------------- day sheet content ---------------- */

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
}
.sheet-head h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .06em;
}

.day-status { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .03em;
}
.pill.done {
  background: var(--blush-pale);
  color: var(--berry-deep);
  box-shadow: inset 0 0 0 1px #f2cfc8;
}
.pill.warn { background: #fdf0e2; color: var(--gold-deep); }

.day-stamp {
  display: grid;
  place-items: center;
  min-height: 0;
}
.day-stamp img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin: 10px 0 4px;
  filter: drop-shadow(0 6px 12px rgba(122, 88, 66, .16));
  animation: stampIn .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.day-stamp .em {
  font-size: 54px;
  line-height: 1;
  margin: 12px 0 6px;
  animation: stampIn .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes stampIn {
  from { transform: scale(.4) rotate(-14deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.day-workouts { margin: 8px 0 4px; }

.workout {
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  margin-top: 8px;
}
.wo-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.wo-top b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.wo-top .wo-min { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--berry); font-weight: 600; }
.wo-top .wo-del {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #c2b1a0;
  font-size: 16px;
  display: grid;
  place-items: center;
}
.wo-note {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.sheet-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding-top: 16px;
}
.sheet-actions .btn { padding: 13px 8px; font-size: 14px; }
.sheet-actions.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------------- sheets ---------------- */

.sheet-layer {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}
.sheet-layer.open { display: block; }

.backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 55, 44, .42);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  background: var(--card);
  background-image: var(--noise);
  background-size: 160px 160px;
  border-radius: 26px 26px 0 0;
  padding: 6px 20px calc(20px + var(--safe-b));
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -14px 40px rgba(122, 88, 66, .16);
  animation: slideUp .3s cubic-bezier(.2, .85, .3, 1) both;
}
@keyframes slideUp {
  from { transform: translateY(102%); }
  to { transform: translateY(0); }
}

.grabber {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #e6d3bf;
  margin: 6px auto 14px;
}

/* ---------------- chips ---------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 8px;
}
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px dashed #e3d0bb;
  color: var(--ink-soft);
  font-size: 13px;
  transition: background .15s, color .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
.chip.selected {
  background: var(--berry);
  border-color: var(--berry);
  border-style: solid;
  color: #fff8f1;
}

/* ---------------- celebration ---------------- */

.celebrate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  place-items: center;
  background: rgba(74, 55, 44, .5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 24px;
}
.celebrate.open { display: grid; animation: fadeIn .2s ease both; }

.celebrate-card {
  position: relative;
  z-index: 2;
  width: min(86vw, 330px);
  background: var(--card);
  background-image: var(--noise);
  background-size: 160px 160px;
  border: 2px dashed #e8c3ba;
  border-radius: 28px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(74, 55, 44, .26);
  animation: pop .5s cubic-bezier(.2, 1.3, .35, 1) both;
}
@keyframes pop {
  from { transform: scale(.82); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.celebrate-card .celeb-emoji { font-size: 52px; line-height: 1; margin-bottom: 10px; }
.celebrate-card h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .04em;
}
.celebrate-card h2 .drop { color: var(--berry); font-size: 27px; }
.celebrate-card p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.celebrate-card .btn { margin-top: 18px; }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i {
  position: absolute;
  top: -20px;
  left: var(--x);
  width: var(--s);
  height: calc(var(--s) * .6);
  background: var(--c);
  border-radius: var(--r);
  animation: fall var(--dur) linear var(--delay) forwards;
}
@keyframes fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate3d(var(--dx), 112vh, 0) rotate(var(--rot)); opacity: .85; }
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(104px + var(--safe-b));
  transform: translate(-50%, 8px);
  background: rgba(75, 58, 49, .94);
  color: #fdf6ec;
  font-size: 13px;
  letter-spacing: .03em;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 400;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- tabbar ---------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px calc(6px + var(--safe-b));
  background: rgba(250, 243, 234, .93);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px dashed rgba(201, 160, 90, .38);
}
.tab {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  border-radius: 14px;
  color: #9a8577;
  font-size: 11.5px;
  letter-spacing: .14em;
  transition: color .15s;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--berry); }
.tab:active { background: rgba(122, 88, 66, .05); }

/* ---------------- desktop ---------------- */

@media (min-width: 620px) {
  body { background-color: #f3e7d9; }
  .app {
    padding-top: 28px;
    padding-bottom: 110px;
  }
  .card { padding: 22px; }
  .calendar-card { padding: 22px 18px 16px; }
  .day { min-height: 60px; }
  .day .num { font-size: 15px; }
  .stamp-grid.manage { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
