/* Workout Doctor. Colours from Dilshi's painting of Punnu: a sky of navy and
   cornflower dots on pale aqua, anthurium reds and pinks, gold, and a black cat. */

:root {
  --paper: #fbf5ef;
  --card: #fffdfa;
  --ink: #241a26;
  --ink-2: #5b4c58;
  --muted: #9a8a94;
  --line: #eadfd6;
  --shade: rgba(60, 30, 50, .08);
  --swim: #2f63c9;
  --bike: #c98d00;
  --run: #d7263d;
  --strength: #c2508a;
  --mobility: #8a6fc9;
  --gold: #f2b31a;
  --rose: #e8467c;
  --navy: #1f3a93;
  --aqua: #bfe6ee;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16142a; --card: #211e38; --ink: #f3ece6; --ink-2: #cdbfc8; --muted: #8f84a0;
    --line: #322d52; --shade: rgba(0, 0, 0, .35); --bike: #e8b020; --navy: #9db6ff; --swim: #6d97ff; --run: #ff5a6e;
  }
  .dotsky rect { fill: #253a6b; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(84px + var(--safe-b));
}
body.has-sheet { overflow: hidden; }
body.joining { padding-bottom: 0; }
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
p { margin: 0 0 .6em; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.eyebrow { font: 600 .72rem/1.2 var(--round); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .35rem; }
.sub { color: var(--ink-2); font-size: .95rem; }
.hint { color: var(--muted); font-size: .88rem; text-align: center; padding: 0 24px; }

/* ---------- buttons, chips, fields ---------- */
.primary {
  background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 13px 24px;
  font-weight: 600; box-shadow: 0 6px 18px var(--shade); transition: transform .15s;
}
.primary:active { transform: scale(.97); }
.primary:disabled { opacity: .5; }
.ghost { background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 9px 15px; font-size: .9rem; color: var(--ink-2); }
.ghost:active { background: var(--line); }
.link { background: none; border: 0; padding: 4px 2px; color: var(--navy); font-weight: 600; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: .9rem; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.form { display: grid; gap: 4px; }
.field { display: grid; gap: 5px; margin-bottom: 10px; font-size: .9rem; color: var(--ink-2); }
.field-lbl { font-size: .9rem; color: var(--ink-2); }
.field input:not([type=range]), .field textarea, input[type=date] {
  font: 16px var(--sans); color: var(--ink); background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 11px 13px; width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); }
.field input[type=range] { width: 100%; accent-color: var(--rose); }
.scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.row3 .field { min-width: 0; }
.row3 .field:nth-child(3), .row3 button { grid-column: 1 / -1; }
.row2 > * { min-width: 0; }
.sub-field { margin-left: 14px; opacity: .85; }
.err { color: var(--run); font-size: .9rem; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-btns input[type=date] { width: auto; padding: 8px 10px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 2px;
  padding: 8px 8px calc(8px + var(--safe-b)); background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-top: 1px solid var(--line);
}
.tabbar[hidden] { display: none; }
.tabbar a { flex: 1; max-width: 110px; display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--muted); font: 600 .7rem var(--round); padding: 4px 0; border-radius: 14px; }
.tabbar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on svg { stroke: var(--rose); }

/* ---------- today: hero ---------- */
.hero { position: relative; height: 262px; overflow: hidden; border-radius: 0 0 34px 34px; }
.dotsky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ''; position: absolute; inset: auto 0 0 0; height: 90px; background: linear-gradient(to bottom, transparent, color-mix(in srgb, #e9a3b2 55%, transparent)); pointer-events: none; }
.hero-text {
  position: absolute; left: 16px; top: max(18px, env(safe-area-inset-top)); right: 120px; z-index: 2;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-radius: 20px; padding: 13px 16px 12px; box-shadow: 0 8px 24px rgba(31, 58, 147, .18);
}
.hero-text .date { font: 600 .74rem var(--round); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.hero-text h1 { font-size: 1.62rem; line-height: 1.15; }
.hero-text .count { margin: 7px 0 0; font: .9rem var(--round); color: var(--ink-2); }
.hero-text .count b { font-size: 1.05rem; color: var(--run); }
.hero-cat { position: absolute; right: 2px; bottom: -6px; z-index: 1; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .18)); }
.punnu-sleep .halo { animation: halo 4s ease-in-out infinite; transform-origin: 100px 38px; }
.punnu .wings { transform-origin: 100px 120px; }
.punnu-proud .wings { animation: flap 1.6s ease-in-out infinite; }
@keyframes halo { 50% { transform: translateY(-3px); } }
@keyframes flap { 50% { transform: scaleY(1.06) translateY(-2px); } }

/* ---------- garland ---------- */
.garland { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 14px 12px 4px; }
.g-day { display: grid; justify-items: center; gap: 4px; text-decoration: none; padding: 6px 0 8px; border-radius: 16px; min-height: 58px; }
.g-day.today { background: var(--card); box-shadow: 0 4px 14px var(--shade); }
.g-lbl { font: 700 .72rem var(--round); color: var(--muted); }
.g-day.today .g-lbl { color: var(--rose); }
.g-fl { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; max-width: 46px; }
.g-rest { color: var(--muted); font-size: .8rem; font-family: var(--serif); font-style: italic; }
.garland.big .g-fl { max-width: 60px; }
.g-b { color: var(--muted); opacity: .9; }
.g-b.sport-swim { color: var(--swim); } .g-b.sport-bike { color: var(--bike); } .g-b.sport-run { color: var(--run); } .g-b.sport-strength { color: var(--strength); }
.g-p { color: var(--muted); }
.g-f { animation: none; }

/* ---------- notes, focus, thinking ---------- */
.note-card, .thinking, .rest-card, .closed-card, .close-cta, .panel, .coach-status, .note, .goal, .goalcheck, .phases, .sportgoals {
  background: var(--card); border-radius: var(--r); box-shadow: 0 6px 22px var(--shade); margin: 14px 14px; padding: 18px;
}
.note-card { border: 1.5px solid color-mix(in srgb, var(--gold) 55%, transparent); transition: opacity .4s, transform .4s; }
.note-card.gone { opacity: 0; transform: translateY(-8px); }
.note-body p, .note p { font-family: var(--serif); font-size: 1.04rem; line-height: 1.6; }
.note-body.clamp { max-height: 9.6em; overflow: hidden; mask-image: linear-gradient(to bottom, #000 60%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); }
.note-actions { display: flex; justify-content: space-between; margin-top: 6px; }
.thinking { display: flex; gap: 12px; align-items: center; }
.thinking div { display: grid; }
.thinking span { color: var(--ink-2); font-size: .92rem; }
.thinking .punnu { animation: halo 2.4s ease-in-out infinite; }
.week-focus { margin: 6px 20px 2px; color: var(--ink-2); font-family: var(--serif); font-size: 1rem; }
.week-focus b { color: var(--ink); }
.load { display: inline-block; font: 700 .64rem var(--round); letter-spacing: .1em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); vertical-align: 2px; }
.load-recovery { background: #d8eef3; color: #1d5f70; } .load-taper { background: #e8defa; color: #5a3d99; } .load-race { background: #fbd9de; color: #a3122a; } .load-build { background: #fbecc6; color: #7a5600; }
.rest-card { text-align: center; padding: 30px 18px; }
.rest-card h3 { font-size: 1.5rem; margin: 6px 0 4px; }
.rest-card p { font-family: var(--serif); font-style: italic; color: var(--ink-2); }
.tomorrow { margin: 6px 22px; color: var(--ink-2); font-size: .92rem; }
.tomorrow span { font: 700 .7rem var(--round); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: 6px; }
.quote { margin: 26px 26px 16px; padding: 0; text-align: center; }
.quote p { font-family: var(--serif); font-style: italic; font-size: 1.12rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.quote cite { display: block; margin-top: 6px; font: .78rem var(--round); color: var(--muted); font-style: normal; }
.quote.small p { font-size: 1rem; }

/* ---------- session card ---------- */
.today-list { display: grid; gap: 14px; padding: 8px 14px; }
.card {
  --c: var(--ink); position: relative; overflow: hidden; background: var(--card); border-radius: var(--r);
  box-shadow: 0 8px 26px var(--shade); padding: 16px 16px 14px 22px; transition: transform .2s;
}
.card.sport-swim { --c: var(--swim); } .card.sport-bike { --c: var(--bike); } .card.sport-run { --c: var(--run); }
.card.sport-strength { --c: var(--strength); } .card.sport-mobility { --c: var(--mobility); }
.card .band { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--c); }
.card.hard .band { background: repeating-linear-gradient(to bottom, var(--c) 0 7px, transparent 7px 11px); }
.card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card .sport { display: flex; align-items: center; gap: 6px; font: 600 .78rem var(--round); color: var(--c); letter-spacing: .02em; }
.keytag { font: 700 .62rem var(--round); letter-spacing: .14em; text-transform: uppercase; color: #7a5600; background: #fbecc6; padding: 2px 8px; border-radius: 999px; }
.card h3 { font-size: 1.32rem; margin: 6px 0 4px; line-height: 1.2; }
.card h3 .kind { font: 600 .72rem var(--round); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; vertical-align: 3px; }
.card .why { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.card details { margin: 6px 0 2px; }
.card summary { font: 600 .82rem var(--round); color: var(--muted); cursor: pointer; list-style: none; letter-spacing: .04em; }
.card summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform .2s; }
.card details[open] summary::before { transform: rotate(90deg); }
.card .detail { font-size: .92rem; color: var(--ink-2); margin-top: 8px; white-space: pre-line; }
.card .prov { font-size: .85rem; color: var(--muted); font-style: italic; }
.card.provisional { opacity: .85; }
.set { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.set li { display: grid; grid-template-columns: 64px 1fr; column-gap: 8px; align-items: baseline; }
.set .what { font: 700 .95rem var(--round); color: var(--ink); white-space: nowrap; }
.set .lbl { font-size: .92rem; color: var(--ink-2); }
.set .lbl i { color: var(--muted); font-style: normal; font-size: .82rem; }
.set .lbl small { display: block; color: var(--muted); font-size: .8rem; }
.set .tgt { grid-column: 2; font: .86rem var(--round); color: var(--c); }
.set .tgt b { font-weight: 700; }
.set .rep { grid-template-columns: 52px 1fr; background: color-mix(in srgb, var(--c) 7%, transparent); border-radius: 14px; padding: 8px 8px 8px 0; }
.set .reps { font: 800 1.15rem var(--round); color: var(--c); text-align: center; }
.set .rep ol { list-style: none; padding: 0; margin: 2px 0 0; display: grid; gap: 4px; }
.set .rep li { grid-template-columns: 58px 1fr; }
.rep-lbl { font: 600 .78rem var(--round); color: var(--muted); }
.garmin { margin: 10px 0 0; font-size: .88rem; color: var(--ink-2); background: color-mix(in srgb, var(--aqua) 40%, transparent); border-radius: 12px; padding: 8px 12px; }
.status { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.status > div { flex: 1; display: grid; }
.status small { color: var(--ink-2); font-size: .85rem; }
.card.done, .card.skipped { padding-bottom: 12px; }
.card.skipped { opacity: .8; }
.card.skipped .band { background: var(--muted); }
.rpe-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.rpe-quick button { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: .82rem; color: var(--ink-2); }
.card.just-done .bloom { animation: bloom .9s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes bloom { from { transform: scale(0) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.actions .alt { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .soon { flex: 1; color: var(--muted); font-size: .85rem; font-style: italic; font-family: var(--serif); }
.hold {
  position: relative; flex: 0 0 auto; width: 78px; height: 78px; border-radius: 50%; border: 0; padding: 0;
  background: color-mix(in srgb, var(--c) 9%, var(--card)); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .2s, background .2s;
}
.hold .dotring { position: absolute; inset: 1px; }
.hold .rd { fill: var(--line); transition: fill .08s, r .12s; }
.hold .rd.lit { fill: var(--c); r: 3.4; }
.hold-lbl { position: relative; font: 700 .7rem/1.15 var(--round); color: var(--c); letter-spacing: .03em; }
.hold.holding { transform: scale(.95); background: color-mix(in srgb, var(--c) 16%, var(--card)); }
.hold.complete { animation: done-pop .45s ease-out; }
@keyframes done-pop { 50% { transform: scale(1.12); } }

/* ---------- toast & celebrate ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60; width: min(92vw, 520px);
  transform: translate(-50%, 16px); opacity: 0; transition: opacity .45s, transform .45s;
  background: var(--card); border-radius: 18px; box-shadow: 0 14px 40px rgba(40, 20, 40, .22); padding: 14px 18px; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .q { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--ink); }
.toast .by { display: block; font: .75rem var(--round); color: var(--muted); margin-top: 4px; }
.celebrate { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .4s; }
.celebrate.show { opacity: 1; }
.celebrate h2 { font-size: 2rem; margin-top: 6px; }
.celebrate p { font-family: var(--serif); font-style: italic; color: var(--ink-2); max-width: 30ch; font-size: 1.1rem; margin-top: 8px; }
.celebrate cite { font: .78rem var(--round); color: var(--muted); }
.burst { position: absolute; left: 50%; top: 42%; }
.burst span { position: absolute; transform: rotate(var(--a)) translateY(0); animation: burst 1.6s cubic-bezier(.15, .7, .3, 1) var(--d) forwards; opacity: 0; }
@keyframes burst { 15% { opacity: 1; } to { transform: rotate(var(--a)) translateY(-150px) rotate(200deg); opacity: 0; } }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(30, 15, 30, .32); opacity: 0; transition: opacity .3s; }
.sheet {
  position: absolute; left: 50%; bottom: 0; width: min(100%, 640px); max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 28px 28px 0 0; padding: 10px 20px calc(24px + var(--safe-b));
  transform: translate(-50%, 100%); transition: transform .35s cubic-bezier(.2, .9, .3, 1);
}
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { font-size: 1.5rem; margin-bottom: 4px; }
.sheet .sub { margin-bottom: 14px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.card-sheet .sheet { background: var(--paper); }
.card-sheet .card { box-shadow: none; }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.daypick .day { display: grid; justify-items: center; gap: 1px; border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 8px 0; }
.daypick .day b { font: 700 .72rem var(--round); color: var(--muted); }
.daypick .day span { font: 700 1.05rem var(--round); }
.daypick .day i { font-style: normal; font-size: .7rem; color: var(--muted); min-height: 1em; }
.daypick .day.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.daypick .day.on b, .daypick .day.on i { color: var(--paper); }
.warn p { background: #fff3d6; color: #6b4b00; border-radius: 12px; padding: 8px 12px; font-size: .9rem; }
@media (prefers-color-scheme: dark) { .warn p { background: #3a3220; color: #f3d98f; } }

/* ---------- week ---------- */
.page-head { padding: max(22px, env(safe-area-inset-top)) 20px 6px; }
.page-head h1 { font-size: 1.9rem; line-height: 1.15; }
.page-head .lede { font-family: var(--serif); color: var(--ink-2); margin-top: 8px; }
.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: center; }
.nav-arrow { font: 300 2.2rem/1 var(--serif); text-decoration: none; color: var(--ink); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.nav-arrow.off { opacity: .15; }
.weeknav h1 { font-size: 1.45rem; }
.totals { display: grid; gap: 8px; margin: 10px 14px; }
.tot { display: grid; grid-template-columns: 22px 1fr; column-gap: 10px; align-items: center; color: var(--c); }
.tot.sport-swim { --c: var(--swim); } .tot.sport-bike { --c: var(--bike); } .tot.sport-run { --c: var(--run); } .tot.sport-strength { --c: var(--strength); }
.tot-txt { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--ink); font-size: .9rem; }
.tot-txt b i { font: 600 .78rem var(--round); color: var(--muted); font-style: normal; margin-left: 4px; }
.tot-n { display: grid; justify-items: end; color: var(--muted); font: .82rem/1.35 var(--round); }
.tot-d { color: var(--c); font-weight: 600; }
.bar { grid-column: 2; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--c); border-radius: 3px; transition: width .6s; }
.days { display: grid; gap: 8px; margin: 12px 14px; }
.wday { background: var(--card); border-radius: 18px; padding: 10px 12px; box-shadow: 0 3px 12px var(--shade); transition: box-shadow .2s, transform .2s; }
.wday.today { outline: 2px solid color-mix(in srgb, var(--rose) 55%, transparent); }
.wday.drop { transform: scale(1.015); box-shadow: 0 0 0 3px var(--gold), 0 8px 24px var(--shade); }
.wd-h { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.wd-h b { font-family: var(--serif); font-size: 1rem; color: var(--ink); }
.wd-list { display: grid; gap: 6px; }
.restline { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: .92rem; }
.wchip {
  --c: var(--ink); display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; text-align: left;
  border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 6%, var(--card)); border-radius: 12px;
  padding: 8px 10px; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.wchip.sport-swim { --c: var(--swim); } .wchip.sport-bike { --c: var(--bike); } .wchip.sport-run { --c: var(--run); }
.wchip.sport-strength { --c: var(--strength); } .wchip.sport-mobility { --c: var(--mobility); }
.wchip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); justify-self: center; }
.wchip.hard .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.wc-t { font-size: .93rem; font-weight: 600; }
.wc-m { font: .78rem var(--round); color: var(--muted); }
.wchip.prov { opacity: .7; border-left-style: dashed; }
.wchip.skipped .wc-t { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.wchip.lifted { opacity: .35; }
.ghost-chip { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; box-shadow: 0 14px 30px rgba(0, 0, 0, .25); transform-origin: center; }
body.dragging { user-select: none; -webkit-user-select: none; }
.closed-card { display: flex; gap: 12px; align-items: center; }
.closed-card small { display: block; font-family: var(--serif); font-style: italic; color: var(--ink-2); margin-top: 4px; }
.close-cta { text-align: center; }
.close-cta p { font-family: var(--serif); color: var(--ink-2); }

/* review */
.review { text-align: center; }
.review h2 { font-size: 1.8rem; }
.review-garland { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 16px 0; min-height: 40px; }
.review-garland .rv { animation: bloom .7s cubic-bezier(.2, 1.6, .4, 1) both; animation-delay: calc(var(--i) * 110ms + 150ms); }
.review-stats { display: flex; justify-content: center; gap: 22px; margin: 8px 0 14px; }
.review-stats div { display: grid; }
.review-stats b { font: 700 1.5rem var(--round); }
.review-stats span { font-size: .8rem; color: var(--muted); }
.review .field { text-align: left; }
.review.done { padding: 10px 0; }
.review.done .sheet-actions { justify-content: center; }

/* ---------- journey ---------- */
.goals { display: grid; gap: 0; }
.goal h3 { font-size: 1.25rem; }
.goal .target { margin: 6px 0 4px; }
.goal .target b { font: 700 1.2rem var(--round); color: var(--run); }
.goal.tri .target b { color: var(--swim); }
.goal .proj { font-family: var(--serif); color: var(--ink-2); }
.sportgoals { display: grid; gap: 10px; }
.sg { --c: var(--ink); display: grid; gap: 1px; border-left: 4px solid var(--c); padding-left: 12px; }
.sg.sport-swim { --c: var(--swim); } .sg.sport-bike { --c: var(--bike); } .sg.sport-run { --c: var(--run); }
.sg b { font-family: var(--serif); font-size: 1.05rem; }
.sg span { font-size: .88rem; color: var(--ink-2); }
.sg em { font: normal 700 .92rem var(--round); color: var(--c); }
.path-wrap { margin: 6px 0 0; }
svg.path { display: block; max-width: 520px; margin: 0 auto; overflow: visible; }
.jnode { cursor: pointer; }
.jnode .jl { font: 600 12.5px var(--serif); fill: var(--ink); }
.jnode .jd { font: 700 10.5px var(--round); fill: var(--muted); }
.jnode .js { font: 10.5px var(--round); fill: var(--muted); }
.jnode .mk.race { fill: var(--run); font-weight: 700; }
.jnode .mk.sim { fill: #b07b00; font-weight: 700; }
.jnode .mk.bench { fill: var(--swim); font-weight: 700; }
.jnode.past circle { opacity: .55; }
.jnode.current circle { stroke: var(--gold); stroke-width: 4; }
.phases h2, .goalcheck h2, .panel h2 { font-size: 1.25rem; margin-bottom: 8px; }
.phase { padding: 8px 0; border-top: 1px solid var(--line); }
.phase:first-of-type { border-top: 0; }
.phase span { float: right; font: .8rem var(--round); color: var(--muted); }
.phase p { font-size: .9rem; color: var(--ink-2); margin: 2px 0 0; }
.phase.now b { color: var(--rose); }

/* ---------- coach ---------- */
.coach-status { display: flex; gap: 12px; align-items: center; }
.coach-status div { display: grid; }
.coach-status span { color: var(--ink-2); font-size: .9rem; }
.note.old { box-shadow: none; background: transparent; border: 1px solid var(--line); }
.note summary { font-family: var(--serif); color: var(--ink-2); cursor: pointer; }
.gc { padding: 8px 0; border-top: 1px solid var(--line); }
.gc:first-of-type { border-top: 0; }
.gc span { display: block; font-size: .88rem; color: var(--ink-2); }
.gc em { font: normal 700 .92rem var(--round); color: var(--ink); }
.gc p { font-family: var(--serif); font-size: .95rem; color: var(--ink-2); margin: 4px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-family: var(--serif); font-style: italic; }

/* ---------- settings ---------- */
.zones { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 6px 0 10px; }
.zones th { text-align: left; font-weight: 600; padding: 5px 0; }
.zones td { padding: 5px 4px; font-family: var(--round); }
.zones .rpe { color: var(--muted); text-align: right; white-space: nowrap; }
.panel details summary { font-family: var(--serif); font-size: 1.02rem; padding: 6px 0; cursor: pointer; }
.away { list-style: none; padding: 0; margin: 0 0 12px; }
.away li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.punnu-panel { padding: 12px; text-align: center; }
.punnu-panel img { width: 100%; max-width: 360px; border-radius: 50% 50% 14px 14px / 34% 34% 14px 14px; display: block; margin: 0 auto; box-shadow: 0 10px 30px var(--shade); }
.caption { font-family: var(--serif); font-size: .95rem; color: var(--ink-2); margin-top: 10px; }
.change ul { margin: 4px 0 10px; padding-left: 18px; font-size: .9rem; color: var(--ink-2); }
.foot { text-align: center; box-shadow: none; background: transparent; }

/* ---------- join & empty ---------- */
.join { position: relative; min-height: 100vh; display: grid; align-content: end; overflow: hidden; }
.join-sky { position: absolute; inset: 0 0 35% 0; border-radius: 0 0 50% 50% / 0 0 12% 12%; overflow: hidden; }
.join-sky .dotsky { position: absolute; inset: 0; }
.join-cat { position: relative; z-index: 1; display: grid; place-items: center; margin-bottom: -36px; }
.join-card { position: relative; z-index: 2; background: var(--paper); border-radius: 50% 50% 0 0 / 60px 60px 0 0; padding: 46px 26px calc(30px + var(--safe-b)); text-align: center; box-shadow: 0 -10px 40px var(--shade); }
.join-card h1 { font-size: 2.2rem; }
.join-card .tag { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1.1rem; margin-bottom: 20px; }
.join-card .form { text-align: left; max-width: 380px; margin: 0 auto; }
.join-card .primary { margin-top: 8px; width: 100%; padding: 15px; }
.empty-state { text-align: center; padding: 70px 26px; display: grid; justify-items: center; gap: 10px; }
.empty-state h1 { font-size: 1.7rem; }
.empty-state p { font-family: var(--serif); color: var(--ink-2); max-width: 32ch; }

@media (min-width: 700px) {
  .hero { margin: 16px; border-radius: 34px; }
  .hero-text h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- her edits ---------- */
.edited { margin: 2px 0 6px; font-size: .88rem; color: var(--ink-2); }
.edtag { font: 700 .62rem var(--round); letter-spacing: .14em; text-transform: uppercase; color: #8a2f5c; background: #fbe0ec; padding: 2px 8px; border-radius: 999px; }
.ednote { font-family: var(--serif); font-style: italic; }
.stepedit { display: grid; gap: 8px; margin: 6px 0 12px; }
.se-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 30px; gap: 6px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 8px; }
.se-row input, .se-row select, .se-rep input { font: 15px var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 9px; width: 100%; min-width: 0; }
.se-x { border: 0; background: none; font-size: 1.3rem; color: var(--muted); padding: 0; }
.se-rep { border: 1.5px dashed color-mix(in srgb, var(--rose) 45%, var(--line)); border-radius: 16px; padding: 8px; display: grid; gap: 6px; background: color-mix(in srgb, var(--rose) 4%, transparent); }
.se-rep-h { display: flex; align-items: center; gap: 8px; font: 600 .85rem var(--round); color: var(--ink-2); }
.se-rep-h input { width: 64px; }
.se-rep-h .se-x { margin-left: auto; }
.se-add { display: flex; gap: 8px; flex-wrap: wrap; }
.se-sum { font: .85rem var(--round); color: var(--muted); }
.se-sum button { margin-left: 6px; }
.field select { font: 16px var(--sans); color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 13px; width: 100%; }

/* ---------- talking to the coach ---------- */
.goalcheck summary { font-family: var(--serif); font-size: 1.05rem; cursor: pointer; }
.goalcheck .gc:first-of-type { margin-top: 8px; }
.thread { display: grid; gap: 10px; padding: 6px 14px 14px; }
.day-sep { text-align: center; font: 700 .7rem var(--round); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; }
.note-bubble { background: var(--card); border: 1.5px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 20px; padding: 14px 16px; box-shadow: 0 6px 18px var(--shade); }
.note-bubble p { font-family: var(--serif); font-size: 1rem; line-height: 1.55; }
.note-bubble.old { box-shadow: none; border-color: var(--line); }
.note-bubble summary { font-family: var(--serif); color: var(--ink-2); cursor: pointer; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg.her { margin-left: auto; flex-direction: row-reverse; }
.msg .avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--aqua); display: grid; place-items: center; }
.msg .avatar .punnu { margin-top: 6px; }
.bubble { border-radius: 20px; padding: 10px 14px 6px; box-shadow: 0 3px 12px var(--shade); }
.bubble p { margin: 0 0 .5em; line-height: 1.45; }
.msg.coach .bubble { background: var(--card); border-bottom-left-radius: 6px; }
.msg.coach .bubble p { font-family: var(--serif); font-size: 1.02rem; }
.msg.her .bubble { background: linear-gradient(135deg, #e8467c, #d7263d); color: #fff; border-bottom-right-radius: 6px; }
.msg.her.pending .bubble { opacity: .7; }
.bubble .time { display: block; text-align: right; font: .68rem var(--round); opacity: .6; margin-top: -2px; }
.act-badge { display: inline-block; margin: 2px 0 6px; font: 700 .72rem var(--round); letter-spacing: .04em; color: #1d5f70; background: #d8eef3; padding: 3px 10px; border-radius: 999px; text-decoration: none; }
.typing .dots { display: inline-flex; gap: 4px; padding: 6px 2px 4px; }
.typing .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: .2s; } .typing .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.composer { position: sticky; bottom: calc(68px + var(--safe-b)); z-index: 5; margin: 0 8px; padding: 8px 8px 6px; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 22px; }
.composer .prompts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.composer .prompts::-webkit-scrollbar { display: none; }
.composer .prompts .chip { white-space: nowrap; font-size: .82rem; padding: 6px 12px; }
.composer.typing .prompts { display: none; }
.compose-row { display: flex; gap: 8px; align-items: flex-end; }
.compose-row textarea { flex: 1; font: 16px/1.4 var(--sans); color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 10px 14px; resize: none; max-height: 160px; }
.compose-row textarea:focus { outline: none; border-color: var(--rose); }
.send { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); display: grid; place-items: center; }
.send:active { transform: scale(.94); }
.compose-hint { margin: 4px 6px 0; font-size: .74rem; color: var(--muted); text-align: center; }
.composer.typing .compose-hint { display: none; }
.note-bubble .eyebrow { font: 600 .72rem/1.2 var(--round); }
