/* Layout concept: a coaching "control room" — a quiet ink rail for navigation, a cool working
   canvas, and one cobalt signal colour for anything you can act on. Numbers set in mono so weeks line up. */
:root {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #151a2d;
  --muted: #5b627e;
  --faint: #8c92ab;
  --line: #dde0ea;
  --accent: #2c43c4;
  --accent-ink: #ffffff;
  --accent-soft: #e5e9fb;
  --rail: #151a2d;
  --rail-ink: #c9cee3;
  --rail-active: #ffffff;
  --signal: #e59a0b;
  --signal-soft: #fdf1d8;
  --good: #1d8452;
  --good-soft: #def3e8;
  --warn: #b86e00;
  --bad: #c03a3a;
  --bad-soft: #fae3e3;
  --shadow: 0 1px 2px rgba(21, 26, 45, .06), 0 4px 16px rgba(21, 26, 45, .05);
  --f-display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --f-body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1120; --surface: #161a2c; --surface-2: #1b2034; --ink: #e8eaf4; --muted: #a0a6c2; --faint: #747b99;
    --line: #2a3050; --accent: #8597ff; --accent-ink: #0e1120; --accent-soft: #232a55; --rail: #0a0d18; --rail-ink: #a7adc8;
    --rail-active: #ffffff; --signal: #f4b443; --signal-soft: #3a2f16; --good: #4cc48a; --good-soft: #17352a; --warn: #f0a33a;
    --bad: #ff7b7b; --bad-soft: #3b1f24; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1120; --surface: #161a2c; --surface-2: #1b2034; --ink: #e8eaf4; --muted: #a0a6c2; --faint: #747b99;
  --line: #2a3050; --accent: #8597ff; --accent-ink: #0e1120; --accent-soft: #232a55; --rail: #0a0d18; --rail-ink: #a7adc8;
  --rail-active: #ffffff; --signal: #f4b443; --signal-soft: #3a2f16; --good: #4cc48a; --good-soft: #17352a; --warn: #f0a33a;
  --bad: #ff7b7b; --bad-soft: #3b1f24; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 700; letter-spacing: -.01em; margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, .mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .85rem; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--rail-active); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; font: 700 15px var(--f-display); flex: none; }
.brand-name { font: 700 1rem/1.15 var(--f-display); }
.brand-sub { font-size: .72rem; color: var(--rail-ink); opacity: .8; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--rail-ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); color: var(--rail-active); }
.nav a.on { background: rgba(255,255,255,.1); color: var(--rail-active); }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rail-ink); opacity: .6; padding: 0 10px 4px; }
.nav-badge { background: var(--signal); color: #1d1500; border-radius: 99px; font: 600 .7rem var(--f-mono); padding: 1px 7px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; font-size: .82rem; padding: 0 8px; }
.rail-foot button { background: none; border: 0; color: var(--rail-ink); text-align: left; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.main { min-width: 0; padding-block: 28px 64px; padding-inline: clamp(16px, 3.4vw, 44px); }
.page { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.page-head .sub { color: var(--muted); margin-top: 6px; }
.demo-bar { background: var(--signal-soft); color: var(--ink); border-bottom: 1px solid var(--line); padding: 8px 16px; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; }
.demo-bar button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 10px; cursor: pointer; font-size: .8rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; padding: 12px 16px; gap: 10px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .nav-label, .rail-foot .who { display: none; }
  .rail-foot { flex-direction: row; gap: 14px; margin-top: 0; }
  h1 { font-size: 1.5rem; }
}

/* ---------- building blocks ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.spread { justify-content: space-between; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 6px; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn[disabled] { opacity: .55; cursor: default; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }

.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 2px 9px; font-size: .75rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pc, var(--faint)); }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--signal-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; min-width: 0; }
label.f .hint { font-weight: 400; color: var(--muted); font-size: .78rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; font-weight: 400; font-size: .92rem; min-width: 0;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fgrid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.fgrid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 16px; margin: 0; min-width: 0; }
legend { padding: 0 6px; font: 700 .95rem var(--f-display); display: flex; align-items: center; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.scale { display: flex; gap: 6px; flex-wrap: wrap; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: inline-grid; place-items: center; min-width: 38px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--f-mono); }
.scale input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 18px; padding-bottom: 6px; }

/* row editor */
.re { overflow-x: auto; }
.re table { width: 100%; border-collapse: collapse; min-width: 560px; }
.re th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 6px 6px; font-weight: 600; }
.re td { padding: 3px; vertical-align: top; }
.re td input, .re td select, .re td textarea { font-size: .86rem; padding: 6px 8px; }
.re td textarea { min-height: 36px; }
.re .x { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 1.1rem; padding: 6px; }
.re .x:hover { color: var(--bad); }

/* stat tiles */
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .k { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tile .v { font: 600 1.5rem/1.1 var(--f-mono); font-variant-numeric: tabular-nums; }
.tile .d { font: 500 .78rem var(--f-mono); }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--muted); }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl td.n { font-family: var(--f-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.tbl th.n { text-align: right; }
table.tbl tr:last-child td { border-bottom: 0; }

/* bars */
.bar { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.good > i { background: var(--good); }
.bar.warn > i { background: var(--signal); }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; }
.meter-row .bar { grid-column: 1 / -1; }

/* client cards */
.ccard { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; }
.ccard:hover { border-color: var(--accent); }
.ccard .who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 1rem var(--f-display); flex: none; }
.dots { display: flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.dots i.on { background: var(--accent); border-color: var(--accent); }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--signal-soft); }
.flag b { font-weight: 600; }

/* entries */
.entry { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.entry.unreviewed { border-left: 4px solid var(--signal); }
.entry-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.posts { display: flex; flex-direction: column; gap: 6px; }
.post { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: .9rem; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); max-width: 680px; }
.msg.coach { background: var(--accent-soft); border-color: transparent; }
.msg .meta { font-size: .75rem; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply { display: flex; flex-direction: column; gap: 8px; }

/* plan */
.pillar { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.pillar:first-child { border-top: 0; }
.pillar .share { font: 600 1.35rem var(--f-mono); color: var(--accent); }
.cal { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.calday { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; background: var(--surface); }
.calday.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.calday.done { opacity: .62; }
.calday .d { font: 600 .78rem var(--f-mono); color: var(--muted); white-space: nowrap; }
.list-plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task.done .t { text-decoration: line-through; color: var(--muted); }

.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.chart-box { position: relative; height: 220px; }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(100%, 420px); display: flex; flex-direction: column; gap: 18px; }
.auth-card .brand { color: var(--ink); padding: 0; }
.auth-card .brand-sub { color: var(--muted); }
.err { color: var(--bad); font-size: .88rem; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: .9rem; z-index: 50; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.live-metrics { display: grid; gap: 6px 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); background: var(--surface-2); border-radius: 8px; padding: 12px; margin-top: 12px; }
.live-metrics div { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; }
.live-metrics b { font-family: var(--f-mono); font-weight: 600; }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .88rem; }
.guide-metric { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 4px 18px; }
@media (max-width: 640px) { .guide-metric { grid-template-columns: minmax(0, 1fr); } .kv { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- clients list ---------- */
.d-block { display: block; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 7px; font: 600 .85rem var(--f-body); color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }
.clist { padding: 0; overflow: hidden; }
.crow { display: grid; grid-template-columns: minmax(170px, 1.5fr) minmax(110px, 1.1fr) minmax(120px, 1.2fr) minmax(90px, .8fr) minmax(150px, 1.2fr) minmax(90px, .8fr) auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow:not(.crow-head):hover { background: var(--surface-2); }
.crow-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding-block: 10px; background: var(--surface-2); }
.crow-who { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.crow-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crow-cell { min-width: 0; font-size: .9rem; }
.crow-cell .lbl { display: none; }
.crow-act { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 1100px) {
  .crow-head { display: none; }
  .crow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; padding: 16px; }
  .crow-who, .crow-act { grid-column: 1 / -1; }
  .crow-act { justify-content: flex-start; }
  .crow-cell { display: flex; flex-direction: column; gap: 3px; }
  .crow-cell .lbl { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
}
.pay-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; }
.pay-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 44px; }
.pay-row:last-child { border-bottom: 0; }
[hidden] { display: none !important; }

/* ---------- client view (preview) ---------- */
.tabs a.tab-preview { color: var(--accent); }
.pv-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; background: var(--accent-soft); border-radius: var(--r); padding: 14px 16px; }
.pv-bar-txt { display: flex; flex-direction: column; gap: 3px; max-width: 640px; }
.pv-switch { min-width: 200px; }
.pv-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(20, 26, 60, .12); background: var(--bg); }
.pv-chrome { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pv-dots { display: flex; gap: 5px; } .pv-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.pv-url { flex: 1; min-width: 0; font: .78rem var(--f-mono); color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 4px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 560px; }
.pv-rail { position: static; height: auto; }
.pv-main { min-width: 0; padding: 22px clamp(14px, 2.4vw, 30px) 40px; }
.pv-main .page { max-width: none; }
.pv-main [inert] { cursor: default; }
@media (max-width: 860px) {
  .pv-shell { grid-template-columns: minmax(0, 1fr); }
  .pv-rail { padding: 10px 12px; gap: 8px; }
  .pv-rail .nav { flex-direction: row; overflow-x: auto; }
  .pv-chrome .chip { display: none; }
}

/* ---------- client-changed calendar ideas ---------- */
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.calday { align-items: flex-start; }
.calday.changed { border-color: var(--warn); border-style: dashed; }
.idea-orig { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--line); padding-top: 6px; }
.idea-orig .chip { align-self: flex-start; white-space: normal; }
.idea-orig s { color: var(--muted); text-decoration-thickness: 1px; display: block; }
.idea-form { border-top: 1px solid var(--line); padding-top: 8px; }
.idea-form textarea { min-height: 70px; }
.flagbox { background: var(--signal-soft); border-radius: 10px; padding: 12px 14px; }
.idea-row { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.idea-row .d { font: 600 .78rem var(--f-mono); color: var(--muted); }

/* ---------- how it works ---------- */
.hw-rhythm { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.hw-rhythm > div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.hw-steps { display: grid; gap: 16px 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
.hw-step { display: flex; gap: 12px; align-items: flex-start; }
.hw-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 700 .85rem var(--f-mono); }
.hw-step .list-plain { margin: 0; }
.rules { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 12px; }
.rules li::marker { font-family: var(--f-mono); color: var(--accent); font-weight: 700; }
.rules p { margin: 3px 0 0; color: var(--muted); }

/* ---------- calendar months + locking ---------- */
.cal-month + .cal-month { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.cal-month-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.locked-month { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.locked-month .lock { font-size: 1.1rem; }
.acc-row { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .acc-row { grid-template-columns: 1fr auto; } .acc-row > :last-child { grid-column: 1 / -1; justify-content: flex-start !important; } }

/* ---------- platform tabs ---------- */
.plat-tabs { flex-wrap: wrap; align-self: flex-start; }
.plat-tabs button, .seg button { display: inline-flex; align-items: center; gap: 6px; }
.plat-tabs .dot { width: 8px; height: 8px; border-radius: 50%; }
.seg { flex-wrap: wrap; }

/* ---------- coach calendar editor ---------- */
.ce-filters { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 8px 0; border-bottom: 1px solid var(--line); }
.ce-month + .ce-month { margin-top: 18px; }
.ce-mhead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.ce-row { display: grid; grid-template-columns: 150px 140px 190px minmax(0, 1fr) 70px; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.ce-row:has(input[type=hidden][data-ce=platform]) { grid-template-columns: 150px 190px minmax(0, 1fr) 70px; }
.ce-when { display: flex; flex-direction: column; gap: 4px; }
.ce-day { font: 600 .78rem var(--f-mono); color: var(--muted); }
.ce-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ce-f > span:first-child { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.ce-row input, .ce-row select, .ce-row textarea { font-size: .88rem; padding: 6px 8px; }
.ce-changed { color: var(--warn); }
.ce-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ce-side .x { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 1.2rem; padding: 2px 6px; }
.ce-side .x:hover { color: var(--bad); }
@media (max-width: 900px) {
  .ce-row, .ce-row:has(input[type=hidden][data-ce=platform]) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ce-item { grid-column: 1 / -1; }
  .ce-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}
