/* JTC calendar — artifact design language.
   Warm cream page, white cards, black tabs and headings, color used
   sparingly for labels and borders (fitness teal, fatigue amber,
   form red-orange, + buttons orange-red). Session chips keep the
   website's sport colors (run green, bike blue, swim teal, rest
   gray) and status language: done is solid with a
   check, skipped is muted and struck through, planned is neutral.
   Below 700px the month view becomes a compact tappable grid with
   session dots instead of an unreadable squeeze. */

body { font-family: -apple-system, "Segoe UI", Helvetica, Arial,
  sans-serif; color: #1a1a1a; margin: 0; line-height: 1.5;
  background: #f6f2e9; }
header { background: #f6f2e9; color: #1a1a1a;
  padding: 0.9rem 1rem 0.75rem; display: flex;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  align-items: center; max-width: 76rem; margin: 0 auto; }
/* Brand wordmark: JARVIS big, each letter a step on the ember-to-gold
   Jarvis-palette ramp, with TRIATHLON COACHING tracked out beneath. */
header .brand { line-height: 1; }
header .brand-word { display: block; font-weight: 900;
  font-size: clamp(1.9rem, 5.5vw, 2.9rem); letter-spacing: -0.02em; }
header .brand-word .b1 { color: #b4232f; }
header .brand-word .b2 { color: #bc3a2c; }
header .brand-word .b3 { color: #c4532a; }
header .brand-word .b4 { color: #cc6e2b; }
header .brand-word .b5 { color: #d48933; }
header .brand-word .b6 { color: #d9a441; }
header .brand-sub { display: block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.34em; text-transform: uppercase; color: #1a1a1a;
  margin-top: 0.3rem; }

header .who { color: #6f6a61; font-size: 0.9rem; }
header .who a { color: #1a1a1a; }
main { max-width: 76rem; margin: 0 auto; padding: 0.25rem 1rem 1rem; }
footer { text-align: center; color: #6f6a61; font-size: 0.8rem;
  padding: 2rem 1rem; }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; font-weight: 800; margin: 1.5rem 0 0.5rem; }
h3 { font-size: 1rem; font-weight: 800; margin: 1.25rem 0 0.5rem; }
a { color: #1a1a1a; }
a:hover { text-decoration: underline; }
.meta { color: #6f6a61; font-size: 0.9rem; }
.empty { color: #6f6a61; }
.muted { color: #6f6a61; }

/* Pill tabs: header Home/Calendar/Coach + Month/Week toggle.
   Selected tab is solid black with white text, the artifact look. */
.tabs, .view-toggle { display: inline-flex; gap: 0.25rem;
  border: 1px solid #e2ddd2; background: #fff;
  border-radius: 999px; padding: 0.25rem; }
.view-toggle { margin-bottom: 1rem; }
.tab, .view-toggle a, .view-toggle span { padding: 0.35rem 1rem;
  border-radius: 999px; text-decoration: none; color: #1a1a1a;
  font-weight: 600; }
.tab:hover, .view-toggle a:hover { text-decoration: none;
  background: #f6f2e9; }
.tab.active, .view-toggle .toggle-active { background: #1a1a1a;
  color: #fff; font-weight: 700; }
.calnav, .weeknav { display: flex; gap: 1rem; margin-bottom: 1rem;
  flex-wrap: wrap; }

/* Form & Fitness strip: white card, thick black top border,
   small gray caps header with the date at the right, big bold
   numbers under small colored caps labels, bold status line. */
.strip { background: #fff; border: 1px solid #e2ddd2;
  border-top: 4px solid #1a1a1a; border-radius: 12px;
  padding: 1rem 1.25rem 1.1rem; margin-bottom: 1.5rem; }
.strip-head { display: flex; justify-content: space-between;
  gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.strip-title { margin: 0; font-size: 0.85rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: #6f6a61; }
.strip-date { color: #6f6a61; font-size: 0.9rem;
  white-space: nowrap; }
.strip-stats { display: flex; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 0.75rem; }
.stat { display: flex; flex-direction: column; }
.stat-label { font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; }
.stat-label.fit { color: #0e7490; }
.stat-label.fat { color: #c77414; }
.stat-label.frm { color: #df4f26; }
.stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1.05;
  color: #1a1a1a; }
.stat-value.frm { color: #df4f26; }
.strip-status { font-weight: 800; color: #1a1a1a; font-size: 1.05rem;
  margin: 0.6rem 0 0; }
.strip .meta { color: #6f6a61; margin: 0.4rem 0 0; }

/* Month grid */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: #e2ddd2; border: 1px solid #e2ddd2;
  border-radius: 12px; overflow: hidden; }
.weekday { background: #efe9dc; font-size: 0.8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: #6f6a61;
  padding: 0.5rem; text-align: center; }
.mday { background: #fff; padding: 0.5rem; min-height: 7.5rem; }
.mday.outside { background: #f6f2e9; }
.mday.outside .daynum { color: #9a948a; }
.mday.today { background: #fff; box-shadow: inset 0 0 0 2px #1a1a1a; }
.daynum { font-weight: 800; color: #1a1a1a; text-decoration: none;
  display: inline-block; margin-bottom: 0.35rem; }
.mday-chips { display: grid; gap: 0.35rem; }

/* Phone month grid: hidden on desktop, shown below 700px. */
.month-mobile { display: none; }
.mobile-day { display: none; }

/* Session chips */
.chip { display: block; border: 1px solid #e2ddd2;
  border-left: 4px solid #6f6a61; border-radius: 8px;
  padding: 0.45rem 0.55rem; text-decoration: none; color: #1a1a1a;
  background: #fff; }
.chip:hover { border-color: #c9c2b2; text-decoration: none; }
.chip-top { display: flex; gap: 0.4rem; align-items: baseline; }
.chip-sport { font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; flex-shrink: 0; }
.chip-title { font-size: 0.9rem; line-height: 1.3; }
.chip-meta { display: block; font-size: 0.8rem; color: #6f6a61; }
.chip-actuals { display: block; font-size: 0.8rem; color: #2a7d4f; }
.chip.sport-run, .homecard.sport-run { border-left-color: #2a7d4f; }
.chip.sport-run .chip-sport, .homecard.sport-run .chip-sport { color: #2a7d4f; }
.chip.sport-bike, .homecard.sport-bike { border-left-color: #2563a8; }
.chip.sport-bike .chip-sport, .homecard.sport-bike .chip-sport { color: #2563a8; }
.chip.sport-swim, .homecard.sport-swim { border-left-color: #0e7490; }
.chip.sport-swim .chip-sport, .homecard.sport-swim .chip-sport { color: #0e7490; }
.chip.sport-walk, .homecard.sport-walk { border-left-color: #8a6d3b; }
.chip.sport-walk .chip-sport, .homecard.sport-walk .chip-sport { color: #8a6d3b; }
.chip.sport-rest, .homecard.sport-rest { border-left-color: #9aa9b7;
  border-style: dashed; }
.chip.sport-rest .chip-sport, .homecard.sport-rest .chip-sport { color: #6f6a61; }
.chip.status-done .chip-title::before, .homecard.status-done .card-title::before { content: "\2713\0020";
  color: #2a7d4f; font-weight: 700; }
.chip.status-skipped, .homecard.status-skipped { opacity: 0.55; }
.chip.status-skipped .chip-title, .homecard.status-skipped .card-title { text-decoration: line-through; }

/* Home tab: day groups of enlarged session cards */
.homeday { margin-bottom: 1.5rem; }
.homeday h2 { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }
.homecard { display: block; border: 1px solid #e2ddd2;
  border-left: 4px solid #6f6a61; border-radius: 10px;
  padding: 0.7rem 0.85rem; color: #1a1a1a; margin-bottom: 0.6rem;
  background: #fff; }
.card-top { display: flex; gap: 0.4rem; align-items: baseline; }
.card-top a { color: #1a1a1a; text-decoration: none; font-size: 1rem; }
.card-top a:hover { text-decoration: underline; }
.homecard .goal { margin-top: 0.5rem; }
.homecard .goal p { margin: 0 0 0.4rem; }
.homecard textarea { width: 100%; box-sizing: border-box; }
.pain-badge { display: block; color: #9b1c1c; font-weight: 600;
  font-size: 0.8rem; }
.ai-badge { display: inline-block; background: #eef4fb; color: #2563a8;
  border: 1px solid #9fc3e8; border-radius: 999px; padding: 0 0.45rem;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.ai-note { border-left: 4px solid #2563a8; background: #eef4fb;
  border-radius: 8px; padding: 0.5rem 0.7rem; margin: 0.5rem 0; }
.ai-note p { margin: 0.3rem 0 0; }
.notecount { display: block; color: #6f6a61; font-size: 0.8rem; }

/* Week board + summary column */
.weekgrid { display: grid; gap: 1.5rem; }
@media (min-width: 900px) {
  .weekgrid { grid-template-columns: 2fr 1fr; }
}
.day { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }
.sessions { list-style: none; padding: 0; margin: 0; }
.chip-item { margin-bottom: 0.5rem; }
.summary { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 1rem; height: fit-content; }
.summary table { width: 100%; border-collapse: collapse;
  font-size: 0.95rem; }
.summary th, .summary td { text-align: left; padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #e2ddd2; vertical-align: top; }

/* Day detail */
.covernote { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 0.5rem 1rem; }
.covernote h2 { margin: 0 0 0.35rem; }
.covernote p { margin: 0 0 0.35rem; }
.covernote p:last-child { margin-bottom: 0; }
.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.4rem; }
.notes { list-style: none; padding: 0; }
.note { border: 1px solid #e2ddd2; border-radius: 12px;
  padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; background: #fff; }
.note.pain { border-color: #d88; background: #fdf2f2; }
.note.role-coach { background: #f6f2e9; }
.movelist { padding-left: 1.2rem; }
.movelist li { margin-bottom: 0.4rem; }
.coach-athlete { border-top: 1px solid #e2ddd2; padding-top: 0.5rem; }

/* Progress tab: recovery + per-sport trend tiles. Numbers and
   trend words only — no charts in v1. */
.progress-grid { display: grid; gap: 0.75rem; margin: 0.75rem 0 1.5rem;
  grid-template-columns: repeat(2, 1fr); }
.ptile { background: #fff; border: 1px solid #e2ddd2;
  border-radius: 12px; padding: 0.75rem 1rem; }
.ptile h3 { margin: 0 0 0.35rem; }
.ptile p { margin: 0 0 0.35rem; }
.ptile p:last-child { margin-bottom: 0; }
.pbig { font-size: 1.05rem; font-weight: 700; }
.trend { font-weight: 700; }
.trend.better { color: #2a7d4f; }
.trend.slipping { color: #b4232f; }
.trend.steady { color: #6f6a61; }

/* Forms */
form { display: grid; gap: 0.6rem; max-width: 34rem; margin-top: 0.5rem; }
form label { display: grid; gap: 0.3rem; }
form[style] { display: inline; }
input, textarea, select, button { font: inherit; padding: 0.45rem;
  border: 1px solid #d8d2c4; border-radius: 8px; background: #fff; }
button { background: #1a1a1a; color: #fff; cursor: pointer;
  width: fit-content; }
label.inline { display: flex; gap: 0.5rem; align-items: center; }

/* Phone: month view becomes a compact tappable 7-column grid; the
   full-chip desktop grid is hidden and the selected day's sessions
   list below the grid. */
@media (max-width: 700px) {
  main { padding: 0.25rem 0.75rem 0.75rem; }
  header { padding: 0.75rem; }
  header .brand-sub { letter-spacing: 0.26em; }
  .month-grid { display: none; }
  .month-mobile { display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 1px; background: #e2ddd2; border: 1px solid #e2ddd2;
    border-radius: 12px; overflow: hidden; }
  .mweekday { background: #efe9dc; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: #6f6a61;
    padding: 0.4rem 0; text-align: center; }
  .mcell { background: #fff; padding: 0.45rem 0.2rem 0.4rem;
    text-align: center; text-decoration: none; min-height: 3.1rem;
    display: flex; flex-direction: column; align-items: center;
    gap: 0.2rem; }
  .mcell-num { font-weight: 800; font-size: 0.95rem; line-height: 1.2; }
  .mcell.today { box-shadow: inset 0 0 0 2px #1a1a1a; }
  .mcell.selected { background: #1a1a1a; color: #fff; }
  .mcell.selected .mcell-num { color: #fff; }
  .mcell.selected .mdot { box-shadow: 0 0 0 1px #fff; }
  .mcell.outside { background: #f6f2e9; }
  .mcell.outside .mcell-num { color: #9a948a; font-weight: 600; }
  .mdots { display: flex; gap: 3px; flex-wrap: wrap;
    justify-content: center; }
  .mdot { width: 8px; height: 8px; border-radius: 50%; }
  .mdot.sport-run { background: #2a7d4f; }
  .mdot.sport-bike { background: #2563a8; }
  .mdot.sport-swim { background: #0e7490; }
  .mdot.sport-walk { background: #8a6d3b; }
  .mdot.sport-rest { background: #9aa9b7; }
  .mdot.sport-race { background: #1a1a1a; }
  .mobile-day { display: block; margin-top: 1.25rem; }
  .mobile-day .mday-chips { display: grid; gap: 0.5rem; }
  .strip-stats { gap: 1.25rem; }
  .stat-value { font-size: 1.9rem; }
  .progress-grid { grid-template-columns: 1fr; }
}

/* Home boards: event + goal cards, artifact look. Section headings
   are bold black caps with an orange circular + button at the right. */
.board-section { margin-bottom: 2rem; }
.board-head { display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; }
.board-head h2 { text-transform: uppercase; margin: 0; }
.add-btn { background: #df4f26; color: #fff; border: none;
  border-radius: 50%; width: 2.5rem; height: 2.5rem; font-size: 1.5rem;
  line-height: 1; cursor: pointer; flex-shrink: 0; padding: 0; }
.add-btn:hover { background: #c7431f; }
.board-grid { display: grid; gap: 1rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); }
.event-card, .goal-card { background: #fff;
  border: 1px dashed #c9c2b2; border-radius: 12px;
  padding: 1rem 1.25rem; position: relative; }
.event-name { font-size: 1.05rem; }
.event-star { color: #1a1a1a; }
.event-date { color: #df4f26; font-weight: 700; margin-top: 0.15rem; }
.event-desc, .goal-desc { color: #6f6a61; margin: 0.5rem 0 0; }
.goal-card { border-top: 4px solid #1a1a1a; }
.goal-card.goal-cat-swim { border-top-color: #0e7490; }
.goal-card.goal-cat-bike { border-top-color: #c77414; }
.goal-card.goal-cat-run { border-top-color: #df4f26; }
.goal-card.goal-cat-70\.3 { border-top-color: #1a1a1a; }
.goal-cat { font-size: 0.8rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: #1a1a1a; }
.goal-card.goal-cat-swim .goal-cat { color: #0e7490; }
.goal-card.goal-cat-bike .goal-cat { color: #c77414; }
.goal-card.goal-cat-run .goal-cat { color: #df4f26; }
.goal-card.goal-cat-70\.3 .goal-cat { color: #1a1a1a; }
.goal-title { font-size: 1.5rem; font-weight: 800; line-height: 1.15;
  margin-top: 0.25rem; }
.card-x-form { display: inline; }
.card-x { position: absolute; top: 0.5rem; right: 0.75rem;
  background: transparent; color: #9a948a; border: none;
  font-size: 1.25rem; line-height: 1; padding: 0; cursor: pointer; }
.card-x:hover { color: #1a1a1a; }
dialog.popup { border: 1px solid #e2ddd2; border-radius: 12px;
  padding: 1.5rem; max-width: 32rem; width: calc(100% - 2rem); }
dialog.popup::backdrop { background: rgba(0, 0, 0, 0.35); }
.form-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.form-actions button[type="button"] { background: #fff; color: #1a1a1a;
  border: 1px solid #c9c2b2; }

/* Race sessions: the calendar mirror of a dated home event. */
.chip.sport-race { border-left-color: #1a1a1a; }
.chip.sport-race .chip-sport { color: #1a1a1a; }

/* Race ★-pill strip above the calendar, mirroring the artifact:
   solid black pills, white text, wrapping to a second row. */
.race-strip { display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin: 0.9rem 0 0.4rem; }
.race-pill { background: #1a1a1a; color: #fff; border-radius: 999px;
  padding: 0.35rem 0.85rem; font-weight: 700; font-size: 0.9rem;
  white-space: nowrap; }
/* Week totals header line under the pills. */
.week-header { font-size: 1rem; margin: 0.2rem 0 0.9rem; }

/* Onboarding nudge card on Home (non-coach athletes only). */
.onboarding-nudge { background: #fff; border: 1px solid #e2ddd2;
  border-top: 4px solid #1a1a1a; padding: 1rem 1.2rem; }
.onboarding-nudge h2 { margin: 0 0 0.4rem; }
.onboarding-nudge p { margin: 0.4rem 0; }
.btn { display: inline-block; background: #1a1a1a; color: #fff;
  border-radius: 999px; padding: 0.6rem 1.2rem; font-weight: 700;
  text-decoration: none; min-height: 48px; line-height: 1.5;
  box-sizing: border-box; }
.btn:hover { background: #000; }
