:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #68758a;
  --soft: #eef3f8;
  --line: #d7e0ea;
  --paper: #f7f9fc;
  --panel: #ffffff;
  --navy: #172033;
  --blue: #2868d8;
  --teal: #0d8876;
  --green: #167a52;
  --gold: #a66b09;
  --red: #b4233c;
  --shadow: 0 22px 60px rgba(23, 32, 51, 0.11);
  --small-shadow: 0 10px 25px rgba(23, 32, 51, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eaf0f7 0, #f7f9fc 310px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 310px;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(40, 104, 216, 0.18), transparent 44%),
    linear-gradient(250deg, rgba(13, 136, 118, 0.15), transparent 42%);
}

button,
input,
textarea {
  font: inherit;
}

button,
.button,
.icon-button {
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.app-shell {
  position: relative;
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--small-shadow);
}

.nav > a {
  padding: 0 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 950;
  text-decoration: none;
}

.nav div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.nav a,
.nav button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.nav a:hover,
.nav button:hover {
  background: #fff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav form {
  margin: 0;
}

.date-hero,
.panel,
.auth-panel {
  border: 1px solid rgba(215, 224, 234, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.date-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 14px;
  padding: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(23, 32, 51, 0.96), rgba(36, 79, 118, 0.92)),
    var(--navy);
  color: #fff;
}

.date-hero .eyebrow {
  color: #a8d7ff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 12px;
  font-size: 0.98rem;
  color: var(--muted);
  text-transform: uppercase;
}

.muted,
.task-row span,
.compact-list span {
  color: var(--muted);
}

.date-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.date-tools input,
.stacked-form input,
.stacked-form textarea,
.inline-input input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.date-tools input:focus,
.stacked-form input:focus,
.stacked-form textarea:focus,
.inline-input input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(40, 104, 216, 0.12);
}

.date-tools input {
  height: 42px;
  padding: 0 12px;
}

.date-hero .date-tools input {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.button,
.icon-button,
.stacked-form button,
.list-form button {
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover,
.icon-button:hover,
.stacked-form button:hover,
.list-form button:hover {
  transform: translateY(-1px);
  box-shadow: var(--small-shadow);
}

.button {
  padding: 0 16px;
}

.button.alt {
  background: #e7f0ff;
  color: var(--blue);
}

.date-hero .button,
.date-hero .icon-button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.date-hero .button.alt {
  background: #fff;
  color: var(--blue);
}

.icon-button {
  width: 42px;
  font-size: 1.25rem;
}

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

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.score {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  background: #e8f0ff;
  color: var(--blue);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(40, 104, 216, 0.12);
}

.score.complete {
  background: #e8f8f0;
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(22, 122, 82, 0.14);
}

.water-panel {
  background:
    linear-gradient(135deg, rgba(40, 104, 216, 0.08), rgba(13, 136, 118, 0.06)),
    #fff;
}

.water-form {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 9px;
}

.water-check {
  min-height: 70px;
  display: grid;
  place-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(23, 32, 51, 0.03);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.water-check:hover {
  transform: translateY(-1px);
  border-color: rgba(40, 104, 216, 0.45);
}

.water-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--blue);
}

.water-check:has(input:checked) {
  border-color: rgba(40, 104, 216, 0.45);
  background: #e8f0ff;
  color: var(--blue);
}

.task-list {
  display: grid;
  gap: 9px;
}

.task-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 34px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.task-row:hover {
  border-color: rgba(40, 104, 216, 0.32);
  box-shadow: var(--small-shadow);
  transform: translateY(-1px);
}

.task-row strong {
  display: block;
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.task-row.done {
  border-color: rgba(22, 122, 82, 0.25);
  background: #f3fbf7;
}

.task-row.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.check {
  width: 36px;
  height: 36px;
  border: 2px solid #aab7c7;
  border-radius: 8px;
  background: #fff;
  color: #fff;
  font-weight: 950;
}

.done .check {
  border-color: var(--green);
  background: var(--green);
}

.carryover {
  color: var(--gold);
  font-weight: 900;
  text-decoration: none;
}

.help {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #fff4da;
  color: var(--gold);
  font-weight: 950;
  box-shadow: inset 0 0 0 1px rgba(166, 107, 9, 0.13);
}

.inline-input {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.inline-input input {
  width: 90px;
  height: 38px;
  padding: 0 9px;
}

.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

blockquote {
  margin: 0;
  padding: 17px;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f0fbf8;
  color: #24453f;
  line-height: 1.55;
}

.empty {
  margin: 0;
  padding: 15px;
  border: 1px dashed #bdc9d8;
  border-radius: 8px;
  background: #fbfcfe;
  color: var(--muted);
}

.auth-panel {
  width: min(540px, 100%);
  margin: 8vh auto 0;
  padding: 28px;
}

.stacked-form {
  display: grid;
  gap: 13px;
}

.stacked-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.stacked-form input,
.stacked-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  color: var(--ink);
  font-weight: 550;
}

.stacked-form textarea {
  resize: vertical;
}

.stacked-form button {
  justify-self: start;
  padding: 0 17px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide-panel {
  grid-column: 1 / -1;
}

.weekday-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.weekday-picker label,
.checkbox-line {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 850;
}

.checkbox-line {
  justify-content: flex-start;
  padding: 0 10px;
}

.compact-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.compact-list li,
.list-form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-form {
  margin: 0 0 8px;
}

.list-form form {
  margin: 0;
}

.list-form span {
  overflow-wrap: anywhere;
}

.list-form button {
  min-height: 34px;
  padding: 0 11px;
  flex: 0 0 auto;
  background: #e8f0ff;
  color: var(--blue);
}

.reorder-save {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.reorder-save button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}

.drag-item {
  cursor: grab;
}

.drag-item.dragging {
  opacity: 0.56;
}

.drag-handle {
  width: 32px;
  min-height: 32px;
  padding: 0;
  flex: 0 0 auto;
  background: #f0f4f8;
  color: var(--muted);
  cursor: grab;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.calendar-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.calendar-blank {
  min-height: 100px;
}

.calendar-day,
.month-card {
  min-height: 100px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(23, 32, 51, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.calendar-day.today,
.month-card:hover,
.calendar-day:hover {
  border-color: rgba(40, 104, 216, 0.48);
  box-shadow: var(--small-shadow);
  transform: translateY(-1px);
}

.calendar-day span,
.month-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.month-card {
  min-height: 125px;
}

.alert {
  padding: 12px 14px;
  border: 1px solid #f3b7c2;
  border-radius: 8px;
  background: #fff1f3;
  color: var(--red);
  font-weight: 800;
}

@media (max-width: 820px) {
  .date-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-tools {
    justify-content: flex-start;
  }

  .admin-grid,
  .catalog-grid,
  .month-grid {
    grid-template-columns: 1fr;
  }

  .task-row {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
  }

  .inline-input {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }

  .water-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 18px, 1160px);
    padding-top: 14px;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-hero,
  .panel,
  .auth-panel {
    padding: 15px;
  }

  .weekday-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .water-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-head,
  .calendar-blank {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }
}
