:root {
  --bg: #f6f3ee;
  --card: #fffdf9;
  --ink: #191714;
  --muted: #6f6a62;
  --line: #e5dfd3;
  --accent: #0f766e;
  --accent-soft: #dcefec;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(25, 23, 20, .06), 0 8px 24px rgba(25, 23, 20, .05);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: 100%; max-width: 780px; margin: 0 auto; padding: 0 18px; }

/* top bar */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 243, 238, .92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { font-size: 13px; font-weight: 700; letter-spacing: .18em; }
.progress { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* hero */
.hero { padding: 22px 0 4px; }
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #e9e2d6;
}
.hero-copy h1 {
  margin: 20px 0 6px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.lede { margin: 0; color: var(--muted); font-size: 16px; }

/* facts */
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 22px 0 30px;
}
.fact {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fact-k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fact-v { font-size: 17px; font-weight: 600; }
.fact-v.small { font-size: 14px; font-weight: 500; line-height: 1.35; }

/* days */
.days { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 760px) {
  .days { grid-template-columns: 1fr 1fr; align-items: start; }
  .days .card.rest { grid-column: 1 / -1; }
}

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

.day-head { display: flex; align-items: baseline; gap: 10px; }
.day-no {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
}
.day-count { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card h2 { margin: 2px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.card .note-line { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

ul.ex { list-style: none; margin: 0; padding: 0; }
ul.ex li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
ul.ex li:first-child { border-top: 0; }

.check {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 2px solid #cfc7b8;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .12s ease, border-color .12s ease;
}
.check[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.check[aria-checked="true"]::after {
  content: "";
  position: absolute;
  left: 7px; top: 3px;
  width: 7px; height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.ex-body { flex: 1 1 auto; min-width: 0; }
.ex-title { display: block; font-weight: 600; font-size: 16px; }
.ex-detail { display: block; color: var(--muted); font-size: 13.5px; }
li.done .ex-title { text-decoration: line-through; color: var(--muted); }
li.done .ex-detail { opacity: .7; }

.ex-tools { display: flex; gap: 4px; }
.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { background: #efe9dd; color: var(--ink); }

/* video slot */
.watch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 0;
  border-radius: 999px;
  padding: 5px 11px 5px 8px;
  cursor: pointer;
}
.ex-video { margin-top: 10px; }
.ex-video video { width: 100%; border-radius: 12px; display: block; background: #000; }
.video-pending {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-style: italic;
}

/* add row */
.add-row { margin-top: 12px; }
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 16px;
  cursor: pointer;
  min-height: 44px;
}
.btn.primary { background: var(--ink); color: #fffdf9; width: 100%; }
.btn.secondary { background: #efe9dd; color: var(--ink); width: 100%; }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  width: 100%;
  font-weight: 500;
  min-height: 42px;
}
.btn.small { padding: 8px 12px; min-height: 38px; font-size: 14px; width: auto; }

/* rest card */
.card.rest { margin-top: 26px; }
.card.rest .note-line { margin-bottom: 10px; }

/* timer */
.timer-card { margin-top: 26px; }
.timer {
  font-size: 52px;
  font-weight: 600;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  margin: 6px 0 14px;
}
.timer[data-state="done"] { color: var(--accent); }
.presets { display: flex; gap: 8px; margin-bottom: 14px; }
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 40px;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fffdf9; }
.caption { margin: 12px 0 0; color: var(--muted); font-size: 13.5px; }

/* note */
.note {
  margin: 22px 0 0;
  background: #fdf6e3;
  border: 1px solid #ecdfbd;
  border-radius: var(--radius);
  padding: 16px 18px;
}
.note h2 { margin: 0 0 4px; font-size: 16px; }
.note p { margin: 0; color: #5c5343; font-size: 14.5px; }

.tools-row { margin: 22px 0 0; }

.foot { margin: 30px 0 40px; color: var(--muted); font-size: 13px; }
.foot p { margin: 0 0 8px; }
.brand-foot { font-weight: 700; letter-spacing: .18em; font-size: 11px; color: var(--ink); }

/* editing */
.edit-input {
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
}
.edit-input + .edit-input { margin-top: 6px; }

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