:root {
  color-scheme: light;
  --cream: #fffaf4;
  --cream-deep: #f7eadf;
  --milk: #fffefd;
  --berry: #a72d38;
  --berry-dark: #7f1724;
  --strawberry: #cf5261;
  --blush: #f5cbd0;
  --petal: #f9e2e6;
  --sky: #cfe4ec;
  --ink: #4a2a2f;
  --muted: #9a7479;
  --line: rgba(127, 23, 36, 0.18);
  --shadow: 0 18px 50px rgba(127, 23, 36, 0.14);
  --small-shadow: 0 8px 22px rgba(127, 23, 36, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(167, 45, 56, 0.08) 50%, transparent 50%) 0 0 / 40px 40px,
    linear-gradient(0deg, rgba(167, 45, 56, 0.08) 50%, transparent 50%) 0 0 / 40px 40px,
    var(--cream);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shell {
  position: relative;
  width: min(100%, 1080px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(255, 250, 244, 0.94)),
    var(--cream);
}

.shell::before,
.shell::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.shell::before {
  inset: 0;
  background:
    radial-gradient(circle at 14% 16%, rgba(207, 82, 97, 0.15) 0 7px, transparent 8px),
    radial-gradient(circle at 82% 20%, rgba(207, 228, 236, 0.65) 0 26px, transparent 27px),
    linear-gradient(135deg, transparent 0 70%, rgba(207, 228, 236, 0.3) 70%);
}

.shell::after {
  right: -36px;
  bottom: 68px;
  width: 180px;
  height: 76px;
  border: 2px solid rgba(127, 23, 36, 0.18);
  border-radius: 999px 999px 34px 34px;
  background: rgba(255, 255, 255, 0.42);
  transform: rotate(-12deg);
}

.card-stage,
.topbar,
.main-header,
.content-stack,
.compact-list,
.shop-grid,
.achievement-grid,
.bottom-nav,
.timer-center,
.timer-actions,
.mode-tabs {
  position: relative;
  z-index: 1;
}

.gingham-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 74px;
  background:
    linear-gradient(90deg, rgba(167, 45, 56, 0.18) 50%, transparent 50%) 0 0 / 28px 28px,
    linear-gradient(0deg, rgba(167, 45, 56, 0.18) 50%, transparent 50%) 0 0 / 28px 28px,
    #fff8f0;
  mask-image: linear-gradient(#000 0 70%, transparent);
}

.card-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 84px 18px 42px;
}

.round-entry,
.soft-icon,
.date-pill,
.fab,
.modal-close,
.calendar-head button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(127, 23, 36, 0.18);
  border-radius: 999px;
  background: rgba(255, 254, 253, 0.9);
  box-shadow: var(--small-shadow);
}

.round-entry {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
}

.card-kicker {
  align-self: end;
  margin: 0 0 10px;
  color: var(--berry);
  font-size: 0.88rem;
  font-weight: 700;
}

.task-focus-card {
  position: relative;
  width: min(88vw, 430px);
  min-height: 390px;
  padding: 76px 28px 24px;
  border: 2px solid rgba(167, 45, 56, 0.34);
  border-radius: 28px;
  outline: 8px solid rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(var(--milk), var(--milk)) padding-box,
    repeating-linear-gradient(45deg, rgba(167, 45, 56, 0.5) 0 8px, #fff7ef 8px 16px) border-box;
  box-shadow: var(--shadow);
  text-align: center;
  touch-action: none;
}

.task-focus-card::before {
  position: absolute;
  inset: 13px;
  border: 1px dashed rgba(167, 45, 56, 0.24);
  border-radius: 20px;
  content: "";
}

.sticker-label {
  position: absolute;
  top: 22px;
  left: 22px;
  padding: 7px 12px;
  border: 1px solid rgba(127, 23, 36, 0.2);
  border-radius: 999px;
  background: var(--sky);
  color: var(--berry-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.bow-mark {
  position: absolute;
  top: 27px;
  right: 26px;
  width: 52px;
  height: 30px;
}

.bow-mark::before,
.bow-mark::after {
  position: absolute;
  top: 4px;
  width: 25px;
  height: 22px;
  border: 2px solid rgba(127, 23, 36, 0.34);
  background: var(--petal);
  content: "";
}

.bow-mark::before {
  left: 1px;
  border-radius: 70% 35% 65% 45%;
  transform: rotate(18deg);
}

.bow-mark::after {
  right: 1px;
  border-radius: 35% 70% 45% 65%;
  transform: rotate(-18deg);
}

.task-focus-card h1 {
  position: relative;
  margin: 66px 0 18px;
  font-size: clamp(2rem, 7vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.task-focus-card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.swipe-hints {
  position: absolute;
  right: 20px;
  bottom: 20px;
  left: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.swipe-hints span,
.card-actions button,
.mode-tabs button,
.timer-actions button,
.modal-form button,
.reward-card button {
  border: 1px solid rgba(127, 23, 36, 0.16);
  border-radius: 999px;
  background: #fff8f8;
  color: var(--berry-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.swipe-hints span {
  padding: 8px 5px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.card-actions button,
.timer-actions button,
.modal-form button {
  min-height: 38px;
  padding: 0 15px;
}

.topbar,
.main-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 8px;
}

.topbar h1,
.main-header h1 {
  margin: 2px 0 0;
  font-size: 1.26rem;
  line-height: 1.18;
}

.mini-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.soft-icon,
.date-pill {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--berry-dark);
  font-weight: 900;
}

.points,
.topbar strong {
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--berry-dark);
  font-size: 0.86rem;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  padding: 16px;
}

.mode-tabs button {
  min-height: 36px;
  padding: 0 6px;
}

.mode-tabs button.active,
.bottom-nav button.active {
  background: var(--berry);
  color: #fff;
}

.timer-center {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 46px 18px 22px;
}

.timer-orb {
  width: min(68vw, 310px);
  aspect-ratio: 1;
  border: 2px solid rgba(167, 45, 56, 0.28);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 42%, #fff 0 38%, transparent 39%),
    conic-gradient(from 20deg, var(--petal), #fff8f0, var(--sky), var(--petal));
  box-shadow: var(--shadow);
}

.timer-orb span {
  display: block;
  padding: 0 34px;
  font-size: clamp(1.35rem, 5vw, 2.4rem);
  font-weight: 900;
  line-height: 1.25;
}

.timer-center p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.timer-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 6px 18px 28px;
}

.content-stack,
.compact-list,
.shop-grid,
.achievement-grid {
  padding: 12px 14px 92px;
}

.tomorrow-slot {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px dashed rgba(167, 45, 56, 0.28);
  border-radius: 18px;
  background: rgba(255, 254, 253, 0.78);
}

.tomorrow-slot span,
.habit-row span,
.reward-card span,
.achievement-grid span,
.mini-task small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.quadrant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quadrant {
  min-height: 150px;
  padding: 10px;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 16px;
  background: rgba(255, 254, 253, 0.82);
  box-shadow: var(--small-shadow);
}

.quadrant h2 {
  margin: 0 0 8px;
  color: var(--berry-dark);
  font-size: 0.91rem;
}

.task-list {
  display: grid;
  gap: 7px;
}

.mini-task,
.habit-row,
.reward-card,
.achievement-grid article {
  border: 1px solid rgba(127, 23, 36, 0.12);
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 5px 14px rgba(127, 23, 36, 0.08);
}

.mini-task {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 9px 10px;
  text-align: left;
}

.mini-task span {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 800;
}

.mini-task em,
.task-note {
  position: relative;
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.mini-task em {
  overflow: hidden;
  font-size: 0.74rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-note {
  max-width: min(84%, 520px);
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: 14px;
  background: rgba(255, 248, 248, 0.72);
  font-size: 0.88rem;
  line-height: 1.45;
}

.empty {
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-list {
  display: grid;
  gap: 9px;
}

.habit-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}

.habit-row div {
  display: grid;
  gap: 3px;
}

.check-round {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(167, 45, 56, 0.32);
  border-radius: 50%;
  background: #fff7f7;
}

.check-round.done {
  background: radial-gradient(circle, #fff 0 24%, var(--berry) 25%);
}

.shop-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reward-card,
.achievement-grid article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 13px;
}

.reward-card button {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
}

.achievement-grid strong {
  color: var(--berry-dark);
  font-size: 1.9rem;
}

.heatmap-card {
  grid-column: 1 / -1;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 5px;
}

.heatmap i {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--cream-deep);
}

.heatmap i.warm {
  background: var(--petal);
}

.heatmap i.hot {
  background: var(--strawberry);
}

.bottom-nav {
  position: fixed;
  right: max(12px, calc((100vw - 1080px) / 2 + 12px));
  bottom: 12px;
  left: max(12px, calc((100vw - 1080px) / 2 + 12px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 1056px;
  margin: 0 auto;
  padding: 7px;
  border: 1px solid rgba(127, 23, 36, 0.16);
  border-radius: 22px;
  background: rgba(255, 254, 253, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.bottom-nav button {
  min-height: 39px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.fab {
  position: fixed;
  right: max(18px, calc((100vw - 1080px) / 2 + 18px));
  z-index: 3;
  width: 50px;
  height: 50px;
  color: var(--berry-dark);
  font-weight: 900;
}

.fab-card {
  bottom: 136px;
  background: var(--sky);
}

.fab-add {
  bottom: 78px;
  background: var(--petal);
  font-size: 1.25rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(74, 42, 47, 0.22);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid rgba(127, 23, 36, 0.18);
  border-radius: 24px;
  background: var(--milk);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
}

.modal-form {
  display: grid;
  gap: 13px;
}

.modal-form h2 {
  margin: 0 34px 4px 0;
}

.modal-form p {
  margin: 0;
  color: var(--muted);
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--berry-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  width: 100%;
  padding: 0 12px;
  border: 1px solid rgba(127, 23, 36, 0.18);
  border-radius: 14px;
  background: #fffaf7;
  color: var(--ink);
}

.modal-form input,
.modal-form select {
  min-height: 42px;
}

.modal-form textarea {
  height: 42px;
  min-height: 42px;
  padding-top: 9px;
  padding-bottom: 9px;
  max-width: 100%;
  resize: vertical;
}

.modal-form .check-field {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 999px;
  background: #fff8f8;
}

.modal-form .check-field input {
  width: auto;
  min-height: 0;
  padding: 0;
}

.modal-form label.is-disabled {
  opacity: 0.52;
}

.modal-form button[type="submit"] {
  background: var(--berry);
  color: #fff;
}

.prompt-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.calendar {
  display: grid;
  gap: 12px;
}

.calendar-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.calendar-head button {
  width: 36px;
  height: 36px;
}

.week-row,
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-row span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.day-grid button {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-weight: 800;
}

.day-grid button.picked {
  background: var(--sky);
  color: var(--berry-dark);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 96px;
  padding: 10px 13px;
  border-radius: 999px;
  background: var(--berry-dark);
  color: #fff;
  box-shadow: var(--small-shadow);
}

@media (min-width: 780px) {
  .shell {
    min-height: 760px;
    margin-top: 24px;
    margin-bottom: 24px;
    border: 1px solid rgba(127, 23, 36, 0.14);
    border-radius: 30px;
    box-shadow: var(--shadow);
  }

  .app-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
  }

  .content-stack,
  .compact-list,
  .shop-grid,
  .achievement-grid {
    padding-right: 22px;
    padding-left: 22px;
  }

  .quadrant-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quadrant {
    min-height: 360px;
  }

  .compact-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-grid,
  .achievement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .heatmap-card {
    grid-column: span 2;
  }

  .modal-backdrop {
    place-items: center;
  }
}

@media (max-width: 380px) {
  .task-focus-card {
    min-height: 350px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .swipe-hints {
    grid-template-columns: 1fr;
  }

  .quadrant-grid,
  .shop-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

/* v2: softer transfer-station inspired shell */
body {
  background:
    linear-gradient(90deg, rgba(144, 48, 55, 0.22) 50%, transparent 50%) 0 0 / 34px 34px,
    linear-gradient(0deg, rgba(144, 48, 55, 0.22) 50%, transparent 50%) 0 0 / 34px 34px,
    #fff7f1;
}

.shell {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.66) 0 70px, transparent 70px),
    linear-gradient(to bottom, #fff7f1 0 74%, #d8e8ee 74% 100%);
}

.shell::before {
  inset: 54px 10px 82px;
  border-radius: 34px;
  background:
    linear-gradient(#fffaf4, #fffdf9) padding-box,
    repeating-linear-gradient(90deg, rgba(144, 48, 55, 0.16) 0 10px, rgba(255, 255, 255, 0.8) 10px 20px) border-box;
  border: 1px solid rgba(144, 48, 55, 0.12);
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.72),
    0 18px 50px rgba(127, 23, 36, 0.12);
}

.shell::after {
  right: 42%;
  bottom: 22px;
  width: 132px;
  height: 60px;
  border-color: rgba(144, 48, 55, 0.12);
  border-radius: 50% 50% 20px 20px;
  background:
    radial-gradient(circle at 50% 18%, #b94a55 0 9px, transparent 10px),
    radial-gradient(circle at 36% 38%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 50% 38%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 64% 38%, #fff 0 5px, transparent 6px),
    #ffe9e8;
  transform: none;
}

.main-header {
  grid-template-columns: 76px 1fr 76px;
  min-height: 76px;
  padding: 18px 18px 6px;
}

.year-pill,
.day-chip,
.avatar-button,
.undo-button {
  border: 1px solid rgba(144, 48, 55, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 250, 0.92);
  color: var(--berry-dark);
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(127, 23, 36, 0.1);
}

.year-pill {
  min-height: 40px;
  padding: 0 14px;
}

.points-center {
  justify-self: center;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(144, 48, 55, 0.16);
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: var(--small-shadow);
}

.points-center span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.points-center strong {
  color: var(--berry-dark);
  font-size: 1.15rem;
}

.avatar-button {
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  background:
    radial-gradient(circle at 50% 40%, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 50% 72%, #fff 0 13px, transparent 14px),
    var(--sky);
}

.profile-menu {
  position: absolute;
  top: 66px;
  right: 16px;
  z-index: 4;
  display: grid;
  width: 156px;
  padding: 8px;
  border: 1px solid rgba(144, 48, 55, 0.14);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.profile-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.profile-menu button:hover {
  background: var(--petal);
}

.date-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 6px 16px 10px;
}

.day-chip {
  min-height: 36px;
  padding: 0 13px;
}

.month-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 1px 8px;
  scrollbar-width: none;
}

.month-scroll::-webkit-scrollbar {
  display: none;
}

.month-scroll button {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 34px;
  border: 1px solid rgba(144, 48, 55, 0.14);
  border-radius: 999px;
  background: #fffdf9;
  color: var(--muted);
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(127, 23, 36, 0.08);
}

.month-scroll button.active {
  background: var(--berry);
  color: #fff;
}

.content-stack {
  padding-top: 4px;
}

.quadrant-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 9px;
  margin-bottom: 10px;
}

.tomorrow-slot {
  margin-bottom: 0;
  border-style: solid;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(207, 228, 236, 0.55), transparent 42%),
    #fffdf9;
}

.tomorrow-slot span {
  justify-self: start;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
}

.undo-button {
  min-width: 62px;
  padding: 0 12px;
}

.quadrant {
  border-radius: 20px;
  background:
    linear-gradient(#fffdf9, #fffaf6) padding-box,
    repeating-linear-gradient(45deg, rgba(207, 82, 97, 0.18) 0 7px, rgba(255, 255, 255, 0.85) 7px 14px) border-box;
  border: 1px solid transparent;
}

.quadrant h2 {
  display: inline-block;
  margin-bottom: 9px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f4d6da;
  color: var(--berry-dark);
}

.mini-task,
.habit-row,
.reward-card,
.achievement-grid article {
  border-radius: 18px;
  background: #fffefa;
}

.bottom-nav {
  border-radius: 28px;
  background: rgba(255, 253, 250, 0.94);
}

.fab-add {
  background: var(--berry);
  color: #fff;
  border: 6px solid rgba(255, 255, 255, 0.76);
}

.fab-card {
  background: #fffdf9;
}

.year-picker h2 {
  margin: 0 0 14px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.year-grid button {
  min-height: 42px;
  border: 1px solid rgba(144, 48, 55, 0.14);
  border-radius: 14px;
  background: #fff8f8;
  color: var(--berry-dark);
  font-weight: 900;
}

.year-grid button.picked {
  background: var(--sky);
}

@media (min-width: 780px) {
  .date-rail {
    padding-right: 22px;
    padding-left: 22px;
  }

  .main-header {
    padding-right: 22px;
    padding-left: 22px;
  }
}

@media (max-width: 430px) {
  .main-header {
    grid-template-columns: 70px 1fr 70px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .date-rail {
    grid-template-columns: 1fr;
    padding-right: 12px;
    padding-left: 12px;
  }

  .day-chip {
    justify-self: start;
  }

  .points-center {
    min-width: 104px;
    padding: 0 14px;
  }
}

/* v3: keep the date rail inside the calendar popup only */
.shell {
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.66) 0 70px, transparent 70px),
    linear-gradient(to bottom, #fff7f1 0 70%, #f8ede9 70% 82%, #e7f0f2 82% 100%);
}

.main-header {
  padding-bottom: 12px;
}

.date-pill {
  justify-self: start;
  min-width: 58px;
  min-height: 42px;
  padding: 0 14px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  background: var(--berry);
  color: #fff;
  box-shadow: 0 8px 20px rgba(127, 23, 36, 0.18);
}

.points-center {
  border-color: rgba(144, 48, 55, 0.2);
  background: #fff6f6;
}

.points-center strong {
  color: var(--berry);
}

.avatar-button {
  background:
    radial-gradient(circle at 50% 40%, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 50% 72%, #fff 0 13px, transparent 14px),
    #f3d7dc;
}

.header-spacer {
  width: 58px;
  height: 42px;
}

.content-stack {
  padding-top: 10px;
}

.modal-card {
  border: 1px solid transparent;
  background:
    linear-gradient(#fffdf9, #fff9f3) padding-box,
    repeating-linear-gradient(90deg, rgba(144, 48, 55, 0.18) 0 10px, rgba(255, 255, 255, 0.85) 10px 20px) border-box;
}

.calendar-head {
  grid-template-columns: 1fr;
  justify-items: center;
}

.calendar-head .calendar-year {
  width: auto;
  min-width: 120px;
  height: 42px;
  border: 1px solid rgba(144, 48, 55, 0.16);
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: var(--small-shadow);
}

.calendar-months {
  margin: 0 -4px;
  padding-bottom: 10px;
}

.calendar-months button {
  min-width: 62px;
}

.compact-years {
  padding: 8px;
  border: 1px dashed rgba(144, 48, 55, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.day-grid button.picked {
  background: var(--sky);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.75);
}

@media (min-width: 780px) {
  .content-stack {
    padding-top: 12px;
  }
}

@media (max-width: 430px) {
  .main-header {
    padding-bottom: 10px;
  }
}

/* v4: smaller calendar popup, real swipe feel, timer title plaque */
.modal-card {
  width: min(100%, 370px);
  padding: 16px;
}

.calendar {
  gap: 8px;
}

.calendar-head .calendar-year {
  min-width: 108px;
  height: 36px;
  font-size: 0.98rem;
}

.calendar-months {
  gap: 6px;
  padding-bottom: 6px;
}

.calendar-months button {
  min-width: 50px;
  min-height: 30px;
  font-size: 0.78rem;
}

.week-row,
.day-grid {
  gap: 4px;
}

.week-row span {
  font-size: 0.7rem;
}

.day-grid button {
  min-height: 31px;
  font-size: 0.82rem;
}

.compact-years {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.compact-years button {
  min-height: 34px;
  font-size: 0.8rem;
}

.date-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.task-focus-card {
  transition: transform 160ms ease, box-shadow 160ms ease;
  user-select: none;
}

.task-focus-card.is-dragging {
  box-shadow: 0 24px 62px rgba(127, 23, 36, 0.2);
  transition: none;
}

.timer-shell .topbar {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
}

.timer-title-card {
  position: relative;
  justify-self: center;
  display: grid;
  justify-items: center;
  max-width: min(68vw, 440px);
  padding: 8px 22px 10px;
  border: 1px solid rgba(144, 48, 55, 0.18);
  border-radius: 999px;
  background:
    radial-gradient(circle at 0 50%, transparent 0 9px, #fffdf9 10px),
    radial-gradient(circle at 100% 50%, transparent 0 9px, #fffdf9 10px),
    #fffdf9;
  box-shadow:
    inset 0 0 0 4px rgba(255, 236, 238, 0.72),
    0 8px 20px rgba(127, 23, 36, 0.1);
  text-align: center;
}

.timer-title-card::before {
  position: absolute;
  inset: 4px 10px;
  border: 1px dashed rgba(144, 48, 55, 0.22);
  border-radius: 999px;
  content: "";
  pointer-events: none;
}

.timer-title-card span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.timer-title-card h1 {
  max-width: 100%;
  margin: 1px 0 0;
  overflow: hidden;
  color: var(--berry-dark);
  font-size: 1rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 430px) {
  .modal-card {
    width: min(100%, 350px);
    padding: 14px;
  }

  .date-pair {
    grid-template-columns: 1fr;
  }

  .timer-title-card {
    max-width: 62vw;
    padding-right: 16px;
    padding-left: 16px;
  }
}

/* v5: profile panel, berry heatmap, solid dialogs, and card lace */
.card-shell .gingham-strip {
  height: 94px;
  background:
    radial-gradient(circle at 16px 84px, transparent 0 14px, #fff7f1 15px 16px, transparent 17px) 0 0 / 32px 94px repeat-x,
    linear-gradient(90deg, rgba(144, 48, 55, 0.24) 50%, transparent 50%) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(144, 48, 55, 0.24) 50%, transparent 50%) 0 0 / 32px 32px,
    #fff8f2;
  mask-image: none;
}

.card-shell .gingham-strip::after {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 54px;
  height: 28px;
  border: 2px solid rgba(127, 23, 36, 0.22);
  border-radius: 50%;
  background: #fffdf9;
  content: "";
}

.profile-menu {
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: auto;
  margin: 0 16px 10px;
  padding: 10px;
  border: 1px solid rgba(144, 48, 55, 0.18);
  border-radius: 22px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.profile-menu button {
  min-height: 42px;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: 15px;
  background: #fff8f8;
  color: var(--berry-dark);
  text-align: center;
  font-weight: 900;
}

.profile-menu button:hover {
  background: var(--petal);
}

.modal-card {
  border: 1px solid rgba(144, 48, 55, 0.18);
  background: #fffdf9;
}

.compact-years {
  border-style: solid;
}

.heatmap-title button {
  background: #fff0f2;
  color: var(--berry);
}

.heatmap-title strong {
  color: var(--berry-dark);
}

.month-heatmap span {
  color: var(--muted);
}

.month-heatmap i {
  background: #fff5f1;
  color: #8f6c70;
}

.month-heatmap i.level-1 {
  background: #f9dfe2;
}

.month-heatmap i.level-2 {
  background: #efb9c0;
}

.month-heatmap i.level-3 {
  background: #d97883;
  color: #fff;
}

.month-heatmap i.level-4 {
  background: var(--berry);
  color: #fff;
}

.month-heatmap i.picked {
  border: 2px solid var(--berry-dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

@media (max-width: 430px) {
  .profile-menu {
    grid-template-columns: 1fr;
  }
}

/* v4: restore roomy quadrants and use cropped reference borders */
.shell {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    url("./assets/bottom-border.png") bottom center / 100% auto no-repeat,
    linear-gradient(to bottom, #fff7f1 0 72%, #f7eeeb 72% 100%);
}

.shell::before {
  inset: 78px 10px 92px;
  border-radius: 30px;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(144, 48, 55, 0.12);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.72),
    0 18px 50px rgba(127, 23, 36, 0.1);
}

.shell::after {
  display: none;
}

.content-stack {
  padding-top: 12px;
}

.quadrant-tools {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 10px;
}

.tomorrow-slot {
  display: grid;
  gap: 4px;
  margin-bottom: 0;
  padding: 12px 14px;
  border: 1px dashed rgba(167, 45, 56, 0.28);
  border-radius: 18px;
  background: rgba(255, 254, 253, 0.88);
}

.tomorrow-slot span {
  justify-self: start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.tomorrow-slot strong {
  overflow-wrap: anywhere;
}

.undo-button {
  align-self: stretch;
  min-width: 62px;
  background: #fff7f7;
}

.quadrant-grid {
  gap: 9px;
}

.quadrant {
  min-height: 150px;
  padding: 10px;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 16px;
  background: rgba(255, 254, 253, 0.88);
  box-shadow: var(--small-shadow);
}

.quadrant h2 {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--berry-dark);
  font-size: 0.91rem;
}

.mini-task {
  min-height: 0;
  padding: 8px 9px;
  border-radius: 14px;
  background: #fffdfa;
}

.mini-task span {
  font-size: 0.86rem;
}

.mini-task small {
  font-size: 0.68rem;
}

.achievement-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.achievement-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.achievement-stats article {
  min-height: 92px;
  align-content: center;
  text-align: center;
}

.achievement-stats strong {
  font-size: clamp(1.45rem, 7vw, 2rem);
}

.heatmap-card {
  grid-column: auto;
  min-height: 0;
}

.heatmap-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  text-align: center;
}

.heatmap-title button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef5de;
  color: #7e852e;
  font-size: 1.35rem;
  font-weight: 900;
}

.heatmap-title strong {
  color: #3d4229;
  font-size: 1.18rem;
}

.month-heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.month-heatmap span {
  color: #a3a184;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.month-heatmap i {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 12px;
  background: #f3f5df;
  color: #777665;
  font-style: normal;
}

.month-heatmap i.blank {
  background: transparent;
}

.month-heatmap i.warm {
  background: #dfeccf;
}

.month-heatmap i.hot {
  background: #c9e3b4;
}

.month-heatmap i.picked {
  border: 2px solid #969333;
  background: #eef5dc;
}

.month-heatmap b {
  font-size: clamp(0.72rem, 2.8vw, 1rem);
}

.heatmap {
  display: none;
}

@media (min-width: 780px) {
  .quadrant {
    min-height: 300px;
  }

  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .shell::before {
    inset: 74px 8px 88px;
  }

  .achievement-stats {
    gap: 6px;
  }

  .achievement-stats article {
    min-height: 82px;
    padding: 10px 6px;
  }

  .month-heatmap {
    gap: 5px;
  }
}

/* v6: final cropped border assets and narrow profile dropdown */
.shell {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    url("./assets/bottom-border.png") bottom center / 100% auto no-repeat,
    linear-gradient(to bottom, #fff7f1 0 68%, #f8ede9 68% 82%, #e9f1f2 82% 100%);
}

.shell::before {
  inset: 78px 10px 92px;
}

.card-shell .gingham-strip {
  height: 112px;
  background: url("./assets/top-border.png") top center / 100% auto no-repeat;
  mask-image: none;
}

.card-shell .gingham-strip::after {
  display: none;
}

.card-stage {
  padding-top: 112px;
}

.profile-menu {
  position: absolute;
  top: 72px;
  right: 16px;
  z-index: 12;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  width: min(40vw, 210px);
  min-width: 150px;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(144, 48, 55, 0.18);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.profile-menu button {
  min-height: 38px;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: 13px;
  background: #fff8f8;
  color: var(--berry-dark);
  text-align: left;
  padding: 0 12px;
  font-weight: 900;
}

.modal-card {
  border: 1px solid rgba(144, 48, 55, 0.18);
  background: #fffdf9;
}

.compact-years {
  border-style: solid;
}

.heatmap-title button {
  background: #fff0f2;
  color: var(--berry);
}

.heatmap-title strong {
  color: var(--berry-dark);
}

.month-heatmap span {
  color: var(--muted);
}

.month-heatmap i {
  background: #fff5f1;
  color: #8f6c70;
}

.month-heatmap i.level-1 {
  background: #f9dfe2;
}

.month-heatmap i.level-2 {
  background: #efb9c0;
}

.month-heatmap i.level-3 {
  background: #d97883;
  color: #fff;
}

.month-heatmap i.level-4 {
  background: var(--berry);
  color: #fff;
}

.month-heatmap i.picked {
  border: 2px solid var(--berry-dark);
  background: #fff0f2;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.month-heatmap i.picked.level-3,
.month-heatmap i.picked.level-4 {
  background: var(--berry);
}

@media (max-width: 430px) {
  .profile-menu {
    width: 40vw;
    min-width: 148px;
  }

  .card-stage {
    padding-top: 104px;
  }
}

/* v7: make card actions visible and swipe hit area reliable */
.card-stage {
  grid-template-rows: auto auto auto;
  align-content: center;
  gap: 14px;
  padding-bottom: 190px;
}

.card-kicker,
.task-focus-card,
.card-actions {
  position: relative;
  z-index: 4;
}

.task-focus-card {
  cursor: grab;
}

.task-focus-card.is-dragging {
  cursor: grabbing;
}

.card-actions {
  width: min(92vw, 430px);
  margin-top: 0;
  padding: 10px;
  border: 1px solid rgba(144, 48, 55, 0.16);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 12px 28px rgba(127, 23, 36, 0.12);
  backdrop-filter: blur(8px);
}

.card-actions button {
  flex: 1 1 108px;
  min-width: 0;
  background: #fff4f5;
}

.card-actions button:first-child {
  background: var(--berry);
  color: #fff;
}

@media (max-width: 430px) {
  .card-stage {
    padding-bottom: 110px;
    gap: 10px;
  }

  .card-actions {
    border-radius: 24px;
  }
}

/* v8: remove duplicated kicker and keep action buttons on the cream panel */
.card-kicker {
  display: none;
}

.card-actions {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 28px 0 46px;
  transform: none;
  background: #fffdf9;
  box-shadow:
    inset 0 0 0 4px rgba(255, 238, 240, 0.72),
    0 16px 34px rgba(127, 23, 36, 0.14);
}

.card-actions::before {
  position: absolute;
  inset: -8px;
  z-index: -1;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: inherit;
  background: #fffdf9;
  content: "";
}

@media (max-width: 430px) {
  .card-stage {
    padding-bottom: 104px;
  }

  .card-actions {
    margin-bottom: 52px;
  }
}

/* v9: card action buttons live inside the cream task card */
.task-focus-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.task-focus-card h1,
.task-focus-card p,
.task-focus-card .card-actions {
  flex: 0 0 auto;
}

.task-focus-card .card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-radius: 22px;
  margin-bottom: 0;
}

.task-focus-card .card-actions button {
  min-height: 40px;
  padding: 0 8px;
  white-space: nowrap;
}

.swipe-hints {
  display: none;
}

/* v10: blue lace timer inspired by the new trim reference */
.timer-center {
  gap: 22px;
  padding-top: 38px;
}

.timer-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: min(66vw, 300px);
  border: 0;
  background:
    radial-gradient(circle, #fffdf9 0 58%, transparent 59%),
    repeating-conic-gradient(
      from -5deg,
      #b9dff3 0 7deg,
      #ffffff 7deg 14deg,
      #f7d3dc 14deg 21deg,
      #ffffff 21deg 28deg
    );
  box-shadow:
    0 18px 42px rgba(117, 161, 184, 0.2),
    0 8px 20px rgba(127, 23, 36, 0.08);
}

.timer-orb::before {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 0, #b9dff3 0 7px, transparent 8px) 50% 0 / 34px 34px repeat-x,
    radial-gradient(circle at 50% 100%, #f7d3dc 0 6px, transparent 7px) 50% 100% / 30px 30px repeat-x,
    #fffdf9;
  box-shadow:
    inset 0 0 0 1px rgba(117, 161, 184, 0.2),
    inset 0 0 0 9px rgba(235, 246, 251, 0.78);
  content: "";
}

.timer-orb::after {
  position: absolute;
  inset: 36px;
  border: 1px dashed rgba(117, 161, 184, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 12%, #b9dff3 0 5px, transparent 6px),
    radial-gradient(circle at 36% 16%, #f5cbd4 0 4px, transparent 5px),
    radial-gradient(circle at 64% 16%, #f5cbd4 0 4px, transparent 5px),
    linear-gradient(#fffdf9, #fff8f8);
  content: "";
}

.timer-orb span {
  position: relative;
  z-index: 1;
  max-width: 68%;
  padding: 0;
  color: var(--berry-dark);
  font-size: clamp(1.34rem, 4.7vw, 2.25rem);
  text-align: center;
}

.timer-center p {
  padding: 8px 14px;
  border: 1px solid rgba(117, 161, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.72);
  color: #7a6469;
}

.mode-tabs button.active {
  background: #b9dff3;
  color: var(--berry-dark);
}

.timer-title-card {
  padding: 10px 24px;
  border-color: rgba(117, 161, 184, 0.26);
  box-shadow:
    inset 0 0 0 4px rgba(235, 246, 251, 0.86),
    0 8px 20px rgba(117, 161, 184, 0.12);
}

.timer-title-card h1 {
  margin: 0;
  color: var(--berry-dark);
}

/* v11: keep mobile quadrants as a real 2x2 matrix */
@media (max-width: 779px) {
  .quadrant-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quadrant {
    min-height: 178px;
    padding: 8px;
    border-radius: 15px;
  }

  .quadrant h2 {
    margin-bottom: 6px;
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .task-list {
    gap: 5px;
  }

  .mini-task {
    padding: 7px 7px;
    border-radius: 12px;
  }

  .mini-task span {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .mini-task small {
    display: none;
  }
}

@media (max-width: 360px) {
  .quadrant-grid {
    gap: 6px;
  }

  .quadrant {
    min-height: 160px;
    padding: 7px;
  }

  .quadrant h2 {
    font-size: 0.72rem;
  }
}

/* v12: calm double-ring timer and roomier score pill */
.timer-shell .topbar {
  grid-template-columns: 48px minmax(0, 1fr) 68px;
  gap: 8px;
}

.timer-shell .topbar strong {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(117, 161, 184, 0.22);
  border-radius: 999px;
  background: #d9eff7;
  color: var(--berry-dark);
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.66),
    0 8px 18px rgba(117, 161, 184, 0.14);
}

.timer-orb {
  width: min(64vw, 292px);
  background:
    radial-gradient(circle, #fffaf7 0 52%, transparent 53%),
    radial-gradient(circle, transparent 0 58%, rgba(151, 33, 54, 0.22) 59% 61%, transparent 62%),
    radial-gradient(circle, transparent 0 67%, #d9eff7 68% 78%, transparent 79%),
    radial-gradient(circle, #fffdf9 0 100%);
  box-shadow:
    0 20px 42px rgba(117, 161, 184, 0.16),
    0 10px 22px rgba(127, 23, 36, 0.08);
}

.timer-orb::before {
  inset: 22px;
  border: 1px solid rgba(117, 161, 184, 0.2);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 73%, rgba(217, 239, 247, 0.72) 74% 80%, transparent 81%),
    linear-gradient(#fffdf9, #fff8f8);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.72),
    inset 0 0 0 14px rgba(245, 214, 220, 0.26);
}

.timer-orb::after {
  inset: 42px;
  border: 1px dashed rgba(151, 33, 54, 0.2);
  background: transparent;
}

.timer-orb span {
  max-width: 62%;
  color: #951f35;
  font-size: clamp(1.28rem, 4.4vw, 2.05rem);
}

@media (max-width: 430px) {
  .timer-shell .topbar {
    grid-template-columns: 44px minmax(0, 1fr) 62px;
  }

  .timer-shell .topbar strong {
    min-width: 54px;
    padding: 0 10px;
    font-size: 0.88rem;
  }

.timer-orb {
    width: min(62vw, 282px);
  }
}

/* v13: task scoring settings and major events */
.score-rules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 9px;
}

.score-rules label {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px 7px;
  border: 1px solid rgba(144, 48, 55, 0.13);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.82);
  box-shadow: 0 5px 12px rgba(127, 23, 36, 0.06);
}

.score-rules span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-rules input {
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: 999px;
  background: #fff8f8;
  color: var(--berry-dark);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
}

.major-events {
  display: grid;
  gap: 7px;
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 18px;
  background: rgba(255, 254, 253, 0.88);
  box-shadow: var(--small-shadow);
}

.major-events h2,
.quadrant h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.major-events h2 {
  margin: 0;
  color: var(--berry-dark);
  font-size: 0.92rem;
}

.major-events small,
.quadrant h2 small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
}

.custom-points-field[hidden] {
  display: none;
}

.profile-score-settings {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(144, 48, 55, 0.12);
  border-radius: 15px;
  background: #fffdf9;
}

.profile-score-settings > strong {
  color: var(--berry-dark);
  font-size: 0.86rem;
}

.profile-menu .score-rules {
  margin-bottom: 0;
}

@media (max-width: 430px) {
  .score-rules {
    gap: 5px;
  }

  .score-rules label {
    padding: 7px 5px;
  }

  .score-rules span {
    font-size: 0.62rem;
  }

  .score-rules input {
    min-height: 26px;
    font-size: 0.76rem;
  }

  .major-events {
    padding: 9px;
  }

  .profile-menu {
    width: min(76vw, 330px);
  }

  .profile-menu .score-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v13: compact delete controls and single large card panel */
.delete-mode-button,
.delete-dot {
  border: 1px solid rgba(144, 48, 55, 0.16);
  background: #fff7f7;
  color: var(--berry-dark);
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(127, 23, 36, 0.08);
}

.delete-mode-button {
  align-self: stretch;
  min-width: 62px;
  padding: 0 12px;
  border-radius: 999px;
}

.delete-mode-button.active {
  background: var(--berry);
  color: #fff;
}

.mini-task {
  position: relative;
  padding-right: 26px;
}

.delete-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-style: normal;
  line-height: 1;
}

.mini-task .delete-dot {
  position: absolute;
  top: 6px;
  right: 6px;
}

.habit-row,
.reward-card {
  position: relative;
}

.item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
}

.habit-row {
  padding-right: 48px;
}

.reward-card {
  padding-right: 42px;
}

.reward-card .item-delete {
  padding: 0;
  line-height: 1;
  text-align: center;
}

.card-shell::before {
  display: none;
}

.card-stage {
  align-content: start;
  padding: 152px 26px 52px;
}

.task-focus-card {
  width: min(92vw, 720px);
  min-height: min(62vh, 620px);
  padding: 92px 34px 34px;
  border-radius: 34px;
  outline: 0;
  box-shadow:
    inset 0 0 0 1px rgba(144, 48, 55, 0.08),
    0 22px 52px rgba(127, 23, 36, 0.14);
}

.task-focus-card::before {
  inset: 18px;
  border-radius: 26px;
}

.bow-mark {
  top: 44px;
  right: 42px;
  width: 62px;
  height: 38px;
  transform: rotate(-18deg);
}

.bow-mark::before,
.bow-mark::after {
  top: 7px;
  width: 31px;
  height: 25px;
  background: #f7d3dc;
  border-color: rgba(144, 48, 55, 0.28);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.45);
}

.bow-mark::before {
  left: 29px;
  border-radius: 35% 70% 45% 65%;
  transform: rotate(18deg);
}

.bow-mark::after {
  right: 29px;
  border-radius: 70% 35% 65% 45%;
  transform: rotate(-18deg);
}

.task-focus-card h1 {
  margin-top: auto;
}

.task-focus-card .card-actions {
  margin-top: 40px;
  margin-bottom: auto;
}

@media (max-width: 430px) {
  .card-stage {
    padding: 146px 24px 46px;
  }

  .task-focus-card {
    width: min(91vw, 420px);
    min-height: 56vh;
    padding: 86px 24px 28px;
    border-radius: 30px;
  }

  .bow-mark {
    top: 40px;
    right: 34px;
  }
}

/* v14: use the real bow sticker from the reference border */
.bow-mark {
  top: 34px;
  right: 38px;
  width: 86px;
  height: 62px;
  background: url("./assets/bow-berry-1.png") center / contain no-repeat;
  transform: rotate(-5deg);
  transform-origin: center;
  filter: drop-shadow(0 7px 10px rgba(127, 23, 36, 0.16));
}

.bow-mark::before,
.bow-mark::after {
  display: none;
}

@media (max-width: 430px) {
  .bow-mark {
    top: 34px;
    right: 30px;
    width: 76px;
    height: 56px;
  }
}


/* v15: cleaner card preview surface */
.card-shell {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    #fff7f1;
}

.card-shell::before,
.card-shell::after {
  display: none;
}

.card-stage {
  background: transparent;
}

.task-focus-card {
  background: #fffaf6;
}

.sticker-label {
  top: 38px;
  left: 34px;
}

@media (max-width: 430px) {
  .sticker-label {
    top: 34px;
    left: 28px;
  }
}

/* v16: restore bottom trim and tilt bow gently */
.card-shell {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    url("./assets/bottom-border.png") bottom center / 100% auto no-repeat,
    #fff7f1;
}

.bow-mark {
  transform: rotate(7deg);
}

/* v17: single cream base with bottom trim, align sticker with bow */
.card-shell {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    url("./assets/bottom-border.png") bottom center / 100% auto no-repeat,
    #fffaf6;
}

.sticker-label {
  top: 54px;
}

@media (max-width: 430px) {
  .sticker-label {
    top: 50px;
  }
}

/* v18: soften card bottom seam and fine tune sticker alignment */
.card-stage::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 82px;
  height: 34px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, #fffaf6 0%, rgba(255, 250, 246, 0.92) 55%, rgba(255, 250, 246, 0) 100%);
}

.task-focus-card {
  box-shadow:
    inset 0 0 0 1px rgba(144, 48, 55, 0.06),
    0 18px 38px rgba(127, 23, 36, 0.08);
}

.sticker-label {
  top: 48px;
}

@media (max-width: 430px) {
  .sticker-label {
    top: 46px;
  }
}

/* v19: give the card more vertical presence */
.task-focus-card {
  min-height: min(70vh, 720px);
  padding-top: 104px;
  padding-bottom: 42px;
}

.task-focus-card h1 {
  margin-top: auto;
}

.task-focus-card .card-actions {
  margin-bottom: auto;
}

@media (max-width: 430px) {
  .task-focus-card {
    min-height: 64vh;
    padding-top: 96px;
    padding-bottom: 34px;
  }
}

/* v20: rebalance card vertical rhythm */
.card-stage {
  padding-top: 124px;
}

.task-focus-card h1 {
  margin-top: 18vh;
}

.task-focus-card .card-actions {
  margin-top: 56px;
  margin-bottom: 64px;
}

@media (max-width: 430px) {
  .card-stage {
    padding-top: 118px;
  }

  .task-focus-card h1 {
    margin-top: 15vh;
  }

  .task-focus-card .card-actions {
    margin-top: 46px;
    margin-bottom: 54px;
  }
}

/* v21: nudge the card upward and settle actions lower inside it */
.card-stage {
  padding-top: 104px;
}

.task-focus-card h1 {
  margin-top: 16vh;
}

.task-focus-card .card-actions {
  margin-top: 74px;
  margin-bottom: 42px;
}

@media (max-width: 430px) {
  .card-stage {
    padding-top: 98px;
  }

  .task-focus-card h1 {
    margin-top: 13vh;
  }

  .task-focus-card .card-actions {
    margin-top: 62px;
    margin-bottom: 36px;
  }
}

/* v22: keep the mobile card compact and lock the card page without moving the trim */
@media (max-width: 430px) {
  html:has(.card-shell),
  body:has(.card-shell) {
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .card-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    background:
      url("./assets/top-border.png") top center / 100% auto no-repeat,
      #fffaf6;
  }

  .card-shell::before {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: block;
    height: calc(100vw * 257 / 941);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
    background: url("./assets/bottom-border-mobile-clean.png") bottom center / 100% auto no-repeat;
    content: "";
  }

  .card-stage {
    height: 100dvh;
    min-height: 0;
    align-content: start;
    padding: 98px 24px 0;
    overflow: hidden;
  }

  .task-focus-card {
    width: min(91vw, 420px);
    min-height: 64vh;
    height: auto;
    max-height: none;
    padding: 96px 24px 34px;
  }

  .task-focus-card h1 {
    margin-top: 13vh;
  }

  .task-focus-card .card-actions {
    margin-top: 62px;
    margin-bottom: 36px;
  }

  .card-stage::after {
    display: none;
  }
}

@media (max-width: 380px) {
  .card-stage {
    padding-top: 92px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .task-focus-card {
    min-height: 62vh;
    padding-top: 88px;
    padding-bottom: 28px;
  }

  .task-focus-card h1 {
    margin-top: 11vh;
  }

  .task-focus-card .card-actions {
    margin-top: 48px;
    margin-bottom: 30px;
  }
}
/* v23: crop the top seam baked into the mobile bottom trim asset */
@media (max-width: 430px) {
  .card-shell::after {
    display: none;
  }
}

/* v24: move scoring controls into a roomier profile panel */
.profile-menu {
  width: min(86vw, 360px);
}

.profile-menu .profile-score-settings {
  margin-top: 2px;
}

.profile-menu .score-rules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 430px) {
  .profile-menu {
    width: min(86vw, 340px);
    min-width: 260px;
  }
}

/* v25: cat achievement badges and embedded task date picker */
.date-pill {
  cursor: default;
}

.achievement-stats article.cat-stat {
  min-height: 122px;
  align-content: center;
  justify-items: center;
  gap: 8px;
}

.cat-badge {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(58px, 17vw, 78px);
  height: clamp(50px, 15vw, 66px);
  border: 2px solid rgba(127, 23, 36, 0.16);
  border-radius: 24px 24px 26px 26px;
  --cat-face: #fff8f4;
  background:
    radial-gradient(circle at 34% 64%, rgba(207, 82, 97, 0.2) 0 5px, transparent 6px),
    radial-gradient(circle at 66% 64%, rgba(207, 82, 97, 0.2) 0 5px, transparent 6px),
    var(--cat-face);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.72),
    0 10px 18px rgba(127, 23, 36, 0.1);
}

.cat-badge::before,
.cat-badge::after {
  position: absolute;
  top: -13px;
  z-index: -1;
  width: 25px;
  height: 24px;
  border: 2px solid rgba(127, 23, 36, 0.16);
  background: var(--cat-face);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  content: "";
}

.cat-badge::before {
  left: 7px;
}

.cat-badge::after {
  right: 7px;
}

.cat-badge strong {
  position: relative;
  z-index: 1;
  color: var(--berry-dark);
  font-size: clamp(1.2rem, 5vw, 1.9rem);
  line-height: 1;
}

/* v26: user avatar import/export and source-image cat achievement badges */
.avatar-button {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, #fff 0 8px, transparent 9px),
    radial-gradient(circle at 50% 72%, #fff 0 13px, transparent 14px),
    var(--sky);
}

.avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.profile-menu {
  width: 168px;
}

.achievement-stats article.cat-stat {
  min-height: 118px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.cat-badge {
  width: clamp(78px, 25vw, 112px);
  height: clamp(78px, 25vw, 112px);
  border: 0;
  border-radius: 0;
  background: url("./assets/achievement-strawberry-badge.png") center / contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 9px 12px rgba(164, 85, 95, 0.1));
}

.cat-badge::before,
.cat-badge::after {
  display: none;
}

.cat-badge strong {
  color: #a25361;
  font-size: clamp(1.18rem, 5vw, 1.72rem);
}

.avatar-picker {
  position: relative;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 18px;
  background: #fff8f8;
}

.avatar-picker input,
.import-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.avatar-picker i {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(127, 23, 36, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, #fff 0 12px, transparent 13px),
    radial-gradient(circle at 50% 72%, #fff 0 20px, transparent 21px),
    var(--sky);
  box-shadow: var(--small-shadow);
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sync-panel button,
.import-button {
  position: relative;
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.sync-panel .import-button {
  background: #fff8f8;
  color: var(--berry-dark);
  border: 1px solid rgba(127, 23, 36, 0.14);
}

.account-panel {
  gap: 14px;
}

.account-user {
  padding: 12px;
  border: 1px solid rgba(127, 23, 36, 0.12);
  border-radius: 14px;
  background: #fff8f8;
}

.account-user strong {
  display: block;
  margin-top: 4px;
  word-break: break-all;
}

.account-auth-form {
  display: grid;
  gap: 12px;
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.account-panel button,
.account-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
}

.account-panel .secondary-button {
  border: 1px solid rgba(127, 23, 36, 0.14);
  background: #fff8f8;
  color: var(--berry-dark);
}

.account-tip {
  font-size: 0.78rem;
  line-height: 1.55;
}

.pretty-date-field button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(127, 23, 36, 0.18);
  border-radius: 14px;
  background: #fffaf7;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
  padding: 0 12px;
}

.task-date-picker {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid rgba(144, 48, 55, 0.14);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: var(--small-shadow);
  overflow: hidden;
}

.compact-calendar-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  gap: 8px;
}

.compact-calendar-head strong {
  align-self: center;
  color: var(--berry-dark);
  font-size: 1rem;
  text-align: center;
}

.task-date-picker .calendar-head button {
  width: 32px;
  height: 32px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}

.task-date-picker .week-row,
.task-date-picker .day-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.task-date-picker .week-row span {
  font-size: 0.68rem;
}

.task-date-picker .day-grid button {
  width: 100%;
  min-width: 0;
  padding: 0;
  font-size: 0.78rem;
}

/* v27: shared red-check completion control for tasks and habits */
.mini-task {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-right: 9px;
}

.mini-task.is-deleting {
  padding-right: 36px;
}

.mini-task-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.mini-task.done .mini-task-copy span {
  color: var(--muted);
  text-decoration: line-through;
}

.mini-task.done small {
  opacity: 0.65;
}

.check-round {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  border: 2px solid rgba(167, 45, 56, 0.25);
  background: #fffaf8;
  transition: border-color 160ms ease, background 160ms ease;
}

.task-check {
  width: 30px;
  height: 30px;
}

.check-round.done,
.check-round.done:disabled {
  border-color: rgba(167, 45, 56, 0.38);
  background: #fff5f5;
  cursor: default;
  opacity: 1;
}

.check-round.done::after {
  width: 8px;
  height: 15px;
  border: solid var(--berry);
  border-width: 0 3px 3px 0;
  content: "";
  transform: translateY(-2px) rotate(43deg);
}

/* v28: daily rollover review for unfinished tasks */
.rollover-panel {
  max-height: min(78vh, 680px);
}

.rollover-list {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 430px);
  overflow-y: auto;
  padding-right: 2px;
}

.rollover-task {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(127, 23, 36, 0.13);
  border-radius: 16px;
  background: #fffaf7;
}

.rollover-task strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.rollover-task small {
  color: var(--muted);
  font-size: 0.76rem;
}

.rollover-task label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.rollover-task input {
  min-height: 38px;
}

.rollover-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.rollover-actions button:first-child {
  background: var(--berry);
  color: #fff;
}

.rollover-actions .ghost-danger,
.rollover-later {
  border: 1px solid rgba(127, 23, 36, 0.14);
  background: #fff4f3;
  color: var(--berry-dark);
}

/* v29: compact timer viewport, clean rings, and wheel countdown picker */
html:has(.timer-shell),
body:has(.timer-shell) {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.timer-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100dvh;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: clamp(62px, 12vh, 94px);
  padding-bottom: clamp(70px, 13vh, 108px);
  overflow: hidden;
}

.timer-shell .topbar {
  flex: none;
  padding: 6px 16px 4px;
}

.timer-shell .mode-tabs {
  flex: none;
  padding: 8px 16px 5px;
}

.timer-shell .timer-center {
  align-content: center;
  flex: none;
  gap: 10px;
  min-height: 0;
  margin-top: auto;
  padding: 4px 18px;
}

.timer-shell .timer-actions {
  flex: none;
  margin-top: clamp(14px, 2.5vh, 22px);
  margin-bottom: auto;
  padding: 0 18px;
}

.timer-shell .timer-actions .timer-sound-button.is-on {
  border-color: rgba(117, 161, 184, 0.32);
  background: #d9eff7;
  color: var(--berry-dark);
}

.timer-orb {
  display: grid;
  place-items: center;
  width: min(53vw, 238px);
  border-radius: 50%;
  background: radial-gradient(circle, #fffaf7 0 67%, #e4cfd3 68% 73%, #a9d4e6 74% 88%, transparent 89%);
  box-shadow: 0 14px 32px rgba(117, 161, 184, 0.14);
}

.timer-orb::before,
.timer-orb::after {
  display: none;
}

.timer-orb-button {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
}

.timer-orb span {
  max-width: 64%;
}

.timer-center p {
  padding: 6px 13px;
  font-size: 0.86rem;
}

.timer-orb.has-picker {
  width: min(88vw, 336px);
  aspect-ratio: auto;
  gap: 10px;
  padding: 13px 12px 11px;
  border: 1px solid rgba(117, 161, 184, 0.24);
  border-radius: 22px;
  background: rgba(255, 253, 249, 0.94);
}

.countdown-picker {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.countdown-picker::before {
  position: absolute;
  top: 40px;
  right: 0;
  left: 0;
  height: 40px;
  border-top: 1px solid rgba(117, 161, 184, 0.24);
  border-bottom: 1px solid rgba(117, 161, 184, 0.24);
  border-radius: 9px;
  background: rgba(217, 239, 247, 0.28);
  pointer-events: none;
  content: "";
}

.countdown-picker label {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.timer-orb .countdown-picker span {
  max-width: none;
  padding: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1;
}

.countdown-wheel {
  position: relative;
  width: 100%;
  height: 120px;
  overflow-y: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--berry-dark);
  font-size: 1.15rem;
  font-weight: 900;
  text-align: center;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
}

.countdown-wheel::-webkit-scrollbar {
  display: none;
}

.countdown-wheel i {
  display: block;
  height: 40px;
  pointer-events: none;
}

.countdown-wheel button {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--berry-dark);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 40px;
  scroll-snap-align: center;
}

.countdown-wheel button.picked {
  background: transparent;
  color: var(--berry-dark);
}

.countdown-start {
  min-height: 36px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
}

@media (max-width: 430px) {
  .timer-shell {
    padding-top: calc(100vw * 105 / 941 + 8px);
    background:
      url("./assets/top-border.png") top center / 100% auto no-repeat,
      url("./assets/bottom-border-mobile.png") bottom center / 100% auto no-repeat,
      #fff8f2;
  }

  .timer-shell::before,
  .timer-shell::after {
    display: none;
  }

  .timer-orb {
    width: min(57vw, 222px);
  }
}

/* v30: align timer trim, single blue ring, and right-hand back button */
.timer-shell .topbar {
  grid-template-columns: 68px minmax(0, 1fr) 48px;
}

.timer-shell .topbar strong {
  justify-self: start;
}

.timer-shell .soft-icon {
  justify-self: end;
}

.timer-orb {
  background: radial-gradient(circle closest-side, #fffaf7 0 72%, #b1dbea 73% 89%, transparent 90%);
}

@media (max-width: 430px) {
  .timer-shell .topbar {
    grid-template-columns: 62px minmax(0, 1fr) 44px;
  }
}

/* v31: plain countdown numbers and a single-outline timer title */
.timer-title-card {
  border: 2px solid #b1dbea;
  background: #fff8f2;
  box-shadow: 0 8px 20px rgba(117, 161, 184, 0.12);
}

.timer-title-card::before {
  display: none;
}

/* v32: warm timer canvas and centered custom wheel selection slot */
.timer-shell,
.timer-shell .soft-icon,
.timer-shell .mode-tabs button:not(.active),
.timer-shell .timer-actions button,
.timer-shell .timer-center p {
  background-color: #fff8f2;
}

.timer-shell .timer-orb {
  background: radial-gradient(circle closest-side, #fff8f2 0 72%, #b1dbea 73% 89%, transparent 90%);
}

.timer-orb.has-picker {
  background: #fff8f2;
}

/* v33: interactive achievement gacha machine */
.achievement-grid .gacha-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gacha-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.gacha-title strong {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  white-space: nowrap;
}

.gacha-title span {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--sky);
  color: var(--berry-dark);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.gacha-machine-wrap {
  position: relative;
  width: min(78vw, 286px);
  margin: 1px auto -1px;
}

.gacha-machine {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.gacha-card.spinning .gacha-machine {
  animation: gacha-shake 520ms ease-in-out 2;
}

.gacha-capsule {
  position: absolute;
  right: 46%;
  bottom: 15%;
  display: none;
  width: 26px;
  height: 29px;
  border: 2px solid rgba(127, 23, 36, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(to bottom, #d9eff7 0 48%, #f0bdc4 48% 100%);
  box-shadow: 0 6px 12px rgba(127, 23, 36, 0.12);
}

.gacha-card.spinning .gacha-capsule {
  display: block;
  animation: gacha-drop 820ms 450ms ease-out both;
}

.gacha-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.gacha-progress {
  width: min(100%, 224px);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f3e0dc;
}

.gacha-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b9dff3, #d97883);
  transition: width 240ms ease;
}

.achievement-grid .gacha-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.gacha-spin {
  min-width: 122px;
  min-height: 39px;
  margin-top: 3px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
}

.gacha-spin:disabled {
  background: #f0dfe0;
  color: var(--muted);
  opacity: 1;
}

.gacha-result {
  min-height: 19px;
  margin: 0;
  color: var(--berry);
  font-size: 0.84rem;
  font-weight: 900;
  opacity: 0;
  transform: translateY(5px);
}

.gacha-result.show {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 240ms ease;
}

@keyframes gacha-shake {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-1.7deg);
  }
  75% {
    transform: rotate(1.7deg);
  }
}

@keyframes gacha-drop {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.8);
  }
  55% {
    opacity: 1;
    transform: translateY(45px) scale(1);
  }
  72% {
    transform: translateY(36px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(45px) scale(1);
  }
}

@media (min-width: 780px) {
  .gacha-card {
    grid-column: span 2;
  }
}

/* v34: blend the achievement stage into the page and center mobile cards */
.app-shell:has(.achievement-grid)::before {
  display: none;
}

@media (max-width: 430px) {
  .card-stage {
    align-content: center;
    padding: 0 24px;
  }
}

/* v35: keep achievement background uniform and center the card on the viewport */
.app-shell:has(.achievement-grid) {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    url("./assets/bottom-border.png") bottom center / 100% auto no-repeat,
    #fff7f1;
}

@media (max-width: 430px) {
  .card-stage {
    justify-items: center;
    padding-right: 0;
    padding-left: 0;
  }

  .task-focus-card {
    justify-self: center;
    width: min(91vw, 420px);
    margin-right: auto;
    margin-left: auto;
  }
}

/* v36: gingham bow and one clean, cropped footer decoration across screens */
.bow-mark {
  top: 28px;
  right: 34px;
  width: 94px;
  height: 78px;
  background-image: url("./assets/bow-gingham.png");
  transform: rotate(6deg);
  filter: drop-shadow(0 6px 8px rgba(127, 23, 36, 0.12));
}

.card-shell,
.app-shell,
.timer-shell,
.app-shell:has(.achievement-grid) {
  background:
    url("./assets/top-border.png") top center / 100% auto no-repeat,
    #fffaf6;
}

.card-shell::after,
.app-shell::after,
.timer-shell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: auto;
  height: calc(min(100vw, 1080px) * 219 / 941);
  border: 0;
  border-radius: 0;
  background: url("./assets/bottom-border-mobile-clean.png") bottom center / 100% auto no-repeat;
  box-shadow: none;
  transform: none;
  pointer-events: none;
  content: "";
}

/* v38: bring the shared content frame back to the achievement view */
.app-shell:has(.achievement-grid)::before {
  display: block;
}

.card-shell::before {
  display: none;
}

.app-shell .fab-add {
  bottom: calc(min(100vw, 1080px) * 219 / 941 + 18px);
}

.app-shell .fab-card {
  bottom: calc(min(100vw, 1080px) * 219 / 941 + 76px);
}

@media (max-width: 430px) {
  .bow-mark {
    top: 29px;
    right: 27px;
    width: 82px;
    height: 68px;
  }
}

/* v37: shop gift bag for redeemed rewards */
.fab-bag {
  display: grid;
  place-items: center;
  background: #fff0e8;
  font-size: 1.35rem;
}

.fab-bag span {
  line-height: 1;
}

.fab-bag i {
  position: absolute;
  top: -4px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #fffaf6;
  border-radius: 999px;
  background: var(--berry);
  color: #fff;
  font-size: 0.64rem;
  font-style: normal;
}

.app-shell .fab-bag {
  bottom: calc(min(100vw, 1080px) * 219 / 941 + 134px);
}

.modal-card:has(.bag-panel) {
  width: min(100%, 480px);
  max-height: min(72vh, 620px);
  padding: 23px 18px 20px;
  overflow: hidden;
  border-radius: 28px 28px 22px 22px;
  background: #fffaf4;
}

.bag-panel {
  display: grid;
  gap: 20px;
}

/* v39: standalone auth entry with the same paper-and-berry language */
.auth-page-shell {
  width: min(100vw, 1080px);
  max-width: 100vw;
  background:
    url("./assets/auth-top-border-clean.png") top center / 100% auto no-repeat,
    #fffaf6;
}

.auth-page-shell::before {
  display: none;
}

.auth-page-shell::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: calc(min(100vw, 1080px) * 257 / 941);
  border: 0;
  border-radius: 0;
  background: url("./assets/bottom-border-mobile-clean.png") bottom center / 100% auto no-repeat;
  box-shadow: none;
  transform: none;
  pointer-events: none;
  content: "";
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  justify-items: center;
  padding: 90px 17px calc(min(100vw, 1080px) * 257 / 941 + 20px);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.auth-ornament {
  display: none;
}

.auth-page-shell .auth-card {
  position: relative;
  display: grid;
  justify-self: center;
  width: min(430px, calc(100vw - 34px)) !important;
  max-width: none !important;
  margin-right: auto;
  margin-left: auto;
  gap: 16px;
  padding: 22px 22px 24px;
  border: 1px solid rgba(167, 45, 56, 0.18);
  border-radius: 30px;
  outline: 0;
  background: rgba(255, 253, 249, 0.78);
  box-shadow: 0 18px 46px rgba(127, 23, 36, 0.1);
  backdrop-filter: blur(4px);
}

.auth-tabs,
.auth-form,
.auth-form .primary-button,
.auth-form .text-button {
  width: 100%;
  min-width: 0;
}

.auth-page-shell .auth-card::before {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px dashed rgba(167, 45, 56, 0.13);
  border-radius: 22px;
  content: "";
}

.auth-page-shell .auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-art {
  display: grid;
  width: min(52%, 186px);
  aspect-ratio: 1;
  place-items: center;
  justify-self: center;
  margin: -62px 0 -2px;
  border: 1px solid rgba(127, 23, 36, 0.13);
  border-radius: 50%;
  background: #fff8f2;
  box-shadow: var(--small-shadow);
  overflow: hidden;
}

.auth-art img {
  width: 112%;
  height: 112%;
  object-fit: contain;
}

.auth-copy {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.auth-copy .sticker-label {
  position: static;
  padding: 6px 11px;
  background: var(--sky);
  font-size: 0.68rem;
}

.auth-copy h1 {
  margin: 0;
  color: var(--berry-dark);
  font-size: clamp(1.9rem, 8vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(127, 23, 36, 0.11);
  border-radius: 999px;
  background: #fff3f2;
}

.auth-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tabs button.is-active {
  background: var(--berry);
  color: #fff;
  box-shadow: 0 8px 16px rgba(127, 23, 36, 0.18);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label:not(.remember) {
  display: grid;
  gap: 5px;
  color: var(--berry-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(127, 23, 36, 0.16);
  border-radius: 14px;
  outline: none;
  background: #fffaf7;
  color: var(--ink);
}

.auth-form input:not([type="checkbox"]):focus {
  border-color: rgba(167, 45, 56, 0.48);
  box-shadow: 0 0 0 3px rgba(245, 203, 208, 0.48);
}

.auth-form input::placeholder {
  color: #c4a6a4;
  font-size: 0.82rem;
}

.auth-form label.signup-only {
  display: none;
}

.auth-page-shell [data-mode="signup"] .signup-only {
  display: grid;
}

.auth-helper {
  min-height: 38px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.auth-form .primary-button {
  min-height: 56px;
  border: 0;
  border-radius: 15px;
  background: var(--berry);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(127, 23, 36, 0.2);
}

.auth-form .text-button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--berry);
  font-weight: 900;
}

@media (max-height: 760px) {
  .auth-stage {
    align-content: center;
    padding-top: 70px;
  }

  .auth-art {
    width: min(48%, 170px);
    margin-top: -38px;
  }
}

@media (max-width: 430px) {
  .auth-stage {
    padding-right: 17px;
    padding-left: 17px;
  }

  .auth-ornament {
    top: 78px;
    right: 18px;
    width: 86px;
  }
}

.bag-panel header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 34px;
}

.bag-panel header > span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fce9e1;
  font-size: 1.6rem;
}

.bag-panel h2 {
  margin: 0;
  color: var(--berry-dark);
  font-size: 1.18rem;
}

.coupon-list {
  display: grid;
  gap: 12px;
  max-height: min(48vh, 440px);
  overflow-y: auto;
  padding: 1px 2px 3px;
}

.coupon-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 94px;
  padding: 16px 14px 13px 18px;
  border: 1px dashed rgba(160, 74, 64, 0.28);
  border-radius: 18px;
  background: #fff4ee;
}

.coupon-card::before,
.coupon-card::after {
  position: absolute;
  top: calc(50% - 8px);
  width: 15px;
  height: 16px;
  border-radius: 50%;
  background: #fffaf4;
  content: "";
}

.coupon-card::before {
  left: -8px;
}

.coupon-card::after {
  right: -8px;
}

.coupon-card strong {
  display: block;
  margin-bottom: 7px;
  color: var(--berry-dark);
  font-size: 0.98rem;
}

.coupon-card small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.coupon-card b {
  position: absolute;
  top: 13px;
  right: 16px;
  color: var(--berry-dark);
  font-size: 0.8rem;
}

.coupon-card button {
  grid-column: 2;
  justify-self: end;
  min-width: 74px;
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--petal);
  color: var(--berry-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.coupon-card:has(b) button {
  margin-top: 19px;
}

.bag-empty {
  display: grid;
  justify-items: center;
  min-height: 254px;
  align-content: center;
  gap: 21px;
  padding: 18px;
  border-radius: 20px;
  background: #fff5ef;
}

.bag-empty span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #fce7df;
  font-size: 2.25rem;
}

.bag-empty p {
  max-width: 285px;
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
}

body:has(.bag-panel) .toast {
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

/* v40: auth page clean logo + remove footer seam */
.auth-art {
  width: min(68%, 260px);
  aspect-ratio: auto;
  margin: -58px 0 -4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.auth-art img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-page-shell::after {
  bottom: -18px;
  height: calc(min(100vw, 1080px) * 257 / 941 + 18px);
  background-image: url("./assets/auth-bottom-border-clean.png");
  -webkit-mask-image: none;
  mask-image: none;
}

@media (max-height: 760px) {
  .auth-art {
    width: min(62%, 238px);
    margin-top: -44px;
  }
}

