/* The Classroom Screen (/classroom-screen): the whole window is the board. Big type for a projector across the room. */
:root {
  --p-50: #f5f3ff; --p-100: #ede9fe; --p-200: #ddd6fe; --p-300: #c4b5fd; --p-500: #8b5cf6; --p-600: #7c3aed; --p-700: #6d28d9; --p-900: #4c1d95;
  --s-100: #ffedd5; --s-500: #f97316; --s-600: #ea580c;
  --ink: #1f1637; --muted: #5b5570; --line: #e4e0ef; --card: #ffffff;
  --ok: #16a34a; --warn: #eab308; --stop: #dc2626;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body.cs-body { margin: 0; font-family: Poppins, system-ui, sans-serif; color: var(--ink); background: #1f1637; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Every dropdown draws its own chevron, clear of the rounded edge (the browser's arrow sits on the edge). */
.cs select { min-height: 38px; padding: 6px 38px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%235b5570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 14px 14px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.cs select:hover { border-color: var(--p-300); }
.cs select:focus-visible { outline: 3px solid var(--s-500); outline-offset: 2px; }
[hidden] { display: none !important; }

/* The page is one screen: the top bar, then the board, which scrolls by itself and ends above the dock (--dock-space). */
.cs { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.cs[data-bg="chalkboard"] { background: radial-gradient(circle at 30% 20%, #2f5d50 0%, #23463c 60%, #1c3a31 100%); }
.cs[data-bg="whiteboard"] { background: #f4f5f7; }
.cs[data-bg="sky"] { background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 55%, #e0f2fe 100%); }
.cs[data-bg="sunset"] { background: linear-gradient(160deg, #f97316 0%, #ec4899 55%, #8b5cf6 100%); }
.cs[data-bg="forest"] { background: linear-gradient(170deg, #166534 0%, #15803d 50%, #4d7c0f 100%); }
.cs[data-bg="night"] { background: radial-gradient(circle at 70% 10%, #312e81 0%, #1e1b4b 50%, #0f0a2e 100%); }
.cs[data-bg="dots"] { background: #fffaf0 radial-gradient(#e5d9c3 1.5px, transparent 1.6px) 0 0 / 22px 22px; }
.cs[data-bg="grid"] { background: #f8fafc linear-gradient(#dbe4f0 1px, transparent 1px) 0 0 / 28px 28px, #f8fafc linear-gradient(90deg, #dbe4f0 1px, transparent 1px) 0 0 / 28px 28px; }

/* Top bar */
/* Top bar: the brand, the three tabs, then quiet board settings (icons) and the two actions, Save and Present. */
.cs-top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 7px 14px; background: rgba(31, 22, 55, 0.94); color: #fff; backdrop-filter: blur(6px); }
.cs-brand { display: inline-flex; gap: 8px; align-items: center; color: #fff; font-size: 1.05rem; font-weight: 700; text-decoration: none; }
.cs-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.cs-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.cs-tabs button { min-height: 36px; padding: 5px 16px; border: 0; border-radius: 999px; background: none; color: rgba(255, 255, 255, 0.85); font-weight: 600; cursor: pointer; }
.cs-tabs button:hover { color: #fff; }
.cs-tabs button[aria-selected="true"] { background: #fff; color: var(--p-700); }
.cs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.cs-settings { display: flex; gap: 2px; }
.cs-tbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: rgba(255, 255, 255, 0.8); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.cs-tbtn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.cs-tbtn svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cs-tbtn[data-draw][aria-pressed="true"] { background: #fff; color: var(--p-700); }
.cs-tbtn[data-mute][aria-pressed="true"] { color: #fdba74; }
.cs-divider { width: 1px; height: 26px; margin: 0 4px; background: rgba(255, 255, 255, 0.18); }
@media (max-width: 1180px) { .cs-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.cs-btn { display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 38px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 0.92rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.cs-btn:hover { border-color: var(--p-300); }
.cs-btn:focus-visible, .cs-tbtn:focus-visible, .cs-tabs button:focus-visible, .cs-dock button:focus-visible, .cs-wtools button:focus-visible, .cs-page:focus-visible, .cs-exit:focus-visible { outline: 3px solid var(--s-500); outline-offset: 2px; }
.cs-top .cs-save { border: 0; background: var(--s-500); color: #fff; }
.cs-top .cs-present-btn { border: 0; background: #fff; color: var(--p-700); }
.cs-top .cs-present-btn:hover { background: var(--p-50); }
.cs-primary { border: 0; background: var(--p-600); color: #fff; }
.cs-primary:hover { background: var(--p-700); }
.cs-orange { border: 0; background: var(--s-500); color: #fff; }
.cs-icon { width: 40px; padding: 0; font-size: 1.1rem; }
.cs-count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 0.78rem; text-align: center; }
.cs-muted { color: var(--muted); font-size: 0.9rem; }

/* Board */
.cs-main { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: var(--dock-space, 96px); overflow: auto; }
.cs-panel { flex: 1; padding: 14px 16px 16px; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-flow: dense; gap: 16px; }
.cs-empty { display: grid; justify-items: center; gap: 8px; margin: 60px auto; padding: 22px 28px; max-width: 440px; border-radius: 20px; background: rgba(255, 255, 255, 0.95); text-align: center; }
.cs-empty strong { font-size: 1.15rem; }
.cs-empty p { margin: 0 0 6px; color: var(--muted); }

/* Pages of the board */
.cs-pages { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; margin: 0 0 14px; padding: 4px; border-radius: 14px; background: rgba(15, 10, 46, 0.38); backdrop-filter: blur(4px); }
.cs-page { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 4px 12px 4px 6px; border: 0; border-radius: 10px; background: none; color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.cs-page:hover { background: rgba(255, 255, 255, 0.12); }
.cs-page b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: rgba(255, 255, 255, 0.2); font-size: 0.72rem; }
.cs-page[aria-current="page"] { background: #fff; color: var(--p-700); }
.cs-page[aria-current="page"] b { background: var(--p-100); }
.cs-page-add { padding: 4px 12px; color: rgba(255, 255, 255, 0.88); }

/* A widget: no title bar. Its label is small; its controls show on hover or keyboard focus. Big parts size with the
   widget's own width (container units), so a widget grows with S to XL and with Spotlight. */
.cs-widget { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 240px; padding: 8px 12px 12px; border-radius: 20px; background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 14px 34px -14px rgba(10, 6, 30, 0.55); overflow: hidden; container-type: inline-size; }
.cs-widget[data-size="m"] { grid-column: span 2; }
.cs-widget[data-size="l"] { grid-column: span 3; grid-row: span 2; }
.cs-widget[data-size="xl"] { grid-column: 1 / -1; grid-row: span 2; }
.cs-widget.dragging { opacity: 0.45; }
.cs-widget.drop-before { box-shadow: -6px 0 0 var(--s-500), 0 14px 34px -14px rgba(10, 6, 30, 0.55); }
.cs-wlabel { display: flex; align-items: center; gap: 7px; min-height: 28px; margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-wlabel-icon { flex: none; width: 24px; height: 24px; }
.cs-wtools { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--ink); box-shadow: 0 6px 18px -6px rgba(10, 6, 30, 0.6);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
.cs-widget:hover .cs-wtools, .cs-widget:focus-within .cs-wtools, .cs-widget.cs-spot .cs-wtools { opacity: 1; transform: none; pointer-events: auto; }
.cs-wtools button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; background: none; color: #fff; cursor: pointer; }
.cs-wtools button:hover, .cs-wtools button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.18); }
.cs-wtools svg { width: 16px; height: 16px; }
.cs-wtools .cs-grip { cursor: grab; }
.cs-wsize { min-width: 24px; color: var(--p-300); font-size: 0.7rem; font-weight: 700; text-align: center; }
.cs-wbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 6px 2px 2px; text-align: center; }
.cs-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cs-chip { min-height: 34px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.cs-chip[aria-pressed="true"] { border-color: var(--p-600); background: var(--p-100); color: var(--p-900); }
@media (hover: none) {
  .cs-wtools { opacity: 1; transform: none; pointer-events: auto; }
  .cs-wlabel { padding-right: 200px; }
}

/* Spotlight: one widget on the full screen */
.cs-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 10, 46, 0.6); backdrop-filter: blur(4px); }
.cs-widget.cs-spot { position: fixed; inset: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(24px, env(safe-area-inset-left, 0px)); z-index: 46; overflow: auto; }

/* Timer and clock */
.cs-digits { font-size: clamp(2.6rem, 22cqi, 16rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cs-digits-sm { font-size: clamp(1.8rem, 10cqi, 6rem); }
.cs-digits-md { font-size: clamp(2.4rem, 15cqi, 9rem); }
.cs-digits.done { color: var(--stop); animation: cs-pulse 1s infinite; }
.cs-bar { width: 100%; height: 10px; border-radius: 999px; background: var(--p-100); overflow: hidden; }
.cs-bar span { display: block; height: 100%; background: var(--p-600); transition: width 0.4s linear; }
.cs-pie { width: min(70cqi, 62vh); aspect-ratio: 1; }
.cs-date { color: var(--muted); font-weight: 600; }
@keyframes cs-pulse { 50% { opacity: 0.35; } }

/* Picker, groups, points */
.cs-name { min-height: 1.2em; font-size: clamp(2rem, 14cqi, 9rem); font-weight: 700; color: var(--p-700); }
.cs-name.rolling { color: var(--muted); }
.cs-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; width: 100%; text-align: left; }
.cs-group { padding: 8px 10px; border-radius: 12px; background: var(--p-50); font-size: 0.95rem; }
.cs-group strong { display: block; color: var(--p-700); }
.cs-teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; width: 100%; }
.cs-team { padding: 10px; border-radius: 14px; color: #fff; }
.cs-team input { width: 100%; border: 0; background: none; color: #fff; font-weight: 700; text-align: center; }
.cs-team .cs-score { font-size: clamp(2.4rem, 10cqi, 7rem); font-weight: 700; line-height: 1.1; }
.cs-team button { width: 44px; height: 40px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, 0.25); color: #fff; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.cs-team-members { font-size: 0.85rem; line-height: 1.3; opacity: 0.92; }
.cs-students { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; width: 100%; }
.cs-student { position: relative; display: flex; border-radius: 12px; background: var(--shade); color: #fff; }
.cs-student-give { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 48px; min-width: 0; padding: 6px 8px 6px 12px; border: 0; border-radius: 12px 0 0 12px; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.cs-student-name { overflow-wrap: anywhere; line-height: 1.2; }
.cs-student-score { min-width: 1.6em; padding: 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); font-size: 1.15rem; text-align: center; }
.cs-student-take { flex: none; width: 34px; border: 0; border-left: 1px solid rgba(255, 255, 255, 0.3); border-radius: 0 12px 12px 0; background: rgba(0, 0, 0, 0.12); color: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.cs-student-give:active { transform: scale(0.97); }
/* A small Class points tool: two columns, the score under the name, so 30 students stay short */
@container (max-width: 320px) {
  .cs-students { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cs-student-give { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 5px 6px 5px 9px; font-size: 0.8rem; }
  .cs-student-score { padding: 0 6px; font-size: 0.85rem; }
  .cs-student-take { width: 24px; font-size: 1rem; }
}
.cs-here { display: flex; flex-wrap: wrap; gap: 8px; max-height: 50vh; overflow: auto; }
.cs-here-name { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cs-here-name[aria-pressed="true"] { border-style: dashed; background: #f4f2f8; color: var(--muted); text-decoration: line-through; }
.cs-here-tag { padding: 1px 8px; border-radius: 999px; background: #fee2e2; color: #991b1b; font-size: 0.75rem; text-decoration: none; }

/* Noise and voice */
.cs-meter { position: relative; width: 100%; height: clamp(160px, 42cqi, 62vh); border-radius: 14px; background: #0f0a2e; overflow: hidden; }
.cs-meter canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cs-meter-label { font-weight: 700; }
.cs-voice-num { width: clamp(100px, 36cqi, 46vh); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: clamp(3.4rem, 22cqi, 15rem); font-weight: 700; line-height: 1; }
.cs-voice-name { font-size: clamp(1.4rem, 7cqi, 4.5rem); font-weight: 700; line-height: 1.15; }
.cs-v0 { background: #6b7280; } .cs-v1 { background: #3b82f6; } .cs-v2 { background: #16a34a; } .cs-v3 { background: #f59e0b; } .cs-v4 { background: #dc2626; }

/* Traffic light */
.cs-light { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 28px; background: #1f2937; }
.cs-light button { width: clamp(56px, 16cqi, 24vh); aspect-ratio: 1; border: 0; border-radius: 50%; opacity: 0.25; cursor: pointer; }
@container (min-width: 520px) { .cs-light { flex-direction: row; } }
.cs-light button[aria-pressed="true"] { opacity: 1; box-shadow: 0 0 24px currentColor; }
.cs-light-label { font-size: clamp(1.4rem, 6cqi, 4rem); font-weight: 700; }

/* Text */
.cs-text { width: 100%; min-height: 140px; flex: 1; padding: 8px; border: 1px dashed transparent; border-radius: 10px; font-size: clamp(1.3rem, 4.6cqi, 3.4rem); line-height: 1.45; text-align: left; outline: none; white-space: pre-wrap; }
.cs-text:focus { border-color: var(--p-300); background: var(--p-50); }

/* Bingo */
.cs-ball { width: clamp(110px, 34cqi, 44vh); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--s-500); color: #fff; font-size: clamp(2.4rem, 11cqi, 8rem); font-weight: 700; }
.cs-called { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-height: 90px; overflow: auto; font-size: 0.8rem; }
.cs-called span { padding: 2px 6px; border-radius: 6px; background: var(--p-100); }

/* Worksheet widget */
.cs-ws img { max-width: 100%; max-height: min(70cqi, 60vh); border: 1px solid var(--line); border-radius: 8px; }

/* Dock: the teacher's tools, the Lesson group, All tools and Hide. The board keeps room under its last row for it. */
.cs-dock { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 15; display: flex; align-items: stretch; gap: 2px; max-width: calc(100% - 24px); padding: 6px; border-radius: 22px; background: rgba(255, 255, 255, 0.97); box-shadow: 0 14px 40px -10px rgba(10, 6, 30, 0.55); transform: translateX(-50%); }
.cs-dock-tools { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cs-dock-tools::-webkit-scrollbar { display: none; }
.cs-dock-tool { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 68px; padding: 6px; border: 0; border-radius: 15px; background: none; color: var(--ink); font-size: 0.7rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.cs-dock-tool:hover { background: var(--p-50); }
.cs-dock .cs-dock-icon { display: block; width: 32px; height: 32px; transition: transform 0.15s; }
.cs-dock-tool:hover .cs-dock-icon { transform: translateY(-2px) scale(1.06); }
.cs-dock-lesson { flex: none; display: flex; gap: 2px; margin-left: 4px; padding: 0 2px; border-radius: 16px; background: var(--s-100); }
.cs-dock-lesson .cs-dock-tool:hover { background: #fed7aa; }
.cs-dock-all-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--p-100); color: var(--p-700); }
.cs-dock-all-icon svg { width: 18px; height: 18px; }
.cs-dock-all { margin-left: 4px; }
.cs-dock-hide { color: var(--muted); }
.cs-dock-hide svg { width: 32px; height: 32px; padding: 7px; }
.cs-dock-min { border-radius: 999px; }
.cs-hide-dock .cs-dock { display: none; }

/* All tools and the page starts */
.cs-dialog.cs-dialog-wide { width: min(820px, calc(100% - 32px)); }
.cs-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cs-tools-group { margin: 10px 0 6px; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cs-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.cs-tool { position: relative; }
.cs-tool-add { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 0.86rem; font-weight: 600; text-align: left; cursor: pointer; }
.cs-tool-add:hover { border-color: var(--p-300); background: var(--p-50); }
.cs-tool-add img { flex: none; width: 32px; height: 32px; }
.cs-tool-pin { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 0.8rem; cursor: pointer; }
.cs-tool-pin[aria-pressed="true"] { background: var(--s-500); color: #fff; }
/* Start a page: moments on the left; the preview, the tools and their settings on the right */
.cs-dialog.cs-dialog-start { width: min(1000px, calc(100% - 32px)); }
.cs-start-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: min(720px, 86vh); }
.cs-start-side { display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow: auto; padding: 22px 14px 16px; background: #f7f5fc; border-right: 1px solid #ece8f6; }
.cs-start-page { padding: 0 10px; color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.cs-start-side h2 { margin: 0 0 10px; padding: 0 10px; font-size: 1.35rem; }
.cs-start-list { display: flex; flex-direction: column; gap: 4px; }
.cs-start-item { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 10px; border: 0; border-radius: 14px; background: none; text-align: left; cursor: pointer; }
.cs-start-item:hover { background: rgba(124, 58, 237, 0.07); }
.cs-start-item[aria-pressed="true"] { background: #fff; box-shadow: 0 0 0 2px var(--p-600); }
.cs-start-item img { flex: none; width: 30px; height: 30px; }
.cs-start-item-text { display: flex; flex-direction: column; min-width: 0; }
.cs-start-item-text strong { font-size: 0.92rem; }
.cs-start-item-text span { color: var(--muted); font-size: 0.78rem; }
.cs-start-blank { margin-top: 8px; border: 1px dashed var(--p-300); color: var(--p-700); }
.cs-start-plus { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--p-100); font-weight: 700; }
.cs-start-main { display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow: auto; padding: 22px 24px 18px; }
.cs-start-name { margin: 0; font-size: 1.5rem; }
.cs-start-main .cs-dialog-head { align-items: flex-start; }
.cs-start-main .cs-dialog-head p { margin: 4px 0 0; }
.cs-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 26px; grid-auto-flow: dense; gap: 8px; padding: 12px; border-radius: 16px; background: radial-gradient(circle at 30% 20%, #2f5d50 0%, #1c3a31 100%); }
.cs-mini-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 4px; border-radius: 10px; background: #fff; text-align: center; overflow: hidden; }
.cs-mini-tile img { width: 28px; height: 28px; }
.cs-mini-tile strong { font-size: 0.76rem; line-height: 1.2; }
.cs-mini-tile span { color: var(--muted); font-size: 0.7rem; line-height: 1.2; }
.cs-mini-old { opacity: 0.45; }
.cs-mini-empty { grid-column: 1 / -1; grid-row: span 3; display: grid; place-items: center; margin: 0; border: 2px dashed rgba(255, 255, 255, 0.3); border-radius: 10px; color: rgba(255, 255, 255, 0.8); font-weight: 600; }
.cs-start-tools { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.cs-start-tools legend { margin-bottom: 6px; padding: 0; font-size: 0.92rem; }
.cs-start-tool { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px 4px 12px; border: 1px solid var(--line); border-radius: 12px; }
.cs-start-tool input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--p-600); }
.cs-start-tool img { width: 30px; height: 30px; }
.cs-start-tool label { font-weight: 600; cursor: pointer; }
.cs-start-tool.cs-off img, .cs-start-tool.cs-off label, .cs-start-tool.cs-off select { opacity: 0.45; }
.cs-start-none { padding-right: 8px; color: var(--muted); font-size: 0.82rem; }
.cs-start-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.cs-start-keep { display: grid; gap: 8px; margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 14px; }
.cs-start-keep legend { padding: 0 6px; font-weight: 700; font-size: 0.88rem; }
.cs-start-keep label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.cs-start-keep input { margin-top: 4px; accent-color: var(--p-600); }
.cs-start-keep label > span { display: flex; flex-direction: column; font-size: 0.9rem; }
.cs-start-keep .cs-muted { font-size: 0.8rem; }
.cs-field input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500; }
.cs-start-go:disabled { opacity: 0.5; cursor: not-allowed; }
.cs-start-main > .cs-dialog-buttons { position: sticky; bottom: -18px; margin: 0 -24px -18px; padding: 12px 24px 18px; background: #fff; border-top: 1px solid #efecf6; }
@media (max-width: 720px) {
  .cs-start-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cs-start-side { border-right: 0; border-bottom: 1px solid #ece8f6; }
  .cs-start-list { flex-direction: row; overflow-x: auto; }
  .cs-start-item { flex: none; }
}
.cs-field { display: grid; gap: 4px; font-weight: 600; }
.cs-dialog-split { justify-content: space-between; }

/* Present mode: no top bar, dock, labels or controls; the controls come back over a widget */
.cs-presenting .cs-top, .cs-presenting .cs-dock, .cs-presenting .cs-pages, .cs-presenting .cs-wlabel, .cs-presenting .cs-wtools { display: none; }
.cs-presenting .cs-panel { padding: 16px; }
/* Present mode fits one screen: the rows share its height, and a tool with more than fits scrolls inside its card. */
.cs-presenting .cs-main { margin-bottom: 0; }
.cs-presenting #cs-board:not([hidden]) { display: flex; flex-direction: column; min-height: 0; }
.cs-presenting #cs-board .cs-grid { flex: 1; min-height: 0; grid-auto-rows: minmax(0, 1fr); }
.cs-presenting #cs-board .cs-widget { min-height: 0; }
.cs-presenting #cs-board .cs-wbody { min-height: 0; overflow: auto; justify-content: safe center; }
/* Present mode: the controls float in one dark bar over the card (classroom-screen.js floatAll), so they take no space */
.cs-float { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 6px; max-height: calc(100% - 16px); padding: 8px; overflow: auto;
  border-radius: 14px; background: rgba(31, 22, 55, 0.94); box-shadow: 0 10px 24px -10px rgba(10, 6, 30, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.15s; }
.cs-widget:hover > .cs-float, .cs-widget:focus-within > .cs-float, .cs-widget.cs-touched > .cs-float { opacity: 1; pointer-events: auto; }
.cs-float .cs-btn, .cs-float .cs-chip { border-color: transparent; background: rgba(255, 255, 255, 0.14); color: #fff; }
.cs-float .cs-btn:hover, .cs-float .cs-chip:hover { background: rgba(255, 255, 255, 0.24); }
.cs-float .cs-chip[aria-pressed="true"], .cs-float .cs-primary { background: var(--p-600); color: #fff; }
.cs-float .cs-muted, .cs-float label { color: #e9e5f5; }
/* Present mode: the big parts grow with the card's height too (cqh), not only its width */
.cs-presenting #cs-board .cs-widget { container-type: size; }
.cs-presenting #cs-board .cs-digits { font-size: clamp(1.6rem, min(22cqi, 40cqh), 16rem); }
.cs-presenting #cs-board .cs-digits-sm { font-size: clamp(1.1rem, min(10cqi, 14cqh), 6rem); }
.cs-presenting #cs-board .cs-digits-md { font-size: clamp(1.4rem, min(15cqi, 28cqh), 9rem); }
.cs-presenting #cs-board .cs-pie { width: min(70cqi, 68cqh); }
.cs-presenting #cs-board .cs-name { font-size: clamp(1.4rem, min(14cqi, 30cqh), 9rem); }
.cs-presenting #cs-board .cs-team .cs-score { font-size: clamp(1.6rem, min(10cqi, 24cqh), 7rem); }
.cs-presenting #cs-board .cs-meter { height: clamp(80px, 82cqh, 100vh); }
.cs-presenting #cs-board .cs-voice-num { width: clamp(64px, min(36cqi, 52cqh), 100vh); font-size: clamp(2rem, min(22cqi, 32cqh), 15rem); }
.cs-presenting #cs-board .cs-voice-name { font-size: clamp(1rem, min(7cqi, 11cqh), 4.5rem); }
.cs-presenting #cs-board .cs-light button { width: clamp(36px, min(16cqi, 24cqh), 100vh); }
.cs-presenting #cs-board .cs-light-label { font-size: clamp(1rem, min(6cqi, 10cqh), 4rem); }
.cs-presenting #cs-board .cs-ball { width: clamp(64px, min(34cqi, 62cqh), 100vh); font-size: clamp(1.6rem, min(11cqi, 20cqh), 8rem); }
.cs-presenting #cs-board .cs-ws img { max-height: min(70cqi, 72cqh); }
.cs-presenting #cs-board .cs-die { font-size: clamp(2.4rem, min(24cqi, 60cqh), 16rem); }
.cs-presenting #cs-board .cs-symbol { font-size: clamp(2.4rem, min(24cqi, 46cqh), 16rem); }
.cs-presenting #cs-board .cs-symbol img { width: clamp(56px, min(34cqi, 56cqh), 280px); }
.cs-presenting #cs-board .cs-qr { width: min(80cqi, 82cqh); }
.cs-presenting #cs-board .cs-student-give { min-height: clamp(40px, 11cqh, 72px); font-size: clamp(0.8rem, min(3.4cqi, 4.6cqh), 1.5rem); }
.cs-presenting .cs-wbody .cs-teacher { opacity: 0; transition: opacity 0.2s; }
.cs-presenting .cs-wbody > .cs-row, .cs-presenting .cs-wbody > .cs-address, .cs-presenting .cs-wbody > label, .cs-presenting .cs-wbody > input,
.cs-presenting .cs-wbody > select, .cs-presenting .cs-team .cs-row, .cs-presenting .cs-student-take { opacity: 0; transition: opacity 0.2s; }
.cs-presenting .cs-widget:hover .cs-wbody > *, .cs-presenting .cs-widget:focus-within .cs-wbody > *, .cs-presenting .cs-widget:hover .cs-team .cs-row, .cs-presenting .cs-widget:hover .cs-student-take { opacity: 1; }
.cs-exit { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); z-index: 60; padding: 8px 16px; border: 0; border-radius: 999px; background: rgba(31, 22, 55, 0.88); color: #fff; font-weight: 600; opacity: 0; transition: opacity 0.3s; cursor: pointer; }
.cs-exit.cs-exit-on, .cs-exit:focus-visible { opacity: 1; }

/* Poll: a show of hands counted on the board */
.cs-poll-body { align-items: stretch; }
.cs-poll-q { padding: 4px 6px; border: 1px dashed transparent; border-radius: 10px; color: var(--ink); font-size: clamp(1.1rem, 6cqi, 3.6rem); font-weight: 700; line-height: 1.2; text-align: left; outline: none; }
.cs-poll-q:focus { border-color: var(--p-300); background: var(--p-50); }
.cs-poll { display: grid; gap: clamp(6px, 1.6cqi, 16px); width: 100%; }
.cs-poll-answer { position: relative; display: flex; align-items: center; gap: 10px; padding: clamp(8px, 2cqi, 18px) 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; color: var(--ink); font-size: clamp(1rem, 4.4cqi, 2.6rem); font-weight: 600; text-align: left; cursor: pointer; }
.cs-poll-answer:hover { border-color: var(--p-300); }
.cs-poll-bar { position: absolute; inset: 0 auto 0 0; background: #ccfbf1; transition: width 0.3s; }
.cs-poll-answer b, .cs-poll-text, .cs-poll-count { position: relative; }
.cs-poll-answer b { display: grid; place-items: center; flex: none; width: 1.6em; height: 1.6em; border-radius: 8px; background: var(--p-600); color: #fff; font-size: 0.8em; }
.cs-poll-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cs-poll-count { color: #0f766e; font-style: normal; font-variant-numeric: tabular-nums; }
/* The phone vote: the QR code, the code in two halves and how many voted, then Close the vote. */
.cs-poll-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; width: 100%; padding: 10px; border-radius: 14px; background: var(--p-50); }
.cs-poll-qr { flex: none; width: clamp(72px, 18cqi, 160px); height: auto; aspect-ratio: 1; border-radius: 8px; background: #fff; }
.cs-poll-join { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; text-align: left; }
.cs-poll-code { font-size: clamp(1.4rem, 7cqi, 3.2rem); line-height: 1.1; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.cs-poll-edit { display: flex; align-items: center; gap: 8px; }
.cs-poll-edit b { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--p-600); color: #fff; }
.cs-poll-edit input { flex: 1; min-width: 0; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; }

/* Routines */
.cs-routines, .cs-lesson { max-width: 1100px; margin: 0 auto; padding: 20px; border-radius: 20px; background: rgba(255, 255, 255, 0.97); }
.cs-routines h2 { margin: 0 0 4px; }
.cs-routines h3 { margin: 22px 0 10px; font-size: 1rem; color: var(--p-900); }
.cs-routines-head { display: grid; gap: 8px; justify-items: start; }
.cs-routines-head p { margin: 0; color: var(--muted); }
.cs-routine-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cs-rcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.cs-rcard strong { font-size: 1.05rem; }
.cs-rcard .cs-row { justify-content: flex-start; margin-top: auto; }
.cs-runner { max-width: 1200px; margin: 0 auto; display: grid; gap: 16px; padding: 24px; border-radius: 24px; background: rgba(255, 255, 255, 0.97); text-align: center; }
.cs-run-name { margin: 0; color: var(--muted); font-weight: 600; }
.cs-run-step { margin: 0; font-size: clamp(2.2rem, 6vw, 5rem); font-weight: 700; line-height: 1.1; }
.cs-run-count { font-size: clamp(3.5rem, 12vw, 9rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--p-700); }
.cs-run-count.low { color: var(--stop); }
.cs-run-meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.cs-run-voice { padding: 6px 16px; border-radius: 999px; color: #fff; font-weight: 700; }
.cs-run-next { color: var(--muted); }
.cs-run-steps { display: flex; gap: 6px; justify-content: center; }
.cs-run-steps span { width: 34px; height: 8px; border-radius: 999px; background: var(--p-100); }
.cs-run-steps span.done { background: var(--p-600); }
.cs-run-steps span.now { background: var(--s-500); }
.cs-run-buttons .cs-btn { min-height: 52px; padding: 8px 24px; font-size: 1.1rem; }
.cs-run-break { padding: 12px 18px; border-radius: 14px; background: var(--s-100); font-size: 1.4rem; font-weight: 600; }
/* The runner for children who cannot read yet: the step's picture with the time left as a ring around it (or a slice or
   ten dots), green, then yellow from half, then red for the last fifth; the digits stay small for the teacher. */
.cs-runner { --shade: #16a34a; }
.cs-runner[data-shade="mid"] { --shade: #eab308; }
.cs-runner[data-shade="stop"] { --shade: var(--stop); }
.cs-run-stage { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 3vw, 48px); align-items: center; text-align: left; }
.cs-run-pic { position: relative; width: clamp(150px, min(26vw, 40vh), 340px); aspect-ratio: 1; display: grid; place-items: center; }
.cs-run-face { width: 86%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #fbf3e6; }
.cs-run-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-run-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cs-ring-track, .cs-ring-arc { fill: none; stroke-width: 6; }
.cs-ring-track { stroke: var(--p-100); }
.cs-ring-arc { stroke: var(--shade); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear, stroke 0.4s; }
.cs-run-words { display: grid; gap: 12px; justify-items: start; }
.cs-run-stage .cs-run-step { font-size: clamp(1.8rem, min(4.4vw, 8vh), 4.2rem); }
.cs-run-words .cs-run-count { font-size: clamp(1.6rem, 3vw, 2.4rem); color: var(--muted); }
.cs-run-words .cs-run-meta { justify-content: flex-start; }
.cs-run-gauge:empty { display: none; }
.cs-run-slice { width: clamp(90px, 11vw, 150px); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--shade) var(--left, 360deg), var(--p-100) 0); box-shadow: inset 0 0 0 6px #fff, 0 0 0 3px var(--p-100); }
.cs-run-dots { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-run-dots i { width: clamp(22px, 2.6vw, 36px); aspect-ratio: 1; border-radius: 50%; background: var(--p-100); transition: background 0.3s; }
.cs-run-dots i.on { background: var(--shade); }
.cs-run-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; }
.cs-run-strip button { flex: none; width: 104px; display: grid; justify-items: center; gap: 4px; padding: 8px 6px; border: 2px solid var(--p-100); border-radius: 16px; background: #fff; color: var(--muted); font: inherit; font-size: 0.78rem; line-height: 1.2; cursor: pointer; }
.cs-run-strip img { width: clamp(40px, 6vh, 60px); height: clamp(40px, 6vh, 60px); border-radius: 50%; object-fit: cover; }
.cs-run-strip button.now { border-color: var(--s-500); color: var(--ink, #1d1830); }
.cs-run-strip button.done { opacity: 0.45; }
.cs-run-head { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; }
.cs-run-settings { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: flex-end; }
.cs-run-settings .cs-chip { min-height: 36px; padding: 4px 12px; font-size: 0.85rem; }
.cs-run-choice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cs-runner[data-view="big"] .cs-run-pic { width: clamp(200px, min(36vw, 52vh), 460px); }
.cs-runner[data-view="big"] .cs-run-stage .cs-run-step { font-size: clamp(1.5rem, min(3.2vw, 6vh), 2.8rem); }
.cs-runner[data-view="words"] .cs-run-pic, .cs-runner[data-view="words"] .cs-run-strip img { display: none; }
.cs-runner[data-view="words"] .cs-run-stage .cs-run-step { font-size: clamp(2.2rem, 6vw, 5rem); }
.cs-runner[data-view="words"] .cs-run-stage { grid-template-columns: 1fr; text-align: center; }
.cs-runner[data-view="words"] .cs-run-words { justify-items: center; }
.cs-runner[data-view="words"] .cs-run-words .cs-run-meta { justify-content: center; }
.cs-runner[data-view="words"] .cs-run-words .cs-run-count, .cs-run-pic[hidden] + .cs-run-words .cs-run-count { font-size: clamp(3.5rem, 12vw, 9rem); color: var(--p-700); }
.cs-run-stage:has(.cs-run-pic[hidden]) { grid-template-columns: 1fr; text-align: center; }
.cs-run-stage:has(.cs-run-pic[hidden]) .cs-run-words { justify-items: center; }
.cs-wpic { width: clamp(64px, 30cqi, 140px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin: 0 auto; background: #fbf3e6; }
.cs-wpic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-edit-pic { width: 44px; height: 44px; padding: 0; border: 1px dashed var(--line) !important; border-radius: 50% !important; overflow: hidden; background: #fbf3e6 !important; color: var(--muted); }
.cs-edit-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-pick-box { margin: 4px 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--p-50, #f7f4ff); display: grid; gap: 10px; }
.cs-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; }
.cs-pick-pic { padding: 2px; border: 2px solid transparent; border-radius: 50%; background: #fff; cursor: pointer; }
.cs-pick-pic[aria-pressed="true"] { border-color: var(--s-500); }
.cs-pick-pic img { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; display: block; }
.cs-pick-box label.cs-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cs-pick-box label.cs-btn { position: relative; cursor: pointer; }
/* The noise meter's card: what the browser will ask, or how to unblock the microphone. */
.cs-mic-card { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 12px; text-align: center; color: #fff; background: rgba(15, 10, 46, 0.86); }
.cs-mic-card[hidden] { display: none; }
.cs-mic-card ol { margin: 0; padding-left: 1.2em; text-align: left; font-size: 0.9rem; }
.cs-mic-card small { max-width: 34ch; opacity: 0.85; }
.cs-mic-chip { justify-self: center; padding: 3px 12px; border-radius: 999px; background: #e8f6ef; color: #146c44; font-size: 0.8rem; font-weight: 600; }
.cs-mic-chip[hidden] { display: none; }
.cs-editor { max-width: 900px; margin: 0 auto; padding: 20px; border-radius: 20px; background: #fff; }
.cs-editor input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.cs-edit-row { display: grid; grid-template-columns: 44px 1fr 90px 120px 36px; gap: 6px; align-items: center; margin: 6px 0; }
.cs-edit-row input { padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; }
.cs-edit-row button { border: 0; background: none; font-size: 1.1rem; cursor: pointer; }

/* Lesson */
.cs-search { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-search input { flex: 1 1 280px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; }
.cs-search select { min-height: 44px; padding: 0 42px 0 18px; border-radius: 999px; background-position: right 18px center; }
.cs-lesson-note { margin: 8px 0 16px; }
.cs-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.cs-result { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; cursor: pointer; }
.cs-result:hover { border-color: var(--p-400, #a78bfa); box-shadow: 0 4px 14px rgba(76, 29, 149, 0.12); }
.cs-result img { width: 100%; aspect-ratio: 108 / 140; object-fit: contain; background: var(--p-50); border-radius: 8px; }
.cs-result strong { font-size: 0.9rem; line-height: 1.3; }
.cs-result span { font-size: 0.78rem; color: var(--muted); }
.cs-show { display: flex; flex-direction: column; height: 100%; min-height: 420px; border-radius: 18px; background: #fff; overflow: hidden; }
.cs-show-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.cs-show-bar strong { flex: 1; }
.cs-show-actions { display: flex; gap: 6px; }
.cs-frame { flex: 1; width: 100%; border: 0; background: #e9e7f0; }

/* Dialogs */
.cs-dialog { width: min(560px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 20px 60px rgba(15, 10, 46, 0.4); }
.cs-dialog::backdrop { background: rgba(15, 10, 46, 0.55); }
.cs-dialog-body { display: grid; gap: 10px; padding: 22px; }
.cs-dialog h2 { margin: 0; }
.cs-dialog p { margin: 0; }
.cs-dialog textarea, .cs-dialog input[type="text"] { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.cs-dialog-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.cs-file { font-size: 0.9rem; font-weight: 600; }
.cs-bgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cs-bgs button { display: grid; gap: 4px; padding: 0 0 6px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-size: 0.8rem; font-weight: 600; cursor: pointer; overflow: hidden; }
.cs-bgs button[aria-pressed="true"] { border-color: var(--p-600); }
.cs-bgs .cs[data-bg] { min-height: 56px; }
.cs-providers { display: grid; gap: 8px; }
.cs-saved-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cs-saved-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.cs-upsell { padding: 10px 12px; border-radius: 12px; background: var(--s-100); }

.cs-toast { position: fixed; left: 50%; bottom: 96px; z-index: 30; padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; transform: translateX(-50%); }
/* The floating timer (floatTimer): a running timer over the Routines and Lesson tabs, in the corner the teacher drags
   it to. The top corners start under the top bar (--ft-top); the bottom corners end above the dock (--dock-space). */
.cs-ft { position: fixed; z-index: 25; display: flex; flex-direction: column; gap: 8px; width: 216px; padding: 8px 12px 12px; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 16px 40px -12px rgba(10, 6, 30, 0.6); touch-action: none; }
.cs-ft[data-corner="tl"] { top: var(--ft-top, 72px); left: 16px; }
.cs-ft[data-corner="tr"] { top: var(--ft-top, 72px); right: 16px; }
.cs-ft[data-corner="bl"] { bottom: var(--dock-space, 96px); left: 16px; }
.cs-ft[data-corner="br"] { bottom: var(--dock-space, 96px); right: 16px; }
.cs-ft-moving { box-shadow: 0 24px 50px -12px rgba(10, 6, 30, 0.7); opacity: 0.92; }
.cs-ft-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px -4px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 700; cursor: grab; user-select: none; }
.cs-ft-moving .cs-ft-head { cursor: grabbing; }
.cs-ft-x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.cs-ft-x:hover { background: var(--p-50); color: var(--ink); }
.cs-ft-digits { font-size: 3rem; font-weight: 700; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.cs-ft-digits.done { color: var(--stop); animation: cs-pulse 1s infinite; }
.cs-ft .cs-bar { height: 8px; }
.cs-ft-row { display: flex; gap: 6px; justify-content: center; }
.cs-noscript { margin: 40px; padding: 16px; border-radius: 12px; background: #fff; }

/* Full screen and small windows */
@media (max-width: 920px) { .cs-widget[data-size="l"] { grid-column: span 2; } }
@media (max-width: 720px) {
  .cs-actions { margin-left: 0; width: 100%; }
  .cs-divider { margin-left: auto; }
  .cs-widget[data-size] { grid-column: span 1; grid-row: span 1; }
  .cs-grid { grid-template-columns: 1fr; }
  .cs-edit-row { grid-template-columns: 44px 1fr 70px; }
  .cs-run-stage { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cs-run-words { justify-items: center; }
  .cs-dock { bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .cs-dock-tool { min-width: 60px; }
}
@media (prefers-reduced-motion: reduce) { .cs-wtools, .cs-exit, .cs-dock .cs-dock-icon, .cs-poll-bar { transition: none; } }

/* The tools of 2026-11-22: stopwatch, dice, work symbols, QR code, picture, video, web page, camera */
.cs-dice { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; }
.cs-die { font-size: clamp(5rem, 24cqi, 16rem); line-height: 1; color: var(--p-700); }
.cs-symbol { font-size: clamp(4.5rem, 24cqi, 16rem); line-height: 1.1; }
.cs-symbol img { display: block; width: clamp(88px, 34cqi, 280px); height: auto; }
.cs-chip-pic { display: inline-flex; align-items: center; gap: 6px; }
.cs-chip-pic img { flex: none; }
.cs-qr { width: min(80cqi, 60vh); height: auto; border-radius: 8px; }
.cs-address { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; width: 100%; max-width: 460px; }
.cs-address input, .cs-wbody > input[type="text"] { flex: 1 1 160px; min-width: 0; min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.cs-wbody > input[type="text"] { flex: none; width: 100%; max-width: 460px; }
.cs-address-shown { max-width: 100%; overflow-wrap: anywhere; }
.cs-media-body { justify-content: flex-start; padding: 10px; }
.cs-media { flex: 1; min-height: 0; max-width: 100%; max-height: 60vh; border-radius: 10px; object-fit: contain; }
.cs-embed { flex: 1; width: 100%; min-height: 220px; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.cs-link-open { max-width: 100%; overflow-wrap: anywhere; font-size: 1.05rem; text-decoration: none; }
.cs-class-saved { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cs-class-saved label { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.cs-class-saved input { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* Draw on the screen: the pen layer over the board */
.cs-draw { position: fixed; inset: 0; z-index: 40; }
.cs-draw canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.cs-draw-bar { position: absolute; top: calc(68px + env(safe-area-inset-top, 0px)); left: 50%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.97); box-shadow: 0 10px 30px rgba(15, 10, 46, 0.3); transform: translateX(-50%); }
.cs-pen { width: 34px; height: 34px; padding: 0; border: 2px solid var(--line); border-radius: 50%; background: var(--pen); cursor: pointer; }
.cs-pen[aria-pressed="true"], .cs-draw-bar .cs-btn[aria-pressed="true"] { outline: 3px solid var(--s-500); outline-offset: 2px; }

@media print { .cs-top, .cs-dock, .cs-draw, .cs-pages, .cs-wtools { display: none; } }
