/* 今天这几件 — a quiet daily list. */

:root {
  --paper: #f3eee3;
  --paper-hi: #fbf8f0;
  --paper-lo: #ece5d6;
  --ink: #211d16;
  --ink-2: #474135;
  --ink-3: #746c5e;
  --ink-4: #9a9182;
  --line: #dbd3c2;
  --line-soft: #e8e1d3;
  --line-strong: #c9bfab;
  --accent: #c24a2c;
  --accent-ink: #a63c22;
  --accent-wash: #f3ded3;
  --ok: #4f6b4a;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --shadow-sheet: 0 1px 0 rgba(255, 255, 255, 0.72) inset, 0 22px 44px -32px rgba(33, 29, 22, 0.42), 0 2px 6px rgba(33, 29, 22, 0.035);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  height: 100%;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(120% 70% at 8% -8%, #fbf7ec 0%, rgba(251, 247, 236, 0) 58%),
    radial-gradient(90% 70% at 108% 108%, #eae2d1 0%, rgba(234, 226, 209, 0) 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body.is-locked {
  overflow: hidden;
  touch-action: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}

/* ---------- shell ---------- */

.app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 22px calc(env(safe-area-inset-bottom) + 132px);
  flex: 1;
}

.topbar {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.datestamp {
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.055em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  transition: background-color 0.2s ease, color 0.2s ease;
}

#settingsBtn {
  margin-right: -11px;
}

.icon-btn:hover { background: rgba(33, 29, 22, 0.055); }
.icon-btn:active { background: rgba(33, 29, 22, 0.09); }
.icon-btn .icon { width: 21px; height: 21px; }

/* ---------- hero ---------- */

.hero {
  margin-top: 38px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}

.eyebrow-rule {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: 0.75;
  flex: none;
}

.headline {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(33px, 9.3vw, 44px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-wrap: balance;
}

.period { color: var(--accent); }

.hero-meta {
  margin: 15px 0 0;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-height: 18px;
}

.hero-meta b {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
}

.hero-meta .sep {
  color: var(--ink-4);
  font-size: 10px;
  transform: translateY(-1px);
}

/* ---------- batch sheet ---------- */

.sheet-wrap { margin-top: 23px; }

.sheet {
  position: relative;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
}

.sheet::after {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  right: 30px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.batch {
  list-style: none;
  margin: 0;
  padding: 6px 18px;
}

.task {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
  will-change: transform, opacity;
}

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

.task.is-new { animation: rowIn 0.45s var(--ease) both; }

.batch.is-anim .task {
  animation: rowIn 0.55s var(--ease) both;
  animation-delay: calc(var(--i) * 48ms + 40ms);
}

.task-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 0;
  text-align: left;
}

.check-ring {
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex: none;
  color: var(--paper-hi);
  transition: border-color 0.22s ease, background-color 0.22s ease, transform 0.22s var(--ease);
}

.check-ring .icon {
  width: 14px;
  height: 14px;
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.16s ease, transform 0.22s var(--ease);
}

.task-main:hover .check-ring { border-color: var(--ink-4); }
.task-main:active .check-ring { transform: scale(0.9); }

.task-text {
  min-width: 0;
  flex: 1;
}

.task-title {
  display: inline;
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 1px;
  transition: background-size 0.34s ease 0.06s, color 0.25s ease;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.task-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.task-note {
  color: var(--ink-4);
  min-width: 0;
  overflow-wrap: break-word;
}

.task-note::before {
  content: "·";
  margin: 0 6px;
  color: var(--ink-4);
  opacity: 0.65;
}

.task-swap {
  width: 40px;
  height: 40px;
  margin: 10px -9px 0 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-3);
  opacity: 0.62;
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.3s var(--ease);
  flex: none;
}

.task-swap .icon { width: 17px; height: 17px; }

.task-swap:hover {
  opacity: 1;
  color: var(--ink-2);
  background: rgba(33, 29, 22, 0.05);
}

.task-swap:active { transform: rotate(45deg); }

.task.is-completing .check-ring {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.task.is-completing .check-ring .icon {
  opacity: 1;
  transform: scale(1);
}

.task.is-completing .task-title {
  color: var(--ink-3);
  background-size: 100% 1px;
}

.task.is-completing .task-meta { opacity: 0.55; }

.task.is-collapsing {
  overflow: hidden;
  transition: height 0.24s var(--ease), opacity 0.2s ease, border-color 0.2s ease;
}

.task.is-swapping .task-text {
  animation: swapOut 0.16s ease forwards;
}

.task.is-entering { animation: swapIn 0.3s var(--ease) both; }

/* empty state inside the sheet */

.empty {
  padding: 34px 24px 37px;
  text-align: center;
}

.empty .big-check {
  width: 58px;
  height: 58px;
  margin: 2px auto 16px;
  color: var(--accent);
  display: block;
}

.big-check path {
  stroke-dasharray: 64;
  stroke-dashoffset: 64;
  animation: drawCheck 0.62s var(--ease) 0.08s forwards;
}

.empty-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.empty-sub {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.empty .text-btn {
  margin-top: 18px;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-ink);
  border-bottom: 1px solid rgba(194, 74, 44, 0.35);
}

.hint {
  margin: 11px 4px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.015em;
  color: var(--ink-3);
  animation: fadeIn 0.6s 0.7s both;
}

/* ---------- done ---------- */

.done {
  margin-top: 25px;
  animation: fadeUp 0.4s var(--ease) both;
}

.done-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 9px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
}

.done-label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.done-label .icon {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.done-label b {
  font-weight: 600;
  color: var(--ink-2);
}

.done-total {
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
}

.done-list {
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
}

.done-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 3px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.done-item-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.done-item-title::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-4);
  opacity: 0.55;
  flex: none;
  transform: translateY(-2px);
}

.done-item-title span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.done-dur {
  flex: none;
  font-size: 11px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ---------- last seven days ---------- */

.week {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.week-head {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 3px;
  text-align: left;
}

.week-title {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.075em;
  color: var(--ink-2);
  white-space: nowrap;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 17px;
  flex: none;
  padding-bottom: 1px;
}

.spark i {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: var(--line-strong);
  min-height: 2px;
  opacity: 0.8;
}

.spark i.has-count { background: var(--ink-4); }
.spark i.is-today { background: var(--accent); opacity: 1; }

.week-sum {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.week-head .chev {
  width: 16px;
  height: 16px;
  color: var(--ink-4);
  transition: transform 0.28s var(--ease);
  flex: none;
}

.week.is-open .week-head .chev { transform: rotate(180deg); }

.week-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--ease);
}

.week-inner {
  overflow: hidden;
  min-height: 0;
}

.week.is-open .week-body { grid-template-rows: 1fr; }

.week-days { padding: 2px 3px 4px; }

.day {
  padding: 9px 0 10px;
  border-top: 1px solid var(--line-soft);
}

.day:first-child { border-top: 0; }

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

.day-name {
  font-size: 12px;
  color: var(--ink-2);
}

.day-name.is-today {
  color: var(--accent-ink);
  font-weight: 600;
}

.day-stats {
  font-size: 10.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.day-tasks {
  margin: 3px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-4);
  overflow-wrap: break-word;
}

.day.is-empty {
  padding-top: 10px;
  padding-bottom: 11px;
}

.day.is-empty .day-stats { color: var(--ink-4); opacity: 0.78; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  margin: 0 0 4px;
  padding: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-ink);
}

.link-btn span { transition: transform 0.2s var(--ease); }
.link-btn:hover span { transform: translateX(3px); }

/* ---------- dock ---------- */

.dock {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 22px calc(env(safe-area-inset-bottom) + 11px);
  background: rgba(243, 238, 227, 0.9);
  border-top: 1px solid rgba(219, 211, 194, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(1.08);
  backdrop-filter: blur(16px) saturate(1.08);
}

.dock-inner {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 9px;
  align-items: stretch;
}

.dock-lib {
  height: 54px;
  padding: 0 15px 0 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 248, 240, 0.72);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.dock-lib:hover { background: var(--paper-hi); border-color: var(--line-strong); }

.dock-lib .icon { width: 17px; height: 17px; color: var(--ink-3); }

.dock-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(33, 29, 22, 0.065);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.dock-main {
  flex: 1;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 26px -14px rgba(33, 29, 22, 0.62);
  transition: background-color 0.25s ease, opacity 0.25s ease, transform 0.18s var(--ease), box-shadow 0.25s ease;
}

.dock-main .icon {
  width: 17px;
  height: 17px;
  opacity: 0.8;
  transition: transform 0.4s var(--ease);
}

.dock-main:hover .icon { transform: rotate(-40deg); }
.dock-main:active { transform: scale(0.985); }
.dock-main:disabled { opacity: 0.32; box-shadow: none; }

.dock-main.is-accent {
  background: var(--accent);
  box-shadow: 0 12px 26px -14px rgba(194, 74, 44, 0.7);
}

/* ---------- full-screen views ---------- */

.view {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  overflow: hidden;
  animation: viewIn 0.34s var(--ease) both;
}

.view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 60% at 8% -10%, #fbf7ec 0%, rgba(251, 247, 236, 0) 60%),
    radial-gradient(80% 60% at 105% 105%, #eae2d1 0%, rgba(234, 226, 209, 0) 55%);
}

.view-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) 18px 10px;
}

.view-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.view-back { margin-left: -11px; }

.view-head .pill-btn {
  margin-left: auto;
  height: 38px;
  padding: 0 14px 0 11px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 19px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: rgba(251, 248, 240, 0.62);
}

.view-head .pill-btn:hover { background: var(--paper-hi); }
.view-head .pill-btn .icon { width: 15px; height: 15px; }

.head-spacer { width: 44px; margin-left: auto; }

.view-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 22px calc(env(safe-area-inset-bottom) + 46px);
}

.view-meta {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.view-hint {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--ink-4);
}

/* library */

.lib-list {
  list-style: none;
  margin: 17px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.lib-item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}

.lib-main {
  flex: 1;
  min-width: 0;
  padding: 3px 0;
}

.lib-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink);
  overflow-wrap: break-word;
}

.lib-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

.lib-meta .sep { color: var(--ink-4); }

.lib-meta .sep { margin: 0 5px; opacity: 0.65; }

.lib-add {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-2);
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.lib-add:hover { border-color: var(--ink-3); background: var(--paper-hi); }
.lib-add:active { transform: scale(0.94); }
.lib-add .icon { width: 16px; height: 16px; }

.lib-inbatch {
  flex: none;
  margin: 0 6px 0 4px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 9.5px;
  letter-spacing: 0.03em;
  color: var(--ink-4);
  white-space: nowrap;
}

.lib-del {
  width: 34px;
  height: 40px;
  margin-right: -6px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  color: var(--ink-4);
  opacity: 0.72;
  transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.lib-del:hover { color: var(--accent-ink); background: var(--accent-wash); opacity: 1; }
.lib-del .icon { width: 15px; height: 15px; }

.empty-view {
  padding: 58px 16px 30px;
  text-align: center;
}

.empty-view-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
}

.empty-view-sub {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.empty-view .btn-primary.slim {
  width: auto;
  min-width: 132px;
  height: 44px;
  margin-top: 20px;
  padding: 0 20px;
  font-size: 13px;
  border-radius: 13px;
}

/* history */

.history-hero { padding: 24px 0 26px; }

.history-big {
  margin: 12px 0 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--serif);
  font-size: 66px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.history-big .unit {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
}

.history-sub {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.history-group {
  padding: 14px 0 12px;
  border-top: 1px solid var(--line);
}

.history-group h3 {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.history-group h3 span {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.history-items { margin-top: 7px; }

.history-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ink-2);
}

.history-item .dur {
  flex: none;
  font-size: 10.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ---------- overlays & sheets ---------- */

.overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 24, 18, 0.36);
  opacity: 0;
  transition: opacity 0.28s ease;
}

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

.sheet-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--paper-hi);
  border-radius: 24px 24px 0 0;
  padding: 7px 24px calc(env(safe-area-inset-bottom) + 24px);
  box-shadow: 0 -22px 60px -32px rgba(20, 17, 12, 0.5);
  transform: translateY(102%);
  transition: transform 0.36s var(--ease);
}

.overlay.is-open .sheet-panel { transform: translateY(0); }

.overlay.is-closing .overlay-backdrop { opacity: 0; }
.overlay.is-closing .sheet-panel { transform: translateY(102%); }

.grabber {
  width: 34px;
  height: 4px;
  margin: 3px auto 8px;
  border-radius: 4px;
  background: var(--line-strong);
  opacity: 0.55;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.panel-head .icon-btn { margin-right: -12px; }

/* form */

.field {
  display: block;
  margin: 20px 0 0;
  border: 0;
  padding: 0;
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.optional {
  margin-left: 4px;
  font-weight: 400;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

.text-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-size: 16px;
  color: var(--ink);
  transition: border-color 0.2s ease, background-color 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.text-input::placeholder { color: var(--ink-4); opacity: 0.85; }
.text-input:hover { border-color: var(--line-strong); }
.text-input:focus { border-color: transparent; background: #fffdf8; outline: 2px solid var(--ink-2); outline-offset: 1px; }
.text-input.is-invalid { border-color: var(--accent); outline: none; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 19px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-2);
  background: transparent;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.chip:hover { border-color: var(--line-strong); }
.chip.is-on {
  color: var(--paper-hi);
  background: var(--ink);
  border-color: var(--ink);
}

.custom-min {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.custom-min input {
  width: 94px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  font-size: 16px;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.custom-min input:focus { border-color: transparent; outline: 2px solid var(--ink-2); outline-offset: 1px; background: #fffdf8; }
.custom-min input::-webkit-outer-spin-button,
.custom-min input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.form-error {
  margin: 13px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--accent-ink);
}

.btn-primary {
  width: 100%;
  height: 52px;
  margin-top: 26px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.16s var(--ease), background-color 0.2s ease, opacity 0.2s ease;
}

.btn-primary:hover { background: #2d281f; }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; }
.btn-primary.inline { width: auto; margin: 0; min-width: 112px; height: 48px; border-radius: 13px; }

.btn-ghost {
  height: 48px;
  padding: 0 22px;
  border-radius: 13px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover { background: var(--paper); border-color: var(--line-strong); }

/* settings */

.setting-block { margin-top: 10px; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 0 8px;
}

.setting-copy h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.setting-copy p {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.setting-copy b {
  font-weight: 500;
  color: var(--ink-2);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 60px;
  height: 44px;
  margin-right: -6px;
}

.switch input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: relative;
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 16px;
  background: var(--line);
  transition: background-color 0.22s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-hi);
  box-shadow: 0 1px 3px rgba(33, 29, 22, 0.25);
  transition: transform 0.24s var(--ease);
}

.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch input:disabled + .switch-track { opacity: 0.5; }

.remind-status {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-4);
  min-height: 17px;
}

.remind-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.remind-status.is-on { color: var(--ink-3); }
.remind-status.is-on::before { background: var(--ok); }
.remind-status.is-error::before { background: var(--accent); }

.ios-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 15px;
  padding: 12px 13px;
  border-radius: 12px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-size: 11.5px;
  line-height: 1.6;
}

.ios-note .icon { width: 16px; height: 16px; margin-top: 1px; }

.fineprint {
  margin: 13px 0 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-4);
}

.about {
  margin-top: 24px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.about-name {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.about-name span {
  margin-left: 3px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--ink-4);
}

.about p + p {
  margin: 6px 0 0;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--ink-4);
}

/* confirm */

.confirm-panel { padding-top: 13px; }

.confirm-panel h2 {
  margin: 9px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.confirm-body {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

/* toast */

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 98px);
  transform: translate(-50%, 10px);
  max-width: calc(100vw - 40px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--paper-hi);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.28s var(--ease);
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast-text { min-width: 0; }

.toast-action {
  flex: none;
  padding: 8px 2px;
  margin: -8px 0;
  font-size: 12px;
  font-weight: 600;
  color: #f2b49f;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(242, 180, 159, 0.5);
}

/* noscript */

.noscript {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: center;
}

/* ---------- desktop ---------- */

@media (min-width: 680px) {
  .page {
    padding-top: calc(env(safe-area-inset-top) + 30px);
    padding-bottom: 150px;
  }

  .hero { margin-top: 56px; }
  .headline { font-size: 46px; }
  .hero-meta { margin-top: 17px; }
  .sheet-wrap { margin-top: 30px; }
  .batch { padding: 8px 22px; }
  .task-main { padding: 17px 0; gap: 15px; }
  .task-title { font-size: 17px; }
  .task-swap { margin-top: 12px; }
  .dock {
    padding: 0 0 22px;
    background: transparent;
    border-top: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    pointer-events: none;
  }

  .dock-inner {
    max-width: 560px;
    padding: 8px;
    pointer-events: auto;
    background: rgba(251, 248, 240, 0.86);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 40px -30px rgba(33, 29, 22, 0.55);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .dock-lib { border-radius: 14px; }
  .dock-main { border-radius: 14px; }

  .view-head,
  .view-scroll {
    width: 100%;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }

  .overlay { align-items: center; }
  .sheet-panel {
    max-width: 500px;
    max-height: 86dvh;
    border-radius: 24px;
    margin: 24px;
    padding-bottom: 26px;
    transform: translateY(24px) scale(0.985);
    opacity: 0;
    transition: transform 0.32s var(--ease), opacity 0.24s ease;
  }
  .overlay.is-open .sheet-panel { transform: translateY(0) scale(1); opacity: 1; }
  .overlay.is-closing .sheet-panel { transform: translateY(18px) scale(0.99); opacity: 0; }
  .grabber { display: none; }

  .toast { bottom: 110px; }
}

@media (max-width: 370px) {
  .page { padding-left: 18px; padding-right: 18px; }
  .headline { font-size: clamp(30px, 9vw, 36px); }
  .batch { padding: 6px 15px; }
  .task-main { gap: 12px; }
  .task-title { font-size: 15.5px; }
  .dock { padding-left: 18px; padding-right: 18px; }
  .dock-lib { padding: 0 12px 0 14px; position: relative; }
  .dock-lib > span:not(.dock-count) { display: none; }
  .dock-lib { width: 54px; justify-content: center; }
  .dock-count { position: absolute; transform: translate(18px, -14px); margin: 0; }
  .week-head { gap: 9px; }
}

/* ---------- motion preferences ---------- */

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

@keyframes swapOut {
  to { opacity: 0; transform: translateY(-5px); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

.view.is-closing {
  animation: viewOut 0.22s ease both;
  pointer-events: none;
}

@keyframes viewOut {
  to { opacity: 0; transform: translateY(6px); }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
