/* Create activity, rebuilt (§293): the chooser, the maker, the editor, the screen tools, the wheel's modes and the
   timer. Colours are the app's tokens only, so both themes follow. Heights that come from the window are divided by
   --a11y-zoom, as everywhere in the app. */

/* ───────── the chooser ───────── */
.cs-root { display: grid; gap: 14px; min-width: 0; }
.cs-loading { color: var(--muted); }
.cs-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 18px; }
.cs-context { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; flex: 1 1 420px; min-width: 0; }
.cs-context .ia-field { margin: 0; }
.cs-field select { min-width: 160px; }
.cs-unit { flex: 1 1 260px; min-width: 0; }
.cs-unit select, .cs-unit input { width: 100%; }
.cs-search { flex: 0 1 300px; min-width: 200px; }
.cs-lang { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 10px 14px; border-left: 4px solid var(--peach); border-radius: 0 10px 10px 0; background: var(--peach-soft); font-size: 13.5px; color: var(--ink); }
.cs-lang-k { font-weight: 700; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--peach); }
.cs-nocur, .cs-muted { color: var(--muted); }
.cs-nocur { margin: 0; font-size: 13.5px; }
.cs-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.cs-tab { flex: 0 0 auto; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cs-tab.is-on { background: var(--navy); border-color: var(--navy); color: var(--on-accent); }
.cs-tab:focus-visible, .cs-card:focus-visible, .cs-way:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.cs-cards { display: grid; gap: 22px; }
.cs-group { min-width: 0; }
.cs-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 10px; font-size: 1.05rem; color: var(--ink); }
.cs-h small { font-size: 13px; font-weight: 400; color: var(--muted); }
.cs-fits { padding: 14px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--canvas); }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.cs-card { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon name" "line line" "meta meta"; align-items: center; gap: 6px 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.cs-icon { grid-area: icon; font-size: 24px; line-height: 1; }
.cs-name { grid-area: name; font-weight: 700; font-size: 15px; }
.cs-line { grid-area: line; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
.cs-meta { grid-area: meta; font-size: 12px; color: var(--muted); }
.cs-meta b { font-weight: 700; color: var(--brand-blue); }
@media (hover: hover) {
  .cs-card:hover { border-color: var(--navy); box-shadow: var(--shadow-sm); }
  .cs-tab:not(.is-on):hover, .cs-way:hover { border-color: var(--navy); }
}

/* ───────── the maker ───────── */
.ask-card.cs-maker { width: min(600px, 100%); max-height: calc(94dvh / var(--a11y-zoom, 1)); overflow: auto; }
.cs-maker .ask-title { display: flex; align-items: center; gap: 8px; }
.cs-maker-line { margin: 2px 0 8px; font-size: 14px; color: var(--ink-soft); }
.cs-maker-for { margin: 0 0 10px; font-size: 14px; }
.cs-maker .ia-field { margin-bottom: 12px; }
.cs-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 4px 0 12px; }
.cs-way { display: grid; gap: 4px; align-content: start; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cs-way-i { font-size: 22px; line-height: 1; }
.cs-way b { font-size: 14px; }
.cs-way small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.cs-more { margin: 0 0 10px; }
.cs-more > summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.cs-more[open] > summary { margin-bottom: 8px; }
.cs-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.cs-check input { margin-top: 3px; }
.cs-prompt { width: 100%; resize: vertical; font-size: 14px; line-height: 1.5; }

/* ───────── the editor ───────── */
.cs-editor { display: grid; gap: 12px; min-width: 0; }
.cs-ed-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; background: var(--canvas); border-bottom: 1px solid var(--line-soft); }
.cs-ed-kind { font-weight: 700; font-size: 15px; }
.cs-ed-state { font-size: 13px; color: var(--muted); flex: 1 1 auto; }
.cs-ed-state.is-warn { color: var(--peach); font-weight: 600; }
.cs-ed-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-more-btn { min-width: 44px; }
.cs-note { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--green-soft); font-size: 13.5px; }
.cs-ed-body { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.cs-form { display: grid; gap: 12px; min-width: 0; max-height: calc(100dvh / var(--a11y-zoom, 1) - 150px); overflow: auto; padding: 2px 6px 24px 2px; }
.cs-form .ia-field { margin: 0; }
.cs-f textarea { resize: vertical; }
.cs-lab { display: block; }
.cs-opt { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.cs-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); font-weight: 400; }
.cs-num input { max-width: 140px; }
.cs-list { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; min-width: 0; }
.cs-list > legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.cs-count { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cs-item { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--paper); min-width: 0; }
.cs-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.cs-item-tools { display: inline-flex; gap: 2px; }
.cs-item-tools .text-button { min-width: 30px; padding: 2px 6px; }
.cs-list.is-lines .cs-item { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 6px 8px; }
.cs-list.is-lines .cs-item-head { display: contents; }
.cs-list.is-lines .cs-item-head > b { grid-column: 1; grid-row: 1; min-width: 22px; color: var(--muted); }
.cs-list.is-lines .cs-item-tools { grid-column: 1 / -1; justify-self: end; }
.cs-list.is-lines .cs-item > .ia-field { grid-column: 2; grid-row: 1; }
.cs-list.is-lines .cs-item > .ia-field { font-size: 0; }
.cs-list.is-lines .cs-item > .ia-field input { font-size: 14px; }
.cs-add { justify-self: start; }
.cs-preview { position: sticky; top: 64px; display: grid; gap: 8px; min-width: 0; }
.cs-problems { padding: 8px 12px; border-radius: 10px; background: var(--peach-soft); color: var(--ink); font-size: 13px; }
.cs-problems:empty { display: none; }
.cs-stage { border: 1px solid var(--line); border-radius: var(--radius); background: var(--line-soft); overflow: hidden; min-width: 0; }
.cs-frame { display: block; width: 100%; height: calc(100dvh / var(--a11y-zoom, 1) - 175px); min-height: 460px; border: 0; background: var(--line-soft); }
.cs-screen { padding: 14px; background: var(--canvas); max-height: calc(100dvh / var(--a11y-zoom, 1) - 175px); min-height: 460px; overflow: auto; }
.cs-screen .wh-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cs-screen .wh-holder { max-width: 340px; }
.cs-screen .wh-title { font-size: 1.3rem; }
@media (max-width: 980px) {
  .cs-ed-body { grid-template-columns: minmax(0, 1fr); }
  .cs-form { max-height: none; overflow: visible; }
  .cs-preview { position: static; }
  .cs-frame { height: calc(78dvh / var(--a11y-zoom, 1)); min-height: 380px; }
  .cs-screen { max-height: none; min-height: 0; }
}
@media (max-width: 620px) {
  .cs-ways { grid-template-columns: minmax(0, 1fr); }
  .cs-search { flex: 1 1 100%; }
  .cs-ed-actions { width: 100%; }
}

/* the classic form (Listening, an organization's own types): only the chosen type shows */
.cs-classic .type-option:not(.selected) { display: none; }
.cs-classic-back { display: inline-block; margin: 0 0 12px; }

/* the library's cover for an activity of the new kinds: its first page */
.lib-cover.is-kind iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; background: var(--paper); border-radius: 4px 4px 0 0; box-shadow: 0 2px 8px rgba(10, 49, 83, .15); }

/* ───────── the screen tools ───────── */
.cs-present { position: fixed; inset: 0; z-index: 100000; overflow: auto; background: var(--canvas); padding: 18px clamp(14px, 3vw, 40px) 40px; display: flex; flex-direction: column; gap: 18px; }
.cs-present-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.cs-present-head h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.1rem); color: var(--ink); }
.cs-present-tools { display: flex; gap: 8px; }
.cs-present-body { flex: 1 1 auto; display: grid; align-content: center; justify-items: center; }
.cs-tool { width: 100%; display: grid; gap: 16px; justify-items: center; font-family: var(--font-ui); color: var(--ink); }
.cs-tool-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.button.cs-big { font-size: 1.05rem; padding: 12px 26px; }
.cs-tool.is-present .button.cs-big { font-size: 1.3rem; padding: 14px 34px; }

/* dice */
.cs-dice { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; }
.cs-die { position: relative; width: 190px; aspect-ratio: 1; display: grid; place-items: center; padding: 16px; border: 3px solid var(--ink); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow-sm); text-align: center; }
.cs-die.is-two { border-color: var(--peach); }
.cs-die b { font-size: 1.25rem; line-height: 1.25; overflow-wrap: anywhere; }
.cs-pips { position: absolute; top: 10px; left: 10px; width: 34px; height: 34px; }
.cs-pips svg { display: block; width: 100%; height: 100%; fill: var(--ink); }
.cs-die.is-two .cs-pips svg { fill: var(--peach); }
.cs-tool.is-present .cs-die { width: min(300px, 38vw); }
.cs-tool.is-present .cs-die b { font-size: clamp(1.4rem, 2.6vw, 2.2rem); }
.cs-die.is-rolling { animation: cs-shake .14s linear infinite; }
@keyframes cs-shake { 0% { transform: rotate(-7deg) translateY(-3px); } 50% { transform: rotate(7deg) translateY(2px); } 100% { transform: rotate(-7deg) translateY(-3px); } }
.cs-dice-say { margin: 0; max-width: 46ch; text-align: center; font-size: 1.2rem; line-height: 1.45; font-weight: 500; color: var(--ink); }
.cs-dice-say b { color: var(--brand-blue); }
.cs-tool.is-present .cs-dice-say { font-size: clamp(1.4rem, 2.8vw, 2.3rem); }

/* a deck of cards */
.cs-deck { display: grid; gap: 14px; justify-items: center; width: 100%; }
.cs-deck-card { position: relative; width: min(620px, 100%); aspect-ratio: 3 / 2; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, .8, .3, 1); cursor: pointer; }
.cs-deck-card.is-turned { transform: rotateY(180deg); }
.cs-deck-face { color: var(--ink); font-weight: 600; position: absolute; inset: 0; display: grid; place-items: center; padding: 26px 32px; border: 2px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow-sm); backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; font-size: clamp(1.15rem, 2.2vw, 1.6rem); line-height: 1.4; overflow: auto; }
.cs-deck-face b { color: var(--brand-blue); }
.cs-back { transform: rotateY(180deg); background: var(--green-soft); }
.cs-deck-card:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 4px; }
.cs-deck-count { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.cs-tool.is-present .cs-deck-card { width: min(980px, 92vw); }
.cs-tool.is-present .cs-deck-face { font-size: clamp(1.5rem, 3.2vw, 2.6rem); }

/* a quiz board */
.cs-board { position: relative; width: 100%; max-width: 1180px; display: grid; gap: 14px; }
.cs-board-grid { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 8px; }
.cs-board-cat { display: grid; place-items: center; padding: 10px 8px; border-radius: 10px; background: var(--navy); color: var(--on-accent); font-weight: 800; font-size: .95rem; text-align: center; overflow-wrap: anywhere; }
.cs-board-cell { height: 64px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--peach); font: inherit; font-weight: 800; font-size: 1.4rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.cs-board-cell.is-used { opacity: .22; cursor: default; }
.cs-board-cell.is-empty { border: 0; background: transparent; }
.cs-tool.is-present .cs-board-cat { font-size: clamp(1rem, 1.6vw, 1.35rem); padding: 14px 10px; }
.cs-tool.is-present .cs-board-cell { height: clamp(70px, 11vh, 110px); font-size: clamp(1.6rem, 3vw, 2.4rem); }
.cs-board-teams { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cs-team { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 12px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); }
.cs-team.is-ahead { border-color: var(--peach); }
.cs-team-score { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.cs-team-adj { grid-column: 1 / -1; display: flex; justify-content: center; gap: 6px; }
.cs-board-q { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 10px; border-radius: 14px; background: color-mix(in srgb, var(--canvas) 94%, transparent); }
.cs-board-q[hidden] { display: none; }
.cs-board-card { width: min(780px, 100%); display: grid; gap: 14px; justify-items: center; padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-lg); text-align: center; }
.cs-board-k { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cs-board-question { margin: 0; font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.35; font-weight: 600; color: var(--ink); }
.cs-board-answer { margin: 0; padding: 10px 16px; border-radius: 12px; background: var(--green-soft); color: var(--brand-blue); font-weight: 800; font-size: clamp(1.2rem, 2.3vw, 1.8rem); }
.cs-board-answer[hidden], .cs-tool-row[hidden] { display: none; }
.cs-tool.is-present .cs-board-question { font-size: clamp(1.6rem, 3.4vw, 2.8rem); }

/* ───────── the wheel's modes ───────── */
.wh-name { margin: 6px 0 0; font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 800; line-height: 1.1; color: var(--brand-blue); text-align: center; overflow-wrap: anywhere; }
.wh-card p.wh-k { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.wh-card-label.is-target { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--brand-blue); margin-top: 8px; }
.wh-reveal { margin-top: 12px; display: grid; gap: 10px; justify-items: start; }
.wh-answer { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--green-soft); color: var(--brand-blue); font-weight: 700; font-size: 1.2rem; }
.wh-answer[hidden], .wh-reveal .button[hidden] { display: none; }
.wh-more { min-width: 44px; }

/* the speaking timer (the wheel's minute, the dice, the cards) */
.class-timer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; margin: 8px 0 14px; }
.class-time { min-width: 4ch; font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); text-align: center; }
.class-timer.is-low .class-time { color: var(--peach); }
.class-timer.is-up .class-time { color: var(--danger); animation: class-pulse .5s ease-in-out 3; }
@keyframes class-pulse { 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) {
  .cs-die.is-rolling, .class-timer.is-up .class-time { animation: none; }
  .cs-deck-card { transition: none; }
}

/* ───────── the curriculum (§294): the console's tab and the Create screen ───────── */
.cs-top-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 0 1 auto; }
.cs-cur-btn { white-space: nowrap; }
.cs-copy-note { padding: 9px 14px; border-radius: 10px; background: var(--green-soft); font-size: 13.5px; }
.cs-copy-note:empty, #cs-copies:empty { display: none; }
.cur { display: grid; gap: 14px; min-width: 0; }
.cur-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; }
.cur-title { margin: 0; font-size: 1.35rem; color: var(--ink); }
.cur-sub { margin: 4px 0 0; max-width: 70ch; font-size: 13.5px; color: var(--muted); }
.cur-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cur-search { width: min(320px, 100%); }
.cur-more { min-width: 44px; }
.cur-copy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 0 12px 12px 0; background: var(--green-soft); font-size: 14px; }
.cur-copy-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cur-program { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--canvas); min-width: 0; }
.cur-program-head { display: flex; gap: 8px; align-items: center; }
.cur-program-head h3 { margin: 0; font-size: 1.05rem; }
.cur-program-name { flex: 1 1 auto; font-weight: 700; }
.cur-level { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); min-width: 0; }
.cur-level > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.cur-level > summary::-webkit-details-marker, .cur-unit > summary::-webkit-details-marker { display: none; }
.cur-level > summary::before, .cur-unit > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.cur-level[open] > summary::before, .cur-unit[open] > summary::before { transform: rotate(90deg); }
.cur-level-name { font-weight: 700; }
.cur-chip { padding: 1px 8px; border-radius: 999px; background: var(--line-soft); font-size: 12px; font-weight: 700; color: var(--ink); }
.cur-level-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.cur-level-body { display: grid; gap: 8px; padding: 4px 14px 14px; }
.cur-level-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.cur-level-fields .ia-field { margin: 0; }
.cur-grow { flex: 1 1 240px; min-width: 0; }
.cur-unit { border: 1px solid var(--line-soft); border-radius: 10px; min-width: 0; }
.cur-unit > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; cursor: pointer; list-style: none; font-size: 14px; }
.cur-unit-grammar { flex: 1 1 200px; min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur-dots { display: inline-flex; gap: 3px; margin-left: auto; }
.cur-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.cur-dots i.is-on { background: var(--navy); }
.cur-unit-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 4px 12px 12px; }
.cur-unit-body .ia-field { margin: 0; }
.cur-unit-body .cur-wide { grid-column: 1 / -1; }
.cur-unit-body textarea { resize: vertical; }
.cur-unit-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.cur-add { justify-self: start; }
.cs-cur { min-width: 0; }
@media (max-width: 620px) {
  .cur-unit-body { grid-template-columns: minmax(0, 1fr); }
  .cur-level-count { margin-left: 0; width: 100%; }
}
