:root {
  color-scheme: light;
  --page: #f5f7fb;
  --ink: #17212b;
  --muted: #647084;
  --line: #dce2ea;
  --card: #ffffff;
  --card-strong: #f0fbf9;
  --accent: #0f766e;
  --accent-ink: #073f3b;
  --shadow: 0 18px 45px rgba(54, 43, 31, 0.13);
  --pe: #dceefb;
  --pe-ink: #154766;
  --al: #eee3ff;
  --al-ink: #513076;
  --library: #e5f3dd;
  --library-ink: #315b23;
  --music: #ffe1e1;
  --music-ink: #7a2929;
  --science: #dff5ef;
  --science-ink: #176353;
  --art: #ffe8c6;
  --art-ink: #744400;
  --sel: #f8ddeb;
  --sel-ink: #733151;
  --studies: #fde68a;
  --studies-ink: #713f12;
  --skip: #e5e7eb;
  --skip-ink: #4b5563;
  --after: #e0f2fe;
  --after-ink: #075985;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(160deg, rgba(15, 118, 110, 0.1), transparent 38%),
    linear-gradient(20deg, rgba(226, 92, 92, 0.08), transparent 42%),
    var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.icon-sprite {
  display: none;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 10px 10px 12px;
}

.hero {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 2px 8px;
}

.eyebrow,
.week-range,
.weekday,
.date {
  margin: 0;
}

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

h1 {
  margin: 1px 0 3px;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0;
}

.week-range {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.cycle-wheel {
  position: relative;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 2px solid rgba(15, 118, 110, 0.3);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--card) 0 38%, transparent 39%),
    conic-gradient(#dff5ef, #ffe8c6, #f8ddeb, #dceefb, #eee3ff, #e5f3dd, #dff5ef);
  box-shadow: var(--shadow);
}

.cycle-wheel::after {
  content: "6 day";
  position: absolute;
  inset: 22px 16px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 850;
}

.cycle-wheel span {
  position: absolute;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-ink);
  font-size: 0.62rem;
  font-weight: 850;
}

.cycle-wheel span:nth-child(1) { left: 23px; top: 3px; }
.cycle-wheel span:nth-child(2) { right: 5px; top: 15px; }
.cycle-wheel span:nth-child(3) { right: 5px; bottom: 15px; }
.cycle-wheel span:nth-child(4) { left: 23px; bottom: 3px; }
.cycle-wheel span:nth-child(5) { left: 5px; bottom: 15px; }
.cycle-wheel span:nth-child(6) { left: 5px; top: 15px; }

.week-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  padding: 5px 0 7px;
  background: linear-gradient(to bottom, var(--page) 78%, rgba(245, 247, 251, 0));
}

.icon-button,
.today-button {
  min-height: 46px;
  border: 1px solid rgba(35, 31, 32, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(54, 43, 31, 0.08);
}

.icon-button {
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.today-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 800;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.week-list {
  display: grid;
  gap: 7px;
}

.day-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  min-height: 79px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 30px rgba(54, 43, 31, 0.08);
}

.day-card.is-today {
  border-color: rgba(15, 118, 110, 0.55);
  background: var(--card-strong);
}

.day-card.is-skipped {
  background: rgba(248, 250, 252, 0.92);
}

.date-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
}

.weekday {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.date {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.day-detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
}

.day-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cycle-badge {
  display: inline-flex;
  min-width: 62px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.86rem;
  font-weight: 900;
}

.today-marker,
.skip-badge {
  display: none;
  font-size: 0.75rem;
  font-weight: 850;
}

.today-marker {
  color: var(--accent);
}

.is-today .today-marker {
  display: inline;
}

.is-skipped .skip-badge {
  display: inline;
  color: var(--skip-ink);
}

.activities,
.after-school {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.after-school {
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.chip {
  display: inline-flex;
  max-width: 100%;
  min-height: 25px;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--chip-ink);
  background: var(--chip-bg);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
}

.chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.chip-pe { --chip-bg: var(--pe); --chip-ink: var(--pe-ink); }
.chip-al { --chip-bg: var(--al); --chip-ink: var(--al-ink); }
.chip-library { --chip-bg: var(--library); --chip-ink: var(--library-ink); }
.chip-music { --chip-bg: var(--music); --chip-ink: var(--music-ink); }
.chip-science { --chip-bg: var(--science); --chip-ink: var(--science-ink); }
.chip-art { --chip-bg: var(--art); --chip-ink: var(--art-ink); }
.chip-sel { --chip-bg: var(--sel); --chip-ink: var(--sel-ink); }
.chip-studies { --chip-bg: var(--studies); --chip-ink: var(--studies-ink); }
.chip-skip { --chip-bg: var(--skip); --chip-ink: var(--skip-ink); }
.chip-after { --chip-bg: var(--after); --chip-ink: var(--after-ink); }

@media (min-width: 700px) {
  .app-shell {
    padding-top: 30px;
  }

  h1 {
    font-size: 4.25rem;
  }
}

@media (max-height: 680px) and (max-width: 520px) {
  .app-shell {
    padding-top: 6px;
    padding-bottom: 8px;
  }

  .hero {
    min-height: 48px;
  }

  .cycle-wheel {
    display: none;
  }

  h1 {
    font-size: 1.65rem;
  }

  .week-range {
    font-size: 0.82rem;
  }

  .week-controls {
    grid-template-columns: 42px 1fr 42px;
    padding: 3px 0 5px;
  }

  .icon-button,
  .today-button {
    min-height: 39px;
  }

  .day-card {
    grid-template-columns: 62px 1fr;
    min-height: 70px;
  }

  .date-block {
    padding: 7px 8px;
  }

  .day-detail {
    padding: 7px 8px;
  }

  .cycle-badge {
    min-width: 56px;
    min-height: 25px;
    font-size: 0.78rem;
  }

  .chip {
    min-height: 23px;
    padding: 3px 6px;
    font-size: 0.73rem;
  }
}
