/* ==========================================================================
   ShiftChores — built on the brand logo: navy and seafoam teal, with a rounded
   geometric display face (Nunito) echoing the wordmark. Kept upscale with
   generous space, hairline rules, tracked uppercase labels and restrained colour.
   ========================================================================== */

:root {
  /* Brand: taken from the logo. */
  --navy: #0b2559;
  --navy-2: #163a7a;
  --teal: #4aa898;
  --teal-deep: #1f7f70; /* teal dark enough for text on white */
  --ink: var(--navy);
  --paper: #ffffff;
  --paper-2: #f6f5f2;
  --paper-3: #eeece7;
  --line: #e4e1db;
  --line-strong: #cfcac1;
  --muted: #666360;
  --faint: #9a958e;
  /* Jewel palette: one colour per shift, used sparingly so it stays refined. */
  --gold: #b8862b; --gold-soft: #fbf4e4;
  --sapphire: #2c5cb8; --sapphire-soft: #eaf0fb;
  --plum: #6b3fa0; --plum-soft: #f3edf9;
  --teal-soft: #e6f4f1;
  /* The logo's arrows run navy into teal. */
  --stripe: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 35%, var(--teal) 100%);
  --accent: var(--teal-deep);
  --on-accent: #ffffff;
  --accent-soft: #e6f4f1;
  --accent-tint: #bfe3dc;
  --success: #1d6b45;
  --success-soft: #e7f3ec;
  --warning: #8a5a00;
  --warning-soft: #fbf1dc;
  --danger: #a4231c;
  --danger-soft: #fbe9e7;
  --g-morning: var(--gold);
  --g-mid: var(--sapphire);
  --g-evening: var(--plum);
  --g-double: var(--teal-deep);
  --p-high: #b42318; --p-high-soft: #fdecea; --p-high-line: #f3c0bb;
  --p-normal: #2c5cb8; --p-normal-soft: #eaf0fb; --p-normal-line: #c6d4ef;
  --p-low: #5b6b7f; --p-low-soft: #eef1f5; --p-low-line: #d3dae3;

  --font-heading: 'Nunito', 'Avenir Next', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --radius: 2px;
  --radius-lg: 4px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .14);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: #1c2638;
  background: var(--paper-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; line-height: 1.1; letter-spacing: -.015em; margin: 0 0 .5rem; color: var(--navy); }
h1 { font-size: clamp(2rem, 3.6vw, 2.75rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.center { text-align: center; }

.label, .eyebrow, th, legend {
  font-size: .68rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { color: var(--accent); display: block; margin-bottom: .6rem; }

/* ---------- buttons ---------- */
button, .btn {
  --bg: transparent; --fg: var(--ink); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .6rem 1.15rem;
  font: inherit; font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg); background: var(--bg); border: 1px solid var(--bd); border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
button:hover, .btn:hover { --bg: var(--ink); --fg: var(--paper); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; }
button:disabled:hover { --bg: transparent; --fg: var(--ink); }
button.primary, .btn.primary { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
button.primary:hover, .btn.primary:hover { --bg: var(--accent); --bd: var(--accent); --fg: var(--on-accent); }
button.primary:disabled:hover { --bg: var(--ink); --fg: var(--paper); --bd: var(--ink); }
button.accent { --bg: var(--accent); --fg: var(--on-accent); --bd: var(--accent); }
button.accent:hover { --bg: var(--ink); --bd: var(--ink); }
button.danger { --fg: var(--danger); --bd: var(--danger); }
button.danger:hover { --bg: var(--danger); --fg: #fff; }
button.ghost { --bd: transparent; }
button.ghost:hover { --bg: var(--paper-3); --fg: var(--ink); }
button.link {
  border: 0; background: none; padding: .15rem 0; min-height: 0; color: var(--ink);
  text-transform: none; letter-spacing: 0; font-size: .9rem; font-weight: 500; text-decoration: underline;
}
button.link:hover { --bg: transparent; color: var(--accent); }
button.link.danger { color: var(--danger); }
button.small { min-height: 32px; padding: .35rem .75rem; font-size: .62rem; }
button.big { min-height: 54px; padding: .9rem 1.8rem; font-size: .76rem; }

/* ---------- forms ---------- */
label { display: grid; gap: .35rem; font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #3f3c38; }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--paper);
  min-height: 42px; padding: .55rem .75rem; min-width: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
select.small { min-height: 34px; padding: .3rem .5rem; font-size: .85rem; }
textarea { width: 100%; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .85rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { accent-color: var(--accent); }
input[type=file] { border-style: dashed; padding: .5rem; }
.form-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }

.switch { display: inline-flex; flex-direction: row; align-items: center; gap: .6rem; cursor: pointer; color: var(--ink); font-size: .9rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.switch input { appearance: none; width: 2.5rem; height: 1.4rem; min-height: 0; border-radius: 999px; background: var(--line-strong); position: relative; padding: 0; border: 0; cursor: pointer; flex: none; transition: background .2s var(--ease); }
.switch input::after { content: ''; position: absolute; top: .2rem; left: .2rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: left .2s var(--ease); }
.switch input:checked { background: var(--ink); }
.switch input:checked::after { left: 1.3rem; }

/* ---------- surfaces ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.1rem, 2.4vw, 1.6rem); }
.stack { display: grid; gap: 1.1rem; }
/* Grid children default to min-width:auto, which lets a wide table push the page sideways. */
.stack > *, .grid-2 > * { min-width: 0; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.1rem; align-items: start; }
section.card > h2:first-child { margin-bottom: .9rem; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); background: var(--paper-2); white-space: nowrap; }
td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf8; }

.badge {
  display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .5rem;
  font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--line-strong); border-radius: var(--radius); color: #3a3835; background: var(--paper);
}
.badge.ok { background: var(--success-soft); border-color: #bfdccb; color: var(--success); }
.badge.warn { background: var(--warning-soft); border-color: #ecd6a6; color: var(--warning); }
.badge.bad { background: var(--danger-soft); border-color: #f1c2bd; color: var(--danger); }
.badge.info { background: var(--accent-soft); border-color: var(--accent-tint); color: var(--ink); }
.badge.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.count { display: inline-grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: 0; }

.group { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; white-space: nowrap; }
.group::before { content: ''; width: .55rem; height: .55rem; background: var(--muted); transform: rotate(45deg); flex: none; }
.group.morning::before { background: var(--g-morning); }
.group.mid::before { background: var(--g-mid); }
.group.evening::before { background: var(--g-evening); }
.group.double::before { background: var(--g-double); }

/* Priority colour code: High = red, Normal = blue, Low = slate. */
.prio { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .5rem; border: 1px solid; border-radius: var(--radius); font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.prio::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prio.high { color: var(--p-high); background: var(--p-high-soft); border-color: var(--p-high-line); }
.prio.normal { color: var(--p-normal); background: var(--p-normal-soft); border-color: var(--p-normal-line); }
.prio.low { color: var(--p-low); background: var(--p-low-soft); border-color: var(--p-low-line); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
/* Hairlines drawn per tile, so a short last row doesn't leave a grey filler cell. */
.stat { background: var(--paper); padding: 1.1rem 1.25rem; outline: 1px solid var(--line); }
.stat .n { font-family: var(--font-heading); font-weight: 800; color: var(--navy); font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1; margin-bottom: .45rem; }
.stat .l { font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat.dark { background: var(--ink); color: #fff; }
.stat.dark .l { color: rgba(255, 255, 255, .65); }
.stat.dark .n { color: #fff; }

.notice { padding: .85rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); font-size: .9rem; }
.notice.warn { border-left-color: var(--warning); background: var(--warning-soft); }
.notice.bad { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.ok { border-left-color: var(--success); background: var(--success-soft); }

.meter { height: 6px; border-radius: 999px; background: var(--paper-3); overflow: hidden; margin-top: .6rem; min-width: 80px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .6s var(--ease); }
.points-n { font-family: var(--font-heading); font-weight: 800; color: var(--navy); font-size: 2.2rem; line-height: 1; }

details > summary { cursor: pointer; font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--paper-3); padding: .1em .35em; border-radius: 2px; }

#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 60; width: min(92vw, 460px); }
#toast div { background: var(--ink); color: #fff; padding: .8rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: .9rem; animation: rise .35s var(--ease); }
#toast div.bad { background: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--font-heading); font-size: .95rem; flex: none; }
.brand-name { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 500; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-body); font-size: .55rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-top: .15rem; }

/* ---------- manager shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.nav { display: grid; gap: 2px; }
.nav button {
  width: 100%; justify-content: space-between; border: 0; border-left: 2px solid transparent; border-radius: 0;
  min-height: 40px; padding: .5rem .75rem; font-size: .66rem; color: var(--muted);
}
.nav button:hover { --bg: var(--paper-2); --fg: var(--ink); }
.nav button.active { color: var(--navy); border-left-color: var(--teal); background: var(--teal-soft); }
.side .bottom { margin-top: auto; padding: 0 .75rem; display: grid; gap: .25rem; }
.main { padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.75rem) 5rem; max-width: 1240px; width: 100%; min-width: 0; }
.page-head { margin-bottom: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); align-items: flex-end; }
.page-head h1 { margin: 0; }
.page-head p { margin: .5rem 0 0; max-width: 46rem; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: column; gap: .75rem; padding: 1rem 16px .5rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { display: flex; overflow-x: auto; gap: 0; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .nav button { width: auto; border-left: 0; border-bottom: 2px solid transparent; }
  .nav button.active { border-bottom-color: var(--accent); background: none; }
  .side .bottom { display: none; }
  .main { padding: 1.25rem 16px 4rem; }
}

/* ---------- landing & login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.login .art { background: var(--ink); color: #fff; padding: clamp(2rem, 6vw, 5rem); display: flex; flex-direction: column; justify-content: space-between; gap: 3rem; }
.login .art h1 { color: #fff; font-size: clamp(2.6rem, 5.5vw, 5rem); line-height: .98; letter-spacing: -.025em; max-width: 12ch; }
.login .art h1 em { color: #8fd6c8; font-style: normal; }
.login .art p { color: rgba(255, 255, 255, .72); max-width: 34rem; font-size: 1.05rem; }
.login .art .label { color: rgba(255, 255, 255, .55); }
.login .art .brand { color: #fff; }
.login .art .brand-mark { background: linear-gradient(#fff, #fff) top / 100% calc(100% - 5px) no-repeat, var(--stripe); color: var(--ink); }
.login .art .brand-name small { color: rgba(255, 255, 255, .55); }
.login .pane { display: grid; place-items: center; padding: clamp(1.5rem, 5vw, 4rem) 16px; background: var(--paper); }
.login .card { width: min(100%, 380px); display: grid; gap: 1rem; border: 0; padding: 0; }
.login .card h2 { font-size: 2rem; margin: 0; }
@media (max-width: 860px) {
  .login { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- kiosk ---------- */
.kiosk { max-width: 980px; margin: 0 auto; padding: 0 16px 4rem; }
.kiosk header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem 0; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.kiosk header select { min-height: 38px; }
.clock { font-family: var(--font-heading); font-weight: 700; color: var(--navy); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.kiosk h1 { margin-bottom: .35rem; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); background: var(--paper); border: 1px solid var(--line); margin-top: 1.5rem; }
.person {
  min-height: 92px; border: 0; border-radius: 0; --bg: var(--paper); justify-content: flex-start; padding: 1.1rem 1.25rem; outline: 1px solid var(--line);
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; letter-spacing: 0; text-transform: none; white-space: normal; text-align: left;
}
.person:hover { --bg: var(--ink); --fg: #fff; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); max-width: 320px; margin: 0 auto; }
.pinpad button { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; letter-spacing: 0; min-height: 72px; border: 0; border-radius: 0; --bg: var(--paper); }
.pinpad button:hover { --bg: var(--ink); --fg: #fff; }
.pinpad span { background: var(--paper); }
.pin-dots { display: flex; justify-content: center; gap: .9rem; margin: 1.25rem 0 1.5rem; }
.pin-dots i { width: .8rem; height: .8rem; border: 1px solid var(--ink); transform: rotate(45deg); transition: background .15s; }
.pin-dots i.on { background: var(--ink); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); background: var(--paper); border: 1px solid var(--line); }
.choice {
  flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: .35rem; min-height: 140px; padding: 1.25rem; outline: 1px solid var(--line);
  border: 0; border-radius: 0; --bg: var(--paper); text-transform: none; letter-spacing: 0; white-space: normal; text-align: left;
}
.choice .group { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.choice small { color: var(--muted); font-size: .85rem; font-weight: 400; }
.choice:hover { --bg: var(--paper-2); --fg: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .counts { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .5rem; }

/* shift header with progress ring */
.shift-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
.ring { --p: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--accent)) calc(var(--p) * 1%), var(--paper-3) 0); transition: --p .8s var(--ease); position: relative; }
.ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--paper); }
.ring b { position: relative; font-family: var(--font-heading); font-size: 1.3rem; font-weight: 800; color: var(--navy); line-height: 1; text-align: center; }
.ring b small { display: block; font-family: var(--font-body); font-size: .55rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: .2rem; }
@media (max-width: 560px) { .shift-head { grid-template-columns: auto minmax(0, 1fr); } .shift-head > :last-child { grid-column: 1 / -1; } }

/* chore cards */
.chores { display: grid; gap: .75rem; }
.chore { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: center; transition: border-color .2s var(--ease), box-shadow .25s var(--ease); position: relative; }
/* A coloured spine shows priority at a glance. */
.chore { border-left-width: 5px; }
.chore.p-high { border-left-color: var(--p-high); }
.chore.p-normal { border-left-color: var(--p-normal); }
.chore.p-low { border-left-color: var(--p-low); }
.chore.in_progress { border-top-color: var(--ink); border-right-color: var(--ink); border-bottom-color: var(--ink); box-shadow: var(--shadow); }
/* Finished: the whole card turns green so it reads as complete from across the room. */
.chore.done, .chore.approved { background: var(--success-soft); border-color: #bfdccb; border-left-color: var(--success); }
.chore .praise { margin-top: .3rem; font-size: .9rem; font-weight: 600; color: var(--success); }
.chore.just-done { animation: glow 1.4s var(--ease); }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(29, 107, 69, .45); } 100% { box-shadow: 0 0 0 14px rgba(29, 107, 69, 0); } }
.photo-need { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink); font-weight: 600; }
svg.icon { width: 15px; height: 15px; flex: none; }
.chore .title { font-family: var(--font-heading); font-weight: 700; color: var(--navy); font-size: 1.12rem; line-height: 1.25; }
.chore.done .title, .chore.approved .title { color: #1b4d35; }
.chore .meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; margin-top: .35rem; font-size: .85rem; color: var(--muted); }
.chore .time { display: inline-flex; align-items: center; gap: .35rem; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chore .time svg { width: 15px; height: 15px; }
.chore .note { grid-column: 2 / -1; }
.chore .actions { display: flex; gap: .4rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 560px) {
  .chore { grid-template-columns: auto minmax(0, 1fr); }
  .chore .actions { grid-column: 1 / -1; }
  .chore .actions button:not(.link) { flex: 1; }
}

.tick { width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; background: var(--paper); flex: none; }
.tick svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tick path { stroke-dasharray: 30; stroke-dashoffset: 30; }
.chore.in_progress .tick { border-color: var(--ink); }
.chore.in_progress .tick svg { display: none; }
.chore.in_progress .tick::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s var(--ease) infinite; }
.chore.done .tick, .chore.approved .tick { background: var(--success); border-color: var(--success); color: #fff; }
.chore.done .tick path, .chore.approved .tick path { stroke-dashoffset: 0; }
.chore.just-done .tick { animation: pop .5s var(--ease); }
.chore.just-done .tick path { animation: draw .45s .1s var(--ease) both; }
@keyframes draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .6; } 50% { transform: scale(1); opacity: 1; } }

/* elapsed bar for in-progress chores */
.elapsed { grid-column: 2 / -1; height: 3px; background: var(--paper-3); overflow: hidden; }
.elapsed span { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.elapsed.over span { background: var(--warning); }

/* press-and-hold to finish */
button.hold { position: relative; overflow: hidden; isolation: isolate; user-select: none; -webkit-user-select: none; touch-action: none; }
button.hold::before { content: ''; position: absolute; inset: 0; background: var(--accent); transform: scaleX(0); transform-origin: left; z-index: -1; }
button.hold.holding::before { transform: scaleX(1); transition: transform var(--hold, 700ms) linear; }
button.hold.holding { --fg: #fff; --bd: var(--accent); }

.burst { position: absolute; right: 1.25rem; top: .25rem; font-family: var(--font-heading); font-size: 1.4rem; color: var(--accent); pointer-events: none; animation: burst 1.2s var(--ease) forwards; }
@keyframes burst { 0% { opacity: 0; transform: translateY(6px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.05); } 100% { opacity: 0; transform: translateY(-28px); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -14px; width: 8px; height: 14px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate3d(var(--dx), 105vh, 0) rotate(var(--r)); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ---------- photos ---------- */
.photo-thumb { padding: 0; min-height: 0; width: 64px; height: 64px; border: 1px solid var(--line); overflow: hidden; flex: none; --bg: var(--paper-2); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb:hover { --bg: var(--paper-2); border-color: var(--ink); }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(11, 37, 89, .9); display: grid; place-items: center; gap: 1rem; padding: 16px; align-content: center; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 80vh; object-fit: contain; background: #000; }
.lightbox button { --fg: #fff; --bd: rgba(255, 255, 255, .6); }

/* ==========================================================================
   Colour: the jewel palette, applied as accents rather than fills.
   ========================================================================== */

/* A fine four-colour rule across the top of every page. */
body::before { content: ''; position: fixed; inset: 0 0 auto; height: 4px; background: var(--stripe); z-index: 90; }

/* Logo mark: black square standing on the four shift colours. */
.brand-mark { background: linear-gradient(var(--ink), var(--ink)) top / 100% calc(100% - 5px) no-repeat, var(--stripe); padding-bottom: 5px; }

/* Shift colour keys, used by tiles, the ring and the shift header. */
.morning { --c: var(--gold); --c-soft: var(--gold-soft); }
.mid { --c: var(--sapphire); --c-soft: var(--sapphire-soft); }
.evening { --c: var(--plum); --c-soft: var(--plum-soft); }
.double { --c: var(--teal); --c-soft: var(--teal-soft); }

/* Rotating colour for repeated tiles (stats, menu, names). */
.stats > :nth-child(4n + 1), .nav button:nth-child(4n + 1), .people .person:nth-child(4n + 1) { --c: var(--gold); }
.stats > :nth-child(4n + 2), .nav button:nth-child(4n + 2), .people .person:nth-child(4n + 2) { --c: var(--sapphire); }
.stats > :nth-child(4n + 3), .nav button:nth-child(4n + 3), .people .person:nth-child(4n + 3) { --c: var(--plum); }
.stats > :nth-child(4n + 4), .nav button:nth-child(4n + 4), .people .person:nth-child(4n + 4) { --c: var(--teal); }

.page-head h1::after { content: ''; display: block; width: 72px; height: 3px; margin-top: .65rem; background: var(--stripe); }
.stat { box-shadow: inset 0 3px 0 var(--c, transparent); }
.nav button.active { border-left-color: var(--teal); }
@media (max-width: 860px) { .nav button.active { border-bottom-color: var(--teal); } }

.person { gap: .8rem; }
.person::before { content: ''; width: .55rem; height: .55rem; transform: rotate(45deg); background: var(--c); flex: none; transition: background .2s var(--ease); }
.person:hover { --bg: var(--c); --fg: #fff; }
.person:hover::before { background: #fff; }
.pinpad button:hover { --bg: var(--sapphire); --fg: #fff; }

.choice { box-shadow: inset 0 4px 0 var(--c, var(--line)); }
.choice:hover { --bg: var(--c-soft, var(--paper-2)); --fg: var(--ink); box-shadow: inset 0 4px 0 var(--c, var(--ink)), inset 0 0 0 1px var(--c, var(--ink)); }
.shift-head { box-shadow: inset 0 4px 0 var(--c, var(--accent)); }

#toast div { border-left: 4px solid var(--teal); }
#toast div.bad { border-left-color: #fff; }

/* Back links at the top of every page. */
.backbar { margin: -.5rem 0 1rem; }
button.back {
  --bg: transparent; --bd: transparent; --fg: var(--muted);
  min-height: 0; padding: .3rem 0; gap: .45rem; font-size: .64rem; margin-bottom: .6rem;
}
button.back:hover { --bg: transparent; --fg: var(--sapphire); }
button.back span { font-size: 1rem; letter-spacing: 0; transition: transform .2s var(--ease); }
button.back:hover span { transform: translateX(-3px); }
.page-head button.back { display: flex; }

.person .you { margin-left: auto; font-family: var(--font-body); font-size: .58rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--c); }
.person:hover .you { color: #fff; }

/* ---------- gamification ---------- */
.game-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .75rem; margin: -0.5rem 0 1.5rem; }
.game-tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.15rem; box-shadow: inset 4px 0 0 var(--c); }
.game-tile.gold { --c: var(--gold); }
.game-tile.sapphire { --c: var(--sapphire); }
.game-tile .big-n { font-family: var(--font-heading); font-weight: 800; color: var(--navy); font-size: 2rem; line-height: 1; margin: .35rem 0 .3rem; }
.game-tile .big-n small { font-family: var(--font-body); font-size: .85rem; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: .6rem; margin-top: 1rem; }
.medal { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); opacity: .55; }
.medal.earned { opacity: 1; border-style: solid; border-color: #e7d3a6; background: var(--gold-soft); }
.medal-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--faint); }
.medal.earned .medal-mark { background: var(--gold); border-color: var(--gold); color: #fff; }
.leaders { list-style: none; margin: .6rem 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.leaders li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; padding: .6rem .8rem; border-bottom: 1px solid var(--line); background: var(--paper); }
.leaders li:last-child { border-bottom: 0; }
.leaders li.you { background: var(--teal-soft); font-weight: 600; }
.leaders .rank { font-family: var(--font-heading); font-weight: 800; color: var(--navy); font-size: 1.15rem; }
.leaders li:nth-child(1) .rank { color: var(--gold); }
.leaders .score { color: var(--muted); font-size: .85rem; }
.program { padding-top: .9rem; border-top: 1px solid var(--line); }
.program p { margin: .4rem 0 0 3.1rem; max-width: 46rem; }
.program-select { display: flex; flex-direction: row; align-items: center; gap: .9rem; color: var(--ink); font-size: .9rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.program-select select { min-height: 36px; }

/* ---------- logo ---------- */
.brand { flex-direction: column; align-items: flex-start; gap: .35rem; }
.brand .logo { display: block; height: auto; }
.brand small { font-size: .58rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.side .brand .logo { width: 196px; }
.kiosk header .brand .logo { width: 210px; }
.login .art .brand .logo { width: min(320px, 70vw); }
.login .art .brand small { color: rgba(255, 255, 255, .6); }
.login .art { background: radial-gradient(120% 90% at 100% 100%, rgba(74, 168, 152, .28), transparent 60%), var(--navy); }
.tagline { font-family: var(--font-heading); font-weight: 700; color: var(--teal-deep); letter-spacing: .01em; }
@media (max-width: 860px) {
  .side .brand .logo { width: 150px; }
  .kiosk header .brand .logo { width: 172px; }
}
.order-cell { white-space: nowrap; }
.order-cell .pos { display: inline-block; min-width: 1.4rem; font-family: var(--font-heading); font-weight: 800; color: var(--navy); }
.order-cell .movers { display: inline-flex; gap: .25rem; margin-left: .35rem; vertical-align: middle; }
button.move { min-height: 0; width: 28px; height: 28px; padding: 0; font-size: .9rem; letter-spacing: 0; --bd: var(--line-strong); }
button.move:hover { --bg: var(--teal-soft); --fg: var(--navy); --bd: var(--teal); }
.program .program-extra { margin: .8rem 0 0 3.1rem; }

/* ---------- sign-in ---------- */
.login .pane .card { width: min(100%, 440px); }
.demo-accounts:empty { display: none; }
.demo-accounts { margin-top: .75rem; padding-top: 1rem; border-top: 1px solid var(--line); display: grid; gap: .6rem; }
.demo-list { display: grid; gap: .45rem; }
button.demo-person {
  --bg: var(--paper); --fg: var(--navy); --bd: var(--line);
  justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: .1rem;
  min-height: 0; padding: .6rem .8rem; text-transform: none; letter-spacing: 0; font-size: .92rem; white-space: normal; text-align: left;
}
button.demo-person small { color: var(--muted); font-weight: 400; font-size: .8rem; }
button.demo-person:hover { --bg: var(--teal-soft); --fg: var(--navy); --bd: var(--teal); }
.inbox { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-2); }
.inbox-bar { display: grid; gap: .15rem; padding: .7rem .9rem; border-bottom: 1px solid var(--line); background: var(--teal-soft); }
.mail { background: var(--paper); margin: .75rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); display: grid; gap: .6rem; }
.mail-head { display: grid; gap: .2rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.mail-subject { font-family: var(--font-heading); font-weight: 800; color: var(--navy); margin-top: .2rem; }
.mail-logo { width: 150px; margin: .3rem 0; }
.mail p { margin: 0; font-size: .92rem; }
.mail .btn { justify-self: start; }
.org-list { display: grid; gap: .6rem; }
.org { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: inset 4px 0 0 var(--teal); }
.org strong { font-family: var(--font-heading); font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.signed-in { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- chore groups ---------- */
.filter-tabs { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 1rem; background: var(--paper-3); border-radius: 999px; }
.filter-tabs button { --bg: transparent; --bd: transparent; --fg: var(--muted); min-height: 34px; padding: .3rem .9rem; border-radius: 999px; font-size: .64rem; gap: .45rem; }
.filter-tabs button:hover { --bg: var(--paper); --fg: var(--navy); }
.filter-tabs button.on { --bg: var(--paper); --fg: var(--navy); box-shadow: 0 1px 2px rgba(11, 37, 89, .12); }
.filter-tabs .n { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: 999px; background: var(--paper-3); color: var(--navy); font-size: .62rem; letter-spacing: 0; }
.filter-tabs button.on .n { background: var(--teal); color: #fff; }
.group-block { margin-top: 1.75rem; }
.group-head { display: flex; justify-content: space-between; align-items: flex-end; gap: .75rem; flex-wrap: wrap; padding-bottom: .6rem; margin-bottom: .75rem; border-bottom: 2px solid var(--teal); }
.group-head h3 { margin: .2rem 0 0; font-size: 1.25rem; }
.chore.is-group:not(.done):not(.approved) { background: linear-gradient(90deg, var(--teal-soft), var(--paper) 40%); }
.group-tag, .mine-tag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; font-family: var(--font-body); font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; }
.group-tag { background: var(--teal-soft); color: var(--teal-deep); border: 1px solid var(--accent-tint); }
.mine-tag { background: var(--navy); color: #fff; }
.member-picker { display: flex; flex-wrap: wrap; gap: .4rem; }
.member-picker .member { display: inline-flex; flex-direction: row; align-items: center; gap: .4rem; padding: .35rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--navy); background: var(--paper); }
.member-picker .member input { margin: 0; }
.member-picker .member.on, .member-picker .member:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); }
.group-card { box-shadow: inset 4px 0 0 var(--teal); }
.group-card .group-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--navy); border-color: transparent; padding-left: 0; min-width: 0; flex: 1; }
.group-card .group-name:hover, .group-card .group-name:focus { border-color: var(--line-strong); padding-left: .6rem; }
.not-scheduled { box-shadow: inset 4px 0 0 var(--line-strong); }
.next-shift { display: grid; gap: .3rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); }
button.demo-person .demo-try { margin-top: .3rem; font-size: .8rem; font-weight: 400; line-height: 1.45; color: #3a4357; }
button.demo-person:hover .demo-try { color: var(--navy); }
.group-block.individual { margin-top: .5rem; }
.group-block.individual .group-head { border-bottom-color: var(--navy); }
/* The sign-in side can be long (demo accounts): keep the brand panel pinned to the screen instead of
   stretching with it, so the headline stays in view. Phones stack the two panels as before. */
@media (min-width: 861px) {
  .login { align-items: start; }
  .login .art { position: sticky; top: 0; height: 100vh; }
  .login .pane { min-height: 100vh; }
}

/* ---------- extra chores ---------- */
.group-block.extras .group-head { border-bottom-color: var(--gold); }
.extra-tag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; font-family: var(--font-body); font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; background: var(--gold-soft); color: #7a5a17; border: 1px solid #e7d3a6; }
.chore.extra-open { border-style: dashed; border-left-style: solid; background: linear-gradient(90deg, var(--gold-soft), var(--paper) 45%); }
.chore.extra-open.taken { opacity: .6; background: var(--paper-2); }
.chore.extra-open .tick { border-style: dashed; }
.bonus-pts { font-weight: 700; color: #7a5a17; }

/* ---------- account notices, store scope ---------- */
.account-banner:empty { display: none; }
.account-banner { display: grid; gap: .6rem; margin-bottom: 1.2rem; }
.account-banner .notice { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.notice.info { border-left-color: var(--sapphire); background: var(--sapphire-soft); }
.notice.dark, .notice.support { border-left-color: var(--gold); background: var(--navy); color: #fff; }
.notice.support a { color: #fff; text-decoration: underline; }
.btn.dark { --bg: var(--ink); --fg: #fff; --bd: var(--ink); }
.scope-note { padding: .55rem .7rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }
tr.locked td { color: var(--muted); background: var(--paper-2, #faf9f7); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
.field { display: grid; gap: .35rem; }
.store-picker { display: grid; gap: .45rem; }
.store-picker .row { gap: 1rem; }
.store-checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.store-checks[hidden] { display: none; }

/* ---------- stores ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.1rem; }
.store-card { display: grid; gap: .9rem; box-shadow: inset 0 3px 0 var(--teal); }
.store-card.closed { opacity: .65; box-shadow: inset 0 3px 0 var(--line-strong); }
.store-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; color: var(--navy); border-color: transparent; padding-left: 0; min-width: 0; flex: 1; }
.store-name:hover, .store-name:focus { border-color: var(--line-strong); padding-left: .5rem; }
.stats.mini .stat { padding: .7rem .9rem; }
.stats.mini .stat .n { font-size: 1.5rem; }

/* ---------- reports ---------- */
.report-filters { display: flex; flex-wrap: wrap; gap: .8rem 1.1rem; align-items: end; }
.report-filters label { display: grid; gap: .3rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; margin-top: 1rem; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; min-width: 3px; height: 100%; position: relative; }
.bar span { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 2px 2px 0 0; }
.bar .assigned { background: var(--accent-tint); }
.bar .completed { background: var(--teal-deep); }
.bar:hover .completed { background: var(--navy); }
.legend { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-left: .6rem; }
.legend i.assigned { background: var(--accent-tint); }
.legend i.completed { background: var(--teal-deep); }
table.report td { white-space: nowrap; }
.rate { font-weight: 700; }
.rate.good { color: var(--success); }
.rate.ok { color: var(--warning); }
.rate.low { color: var(--danger); }
.flag-n { font-weight: 700; color: var(--danger); }

/* ---------- billing ---------- */
.big-price { font-family: var(--font-heading); font-weight: 900; font-size: 2.1rem; color: var(--navy); line-height: 1.1; }
.big-price small { font-size: .9rem; font-weight: 700; color: var(--muted); margin-left: .15rem; }
.big-price.muted { color: var(--muted); }
.seat-meter { height: 10px; border-radius: 999px; background: var(--paper-3, #eeebe6); overflow: hidden; }
.seat-meter span { display: block; height: 100%; background: var(--teal-deep); border-radius: inherit; }
.seat-meter span.full { background: var(--warning); }
.seg { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; min-height: 36px; }
.seg button.on { --bg: var(--ink); --fg: #fff; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.1rem; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: .7rem; position: relative; box-shadow: inset 0 3px 0 var(--line-strong); }
.plan-card h3 { margin: 0; font-family: var(--font-heading); font-weight: 900; font-size: 1.3rem; color: var(--navy); }
.plan-card.featured { box-shadow: inset 0 3px 0 var(--teal); }
.plan-card.current { box-shadow: inset 0 0 0 2px var(--teal-deep); }
.plan-card > button, .plan-card > .btn { margin-top: auto; }
.plan-flag { position: absolute; top: .8rem; right: .8rem; font-size: .6rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-deep); }
.plan-points { margin: 0; padding-left: 1.1rem; color: var(--muted); display: grid; gap: .25rem; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.events li { padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
.events li:last-child { border-bottom: 0; }

/* ---------- sign-up ---------- */
.signup-plans { display: grid; gap: .6rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.mini-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: .5rem; }
.mini-plan { display: grid; gap: .15rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); }
.mini-plan strong { font-family: var(--font-heading); color: var(--navy); }
.org.admin-org { box-shadow: inset 4px 0 0 var(--gold); }

/* ---------- admin console ---------- */
body.admin .side { background: linear-gradient(180deg, var(--paper) 0%, var(--gold-soft) 100%); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.facts dt { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); align-self: center; }
.facts dd { margin: 0; }
.admin-actions { display: grid; gap: .7rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.admin-plans form { gap: .7rem; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.steps li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .8rem; align-items: center; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); }
.steps li .tick { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: .8rem; color: #fff; }
.steps li.done .tick { background: var(--teal-deep); border-color: var(--teal-deep); }
.steps li.done strong { color: var(--muted); text-decoration: line-through; }

/* ---------- sign-in: demo shortcuts ---------- */
.or-line { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.demo-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .6rem; }
.demo-feature {
  display: grid; gap: .3rem; align-content: start; text-align: left; padding: 1rem; min-height: 0; white-space: normal;
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .85rem; line-height: 1.45;
  border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); text-decoration: none; background: var(--paper);
}
.demo-feature strong { font-family: var(--font-heading); font-weight: 900; font-size: 1.1rem; color: var(--navy); }
.demo-feature small { font-weight: 700; color: var(--teal-deep); }
.demo-feature.admin { box-shadow: inset 0 3px 0 var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--paper) 70%); }
.demo-feature.signup { box-shadow: inset 0 3px 0 var(--teal); background: linear-gradient(180deg, var(--teal-soft), var(--paper) 70%); }
.demo-feature:hover { --bg: var(--paper); border-color: var(--navy); color: var(--ink); }
.demo-group { margin-top: .4rem; }
.demo-top:empty { display: none; }
.demo-top { display: grid; gap: .6rem; margin-bottom: 1.1rem; }

/* ---------- sign-up: terms, bot trap ---------- */
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.switch.terms { align-items: flex-start; font-size: .88rem; line-height: 1.45; }
.switch.terms input { margin-top: .2rem; }
.legal-links { margin: 0; text-align: center; }
.turnstile { min-height: 65px; }

/* ---------- admin: two-step sign-in, system status, danger zone ---------- */
.mfa-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mfa-head .brand .logo { width: 170px; }
.mfa-page { max-width: 36rem; margin: 1.5rem auto 3rem; padding: 0 16px; display: grid; gap: 1.5rem; }
.mfa-card { max-width: 40rem; }
.mfa-qr { width: min(240px, 100%); padding: .4rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: .6rem; }
.mfa-qr svg { display: block; width: 100%; height: auto; }
.mfa-manual summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.mfa-steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .5rem; }
.mfa-key { font-size: 1rem; letter-spacing: .08em; padding: .15rem .4rem; background: var(--paper-3, #eeebe6); border-radius: var(--radius); word-break: break-all; }
.sys-grid { display: grid; gap: .55rem; margin-top: .8rem; }
.sys-row { display: grid; grid-template-columns: .7rem 11rem 1fr; gap: .2rem .7rem; align-items: baseline; }
.sys-row .muted { grid-column: 3; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--success); }
.dot.warn { background: var(--warning); }
.danger-zone { box-shadow: inset 0 3px 0 var(--danger); }
@media (max-width: 600px) { .sys-row { grid-template-columns: .7rem 1fr; } .sys-row > :nth-child(n+3) { grid-column: 2; } }

/* ---------- legal pages ---------- */
.legal { max-width: 44rem; margin: 0 auto; padding: 2rem 16px 4rem; line-height: 1.6; }
.legal .logo { height: 44px; width: auto; margin-bottom: 1.5rem; }
.legal h2 { margin-top: 1.8rem; font-size: 1.2rem; }
.legal ul { padding-left: 1.2rem; display: grid; gap: .4rem; }
.role-help { margin: .4rem 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.store-picker > .label { margin-top: .2rem; }
.store-picker [hidden], .store-checks[hidden] { display: none !important; }

/* =====================================================================
   Phones first. Everything below applies to narrow screens; desktop is unchanged.
   ===================================================================== */

/* Phone navigation (back office and admin): bottom bar + Menu sheet. Hidden on desktop. */
.tabbar, .sheet { display: none; }
@media (max-width: 860px) {
  .side .nav { display: none; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06);
    padding: 0 0 env(safe-area-inset-bottom);
  }
  .tabbar button {
    --bg: transparent; --bd: transparent; --fg: var(--muted); border: 0; border-radius: 0; min-height: 58px; padding: .4rem .2rem;
    font-size: .62rem; letter-spacing: .08em; white-space: normal; line-height: 1.2; position: relative; border-top: 3px solid transparent;
  }
  .tabbar button.on { --fg: var(--navy); border-top-color: var(--teal); background: var(--teal-soft); }
  .tabbar .count, .sheet-list .count { margin-left: .3rem; }
  .sheet:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 50; background: var(--paper);
    padding: 1rem 16px calc(1rem + env(safe-area-inset-bottom)); overflow-y: auto;
  }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }
  .sheet-head strong { font-family: var(--font-heading); font-size: 1.3rem; color: var(--navy); }
  .sheet-list { display: grid; gap: 2px; padding: .6rem 0; }
  .sheet-list button { justify-content: flex-start; min-height: 52px; border: 0; border-left: 3px solid transparent; --bd: transparent; font-size: .74rem; }
  .sheet-list button.on { border-left-color: var(--teal); background: var(--teal-soft); --fg: var(--navy); }
  .sheet-foot { margin-top: auto; display: grid; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
  .main { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .scope-note { padding: .3rem .5rem; font-size: .72rem; }
}

/* Thumb-sized controls, and 16px text in fields so phones don't zoom in on every tap. */
@media (max-width: 860px) {
  button, .btn { min-height: 44px; }
  button.small, .btn.small { min-height: 40px; padding: .5rem .85rem; font-size: .66rem; }
  button.link { min-height: 40px; }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  select.small { min-height: 42px; font-size: 16px; }
  input[type=checkbox], input[type=radio] { min-height: 0; }
  button.move { width: 40px; height: 40px; }
  .chore .actions button, .chore .actions .btn { min-height: 46px; padding-left: 1.1rem; padding-right: 1.1rem; }
  .form-row > label, .form-row > .field { flex: 1 1 100%; min-width: 0 !important; }
  .form-row > label input, .form-row > label select { width: 100%; max-width: none !important; }
  .page-head { flex-wrap: wrap; gap: .75rem; }
  .page-head .row { width: 100%; }
  .page-head .row > * { flex: 1 1 auto; }
}

/* Employee screen: the filter pills scroll inside themselves, never the page. */
@media (max-width: 860px) {
  .filter-tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tabs button { flex: 0 0 auto; min-height: 40px; }
}

/* Tables become cards: one card per row, each value under its column name. */
@media (max-width: 720px) {
  .table-wrap { overflow: visible; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards thead { display: none; }
  table.cards tr { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .7rem .9rem; margin-bottom: .7rem; background: var(--paper); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
  table.cards tr.clickable:active { background: var(--accent-soft); }
  table.cards td { border: 0; padding: .3rem 0; white-space: normal; }
  table.cards td:empty { display: none; }
  table.cards td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: .15rem;
    font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  }
  table.cards td:first-child { font-size: 1.02rem; padding-top: 0; }
  table.cards td:first-child::before { display: none; }
  table.cards td input:not([type=checkbox]):not([type=radio]), table.cards td select { width: 100%; min-width: 0 !important; }
  table.report td { white-space: normal; }
}

/* Sign-in on a phone: a compact brand header, so the form is on the first screen. */
@media (max-width: 860px) {
  .login .art { padding: 1rem 16px; gap: 0; min-height: 0; }
  .login .art > div, .login .art > .label { display: none; }
  .login .art .brand .logo { width: 210px; }
  .login .pane { place-items: start center; padding: 1.25rem 16px 3rem; }
  .login { min-height: 0; }
}

/* Long words (emails, links, keys) wrap instead of widening the page. */
main, .card, .notice { overflow-wrap: anywhere; }
pre, code { white-space: pre-wrap; word-break: break-word; }
@media (max-width: 860px) {
  .stat .n { font-size: clamp(1.35rem, 6.5vw, 1.9rem); overflow-wrap: normal; white-space: nowrap; }
  .stat { padding: .85rem .9rem; }
  .big-price { font-size: 1.7rem; overflow-wrap: normal; }
}
@media (max-width: 720px) {
  table.cards td[data-label] { display: grid; grid-template-columns: 6.8rem minmax(0, 1fr); column-gap: .8rem; align-items: baseline; }
  table.cards td[data-label]::before { grid-column: 1; grid-row: 1 / span 12; margin: 0; padding-top: .15rem; }
  table.cards td[data-label] > * { grid-column: 2; }
  table.cards td:first-child { display: block; }
}
@media (max-width: 720px) {
  table.cards td[data-label] > * { justify-self: start; max-width: 100%; }
  table.cards td[data-label] > input, table.cards td[data-label] > select, table.cards td[data-label] > .row, table.cards td[data-label] > form { justify-self: stretch; }
}
@media (max-width: 860px) {
  button.back { min-height: 44px; }
  .seg button { min-height: 44px; }
}
@media (max-width: 720px) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; width: 100%; }
  table.stack th { border: 0; padding: .6rem 0 .1rem; background: none; white-space: normal; }
  table.stack td { padding: 0 0 .6rem; }
}
@media (max-width: 720px) {
  /* Cells you type or pick in: label above, the field full width. */
  table.cards td[data-label]:has(input:not([type=checkbox]):not([type=radio]), select, textarea) { display: block; }
  table.cards td[data-label]:has(input:not([type=checkbox]):not([type=radio]), select, textarea)::before { margin-bottom: .25rem; }
}
/* Organization-defined shifts carry their own colour (--g / --c); the four defaults keep theirs. */
.group::before { background: var(--g, var(--muted)); }

/* ---------- Settings → Shifts ---------- */
.shift-list { display: grid; gap: .6rem; }
.shift-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.shift-row.add { border-style: dashed; }
.shift-row label { display: grid; gap: .3rem; }
.shift-row .swatch { width: 14px; height: 14px; border-radius: 3px; align-self: center; background: var(--line-strong); transform: rotate(45deg); }
@media (max-width: 720px) { .shift-row > label:not(.switch) { flex: 1 1 40%; } .shift-row > label:first-of-type { flex-basis: 100%; } }

/* ---------- employee screen: header account area, celebration ---------- */
.head-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.account { display: flex; align-items: center; gap: .45rem; }
.account:empty { display: none; }
.points-chip { display: inline-flex; align-items: baseline; gap: .15rem; padding: .45rem .75rem; border-radius: 999px; background: var(--gold-soft); border: 1px solid #e7d3a6; color: #7a5a17; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.points-chip strong { font-family: var(--font-heading); font-size: 1.05rem; color: var(--navy); }
.signed-in { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
@media (max-width: 560px) {
  .kiosk header { gap: .5rem; padding: .9rem 0; margin-bottom: 1rem; }
  .kiosk header .clock { font-size: 1.05rem; }
  .head-right { width: 100%; justify-content: space-between; }
}

.celebrate { position: fixed; inset: 0; z-index: 65; display: grid; place-items: center; padding: 16px; background: rgba(11, 37, 89, .28); animation: rise .25s var(--ease); }
.celebrate-card {
  display: grid; justify-items: center; gap: .35rem; text-align: center; width: min(100%, 360px); padding: 1.6rem 1.4rem 1.4rem;
  background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); border-top: 5px solid var(--teal); animation: pop .45s var(--ease);
}
.celebrate-card strong { font-family: var(--font-heading); font-weight: 900; font-size: 1.7rem; color: var(--navy); line-height: 1.1; }
.celebrate-card p { margin: 0; color: var(--muted); }
.celebrate-card p:nth-of-type(2) { color: var(--teal-deep); font-weight: 700; }
.celebrate-check { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--success); margin-bottom: .4rem; animation: pop .5s var(--ease); }
.celebrate-check svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; animation: draw .5s .15s var(--ease) both; }
.celebrate.big .celebrate-card { border-top-color: var(--gold); }
.celebrate.big .celebrate-check { background: var(--gold); width: 76px; height: 76px; }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card, .celebrate-check, .celebrate-check svg { animation: none; } }
.side .bottom .signout { width: 100%; margin-top: .4rem; }

/* ---------- swap ---------- */
.swap-requests { display: grid; gap: .6rem; margin: 0 0 1.5rem; }
.swap-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 4px solid var(--sapphire); background: var(--sapphire-soft); }
.swap-card .swap-title { font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; color: var(--navy); margin: .15rem 0 .3rem; }
.swap-note { margin-top: .35rem; font-size: .82rem; font-weight: 600; color: var(--sapphire); }
.sheet-modal { position: fixed; inset: 0; z-index: 60; background: rgba(11, 37, 89, .35); display: grid; align-items: end; justify-items: center; }
.sheet-modal-card {
  width: min(100%, 520px); max-height: 85vh; overflow-y: auto; background: var(--paper); display: grid; gap: .8rem;
  padding: 1.3rem 16px calc(1.3rem + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg); animation: rise .25s var(--ease);
}
@media (min-width: 640px) { .sheet-modal { align-items: center; } .sheet-modal-card { border-radius: 18px; } }
.swap-people { display: grid; gap: .5rem; }
.swap-people button { display: grid; justify-items: start; gap: .1rem; text-align: left; min-height: 58px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .95rem; padding: .7rem 1rem; }
.swap-people button strong { font-family: var(--font-heading); font-size: 1.05rem; }
.swap-people button small { color: var(--muted); }
.swap-people button:hover small { color: inherit; }

/* ---------- approval audit ---------- */
.audit-list { display: grid; gap: .6rem; margin-top: .8rem; }
.audit-row { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.audit-row.failed { border-left: 4px solid var(--danger); }
.audit-main { display: grid; gap: .25rem; min-width: 0; }
.audit-side { display: grid; gap: .5rem; justify-items: end; align-content: start; }
.audit-side .photo-thumb img { width: 72px; height: 72px; object-fit: cover; }
@media (max-width: 600px) { .audit-row { flex-direction: column; } .audit-side { justify-items: start; grid-auto-flow: column; align-items: center; } }
.swap-card .meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-size: .85rem; }
.swap-card .time { display: inline-flex; align-items: center; gap: .3rem; }
.swap-card .time svg { width: 15px; height: 15px; flex: none; }

/* Swap buttons: ShiftChores green, clearly a button. */
button.swap-btn { --bg: var(--teal-soft); --fg: var(--teal-deep); --bd: var(--teal); gap: .4rem; }
button.swap-btn span { font-size: 1rem; line-height: 1; letter-spacing: 0; }
button.swap-btn:hover { --bg: var(--teal); --fg: #fff; --bd: var(--teal); }
button.swap-btn { border-width: 1.5px; font-weight: 700; }
button.swap-btn.pending { --bg: var(--paper); --fg: var(--teal-deep); --bd: var(--teal-deep); }
button.swap-btn.pending:hover { --bg: var(--teal-deep); --fg: #fff; }
.swap-tag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; font-family: var(--font-body); font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; background: var(--teal-soft); color: var(--teal-deep); border: 1px solid var(--teal); }
.chore-legend { margin: -.25rem 0 .75rem; font-size: .8rem; color: var(--muted); line-height: 1.7; }
.chore-legend .mine-tag, .chore-legend .swap-tag { margin-left: 0; }

/* Chore cards: one soft, solid colour per kind (no gradients). Finished chores stay green. */
.chore:not(.done):not(.approved) { background: #eef3fb; }
.chore.is-group:not(.done):not(.approved) { background: var(--teal-soft); }
.chore.is-extra:not(.done):not(.approved), .chore.extra-open:not(.done):not(.approved) { background: var(--gold-soft); }
.chore.extra-open.taken:not(.done):not(.approved) { background: var(--paper-2, #f4f2ee); }
.share-tag { display: inline-block; margin-left: .5rem; padding: .1rem .45rem; border-radius: 999px; font-family: var(--font-body); font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; vertical-align: middle; background: #fff; color: var(--sapphire); border: 1px solid #c6d4ef; }

/* ---------- recognition: a colour and icon per badge ---------- */
.b-first { --bc: var(--teal-deep); --bc-soft: var(--teal-soft); }
.b-sweep { --bc: var(--sapphire); --bc-soft: var(--sapphire-soft); }
.b-hat_trick { --bc: #c2410c; --bc-soft: #fdeee4; }
.b-five_star { --bc: var(--gold); --bc-soft: var(--gold-soft); }
.b-priority { --bc: var(--p-high); --bc-soft: var(--p-high-soft); }
.b-proof { --bc: var(--plum); --bc-soft: var(--plum-soft); }
.b-century { --bc: var(--navy); --bc-soft: #e8ecf5; }
.recognition { box-shadow: inset 0 4px 0 var(--teal); }
.badges { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: .7rem; }
.medal { opacity: 1; border: 1px dashed var(--line-strong); background: var(--paper); align-items: center; }
.medal .medal-mark { width: 46px; height: 46px; border-radius: 50%; border: 2px dashed var(--bc); color: var(--bc); background: var(--paper); }
.medal .medal-mark svg { width: 24px; height: 24px; }
.medal .medal-text { display: grid; gap: .15rem; min-width: 0; }
.medal .medal-text .small { color: var(--muted); }
.medal.earned { border: 1px solid var(--bc); background: var(--bc-soft); box-shadow: inset 4px 0 0 var(--bc); }
.medal.earned .medal-mark { background: var(--bc); border: 2px solid var(--bc); color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.medal.earned strong { color: var(--bc); }
.medal:not(.earned) strong { color: var(--ink); }
.medal-state { justify-self: start; margin-top: .15rem; padding: .05rem .5rem; border-radius: 999px; background: var(--bc); color: #fff; font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.medal-progress { display: flex; align-items: center; gap: .5rem; margin-top: .2rem; }
.medal-progress .meter { flex: 1; margin: 0; height: 6px; }
.medal-progress .meter span { background: var(--bc); }
.medal-progress small { color: var(--bc); font-weight: 700; white-space: nowrap; }
.leaders li:nth-child(1) .rank { color: var(--gold); }
.leaders li:nth-child(2) .rank { color: var(--sapphire); }
.leaders li:nth-child(3) .rank { color: var(--plum); }
.leaders li:nth-child(-n + 3) { box-shadow: inset 4px 0 0 currentColor; }
.leaders li:nth-child(1) { color: var(--gold); }
.leaders li:nth-child(2) { color: var(--sapphire); }
.leaders li:nth-child(3) { color: var(--plum); }
.leaders li .who, .leaders li .score { color: var(--ink); }
.leaders li .score { color: var(--muted); }
.badge-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: 999px; background: var(--bc-soft); color: var(--bc); border: 1px solid var(--bc); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.badge-chip svg { width: 14px; height: 14px; }

/* ---------- Ready to leave / Sign out: one matching pair, top and bottom ---------- */
.top-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.top-bar .backbar { margin: 0; }
.leave-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
button.leave-btn { min-height: 44px; min-width: 9.5rem; --bg: var(--paper); --fg: var(--navy); --bd: var(--navy); font-size: .7rem; }
button.leave-btn:hover { --bg: var(--navy); --fg: #fff; }
button.leave-btn.ready { --bg: var(--teal-deep); --fg: #fff; --bd: var(--teal-deep); }
button.leave-btn.ready:hover { --bg: var(--navy); --bd: var(--navy); }
button.leave-btn.requested, button.leave-btn.requested:disabled { opacity: 1; --bg: var(--teal-soft); --fg: var(--teal-deep); --bd: var(--teal); cursor: default; }
.signed-in { display: grid; gap: .6rem; justify-items: start; }
@media (max-width: 560px) {
  .top-bar .leave-bar, .signed-in .leave-bar { width: 100%; }
  button.leave-btn { flex: 1 1 0; min-width: 0; }
}
/* Bottom pair lines up on the right, like the top. */
.signed-in { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
@media (max-width: 560px) { .signed-in { align-items: stretch; text-align: left; } }

/* =====================================================================
   Every action looks like a button (like Start, Swap and Sign out).
   ===================================================================== */
/* "Ghost" buttons (Pause…) and small text-link actions (Undo, Edit, Remove…) get a real outline. */
button.ghost, button.link.small {
  --bg: var(--paper); --fg: var(--navy); --bd: var(--navy);
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  min-height: 32px; padding: .35rem .75rem;
  font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
}
button.ghost:hover, button.link.small:hover { --bg: var(--navy); --fg: #fff; color: #fff; }
button.link.small.danger { --fg: var(--danger); --bd: var(--danger); color: var(--danger); }
button.link.small.danger:hover { --bg: var(--danger); --fg: #fff; color: #fff; }
/* Back / Home: a small outlined button too. */
button.back {
  --bg: var(--paper); --fg: var(--navy); --bd: var(--line-strong);
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg); min-height: 36px; padding: .4rem .8rem; border-radius: var(--radius);
}
button.back:hover { --bg: var(--navy); --fg: #fff; --bd: var(--navy); color: #fff; }
/* …but a link inside a sentence stays a link. */
p button.link.small, .muted button.link.small, .small button.link.small {
  border: 0; background: none; padding: 0; min-height: 0; color: inherit;
  font-size: inherit; letter-spacing: 0; text-transform: none; text-decoration: underline; font-weight: 600;
}
p button.link.small:hover, .muted button.link.small:hover, .small button.link.small:hover { background: none; color: var(--accent); }
@media (max-width: 860px) {
  button.ghost, button.link.small { min-height: 40px; padding: .5rem .85rem; }
  p button.link.small, .muted button.link.small, .small button.link.small { min-height: 0; padding: 0; }
}
.page-head button.back { display: inline-flex; }

/* ---------- badge artwork ---------- */
/* Colours follow each badge's artwork. */
.b-first { --bc: #2e7d4f; --bc-soft: #e7f3ec; }
.b-five_star { --bc: var(--plum); --bc-soft: var(--plum-soft); }
.b-proof { --bc: #c2366f; --bc-soft: #fcebf2; }
.b-hat_trick { --bc: #c2410c; --bc-soft: #fdeee4; }
.medal .medal-mark, .medal.earned .medal-mark { width: 72px; height: 72px; border: 0; background: none; box-shadow: none; border-radius: 0; }
.medal .medal-mark .badge-art { width: 72px; height: 72px; object-fit: contain; filter: grayscale(1); opacity: .4; transition: filter .3s var(--ease), opacity .3s var(--ease); }
.medal.earned .medal-mark .badge-art { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18)); opacity: 1; }
.medal { padding: .6rem .8rem; }
.badge-chip .badge-art { width: 22px; height: 22px; object-fit: contain; margin: -.2rem 0; }
.badge-chip { padding-left: .3rem; }

/* ---------- Reassign & sign out; People report ---------- */
.reason-picks { display: flex; flex-wrap: wrap; gap: .45rem; }
.reason-pick { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .85rem; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  font-size: .85rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink); }
.reason-pick:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.reason-pick input { margin: 0; min-height: 0; accent-color: var(--danger); }
.warn-n { font-weight: 700; color: var(--warning); }
.people-report tr.open td { background: var(--accent-soft); }
.incident-row td { background: var(--paper-2, #f7f5f1); }
.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.incidents li { display: grid; grid-template-columns: 6.5rem 8.5rem minmax(0, 1fr); gap: .6rem; align-items: center; }
@media (max-width: 720px) { .incidents li { grid-template-columns: auto auto; } .incidents li > :last-child { grid-column: 1 / -1; } }
/* Pause and Undo: solid ShiftChores logo blue. */
button.logo-blue { --bg: var(--navy); --fg: #fff; --bd: var(--navy); }
button.logo-blue:hover { --bg: var(--teal-deep); --bd: var(--teal-deep); --fg: #fff; }

/* ---------- list rows (Schedule, Chores) + pop-up forms ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.filter-bar > label { display: grid; gap: .3rem; min-width: 9rem; }
.filter-bar > label.grow { flex: 1 1 14rem; }
.filter-bar .filter-group { display: grid; gap: .3rem; }
.filter-bar .filter-foot, .filter-bar > p { flex-basis: 100%; display: flex; gap: .75rem; align-items: center; }
.week-nav { display: flex; gap: .4rem; align-items: center; }
.week-nav input { width: auto; }
.list-section { display: grid; gap: .7rem; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.list-head h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.list-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; }
button.list-row {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; text-transform: none; letter-spacing: 0;
  font-weight: 400; font-size: .95rem; padding: .7rem .9rem; min-height: 56px; --bg: var(--paper); --fg: var(--ink); --bd: var(--line-strong);
  white-space: normal; min-width: 0;
}
.chore-row > .list-row { flex: 1; }
[hidden] { display: none !important; }
button.list-row:hover { --bg: var(--paper-2); --fg: var(--ink); --bd: var(--navy); }
button.list-row:hover .muted, button.list-row:hover .list-row-desc { color: var(--muted); }
.list-row-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: .3rem; flex: 1; min-width: 0; }
.list-row-main strong { font-family: var(--font-heading); font-size: 1.02rem; color: var(--navy); }
.list-row-desc { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; font-size: .85rem; }
.list-row-go { font-size: 1.5rem; color: var(--muted); line-height: 1; }
.list-row.dim, .chore-row.dim { opacity: .6; }
.chore-row { display: flex; align-items: center; gap: .5rem; }
.chore-row .movers { display: grid; gap: .25rem; }
.assign-tag { font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--paper-2); color: var(--navy); }
.assign-tag.a-person { background: #eef3fb; color: var(--sapphire); }
.assign-tag.a-group { background: var(--teal-soft); color: var(--teal-deep); }
.assign-tag.a-extra { background: var(--gold-soft); color: #8a6a12; }
.sheet-form { display: grid; gap: .9rem; }
.sheet-fields { border: 0; padding: 0; margin: 0; display: grid; gap: .8rem; min-width: 0; }
.sheet-fields > label, .sheet-fields .two > label { display: grid; gap: .3rem; }
.sheet-fields > label.switch { display: flex; }
.sheet-fields textarea { width: 100%; resize: vertical; font: inherit; }
.sheet-fields .two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.sheet-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.sheet-actions .grow { flex: 1; }
button.sheet-close { min-height: 44px; min-width: 44px; padding: 0; font-size: 1.4rem; line-height: 1; --bd: transparent; }
.chore-desc { margin: .3rem 0 0; font-size: .88rem; color: var(--muted); line-height: 1.4; white-space: pre-line; }
.group-desc { margin: -.3rem 0 .8rem; font-size: .9rem; color: var(--muted); }
/* Sign out (and switch) at the top and bottom of the back office and admin pages */
.account-bar { justify-content: flex-end; margin-bottom: 1rem; }
.account-bar.bottom { margin: 2rem 0 0; }
.account-bar a.btn.leave-btn { display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) {
  .filter-bar > label { min-width: 0; flex: 1 1 calc(50% - .5rem); }
  .filter-bar > label.grow { flex-basis: 100%; }
  .account-bar { width: 100%; }
}
textarea {
  width: 100%; font: inherit; font-size: 16px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink);
  padding: .65rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); resize: vertical;
}
label .hint { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .8rem; color: var(--muted); }
