:root {
  --ink: #24302c;
  --muted: #6d7873;
  --line: #e6ebe7;
  --paper: #f3f5f4;
  --card: #ffffff;
  --green: #2f9e44;
  --green-2: #e8f6ec;
  --dark: #3c4441;
  --warn: #d4534a;
  --ok: #2f9e44;
}
* { box-sizing: border-box; }
body { margin: 0; background: #e7ece9; color: var(--ink); font: 17px/1.35 "Segoe UI", "Avenir Next", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.phone {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  padding: 18px 16px 108px;
  position: relative;
}
.logo { width: 168px; height: auto; display: block; }
h1 { font-size: 28px; letter-spacing: -0.03em; margin: 8px 0 12px; }
h3 { margin: 16px 0 8px; }
.muted { color: var(--muted); font-size: 14px; }
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  margin: 10px 0;
  box-shadow: 0 1px 2px rgba(36, 48, 44, 0.04);
}
.score {
  background: var(--dark);
  color: white;
  border-radius: 22px;
  padding: 18px 18px 16px;
  margin: 8px 0 14px;
}
.score span { display: block; color: #c5cdc8; font-size: 14px; }
.score b { font-size: 48px; letter-spacing: -0.04em; color: #7ddea0; }
.score.low b { color: #ffb4ae; }
.dose { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; }
.dose time { font-weight: 700; font-size: 18px; }
.actions { display: grid; grid-template-columns: 1.4fr 44px 1fr; gap: 8px; margin-top: 12px; }
.actions button, .btn, .btn-ghost, .text-btn {
  border-radius: 999px;
  border: 0;
  padding: 12px 10px;
  font-weight: 650;
}
.btn, .take { background: var(--green); color: white; }
.skip { background: #fdeceb; color: var(--warn); }
.later, .btn-ghost, .text-btn { background: #eef1ef; color: var(--ink); }
.text-btn { display: block; width: 100%; margin-top: 8px; }
.done { color: var(--ok); font-weight: 700; }
.miss { color: var(--warn); font-weight: 700; }
.warn {
  background: #fff6e8;
  color: #8a5a12;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 8px 0;
}
.nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: min(398px, calc(100% - 24px));
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: white;
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(36, 48, 44, 0.08);
  padding: 6px;
}
.nav a {
  text-align: center;
  text-decoration: none;
  color: var(--muted);
  padding: 8px 4px 6px;
  font-size: 12px;
  border-radius: 16px;
  display: grid;
  justify-items: center;
  gap: 2px;
}
.nav a svg { width: 22px; height: 22px; }
.nav a.active { color: var(--green); background: var(--green-2); font-weight: 700; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); margin: 10px 0; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: white;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: white;
  border-radius: 18px;
  padding: 10px;
}
.cal button, .cal .dow {
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 0;
  text-align: center;
}
.cal button.bad { background: #fdeceb; color: var(--warn); }
.cal button.good { background: var(--green-2); color: #1d7a34; }
.dow { font-size: 12px; color: var(--muted); }
dialog { border: 0; border-radius: 18px; padding: 16px; width: min(360px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(36, 48, 44, 0.35); }
.toprow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
select.switch { width: auto; padding: 8px 10px; border-radius: 999px; }
.choices { display: grid; gap: 10px; margin-top: 18px; }
.choices button, .back {
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.choices b { display: block; font-size: 16px; }
.choices span, .back { color: var(--muted); font-size: 13px; }
.back { display: inline-block; margin: 8px 0 12px; cursor: pointer; }
.qr-box video, .qr-box img { width: 100%; border-radius: 16px; background: #1c2420; min-height: 180px; }
@media (max-width: 460px) {
  body { background: var(--paper); }
  .nav { bottom: 0; width: 100%; border-radius: 0; }
}
