:root {
  --bg: #fffaf4;
  --panel: #ffffff;
  --ink: #23312f;
  --muted: #69736e;
  --line: #eadfd3;
  --brand: #287c6f;
  --brand-dark: #1d5f55;
  --warm: #f5c46b;
  --with: #dff2e7;
  --free: #e9eefb;
  --partial: #fff0c9;
  --danger: #b4533f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 1rem 1rem 3rem;
}

.hero {
  align-items: center;
  background: linear-gradient(135deg, #fce2b3, #dff2e7);
  border-radius: 8px;
  display: grid;
  min-height: 440px;
  padding: clamp(2rem, 6vw, 5rem);
}

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

h1 {
  font-size: clamp(2.1rem, 7vw, 4.8rem);
  line-height: 1;
  max-width: 820px;
}

h2 {
  font-size: 1.2rem;
}

.lead {
  color: #33413d;
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: 660px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button,
button {
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 0.75rem 1rem;
}

.button.secondary {
  background: #eef4ef;
  color: var(--brand-dark);
}

.button.small,
button.small {
  min-height: 36px;
  padding: 0.5rem 0.75rem;
}

.feature-grid,
.grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem;
}

.form-shell,
.form-wide {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem auto;
  max-width: 560px;
  padding: 1.5rem;
}

.form-wide {
  max-width: 920px;
}

.day-edit-shell {
  max-width: 720px;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack.compact {
  gap: 0.6rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

textarea {
  min-height: 88px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 1rem;
}

legend {
  font-weight: 800;
}

.radio-line,
.check-line {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.radio-line input,
.check-line input {
  min-height: auto;
  width: auto;
}

.day-list {
  display: grid;
  gap: 0.65rem;
}

.day-row {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(90px, 1fr) minmax(150px, 1.4fr) minmax(120px, 1fr) minmax(170px, 1.4fr);
}

.rhythm-form {
  gap: 1.25rem;
}

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

.choice-card {
  align-items: flex-start;
  background: #fbf7f1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
}

.choice-card:has(input:checked) {
  background: #eef7f2;
  border-color: #96cdb2;
}

.choice-card input {
  margin-top: 0.2rem;
  min-height: auto;
  width: auto;
}

.choice-card small {
  color: var(--muted);
  display: block;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 0.25rem;
}

.start-date {
  max-width: 280px;
}

.rhythm-section {
  display: grid;
  gap: 1rem;
}

.rhythm-week {
  display: grid;
  gap: 0.65rem;
}

.rhythm-week h3 {
  margin: 0;
}

.rhythm-days {
  display: grid;
  gap: 0.75rem;
}

.rhythm-day-row {
  align-items: center;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(100px, 0.7fr) minmax(280px, 2fr) minmax(110px, 0.7fr);
  padding: 0.8rem;
}

.rhythm-day-row[data-day-state="without_child_all_day"] {
  background: #faf8f4;
}

.rhythm-day-row[data-day-state="with_child_all_day"],
.rhythm-day-row[data-day-state="with_child_from"],
.rhythm-day-row[data-day-state="with_child_until"] {
  background: #fbfffc;
  border-color: #d6eadc;
}

.day-options {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-day-editor {
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
}

.single-day-editor[data-day-state="without_child_all_day"] {
  background: #faf8f4;
}

.single-day-editor[data-day-state="with_child_all_day"],
.single-day-editor[data-day-state="with_child_from"],
.single-day-editor[data-day-state="with_child_until"] {
  background: #fbfffc;
  border-color: #d6eadc;
}

.option-pill {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  font-weight: 700;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
}

.option-pill-free {
  color: var(--muted);
}

.option-pill-child:has(input:checked),
.option-pill-partial:has(input:checked) {
  background: var(--with);
  border-color: #91cda7;
  box-shadow: inset 0 0 0 1px #b6dfc3;
  color: var(--ink);
}

.option-pill-free:has(input:checked) {
  background: #f1eee8;
  border-color: #ddd3c8;
  box-shadow: none;
  color: #69736e;
}

.option-pill input {
  min-height: auto;
  width: auto;
}

.time-field {
  font-size: 0.85rem;
}

.time-field input {
  background: #ffffff;
  border-color: #a9d7b9;
}

.calendar-head,
.dashboard-head,
.page-head,
.friend-row,
.result-card,
.overlap {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

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

.weekday {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 96px;
  overflow: hidden;
  padding: 0.65rem;
  position: relative;
}

.calendar-day > span {
  position: relative;
  z-index: 1;
}

.calendar-day.empty {
  background: transparent;
  border-style: dashed;
}

.status-with_child {
  background: var(--with);
  border-color: #b7dcc2;
}

.status-child_free {
  background: #f2eee8;
  border-color: #e3d8cc;
  color: #75807b;
}

.status-partial {
  background: #f2eee8;
  border-color: #d5e8dc;
}

.status-partial::before {
  background: var(--with);
  content: "";
  left: 0;
  position: absolute;
  right: 0;
}

.status-partial.partial-until::before {
  bottom: 50%;
  top: 0;
}

.status-partial.partial-from::before {
  bottom: 0;
  top: 50%;
}

.day-number {
  font-weight: 850;
}

.day-label {
  font-size: 0.86rem;
  line-height: 1.25;
}

.badge,
.mini-badge {
  background: #fff5dc;
  border-radius: 999px;
  color: #7a5513;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.35rem 0.6rem;
}

.mini-badge {
  margin-top: auto;
  width: fit-content;
}

.flash-list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  background: #eef7f2;
  border: 1px solid #cfe9da;
  border-radius: 8px;
  padding: 0.8rem 1rem;
}

.flash.error {
  background: #fff1ee;
  border-color: #f4c0b4;
  color: var(--danger);
}

.overlap.playdate {
  border-left: 6px solid #67a979;
}

.overlap.grown_up {
  border-left: 6px solid #788fd7;
}

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

@media (max-width: 760px) {
  .site-header,
  .calendar-head,
  .dashboard-head,
  .page-head,
  .friend-row,
  .result-card,
  .overlap {
    align-items: stretch;
    flex-direction: column;
  }

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

  .calendar-grid {
    gap: 0.35rem;
  }

  .calendar-day {
    min-height: 76px;
    padding: 0.45rem;
  }

  .day-label {
    font-size: 0.72rem;
  }

  .day-row {
    grid-template-columns: 1fr;
  }

  .choice-cards,
  .rhythm-day-row,
  .day-options {
    grid-template-columns: 1fr;
  }
}
