:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #6b665c;
  --line: #ded8cc;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --lift: 0 16px 40px rgba(39, 35, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 2.5rem;
  line-height: 0.95;
}

h2 {
  font-size: 1.7rem;
}

.streak {
  min-width: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  text-align: center;
  box-shadow: var(--lift);
}

.streak span {
  display: block;
  color: var(--accent-dark);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.streak small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.progress-panel,
.day-card,
.grid-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--lift);
}

.progress-panel {
  padding: 14px;
  margin-bottom: 14px;
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.progress-row strong {
  color: var(--ink);
}

.progress-track {
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e7e0d4;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.day-card {
  padding: 16px;
}

.day-switcher {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.day-switcher button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.day-switcher button:disabled {
  color: #b8b0a2;
}

.motivation {
  margin: 18px 0;
  padding: 16px;
  border-radius: 8px;
  background: #102f2d;
  color: #f7fbf7;
  font-size: 1.05rem;
  font-weight: 760;
  line-height: 1.35;
}

.tasks {
  display: grid;
  gap: 10px;
}

.task {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfaf7;
}

.task input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.task strong,
.task small {
  display: block;
}

.task small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.note-label {
  display: block;
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffefb;
  color: var(--ink);
  line-height: 1.4;
}

textarea:focus,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.25);
  outline-offset: 2px;
}

.save-state {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.grid-panel {
  margin-top: 14px;
  padding: 12px;
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.day-pill {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.day-pill.done {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.day-pill.current {
  border-width: 2px;
  border-color: #111827;
}

@media (min-width: 680px) {
  .shell {
    padding-top: 34px;
  }

  h1 {
    font-size: 3rem;
  }

  .day-card {
    padding: 22px;
  }

  .tasks {
    grid-template-columns: 1fr 1fr;
  }
}
