/* Stridewise — map-paper & pine. Session colours belong to the user, so chrome stays quiet. */
:root {
  --paper: #eef2ef;
  --surface: #ffffff;
  --surface-2: #f6f8f6;
  --ink: #15292b;
  --ink-2: #4b5f60;
  --ink-3: #7d8e8e;
  --line: #d6dfdb;
  --pine: #1e6b52;
  --pine-ink: #ffffff;
  --waymark: #f2c230;
  --waymark-soft: rgba(242, 194, 48, .22);
  --danger: #b42318;
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --shadow: 0 1px 2px rgba(21, 41, 43, .08), 0 8px 24px rgba(21, 41, 43, .10);
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --sidebar: 360px;
  --race-a: #be123c;
  --race-b: #c2410c;
  --race-c: #f2c230;
  --topbar: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1b1d; --surface: #152427; --surface-2: #1b2d30; --ink: #e5eeec; --ink-2: #a9bbb8; --ink-3: #7b8f8c;
    --line: #2a3e41; --pine: #3fa682; --pine-ink: #06170f; --waymark-soft: rgba(242, 194, 48, .16); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1b1d; --surface: #152427; --surface-2: #1b2d30; --ink: #e5eeec; --ink-2: #a9bbb8; --ink-3: #7b8f8c;
  --line: #2a3e41; --pine: #3fa682; --pine-ink: #06170f; --waymark-soft: rgba(242, 194, 48, .16); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--paper); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pine); }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-cond); font-weight: 700; letter-spacing: .01em; margin: 0; line-height: 1.1; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer;
  font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink);
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 14px; }
.btn.icon { width: 38px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: .5; cursor: default; }

label.field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
label.field small { font-weight: 400; color: var(--ink-3); }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); font-weight: 400; color: var(--ink);
}
textarea { min-height: 80px; resize: vertical; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--pine); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: start; }
.grid-name { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: start; }
.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.hint { font-size: 14px; color: var(--ink-3); margin: 0; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; min-height: 36px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- auth */
#auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(ellipse at 20% 10%, transparent 0 38%, var(--line) 38.2% 38.6%, transparent 38.8% 46%, var(--line) 46.2% 46.6%, transparent 46.8% 54%, var(--line) 54.2% 54.6%, transparent 54.8%),
  radial-gradient(ellipse at 85% 90%, transparent 0 22%, var(--line) 22.2% 22.6%, transparent 22.8% 30%, var(--line) 30.2% 30.6%, transparent 30.8%),
  var(--paper); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--radius-l); padding: 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand span { font-family: var(--font-cond); font-weight: 700; font-size: 26px; letter-spacing: .01em; }
.auth-card .brand { margin-bottom: 6px; }
.auth-card .lede { color: var(--ink-2); margin: 0 0 20px; }
.auth-card form { display: grid; gap: 14px; }
.auth-switch { margin-top: 16px; font-size: 15px; color: var(--ink-2); text-align: center; }
.auth-switch button { background: none; border: 0; color: var(--pine); font-weight: 700; cursor: pointer; padding: 0; }
.banner { background: var(--waymark-soft); border-left: 4px solid var(--waymark); padding: 10px 12px; border-radius: var(--radius-s); margin-bottom: 16px; font-size: 15px; }
.error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }

/* ---------------------------------------------------------------- app shell */
#app { height: 100%; display: grid; grid-template-rows: var(--topbar) 1fr; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.topbar .brand span { font-size: 22px; }
.period { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
#calTitle { font-family: var(--font-cond); font-weight: 700; font-size: 26px; margin: 0 8px; white-space: nowrap; letter-spacing: .01em; }
.badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--waymark); color: #15292b; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.has-badge { position: relative; }

.layout { position: relative; display: flex; min-height: 0; overflow: hidden; }
.cal-wrap { flex: 1; padding: 12px 40px 16px 16px; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#calendar { flex: 1; min-height: 0; background: var(--surface); border-radius: var(--radius-m); border: 1px solid var(--line); padding: 4px; }
.mobile-only { display: none !important; }

/* ---------------------------------------------------------------- sidebar */
/* side panels: the main panel pushes the calendar over; the groups panel slides out over the calendar beside it */
.side-panel { position: relative; background: var(--surface); border-left: 1px solid var(--line); min-height: 0; }
#sidebar { flex: none; width: var(--sidebar); z-index: 6; transition: width .26s cubic-bezier(.3,.7,.3,1), margin .26s; }
.sb-closed #sidebar { width: 0; border-left-color: transparent; }
.panel-inner { position: absolute; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#sidebar .panel-inner { transition: transform .26s cubic-bezier(.3,.7,.3,1); }
.sb-closed #sidebar .panel-inner { transform: translateX(30px); }
.sub-panel { position: absolute; top: 0; bottom: 0; right: var(--sidebar); width: var(--sidebar); z-index: 5; box-shadow: -10px 0 30px rgba(15,27,29,.12);
  transform: translateX(100%); visibility: hidden; transition: transform .28s cubic-bezier(.3,.7,.3,1), visibility 0s linear .28s, right .26s; }
.sub-panel .panel-inner { width: 100%; }
.sb-closed .sub-panel { right: 0; }
.groups-open .sub-panel { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.3,.7,.3,1), visibility 0s, right .26s; }
.ex-tab:not(.sb-closed) .sub-panel { visibility: visible; }
.ex-tab:not(.sb-closed):not(.groups-open) .sub-panel { box-shadow: none; }

/* edge toggles: tabs sticking out of each panel's left edge */
.edge-toggle { position: absolute; left: -30px; width: 30px; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface); color: var(--ink-2); cursor: pointer;
  box-shadow: -3px 2px 8px rgba(15,27,29,.08); font: 700 12px/1 var(--font); letter-spacing: .02em; z-index: 2; }
.edge-toggle:hover { color: var(--ink); background: var(--surface-2); }
.edge-toggle span:not(.badge) { writing-mode: vertical-rl; transform: rotate(180deg); }
.edge-toggle svg { transition: transform .26s; transform: rotate(180deg); }
.edge-main { top: 14px; }
.groups-open .edge-main { visibility: hidden; }
.sb-closed .edge-main svg { transform: none; }
.edge-groups { top: 118px; visibility: hidden; }
.ex-tab:not(.sb-closed) .edge-groups { visibility: visible; }
.groups-open .edge-groups svg { transform: rotate(180deg); }
.edge-groups svg { transform: none; }
.edge-toggle .badge { position: static; margin-top: 2px; }
.edge-toggle:focus-visible { outline-offset: -2px; }

.sb-tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; padding: 0 8px; }
.sb-tabs button { flex: 1; border: 0; background: none; padding: 13px 4px 10px; font: 700 15px var(--font); color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; }
.sb-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pine); }
.sb-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; }
.sb-pane[data-pane="plan"] { overflow: hidden; }
.pane-head { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px 10px; }
.pane-head > div { flex: 1; min-width: 0; }
.pane-head h2 { font-size: 24px; }
.pane-head .hint { margin-top: 2px; }
#gpBody { overflow-y: auto; }

/* races */
.sb-month { padding: 12px 16px 4px; font: 700 15px var(--font-cond); color: var(--ink-2); letter-spacing: .02em; }
.race-card { display: flex; gap: 12px; width: calc(100% - 24px); margin: 4px 12px; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; color: var(--ink); font: inherit; }
.race-card:hover { border-color: var(--ink-3); }
.race-card.past { opacity: .6; }
.race-date { flex: none; width: 44px; display: grid; justify-items: center; align-content: start; padding-top: 2px; }
.race-date b { font: 700 28px/1 var(--font-cond); }
.race-date span { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.race-body { display: grid; gap: 5px; min-width: 0; }
.race-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.race-facts { display: flex; flex-wrap: wrap; gap: 4px; }
.race-when { font-size: 13px; color: var(--ink-2); }
.prio { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 5px; font: 700 12px/1 var(--font); color: #fff; }
.prio-A { background: var(--race-a); } .prio-B { background: var(--race-b); } .prio-C { background: var(--race-c); color: #15292b; }
.prio-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 12px 16px; font-size: 12px; color: var(--ink-3); }
.prio-key .prio { width: 16px; height: 16px; font-size: 10px; margin-left: 4px; }
.past-races { margin: 4px 0 16px; }
.past-races summary { padding: 8px 16px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.callout { margin: 4px 12px 8px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--waymark-soft); border: 1px solid var(--waymark); display: grid; gap: 6px; justify-items: start; font-size: 14px; }
.prio-pick { display: grid; gap: 8px; }
.prio-pick label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.prio-pick label:has(input:checked) { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.prio-pick input { margin-top: 3px; accent-color: var(--pine); }
.prio-pick small { display: block; color: var(--ink-3); font-size: 13px; }
.next-race .countdown small { display: block; margin: 4px 0 0; font-size: 15px; }
.plan-warn { background: var(--waymark-soft); border-radius: var(--radius-s); padding: 8px 10px; font-size: 13px; display: grid; gap: 6px; }
.plan-warn p { margin: 0; }
.warn-btn { color: #8a6a00; }
.week-table tr.rec td { background: var(--surface-2); color: var(--ink-2); }
.week-table tr.race td { background: rgba(190, 18, 60, .08); font-weight: 600; }
.season-races .prio { margin-top: 2px; }

/* exercises */
.ex-tools { padding: 0 16px 8px; display: grid; gap: 8px; }
.cat-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.cat-chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.cat-chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-list { display: grid; padding-bottom: 8px; }
.ex-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 6px; border-top: 1px solid var(--line); cursor: grab; user-select: none; -webkit-user-select: none; }
.ex-row:hover { background: var(--surface-2); }
.ex-row.dragging, .gi.dragging { opacity: .35; }
.ex-body { flex: 1; min-width: 0; display: grid; }
.ex-body .t { font-weight: 600; }
.ex-body .s { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grip { color: var(--ink-3); font-size: 14px; letter-spacing: -2px; padding: 6px 4px; cursor: grab; touch-action: none; }
.in-group { color: var(--pine); font-size: 10px; }
.ex-new { margin: 4px 16px 20px; }
.ex-new summary { cursor: pointer; font-weight: 600; color: var(--pine); padding: 6px 0; }
.ex-menu { position: fixed; z-index: 60; width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; }
.ex-menu p { margin: 0 4px 4px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.ex-menu > button { display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 8px; border-radius: var(--radius-s); cursor: pointer; font-weight: 600; }
.ex-menu > button:hover { background: var(--surface-2); }
.ex-menu form { display: flex; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.ex-menu form input { min-height: 32px; padding: 4px 8px; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* groups panel */
.gp-new { padding: 0 16px 10px; flex-wrap: nowrap; }
.gp-list { padding: 0 12px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.gcard { border: 1px solid var(--line); border-left: 5px solid var(--gc); border-radius: var(--radius-m); background: var(--surface); transition: box-shadow .15s, border-color .15s; }
.gcard.drop-on { border-color: var(--gc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gc) 30%, transparent); }
.gcard-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 6px; }
.gcal { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; background: color-mix(in srgb, var(--gc) 16%, transparent); color: var(--gc); cursor: grab; flex: none; }
.gname { flex: 1; min-width: 0; border: 1px solid transparent !important; background: transparent !important; font: 700 17px var(--font-cond) !important; padding: 2px 6px !important; min-height: 32px !important; }
.gname:hover, .gname:focus { border-color: var(--line) !important; background: var(--surface) !important; }
.gcolour { width: 30px !important; height: 30px !important; }
.gitems { padding: 2px 8px 6px; display: grid; gap: 4px; min-height: 40px; }
.gi { display: flex; align-items: center; gap: 3px; padding: 4px 2px 4px 0; min-width: 0; border-radius: var(--radius-s); background: var(--surface-2); }
.gi .n { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi input { width: 42px; min-height: 28px !important; padding: 2px 4px !important; text-align: center; font-size: 13px; }
.gi input.reps { width: 68px; }
.gi .btn.icon.small { width: 26px; min-height: 26px; }
.gi .x { color: var(--ink-3); font-size: 12px; }
.gi-ph { height: 30px; border: 2px dashed var(--gc, var(--pine)); border-radius: var(--radius-s); background: color-mix(in srgb, var(--gc, var(--pine)) 8%, transparent); }
.drop-hint { font-size: 13px; color: var(--ink-3); text-align: center; padding: 6px; border: 1px dashed transparent; border-radius: var(--radius-s); }
.gitems:has(.gi) .drop-hint { padding: 2px; font-size: 12px; }
.dnd-active .gitems .drop-hint { border-color: var(--line); }
.gcard footer { padding: 6px 8px 8px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.gcard { min-width: 0; }
.gcard-head .btn.icon { width: 30px; }
.gcard footer input[type=date] { width: auto; min-height: 30px; padding: 2px 6px; font-size: 13px; }
.dnd-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; background: var(--ink); color: var(--paper); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); white-space: nowrap; }
body.dnd-active { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* race days on the calendar */
.fc .race-day { opacity: 1; background: color-mix(in srgb, var(--race-a) 14%, transparent) !important; }
.fc .race-day.race-B { background: color-mix(in srgb, var(--race-b) 14%, transparent) !important; }
.fc .race-day.race-C { background: color-mix(in srgb, var(--race-c) 22%, transparent) !important; }
.fc .race-day .fc-event-title { font-style: normal; font-weight: 700; font-size: 11px; color: var(--ink); margin: 0; padding: 2px 4px; }
.sb-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.sb-head select { font-weight: 600; flex: 1; width: auto; min-width: 0; }
.sb-head .row { flex-wrap: wrap; }
.race-meta { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.countdown { font-family: var(--font-cond); font-weight: 700; font-size: 34px; line-height: 1; }
.countdown small { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }
.race-facts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.profile { position: relative; }
.profile svg { width: 100%; height: 74px; display: block; }
.profile .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.sb-range { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.sb-range strong { font-family: var(--font-cond); font-size: 19px; }
.sb-list { flex: 1; overflow-y: auto; padding: 4px 0 24px; overscroll-behavior: contain; }
.sb-day { padding: 10px 16px 2px; font-size: 13px; font-weight: 700; color: var(--ink-3); display: flex; justify-content: space-between; }
.sb-week { margin: 12px 16px 0; padding: 4px 0; border-top: 2px solid var(--ink); display: flex; justify-content: space-between; font-family: var(--font-cond); font-size: 17px; font-weight: 700; }
.sb-week > span:first-child small { display: block; font: 600 13px var(--font); color: var(--ink-3); margin-top: 1px; }
.pi { display: flex; gap: 10px; margin: 4px 12px; padding: 8px 10px; border-radius: var(--radius-s); background: var(--surface); border: 1px solid var(--line); cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.pi:hover { border-color: var(--ink-3); }
.pi .bar { width: 5px; border-radius: 3px; flex: none; }
.pi .body { min-width: 0; flex: 1; }
.pi .t { font-weight: 600; line-height: 1.25; }
.pi .m { display: flex; gap: 10px; font-size: 13px; color: var(--ink-3); margin-top: 2px; flex-wrap: wrap; }
.pi.done { cursor: pointer; opacity: .55; background: var(--surface-2); }
.pi.done .t::after { content: " ✓"; color: var(--pine); }
.pi.dragging { opacity: .4; }
.sb-empty { padding: 28px 20px; text-align: center; color: var(--ink-2); display: grid; gap: 12px; justify-items: center; }
.sb-empty h3 { font-size: 22px; color: var(--ink); }
.invites { margin: 10px 12px 4px; border: 1px solid var(--waymark); background: var(--waymark-soft); border-radius: var(--radius-m); padding: 10px 12px; display: grid; gap: 8px; }
.invites h3 { font-size: 18px; }
.inv { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.08); }
.inv:first-of-type { border-top: 0; padding-top: 0; }
.inv .t { font-weight: 600; }

/* ---------------------------------------------------------------- calendar skin */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2);
  --fc-today-bg-color: var(--waymark-soft); --fc-list-event-hover-bg-color: var(--surface-2); --fc-event-border-color: transparent;
  --fc-highlight-color: var(--waymark-soft); font-size: 14px; }
.fc .fc-scrollgrid { border-radius: var(--radius-s); }
.fc .fc-col-header-cell-cushion { font-weight: 700; color: var(--ink-2); padding: 6px 4px; text-decoration: none; }
.fc .fc-daygrid-day-number { font-family: var(--font-cond); font-weight: 700; font-size: 17px; color: var(--ink-2); text-decoration: none; padding: 4px 6px; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--waymark); color: #15292b; border-radius: 6px; }
.fc .fc-day-other .fc-daygrid-day-number { opacity: .45; }
.fc a { color: inherit; }
.fc-event { cursor: pointer; border-radius: 5px; }
.fc .fc-daygrid-event { padding: 1px 4px; margin-top: 2px; }
.ev { display: flex; align-items: center; gap: 4px; overflow: hidden; width: 100%; font-weight: 600; line-height: 1.25; }
.ev .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .kk { opacity: .85; font-weight: 500; white-space: nowrap; }
.ev .ic { flex: none; }
.ev-invited { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 6px, transparent 6px 12px) !important; }
.ev-pending { opacity: .7; outline: 2px dashed currentColor; outline-offset: -2px; }
.ev-done { opacity: .78; }
.ev-done .tt { text-decoration: none; }
.ev-done .ic { background: #15803d; color: #fff; border-radius: 50%; display: grid; place-items: center; width: 14px; height: 14px; }
.ev-done .ic svg { width: 10px; height: 10px; }
.fc-list-event .ev { color: var(--ink); }
.fc .fc-list-day-cushion { background: var(--surface-2); }
.fc .fc-more-link { font-weight: 700; color: var(--ink-2); }
.fc-event-dragging { box-shadow: var(--shadow); }
.fc .fc-timegrid-slot { height: 2.2em; }

/* ---------------------------------------------------------------- dialogs */
dialog { border: 0; padding: 0; border-radius: var(--radius-l); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: rgba(15, 27, 29, .45); }
dialog[open] { display: flex; flex-direction: column; animation: pop .16s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { dialog[open] { animation: none; } }
.dlg-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { font-size: 24px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dlg-body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 16px; grid-auto-rows: max-content; align-content: start; flex: 1 1 auto; min-height: 0; }
.dlg-foot { flex: none; display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
dialog.wide { width: min(920px, calc(100vw - 32px)); }

.type-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pick button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px 4px 6px; cursor: pointer; font-size: 14px; font-weight: 600; }
.type-pick button .sw { width: 14px; height: 14px; border-radius: 50%; }
.type-pick button[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.section-t { font-family: var(--font-cond); font-size: 19px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.desc { background: var(--surface-2); border-radius: var(--radius-m); padding: 12px 14px; display: grid; gap: 8px; }
.desc p { margin: 0; }
.desc ol { margin: 0; padding-left: 20px; }
.ex-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ex-table th { text-align: left; font-size: 13px; color: var(--ink-3); font-weight: 600; padding: 4px 6px; }
.ex-table td { padding: 4px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.ex-table td input { min-height: 34px; padding: 4px 8px; }
.ex-table .num { width: 70px; }
.ex-table .rm { width: 36px; }
.people { display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.status { font-size: 13px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.status.going { background: rgba(30, 107, 82, .15); color: var(--pine); }
.status.declined { color: var(--danger); }
.pick-list { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px; }

.tabs { flex: none; display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 700; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--pine); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 600; }
.list-row .s { font-size: 14px; color: var(--ink-3); }
.link-box { display: flex; gap: 6px; }
.link-box input { font-size: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; display: grid; gap: 10px; }

.week-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.week-table th { text-align: left; color: var(--ink-3); font-weight: 600; padding: 4px 6px; }
.week-table td { padding: 5px 6px; border-top: 1px solid var(--line); }
.week-table td.n { font-variant-numeric: tabular-nums; text-align: right; }
.week-table tr.taper td { background: var(--waymark-soft); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-m); box-shadow: var(--shadow); font-weight: 600; z-index: 100; max-width: calc(100vw - 32px); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) { :root { --sidebar: 320px; } .topbar .brand span { display: none; } }
@media (max-width: 860px) {
  :root { --topbar: 104px; }
  .topbar { flex-wrap: wrap; align-content: center; row-gap: 6px; padding: 6px 10px; }
  .topbar .brand { display: none; }
  .period { margin-left: 0; order: 1; flex: 1; min-width: 0; }
  #calTitle { font-size: 21px; overflow: hidden; text-overflow: ellipsis; margin: 0 4px; }
  .period .btn.icon { width: 30px; }
  #todayBtn { padding: 0 8px; }
  .topbar .actions { gap: 4px; }
  .topbar .actions { order: 2; }
  .topbar .seg { order: 3; width: 100%; }
  .topbar .seg button { flex: 1; padding: 0 4px; }
  .cal-wrap { padding: 8px 36px 8px 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .mobile-only { display: inline-flex !important; }
  .desktop-only { display: none !important; }
  :root { --sidebar: min(92vw, 380px); }
  #sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: var(--sidebar); z-index: 30; box-shadow: -10px 0 40px rgba(15,27,29,.25); transition: transform .26s cubic-bezier(.3,.7,.3,1); padding-top: env(safe-area-inset-top); }
  .sb-closed #sidebar { width: var(--sidebar); transform: translateX(100%); box-shadow: none; }
  .sb-closed #sidebar .panel-inner { transform: none; }
  .sub-panel { position: fixed; right: 0; width: var(--sidebar); z-index: 31; padding-top: env(safe-area-inset-top); }
  .edge-main { top: auto; bottom: calc(96px + env(safe-area-inset-bottom)); }
  .edge-groups { top: auto; bottom: calc(210px + env(safe-area-inset-bottom)); transition: left .28s; }
  .ex-tab:not(.sb-closed):not(.groups-open) .edge-groups { left: calc(-30px - var(--sidebar)); }
  .sb-closed .edge-main { box-shadow: -3px 2px 12px rgba(15,27,29,.22); }
  dialog, dialog.wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .fc { font-size: 12px; }
  .fc .fc-daygrid-day-number { font-size: 15px; }
  .fc .fc-daygrid-event { padding: 0 2px; }
  .ev .kk { display: none; }
}
@media (prefers-reduced-motion: reduce) { #sidebar, #sidebar .panel-inner, .sub-panel, .edge-toggle svg { transition: none !important; } }

/* ---------------------------------------------------------------- units: preferred unit, alternative underneath */
.u { display: inline-flex; flex-direction: column; line-height: 1.15; vertical-align: middle; }
.u small { font-size: .78em; font-weight: 500; color: var(--ink-3); }
.chip .u small { font-size: 11px; }
.pi .m { align-items: flex-start; }
.pi .m .u small { font-size: 11px; }
.sb-week .u { align-items: flex-end; }
.sb-week .u small { font-family: var(--font); font-size: 12px; }
.week-table td.n .u { align-items: flex-end; }
.profile .lbl .peak { display: inline-flex; gap: 8px; align-items: flex-start; }
.profile .lbl .u small { font-size: 10px; }
label.field > small[data-alt] { min-height: 1.2em; }


/* ---------------------------------------------------------------- forms: label on top, control, then hints underneath */
label.field > input, label.field > select, label.field > textarea, label.field > .with-unit { order: 1; }
label.field > small { order: 2; font-weight: 400; color: var(--ink-3); font-size: 12px; line-height: 1.3; }
label.field > small:empty { display: none; }
.dlg-body.compact { gap: 14px; }
.dlg-body.compact label.field { gap: 3px; font-size: 13px; }
.dlg-body.compact input[type=text], .dlg-body.compact input[type=number], .dlg-body.compact input[type=date], .dlg-body.compact input[type=time], .dlg-body.compact select { min-height: 38px; padding: 6px 10px; }
.dlg-body.compact .section-t { font-size: 17px; }
.dlg-body > section { display: grid; gap: 14px; }
.sub-block { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.sub-block .hint { margin-top: -4px; font-size: 13px; }
.seg.small button { min-height: 30px; padding: 0 10px; font-size: 13px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 14px; padding: 2px 0 6px; }
details.more textarea { min-height: 70px; }
.prio-pick { grid-template-columns: repeat(3, 1fr); }
.prio-pick label { padding: 8px 10px; gap: 8px; }
.prio-pick strong { font-size: 14px; }
.prio-pick small { font-size: 12px; line-height: 1.3; }
.prio-pick input { position: absolute; opacity: 0; pointer-events: none; }
.prio-pick label { position: relative; }
.prio-pick label:has(input:focus-visible) { outline: 2px solid var(--pine); outline-offset: 2px; }
dialog.narrow { width: min(460px, calc(100vw - 32px)); }

/* schedule editor */
.day-pick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-pick button { min-height: 40px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font-weight: 700; color: var(--ink-2); cursor: pointer; }
.day-pick button[aria-pressed="true"] { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.role-rows { display: grid; gap: 6px; }
.role-row { display: grid; grid-template-columns: 100px minmax(0, 250px) minmax(0, 150px) 1fr; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.role-row select { min-height: 34px !important; padding: 4px 8px !important; }
.role-row small { font-weight: 400; }
.sched-rows { display: grid; gap: 6px; }
.sched-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--surface-2); border-radius: var(--radius-s); }
.sched-row input, .sched-row select { width: auto; min-height: 34px !important; padding: 4px 8px !important; font-size: 14px; }
.sched-row input[data-k=label] { flex: 1 1 130px; min-width: 110px; }
.sched-row input[type=time] { width: 104px; }
.with-unit { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-3); }
.with-unit input { width: 76px !important; }

/* how-to */
.how-btn { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; border: 1.5px solid var(--pine);
  background: var(--surface); color: var(--pine); font: italic 700 12px/1 Georgia, serif; cursor: pointer; vertical-align: middle; padding: 0; }
.how-btn:hover { background: var(--pine); color: var(--pine-ink); }
.ex-name { display: flex; align-items: center; min-width: 0; }
.ex-name input { flex: 1; min-width: 0; }
.how-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-m); overflow: hidden; background: #000; }
.how-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.how-lede { margin: 0; color: var(--ink-2); }
.how-steps { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.how-mistake { display: grid; gap: 2px; padding: 10px 12px; border-left: 4px solid var(--waymark); background: var(--waymark-soft); border-radius: var(--radius-s); font-size: 14px; }
.chip.eq-home { background: #e0f2fe; color: #075985; border-color: #bae6fd; }
.chip.eq-gym { background: #fde68a55; color: #854d0e; border-color: #fcd34d; }
.list-row.dim { opacity: .55; }
.eq-note { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.linkish { border: 0; background: none; color: var(--pine); font-weight: 700; cursor: pointer; padding: 0; font-size: 13px; }
.radio-list { display: grid; gap: 6px; }
.radio-list.horiz { grid-template-columns: repeat(3, 1fr); }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; }
.radio-list label:has(input:checked) { border-color: var(--pine); box-shadow: inset 0 0 0 1px var(--pine); }
.radio-list input { margin-top: 3px; accent-color: var(--pine); }
.radio-list small { display: block; color: var(--ink-3); font-size: 12px; }
.warn-box { padding: 10px 12px; border-left: 4px solid var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-radius: var(--radius-s); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.wk-actions { display: flex; gap: 4px; justify-content: flex-end; margin: 0 12px; min-height: 0; }
.wk-actions:empty { display: none; }
.wk-actions .btn { min-height: 26px; padding: 0 8px; font-size: 12px; }

/* unit converter */
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.conv-side { display: grid; gap: 4px; }
.conv-unit { font: 700 15px var(--font-cond); color: var(--ink-2); letter-spacing: .02em; }
.conv input { font: 700 26px var(--font-cond) !important; min-height: 52px !important; width: 100%; }
.conv input:focus { border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 18%, transparent); outline: none; }
.conv output { display: flex; align-items: center; min-height: 52px; padding: 0 12px; border-radius: var(--radius-s); background: var(--surface-2); font: 700 26px var(--font-cond); }
.conv-swap { width: 44px; height: 44px; margin-bottom: 4px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--pine); cursor: pointer; display: grid; place-items: center; }
.conv-swap:hover { background: var(--surface-2); }
.conv-kinds { gap: 6px; }

/* print */
.print-head { display: none; }
/* while printing, lay the page out like paper on screen too, so the calendar is measured at full width */
body.printing { background: #fff !important; }
body.printing .topbar, body.printing #sidebar, body.printing #groupsPanel, body.printing .edge-toggle, body.printing #toast { display: none !important; }
body.printing #app { display: block; height: auto; }
body.printing .layout { display: block; overflow: visible; }
body.printing .cal-wrap { padding: 0 !important; max-width: 1100px; margin: 0 auto; }
body.printing #calendar { border: 0; padding: 0; }
body.printing .print-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; font-size: 12px; color: #444; }
@media print {
  body { background: #fff !important; }
  body.printing dialog { display: none !important; }
  body.printing .cal-wrap { max-width: none; }
  body.printing .print-head strong { font: 700 22px var(--font-cond); color: #000; }
  body.printing .fc { font-size: 10px; }
  body.printing .fc-event, body.printing .fc .race-day { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.printing .fc .fc-daygrid-day-frame { min-height: 0; }
  body.printing .fc-dayGridWeek-view .fc-daygrid-day-frame { min-height: 160mm; }
  body.printing .fc-dayGridTwoWeek-view .fc-daygrid-day-frame { min-height: 75mm; }
  body.printing .fc .fc-day-today { background: none !important; }
  body.printing .fc .fc-daygrid-event .ev .tt { white-space: normal; }
  body.printing.print-mono .fc-event { background: #fff !important; color: #000 !important; border: 1px solid #999 !important; }
  body.printing.print-mono .fc .race-day { background: #eee !important; }
}
@media (max-width: 860px) {
  .grid-name { grid-template-columns: 1fr; }
  .prio-pick, .radio-list.horiz { grid-template-columns: 1fr; }
  .role-row { grid-template-columns: 1fr 130px; row-gap: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line, rgba(0,0,0,.08)); }
  .role-row [data-role] { grid-column: 1 / 3; grid-row: 2; }
  .role-row [data-limit] { grid-column: 2; grid-row: 1; }
  .role-row small { grid-column: 1 / 3; }
  .role-row small:empty { display: none; }
  .conv input, .conv output { font-size: 22px !important; }
}

/* ---------------------------------------------------------------- session status on the calendar */
.ev { position: relative; }
.ev-acts { display: none; margin-left: auto; gap: 2px; flex: none; }
.ev-acts [data-ea] { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; background: rgba(255,255,255,.92); color: #15292b; cursor: pointer; }
.ev-acts [data-ea="done"]:hover { background: #dcfce7; color: #166534; }
.ev-acts [data-ea="missed"]:hover { background: #fee2e2; color: #b42318; }
.ev-acts [data-ea="info"]:hover { background: #e0f2fe; color: #075985; }
@media (hover: hover) and (min-width: 861px) { .fc-event:hover .ev-acts { display: inline-flex; } .fc-event:hover .ev .kk { display: none; } }
.fc-list-event .ev-acts { display: inline-flex; }
.fc-list-event .ev-acts [data-ea] { background: var(--surface-2); }
.ev-missed { opacity: .7; }
.ev-missed .tt { text-decoration: line-through; text-decoration-color: #b42318; text-decoration-thickness: 2px; }
.ev-missed .ic { color: #fff; background: #b42318; border-radius: 50%; display: grid; place-items: center; width: 14px; height: 14px; }
.ev-missed .ic svg { width: 10px; height: 10px; }

/* status, effort, pains */
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st svg { width: 12px; height: 12px; }
.st-done { background: #dcfce7; color: #166534; }
.st-missed { background: #fee2e2; color: #b42318; }
.st-none { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }
.effort { display: inline-flex; align-items: baseline; gap: 4px; font: 700 13px var(--font); padding: 2px 8px; border-radius: 999px; color: #15292b; white-space: nowrap; }
.effort small { font-weight: 600; font-size: 11px; opacity: .8; }
.effort.e0 { background: #d1fae5; } .effort.e1 { background: #bbf7d0; } .effort.e2 { background: #fef08a; }
.effort.e3 { background: #fed7aa; } .effort.e4 { background: #fca5a5; } .effort.e5 { background: #f87171; color: #fff; }
.pain { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.pain.sev-2 { background: #ffedd5; } .pain.sev-3 { background: #fee2e2; color: #b42318; border-color: #fca5a5; }
.btn.btn-done { background: #15803d; border-color: #15803d; color: #fff; }
.btn.btn-missed { background: var(--surface); border-color: #fca5a5; color: #b42318; }
.btn.btn-missed:hover { background: #fee2e2; }
.log-box { background: var(--surface-2); border-radius: var(--radius-m); padding: 10px 12px; display: grid; gap: 6px; }
.log-box p { margin: 0; }

/* exercise tick list */
.tick-list { display: grid; gap: 4px; margin-top: 6px; }
.tick { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); cursor: pointer; }
.tick input { width: 20px; height: 20px; margin-top: 1px; accent-color: #15803d; flex: none; }
.tick:has(input:checked) { background: #f0fdf4; border-color: #bbf7d0; }
.tick:has(input:checked) .t { text-decoration: line-through; color: var(--ink-3); }
.tick-body { display: grid; min-width: 0; }
.tick-body .t { font-weight: 600; display: flex; align-items: center; }
.tick-body .s { font-size: 13px; color: var(--ink-3); }

/* effort slider */
.effort-pick { display: grid; gap: 6px; }
.effort-pick input[type=range] { width: 100%; accent-color: var(--pine); height: 28px; }
.effort-scale { display: grid; grid-template-columns: repeat(6, 1fr); font-size: 12px; text-align: center; color: var(--ink-3); font-weight: 700; }
.effort-scale small { display: block; font-weight: 500; font-size: 11px; }
.effort-scale span:first-child { text-align: left; } .effort-scale span:last-child { text-align: right; }

/* ---------------------------------------------------------------- journal */
.journal-mode .period > .btn, .journal-mode .seg[aria-label="Calendar view"] { display: none !important; }
.btn.journal-btn[aria-pressed="true"], .btn.journal-btn[aria-pressed="true"]:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (max-width: 860px) { body.journal-mode { --topbar: 60px; } body.journal-mode .topbar { flex-wrap: nowrap; } }
#journal { flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px 24px; }
.j-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.j-tools select, .j-tools input { width: auto; min-height: 34px; padding: 4px 8px; }
.jstats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 14px; }
.jstat { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; }
.jstat b { display: block; font: 700 28px/1.05 var(--font-cond); }
.jstat b small { font-size: 16px; color: var(--ink-3); }
.jstat span { font-size: 13px; color: var(--ink-2); }
.jstat.ok b { color: #15803d; } .jstat.bad b { color: #b42318; }
.j-week { margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--ink); font: 700 17px var(--font-cond); }
.j-row { display: flex; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.j-row .bar { width: 5px; align-self: stretch; border-radius: 3px; flex: none; }
.j-row.jr-missed { background: linear-gradient(90deg, rgba(254,226,226,.55), transparent 45%); }
.j-row.jr-none .j-title { color: var(--ink-2); }
.j-date { width: 40px; flex: none; text-align: center; }
.j-date b { display: block; font: 700 24px/1 var(--font-cond); }
.j-date span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.j-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.j-title { border: 0; background: none; padding: 0; font: 700 16px var(--font); color: var(--ink); cursor: pointer; text-align: left; }
.j-title:hover { text-decoration: underline; }
.j-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--ink-3); align-items: flex-start; }
.j-notes { margin: 0; font-size: 14px; white-space: pre-wrap; }
.j-acts { display: flex; gap: 4px; flex: none; }
.j-acts .btn svg { width: 14px; height: 14px; }

/* effort graph */
.graph-wrap { overflow-x: auto; }
.effort-svg { width: 100%; min-width: 560px; height: auto; font-family: var(--font); }
.effort-svg .grid { stroke: var(--line); stroke-width: 1; }
.effort-svg .axis { stroke: var(--ink-3); }
.effort-svg .ylab, .effort-svg .xlab { font-size: 11px; fill: var(--ink-3); }
.effort-svg .avg { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.effort-svg .avglab { font-size: 11px; fill: var(--ink-2); font-weight: 600; }
.effort-svg .line { fill: none; stroke: var(--ink-3); stroke-width: 1.5; opacity: .6; }
.effort-svg .pt circle { stroke: var(--surface); stroke-width: 2; }
.effort-svg .plab { font-size: 10.5px; fill: var(--ink-2); font-weight: 600; }
.effort-svg .miss path { stroke: #b42318; stroke-width: 2.4; }

/* ---------------------------------------------------------------- printable documents */
#printDoc { display: none; }
body.printing-doc #app, body.printing-doc dialog, body.printing-doc #toast { display: none !important; }
body.printing-doc #printDoc { display: block; padding: 0; color: #111; background: #fff; font-size: 12px; max-width: 800px; margin: 0 auto; }
body.printing-doc { background: #fff; }
.pd-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 10px; }
.pd-head h1 { font-size: 26px; } .pd-head p { margin: 2px 0 0; color: #444; }
.pd-head span { text-align: right; color: #444; font-size: 11px; }
.pd-day { font-size: 17px; margin: 14px 0 4px; padding-bottom: 2px; border-bottom: 1px solid #bbb; break-after: avoid; }
.pd-session { padding: 6px 0 8px; break-inside: avoid; }
.pd-title { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pd-title em { font-style: normal; color: #555; font-size: 11px; border: 1px solid #ccc; border-radius: 9px; padding: 0 6px; }
.pd-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pd-box { display: inline-block; width: 13px; height: 13px; border: 1.5px solid #111; border-radius: 2px; flex: none; }
.pd-meta { color: #444; margin: 2px 0 0 0; }
.pd-session p, .pd-session ol { margin: 4px 0; }
.pd-session ol { padding-left: 18px; }
.pd-ex { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 11.5px; }
.pd-ex th { text-align: left; border-bottom: 1px solid #999; padding: 3px 4px; font-size: 10.5px; color: #444; }
.pd-ex td { border-bottom: 1px solid #ddd; padding: 4px; vertical-align: top; }
.pd-ex td:nth-child(3), .pd-ex th:nth-child(3) { white-space: nowrap; }
.pd-tick { width: 18px; }
.pd-need { font-size: 11px; color: #333; }
.pd-notes { font-style: italic; color: #333; }
.pd-lines { display: flex; gap: 24px; margin-top: 6px; color: #555; font-size: 11px; }
.pd-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; font-size: 12px; }
.pd-graph { margin: 6px 0 10px; break-inside: avoid; }
.pd-graph .effort-svg { min-width: 0; }
.pd-journal { width: 100%; border-collapse: collapse; font-size: 11px; }
.pd-journal th { text-align: left; border-bottom: 1px solid #999; padding: 4px; font-size: 10.5px; color: #444; }
.pd-journal td { border-bottom: 1px solid #ddd; padding: 4px; vertical-align: top; }
.pd-journal tr { break-inside: avoid; }
.pd-pain { color: #9a3412; margin-top: 2px; }
@media (max-width: 860px) {
  .j-row { flex-wrap: wrap; }
  .j-acts { width: 100%; justify-content: flex-end; }
  .journal-btn span { display: none; }
}
