/* My Classes, on top of kit/kit.css and the shared room (classroom/room.css).
   The first visit is a short pitch beside the class form; after that a bar with the class, who is here and six tabs, and
   under it each tab's stage beside a rail with its controls. Names are pills and cards in each pupil's colour, sized from
   the room's cells on a seat so they read on a projector and on paper. Groups, the order and the wheel take the class
   wheel's colours. Presenting shows a tab's stage alone, large. */

/* ---------- first visit ---------- */
.mc-start { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 5vw, 72px); min-height: calc(100vh - 120px); padding-block: 10px 20px; }
.mc-start-copy { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mc-start-copy > * { animation: rise .6s cubic-bezier(.2,.9,.3,1) both; }
.mc-start-copy > :nth-child(2) { animation-delay: .06s; } .mc-start-copy > :nth-child(3) { animation-delay: .12s; } .mc-start-copy > :nth-child(4) { animation-delay: .18s; }
.mc-title { font-size: clamp(48px, 7vw, 100px); line-height: .98; }
.mc-lead { margin: 0; max-width: 38ch; font-size: clamp(18px, 1.7vw, 22px); line-height: 1.45; }
.mc-points { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 17px; }
.mc-points li { display: flex; align-items: center; gap: 12px; }
.mc-points i { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 3px rgba(0,0,0,.12); }
.mc-form { gap: 10px; max-width: 560px; width: 100%; justify-self: center; padding: clamp(20px, 3vw, 30px); animation: pop .6s .1s cubic-bezier(.2,1.3,.4,1) both; }
.mc-form-title { margin: 0 0 4px; font-size: 28px; font-weight: 900; }
.mc-names-in { min-height: 220px; font-weight: 700; }
.mc-private { display: flex; align-items: flex-start; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; font-weight: 700; line-height: 1.4; }
.mc-private svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--link); }
.mc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mc-self-start { align-self: flex-start; }

/* ---------- the bar: the class, who is here, the tabs ---------- */
.mc-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; padding-block: 10px 18px; }
.mc-class { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.mc-class .dd-btn { min-height: 48px; padding: 9px 18px; font-size: 19px; font-weight: 900; }
.mc-here { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 14px; border: 2px solid var(--border-strong); border-radius: var(--r-pill); background: var(--surface-3); color: var(--fg); font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; }
.mc-here:hover { background: var(--hover); }
.mc-here[aria-expanded="true"] { border-color: var(--fg); }
.mc-here i { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.mc-here.is-away i { background: var(--gold); }
.mc-bar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mc-bar-actions .btn svg { width: 18px; height: 18px; }
.mc-tabs { grid-column: 1 / -1; display: flex; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.mc-tabs::-webkit-scrollbar { display: none; }
.mc-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-weight: 900; font-size: 15px; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.mc-tabs button:hover { color: var(--fg); background: var(--hover); }
.mc-tabs button[aria-selected="true"] { background: var(--fg); color: var(--bg-2); }
.mc-tabs svg { width: 19px; height: 19px; flex: none; }
.mc-here-pop { position: absolute; z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(460px, calc(100vw - 32px)); padding: 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: ddIn .16s ease-out; }
.mc-here-pop .ts-names-grid { max-height: 50vh; overflow-y: auto; }

/* ---------- a tab: its stage beside its rail ---------- */
.mc-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(18px, 3vw, 40px); align-items: start; }
.mc-stage { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.mc-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mc-pane:not([hidden]) .mc-side > * { animation: rise .5s cubic-bezier(.2,.9,.3,1) both; }
.mc-make { width: 100%; }
.mc-make svg { width: 22px; height: 22px; }
.mc-h { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; font-weight: 900; }
.mc-present-title { display: none; margin: 0; font-family: var(--serif); font-style: italic; font-weight: 700; font-size: clamp(26px, 4vh, 48px); text-align: center; }
.mc-mini-ico svg { display: block; width: 22px; height: 23px; }
.mc-result { margin: 0; padding: 10px 14px; border-radius: 14px; font-size: 14px; font-weight: 800; line-height: 1.35; }
.mc-result[data-kind="ok"] { background: color-mix(in srgb, var(--teal) 18%, var(--surface)); }
.mc-result[data-kind="warn"] { background: color-mix(in srgb, var(--gold) 26%, var(--surface)); }
.mc-sum { gap: 8px; }
.hist-head .linkbtn { font-size: 13px; }

/* ---------- the class ---------- */
.mc-roster { gap: 12px; }
.mc-roster-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.mc-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.mc-name { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; border: 2px solid transparent; border-radius: 16px; background: var(--surface-2); color: var(--fg); font-weight: 800; font-size: 16px; text-align: left; cursor: pointer; transition: background .15s, transform .15s; }
.mc-name:hover { background: var(--hover); transform: translateY(-1px); }
.mc-name i { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(20,41,38,.2); }
.mc-name span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-name[aria-pressed="false"] { background: transparent; border: 2px dashed var(--border-strong); color: var(--muted); }
.mc-name[aria-pressed="false"] span { text-decoration: line-through; }
.mc-name[aria-pressed="false"] i { background: var(--track); box-shadow: none; }
.mc-tag { flex: none; margin-left: auto; padding: 1px 8px; border-radius: var(--r-pill); background: var(--fox); color: var(--on-fox); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.cr-rule-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cr-rule-add > span { font-weight: 900; color: var(--muted); }
.cr-rule-add .dd { flex: 1 1 120px; min-width: 0; }
.cr-rule-add .dd-btn { width: 100%; justify-content: space-between; }
.cr-rules, .mc-recent { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cr-rules li, .mc-recent li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 800; font-size: 14px; }
.cr-rules li i { font-style: normal; color: var(--muted); }
.cr-rules li .linkbtn, .mc-recent li .linkbtn { margin-left: auto; font-size: 13px; }
.cr-rules .empty, .mc-recent .empty { background: none; padding-left: 0; color: var(--muted); font-weight: 700; }
.mc-recent li > span { display: flex; flex-direction: column; min-width: 0; }
.mc-recent li small { color: var(--muted); font-size: 12px; font-weight: 700; }
.mc-recent li em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 900; color: var(--link); }
.cr-front { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-pick { padding: 5px 12px; border: 2px dashed var(--border-strong); border-radius: 999px; background: none; color: var(--fg); font-weight: 800; font-size: 13px; cursor: pointer; }
.ts-pick[aria-pressed="true"] { border-style: solid; border-color: var(--fox); background: var(--fox); color: var(--on-fox); }
.ts-names-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-name { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: var(--r-pill); border: 2px solid transparent; background: var(--surface-2); font-weight: 800; font-size: 14px; cursor: pointer; transition: background .15s, opacity .15s; }
.ts-name::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); }
.ts-name:hover { background: var(--hover); }
.ts-name[aria-pressed="false"] { background: transparent; border: 2px dashed var(--border-strong); color: var(--muted); text-decoration: line-through; }
.ts-name[aria-pressed="false"]::before { background: var(--track); }

/* ---------- seating ---------- */
.mc-seat .mc-stage { align-items: center; }
/* the room goes along when the page scrolls, so it stays in view beside a long rail (where it fits the screen) */
@media screen and (min-width: 901px) and (min-height: 600px) { .mc-seat .mc-stage { position: sticky; top: 12px; } }
/* a cell never gets smaller than 56px, so whole names stay readable: a room too wide for the screen pans sideways */
body:not(.presenting) .mc-seat .room-pan { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 34px; margin-bottom: -22px; }
body:not(.presenting) .mc-seat .room-wrap { min-width: max(min(100%, 320px), calc((var(--cols, 10) + .52) * 56px)); }
.mc-room-row { display: flex; align-items: center; gap: 8px; }
.mc-room-row #roomDD { flex: 1 1 auto; min-width: 0; }
#roomDD, #roomDD .dd-btn { width: 100%; }
#roomDD .dd-btn { justify-content: space-between; min-height: 44px; font-size: 16px; font-weight: 900; }
.mc-room-row .btn { flex: none; min-height: 44px; }
.cr-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cr-row .btn { flex: 1 1 auto; }
.seat-layer { --cell: 60px; container-type: size; pointer-events: none; }
.seat { position: absolute; width: calc(var(--cell) * .5); height: calc(var(--cell) * .5); translate: -50% -50%; border-radius: 50%; pointer-events: auto; }
.seat:not(.is-taken) { cursor: pointer; }
.seat:not(.is-taken)::after { content: ''; position: absolute; inset: 6%; border: max(2px, calc(var(--cell) * .03)) dashed rgba(20,62,56,.5); border-radius: 50%; background: rgba(255,252,244,.55); opacity: 0; transition: opacity .2s, scale .2s; }
.seat:not(.is-taken)::before { content: '+'; position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; color: #143E38; font-weight: 900; font-size: calc(var(--cell) * .3); line-height: 1; opacity: 0; transition: opacity .2s; }
.seat:not(.is-taken):focus-visible::after { opacity: .8; }
@media (hover: hover) { .seat:not(.is-taken):hover::after { opacity: .8; } }
:is(.is-picking, body.dragging) .seat:not(.is-taken)::after, :is(.is-picking, body.dragging) .seat:not(.is-taken)::before { opacity: 1; }
.is-picking .seat:not(.is-taken)::after { animation: seatCall 1.6s ease-in-out infinite; }
@keyframes seatCall { 50% { scale: 1.14; } }
.seat.is-target:not(.is-taken)::after { border-style: solid; border-color: #1FA89B; background: rgba(31,168,155,.35); scale: 1.3; animation: none; }
.seat.is-target .chip { outline: 3px dashed #1FA89B; outline-offset: 3px; scale: 1.06; }
.seat:focus-visible { outline: 3px solid var(--focus, #1FA89B); outline-offset: 2px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px 12px 4px 4px; border-radius: 999px; background: #FFFCF4; border: 3px solid var(--c); color: #143E38; font-weight: 900; font-size: 15px; line-height: 1.1; cursor: grab; user-select: none; touch-action: none; box-shadow: 0 4px 10px -4px rgba(20,48,44,.45); transition: scale .2s; }
.chip i { flex: none; display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--c); color: #FFFFFF; font-style: normal; font-size: .78em; font-weight: 900; }
.chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* On a seat: a name card, first name on top and the rest below, as wide as the seat's space allows (--w cells) */
.seat .chip, .chip-ghost.is-card { position: absolute; left: 50%; top: 50%; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: calc(var(--cell) * var(--w, .94)); max-width: none; padding: calc(var(--cell) * .03) calc(var(--cell) * .02) calc(var(--cell) * .04); border-width: max(2px, calc(var(--cell) * .028)); border-top-width: max(4px, calc(var(--cell) * .07)); border-radius: calc(var(--cell) * .11); background: color-mix(in srgb, var(--c) 12%, #FFFCF4); translate: -50% -50%; font-size: calc(var(--cell) * .2 * var(--fs, 1)); line-height: 1.06; letter-spacing: -.01em; text-align: center; }
.seat .chip b, .chip-ghost.is-card b { display: block; overflow: hidden; font-weight: 900; }
.seat .chip small, .chip-ghost.is-card small { display: block; overflow: hidden; margin-top: .06em; color: #3B5E57; font-size: .8em; font-weight: 800; }
.chip.is-lifted { opacity: .3; }
.chip.is-picked { z-index: 3; outline: 3px solid var(--fg); outline-offset: 2px; animation: picked 1.4s ease-in-out infinite; }
@keyframes picked { 50% { scale: 1.08; } }
.chip.chip-ghost { position: fixed; z-index: 100; pointer-events: none; rotate: -3deg; box-shadow: var(--shadow-pop); translate: none; }
.chip-ghost .chip-lock { display: none; }
.chip-lock { position: absolute; right: -6px; top: -8px; display: grid; place-items: center; width: max(18px, calc(var(--cell) * .2)); height: max(18px, calc(var(--cell) * .2)); padding: 0; border: 0; border-radius: 50%; background: var(--forest); color: #FFFCF4; cursor: pointer; opacity: 0; transition: opacity .15s; }
.seat .chip-lock { right: calc(var(--cell) * -.08); top: calc(var(--cell) * -.11); }
.chip-lock svg { width: 62%; height: 62%; }
.chip:hover .chip-lock, .chip.is-locked .chip-lock, .chip-lock:focus-visible { opacity: 1; }
.chip.is-locked { border-style: double; border-width: max(4px, calc(var(--cell) * .045)); }
.seat .chip.is-locked { border-top-width: max(6px, calc(var(--cell) * .08)); }
.chip.is-locked .chip-lock { background: var(--fox); color: var(--on-fox); }
.seat-layer.is-dealt .chip, .seat .chip.is-in { animation: deal .5s cubic-bezier(.2,1.3,.4,1) both; animation-delay: calc(var(--k, 0) * 1ms); }
@keyframes deal { from { opacity: 0; scale: .4; rotate: -12deg; } }
.cr-list-wrap { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; background: var(--surface-2); }
.cr-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; }
.cr-list .chip { font-size: 14px; }
.cr-list-wrap.is-picking, .cr-list-wrap.is-target { outline: 3px dashed var(--teal); outline-offset: -3px; }
.cr-list-wrap.is-target { background: color-mix(in srgb, var(--teal) 14%, var(--surface-2)); }
.cr-picking { position: fixed; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: 10px; width: fit-content; margin-inline: auto; padding: 7px 7px 7px 14px; border-radius: 28px; background: var(--forest); color: var(--paper); font-weight: 800; line-height: 1.3; box-shadow: var(--shadow); animation: rise .3s cubic-bezier(.2,.9,.3,1) both; }
.cr-picking i { flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c, var(--fox)); border: 2px solid var(--paper); }
.cr-picking button { flex: none; padding: 7px 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,.16); color: inherit; font: inherit; font-weight: 900; cursor: pointer; }
.cr-picking button:hover { background: rgba(255,255,255,.26); }
body.presenting .seat:not(.is-taken) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .is-picking .seat:not(.is-taken)::after, .chip.is-picked { animation: none; } }

/* ---------- pairs and groups ---------- */
.ts-by { width: 100%; }
.ts-by button { flex: 1 1 auto; }
.ts-sizes { border-radius: 22px; }
.ts-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.ts-groups.is-few { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.ts-group { border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: outline-color .15s; outline: 3px dashed transparent; outline-offset: 3px; }
.ts-group.is-target { outline-color: var(--c); }
.ts-group h3 { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; padding: 10px 18px; background: var(--c); color: var(--ink); font-size: 19px; font-weight: 900; }
.ts-group h3 small { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.3); font-size: 14px; font-weight: 900; }
.ts-group ul { margin: 0; padding: 8px 18px 14px; list-style: none; }
.ts-group li { padding: 7px 0; border-bottom: 2px dashed var(--border); font-size: clamp(18px, 1.5vw, 22px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; cursor: grab; user-select: none; touch-action: none; border-radius: 8px; transition: background .15s, opacity .15s; }
.ts-group li:hover { background: var(--hover); }
.ts-group li:last-child { border-bottom: 0; }
.ts-group li.is-target { background: color-mix(in srgb, var(--c) 30%, transparent); }
.ts-group li.is-lifted { opacity: .3; }
.ts-groups.is-few li { font-size: clamp(22px, 2vw, 30px); }
.ts-groups.is-many li { font-size: 17px; padding: 4px 0; }
.ts-groups.is-new .ts-group { animation: pop .55s var(--d) cubic-bezier(.2,1.3,.4,1) both; }
.ts-groups.is-new li { animation: rise .45s var(--d2) cubic-bezier(.2,.9,.3,1) both; }
.mc-gghost { position: fixed; z-index: 100; padding: 6px 14px; border-radius: 12px; background: var(--surface); border: 3px solid var(--c); box-shadow: var(--shadow-pop); pointer-events: none; rotate: -3deg; white-space: nowrap; }

/* ---------- pick a name ---------- */
.ts-wheel-stage { position: relative; display: flex; justify-content: center; align-items: center; min-height: 320px; }
.ts-winner { position: absolute; left: 0; right: 0; bottom: 3%; z-index: 3; width: max-content; max-width: 94%; margin-inline: auto; padding: 12px 30px 18px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow-pop); border-top: 8px solid var(--seg); text-align: center; pointer-events: none; }
.ts-winner.is-in { animation: winnerIn .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes winnerIn { from { opacity: 0; transform: translateY(30px) scale(.6) rotate(-3deg); } to { opacity: 1; transform: none; } }
.ts-winner-kick { display: block; font-size: 14px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.ts-winner-name { display: block; margin-top: 2px; font-size: clamp(40px, 6.4vw, 92px); font-weight: 900; line-height: 1.02; letter-spacing: -.015em; overflow-wrap: anywhere; }
.ts-done { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; }
.done-card { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: min(340px, 86%); padding: 26px 24px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); text-align: center; animation: pop .6s cubic-bezier(.2,1.4,.4,1) both; }
.done-card .sticker { font-size: 30px; }
.done-card p { margin: 0; color: var(--muted); }
.ts-need { position: absolute; margin: 0; padding: 12px 18px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow); font-weight: 900; color: var(--muted); }
.ts-look { display: flex; flex-direction: column; gap: 8px; }
.ts-look-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-look-tile { display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: transform .2s; }
.ts-look-tile:hover { transform: translateY(-2px); }
.ts-look-tile canvas { width: 40px; height: 40px; }
.ts-look-tile[aria-pressed="true"] { border-color: var(--fg); background: var(--surface-3); }
.ts-picked { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto; margin: 8px 0 4px; padding: 0; list-style: none; }
.ts-picked li { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-radius: 10px; font-weight: 800; font-size: 15px; }
.ts-picked li:first-child:not(.empty) { background: var(--hover); animation: rise .45s cubic-bezier(.2,.9,.3,1); }
.ts-picked .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(20,41,38,.25); }
.ts-picked .empty { color: var(--muted); font-weight: 700; font-size: 14px; }

/* ---------- a random order ---------- */
.ts-order { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px 14px; margin: 0; padding: 0; list-style: none; }
.ts-order button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 16px 10px 10px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); color: var(--fg); text-align: left; cursor: pointer; transition: opacity .2s, transform .2s; }
.ts-order button:hover { transform: translateY(-2px); }
.ts-order b { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c); color: var(--ink); font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ts-order span { min-width: 0; font-size: clamp(19px, 1.7vw, 25px); font-weight: 900; overflow-wrap: anywhere; }
.ts-order button[aria-pressed="true"] { opacity: .45; }
.ts-order button[aria-pressed="true"] span { text-decoration: line-through; text-decoration-thickness: 3px; }
.ts-order.is-many span { font-size: 18px; }
.ts-order.is-many b { width: 38px; height: 38px; font-size: 17px; }
.ts-order.is-new li { animation: dealIn .45s var(--d) cubic-bezier(.2,1.3,.4,1) both; }
@keyframes dealIn { from { opacity: 0; transform: translateX(-26px) scale(.9); } to { opacity: 1; transform: none; } }

/* nothing made yet */
.ts-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: clamp(30px, 8vh, 90px) 20px; text-align: center; }
.ts-empty p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 18px; font-weight: 800; }
.ts-empty-art { display: grid; grid-template-columns: repeat(2, 34px); gap: 10px; }
.ts-empty-art i { width: 34px; height: 34px; border-radius: 50%; background: var(--c1); animation: hop 1.8s ease-in-out infinite; }
.ts-empty-art i:nth-child(2) { background: var(--c3); animation-delay: .15s; }
.ts-empty-art i:nth-child(3) { background: var(--c5); animation-delay: .3s; }
.ts-empty-art i:nth-child(4) { background: var(--c2); animation-delay: .45s; }
.ts-empty-order { grid-template-columns: 34px; gap: 6px; }
.ts-empty-order i { width: 120px; height: 18px; border-radius: var(--r-pill); }
@keyframes hop { 50% { transform: translateY(-8px); } }

/* ---------- the history ---------- */
.mc-hist { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mc-kinds { align-self: flex-start; }
.mc-day { margin: 14px 0 6px; font-size: 13px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mc-entries { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mc-entry { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); animation: rise .4s cubic-bezier(.2,.9,.3,1) both; }
.mc-entry-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--surface-2); color: var(--fg); }
.mc-entry-ico svg { width: 22px; height: 22px; }
.mc-entry.k-seat .mc-entry-ico { background: color-mix(in srgb, var(--teal) 22%, var(--surface)); }
.mc-entry.k-groups .mc-entry-ico { background: color-mix(in srgb, var(--fox) 22%, var(--surface)); }
.mc-entry.k-pairs .mc-entry-ico { background: color-mix(in srgb, var(--c6) 22%, var(--surface)); }
.mc-entry.k-order .mc-entry-ico { background: color-mix(in srgb, var(--c5) 22%, var(--surface)); }
.mc-entry-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-entry-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 0; }
.mc-entry-h b { font-size: 16px; font-weight: 900; }
.mc-entry-h span { color: var(--muted); font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mc-entry-acts { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; }
.mc-entry-acts .linkbtn { font-size: 13px; }
.mc-entry-acts .linkbtn.is-sure { color: var(--danger); }
.mc-pin { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--track); cursor: pointer; }
.mc-pin svg { width: 20px; height: 20px; }
.mc-pin:hover { background: var(--hover); color: var(--muted); }
.mc-pin[aria-pressed="true"] { color: var(--gold); }
.mc-mini { width: 120px; height: auto; }
.mc-mini-room { fill: color-mix(in srgb, #EBD3AB 60%, var(--surface)); stroke: var(--fg); stroke-width: 2.4; }
.mc-gprev, .mc-oprev { display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.mc-gprev span, .mc-oprev span { max-width: 100%; overflow: hidden; padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.mc-oprev b { margin-right: 4px; color: var(--fg); }
.plan-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.plan-form .field { flex: 1 1 150px; min-width: 0; padding: 8px 12px; font-size: 15px; border-radius: 12px; }
.mc-who-dd, .mc-who-dd .dd-btn { width: 100%; }
.mc-who-dd .dd-btn { justify-content: space-between; }
.mc-who-list { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; max-height: 56vh; overflow-y: auto; }
.mc-who-list li { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 12px; font-weight: 800; font-size: 14px; overflow: hidden; isolation: isolate; }
.mc-who-list li i { position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--w); background: color-mix(in srgb, var(--teal) 16%, transparent); }
.mc-who-n { display: flex; gap: 6px; flex: none; }
.mc-who-n em { font-style: normal; font-size: 12px; font-weight: 900; color: var(--muted); }
.mc-never { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.mc-who-list + .hist-head { margin-top: 14px; }

/* ---------- presenting: the tab's stage alone, large ---------- */
body.presenting { overflow: hidden; }
body.presenting :is(.top, .mc-bar, .mc-side, .sky) { display: none; }
body.presenting main { max-width: none; padding: 0; }
body.presenting .mc-split { display: block; }
body.presenting .mc-present-title { display: block; }
body.presenting .mc-stage { min-height: 100vh; min-height: 100dvh; justify-content: center; padding: 3vh 3vw; }
body.presenting .mc-seat .room-wrap { width: min(100%, calc((100vh - 120px) * var(--ar))); width: min(100%, calc((100dvh - 120px) * var(--ar))); }
body.presenting .ts-groups li { font-size: clamp(22px, 3.2vh, 40px); }
body.presenting .ts-group h3 { font-size: clamp(20px, 3vh, 34px); }
body.presenting .ts-order span { font-size: clamp(20px, 3.4vh, 40px); }
body.presenting .ts-order b { width: clamp(40px, 6vh, 64px); height: clamp(40px, 6vh, 64px); font-size: clamp(18px, 3vh, 30px); }
body.presenting { background: var(--bg); }
.mc-exit { position: fixed; top: 14px; right: 14px; z-index: 80; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--forest); color: var(--paper); font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: var(--shadow); opacity: 0; transition: opacity .3s; }
.mc-exit svg { width: 18px; height: 18px; }
.mc-exit.is-awake, .mc-exit:focus-visible { opacity: 1; }

/* ---------- printing: the seating on one landscape A4 page, or the groups ---------- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #FFFFFF !important; }
  body { padding: 8mm 10mm 0; }
  .sky, .top, .mc-bar, .mc-side, .toast, .mc-exit, .chip-lock, .cr-picking, .mc-here-pop { display: none !important; }
  main, .mc-split { display: block; max-width: none; margin: 0; padding: 0; }
  .room-pan { overflow: visible !important; padding: 0 !important; margin: 0 !important; }
  .mc-present-title { display: block; margin: 0 0 3mm; color: #143E38; font-size: 22pt; line-height: 1.15; text-align: center; }
  .mc-seat .room-wrap { width: min(100%, calc(168mm * var(--ar))) !important; min-width: 0 !important; margin: 0 auto; break-inside: avoid; }
  .seat:not(.is-taken) { visibility: hidden; }
  .ts-group { box-shadow: none; border: 1.5pt solid #143E38; break-inside: avoid; }
  .ts-groups.is-new .ts-group, .ts-groups.is-new li { animation: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 900px) {
  .mc-start { grid-template-columns: minmax(0, 1fr); min-height: 0; text-align: center; }
  .mc-start-copy { align-items: center; }
  .mc-points { align-items: flex-start; text-align: left; }
  .mc-split { grid-template-columns: minmax(0, 1fr); }
  .mc-side { order: -1; }   /* the controls above the groups and the order */
  #paneSeat .mc-side, #panePick .mc-side, #paneClass .mc-side, #paneHistory .mc-side { order: 1; }
  .mc-seat .room-wrap { width: 100%; }
}
@media (max-width: 600px) {
  .mc-bar { grid-template-columns: minmax(0, 1fr); }
  .mc-bar-actions { justify-content: flex-start; }
  .mc-class .dd { flex: 1 1 100%; }
  .mc-class .dd-btn { width: 100%; justify-content: space-between; }
  .mc-tabs button { padding: 9px 12px; font-size: 14px; gap: 6px; }
  .mc-tabs svg { width: 17px; height: 17px; }
  .ts-winner { padding: 8px 18px 12px; }
  .mc-name { padding: 9px 11px; font-size: 15px; }
  .mc-entry { grid-template-columns: auto minmax(0, 1fr); }
  .mc-entry-acts { grid-column: 1 / -1; justify-content: flex-start; }
}
