/* =====================================================================
   Meeting Deck Builder: light, airy UI
   ===================================================================== */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, .72);
  --surface-2: #f7f8fc;
  --ink: #151833;
  --body: #3e4566;
  --muted: #7d839e;
  --hair: rgba(21, 24, 51, .07);
  --hair-2: rgba(21, 24, 51, .13);

  --accent: #5b57e6;
  --accent-2: #4743d1;
  --accent-soft: #eeedfd;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --ok: #12916a; --ok-soft: #e2f6ee;
  --warn: #b25d05; --warn-soft: #fff3df;
  --bad: #d63c3c; --bad-soft: #fdeded;
  --amber: #f5b335;

  --r-xs: 8px; --r-sm: 12px; --r: 16px; --r-lg: 22px;
  --sh-1: 0 1px 2px rgba(21, 24, 51, .04), 0 2px 12px rgba(21, 24, 51, .05);
  --sh-2: 0 4px 10px rgba(21, 24, 51, .05), 0 14px 34px rgba(21, 24, 51, .09);
  --sh-3: 0 24px 70px rgba(21, 24, 51, .22);
  --ease: cubic-bezier(.2, .7, .2, 1);

  font-family: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px; color: var(--ink); line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); min-height: 100vh; }
a { color: var(--accent); }
h1 { margin: 0; font-family: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, sans-serif; font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.005em; }
h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 16px; }
.grow { flex: 1; min-width: 0; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
::selection { background: #dcdafd; }

/* soft colour wash behind everything */
.backdrop { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(99, 102, 241, .13), transparent 60%),
    radial-gradient(700px 480px at 100% 0%, rgba(236, 72, 153, .08), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, rgba(20, 184, 166, .08), transparent 60%),
    var(--bg); }

/* ---------- controls ---------- */
button { font: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .2s, transform .15s var(--ease), color .15s; }
button:hover { background: var(--surface-2); border-color: rgba(21, 24, 51, .2); }
button:active { transform: scale(.97); }
button:disabled { opacity: .42; cursor: default; transform: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(91, 87, 230, .28); outline-offset: 1px; }
button.primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(99, 102, 241, .32); }
button.primary:hover { background: var(--accent-grad); filter: brightness(1.06); box-shadow: 0 8px 22px rgba(99, 102, 241, .42); }
button.ghost { background: transparent; border-color: transparent; color: var(--body); }
button.ghost:hover { background: rgba(21, 24, 51, .05); }
button.ghost.on { background: var(--accent-soft); color: var(--accent); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: rgba(214, 60, 60, .25); }
button.big { height: 44px; padding: 0 22px; font-size: 15px; }
button.small { height: 30px; padding: 0 12px; font-size: 12.5px; }
button.icon { height: 28px; min-width: 28px; padding: 0 6px; border-color: transparent; background: transparent; color: var(--muted); font-size: 12px; border-radius: 8px; }
button.icon:hover { background: rgba(21, 24, 51, .06); color: var(--ink); }
button.link { height: auto; border: 0; background: none; padding: 0; color: var(--accent); font-size: 12.5px; border-radius: 4px; }
button.link:hover { text-decoration: underline; background: none; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--hair-2); border-radius: var(--r-sm); padding: 8px 11px; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover { border-color: rgba(21, 24, 51, .22); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 87, 230, .14); }
input.plain, select.plain { border-color: transparent; background: transparent; padding: 3px 6px; width: 100%; box-shadow: none; }
input.plain:hover, select.plain:hover { background: rgba(21, 24, 51, .04); }
input.plain.strong { font-weight: 700; font-size: 14.5px; }
select.plain { color: var(--muted); font-size: 12.5px; }
label.inline { display: flex; gap: 8px; align-items: center; color: var(--body); font-weight: 600; }

.pill { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: rgba(21, 24, 51, .06); color: var(--body); font-size: 12px; font-weight: 650; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; background: rgba(21, 24, 51, .06); color: var(--body); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.member { background: #dcf5ec; color: #0b7a59; }
.chip.upload { background: #fdeedb; color: #9c5100; }
.chip .micro { width: 34px; }
.warn-text { color: var(--warn); font-weight: 600; }
.tag { display: inline-block; padding: 2px 8px; margin-right: 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: #fff; background: #8a90aa; vertical-align: 1px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; height: 68px; padding: 0 28px;
  background: rgba(250, 250, 254, .72); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hair); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.logo { display: grid; grid-template-columns: repeat(3, 6px); gap: 3px; align-items: end; justify-content: center; width: 36px; height: 36px; padding-bottom: 9px; border-radius: 11px; background: var(--accent-grad); box-shadow: 0 6px 16px rgba(99, 102, 241, .35); }
.logo i { display: block; width: 6px; border-radius: 2px; background: rgba(255, 255, 255, .95); }
.logo i:nth-child(1) { height: 9px; } .logo i:nth-child(2) { height: 16px; } .logo i:nth-child(3) { height: 12px; }
.brand-t b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand-t small { color: var(--muted); font-size: 11.5px; }

.stepper { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; }
.step { height: auto; padding: 6px 14px 6px 6px; gap: 10px; border: 0; background: transparent; border-radius: 999px; color: var(--body); font-weight: 400; text-align: left; }
.step:hover { background: rgba(21, 24, 51, .045); }
.step.on { background: var(--surface); box-shadow: var(--sh-1), 0 0 0 1px var(--hair); }
.step-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 12.5px; font-weight: 700; color: var(--muted); background: rgba(21, 24, 51, .06); transition: all .2s; }
.step.ok .step-n { background: var(--ok-soft); color: var(--ok); }
.step.warn .step-n { background: var(--warn-soft); color: var(--warn); }
.step.on .step-n { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(99, 102, 241, .35); }
.step-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.step-t b { font-size: 13.5px; color: var(--ink); font-weight: 650; }
.step-t small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.step-link { flex: 0 1 28px; min-width: 10px; height: 2px; border-radius: 2px; background: var(--hair-2); }
.step-link.done { background: linear-gradient(90deg, #34c08f, #12916a); }

.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.date-pill { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 14px; border-radius: 999px; background: var(--surface); box-shadow: 0 0 0 1px var(--hair-2); cursor: pointer; }
.date-pill small { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.date-pill input { border: 0; padding: 4px 8px; height: 30px; border-radius: 999px; font-weight: 650; background: transparent; box-shadow: none; }
.date-pill input:focus { box-shadow: none; background: var(--accent-soft); }
.lib-btn { font-size: 15px; }
.lib-btn span { font-size: 13.5px; }

main { position: relative; width: 100%; max-width: 1480px; margin: 0 auto; padding: 34px 40px 110px; }
main.enter { animation: rise .35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 760px; font-size: 14.5px; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--sh-1); }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 16px 22px; }
.panel-head h3 { margin: 0; }
.warn-panel { background: linear-gradient(180deg, #fff6e6, #fff9ef); box-shadow: none; color: #6e4206; }
.warn-panel ul { margin: 6px 0 0; padding-left: 20px; }
.info-panel { background: linear-gradient(180deg, #f0effe, #f6f5ff); box-shadow: none; color: #3b378f; }
.info-panel ul { margin: 6px 0 0; padding-left: 20px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-bar { position: sticky; top: 80px; z-index: 5; padding: 8px 10px 8px 18px; margin-bottom: 22px; border-radius: 999px;
  background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--sh-1), 0 0 0 1px var(--hair); }
.empty { text-align: center; padding: 64px 24px; color: var(--muted); background: var(--surface-glass); border-radius: var(--r-lg); border: 1.5px dashed var(--hair-2); }
.empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty h3 { color: var(--ink); font-size: 19px; }
.empty p { max-width: 540px; margin: 6px auto 18px; }

/* ---------- slide cards (shared) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
.card { position: relative; background: transparent; border: 0; padding: 0; cursor: pointer; user-select: none; border-radius: var(--r-sm); }
.card .thumb { box-shadow: var(--sh-1), 0 0 0 1px var(--hair); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.card:hover .thumb { transform: translateY(-3px); box-shadow: var(--sh-2), 0 0 0 1px var(--hair); }
.card.sel .thumb { box-shadow: 0 0 0 3px var(--accent), var(--sh-2); }
.card.over .thumb { box-shadow: 0 0 0 3px var(--ok); }
.card.dragging { opacity: .35; }
.card.drop-before::before, .card.drop-after::after { content: ""; position: absolute; top: 0; bottom: 28px; width: 4px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 12px rgba(91, 87, 230, .6); }
.card.drop-before::before { left: -11px; } .card.drop-after::after { right: -11px; }
.thumb-wrap { position: relative; }
.thumb { display: block; width: 100%; aspect-ratio: 16/9; object-fit: contain; background: #e8eaf3; border-radius: var(--r-sm); }
.thumb.missing, .mini.missing { display: grid; place-items: center; color: var(--muted); font-size: 11.5px; font-weight: 600; background: repeating-linear-gradient(45deg, #f1f2f8, #f1f2f8 7px, #e9ebf3 7px, #e9ebf3 14px); }
.cap { margin-top: 9px; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.num { position: absolute; bottom: 8px; left: 8px; min-width: 22px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(21, 24, 51, .72); backdrop-filter: blur(6px); }
.badge { position: absolute; top: 8px; right: 8px; background: var(--accent-grad); color: #fff; font-size: 11px; font-weight: 700; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 4px 10px rgba(99, 102, 241, .4); }
.hover-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transform: translateY(-3px); transition: opacity .18s, transform .18s; }
.card:hover .hover-tools { opacity: 1; transform: none; }
.tool { width: 28px; height: 28px; padding: 0; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .94); font-size: 12px; box-shadow: var(--sh-1); }
.hover-tools .tool:disabled { display: none; }
.mini { display: block; width: 136px; aspect-ratio: 16/9; object-fit: contain; background: #e8eaf3; border-radius: 9px; box-shadow: 0 0 0 1px var(--hair); transition: transform .2s var(--ease), box-shadow .2s; }
.micro { display: block; width: 56px; aspect-ratio: 16/9; object-fit: contain; border-radius: 4px; box-shadow: 0 0 0 1px var(--hair); }

/* ---------- running order: a timeline of blocks ---------- */
.timeline { position: relative; padding-left: 46px; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, rgba(99, 102, 241, .35), rgba(139, 92, 246, .2) 50%, rgba(20, 184, 166, .3)); }
.blk { --blk: #8a90aa; position: relative; background: var(--surface-glass); backdrop-filter: blur(10px); border-radius: var(--r-lg); padding: 6px 18px 18px; box-shadow: var(--sh-1); transition: box-shadow .2s; }
.blk:hover { box-shadow: var(--sh-2); }
.blk.collapsed { padding-bottom: 6px; }
.tl-dot { position: absolute; left: -37px; top: 17px; width: 16px; height: 16px; border-radius: 50%; background: var(--blk); box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--hair-2); display: grid; place-items: center; font-size: 12px; }
.blk.is-members .tl-dot, .blk.is-uploads .tl-dot { left: -43px; top: 11px; width: 28px; height: 28px; font-size: 14px; }
.blk.is-members { background: linear-gradient(180deg, rgba(220, 245, 236, .85), rgba(255, 255, 255, .8) 75%); }
.blk.is-uploads { background: linear-gradient(180deg, rgba(253, 238, 219, .85), rgba(255, 255, 255, .8) 75%); }
.blk-head { display: flex; align-items: center; gap: 4px; padding: 8px 0; flex-wrap: wrap; min-height: 52px; }
.blk-head > button { opacity: .6; transition: opacity .15s; }
.blk:hover .blk-head > button, .blk-head > button:focus-visible { opacity: 1; }
.handle { cursor: grab; color: #a5aac0; font-size: 16px; padding: 0 4px; user-select: none; border-radius: 6px; }
.handle:hover { background: rgba(21, 24, 51, .05); color: var(--body); }
.handle:active { cursor: grabbing; }
.collapse { width: 24px; }
.blk-swatch { display: none; }
.blk-title { font-weight: 700; font-size: 17px; letter-spacing: -.01em; border-color: transparent; background: transparent; padding: 5px 8px; width: 300px; max-width: 100%; box-shadow: none; }
.blk-title:hover { background: rgba(21, 24, 51, .04); }
.blk-grid { padding: 6px 0 2px; min-height: 80px; border-radius: var(--r); transition: background .15s; }
.blk-grid.over { background: var(--accent-soft); }
.blk-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 92px; color: var(--muted); border: 1.5px dashed var(--hair-2); border-radius: var(--r); font-weight: 600; pointer-events: none; }
.blk-members { padding: 4px 4px 4px; }
.blk-members p { margin: 0 0 12px; color: var(--body); }
.blk-members p.muted { margin: 12px 0 0; }

.inserter { position: relative; height: 30px; }
.inserter-btn { position: absolute; left: -40px; top: 50%; transform: translateY(-50%); height: 24px; padding: 0; width: 24px; gap: 0; overflow: hidden; justify-content: flex-start;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--hair-2); color: var(--muted); box-shadow: var(--sh-1); opacity: 0; transition: width .25s var(--ease), opacity .15s, color .15s; }
.inserter-btn .plus { flex: none; width: 22px; text-align: center; font-size: 16px; font-weight: 500; line-height: 1; }
.inserter-btn .lbl { font-size: 12px; padding-right: 12px; }
.inserter:hover .inserter-btn, .inserter-btn:focus-visible { opacity: 1; width: 128px; color: var(--accent); border-color: rgba(91, 87, 230, .4); }
.timeline > .inserter:first-child .inserter-btn, .timeline > .inserter:last-child .inserter-btn { opacity: 1; }
body.dragging-block .inserter { height: 46px; }
body.dragging-block .inserter::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; border-radius: 2px; background: var(--hair-2); }
body.dragging-block .inserter-btn { opacity: 0; }
.inserter.over::after { background: var(--accent) !important; height: 4px !important; box-shadow: 0 0 14px rgba(91, 87, 230, .6); }

/* block strips (members & uploads) */
.block-groups { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.group-name { font-weight: 700; font-size: 11.5px; color: var(--body); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.strip figure { margin: 0; text-align: center; font-size: 11.5px; color: var(--body); cursor: zoom-in; flex: none; scroll-snap-align: start; }
.strip figure:hover .mini { transform: translateY(-2px); box-shadow: var(--sh-2); }
.strip figcaption { margin-top: 6px; max-width: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* block type picker / quality picker */
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.type-pick.two { grid-template-columns: 1fr 1fr; }
.type-opt { height: auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; text-align: left; white-space: normal; padding: 16px; font-weight: 400; border-radius: var(--r); background: var(--surface-2); border: 1.5px solid transparent; }
.type-opt:hover { background: #f1f2f9; border-color: transparent; }
.type-opt b { font-size: 15px; }
.type-opt small { color: var(--muted); }
.type-opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 4px rgba(91, 87, 230, .1); }
.type-icon { font-size: 24px; }
.quality-opt ul { margin: 6px 0 0; padding-left: 18px; color: var(--body); font-size: 12.5px; }
.quality-opt li { margin: 2px 0; }

/* ---------- members ---------- */
.two-col { display: grid; grid-template-columns: minmax(290px, 340px) 1fr; gap: 20px; align-items: start; }
@media (max-width: 1150px) { .two-col { grid-template-columns: 1fr; } }
.cls-list { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 14px; }
.cls-row { display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: var(--r-sm); transition: background .15s; }
.cls-row:hover { background: var(--surface-2); }
.cls-main { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cls-main input { font-weight: 650; border-color: transparent; background: transparent; padding: 4px 6px; }
.cls-main input:hover { background: var(--surface); border-color: var(--hair); }
.order { display: flex; flex-direction: column; white-space: nowrap; }
.order .icon { height: 16px; min-width: 20px; padding: 0 4px; font-size: 8px; }
.divider-pick { display: inline-flex; align-items: center; gap: 6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: rgba(91, 87, 230, .025); }
td input:not([type=checkbox]) { width: 100%; }
.group-row td { background: transparent !important; font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); padding: 18px 12px 8px; border-bottom: 0; }
tr.inactive { opacity: .45; }
.name-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #e7e6fe, #f3e8ff); color: var(--accent); font-weight: 800; font-size: 12px; }
td.pages .mini { width: 112px; cursor: zoom-in; }
td.pages .row { flex-wrap: nowrap; }
td.aliases input { min-width: 180px; }
.page-thumb { position: relative; }
.page-thumb .remove { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0; border-radius: 50%; font-size: 10px; opacity: 0; box-shadow: var(--sh-1); transition: opacity .15s; }
.page-thumb:hover .remove { opacity: 1; }
.toggle { position: relative; display: inline-block; width: 40px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: #d5d8e6; cursor: pointer; transition: background .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked + span { background: linear-gradient(135deg, #22b383, var(--ok)); }
.toggle input:checked + span::after { transform: translateX(16px); }
.member-search { width: 240px; border-radius: 999px; padding-left: 16px; }
table.review td { vertical-align: middle; }
table.review tr.warn td { background: var(--warn-soft); }
table.review tr.bad td { background: #fff5f5; }
.review-thumb { display: block; width: 220px; aspect-ratio: 16/9; object-fit: contain; border-radius: 10px; box-shadow: 0 0 0 1px var(--hair), var(--sh-1); background: #e8eaf3; cursor: zoom-in; }
.status-line { margin-top: 6px; }
.howto { background: var(--surface-2); border-radius: var(--r); padding: 12px 16px; margin: 0 0 14px; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ul { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin: 3px 0; }

/* ---------- attendance ---------- */
.att-summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.att-count b { font-size: 30px; letter-spacing: -.02em; }
.att-count span { color: var(--muted); font-weight: 600; }
.meter { width: 200px; height: 8px; background: rgba(21, 24, 51, .07); border-radius: 99px; overflow: hidden; }
.meter div { height: 100%; background: linear-gradient(90deg, #34c08f, var(--ok)); border-radius: 99px; transition: width .4s var(--ease); }
.unmatched { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.unmatched-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(255, 255, 255, .8); padding: 8px 12px; border-radius: var(--r-sm); }
.unmatched-row b { min-width: 200px; }
.sec-head { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.att-group { margin-bottom: 30px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.att-card { height: auto; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; text-align: left; padding: 8px 8px 12px; border-radius: var(--r); border: 0; background: var(--surface); font-weight: 400; white-space: normal; box-shadow: var(--sh-1); transition: transform .2s var(--ease), box-shadow .2s; }
.att-card:hover { background: var(--surface); transform: translateY(-2px); box-shadow: var(--sh-2); }
.att-card.on { box-shadow: 0 0 0 2px #3cc196, var(--sh-1); }
.att-card.on:hover { box-shadow: 0 0 0 2px var(--ok), var(--sh-2); }
.att-card.off { background: rgba(255, 255, 255, .6); }
.att-card .thumb { border-radius: 10px; transition: filter .2s, opacity .2s; }
.att-card.off .thumb { filter: grayscale(1); opacity: .4; }
.att-card.off .att-name { color: var(--muted); }
.att-thumb { position: relative; }
.att-state { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(21, 24, 51, .55); color: #fff; backdrop-filter: blur(6px); }
.att-card.on .att-state { background: var(--ok); }
.att-name { margin: 10px 4px 0; font-weight: 700; font-size: 14px; }
.att-sub { margin: 1px 4px 0; font-size: 11.5px; color: var(--muted); }
.footer-bar { position: sticky; bottom: 18px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding: 10px 10px 10px 22px; border-radius: 999px;
  background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--sh-2), 0 0 0 1px var(--hair); }

/* ---------- final order ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--sh-1); }
.stat-l { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-v { font-size: 22px; font-weight: 750; margin-top: 4px; letter-spacing: -.015em; }
.stat-s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.ok .stat-v { color: var(--ok); } .stat.warn .stat-v { color: var(--warn); }
.order-bar { position: sticky; top: 80px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; padding: 10px 10px 10px 22px; border-radius: 28px;
  background: var(--surface-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--sh-1), 0 0 0 1px var(--hair); }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(21, 24, 51, .06); }
.seg button { height: 28px; border: 0; padding: 0 12px; font-size: 12.5px; background: transparent; color: var(--body); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.final-grid.zoom-m { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px 14px; }
.final-grid.zoom-l { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px 20px; }
.final-grid.zoom-xl { grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 30px 24px; }
.final-grid.zoom-l .cap, .final-grid.zoom-xl .cap { font-size: 14px; }
.card.final { cursor: grab; }
.card.final .thumb-wrap::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px; background: var(--blk); opacity: .9; }
.card.final.divider .thumb { box-shadow: 0 0 0 2px var(--blk), var(--sh-1); }
.card.final .sub { margin-top: 4px; }

/* ---------- library ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--sh-1); display: flex; flex-direction: column; }
.tile p { flex: 1; margin: 0 0 14px; }
.page-library td .mini { width: 120px; cursor: zoom-in; }
.panel-title h3 { margin: 0; }
.req { background: linear-gradient(180deg, #fff7ec, #fffbf6); border-radius: var(--r-lg); padding: 18px; margin: 14px 0; display: flex; flex-direction: column; gap: 14px; }
.req-head { display: flex; align-items: center; gap: 12px; }
.req-head b { font-size: 15.5px; }
.req-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #fde7c9; font-size: 18px; }
.req-step { display: flex; gap: 12px; align-items: flex-start; }
.req-step b { display: block; margin-bottom: 8px; }
.req-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; margin-top: 1px; }
.req-step input.grow { min-width: 280px; border-radius: 999px; padding-left: 16px; }
.req-files { display: flex; gap: 12px; flex-wrap: wrap; padding-left: 36px; }
.req-file { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--r); padding: 8px 14px 8px 8px; box-shadow: var(--sh-1); }
.req-file .mini { width: 120px; cursor: zoom-in; }
.req-file.old { opacity: .55; }
.new-req { margin-top: 14px; }
.new-req input { width: 320px; border-radius: 999px; padding-left: 16px; }
.invite { margin-top: 12px; background: rgba(255, 255, 255, .85); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.invite.editing { box-shadow: 0 0 0 2px var(--accent), 0 0 0 6px rgba(91, 87, 230, .1); }
.invite-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invite-head .link { margin-left: auto; }
.invite-text { white-space: pre-wrap; font-size: 13px; color: var(--body); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; max-height: 170px; overflow: auto; }
.invite textarea { font-size: 13px; width: 100%; resize: vertical; }
.token { font-family: "Cascadia Mono", Consolas, monospace; }

/* ---------- modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(21, 24, 51, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; animation: fade .2s; }
.modal { background: var(--surface); border-radius: 26px; width: min(660px, 100%); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--sh-3); animation: pop .28s var(--ease); overflow: hidden; }
.modal.wide { width: min(1140px, 100%); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.modal-head h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
.modal-body { padding: 10px 22px 20px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; align-items: center; padding: 14px 22px; background: var(--surface-2); }
.modal-foot .muted { margin-right: auto; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.check { flex-direction: row !important; align-items: center; font-weight: 400 !important; padding: 6px 8px; border-radius: 10px; }
.check:hover { background: var(--surface-2); }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.picker { display: grid; grid-template-columns: 260px 1fr; gap: 18px; min-height: 50vh; }
.pick-files { display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: 65vh; padding: 2px; }
.pick-file { height: auto; padding: 10px 14px; text-align: left; flex-direction: column; align-items: flex-start; gap: 2px; white-space: normal; border-radius: var(--r-sm); border-color: transparent; background: transparent; }
.pick-file:hover { background: var(--surface-2); border-color: transparent; }
.pick-file small { color: var(--muted); font-weight: 400; }
.pick-file.on { background: var(--accent-soft); color: var(--accent-2); }
.pick-slides { overflow: auto; max-height: 65vh; padding: 4px; }
.pick-slides .row { margin-bottom: 12px; }

/* ---------- full-size preview ---------- */
.lightbox { position: fixed; inset: 0; z-index: 25; background: rgba(10, 11, 24, .92); backdrop-filter: blur(10px); display: grid; grid-template-rows: auto 1fr auto; color: #e6e8f2; animation: fade .2s; }
.lb-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.lb-cap { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; }
.lb-cap .muted { color: #8c92ad; }
.lb-count { font-weight: 700; color: #a8aec8; font-variant-numeric: tabular-nums; }
.lb-close { background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 38px; height: 38px; padding: 0; }
.lb-close:hover { background: rgba(255, 255, 255, .2); }
.lb-main { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 0; padding: 0 16px; }
.lb-img { max-width: calc(100% - 150px); max-height: 100%; aspect-ratio: 16/9; object-fit: contain; border-radius: 10px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); background: #fff; }
.lb-nav { flex: none; width: 54px; height: 54px; padding: 0; border: 0; background: rgba(255, 255, 255, .1); color: #fff; font-size: 30px; line-height: 1; }
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-rail { display: flex; gap: 8px; overflow-x: auto; padding: 14px 20px 18px; }
.lb-mini { flex: none; width: 116px; aspect-ratio: 16/9; object-fit: contain; border-radius: 6px; outline: 2px solid transparent; opacity: .5; cursor: pointer; background: #fff; transition: opacity .15s, outline-color .15s; }
.lb-mini:hover { opacity: .9; }
.lb-mini.on { outline-color: var(--amber); opacity: 1; }

/* ---------- feedback ---------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 16px); opacity: 0; z-index: 40; background: rgba(21, 24, 51, .92); backdrop-filter: blur(10px); color: #fff; padding: 12px 20px; border-radius: 999px; max-width: 80vw; transition: all .3s var(--ease); box-shadow: var(--sh-3); font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(214, 60, 60, .95); }
.busy { position: fixed; inset: 0; z-index: 30; background: rgba(244, 245, 250, .6); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade .2s; }
.busy-box { background: var(--surface); border-radius: 20px; padding: 20px 28px; display: flex; gap: 14px; align-items: center; box-shadow: var(--sh-3); font-weight: 600; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar additions ---------- */
button.brand { height: auto; padding: 4px 8px 4px 4px; border: 0; background: transparent; border-radius: 14px; font-weight: 400; text-align: left; }
button.brand:hover { background: rgba(21, 24, 51, .04); }
.step-sep { width: 1px; height: 26px; background: var(--hair-2); margin: 0 8px; flex: none; }
.step.home .step-n { background: var(--warn-soft); color: var(--warn); }
.step.home.ok .step-n { background: var(--ok-soft); color: var(--ok); }
.step.home.on .step-n { background: var(--accent-grad); color: #fff; }
.undo-group { display: flex; gap: 0; padding: 2px; border-radius: 999px; background: rgba(21, 24, 51, .045); }
.icon-btn { width: 32px; height: 32px; padding: 0; font-size: 17px; }
.help-btn { font-size: 15px; font-weight: 800; color: var(--accent); background: var(--accent-soft); }
.help-btn:hover { background: #e3e1fc; }
.small-link { font-size: 12.5px; font-weight: 600; color: var(--accent); text-decoration: none; }
.small-link:hover { text-decoration: underline; }

/* ---------- this week (home) ---------- */
.hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px 28px; margin-bottom: 22px; border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .95), rgba(240, 239, 254, .9)); box-shadow: var(--sh-1); }
.hero-ring { position: relative; width: 84px; height: 84px; flex: none; }
.hero-ring svg { display: block; }
.hero-ring svg circle:last-child { transition: stroke-dashoffset .8s var(--ease); }
.hero-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 18px; letter-spacing: -.02em; }
.kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin: 2px 0 4px; }
.hero p { margin: 0; color: var(--body); font-size: 15px; }
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 18px; border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1); transition: box-shadow .2s, transform .2s var(--ease); }
.todo:hover { box-shadow: var(--sh-2); }
.todo.next { box-shadow: 0 0 0 2px rgba(91, 87, 230, .55), var(--sh-2); }
.todo.done { background: rgba(255, 255, 255, .6); box-shadow: none; }
.todo.done .todo-title { color: var(--muted); }
.todo-ico { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--hair-2); font-size: 13px; font-weight: 800; color: #fff; }
.todo.done .todo-ico { background: linear-gradient(135deg, #34c08f, var(--ok)); border-color: transparent; }
.todo.warn .todo-ico { background: var(--amber); border-color: transparent; }
.todo.next .todo-ico { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 87, 230, .15); }
.todo-title { font-weight: 650; font-size: 14.5px; }
.todo-detail { color: var(--muted); font-size: 12.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .55); }
.tip > span { font-size: 20px; line-height: 1; }

/* ---------- choice dialog ---------- */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { height: auto; justify-content: flex-start; gap: 12px; padding: 12px 14px; text-align: left; white-space: normal; font-weight: 400; border-radius: var(--r); background: var(--surface-2); border: 1.5px solid transparent; }
.choice:hover { background: #f0f1f8; border-color: transparent; }
.choice.on { background: var(--accent-soft); border-color: var(--accent); }
.choice b { display: block; font-size: 14px; }
.choice small { color: var(--muted); }
.choice-ico { font-size: 20px; width: 28px; text-align: center; flex: none; }

/* ---------- drop overlay ---------- */
.drop-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(91, 87, 230, .12); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); animation: fade .15s; pointer-events: none; }
.drop-overlay::before { content: ""; position: absolute; inset: 16px; border-radius: 28px; border: 3px dashed rgba(91, 87, 230, .55); }
.drop-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 40px; border-radius: 26px; background: var(--surface); box-shadow: var(--sh-3); text-align: center; animation: pop .25s var(--ease); }
.drop-card b { font-size: 20px; }
.drop-card span { color: var(--muted); max-width: 360px; }
.drop-ico { font-size: 40px; }

/* ---------- next presenter / substitute labels ---------- */
.final-grid .thumb-wrap { container-type: inline-size; }
.ov { position: absolute; top: 4.5%; max-width: 60%; padding: .5em 1.1em; border-radius: 999px; font-size: max(8.5px, 1.75cqw); font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ov-tr { right: 3%; background: rgba(21, 24, 51, .86); }
.ov-tl { left: 3%; background: rgba(178, 93, 5, .88); }
.card.final .hover-tools { top: auto; bottom: 8px; }
.ov-chip { margin-left: 10px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.ov-chip.ov-tr { background: #3b3f6b; }
.ov-chip.ov-tl { background: #b25d05; }
.ov-switches { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.check-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: rgba(21, 24, 51, .05); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.check-pill input { accent-color: var(--accent); }
.chip.sub { margin-left: 10px; background: var(--warn-soft); color: var(--warn); }
.att-card { cursor: pointer; }
.att-card:focus-visible { outline: 3px solid rgba(91, 87, 230, .35); }
.att-card.is-sub { box-shadow: 0 0 0 2px #e0a24a, var(--sh-1); }
.att-card.is-sub .att-state { background: var(--warn); }
.sub-btn { position: absolute; top: 6px; right: 6px; height: 26px; padding: 0 10px; font-size: 11.5px; border: 0; background: rgba(255, 255, 255, .94); box-shadow: var(--sh-1); opacity: 0; transition: opacity .15s; }
.att-card:hover .sub-btn, .sub-btn.on, .sub-btn:focus-visible { opacity: 1; }
.sub-btn.on { background: var(--warn); color: #fff; }

/* ---------- shared workspace ---------- */
.save-state { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; min-width: 54px; text-align: right; }
.save-state.ok { color: var(--ok); }
.save-state.warn { color: var(--warn); }
.presence { display: flex; align-items: center; }
.presence .avatar { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.presence .avatar:first-child { margin-left: 0; }
.avatar.small { width: 30px; height: 30px; font-size: 11px; }
.avatar.other { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #047857; }
button.avatar.me { padding: 0; border: 0; cursor: pointer; background: var(--accent-grad); color: #fff; }
button.avatar.me:hover { filter: brightness(1.08); }
.history-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }

/* ---------- responsive ---------- */
.stepper { overflow: hidden; }
@media (max-width: 1720px) { .step-t small { display: none; } .step { padding-right: 12px; } }
@media (max-width: 1560px) { .brand-t, .lib-btn span { display: none; } .top { gap: 12px; padding: 0 20px; } .step-link { flex-basis: 18px; } }
@media (max-width: 1380px) { .step:not(.on) .step-t { display: none; } .step:not(.on) { padding: 4px; } .hide-sm { display: none; } main { padding: 28px 24px 100px; } }
@media (max-width: 1020px) { .date-pill small { display: none; } .step-sep { margin: 0 2px; } }
/* ---------- phones ---------- */
@media (max-width: 760px) {
  html { font-size: 14px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* top bar: logo · undo · date · library · generate */
  .top { height: 58px; gap: 6px; padding: 0 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(250, 250, 254, .97); }
  .brand { padding: 0; }
  .brand-t, .help-btn, .save-state, .top-actions > button.ghost:not(.lib-btn), .lib-btn span, .gen-lbl { display: none !important; }
  .top-actions { gap: 4px; margin-left: auto; }
  .date-pill { padding: 0 2px 0 8px; }
  .date-pill small { display: none; }
  .date-pill input { width: 118px; padding: 2px 4px; font-size: 13px; }
  .top-actions .primary { padding: 0 13px; }
  .undo-group .icon-btn { width: 28px; }

  /* the steps become an app-style tab bar at the bottom */
  .stepper { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .98); border-top: 1px solid var(--hair); box-shadow: 0 -6px 20px rgba(21, 24, 51, .06); overflow: visible; }
  .step-link, .step-sep { display: none; }
  .stepper .step, .stepper .step:not(.on), .stepper .step.on { flex: 1; flex-direction: column; gap: 3px; padding: 4px 2px; border-radius: 12px; box-shadow: none; background: transparent; min-width: 0; }
  .stepper .step .step-t, .stepper .step:not(.on) .step-t { display: flex; align-items: center; }
  .stepper .step-t b { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
  .stepper .step-t small { display: none; }
  .stepper .step.on .step-t b { color: var(--accent); font-weight: 800; }
  .stepper .step-n { width: 26px; height: 26px; font-size: 11.5px; }

  /* pages */
  main { padding: 18px 14px 40px; }
  h1 { font-size: 23px; }
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-head p { font-size: 13.5px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > button { flex: 1 1 auto; }
  .panel { padding: 16px; border-radius: 18px; }
  .card-bar, .order-bar { position: static; border-radius: 18px; padding: 10px 12px; }
  .footer-bar { bottom: calc(76px + env(safe-area-inset-bottom)); border-radius: 18px; padding: 10px; margin-top: 18px; }
  .footer-bar > .muted { display: none; }
  .footer-bar .big { flex: 1; height: 42px; padding: 0 12px; font-size: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat-v { font-size: 18px; }
  .tiles { grid-template-columns: 1fr; }

  /* this week */
  .hero { padding: 18px; gap: 14px; border-radius: 22px; }
  .hero h1 { font-size: 21px; }
  .hero > button { width: 100%; }
  .todo { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .todo .grow { flex-basis: calc(100% - 40px); }
  .todo-detail { white-space: normal; }
  .todo > button { margin-left: 36px; }
  .home-tips { grid-template-columns: 1fr; }

  /* slides */
  .grid, .grid.small, .final-grid.zoom-m, .final-grid.zoom-l, .final-grid.zoom-xl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .final-grid.zoom-l, .final-grid.zoom-xl { grid-template-columns: 1fr; }
  .cap { font-size: 12px; }
  .seg button { padding: 0 9px; }
  .ov-switches { width: 100%; }

  /* running order */
  .timeline { padding-left: 28px; } .timeline::before { left: 9px; }
  .tl-dot { left: -26px; } .blk.is-members .tl-dot, .blk.is-uploads .tl-dot { left: -32px; }
  .inserter-btn { left: -26px; }
  .blk { padding: 4px 12px 14px; border-radius: 18px; }
  .blk-head { gap: 2px; }
  .blk-title { width: auto; flex: 1 1 140px; font-size: 15.5px; }
  .blk-head > .spacer { display: none; }
  .blk-head > button.small { padding: 0 10px; }

  /* members: each member becomes a card */
  .member-search { width: 100%; }
  .panel-head { flex-wrap: wrap; padding: 14px 16px; }
  table.members thead { display: none; }
  table.members, table.members tbody, table.members tr, table.members td { display: block; width: 100%; }
  table.members tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--hair); }
  table.members td { border: 0; padding: 4px 0; }
  table.members tr:not(.group-row) td:first-child.order { position: absolute; right: 10px; top: 10px; width: auto; flex-direction: row; }
  table.members .group-row td { padding: 14px 0 0; }
  td.pages .row { flex-wrap: wrap; }
  td.aliases input { min-width: 0; }
  table.members td:nth-last-child(-n+2):not(.pages) { display: inline-block; width: auto; margin-right: 12px; vertical-align: middle; }
  .name-cell { min-width: 0; padding-right: 64px; }

  /* attendance */
  .att-summary { gap: 10px; }
  .meter { width: 100%; order: 5; }
  .att-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .att-name { font-size: 13px; }
  .unmatched-row b { min-width: 0; width: 100%; }

  /* library */
  .req { padding: 14px; }
  .req-step input.grow, .new-req input { min-width: 0; width: 100%; }
  .req-files { padding-left: 0; }

  /* dialogs fill the screen */
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-foot { flex-wrap: wrap; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal-foot button { flex: 1 1 auto; }
  .picker { grid-template-columns: 1fr; min-height: 0; }
  .pick-files { max-height: 26vh; }
  .type-pick, .type-pick.two { grid-template-columns: 1fr; }
  table.review td { display: block; padding: 6px 4px; }
  .review-thumb { width: 100%; }
  .checks { grid-template-columns: 1fr; }

  /* full-screen preview */
  .lb-top { padding: 10px 12px; }
  .lb-cap { flex-wrap: wrap; white-space: normal; font-size: 12.5px; }
  .lb-main { padding: 0 6px; gap: 4px; }
  .lb-img { max-width: 100%; }
  .lb-nav { display: none; }
  .lb-mini { width: 76px; }
}
/* touch screens: no hover, so show the small buttons all the time */
@media (hover: none) {
  .hover-tools, .card:hover .hover-tools { opacity: 1; transform: none; }
  .sub-btn { opacity: 1; }
  .inserter-btn { opacity: .85; }
  .blk-head > button { opacity: 1; }
  .card:hover .thumb, .att-card:hover { transform: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
