/* Page structure and existing interactive states. Shared design tokens live in design-system.css. */
* {
  box-sizing:border-box
}
body {
  margin:0;
  min-height:100svh;
  color:var(--ink);
  background:radial-gradient(circle at 7% 4%,rgba(242,138,56,.22),transparent 25rem),radial-gradient(circle at 96% 65%,rgba(23,63,50,.1),transparent 28rem),var(--cream);
  font-family:Inter,ui-rounded,"SF Pro Rounded","Segoe UI",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased
}
button {
  font:inherit
}
.shell {
  width:min(900px,calc(100% - 22px));
  margin:auto;
  padding:14px 0 54px
}
.topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:38px
}
.brand {
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--forest);
  font-size:.75rem;
  font-weight:950;
  letter-spacing:.12em;
  text-decoration:none;
  text-transform:uppercase
}
.brand-mark {
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:11px;
  color:var(--cream);
  background:var(--forest)
}
.home-link {
  padding:9px 12px;
  border-radius:999px;
  color:var(--forest);
  background:rgba(255,253,248,.72);
  font-size:.73rem;
  font-weight:900;
  text-decoration:none
}
.hero {
  margin-bottom:22px
}
.kicker {
  margin:0 0 9px;
  color:var(--orange-dark);
  font-size:.72rem;
  font-weight:950;
  letter-spacing:.14em;
  text-transform:uppercase
}
h1 {
  margin:0;
  color:var(--deep);
  font-size:clamp(3.1rem,15vw,6.2rem);
  font-weight:950;
  letter-spacing:-.07em;
  line-height:.88
}
.intro {
  max-width:600px;
  margin:18px 0 0;
  color:var(--muted);
  line-height:1.55
}
.panel {
  padding:clamp(18px,4vw,34px);
  border:1px solid rgba(23,63,50,.09);
  border-radius:28px;
  background:rgba(255,253,248,.88);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px)
}
.state[hidden] {
  display:none
}
.state-title {
  margin:0 0 10px;
  color:var(--deep);
  font-size:1.5rem
}
.state-copy {
  margin:0 0 20px;
  color:var(--muted);
  line-height:1.5
}
.google {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:50px;
  padding:12px 18px;
  border:1px solid rgba(23,63,50,.14);
  border-radius:15px;
  color:var(--forest);
  background:var(--white);
  font-weight:900;
  cursor:pointer
}
.loading {
  color:var(--muted);
  font-weight:850
}
.summary-line {
  margin:0 0 14px;
  color:var(--forest);
  font-size:.91rem;
  font-weight:900;
  line-height:1.45
}
.competition {
  margin:0 0 18px;
  padding:13px 15px;
  border-radius:16px;
  font-size:.83rem;
  font-weight:900;
  line-height:1.4
}
.competition.eliminated { color:#9f4938; background:#f8e7df; border-color:rgba(159,73,56,.18); font-weight:850 }
.competition.active {
  color:#174737;
  background:#e4eee1
}
.competition.warning {
  color:#8a451d;
  background:#ffead7
}
.competition.eliminated {
  color:#8d3028;
  background:#ffe1dc
}
.stats {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
  margin-bottom:24px
}
.stat {
  padding:15px;
  border:1px solid rgba(23,63,50,.09);
  border-radius:17px;
  background:var(--white)
}
.stat-label {
  display:block;
  margin-bottom:5px;
  color:var(--muted);
  font-size:.64rem;
  font-weight:900;
  letter-spacing:.07em;
  text-transform:uppercase
}
.stat-value {
  display:block;
  color:var(--deep);
  font-size:1.5rem;
  font-weight:950;
  letter-spacing:-.04em
}
.calendar-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:13px
}
.calendar-head h2 {
  margin:0;
  color:var(--deep);
  font-size:1.55rem;
  letter-spacing:-.04em
}
.identity {
  color:var(--muted);
  font-size:.72rem;
  font-weight:800
}
.weekdays,.calendar {
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:4px
}
.weekdays {
  margin-bottom:5px
}
.weekday {
  color:#7a7e76;
  font-size:.6rem;
  font-weight:950;
  text-align:center;
  text-transform:uppercase
}
.calendar-day,.calendar-spacer {
  min-width:0;
  aspect-ratio:.82;
  border-radius:12px
}
.calendar-spacer {
  background:transparent
}
.calendar-day {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  padding:8px 6px;
  border:1px solid transparent;
  text-align:left
}
.calendar-day.completed {
  color:#fff;
  background:var(--forest);
  cursor:pointer
}
.calendar-day.completed:hover,.calendar-day.completed:focus-visible {
  transform:translateY(-2px);
  box-shadow:0 8px 18px rgba(23,63,50,.2);
  outline:2px solid var(--orange);
  outline-offset:1px
}
.calendar-day.missed {
  color:#8c491f;
  background:#ffead8;
  border-color:#f4cfaf
}
.calendar-day.future {
  color:#858980;
  background:#f1f0e9;
  border-color:#e4e2d8
}
.calendar-day.today {
  box-shadow:inset 0 0 0 2px var(--orange)
}
.day-number {
  font-size:.74rem;
  font-weight:950
}
.day-result {
  font-size:.61rem;
  font-weight:900;
  line-height:1.2
}
.day-points {
  font-size:.55rem;
  font-weight:750;
  opacity:.84
}
.legend {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:14px 0 0;
  color:var(--muted);
  font-size:.7rem;
  font-weight:800
}
.legend span {
  display:flex;
  align-items:center;
  gap:6px
}
.legend i {
  width:10px;
  height:10px;
  border-radius:4px
}
.legend .done {
  background:var(--forest)
}
.legend .lost {
  background:#f4c6a1
}
.legend .ahead {
  background:#deddd5
}
.weekly-reports {
  margin-top:32px;
  padding-top:25px;
  border-top:1px solid rgba(23,63,50,.12)
}
.weekly-reports-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:15px
}
.weekly-reports-head .kicker {
  margin-bottom:5px
}
.weekly-reports-head h2 {
  margin:0;
  color:var(--deep);
  font-size:1.5rem;
  letter-spacing:-.045em
}
.weekly-reports-head > p {
  margin:0 0 3px;
  color:var(--muted);
  font-size:.75rem
}
.weekly-report-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px
}
.weekly-report-card {
  position:relative;
  min-width:0;
  min-height:150px;
  padding:14px;
  border:1px solid rgba(23,63,50,.1);
  border-radius:17px;
  background:#f5f1e7
}
.weekly-report-card.is-available {
  border-color:#d5dccd;
  background:#f0f3e9
}
.weekly-report-card.is-locked {
  color:#858980;
  background:#f5f4ef
}
.weekly-report-label {
  margin:0 0 3px;
  color:var(--orange-dark);
  font-size:.61rem;
  font-weight:950;
  letter-spacing:.09em;
  text-transform:uppercase
}
.weekly-report-card.is-locked .weekly-report-label {
  color:#858980
}
.weekly-report-card h3 {
  margin:0;
  color:var(--forest);
  font-size:1.02rem;
  font-weight:950;
  letter-spacing:-.025em
}
.weekly-report-summary {
  min-height:2.4em;
  margin:7px 0 9px;
  color:var(--muted);
  font-size:.68rem;
  line-height:1.4
}
.weekly-report-action,.weekly-report-lock {
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:7px 9px;
  border:0;
  border-radius:10px;
  color:var(--forest);
  background:#e4eadc;
  font-size:.66rem;
  font-weight:900;
  text-align:left
}
.weekly-report-action {
  cursor:pointer
}
.weekly-report-action:hover,.weekly-report-action:focus-visible {
  color:#fffaf0;
  background:var(--forest);
  outline:2px solid var(--orange);
  outline-offset:2px
}
.weekly-report-lock {
  color:#7f8379;
  background:#e9e8e0
}
.weekly-report-new {
  position:absolute;
  top:11px;
  right:11px;
  padding:4px 7px;
  border-radius:999px;
  color:#713c1e;
  background:#f6cfaa;
  font-size:.55rem;
  font-weight:950;
  letter-spacing:.04em;
  text-transform:uppercase
}
.final-report-section {
  margin-top:16px
}
.final-report-card {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px;
  border:1px solid rgba(23,63,50,.1);
  border-radius:20px;
  background:#f5f1e7
}
.final-report-card.is-available {
  border-color:#e6b17f;
  background:#fff1df
}
.final-report-card.is-locked {
  color:#858980;
  background:#f5f4ef
}
.final-report-card h2 {
  margin:0;
  color:var(--forest);
  font-size:1.08rem;
  font-weight:950;
  letter-spacing:-.03em
}
.final-report-card .weekly-report-summary {
  min-height:0;
  margin:5px 0 0;
  font-size:.72rem
}
.final-report-card .weekly-report-action {
  flex:0 0 auto;
  min-height:40px;
  padding:9px 12px;
  color:#fffaf0;
  background:var(--forest);
  cursor:pointer
}
.final-report-card .weekly-report-action:hover,.final-report-card .weekly-report-action:focus-visible {
  color:var(--forest);
  background:#f1c28f;
  outline:2px solid var(--forest);
  outline-offset:2px
}
.final-report-card .weekly-report-action[hidden] {
  display:none
}
.status {
  min-height:1.3em;
  margin:12px 0 0;
  color:#a64e1c;
  font-size:.8rem;
  font-weight:800
}
.detail-dialog {
  width:min(420px,calc(100% - 28px));
  padding:0;
  border:0;
  border-radius:26px;
  color:var(--ink);
  background:var(--white);
  box-shadow:0 28px 90px rgba(13,45,36,.34)
}
.detail-dialog::backdrop {
  background:rgba(13,45,36,.55);
  backdrop-filter:blur(4px)
}
.detail {
  position:relative;
  padding:28px
}
.detail-close {
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  padding:0;
  border:0;
  border-radius:11px;
  color:var(--forest);
  background:#edf0e8;
  font-size:1.25rem;
  cursor:pointer
}
.detail-kicker {
  margin:0 42px 8px 0;
  color:var(--orange-dark);
  font-size:.7rem;
  font-weight:950;
  letter-spacing:.12em;
  text-transform:uppercase
}
.detail h2 {
  margin:0 42px 5px 0;
  color:var(--deep);
  font-size:1.8rem;
  letter-spacing:-.045em
}
.detail-description {
  margin:16px 0 20px;
  color:var(--muted);
  font-size:1.05rem;
  font-weight:800
}
.detail-bonus {
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:12px;
  color:#8f4b14;
  background:#fff0dc;
  font-weight:900
}
.detail-bonus[hidden] { display:none }
.detail-result {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px
}
.detail-result div {
  padding:14px;
  border-radius:15px;
  background:#edf0e8
}
.detail-result span {
  display:block;
  color:var(--muted);
  font-size:.64rem;
  font-weight:900;
  text-transform:uppercase
}
.detail-result strong {
  display:block;
  margin-top:4px;
  color:var(--deep);
  font-size:1.2rem
}
.report-dialog {
  width:min(620px,calc(100% - 24px));
  max-height:calc(100svh - 24px);
  overflow:hidden
}
.final-report-dialog {
  width:min(760px,calc(100% - 20px))
}
.report-detail {
  max-height:calc(100svh - 24px);
  overflow:auto;
  padding:clamp(21px,5vw,34px)
}
.report-detail > *:not(.report-confetti):not(.detail-close) {
  position:relative;
  z-index:1
}
.report-detail h2 {
  margin-top:4px;
  font-size:clamp(1.75rem,6vw,2.5rem)
}
.report-pep {
  margin:10px 0 18px;
  color:var(--muted);
  font-size:.87rem;
  line-height:1.5
}
.report-stats {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px
}
.report-stat {
  min-width:0;
  padding:12px 10px;
  border-radius:14px;
  background:#f0f2e9
}
.report-stat span {
  display:block;
  min-height:2.4em;
  color:var(--muted);
  font-size:.6rem;
  font-weight:900;
  line-height:1.25;
  text-transform:uppercase
}
.report-stat strong {
  display:block;
  margin-top:4px;
  color:var(--forest);
  font-size:1.05rem;
  font-weight:950;
  font-variant-numeric:tabular-nums
}
.report-exercises {
  margin-top:18px
}
.report-exercises h3 {
  margin:0 0 9px;
  color:var(--deep);
  font-size:.94rem
}
.report-exercises ul {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:0;
  padding:0;
  list-style:none
}
.report-exercises li {
  padding:9px 11px;
  border-radius:12px;
  color:var(--forest);
  background:#edf0e8;
  font-size:.76rem
}
.report-steps {
  margin-top:16px;
  padding:13px 15px;
  border-radius:14px;
  color:#fff8ed;
  background:var(--forest);
  font-size:.8rem;
  font-weight:850;
  line-height:1.5
}
.report-steps.is-unreported {
  color:var(--muted);
  background:#f4f0e7;
  font-weight:750
}
.report-confetti {
  position:absolute;
  z-index:0;
  inset:0 0 auto;
  height:120px;
  overflow:hidden;
  pointer-events:none
}
.report-confetti-piece {
  position:absolute;
  top:-14px;
  left:var(--confetti-x);
  width:7px;
  height:11px;
  border-radius:2px;
  background:var(--confetti-color);
  animation:report-confetti-fall 900ms cubic-bezier(.18,.62,.42,1) var(--confetti-delay) both
}
.final-report-detail {
  padding:clamp(20px,5vw,38px)
}
.final-report-detail h2 {
  max-width:620px;
  font-size:clamp(1.9rem,7vw,3.1rem);
  line-height:1.02
}
.final-report-detail .report-pep {
  max-width:580px;
  font-size:.95rem
}
.final-report-status {
  display:inline-flex;
  max-width:100%;
  margin:0 0 16px;
  padding:9px 12px;
  border-radius:999px;
  font-size:.68rem;
  font-weight:950;
  letter-spacing:.045em;
  line-height:1.35
}
.final-report-status.is-active {
  color:#164735;
  background:#e3eee3
}
.final-report-status.is-eliminated {
  color:#8d3028;
  background:#ffe1dc
}
.final-report-status.is-unknown {
  color:#666a62;
  background:#efeee8
}
.final-report-stats {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.final-report-fun-stats {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:9px
}
.final-report-fun-stats > div {
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid rgba(23,63,50,.09);
  border-radius:12px;
  background:#fffaf0
}
.final-report-fun-stats span {
  color:var(--muted);
  font-size:.67rem;
  font-weight:800
}
.final-report-fun-stats strong {
  color:var(--forest);
  font-size:.82rem;
  font-weight:950
}
.final-report-step-section {
  margin-top:20px;
  padding-top:17px;
  border-top:1px solid rgba(23,63,50,.13)
}
.final-report-section-head .kicker {
  margin:0 0 4px
}
.final-report-section-head h3 {
  margin:0;
  color:var(--deep);
  font-size:1.2rem;
  letter-spacing:-.035em
}
.final-report-step-section .report-steps {
  margin-top:10px
}
.final-report-step-stats {
  grid-template-columns:repeat(3,minmax(0,1fr));
  margin-top:8px
}
@keyframes report-confetti-fall {
  to { transform:translateY(130px) rotate(520deg); opacity:0 }
}
.busy {
  opacity:.6;
  pointer-events:none
}
@media(min-width:700px) {
  .shell {
    padding-top:22px
  }
  .stats {
    grid-template-columns:repeat(4,1fr)
  }
  .calendar-day,.calendar-spacer {
    aspect-ratio:1.08
  }
  .calendar-day {
    padding:11px
  }
  .day-number {
    font-size:.88rem
  }
  .day-result {
    font-size:.78rem
  }
  .day-points {
    font-size:.68rem
  }
  .weekly-report-grid {
    grid-template-columns:repeat(4,minmax(0,1fr))
  }
  .weekly-report-card {
    min-height:160px;
    padding:12px
  }
  .weekly-report-card h3 {
    font-size:.96rem
  }
  .report-stats {
    grid-template-columns:repeat(5,minmax(0,1fr))
  }
  .final-report-stats {
    grid-template-columns:repeat(5,minmax(0,1fr))
  }
  .final-report-step-stats {
    grid-template-columns:repeat(3,minmax(0,1fr))
  }
  .report-stat {
    padding:11px 8px
  }
}
@media(max-width:420px) {
  .weekly-reports-head {
    align-items:flex-start;
    flex-direction:column;
    gap:3px
  }
  .weekly-report-grid {
    gap:7px
  }
  .weekly-report-card {
    min-height:160px;
    padding:11px 9px
  }
  .weekly-report-card h3 {
    font-size:.91rem
  }
  .weekly-report-summary {
    font-size:.63rem
  }
  .weekly-report-action,.weekly-report-lock {
    padding:7px;
    font-size:.6rem
  }
  .report-stats {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .final-report-card {
    align-items:flex-start;
    flex-direction:column
  }
  .final-report-card .weekly-report-action {
    width:100%;
    justify-content:center
  }
  .final-report-stats,.final-report-step-stats {
    grid-template-columns:repeat(2,minmax(0,1fr))
  }
  .final-report-status {
    border-radius:13px
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important;
    transition:none!important;
    animation:none!important
  }
}

/* Self-service corrections stay inside the existing day dialog. */
#day-detail { max-height: calc(100dvh - 28px); overflow-y: auto; }
.day-edit-form { margin-top: 22px; border-top: 1px solid var(--line, #d6dccb); padding-top: 18px; }
.day-edit-intro { font-size: .9rem; line-height: 1.5; color: var(--muted, #6d776c); }
.day-edit-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.day-edit-form legend { font-weight: 800; margin-bottom: 12px; }
.day-edit-form select { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #b7c2ac; border-radius: 12px; background: #faf6e9; color: #204b3b; font: inherit; }
.day-edit-parts label, .day-edit-bonus { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: #f4f0e3; border-radius: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.day-edit-bonus[hidden] { display: none; }
.day-edit-form input[type="checkbox"] { flex: 0 0 auto; width: 22px; height: 22px; accent-color: #204b3b; margin: 1px 0 0; }
.day-edit-parts { display: grid; gap: 8px; }
.day-edit-parts p { margin: 0; font-size: .9rem; }
.day-edit-form .google { min-height: 48px; width: 100%; }
.day-edit-form :focus-visible { outline: 3px solid #c6632e; outline-offset: 3px; }
.day-edit-form .status { margin-bottom: 0; }
@media (max-width: 360px) { #day-detail .detail { padding: 20px; } }
