/* The look follows iOS: a grouped background with white cells in light, true black with raised greys in dark,
   the system font at 17 pt, 44 pt touch targets, inset grouped lists, a tab bar. The icon's two colours are the
   only accent. No inline styles anywhere: the shell's policy (style-src 'self') would refuse them. */
:root { --bg: #F2F2F7; --cell: #FFFFFF; --fill: #E5E5EA; --fill-strong: #D1D1D6; --line: #C6C6C8; --text: #000000; --muted: #6C6C70;
        --accent: #442C2C; --on-accent: #E6FF00; --warn-bg: #FFF4CC; --warn-text: #5C4300; --danger: #C4271B;
        --bar: rgba(249, 249, 249, .94); --switch-off: #D1D1D6; --badge: #D92D20; --mark-bg: #442C2C; --mark-text: #E6FF00;
        --tabbar: 56px; --side: 300px; --easy: #AEAEB2; --tempo: #9A7B7B; --seg-track: #FFFFFF; --seg-on: #D1D1D6; color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --cell: #1C1C1E; --fill: #2C2C2E; --fill-strong: #3A3A3C; --line: #38383A; --text: #FFFFFF; --muted: #98989F;
          --accent: #E6FF00; --on-accent: #0B0B00; --warn-bg: #2A2000; --warn-text: #FFD60A; --danger: #FF6961;
          --bar: rgba(22, 22, 24, .94); --switch-off: #39393D;
          --easy: #636366; --tempo: #A9BC2A; --seg-track: #1C1C1E; --seg-on: #3A3A3C; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%;
       font: 17px/22px -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; }
p, h1, h2, h3, ul, ol, pre { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.defs { position: absolute; }
.muted { color: var(--muted); font-size: 13px; line-height: 18px; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); flex-shrink: 0; }
.icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
        flex-shrink: 0; }
.wordmark { display: block; width: 28px; height: 28px; fill: currentColor; color: var(--accent); }
.wordmark.large { width: 88px; height: 88px; }

/* ---------- a page: a large title over grouped lists ---------- */
.page { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px;
        padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + var(--tabbar) + 32px); }
.title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 0 10px; }
.title .muted { margin-top: 2px; }
.title h1 { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.lead { margin-top: 8px; color: var(--muted); }
#view-signin { gap: 24px; padding-top: calc(env(safe-area-inset-top) + 28px); }

.group, .groups { display: flex; flex-direction: column; }
.group { gap: 7px; }
.groups { gap: 26px; }
#view-settings { gap: 26px; }
.group > h2 { padding: 0 16px; font-size: 13px; line-height: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: .2px;
              color: var(--muted); }
.footnote { padding: 0 16px; font-size: 13px; line-height: 18px; color: var(--muted); }
.footnote:empty { display: none; }
.list { display: flex; flex-direction: column; background: var(--cell); border-radius: 12px; overflow: hidden; }
.list > * { position: relative; }
.list:not(.padded) > * + *::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line);
                                     transform: scaleY(.5); transform-origin: top; }
.list.padded { padding: 12px 16px; gap: 8px; font-size: 15px; line-height: 20px; }
.list.padded ol, .list.padded ul { padding-left: 22px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 16px; }
.row .value { color: var(--muted); }
.row .sub { display: block; font-size: 13px; line-height: 18px; color: var(--muted); }
.row.field .name { width: 96px; flex-shrink: 0; }
.row.field { min-height: 52px; }
.row.device { min-height: 60px; padding-right: 8px; }
.row.field input { flex: 1; min-width: 0; height: 44px; border: none; outline: none; background: transparent; }
.row.field input.code, .row .code { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 2px; text-transform: uppercase; }
button.row { width: 100%; border: none; background: transparent; text-align: left; color: var(--accent); justify-content: flex-start; }
button.row.danger, .link.danger { color: var(--danger); }
.link { border: none; background: transparent; color: var(--accent); min-height: 44px; padding: 0 4px; flex-shrink: 0; }
input[type=time] { border: none; border-radius: 8px; padding: 6px 10px; background: var(--fill); min-height: 34px; }

/* The iOS switch, 51 by 31: a real checkbox, invisible, over a drawn track and knob. */
.switch { position: relative; flex-shrink: 0; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .track { display: block; width: 100%; height: 100%; border-radius: 16px; background: var(--switch-off); transition: background .2s; }
.switch .track::before { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
                         background: #FFFFFF; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.button { height: 50px; padding: 0 20px; border: none; border-radius: 14px; background: var(--fill); color: var(--text); font-weight: 600; }
.button.primary { background: var(--accent); color: var(--on-accent); }
.button.wide { width: 100%; }
a.button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.button.small { position: relative; height: 36px; padding: 0 14px; border-radius: 18px; font-size: 15px; }
.button.small::after { content: ""; position: absolute; inset: -4px; }                     /* 44 pt to touch */
.card .button.small { align-self: flex-start; }

/* ---------- Today ---------- */
.fact { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; }
.fact .label, .card .label { font-size: 13px; line-height: 18px; color: var(--muted); }
.fact .big, .card .big { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: .35px; }
.fact .detail, .card .detail, .card .reasons { font-size: 15px; line-height: 20px; color: var(--muted); }
.measure { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.measure .value { color: var(--muted); font-size: 15px; }
progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; border: none; border-radius: 3px;
           background: var(--fill); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--fill); border-radius: 3px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }

.card { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--cell); border-radius: 12px; }
.card.warn { gap: 4px; padding: 12px 16px; background: var(--warn-bg); color: var(--warn-text); font-size: 15px; line-height: 20px; }
.card.warn h2 { font-size: 13px; line-height: 18px; font-weight: 600; text-transform: uppercase; }
.card.warn ul { display: flex; flex-direction: column; gap: 4px; padding: 0; list-style: none; }
#proposals { display: flex; flex-direction: column; gap: 12px; }
.proposal .eyebrow { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 600;
                     text-transform: uppercase; color: var(--muted); }
.proposal .what { font-size: 20px; line-height: 25px; font-weight: 600; }
.proposal .why { font-size: 15px; line-height: 20px; color: var(--muted); }
.proposal .deadline, .proposal .status { font-size: 13px; line-height: 18px; color: var(--muted); }
.proposal .status:empty { display: none; }
.proposal .actions { display: flex; gap: 10px; margin-top: 6px; }
.proposal .actions .button { flex: 1; }

/* ---------- the plan: Today and the week behind one switch ---------- */
.segmented { position: relative; display: flex; height: 44px; margin: -6px 0 -12px; }
.segmented::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 32px; border-radius: 9px; background: var(--seg-track); }
.segmented a { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 2px; color: var(--text);
               text-decoration: none; }
.segmented a span { width: 100%; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
                    font-size: 13px; line-height: 18px; font-weight: 500; }
.segmented a.active span { background: var(--seg-on); font-weight: 600; }
.arrows { display: flex; margin-right: -10px; }
.arrow { width: 44px; height: 44px; padding: 0; border: none; background: transparent; color: var(--accent); display: flex; align-items: center;
         justify-content: center; }
.arrow .icon, .back .icon { width: 22px; height: 22px; stroke-width: 2.4; }

.card { gap: 12px; }
.card.proposal { gap: 8px; }
.fact-head { display: flex; flex-direction: column; gap: 3px; }
.card .reasons { padding-left: 20px; }
.card .reasons:empty, .fine:empty, .detail:empty { display: none; }
.fine { font-size: 12px; line-height: 16px; color: var(--muted); }
.headline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.headline .big { font-size: 28px; line-height: 34px; letter-spacing: .36px; }
.block { display: flex; flex-direction: column; gap: 6px; }

/* A Session drawn: each bar is a step, as wide as it is long and as high as its share of FTP. */
.profile { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.profile.tall { position: relative; height: 96px; margin-bottom: 22px; }
.profile .axis { position: absolute; left: 0; right: 0; top: 100%; margin-top: 6px; display: flex; justify-content: space-between;
                 font-size: 12px; line-height: 16px; color: var(--muted); }
.profile.dense { gap: 1px; }
.profile .bar { flex-basis: 0; min-width: 1px; border-radius: 2px; background: var(--easy); }
.profile .bar.tempo, .swatch.tempo { background: var(--tempo); }
.profile .bar.hard, .swatch.hard { background: var(--accent); }
.swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--easy); }
.targets { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 20px; }
.targets .heading { margin-top: 4px; font-size: 13px; line-height: 18px; color: var(--muted); }
.targets .heading:first-child { margin-top: 0; }
.targets .repeat { font-weight: 600; }
.targets .step { display: flex; justify-content: space-between; gap: 12px; }
.targets .step .time { color: var(--muted); }
.targets .step .watts { font: 13px/20px ui-monospace, "SF Mono", Menlo, monospace; }

.gauges { display: flex; flex-direction: column; gap: 14px; }
.gauge { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 20px; }
.gauge .value { color: var(--muted); }
.gauge .track { position: relative; }
.gauge .track::after { content: ""; position: absolute; top: -3px; right: 0; width: 2px; height: 12px; border-radius: 1px; background: var(--muted); }

.fuel { display: flex; flex-direction: column; }
.fuel-step { display: flex; gap: 12px; }
.fuel-step .rail { width: 12px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 5px; }
.fuel-step .rail i { width: 10px; height: 10px; flex-shrink: 0; border-radius: 5px; background: var(--accent); }
.fuel-step .rail b { flex: 1; width: 2px; border-radius: 1px; background: var(--fill-strong); }
.fuel-step .words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; }
.fuel-step:last-child .rail b { display: none; }
.fuel-step:last-child .words { padding-bottom: 0; }
.fuel-step .when, .fuel-step .how { font-size: 13px; line-height: 18px; color: var(--muted); }
.fuel-step .what { font-weight: 600; }

.rings { display: flex; gap: 12px; }
.ring-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ring { --share: 0; width: 112px; height: 112px; margin-bottom: 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
        background: conic-gradient(var(--accent) calc(var(--share) * 1turn), var(--fill) 0); }
.ring .hole { width: 90px; height: 90px; border-radius: 50%; background: var(--cell); display: flex; flex-direction: column; align-items: center;
              justify-content: center; }
.ring-big { font-size: 22px; line-height: 26px; font-weight: 700; }
.ring-unit { font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }

/* ---------- the week: two charts, then seven days ---------- */
.chart { display: flex; align-items: flex-end; gap: 6px; }
.chart .col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.chart.tall .col { height: 94px; }
.col .num { font-size: 12px; line-height: 16px; font-weight: 600; }
.col .num.soft { color: var(--muted); }
.col .well { width: 100%; height: 72px; display: flex; align-items: flex-end; justify-content: center; }
.col .stick { width: 100%; max-width: 30px; min-height: 8px; border-radius: 6px; background: var(--accent); }
.col .stick.planned { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.col .stick.missed { background: transparent; border: 1.5px dashed var(--fill-strong); }
.col .rest { width: 6px; height: 6px; border-radius: 3px; background: var(--fill-strong); }
.col .tube { width: 100%; max-width: 30px; height: 48px; border-radius: 6px; background: var(--fill); display: flex; align-items: flex-end; overflow: hidden; }
.col .tube i { display: block; width: 100%; background: var(--accent); }
.col .tube.empty { background: transparent; border: 1.5px dashed var(--fill-strong); }
.col .over { width: 100%; max-width: 30px; height: 3px; border-radius: 2px; background: transparent; }
.col .over.is { background: var(--danger); }
.col .seg { width: 100%; max-width: 30px; height: 8px; margin-top: -1px; border-radius: 3px; background: var(--fill); }
.col .seg.on { background: var(--accent); }
.letters { display: flex; gap: 6px; }
.letters span { flex: 1; display: flex; justify-content: center; }
.letters b { width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 12px;
             font-weight: 600; color: var(--muted); }
.letters b.today { background: var(--accent); color: var(--on-accent); font-weight: 700; }

.group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; }
.group-head h2 { font-size: 13px; line-height: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: .2px; color: var(--muted); }
.key { display: flex; gap: 10px; font-size: 12px; line-height: 16px; color: var(--muted); }
.key span { display: flex; align-items: center; gap: 4px; }
.day-row { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; color: var(--text); text-decoration: none; }
.day-row .when { width: 36px; flex-shrink: 0; align-self: flex-start; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.day-row .when small { font-size: 11px; line-height: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.day-row .when b { min-width: 34px; height: 34px; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-size: 22px;
                   line-height: 28px; font-weight: 700; }
.day-row.is-today .when b { background: var(--accent); color: var(--on-accent); font-size: 20px; }
.day-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.day-row .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.day-row .head strong { font-weight: 600; overflow-wrap: anywhere; }
.day-row .lines { margin-top: -6px; font-size: 13px; line-height: 18px; color: var(--muted); }
.chip { flex-shrink: 0; padding: 3px 8px; border-radius: 8px; background: var(--fill); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.chip.soft { color: var(--muted); }
.chip.accent { background: var(--accent); color: var(--on-accent); }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip.missed { color: var(--danger); }
.foodline { display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 18px; }
.foodline .soft { color: var(--muted); }
.foodline .between { align-items: center; }
.capped { display: flex; align-items: center; gap: 3px; }
.capped progress { flex: 1; }
.capped i { display: none; width: 3px; height: 6px; border-radius: 2px; background: var(--danger); }
.capped.over i { display: block; }
.pills { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; vertical-align: 1px; }
.pills i { width: 14px; height: 6px; border-radius: 3px; background: var(--fill-strong); }
.pills i.on { background: var(--accent); }
.chev { flex-shrink: 0; width: 8px; height: 8px; margin: 0 6px 0 2px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
        transform: rotate(45deg); }

/* ---------- one day, pushed over the week ---------- */
.page.pushed { gap: 16px; padding-top: env(safe-area-inset-top); }
.navbar.pushed { justify-content: space-between; margin: 0 -16px; padding: 0 8px; }
.navbar h1 { font-size: 17px; line-height: 22px; font-weight: 600; }
.back { min-width: 76px; height: 44px; display: flex; align-items: center; gap: 2px; color: var(--accent); text-decoration: none; }
.back-spacer { width: 76px; }
.compare { display: flex; flex-direction: column; gap: 5px; font-size: 15px; line-height: 20px; }
.compare .line { display: flex; align-items: center; gap: 8px; }
.compare .line progress { flex: 1; height: 8px; border-radius: 4px; }
.compare .line span { width: 112px; flex-shrink: 0; text-align: right; font-size: 13px; line-height: 18px; }
.compare .line .soft { color: var(--muted); }
progress.soft::-webkit-progress-value { background: var(--easy); }
progress.soft::-moz-progress-bar { background: var(--easy); }
.tiles { display: flex; gap: 10px; }
.tile { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--fill); }
.tile small { font-size: 12px; line-height: 16px; color: var(--muted); }
.tile b { font-weight: 700; }
a.callout { display: block; color: var(--text); text-decoration: none; }
.callout { padding: 10px 12px; border-radius: 10px; background: var(--fill); font-size: 15px; line-height: 20px; }

/* ---------- what the Coach writes: markdown, in a message or in a report ---------- */
.text { overflow-wrap: anywhere; }
.text p { margin: 0 0 8px; } .text p:last-child { margin-bottom: 0; }
.text h3 { font-size: 17px; font-weight: 600; margin: 10px 0 4px; } .text h3:first-child { margin-top: 0; }
.text ul, .text ol { margin: 0 0 8px; padding-left: 24px; }
.text table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 20px; margin: 0 0 8px; }
.text th, .text td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.text code, .text pre { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .88em; }
.text pre { white-space: pre-wrap; margin: 0 0 8px; padding: 10px 12px; background: var(--fill); border-radius: 10px; }
.text a { color: inherit; }

/* ---------- Chat: the Coach writes on the page, the athlete in a quiet bubble ---------- */
body.in-chat { overflow: hidden; }
main.chat { display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; padding-top: env(safe-area-inset-top);
            height: calc(100dvh - var(--tabbar) - env(safe-area-inset-bottom)); }
.navbar { height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-bottom: .5px solid var(--line); }
.navbar h1 { display: flex; }
#conversation { flex: 1; overflow-y: auto; padding: 12px 16px 6px; -webkit-overflow-scrolling: touch; }
#messages { display: flex; flex-direction: column; gap: 16px; }
.day { align-self: center; padding-top: 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.message { display: flex; flex-direction: column; gap: 4px; }
.message.athlete { align-items: flex-end; }
.message.athlete .text { max-width: min(78%, 520px); padding: 8px 14px; border-radius: 18px; background: var(--fill); white-space: pre-wrap; }
.message.athlete .meta { padding-right: 6px; }
.message.coach { flex-direction: row; align-items: flex-start; gap: 10px; }
.message.coach .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.message img { display: block; max-width: min(232px, 78%); max-height: 260px; border-radius: 18px; }
.message .meta { font-size: 12px; line-height: 16px; color: var(--muted); }
.message .error { font-size: 13px; line-height: 18px; color: var(--danger); }
.message.failed .text { box-shadow: 0 0 0 1.5px var(--danger); }
.avatar { width: 22px; height: 22px; margin-top: 1px; flex-shrink: 0; border-radius: 6px; background: var(--mark-bg); color: var(--mark-text);
          display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; font-weight: 800; }
.working { display: flex; align-items: center; gap: 8px; padding: 16px 0 4px; font-size: 15px; line-height: 20px; color: var(--muted); }
.working .avatar { margin: 0 2px 0 0; }
.working .dot { animation: pulse 1.4s ease-in-out infinite; }
.working.problem { color: var(--danger); }
.working.problem .avatar, .working.problem .dot { display: none; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .working .dot { animation: none; } .switch .track, .switch .track::before { transition: none; } }
.banner { display: none; }

#composer { flex-shrink: 0; display: flex; flex-direction: column; padding: 8px 12px 8px 8px; }
.attached { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0 10px 52px; }
.thumb { position: relative; display: block; }
.thumb img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 12px; }
.thumb .remove { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; padding: 0; border: none; border-radius: 12px;
                 background: var(--fill-strong); color: var(--text); font-size: 16px; line-height: 1; }
.thumb .remove::after, .send::after { content: ""; position: absolute; inset: -10px; }      /* a 44 pt target around a small control */
.compose { display: flex; align-items: flex-end; gap: 4px; }
.attach { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.attach span { width: 34px; height: 34px; border-radius: 17px; background: var(--fill); display: flex; align-items: center; justify-content: center; }
.attach .icon { width: 20px; height: 20px; stroke-width: 2; }
#composer .field { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 6px; min-height: 40px; margin-bottom: 2px;
                   padding: 0 5px 0 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); }
#composer textarea { flex: 1; min-width: 0; max-height: 140px; padding: 8px 0; border: none; outline: none; resize: none; background: transparent; }
.send { position: relative; width: 30px; height: 30px; margin-bottom: 4px; padding: 0; flex-shrink: 0; border: none; border-radius: 15px;
        background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; }
.send .icon { width: 18px; height: 18px; stroke-width: 2.4; }

/* ---------- the tabs: a bar at the bottom of a phone ---------- */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding-bottom: env(safe-area-inset-bottom); background: var(--bar);
           -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line); }
#tabs .brand, #tabs #side-today { display: none; }
#tabs .tablist { display: flex; }
#tabs a { position: relative; flex: 1; height: var(--tabbar); display: flex; flex-direction: column; align-items: center; justify-content: center;
             gap: 2px; color: var(--muted); text-decoration: none; font-size: 10px; line-height: 12px; font-weight: 500; }
#tabs a.active { color: var(--accent); }
#tabs .badge { position: absolute; top: 5px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
                  background: var(--badge); color: #FFFFFF; font-size: 12px; line-height: 18px; font-weight: 600; text-align: center; }

/* The Coach's own mark stands in the middle, larger than the icons beside it, and opens the Chat. */
#tabs a.coach .icon, #tabs a.coach .label { display: none; }
#tabs a.coach .wordmark { width: 46px; height: 46px; color: var(--text); }
#tabs a.coach.active .wordmark { color: var(--accent); }
#tabs a.coach .badge { margin-left: 20px; }

/* ---------- ... and a sidebar on a wide screen, with today's facts under it ---------- */
@media (min-width: 900px) {
  body { padding-left: var(--side); }
  body.signed-out { padding-left: 0; }
  .page { padding-bottom: 48px; }
  main.chat { height: 100dvh; max-width: 752px; }        /* a 720 px column inside its 16 px gutters */
  #messages { gap: 18px; }
  .navbar { display: none; }
  #conversation { padding-top: 24px; }
  #composer { padding-bottom: 24px; }
  #tabs { top: 0; right: auto; width: var(--side); padding: 20px 12px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto;
             background: var(--cell); -webkit-backdrop-filter: none; backdrop-filter: none; border-top: none; border-right: .5px solid var(--line); }
  #tabs .brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
  #tabs .brand .wordmark { width: 32px; height: 32px; }
  #tabs .tablist { flex-direction: column; gap: 2px; }
  #tabs a { flex: none; height: 44px; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 12px; border-radius: 10px;
               color: var(--text); font-size: 15px; line-height: 20px; }
  #tabs a .icon { color: var(--muted); }
  #tabs a .label { flex: 1; }
  #tabs a.active { background: var(--fill); color: var(--text); }
  #tabs a.active .icon { color: var(--accent); }
  #tabs .badge, #tabs a.coach .badge { position: static; margin: 0; }
  #tabs a.coach .wordmark { display: none; }
  #tabs a.coach .icon { display: block; }
  #tabs a.coach .label { display: inline; }
  #tabs #side-today { display: flex; }
  #tabs #side-today > h2 { padding: 0 12px; }
  #tabs #side-today .list { background: var(--bg); }
  .banner { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; background: var(--cell);
            color: var(--text); text-decoration: none; font-size: 15px; line-height: 20px; }
  .banner .grow { display: flex; flex-direction: column; }
  .banner .chevron { width: 16px; height: 16px; stroke-width: 2.2; color: var(--muted); }
}
