:root {
  --charcoal: #1f2324;
  --cream: #faf6ec;
  --stone: #e8e3d7;
  --grey: #4a4d4a;
  --grey-light: #8c8f88;
  --green: #2f5a30;
  --green-bg: #dfead6;
  --amber: #6b4500;
  --amber-line: #8a5a00;
  --amber-bg: #fbe9c0;
  --red: #8a1f18;
  --red-line: #a3271f;
  --red-bg: #f9dcd8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 720px; margin: 0 auto; }

header.top { background: var(--charcoal); color: #fff; padding-top: env(safe-area-inset-top); }
header.top .wrap { padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 4px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: #c9d8bf; }
.site { font-size: 26px; font-weight: 600; line-height: 1.1; }
.date { font-size: 16px; color: var(--stone); }

header.task .wrap { padding: 14px 16px 18px; gap: 12px; }
.back {
  align-self: flex-start; min-height: 48px; display: flex; align-items: center; gap: 8px;
  padding: 0 16px 0 10px; border: 2px solid var(--grey-light); border-radius: 12px;
  background: none; color: #fff; font-size: 17px; font-weight: 600; cursor: pointer;
}
.task-title { font-size: 24px; font-weight: 600; line-height: 1.15; }
.pill { align-self: flex-start; font-size: 15px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.pill.due { background: var(--amber-bg); color: var(--amber); }
.pill.missed { background: var(--red-bg); color: var(--red); }
.pill.done { background: var(--green-bg); color: var(--green); }
.pill.plain { background: var(--stone); color: var(--grey); }
.sub { font-size: 16px; color: var(--stone); }

main { flex: 1; display: flex; flex-direction: column; }
main .wrap { padding: 18px 16px 28px; display: flex; flex-direction: column; gap: 22px; flex: 1; }

.banner { border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 600; }
.banner.wait { background: var(--amber-bg); color: var(--amber); border: 2px solid var(--amber-line); }
.banner.bad { background: var(--red-bg); color: var(--red); border: 2px solid var(--red-line); }

section.group { display: flex; flex-direction: column; gap: 10px; }
h2.band { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); }

.card {
  width: 100%; min-height: 76px; text-align: left; background: #fff; border: 2px solid var(--stone);
  border-radius: 14px; padding: 12px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer;
}
.card .icon { flex: none; width: 32px; height: 32px; }
.card .ring { flex: none; width: 28px; height: 28px; border: 2.5px solid var(--grey-light); border-radius: 50%; margin: 0 2px; }
.card .text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.card .name { font-size: 18px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.card .state { font-size: 15px; color: var(--grey); }
.card.missed, .card.due, .card.done { min-height: 84px; padding: 14px 16px; }
.card.missed .name, .card.due .name, .card.done .name { font-size: 19px; }
.card.missed { background: var(--red-bg); border-color: var(--red-line); }
.card.missed .state { color: var(--red); font-weight: 600; font-size: 16px; }
.card.due { background: var(--amber-bg); border-color: var(--amber-line); }
.card.due .state { color: var(--amber); font-weight: 600; font-size: 16px; }
.card.done { background: var(--green-bg); border-color: var(--green); }
.card.done .state { color: var(--green); font-weight: 600; font-size: 16px; }

.later { background: var(--stone); border-radius: 14px; padding: 16px; font-size: 16px; color: var(--grey); }
.empty { font-size: 18px; color: var(--grey); padding: 24px 4px; }

.instructions { margin: 0; font-size: 17px; line-height: 1.45; color: var(--grey); overflow-wrap: anywhere; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.checks h3 { margin: 8px 0 0; font-size: 15px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grey); }
.check {
  min-height: 68px; background: #fff; border: 2px solid var(--stone); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 14px; font-size: 19px; font-weight: 600; cursor: pointer; overflow-wrap: anywhere;
}
.check input { width: 32px; height: 32px; flex: none; accent-color: var(--green); }
.check.on { background: var(--green-bg); border-color: var(--green); }

.extra-btn {
  width: 100%; min-height: 60px; border: 2px dashed var(--grey-light); border-radius: 14px; background: none;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 600; cursor: pointer;
}
.extra { display: flex; flex-direction: column; gap: 12px; }
.extra label { font-size: 17px; font-weight: 600; }
.extra textarea {
  width: 100%; min-height: 96px; border: 2px solid var(--charcoal); border-radius: 14px; background: #fff;
  padding: 12px 14px; font-size: 18px; resize: vertical;
}
.photo-btn {
  min-height: 60px; border: 2px solid var(--charcoal); border-radius: 14px; background: #fff; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 18px; font-weight: 600; cursor: pointer;
}
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.photos .ph { position: relative; }
.photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 2px solid var(--stone); display: block; }
.photos .rm {
  position: absolute; top: -8px; right: -8px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff;
  background: var(--charcoal); color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
}
.need { font-size: 16px; font-weight: 600; color: var(--amber); }
.notice { background: var(--stone); border-radius: 14px; padding: 16px; font-size: 17px; line-height: 1.4; color: var(--charcoal); }

.done-btn {
  width: 100%; min-height: 76px; margin-top: auto; background: var(--green); color: #fff; border: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 24px; font-weight: 700; cursor: pointer;
}
.done-btn[disabled] { background: #b9bdb4; color: #3c3f3c; cursor: default; }

.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.name-btn {
  min-height: 84px; background: #fff; border: 2px solid var(--charcoal); border-radius: 14px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 20px; font-weight: 600;
  cursor: pointer; overflow-wrap: anywhere;
}
.hint { margin: 0; font-size: 15px; line-height: 1.45; color: var(--grey); }
.summary { background: var(--green-bg); border: 2px solid var(--green); border-radius: 14px; padding: 16px; font-size: 18px; line-height: 1.5; }

.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 24px; gap: 12px; }
.center h1 { margin: 0; font-size: 26px; }
.center p { margin: 0; font-size: 18px; color: var(--grey); max-width: 420px; line-height: 1.45; }

@media (min-width: 700px) {
  .names { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
