/* ==========================================================================
   Gymveo · Live crowd + opening hours (crowd board "Affluence en direct").
   Loaded by both layouts after the surface CSS. Every class is prefixed cw-; the components come from
   components.css (.btn, .tag, .chips, .slip, .foot-note, .live-dot, .stamp) and the tokens from tokens.css.
   Pieces: meter (four inked blocks) · member card, pass line, detail · staff pill + popover, day rail, sign-in row ·
   owner tile, Affluence page with the typical-week heat map · settings (crowd, hours) · exit kiosk · print.
   ========================================================================== */

/* halftone of the usual crowd: cobalt dots on paper, sky dots on night */
.desk,.floor.paper,.floor.light,html[data-theme="light"] .floor,.onpaper{--cw-ht:url(#ht-c2)}
.floor,html[data-theme="dark"] .desk,.desk.dark{--cw-ht:url(#ht-s2)}
html[data-theme="light"] .floor,.floor.light,.floor.paper{--cw-ht:url(#ht-c2)}

/* ---------- the meter: four printed blocks, filled in ink up to the level ---------- */
.cw-meter{display:inline-flex;gap:3px;flex:none;vertical-align:middle}
.cw-meter i{width:22px;height:9px;border:1.5px solid var(--text);border-radius:2px}
.cw-meter i.f{background:var(--text)}
.cw-meter.sm i{width:14px;height:7px;border-width:1.25px}
.cw-meter.lg{display:flex;gap:4px}
.cw-meter.lg i{width:auto;flex:1;height:14px;border-radius:3px}
.cw-meter.off i{border-style:dashed;border-color:var(--line-2);background:none}
.cw-scale{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:8px;font-size:calc(13px*var(--k));color:var(--muted);font-weight:500}
.cw-scale span.on{color:var(--text);font-weight:650}

/* ---------- member card (home) ---------- */
.cw-card{position:relative;display:grid;gap:8px;background:var(--panel);border-radius:8px;padding:14px 16px 13px;box-shadow:0 0 0 1px var(--line);color:var(--text);text-decoration:none}
a.cw-card:hover{box-shadow:0 0 0 1.5px var(--line-2)}
a.cw-card:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.floor.paper .cw-card,.floor.light .cw-card,html[data-theme="light"] .floor .cw-card{box-shadow:0 0 0 1px var(--line),0 12px 24px -20px rgba(11,21,48,.45)}
.cw-top{display:flex;align-items:center;flex-wrap:wrap;gap:4px 9px;font-size:13px;font-weight:650;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);min-height:20px}
.cw-top .upd{margin-inline-start:auto;font-size:calc(13px*var(--k));letter-spacing:0;text-transform:none;font-weight:500;font-variant-numeric:tabular-nums;color:var(--text-2)}
[dir="rtl"] .cw-top{text-transform:none;font-size:14px;font-weight:600}
.cw-main{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:4px 14px}
.cw-wl{display:grid;gap:10px;justify-items:start;min-width:0}
.cw-word{font-size:calc(30px*var(--k));font-weight:700;letter-spacing:-.04em;line-height:1}
[dir="rtl"] .cw-word{line-height:1.35}
.cw-num{text-align:end;line-height:1;display:grid;justify-items:end}
.cw-num b{display:block;font-size:40px;font-weight:700;letter-spacing:-.05em;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--text-hi)}
.cw-num b.words{font-size:calc(20px*var(--k));letter-spacing:-.02em;line-height:1.2;white-space:normal;max-width:9em}
.cw-num small{display:block;font-size:calc(13px*var(--k));color:var(--muted);margin-top:4px}
.cw-num.cw-side small{font-size:calc(14px*var(--k));color:var(--text-2);margin:0;max-width:12em;line-height:1.3}
.cw-hint{display:flex;align-items:center;gap:8px;padding-top:9px;border-top:1px dotted var(--line-2);font-size:calc(14px*var(--k));color:var(--text-2);min-height:40px;line-height:1.35}
.cw-hint b{color:var(--text-hi);font-weight:600}
.cw-hint .ic{margin-inline-start:auto;width:18px;height:18px;color:var(--muted);flex:none}
.cw-card.muted .cw-word{color:var(--muted)}

/* ---------- pass line (inside the printed pass, paper in every theme) ---------- */
.cw-passline{color:var(--ink);text-decoration:none}
.cw-passline .cw-pt{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cw-passline .cw-meter i{border-color:var(--ink)}
.cw-passline .cw-meter i.f{background:var(--ink)}
.cw-passline .go{margin-inline-start:auto;font-size:calc(13.5px*var(--k));font-weight:600;color:var(--cobalt-deep);display:inline-flex;align-items:center;gap:2px;flex:none}
.cw-passline .go .ic{width:16px;height:16px}
.cw-passline:focus-visible{outline:3px solid var(--cobalt);outline-offset:2px}

/* ---------- member detail ---------- */
.cw-detail{gap:22px;padding-bottom:28px}
.cw-hero{display:grid;gap:12px}
[dir="rtl"] .cw-hero{gap:16px}
.cw-hero .eb{color:var(--text-2);gap:8px}
.cw-hero .big{display:flex;align-items:baseline;gap:6px 14px;flex-wrap:wrap}
.cw-hero .big .w{font-size:calc(52px*var(--k));font-weight:700;letter-spacing:-.05em;line-height:.95;color:var(--text-hi)}
[dir="rtl"] .cw-hero .big .w{line-height:1.45;padding-bottom:4px}
.cw-hero .big .n{font-size:calc(22px*var(--k));font-weight:600;color:var(--text-2);font-variant-numeric:tabular-nums}
.cw-in{font-size:calc(15px*var(--k));color:var(--text-2);line-height:1.45}
.cw-in b{color:var(--text-hi);font-weight:600}
.cw-sect{display:grid;gap:12px}
.cw-sect .hd{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}
.cw-sect .hd .end{margin-inline-start:auto}
.cw-st{color:var(--text-2)}
.cw-days{display:block}
.cw-days .chip{text-decoration:none;justify-content:center;position:relative;min-height:44px}
.cw-days .chips.fill{flex-wrap:nowrap;gap:6px}
.cw-days .chips.fill .chip{flex:1;padding:0;min-width:0;font-size:calc(14px*var(--k))}
.cw-days .chip.today::after{content:"";position:absolute;bottom:5px;left:50%;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:currentColor}
/* Arabic: whole day names, a scroller with a fade at the far edge (never a chip cut without a hint) */
.cw-days.scroll{position:relative;margin-inline:-22px;padding-inline:22px;overflow-x:auto;scrollbar-width:none}
.cw-days.scroll::-webkit-scrollbar{display:none}
.cw-days.scroll .chips{flex-wrap:nowrap;width:max-content;padding-inline-end:48px}
.cw-days.scroll .chip{flex:none}
.cw-days.scroll{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 56px);mask-image:linear-gradient(to right,transparent 0,#000 56px)}
[dir="ltr"] .cw-days.scroll{-webkit-mask-image:linear-gradient(to left,transparent 0,#000 56px);mask-image:linear-gradient(to left,transparent 0,#000 56px)}
.cw-learn{color:var(--text-2)}
.cw-slip .say{color:var(--ink)}
.cw-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:calc(13px*var(--k));color:var(--muted);align-items:center}
.cw-legend span{display:inline-flex;align-items:center;gap:7px}
.cw-legend .sw{width:16px;height:11px}
.cw-legend .sw .bar{fill:var(--cw-ht)}
.cw-legend .ln{width:18px;border-top:2px solid var(--text)}
.cw-legend .ln.thr{border-top:1.5px dotted var(--line-2)}
.cw-legend .nw-c{width:7px;height:12px;background:var(--live);border-radius:1px}
.cw-hours{display:grid;margin:0}
.cw-hours>div{display:flex;align-items:baseline;gap:12px;padding:9px 0;border-bottom:1px dotted var(--line-2);font-size:calc(14.5px*var(--k))}
.cw-hours dt{color:var(--text-2)}
.cw-hours dd{margin:0;margin-inline-start:auto;font-weight:600;font-variant-numeric:tabular-nums;text-align:end;color:var(--text)}
.cw-hours dd.closed{color:var(--muted);font-weight:500}
.cw-hours>div.today dt{color:var(--text);font-weight:650}
.cw-hours>div.today dt::after{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--text);margin-inline-start:7px;vertical-align:middle}
.cw-sub{font-size:13px;font-weight:650;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);margin:10px 0 0}
[dir="rtl"] .cw-sub{text-transform:none;font-size:14px}
.cw-wnote{color:var(--text-2)}
.cw-fn{border:0;padding-top:0}

/* ---------- the day chart (inline SVG from src/crowdView.js) ---------- */
.cw-chart{width:100%;height:auto;overflow:visible;display:block}
.cw-chart text{font:500 calc(12.5px*var(--cw-k,1)) var(--font);fill:var(--muted);font-variant-numeric:tabular-nums}
.cw-chart text.now{font-weight:700;fill:var(--text)}
.cw-chart text.ar{font-family:var(--font-ar);font-size:calc(13px*var(--cw-k,1))}
.cw-chart .bar{fill:var(--cw-ht)}
.cw-chart .base{stroke:var(--text);stroke-width:1}
.cw-chart .thr{stroke:var(--line-2);stroke-width:1;stroke-dasharray:2 3}
.cw-chart .cap{stroke:var(--accent-2);stroke-width:1.5}
.cw-chart .today{fill:none;stroke:var(--text);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.cw-chart .dot{fill:var(--text)}
.cw-chart .nowbar{fill:var(--live)}
.cw-chart .closed{fill:var(--line-2)}
.cw-chart .tick{stroke:var(--text);stroke-width:1}

/* ---------- staff pill + popover (top bar) ---------- */
.cw-pillbox{position:relative;display:inline-flex}
.cw-pill{display:inline-flex;align-items:center;gap:9px;height:44px;padding:0 14px;border-radius:999px;border:1.5px solid var(--text);background:var(--panel);color:var(--text);font:inherit;font-size:calc(14px*var(--k));font-weight:600;white-space:nowrap;flex:none;cursor:pointer}
.cw-pill .n{display:inline-flex;align-items:baseline;direction:ltr}
.cw-pill b{font-size:17px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text)}
.cw-pill .ap{font-weight:500;color:var(--muted)}
.cw-pill.open,.cw-pill[aria-expanded="true"]{box-shadow:0 0 0 3px rgba(47,80,255,.22)}
.cw-pill:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.cw-pill.closed{border-color:var(--line-2);color:var(--muted)}
.cw-pill.static{cursor:default}
.cw-pop{position:absolute;top:calc(100% + 10px);inset-inline-end:0;z-index:40;width:min(470px,calc(100vw - 32px));background:var(--panel);color:var(--text);border-radius:10px;
  box-shadow:0 0 0 1px var(--line-2),0 30px 50px -24px rgba(11,21,48,.55);padding:18px 20px 16px;display:grid;gap:12px;white-space:normal;font-size:calc(14px*var(--k));text-align:start}
.cw-pop[hidden]{display:none}
.cw-pop::before{content:"";position:absolute;top:-8px;inset-inline-end:72px;width:14px;height:14px;background:var(--panel);transform:rotate(45deg);box-shadow:-1px -1px 0 var(--line-2)}
.cw-pop-h{display:flex;align-items:center;gap:10px}
.cw-pop-h .tag{margin-inline-start:auto}
body.desk .d-right .cw-pop .tag{display:inline-flex}
.cw-pop .foot-note{font-size:calc(13.5px*var(--k));color:var(--text-2)}
.cw-warnline{color:var(--text-2)}
.tag.exact .ic{width:15px;height:15px}
.tag.dashed{border-style:dashed}
@media (max-width:1180px){ .d-right .cw-pill .cw-meter{display:none} }
@media (max-width:900px){
  .d-right .cw-pill{height:44px;padding:0 12px;gap:7px;font-size:calc(13.5px*var(--k))}
  .d-right .cw-pill b{font-size:16px}
  .cw-pop{position:fixed;top:72px;inset-inline:16px;width:auto}
  .cw-pop::before{display:none}
}
/* On a phone the pill keeps the number AND the level word (board: below 1100 px only the blocks go); the gym name
   leaves the bar first (desk.css). */
@media (max-width:420px){ .d-right .cw-pill{padding:0 10px;gap:5px} .d-right .cw-pill .live-dot,.d-right .cw-pill>span[aria-hidden]{display:none} }
@media (max-width:359px){ .d-right .cw-pillbox{display:none} } /* 320 px phones: the bar keeps the person and the clock */

/* ---------- counter: the day rail under the clock, the sign-in row ---------- */
.cw-railbox{max-width:900px}
@media (max-width:640px){ .cw-railbox{display:none} } /* the phone counter has no rail (board) */
.cw-rail{width:100%;height:auto;display:block}
.cw-rail .area{fill:var(--cw-ht)}
.cw-rail .base{stroke:var(--text);stroke-opacity:.35}
.cw-rail .done{stroke:var(--text);stroke-width:3}
.cw-rail .tk{stroke:var(--text);stroke-opacity:.6}
.cw-rail .hr{stroke:var(--text);stroke-opacity:.6}
.cw-rail text{font:600 calc(12.5px*var(--cw-k,1)) var(--font);fill:var(--muted);font-variant-numeric:tabular-nums}
.cw-rail .nowdot{fill:var(--live);stroke:var(--page);stroke-width:3}
.cw-loginrow{display:flex;align-items:center;gap:10px}
.cw-loginrow>span{min-width:0}
.cw-loginrow .cw-meter{flex:none}
.cw-loginrow .cw-st{color:var(--muted)}

/* ---------- owner tile ---------- */
.cw-tile{display:grid;gap:10px;padding:16px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.cw-tile.flat{padding:0;border:0}
.cw-tile .row1{display:flex;align-items:center;gap:9px}
.cw-tile .row1 b{font-weight:650}
.cw-tile .row1 .end{margin-inline-start:auto}
.cw-tile .row2{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 14px}
.cw-tile .row2 .num{font-size:52px;font-weight:700;letter-spacing:-.055em;line-height:.9;font-variant-numeric:tabular-nums;direction:ltr;color:var(--text-hi)}
.cw-tile .row2 .num.off{color:var(--muted)}
.cw-tile .row2 .num .ap{font-size:.5em;color:var(--muted);font-weight:500;letter-spacing:0;margin-inline-end:3px;vertical-align:.3em}
.cw-tile .row2 .lv{display:grid;gap:6px}
.cw-tile .row2 .lv b{font-size:calc(20px*var(--k));font-weight:650;letter-spacing:-.02em;line-height:1.1}
.cw-tile .row2 .hint.end{margin-inline-start:auto;max-width:200px}
.cw-tile .how{font-size:calc(13.5px*var(--k));color:var(--muted)}
.cw-tile .how a{color:var(--text)}
.cw-tile .hint{font-size:calc(14.5px*var(--k));color:var(--text-2);line-height:1.45}
.cw-tile .hint b{color:var(--text);font-weight:600}
.cw-tile.big .row2 .num{font-size:72px}
.cw-learnbar{height:6px;border-radius:3px;background:var(--sunken);box-shadow:inset 0 0 0 1px var(--line);overflow:hidden}
.cw-learnbar i{display:block;height:100%;background:var(--text)}

/* ---------- owner · Affluence page ---------- */
.cw-oph{margin-bottom:18px}
.cw-oph .t-small{display:block;color:var(--muted)}
@media (max-width:900px){.cw-oph>.end.ow-ph-acts{display:flex;grid-column:1/-1;grid-row:2}} /* phone: the two links go under the title, side by side */
.cw-ogrid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:28px 44px;align-items:start}
.cw-ogrid .t-label{display:block;margin-bottom:10px}
.cw-ohours{display:grid;gap:10px}
.cw-ohours .t-label{margin-bottom:0}
.cw-ostatus{display:flex;align-items:center;gap:9px;font-size:calc(16px*var(--k))}
.cw-report{margin-top:40px;display:grid;gap:16px;padding-top:24px;border-top:1px solid var(--line)}
.cw-rh{display:flex;align-items:center;flex-wrap:wrap;gap:12px 16px}
.cw-racts{margin-inline-start:auto;display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.cw-seg a{height:38px;padding:0 14px;border-radius:8px;display:flex;align-items:center;font-size:calc(14px*var(--k));font-weight:600;color:var(--muted);text-decoration:none}
.cw-seg a.on{background:var(--raised);color:var(--text);box-shadow:0 1px 0 var(--line-2)}
@media (max-width:420px){.cw-racts{width:100%;margin-inline-start:0}.cw-seg{display:flex;flex:1 1 100%;min-width:0}.cw-seg a{flex:1;justify-content:center;padding:0 6px;white-space:nowrap}} /* 320 px: the three periods share the width */
.cw-lock{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:14px;align-items:center;padding:16px 18px;border:1.5px dashed var(--line-2);border-radius:10px}
.cw-lock p{color:var(--text-2);margin-top:2px}
.cw-sent{font-size:calc(26px*var(--k));max-width:44ch}
.cw-hhead{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 12px}
.cw-hhead .end{margin-inline-start:auto;color:var(--text-2)}
.cw-heatwrap{overflow-x:auto;padding-bottom:4px}
.cw-heat{display:grid;gap:3px;font-variant-numeric:tabular-nums;min-width:720px}
.cw-heat .row{display:grid;grid-template-columns:96px repeat(var(--cols),minmax(0,1fr)) 124px;gap:3px;align-items:center}
.cw-heat .d{font-size:calc(14px*var(--k));font-weight:600;color:var(--text);display:flex;align-items:center;gap:6px}
.cw-heat .d.today::after{content:"";width:6px;height:6px;border-radius:50%;background:var(--text)}
.cw-heat .pk{font-size:calc(13px*var(--k));color:var(--text-2);padding-inline-start:12px;white-space:nowrap}
.cw-heat .pk b{color:var(--text);font-weight:650}
.cw-heat .pkh{text-align:start;padding-inline-start:12px}
.cw-heat .cell{height:38px;border-radius:3px;position:relative;box-shadow:inset 0 0 0 1px var(--line);overflow:hidden}
.cw-heat .cell svg{position:absolute;inset:0;width:100%;height:100%}
.cw-heat .cell.cl{background:repeating-linear-gradient(135deg,transparent 0 5px,var(--line) 5px 6px)}
.cw-heat .cell.now{box-shadow:inset 0 0 0 2px var(--live)}
.cw-heat .hrs .h{font-size:13px;color:var(--muted);text-align:center;direction:ltr;white-space:nowrap}
.cw-hkey{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;font-size:calc(13.5px*var(--k));color:var(--text-2)}
.cw-hkey>span{display:inline-flex;align-items:center;gap:7px}
.cw-hkey .sw{width:26px;height:16px;border-radius:2px;box-shadow:inset 0 0 0 1px var(--line);position:relative;overflow:hidden;display:inline-block}
.cw-hkey .sw svg{width:100%;height:100%;display:block}
.cw-hkey .sw.cl{background:repeating-linear-gradient(135deg,transparent 0 5px,var(--line-2) 5px 6px)}
.cw-hkey .sw.now{box-shadow:inset 0 0 0 2px var(--live)}
.cw-rnotes{display:grid;grid-template-columns:1fr 1fr;gap:20px 36px;margin-top:4px}
.privacy{display:grid;grid-template-columns:22px minmax(0,1fr);gap:10px;padding:14px 16px;border:1.5px dashed var(--line-2);border-radius:8px;font-size:calc(14px*var(--k));color:var(--text-2);line-height:1.5}
.privacy.solid{border-style:solid;border-color:var(--line)}
.privacy .ic{width:20px;height:20px}
.privacy b{color:var(--text);font-weight:650}

/* ---------- settings: crowd options, hours ---------- */
.cw-setgrid{display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:44px;align-items:start}
.cw-setcol{display:grid;gap:8px;min-width:0}
.cw-rows{display:grid}
.cw-srow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 24px;align-items:center;padding:18px 0;border:0;border-bottom:1px solid var(--line);margin:0;min-width:0}
.cw-rows>.cw-srow:first-child{border-top:1px solid var(--line)}
.cw-srow p,.cw-help{font-size:calc(14px*var(--k));color:var(--text-2);line-height:1.5;margin-top:3px;max-width:60ch}
.cw-srow legend{padding:0;float:left}
.cw-srow legend+p{clear:both}
.cw-h4{font-size:calc(16px*var(--k));font-weight:650;letter-spacing:-.01em;margin:0}
.cw-full{grid-column:1/-1;display:grid;gap:10px;min-width:0}
.cw-switch{position:relative;display:inline-flex;width:52px;height:44px;align-items:center;cursor:pointer}
.cw-switch input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.cw-switch span{width:46px;height:28px;border-radius:14px;background:var(--line-2);position:relative;transition:background .15s}
.cw-switch span::after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(11,21,48,.3);transition:inset-inline-start .15s}
.cw-switch input:checked+span{background:var(--action)}
.cw-switch input:checked+span::after{inset-inline-start:21px}
.cw-switch input:focus-visible+span{outline:3px solid var(--focus);outline-offset:2px}
.cw-segr{display:inline-flex;flex-wrap:wrap;padding:3px;border-radius:10px;background:var(--sunken);gap:2px}
.cw-segr label{position:relative;display:flex}
.cw-segr input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.cw-segr span{min-height:40px;padding:0 14px;border-radius:8px;display:flex;align-items:center;font-size:calc(14px*var(--k));font-weight:600;color:var(--text-2)}
.cw-segr input:checked+span{background:var(--raised);color:var(--text);box-shadow:0 1px 0 var(--line-2),0 0 0 1px var(--line)}
.cw-segr input:focus-visible+span{outline:3px solid var(--focus);outline-offset:1px}
.cw-step{display:inline-flex;align-items:center;gap:8px}
.cw-step .btn.icon{width:44px;height:44px;padding:0;justify-content:center;font-size:20px}
.cw-stepv{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.cw-stepv .input{width:88px;text-align:center;font-weight:650}
.cw-lvtab{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel)}
.cw-lvtab>div{padding:10px 12px;display:grid;gap:7px;align-content:start;border-inline-end:1px solid var(--line)}
.cw-lvtab>div:last-child{border-inline-end:0}
.cw-lvtab b{font-weight:650;font-size:calc(15px*var(--k))}
.cw-lvtab .tab{font-size:calc(14px*var(--k));color:var(--text-2);font-variant-numeric:tabular-nums}
.cw-thin[hidden]{display:none}
.cw-thin{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--text-2);flex-wrap:wrap}
.cw-thin .input{width:74px;height:40px;text-align:center}
.cw-thin .input:disabled{opacity:.55}
.cw-note{color:var(--text-2)}
.cw-readers .tag{justify-self:end}
.cw-keybox{display:grid;gap:10px;padding:14px 16px;border:1.5px solid var(--action);border-radius:10px;background:var(--panel)}
.cw-keybox .input{font-size:14px;width:100%}
.cw-rdlist>.r{grid-template-columns:minmax(0,1fr) auto}
.cw-rdlist small{display:block;color:var(--text-2)}
.cw-rdlist form{margin:0}
.cw-addrd,.cw-clform{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 12px}
.cw-addrd .field{flex:1 1 220px}
.cw-clform .field{flex:1 1 150px}
.cw-setside{display:grid;gap:22px;position:sticky;top:84px}
.cw-plab{font-size:13px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:8px}
[dir="rtl"] .cw-plab{text-transform:none;font-size:13.5px}
.cw-mt{margin-top:14px}
.cw-pvbox{padding:18px;border-radius:12px}
.cw-week{display:grid;gap:6px;padding:18px 0;border-bottom:1px solid var(--line);min-width:0}
.cw-rows>.cw-week:first-child{border-top:1px solid var(--line)}
.cw-weekh{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px}
.cw-weekh .pen{margin-inline-start:auto;background:none;border:0;font:inherit;font-weight:600;cursor:pointer;padding:0}
.cw-day{display:grid;grid-template-columns:120px minmax(0,1fr) 70px;gap:8px 12px;align-items:center;padding:8px 0;border-bottom:1px dotted var(--line-2)}
.cw-dn{font-weight:600}
.cw-rgs{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;min-width:0}
.cw-rg{display:inline-flex;align-items:center;gap:6px}
.cw-rg[hidden]{display:none}
.cw-rg .input{width:84px;height:44px;padding:0 10px;text-align:center;font-variant-numeric:tabular-nums}
.cw-rg .input:invalid{border-color:var(--bad)}
.cw-clr{width:40px;height:40px;padding:0;justify-content:center;color:var(--muted)}
.cw-add{background:none;border:0;font:inherit;font-size:calc(14px*var(--k));cursor:pointer;gap:6px;padding:0;color:var(--text)}
.cw-add .ic{width:16px;height:16px}
.cw-dstate{color:var(--muted);text-align:end}
.cw-cllist>.r{grid-template-columns:minmax(0,1fr) auto}
.cw-cllist small{display:block;color:var(--text-2)}
.cw-cllist form{margin:0}

/* ---------- exit kiosk ---------- */
.cw-kiosk{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;gap:24px;padding-top:18px}
.cw-kbody{flex:1;display:grid;align-content:center;gap:18px;max-width:640px}
.cw-kbody .eb{color:var(--text-2)}
.cw-kform .input{max-width:420px}
.cw-kstamp{min-height:120px;display:grid;justify-items:start;gap:8px}
.cw-kstamp .stamp[hidden]{display:none}

@media (max-width:1100px){
  .cw-setgrid{grid-template-columns:minmax(0,1fr)}
  .cw-setside{position:static}
  .cw-ogrid{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:640px){
  .cw-srow{grid-template-columns:minmax(0,1fr)}
  .cw-srow>.cw-switch,.cw-srow>.cw-step,.cw-srow>.cw-segr,.cw-srow>.pen{justify-self:start}
  .cw-lvtab{grid-template-columns:repeat(2,minmax(0,1fr))}
  .cw-lvtab>div:nth-child(2){border-inline-end:0}
  .cw-lvtab>div:nth-child(-n+2){border-bottom:1px solid var(--line)}
  .cw-day{grid-template-columns:minmax(0,1fr) auto;padding:10px 0}
  .cw-day .cw-rgs{grid-column:1/-1;order:3}
  .cw-rnotes{grid-template-columns:minmax(0,1fr)}
  .cw-lock{grid-template-columns:auto minmax(0,1fr)}
  .cw-lock .btn{grid-column:1/-1;justify-self:start}
  .cw-sent{font-size:calc(21px*var(--k))}
  .cw-tile.big .row2 .num{font-size:56px}
  .cw-tile .row2 .hint.end{max-width:none;margin-inline-start:0;flex-basis:100%}
}

/* ---------- print: the owner's typical week on one sheet (the gym logo prints; decision 1) ---------- */
.cw-printhead,.cw-printfoot{display:none}
@media print{
  .cw-printhead{display:flex;align-items:center;gap:14px;padding-bottom:12px;border-bottom:1.5px solid var(--ink)}
  .cw-printhead b{display:block;font-size:18px}
  .cw-printhead span{font-size:13px;color:var(--ink-muted)}
  .cw-printfoot{display:block;margin-top:12px;font-size:12px;color:var(--ink-muted)}
  .cw-ogrid,.cw-oph{display:none!important}
  .cw-report{margin:0;border:0;padding:0}
  body.desk .d-top,body.desk .o-nav,body.desk .m-tabs,body.desk .dh,.cw-racts,.cw-oph .ow-ph-acts,.flash,.banner{display:none!important}
  body.desk{background:#fff}
  .cw-heat{min-width:0}
  .cw-heat .cell{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
@media (prefers-reduced-motion:reduce){ .cw-switch span,.cw-switch span::after{transition:none} }
.cw-heatwrap:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
