/* ==========================================================================
   fable.css - the ONE shared stylesheet for every "direction B" screen in variant-fable/.
   The tokens, buttons, cards, chips, dialogs, sidebar and dark mode come from ../styles.css and
   ../dark.css (unchanged). Everything here uses those tokens only, so dark mode needs no extra rules.

   Direction B in one line: a picture first (big tappable tiles), then a sheet with big buttons;
   every change saves at once with Undo; plain words; nothing hidden.
   ========================================================================== */

/* ---- Variant banner under the demo banner ------------------------------------- */
.variant-banner { background: var(--brand-tint); color: var(--text); border-bottom: 1px solid var(--line); padding: 8px 16px; font-size: .875rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.variant-banner a { color: var(--brand-dark); font-weight: 700; }
.variant-tag { background: var(--brand); color: var(--on-brand); border-radius: 99px; padding: 1px 10px; font-weight: 800; font-size: .75rem; letter-spacing: .04em; white-space: nowrap; }
.demo-banner .banner-btns button { white-space: nowrap; }

/* ---- Tiles: the main building block ------------------------------------------- */
.tile { display: grid; gap: 6px; text-align: left; width: 100%; min-height: 112px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--text); align-content: start; font: inherit; }
.tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.tile .t-svc, .tile .t-lbl { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tile .t-n { font-size: 2rem; font-weight: 800; line-height: 1; }
.tile .t-n small { font-size: .85rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.tile .t-none .t-n { color: var(--muted); font-size: 1.3rem; }
.tile .t-by { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.tile.closed { background: var(--panel); border-style: dashed; box-shadow: none; cursor: default; color: var(--muted); }
.tile.closed .t-n { font-size: 1.2rem; }
.tile.current { outline: 3px solid var(--brand); outline-offset: 1px; }
.tile.static { cursor: default; } .tile.static:hover { border-color: var(--line); background: var(--surface); }
.tile.bad { border-left: 6px solid var(--bad); } .tile.warn { border-left: 6px solid var(--warn); } .tile.ok { border-left: 6px solid var(--ok); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile-grid.wide { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* People pictograms: one per person, coloured by section. Decorative; the text carries the numbers. */
.pp { display: flex; flex-wrap: wrap; gap: 2px; min-height: 18px; }
.pp svg { width: 16px; height: 18px; }
.pp .more { font-size: .75rem; font-weight: 700; color: var(--muted); align-self: center; }
.pp.k svg, .dot.k, .c-amber .dot { color: var(--kitchen-line); }
.pp.f svg, .dot.f, .c-blue .dot { color: var(--floor-line); }
.pp.b svg, .dot.b, .c-green .dot { color: var(--bar-line); }
.pp.v svg, .dot.v { color: #9a7be8; }
.pp.o svg, .dot.o { color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }

/* ---- Week wall layout (Staffing needs and the Roster) --------------------------- */
.wall-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 6px 0 12px; }
.wall-head .legend { margin-left: auto; }
.wall { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.wall.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-col { display: grid; gap: 8px; align-content: start; }
.day-col h2 { font-size: 1.05rem; text-align: center; padding: 6px 0 2px; }
.day-col h2 small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.day-col.today h2 { color: var(--brand-dark); }

/* ---- Big choice buttons (None, 1, 2, 3 ... or words) ------------------------------ */
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choices button { min-width: 52px; height: 52px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--field-line); background: var(--surface); color: var(--text); font-size: 1.1rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.choices button:hover:not(:disabled) { background: var(--brand-tint); border-color: var(--brand); }
.choices button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.choices button:disabled { opacity: .45; cursor: not-allowed; }
.choices button small { display: block; font-size: .7rem; font-weight: 600; line-height: 1; margin-top: 2px; }
.choices.words button { font-size: 1rem; min-width: 0; }
.more-link { margin-top: 8px; }

/* ---- People tiles (pick someone, staff cards) ------------------------------------- */
.ptile { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--text); font: inherit; }
.ptile:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.ptile[aria-pressed="true"] { border: 2px solid var(--brand); background: var(--brand-tint); }
.ptile:disabled { cursor: not-allowed; opacity: .7; }
.ptile .av { width: 40px; height: 40px; border-radius: 50%; background: var(--panel); color: var(--text); display: grid; place-items: center; font-weight: 800; flex: none; border: 2px solid var(--line); }
.ptile.c-amber .av { border-color: var(--kitchen-line); } .ptile.c-blue .av { border-color: var(--floor-line); } .ptile.c-green .av { border-color: var(--bar-line); }
.ptile .pt-main { flex: 1; min-width: 0; }
.ptile .pt-name { font-weight: 700; display: block; }
.ptile .pt-sub { color: var(--muted); font-size: .85rem; display: block; }
.ptile .pt-why { color: var(--bad); font-size: .85rem; display: block; font-weight: 600; }
.ptile .pt-warn { color: var(--warn); font-size: .85rem; display: block; font-weight: 600; }
.ptile .pt-ok { color: var(--ok); font-size: .85rem; display: block; font-weight: 600; }
.ptile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }

/* ---- Sheet: the editor for one thing, a native dialog that fills a phone screen ----- */
dialog.sheet { width: min(780px, calc(100vw - 24px)); max-height: calc(100vh - 32px); border-radius: 20px; padding: 0; overflow: auto; }
.sh-head { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 20px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.sh-head h2 { font-size: 1.35rem; }
.sh-head .sh-sub { display: block; color: var(--muted); font-size: .9rem; font-weight: 500; }
.sh-head .btn.done { margin-left: auto; min-height: 48px; padding: 8px 22px; font-size: 1.05rem; }
.sh-body { padding: 8px 20px 16px; }
.sh-sec { margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.sh-sec .chip { margin-left: auto; }
.sh-foot { position: sticky; bottom: 0; background: var(--head-bg); border-top: 1px solid var(--line); padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.sh-foot .saved { flex: 1 1 220px; font-size: .9rem; }
.sh-foot .saved strong { color: var(--ok); }
.rr { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.rr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.rr-name { font-weight: 700; font-size: 1.05rem; }
.rr-now { color: var(--muted); font-size: .9rem; }
.facts2 { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 10px; }
.facts2 dt { color: var(--muted); font-weight: 600; } .facts2 dd { margin: 0; }
.why-list { margin: 4px 0 10px; padding-left: 20px; } .why-list li { margin: 3px 0; }

/* ---- Step strip and "what next" ------------------------------------------------------ */
.step-label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin: 14px 0 8px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: inline-grid; place-items: center; font-size: .95rem; flex: none; }
.next-card { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 18px; }
.next-card .txt { flex: 1 1 280px; } .next-card p { margin: 2px 0 0; }

/* ---- Start here, folds, lists, empty states ------------------------------------------ */
.start-here { border: 2px solid var(--brand); background: var(--brand-tint); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 14px; display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.start-here .sh-ico { font-size: 1.4rem; line-height: 1; }
.start-here .sh-txt { flex: 1 1 260px; }
.start-here h2 { font-size: 1.05rem; margin-bottom: 4px; }
.start-here ol { margin: 0; padding-left: 20px; } .start-here li { margin: 3px 0; }
.start-here .btn.small { align-self: center; }
.fold { margin-top: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px; }
.fold summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.fold ul { margin: 6px 0 10px; padding-left: 20px; } .fold li { margin: 3px 0; } .fold h3 { margin: 10px 0 2px; font-size: .95rem; }
.log-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.log-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.log-list .when { color: var(--muted); }
.empty-box { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 18px; text-align: center; background: var(--surface); }
.empty-box .big-icon { font-size: 1.8rem; margin-bottom: 4px; }
.empty-box h2, .empty-box h3 { margin-bottom: 6px; }
.empty-box p { color: var(--muted); max-width: 48ch; margin: 0 auto 8px; }
.off-note { color: var(--muted); font-size: .8rem; margin: 6px 0 0; }
.big-row { display: flex; flex-wrap: wrap; gap: 8px; }
.big-row .btn { min-height: 48px; padding: 8px 20px; font-size: 1rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { border: 1px solid var(--btn-line); background: var(--surface); color: var(--text); border-radius: 99px; padding: 8px 16px; cursor: pointer; font-weight: 700; min-height: 44px; font: inherit; font-weight: 700; }
.pills button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.pills button:hover { border-color: var(--brand); }
.search-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; margin: 10px 0; }
.search-row .ff { flex: 1 1 240px; margin: 0; }
.search-row input[type=search], .search-row input[type=text] { width: 100%; min-height: 48px; font-size: 1rem; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface); color: var(--text); }
.ff label { display: block; font-weight: 600; margin-bottom: 4px; }
.ff input, .ff select, .ff textarea { width: 100%; min-height: 44px; font-size: 1rem; padding: 8px 12px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--surface); color: var(--text); }
.ff textarea { min-height: 80px; }
.ff .err { color: var(--bad); font-weight: 600; font-size: .85rem; margin-top: 4px; }
.ff { margin-bottom: 10px; }

/* (i) info icon and its one shared tooltip (text added with textContent). */
.fi { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--brand); color: var(--brand-dark); background: var(--surface); font-size: .75rem; font-weight: 800; cursor: pointer; vertical-align: middle; margin-left: 4px; padding: 0; line-height: 1; font-family: inherit; }
.fi:hover, .fi[aria-expanded="true"] { background: var(--brand); color: var(--on-brand); }
.fi-tip { position: fixed; z-index: 10000; width: min(300px, calc(100vw - 16px)); background: var(--surface); color: var(--text); border: 2px solid var(--brand); border-radius: 12px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: .85rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; }
.fi-tip .ex { display: block; margin-top: 4px; color: var(--muted); }
.fi-tip[hidden] { display: none; }

/* ---- Undo bar on the page ---------------------------------------------------------- */
.undo-bar { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 150; background: var(--ink); color: var(--on-ink); border-radius: 14px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; width: min(620px, calc(100vw - 24px)); }
.undo-bar[hidden] { display: none; }
.undo-bar .msg { flex: 1 1 200px; }
.undo-bar .btn { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); min-height: 40px; }
.undo-bar .btn.quiet { background: transparent; color: var(--on-ink); border-color: var(--on-ink); }
.undo-bar .sim-tag { background: #ffd666; color: #2b2140; }
body.has-undo main { padding-bottom: 120px; }
body.has-undo .toast { bottom: calc(var(--undo-h, 70px) + 24px); }

/* ---- Roster (direction B) ------------------------------------------------------------- */
.rday { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
.rday.closed { background: var(--panel); border-style: dashed; box-shadow: none; }
.rday h2 { font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.rday h2 small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.rday.today h2 { color: var(--brand-dark); }
.rsvc { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.rsvc h3 { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; gap: 6px; }
.rsvc h3 small { font-weight: 600; text-transform: none; letter-spacing: 0; }
.shift-tile { display: grid; gap: 1px; width: 100%; text-align: left; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); border-left-width: 5px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.shift-tile:hover:not(:disabled) { background: var(--brand-tint); border-color: var(--brand); }
.shift-tile .st-name { font-weight: 700; font-size: .95rem; }
.shift-tile .st-role { font-size: .8rem; color: var(--muted); }
.shift-tile.c-amber { border-left-color: var(--kitchen-line); background: var(--kitchen-bg); color: var(--kitchen-text); }
.shift-tile.c-blue { border-left-color: var(--floor-line); background: var(--floor-bg); color: var(--floor-text); }
.shift-tile.c-green { border-left-color: var(--bar-line); background: var(--bar-bg); color: var(--bar-text); }
.shift-tile.c-amber .st-role, .shift-tile.c-blue .st-role, .shift-tile.c-green .st-role { color: inherit; opacity: .85; }
.shift-tile.gap { border: 2px dashed var(--bad); color: var(--bad); background: var(--surface); }
.shift-tile.gap .st-role { color: var(--bad); opacity: 1; }
.shift-tile.manual .st-name::after { content: " ✎"; font-weight: 400; }
.shift-tile:disabled { cursor: default; opacity: .85; }
.unavail-note { font-size: .78rem; color: var(--muted); padding: 4px 8px; border-radius: 8px; background: repeating-linear-gradient(45deg, var(--panel), var(--panel) 4px, var(--head-bg) 4px, var(--head-bg) 8px); }
.rday .addbtn { width: 100%; min-height: 40px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 16px; border-radius: var(--radius); margin: 0 0 12px; }
.status-strip.draft { background: #fff8de; color: #5c4300; border: 1px dashed #d9a40f; }
.status-strip.approved { background: var(--ok-bg); color: #0f4a28; border: 1px solid var(--ok); }
.status-strip.notbuilt { background: #e9ebef; color: #2f3846; border: 1px solid #b9bfca; }
:root[data-theme="dark"] .status-strip.draft { background: #3a3110; color: #f6dd8a; border-color: #d9a40f; }
:root[data-theme="dark"] .status-strip.approved { background: var(--ok-bg); color: #b7ecc8; }
:root[data-theme="dark"] .status-strip.notbuilt { background: #222f4f; color: #d3dbeb; border-color: #4a5b86; }
.status-strip .txt { flex: 1 1 260px; }
.status-strip .big-row { margin-left: auto; }
.week-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.week-pick .label { font-weight: 800; font-size: 1.1rem; min-width: 170px; text-align: center; }
.week-pick .btn { min-height: 48px; min-width: 48px; font-size: 1.2rem; }
.hours-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hours-list li { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(90px, 160px) auto; gap: 8px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hbar { height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--fill); }
.hbar.warn i { background: #d9a40f; } .hbar.bad i { background: var(--bad); }
.person-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.person-list li { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; background: var(--surface); }
.person-list .nm { font-weight: 700; min-width: 140px; }
.person-list .chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.progress-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.progress-steps li { padding: 6px 10px; border-radius: 10px; background: var(--panel); color: var(--muted); }
.progress-steps li.now { background: var(--brand-tint); color: var(--text); font-weight: 700; }
.progress-steps li.done { color: var(--ok); }
.cmp { width: 100%; border-collapse: collapse; margin: 8px 0; }
.cmp th, .cmp td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; } .cmp td.num, .cmp th.num { text-align: right; }
.print-sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 10px; }
.print-sheet h3 { margin-bottom: 6px; }
.stamp { display: inline-block; border: 2px solid var(--warn); color: var(--warn); border-radius: 8px; padding: 2px 8px; font-weight: 800; font-size: .8rem; }
.stamp.ok { border-color: var(--ok); color: var(--ok); }
table.plain { width: 100%; border-collapse: collapse; font-size: .9rem; } table.plain th, table.plain td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.seg-view { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Requests (direction B) -------------------------------------------------------------- */
.req-tile { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.req-tile.ok { border-left-color: var(--ok); } .req-tile.conflict { border-left-color: var(--warn); } .req-tile.declined { border-left-color: var(--bad); }
.req-tile h2 { font-size: 1.15rem; } .req-tile .when { font-size: 1rem; font-weight: 600; }
.req-tile .quote { font-style: italic; color: var(--muted); }
.req-tile .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.req-tile .chip, .tile .chip, .person-list .chip { white-space: normal; text-align: left; }
.req-tile pre, .req-tile details { min-width: 0; max-width: 100%; }
.req-tile .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.req-tile .acts .btn { min-height: 48px; padding: 8px 22px; font-size: 1rem; }
.req-grid { display: grid; gap: 12px; }
.checked-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-size: .9rem; margin: 6px 0 12px; }

/* ---- Staff cards (direction B) ----------------------------------------------------------- */
.pcard-b { display: grid; gap: 8px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; color: var(--text); font: inherit; width: 100%; }
.pcard-b:hover { border-color: var(--brand); background: var(--brand-tint); }
.pcard-b .top { display: flex; gap: 10px; align-items: center; }
.pcard-b .av { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 800; flex: none; border: 3px solid var(--line); }
.pcard-b.c-amber .av { border-color: var(--kitchen-line); } .pcard-b.c-blue .av { border-color: var(--floor-line); } .pcard-b.c-green .av { border-color: var(--bar-line); }
.pcard-b .nm { font-weight: 800; font-size: 1.05rem; display: block; } .pcard-b .sb { color: var(--muted); font-size: .85rem; display: block; }
.pcard-b .chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pcard-b.left { opacity: .75; border-style: dashed; }
.lv { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--panel); font-weight: 800; font-size: .8rem; }
.lv-1, .lv-2 { background: color-mix(in srgb, var(--brand) 20%, var(--surface)); } .lv-3 { background: color-mix(in srgb, var(--brand) 42%, var(--surface)); } .lv-4 { background: color-mix(in srgb, var(--brand) 70%, var(--surface)); color: var(--on-brand); } .lv-5 { background: var(--brand); color: var(--on-brand); }
.lv-0 { color: var(--muted); }
.sheet .box { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.sheet .box h3 { margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 12px; }

/* ---- Week table cells (Staffing needs) ---- */
.wk-cell2 { min-width: 44px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 700; cursor: pointer; color: var(--text); font: inherit; font-weight: 700; }
.wk-cell2:hover { background: var(--brand-tint); border-color: var(--brand); }
.wk-cell2.current { background: var(--brand); color: var(--on-brand); }
table.plain td.num { text-align: center; }

/* ---- Charts (Dashboard): compact, keyboard-reachable parts, a table beneath each ---- */
.ch-pt:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.ch-pt { cursor: pointer; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; }
.dash-grid > .card { margin: 0; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.chart-grid > .card { margin: 0; padding: 12px 14px; }
.chart-grid > .card.span2 { grid-column: span 2; }
.chart-card h2 { font-size: 1rem; }
.chart-card .row { margin-bottom: 4px; }
.chart-card .legend { font-size: .78rem; gap: 4px 10px; }
.chart-box { width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; max-height: 200px; }
.chart-card .hint { margin: 4px 0 0; font-size: .78rem; }
.chart-card .fold { margin-top: 6px; padding: 6px 12px; }
.chart-card .fold summary { font-size: .85rem; padding: 2px 0; }
.donut { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: center; margin-top: 4px; }
.donut svg { width: 150px; height: 150px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.donut-legend li { display: flex; gap: 8px; align-items: center; }
.labour { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px 18px; align-items: start; }
.labour-side { display: grid; gap: 6px; font-size: .9rem; }
.labour-side ul.plain { gap: 3px; }
.big { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.note { margin: 12px 0 0; padding: 8px 12px; background: #fff8de; border-radius: 10px; font-size: .85rem; color: #5c4300; }
:root[data-theme="dark"] .note { background: #3a3110; color: #f6dd8a; }
@media (max-width: 1000px) { .dash-grid, .labour { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } .chart-grid > .card.span2 { grid-column: auto; } .chart-box svg { max-height: 180px; } }

/* ---- Demo sign-in (login-b) ---- */
.auth-wrap { max-width: 720px; margin: 0 auto; }
.auth-warn { background: #fff3c9; color: #3d2f00; border: 2px dashed #d9a40f; border-radius: var(--radius); padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
:root[data-theme="dark"] .auth-warn { background: #3a3110; color: #f6dd8a; }
.role-tile { display: flex; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--text); font: inherit; box-shadow: var(--shadow); }
.role-tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.role-tile[aria-pressed="true"] { border: 2px solid var(--brand); }
.role-tile .av { width: 44px; height: 44px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-weight: 800; flex: none; border: 2px solid var(--line); }
.role-tile .rn { font-weight: 800; display: block; } .role-tile .rr { color: var(--muted); font-size: .85rem; display: block; }

/* ---- Staff grid (Roster): the original staff-by-day table, scrolling sideways on a phone ---- */
.rgrid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.rgrid { border-collapse: collapse; min-width: 1100px; width: 100%; }
.rgrid th, .rgrid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px; vertical-align: top; min-height: 48px; text-align: left; }
.rgrid thead th { position: sticky; top: 0; background: var(--head-bg); z-index: 3; text-align: center; }
.rgrid thead th small, .rgrid .nm small { display: block; font-weight: 500; color: var(--muted); }
.rgrid .nm { position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 170px; }
.rgrid thead .nm { z-index: 4; background: var(--head-bg); text-align: left; }
.rgrid .secband td { background: var(--section-bg); font-weight: 700; }
.rgrid .shift-tile { margin-bottom: 4px; padding: 5px 7px; }
.rgrid .shift-tile .st-name { font-size: .85rem; } .rgrid .shift-tile .st-role { font-size: .72rem; }
.rgrid th.today { background: #fff3c4; color: #3d2f00; } :root[data-theme="dark"] .rgrid th.today { background: #4a3f12; color: #fbe9a6; }
.rgrid .hrs { min-width: 130px; }

/* ---- Phone ------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .wall, .wall.seven { grid-template-columns: minmax(0, 1fr); }
  .day-col { grid-template-columns: 1fr 1fr; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
  .day-col h2 { grid-column: 1 / -1; text-align: left; padding: 2px 4px 0; }
  .tile { box-shadow: none; min-height: 100px; }
  dialog.sheet { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; }
  .sh-head { padding: 12px 16px; } .sh-body { padding: 4px 16px 12px; } .sh-foot { padding: 10px 16px; }
  .choices { gap: 4px; } .choices button { min-width: 42px; height: 50px; padding: 0 7px; font-size: 1.05rem; }
  .hours-list li { grid-template-columns: 1fr; gap: 4px; }
  .status-strip .big-row { margin-left: 0; }
}
