:root {
  --bg: #f6f4ef;
  --ink: #1c1b19;
  --muted: #5f584e;
  --line: #e4ddd2;
  --accent: #1f6a45;
  --nav: 64px;
  --dock: 76px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 18px;
  line-height: 1.45;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 20px calc(var(--nav) + var(--dock) + env(safe-area-inset-bottom) + 28px);
}
body.no-nav .wrap { padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom) + 32px); }
body.no-dock .wrap { padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 32px); }
body.plain .wrap { padding-bottom: 40px; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 680; margin: 8px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 650; margin: 28px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
}
.who {
  font-weight: 680;
  text-decoration: none;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding-left: 8px;
}
label { display: block; margin: 18px 0 8px; font-size: 16px; }
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
}
.num {
  font-size: 36px;
  line-height: 1;
  text-align: center;
  min-height: 76px;
  font-variant-numeric: tabular-nums;
}
.primary, .choice, .ghost, .textbtn {
  min-height: 48px;
}
.primary {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 680;
  font-size: 18px;
}
.primary:disabled { opacity: 0.55; }
.choice {
  width: 100%;
  margin: 0 0 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 14px 16px;
}
.choice.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.ghost, .textbtn {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: center;
  padding: 12px;
}
.textbtn { text-decoration: underline; text-underline-offset: 3px; }
.dock, .nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 100%);
  background: var(--bg);
}
.dock {
  bottom: calc(var(--nav) + env(safe-area-inset-bottom));
  padding: 10px 20px 12px;
}
body.no-nav .dock { bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.nav {
  bottom: 0;
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}
.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.nav a.on { color: var(--accent); font-weight: 700; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
  width: 100%;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  text-align: left;
  text-decoration: none;
}
.today-mark { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
.err { font-weight: 700; margin: 12px 0; }
.kicker { color: var(--muted); font-size: 15px; margin: 0 0 4px; }
.big {
  font-size: 40px;
  line-height: 1;
  margin: 0 0 8px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.rest-num {
  font-size: 80px;
  text-align: center;
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.stack { display: flex; flex-direction: column; gap: 4px; }
.sheet {
  position: fixed;
  inset: 0;
  background: rgba(28, 27, 25, 0.4);
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet > div {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
}
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.hint { margin-top: 8px; }
