:root {
  --bg: #f6f1e7; --card: #fffdf8; --ink: #2b2a26; --soft: #6f6a5f; --line: #e4dccb;
  --green: #2f7d4f; --green-bg: #e3f1e6; --warn: #8a5a00; --warn-bg: #fdefc8; --red: #a33a2a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 19px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 560px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(112px + env(safe-area-inset-bottom)); }
h1 { font-size: 30px; margin: 0; line-height: 1.15; }
h2 { font-size: 22px; margin: 26px 0 10px; display: flex; align-items: baseline; gap: 10px; }
h2 small { font-size: 17px; font-weight: 400; color: var(--soft); }
p { margin: 10px 0; }
.sub { color: var(--soft); font-size: 17px; }
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.head > div { flex: 1; text-align: center; }
.nav { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 26px; color: var(--ink); }
.nav:disabled { opacity: .25; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 12px 0; }
.dose { display: flex; align-items: center; gap: 12px; }
.dose .what { flex: 1; min-width: 0; }
.dose b { display: block; font-size: 21px; overflow-wrap: anywhere; }
.dose span { color: var(--soft); }
.dose.done { background: var(--green-bg); border-color: #bcdcc4; }

button { font: inherit; cursor: pointer; }
.btn {
  display: block; width: 100%; min-height: 60px; padding: 12px 18px; border-radius: 16px;
  border: 2px solid var(--green); background: var(--green); color: #fff; font-size: 21px; font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--green); }
.btn.plain { border-color: var(--line); background: var(--card); color: var(--ink); font-weight: 500; }
.btn.danger { border-color: var(--red); background: transparent; color: var(--red); }
.btn + .btn { margin-top: 10px; }
.take { min-width: 124px; min-height: 60px; border-radius: 16px; border: 2px solid var(--green); background: var(--green); color: #fff; font-size: 20px; font-weight: 600; }
.taken { min-width: 124px; min-height: 60px; border-radius: 16px; border: 2px solid transparent; background: transparent; color: var(--green); font-size: 18px; font-weight: 600; }
.link { border: 0; background: none; color: var(--green); text-decoration: underline; padding: 10px 0; font-size: 18px; }

.banner { background: var(--warn-bg); border-color: #efd58a; }
.banner .btn { margin-top: 10px; }
.badge { display: inline-block; background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 2px 8px; font-size: 16px; font-weight: 600; }
.rule { color: var(--soft); font-size: 18px; margin: 4px 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn { width: auto; flex: 1; min-height: 52px; font-size: 18px; margin: 0; }
.photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; }
.photo.full { max-height: none; object-fit: contain; }
.empty { text-align: center; padding: 28px 12px; }
.empty .big { font-size: 64px; line-height: 1; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bar .in { max-width: 528px; margin: 0 auto; display: flex; gap: 10px; }
.bar .btn { margin: 0; min-height: 56px; font-size: 18px; padding: 8px 10px; }
.bar .gear { flex: 0 0 60px; font-size: 24px; }

label { display: block; font-size: 17px; color: var(--soft); margin: 12px 0 4px; }
input[type=text], input[type=number], input[type=time], input[type=date], select {
  width: 100%; min-height: 54px; font: inherit; padding: 8px 12px; border-radius: 12px; border: 1px solid #cfc6b3; background: #fff; color: var(--ink);
}
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days button { flex: 1; min-width: 40px; min-height: 48px; border-radius: 10px; border: 1px solid #cfc6b3; background: #fff; color: var(--ink); font-size: 17px; }
.days button.on { background: var(--green); border-color: var(--green); color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; gap: 12px; align-items: center; color: var(--ink); font-size: 18px; }
.check input { width: 28px; height: 28px; flex: none; }
.spin { width: 56px; height: 56px; margin: 24px auto; border: 6px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
.small { font-size: 16px; color: var(--soft); }
