/* ==========================================================================
   variant.css - styles that only the Staffing needs design variant needs.
   Everything else (colours, buttons, cards, dialogs, sidebar, dark mode) comes from
   ../styles.css and ../dark.css, unchanged, so the screen matches the rest of the app.
   Colours are tokens only, so dark mode works without extra rules.
   ========================================================================== */

/* The variant banner sits under the demo banner and says plainly what this page is. */
.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; }

/* ---- Steps: one plain question at a time ---------------------------------- */
.step { margin: 0 0 18px; }
.step-label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; margin: 0 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; }
.step .help { color: var(--muted); font-size: .9rem; margin: -2px 0 10px 40px; }

/* Day buttons: big targets that wrap into a grid on a phone instead of scrolling sideways. */
.day-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; }
.day-btn { border: 1px solid var(--btn-line); background: var(--surface); border-radius: 14px; padding: 10px 8px; min-height: 64px; cursor: pointer; text-align: center; line-height: 1.25; display: grid; gap: 2px; align-content: center; }
.day-btn:hover { border-color: var(--brand); background: var(--brand-tint); }
.day-btn[aria-selected="true"] { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.day-btn .d-name { font-weight: 800; font-size: 1.05rem; }
.day-btn .d-sub { font-size: .8rem; opacity: .9; }
.day-btn.closed { border-style: dashed; }

/* Service choice: two large radio pills with the times and the total under each. */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; border: 0; margin: 0; padding: 0; }
.svc-grid legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.svc-opt2 { position: relative; }
.svc-opt2 input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.svc-opt2 span.box { display: grid; gap: 2px; border: 1px solid var(--btn-line); background: var(--surface); border-radius: 14px; padding: 10px 14px; min-height: 64px; align-content: center; text-align: center; }
.svc-opt2 .s-name { font-weight: 800; font-size: 1.05rem; }
.svc-opt2 .s-sub { font-size: .8rem; color: var(--muted); }
.svc-opt2 input:checked + span.box { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.svc-opt2 input:checked + span.box .s-sub { color: inherit; opacity: .9; }
.svc-opt2 input:focus-visible + span.box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* The heading above the cards: what you are editing, the total, and the copy button. */
.edit-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 12px; }
.edit-head h2 { font-size: 1.25rem; }
.edit-head .btn { margin-left: auto; }

/* Section cards, one per section, with a big stepper per role. */
.needs-grid2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.need-card2 h3 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.need-card2 .row { margin-bottom: 2px; }
.sec-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.role-row2 { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.role-row2 .who { flex: 1 1 120px; min-width: 0; }
.role-row2 .role-name { font-weight: 700; display: block; }
.role-row2 .role-words { color: var(--muted); font-size: .85rem; display: block; }
.stepper2 { display: inline-flex; align-items: center; gap: 6px; }
.stepper2 button { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--field-line); background: var(--surface); font-size: 1.5rem; font-weight: 700; cursor: pointer; line-height: 1; color: var(--text); }
.stepper2 button:hover:not([aria-disabled="true"]) { background: var(--brand-tint); border-color: var(--brand); }
.stepper2 button[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.stepper2 input { width: 64px; height: 48px; text-align: center; font-size: 1.3rem; font-weight: 800; border: 1px solid var(--field-line); border-radius: 14px; background: var(--surface); color: var(--text); }
.stepper2 input::-webkit-outer-spin-button, .stepper2 input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper2 input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* Roles nobody is needed for: one quiet line with a one-tap "add" button each. */
.not-needed { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.not-needed .lbl { color: var(--muted); font-size: .85rem; margin: 0 0 6px; }
.not-needed .btn-row { gap: 6px; }
.off-note { margin: 10px 0 0; color: var(--muted); font-size: .8rem; }

/* A closed day: one plain panel instead of empty cards. */
.closed-panel { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px 18px; text-align: center; background: var(--surface); }
.closed-panel h2 { margin-bottom: 6px; }
.closed-panel p { color: var(--muted); max-width: 48ch; margin: 0 auto 6px; }

/* Whole week at a glance: first column stays put while the rest scrolls on a phone. */
.wk2 th:first-child, .wk2 td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.wk2 thead th:first-child { background: var(--head-bg); }
.wk2 th, .wk2 td { white-space: nowrap; }
.wk2 .wk-total th, .wk2 .wk-total td { background: var(--head-bg); }
.wk2 th.sec { font-weight: 600; }
.wk-cell2 { min-width: 44px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 700; cursor: pointer; color: var(--text); }
.wk-cell2:hover { background: var(--brand-tint); border-color: var(--brand); }
.wk-cell2.current { background: var(--brand); color: var(--on-brand); }
.wk-cell2.closed { color: var(--muted); font-weight: 500; }

/* Plain-language "what happens next" card and the real/pretend card. */
.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; }
.real-card { margin-top: 14px; }
.real-card summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.real-card ul { margin: 6px 0 10px; padding-left: 20px; }
.real-card li { margin: 3px 0; }
.real-card h3 { margin: 10px 0 2px; font-size: .95rem; }

/* Changes this visit (a record; the Undo bar handles the last one). */
.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); }

/* Undo bar: fixed at the bottom, never covers the content (the page gets extra bottom room). */
.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; max-width: calc(100vw - 24px); 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); }
body.has-undo main { padding-bottom: 120px; }
body.has-undo .toast { bottom: 92px; }      /* the short toast sits above the Undo bar, never on top of it */
.svc-opt2 .s-sub span { display: block; }   /* times on one line, people on the next */

/* Keep the (yellow) simulated tag readable on the dark bar. */
.undo-bar .sim-tag { background: #ffd666; color: #2b2140; }

/* Dialog pieces for "Use these numbers on other days" */
.copy-days { display: grid; gap: 6px; }
.copy-day2 { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.copy-day2 input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.copy-day2 .cd-name { font-weight: 700; display: block; }
.copy-day2 .cd-now { color: var(--muted); font-size: .85rem; display: block; }
.copy-day2.is-closed { opacity: .7; cursor: not-allowed; }

@media (max-width: 960px) { .needs-grid2 { grid-template-columns: minmax(0, 1fr); } .edit-head .btn { margin-left: 0; } }
@media (max-width: 480px) { .step .help { margin-left: 0; } .undo-bar { bottom: 8px; border-radius: 12px; } }
