/* [ui2] The redesigned Tutor page (preview at /?ui=2). Loaded after static/style.css, which keeps drawing the board's
   insides (figures, notes, quiz cards, pop-ups); every rule here starts with #u2 (the preview's <body>) so it wins over
   today's layout rules and never touches `/`.
   One visual system: 2 radii (12 / 18), type 12 / 14 / 16 / 20 / 28 / 40, primary / secondary / ghost buttons,
   Lucide line icons (ISC, static/ui2/icons.svg), a light header, one focus ring, 44 px tap targets. */
#u2 {
  --ink: #1f2937; --ink2: #374151; --muted: #4b5563; --muted2: #6b7280; --line: #e5e7eb; --line2: #d1d5db;
  --bg: #f5f6f8; --surface: #fff; --brand: #2563eb; --brand-ink: #1d4ed8; --brand-soft: #eff4ff; --ok: #15803d; --warn: #b45309;
  --r1: 12px; --r2: 18px; --shadow: 0 10px 30px rgba(17, 24, 39, .08); --shadow2: 0 18px 48px rgba(17, 24, 39, .18);
  --t12: 12px; --t14: 14px; --t16: 16px; --t20: 20px; --t28: 28px; --t40: 40px;
  --headh: 60px;
  background: var(--bg); color: var(--ink); font: 400 var(--t16)/1.45 var(--ui);
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
}
#u2 [hidden] { display: none !important; }
#u2 .u-legacy-ctl { display: none !important; }
#u2 .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#u2 .ic.sm { width: 16px; height: 16px; }
#u2 .u-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#u2 .u-skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: var(--r1); font-weight: 600; color: var(--brand-ink); }
#u2 .u-skip:focus { top: 8px; }
#u2 :focus { outline: none; }
#u2 :focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
#u2 input:focus-visible { outline-offset: 0; }

/* ---------------------------------------------------------------- buttons */
#u2 .u-btn, #u2 .u-chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 14px;
  font: 600 var(--t14)/1 var(--ui); color: var(--ink); background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r1);
  cursor: pointer; text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
#u2 .u-btn:hover, #u2 .u-chip:hover { border-color: #9ca3af; }
#u2 .u-btn:disabled, #u2 .u-chip:disabled { opacity: .5; cursor: default; }
#u2 .u-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
#u2 .u-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
#u2 .u-secondary { background: var(--surface); border-color: var(--line2); }
#u2 .u-ghost { background: transparent; border-color: transparent; }
#u2 .u-ghost:hover { background: #eef0f3; border-color: transparent; }
#u2 .u-ico { padding: 0; width: 44px; }
#u2 .u-link { background: none; border: 0; padding: 0 4px; min-height: 44px; font: 600 var(--t14) var(--ui); color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------------------------------------------------------------- header */
#u2 .u-head {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 6px; min-height: var(--headh);
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line);
}
#u2 .u-brand { display: flex; align-items: center; gap: 8px; margin-right: 10px; min-height: 44px; font: 700 var(--t16)/1 var(--ui); color: var(--ink); text-decoration: none; white-space: nowrap; }
#u2 .u-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: #10b981; flex: none; }
#u2 .u-nav { display: flex; gap: 2px; }
#u2 .u-nav a, #u2 .u-nav button { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--r1); background: none; font: 600 var(--t14) var(--ui); color: var(--muted); text-decoration: none; cursor: pointer; }
#u2 .u-nav a:hover, #u2 .u-nav button:hover { color: var(--ink); background: #f1f3f5; }
#u2 .u-nav a.on { color: var(--ink); background: #f1f3f5; }
#u2 .u-sp { flex: 1; }
#u2 .u-lessonname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--t14) var(--ui); color: var(--muted); }
#u2 .u-pop { position: relative; }
#u2 .u-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 70; min-width: 260px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); box-shadow: var(--shadow2); }
#u2 .u-menu-r { left: auto; right: 0; }
#u2 .u-menu a, #u2 .u-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; text-align: left; font: 500 var(--t14) var(--ui); color: var(--ink); text-decoration: none; cursor: pointer; }
#u2 .u-menu a:hover, #u2 .u-menu button:hover { background: #f3f4f6; }
#u2 .u-menu a b { display: block; font-weight: 600; }
#u2 .u-menu a small { display: block; color: var(--muted); font-size: var(--t12); margin-top: 2px; }
#u2 .u-make .u-menu a { display: block; }
#u2 .u-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
#u2 .u-only-phone { display: none !important; }
#u2 .u-narrow { display: none; }

/* views: the home (composer) or the lesson */
#u2 .u-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#u2.u-v-home #uLesson { display: none; }
#u2.u-v-lesson #uHome { display: none; }
#u2.u-v-home #uNewTopic, #u2.u-v-home .u-lessonname { display: none; }
#u2.u-v-lesson .u-nav, #u2.u-v-lesson .u-make { display: none; }

/* ---------------------------------------------------------------- home */
#u2 .u-home { display: flex; flex-direction: column; align-items: center; padding: 48px 20px 40px; }
#u2 .u-back { align-self: flex-start; margin: -28px 0 8px; color: var(--brand-ink); }
#u2 .u-home h1 { margin: 0 0 6px; font: 700 var(--t40)/1.1 var(--hand); text-align: center; color: #111827; }
#u2 .u-sub { margin: 0 0 22px; color: var(--muted); text-align: center; font-size: var(--t16); }
#u2 #ask.u-composer {
  display: block; flex: none; width: min(760px, 100%); min-width: 0; padding: 10px; background: var(--surface);
  border: 1px solid var(--line2); border-radius: var(--r2); box-shadow: var(--shadow);
}
#u2 #ask.u-composer:focus-within { border-color: #93b4f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15), var(--shadow); }
#u2 .u-row1 { display: flex; gap: 8px; align-items: center; }
#u2 #ask #topic {
  flex: 1; min-width: 0; height: 52px; padding: 0 8px; border: 0; background: transparent; color: var(--ink);
  font: 500 var(--t20) var(--ui); border-radius: var(--r1); outline: none;
}
#u2 #ask #topic::placeholder { color: var(--muted2); }
#u2 #ask #go { height: 48px; padding: 0 18px; font: 600 var(--t16) var(--ui); border-radius: var(--r1); background: var(--brand); color: #fff; border: 1px solid var(--brand); }
#u2 #ask #go:hover { background: var(--brand-ink); }
#u2 #ask #go:disabled { opacity: 1; cursor: pointer; }  /* today's page disables it mid-lesson; here a new topic always works */
#u2 .u-row2 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
#u2 #ask .u-chip, #u2 #ask .photobtn { font: 600 var(--t14) var(--ui); background: var(--surface); color: var(--ink2); border: 1px solid var(--line); border-radius: var(--r1); padding: 0 12px; height: 44px; }
#u2 #ask .u-chip:hover, #u2 #ask .photobtn:hover { border-color: #9ca3af; }
#u2 #ask .u-icochip { width: 44px; padding: 0; }
#u2 .u-chip.on { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
#u2 .u-wall { width: min(760px, 100%); margin-top: 12px; padding: 14px 16px; background: #fffbeb; border: 1px solid #fcd34d; border-radius: var(--r1); color: #78350f; font-size: var(--t14); }
#u2 .u-wall p { margin: 0 0 10px; }
#u2 .u-wall .u-btns { display: flex; flex-wrap: wrap; gap: 8px; }
#u2 .u-visitor { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin: 12px 0 0; color: var(--muted); font-size: var(--t14); }
#u2 .u-visitor .ic { width: 16px; height: 16px; color: var(--ok); }
#u2 .u-examples { width: min(760px, 100%); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
#u2 .u-examples button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); color: var(--ink2); font: 500 var(--t14) var(--ui); cursor: pointer; }
#u2 .u-examples button:hover { border-color: var(--brand); color: var(--brand-ink); }
#u2 .u-examples button small { color: var(--muted2); font-size: var(--t12); font-weight: 500; }
#u2 .u-shelf { width: min(1080px, 100%); margin-top: 40px; }
#u2 .u-shelfh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
#u2 .u-shelfh h2 { margin: 0; font: 700 var(--t16) var(--ui); }
#u2 .u-shelfh a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font: 600 var(--t14) var(--ui); color: var(--brand-ink); text-decoration: none; }
#u2 .u-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
#u2 .u-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); cursor: pointer; font: inherit; color: inherit; }
#u2 .u-card:hover { border-color: #9ca3af; box-shadow: var(--shadow); }
#u2 .u-card .u-pic { position: relative; aspect-ratio: 16 / 9; background: #f1f2ee; overflow: hidden; }
#u2 .u-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
#u2 .u-card .u-pic .ic { position: absolute; left: 10px; bottom: 10px; width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: rgba(17, 24, 39, .72); color: #fff; fill: #fff; stroke: none; }
#u2 .u-card .u-ct { padding: 10px 12px 12px; }
#u2 .u-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font: 600 var(--t14)/1.35 var(--ui); }
#u2 .u-card small { display: block; margin-top: 2px; color: var(--muted); font: 500 var(--t12) var(--ui); }
#u2 .u-makevid { margin: 28px 0 0; color: var(--muted); font-size: var(--t14); text-align: center; }
#u2 .u-makevid a { display: inline-block; padding: 12px 2px; color: var(--ink2); font-weight: 600; }
#u2 .u-preview { margin: 8px 0 0; color: var(--muted); font-size: var(--t14); text-align: center; }
#u2 .u-preview a { display: inline-block; padding: 12px 2px; color: var(--brand-ink); font-weight: 600; }

/* ---------------------------------------------------------------- lesson */
#u2 .u-lesson { display: flex; flex-direction: column; gap: 10px; padding: 12px 20px; height: calc(100dvh - var(--headh)); min-height: 520px; }
#u2 .u-stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
#u2 #board {
  flex: 1 1 auto; margin: 0; min-height: 0; border-radius: var(--r2); box-shadow: none; border: 1px solid #e2e0d6;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: 14px 20px 16px;
}
#u2 #boardTitle { font-size: var(--t40); min-height: 46px; }
#u2 #fig { min-height: 0; }
#u2 #notes { min-height: 0; max-height: none; }
#u2 #board:has(#notes .quiz) { grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
#u2 #board:has(#notes .quiz) #notes { max-height: none; }
#u2 #board:has(#notes .quiz) #fig { min-height: 0; }
#u2 .quiz button { min-height: 44px; }
#u2.u-v-home { height: auto; min-height: 100vh; min-height: 100dvh; }  /* today's phone rule fixes the height during a lesson */
#u2 #empty .big { font: 700 var(--t28) var(--hand); color: var(--ink2); }
#u2 #empty .small { font-size: var(--t14); color: var(--muted); }
#u2 #empty .startsaved { pointer-events: auto; margin-top: 10px; min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--r1); background: var(--brand); color: #fff; font: 600 var(--t16) var(--ui); cursor: pointer; }
#u2 #tpEnd { display: none !important; }  /* Practice: the end card has the button */

/* caption directly under the board, then the slim player bar (one card) */
#u2 .u-dock { flex: none; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); }
#u2 .u-cap { padding: 10px 16px 0; }
#u2 #caption { min-height: 28px; font: 500 var(--t20)/1.4 var(--ui); color: var(--muted2); }  /* unread words #6b7280: 4.8:1 */
#u2 #caption .w.on { color: var(--ink); }
#u2 #caption .w.now { color: var(--brand-ink); }
#u2 #caption .error { color: #b91c1c !important; }
#u2 .u-player { display: flex; align-items: center; gap: 10px; padding: 2px 8px 6px 8px; flex-wrap: wrap; }
#u2 .u-playbtn { border-radius: var(--r1); }
#u2 .u-playbtn .ic { fill: currentColor; }
#u2 .u-playbtn.is-replay .ic { fill: none; }
#u2 .u-playbtn.is-play { background: var(--brand); border-color: var(--brand); color: #fff; }
#u2 .u-prog { flex: 1 1 160px; min-width: 120px; display: flex; align-items: center; height: 44px; cursor: default; }
#u2 .u-segs { display: flex; gap: 3px; width: 100%; height: 6px; }
#u2 .u-segs i { flex: 1; height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; position: relative; }
#u2 .u-segs i.done { background: #93c5fd; }
#u2 .u-segs i.now { background: #bfdbfe; }
#u2 .u-segs i.now b { position: absolute; inset: 0; background: var(--brand); transform-origin: left; transform: scaleX(0); }
#u2 .u-segs.cont i { border-radius: 0; }
#u2 .u-segs.cont { border-radius: 3px; overflow: hidden; gap: 0; }
#u2 .u-step { font: 600 var(--t14) var(--ui); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
#u2 .u-rate { min-width: 52px; font-variant-numeric: tabular-nums; }
#u2 .u-status { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; order: 9; padding: 0 6px 2px; font: 500 var(--t14) var(--ui); color: var(--muted); }
#u2 .u-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #bfdbfe; border-top-color: var(--brand); animation: u2spin .8s linear infinite; flex: none; }
@keyframes u2spin { to { transform: rotate(360deg); } }
#u2.tp-ctl .u-prog, #u2.tp-ctl .u-step, #u2.tp-ctl .u-rate { display: none; }  /* More controls on: its bar replaces the progress */
#u2 .u-player #tpBar { flex: 1 1 300px; min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
#u2 .u-player #tpBar > button { width: 44px; height: 44px; }
#u2 .u-player #tpBar #tpPlay { display: none; }  /* ⏯ is the player bar's first button */
#u2 .u-player #tpTicks { height: 44px; align-items: center; }
#u2 .u-player #tpTicks .tp-tick { height: 44px; background-clip: content-box; padding: 16px 0; border-radius: 0; }
#u2 .u-player #tpTicks .tp-tick i { top: 16px; bottom: 16px; }
#u2 .u-player #tpChap { font-size: var(--t12); color: var(--muted); margin-top: -12px; }

/* ask about this lesson */
#u2 #qa.u-ask { flex: none; display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 4px 4px 14px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r2); }
#u2 #qa.u-ask:focus-within { border-color: #93b4f5; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
#u2 #qa #question { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; font: 500 var(--t16) var(--ui); color: var(--ink); outline: none; border-radius: 0; }
#u2 #qa #question::placeholder { color: var(--muted2); }
#u2 #qa button { font: 600 var(--t14) var(--ui); }
#u2 #qa #askBtn { padding: 0 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line2); }
#u2 #qa #mic { width: 44px; padding: 0; background: transparent; border: 0; font-size: inherit; color: var(--ink2); }
#u2 #qa #mic.on { background: #fee2e2; color: #b91c1c; }
#u2 #qa #tpTapBtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface); color: var(--ink2); font: 600 var(--t14) var(--ui); }
#u2 #qa #tpTapBtn[aria-pressed="true"] { background: var(--brand-soft); border-color: #93b4f5; color: var(--brand-ink); }
#u2 #qa #tpTapBtn .lbl { display: inline; }
#u2 #qa #tpTapBtn .ic { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- end card (on the board) */
#u2 .u-end {
  position: absolute; left: 16px; bottom: 16px; z-index: 6; width: min(760px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow2);
}
#u2 .u-end h2 { display: flex; align-items: flex-start; gap: 8px; margin: 0 40px 4px 0; font: 700 var(--t20)/1.3 var(--ui); }
#u2 .u-end h2 .ic { color: var(--ok); width: 24px; height: 24px; margin-top: 1px; }
#u2 .u-end .u-score { color: var(--muted); font-weight: 600; }
#u2 .u-end ul { margin: 6px 0 14px; padding-left: 22px; color: var(--ink2); font-size: var(--t16); }
#u2 .u-end li { margin: 3px 0; }
#u2 .u-end .u-x { position: absolute; top: 8px; right: 8px; }
#u2 .u-endrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#u2 .u-endrow .u-sep { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }
#u2 .u-endmsg { margin: 10px 0 0; font-size: var(--t14); color: var(--muted); }
#u2 .u-endmsg:empty { display: none; }
#u2 .u-endpill { position: absolute; left: 16px; bottom: 16px; z-index: 6; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r1); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font: 600 var(--t14) var(--ui); color: var(--ink); cursor: pointer; }
#u2 .u-endpill .ic { color: var(--ok); }

/* ---------------------------------------------------------------- sheet (Options, level, language, Share, code) */
#u2 .u-sheetback { position: fixed; inset: 0; z-index: 85; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17, 24, 39, .45); }
#u2 .u-sheet { width: min(480px, 100%); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; background: var(--surface); border-radius: var(--r2); box-shadow: var(--shadow2); }
#u2 .u-sheethead { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 20px; background: var(--surface); }
#u2 .u-sheethead h2 { flex: 1; margin: 0; font: 700 var(--t20) var(--ui); }
#u2 .u-sheetbody { padding: 0 20px 18px; }
#u2 .u-sheetbody p.u-hint { margin: 0 0 10px; color: var(--muted); font-size: var(--t14); }
#u2 .u-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
#u2 .u-opt:first-child { border-top: 0; }
#u2 .u-opt .t { flex: 1; min-width: 0; }
#u2 .u-opt b { display: block; font: 600 var(--t16) var(--ui); }
#u2 .u-opt small { display: block; color: var(--muted); font-size: var(--t14); line-height: 1.35; margin-top: 2px; }
#u2 .u-opt .ic { color: var(--ink2); }
#u2 .u-opt:disabled { cursor: default; }
#u2 .u-opt:disabled b, #u2 .u-opt:disabled .u-sw { opacity: .5; }
#u2 .u-sw { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #c4c9d1; transition: background .15s; }
#u2 .u-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: left .15s; }
#u2 .u-opt[aria-checked="true"] .u-sw { background: var(--brand); }
#u2 .u-opt[aria-checked="true"] .u-sw::after { left: 21px; }
#u2 .u-opt .u-check { width: 22px; height: 22px; color: var(--brand); visibility: hidden; }
#u2 .u-opt[aria-checked="true"] .u-check { visibility: visible; }
#u2 .u-group { margin: 16px 0 4px; font: 700 var(--t12) var(--ui); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
#u2 .u-seg { display: flex; margin-top: 8px; border: 1px solid var(--line2); border-radius: var(--r1); overflow: hidden; }
#u2 .u-seg button { flex: 1; min-height: 44px; border: 0; border-left: 1px solid var(--line2); background: var(--surface); font: 600 var(--t14) var(--ui); color: var(--muted); cursor: pointer; }
#u2 .u-seg button:first-child { border-left: 0; }
#u2 .u-seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); }
#u2 .u-row { padding: 12px 0; border-top: 1px solid var(--line); }
#u2 .u-row:first-child { border-top: 0; }
#u2 .u-row > b { display: block; font: 600 var(--t16) var(--ui); }
#u2 .u-row > small { display: block; color: var(--muted); font-size: var(--t14); }
#u2 .u-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
#u2 .u-acts .u-note { flex: 1 1 100%; font-size: var(--t14); color: var(--muted); }
#u2 .u-pill { position: relative; overflow: hidden; display: inline-flex; align-items: center; min-height: 44px; min-width: 190px; padding: 0 14px; border: 1px solid #93b4f5; border-radius: var(--r1); background: var(--brand-soft); color: var(--brand-ink); font: 600 var(--t14) var(--ui); cursor: pointer; }
#u2 .u-pill .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #bfdbfe; transition: width 1.2s linear; }
#u2 .u-pill .lbl { position: relative; }
#u2 .u-codeform { display: flex; gap: 8px; margin-top: 6px; }
#u2 .u-codeform input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--line2); border-radius: var(--r1); font: 600 var(--t20) var(--ui); letter-spacing: .12em; color: var(--ink); }
#u2 .u-msg { min-height: 20px; margin: 10px 0 0; font-size: var(--t14); color: var(--muted); }
#u2 .u-msg.bad { color: #b91c1c; }
#u2 .u-msg.good { color: var(--ok); }
/* the language list (today's searchable list, moved into the sheet while it is open) */
#u2 .u-sheet #langPop { position: static; width: auto; padding: 0; border: 0; box-shadow: none; background: none; }
#u2 .u-sheet #langSearch { height: 48px; font-size: var(--t16); border-radius: var(--r1); border-color: var(--line2); background: var(--surface); color: var(--ink); }
#u2 .u-sheet #langList { max-height: 50dvh; }
#u2 .u-sheet #langList .lopt { min-height: 44px; align-items: center; font-size: var(--t16); }
#u2 .u-sheet #langList .lopt span { color: var(--muted); }

/* toast */
#u2 #uToast { position: fixed; left: 50%; bottom: 24px; z-index: 95; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r1); background: #111827; color: #fff; font: 500 var(--t14) var(--ui); box-shadow: var(--shadow2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
#u2 #uToast button { min-height: 36px; padding: 0 10px; border: 1px solid #4b5563; border-radius: 8px; background: transparent; color: #fff; font: 600 var(--t14) var(--ui); cursor: pointer; }

/* today's pop-ups (video, notes, Edit video, Share, Practice): a lighter scrim, the ✕ inside the card */
#u2 .zoom { background: rgba(17, 24, 39, .6); z-index: 88; }
#u2 .zoom .expcard { position: relative; border-radius: var(--r2); padding: 22px 22px 20px; }
#u2 .zoom .expcard > .zx { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: var(--r1); background: #f3f4f6; color: var(--ink); font-size: var(--t16); }
#u2 .zoom .expcard .exph { padding-right: 44px; }
#u2 .zoom > .zx { width: 44px; height: 44px; }
#u2 .zoom .vidact { border-radius: var(--r1); min-height: 44px; display: inline-flex; align-items: center; }
/* Edit video, trimmed to what teachers need: Brand, Captions, Scenes, Voice; no Lab badges */
#u2 #vidEditBox .edbadge, #u2 #vidEditBox .edchips, #u2 #vidEditBox > .expcard > .edlbl { display: none !important; }
#u2 #vidEditBox .edsec.u-hide { display: none !important; }
#u2 #styleBox .edbadge, #u2 #styleBox .sketchlink { display: none !important; }
#u2 .tp-back, #u2 #tpMenu { z-index: 89; }
/* today's notice (a refused question, a microphone error...) and access card (I have a code), in this page's look */
#u2 #notice { bottom: max(24px, env(safe-area-inset-bottom)); border-radius: var(--r1); font: 500 var(--t14)/1.45 var(--ui); padding: 8px 8px 8px 16px; }
#u2 #notice button { min-height: 44px; padding: 0 14px; border-radius: var(--r1); font: 600 var(--t14) var(--ui); }
#u2 #notice button.nx { min-width: 44px; padding: 0; color: #e5e7eb; }
#u2 .acccard { border-radius: var(--r2); }
#u2 .acccard .accbtn { border-radius: var(--r1); min-height: 44px; }  /* [noaccess] no code form */
#u2 .acccard .acch { font-size: var(--t20); padding-right: 40px; }
#u2 .zoom .acccard > .zx { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: var(--r1); background: #f3f4f6; color: var(--ink); }
#u2 .zoom .acccard { position: relative; }
#u2 .accwrap .acccard { box-shadow: var(--shadow2); }
#u2 #caption .capbtn { min-height: 44px; padding: 0 14px; border-radius: var(--r1); font: 600 var(--t14) var(--ui); }
#u2 #shortsFeed { z-index: 80; }

/* ---------------------------------------------------------------- tablets / small laptops */
@media (max-width: 1100px) {
  #u2 .u-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #u2 .u-cards .u-card:nth-child(n+7) { display: none; }
}
@media (max-width: 900px) {
  #u2 .u-wide { display: none; }
  #u2 .u-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #u2 .u-cards .u-card:nth-child(n+5) { display: none; }
}
@media (min-width: 720px) and (max-height: 800px) {
  #u2 .u-lesson { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  #u2 #boardTitle { font-size: 34px; min-height: 38px; }
}

/* ---------------------------------------------------------------- phones (< 720 px) */
@media (max-width: 719px) {
  #u2 { --headh: 56px; }
  #u2 .u-head { padding: 6px 8px 6px 16px; gap: 4px; }
  #u2 .u-nav, #u2 .u-make { display: none; }
  #u2 .u-only-phone { display: flex !important; }
  #u2 .u-menu hr.u-only-phone { display: block !important; }
  #u2 .u-brand { margin-right: 4px; font-size: var(--t16); min-width: 0; overflow: hidden; }
  #u2 .u-brand-name { overflow: hidden; text-overflow: ellipsis; }
  #u2 .u-lessonname { display: none; }
  #u2 #uMenuBtn { width: 44px; padding: 0; }
  #u2 .u-narrow { display: inline; }
  #u2 #uNewTopic { padding: 0 12px; }
  #u2 .u-menu { position: fixed; top: auto; left: 8px; right: 8px; bottom: 8px; min-width: 0; max-height: 80dvh; overflow: auto; padding-bottom: max(6px, env(safe-area-inset-bottom)); }

  /* home: the composer is docked at the bottom (thumb reach); examples swipe; library cards 2 x 2 */
  #u2 .u-home { align-items: stretch; padding: 22px 16px 190px; }
  #u2 .u-back { margin: -12px 0 6px; }
  #u2 .u-home h1 { font-size: 34px; text-align: left; }
  #u2 .u-sub { text-align: left; margin-bottom: 4px; font-size: var(--t14); }
  #u2 #ask.u-composer { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 30; width: auto; padding: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 30px rgba(17, 24, 39, .14); }
  #u2 #ask #topic { height: 48px; font-size: 17px; padding: 0 6px; }
  #u2 #ask #go { width: 48px; padding: 0; }
  #u2 #ask #go .u-golbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #u2 .u-row2 { flex-wrap: nowrap; gap: 4px; margin-top: 4px; }
  #u2 #ask .u-chip, #u2 #ask .photobtn { padding: 0 10px; min-width: 44px; }
  #u2 #ask .u-lbl { display: none; }
  #u2 #uLangBtn, #u2 #uLevelBtn { min-width: 0; flex: 0 1 auto; overflow: hidden; gap: 6px; }
  #u2 #uLangBtn .ic.sm, #u2 #uLevelBtn .ic.sm { display: none; }
  #u2 #uLangBtn span, #u2 #uLevelBtn span { overflow: hidden; text-overflow: ellipsis; }
  #u2 .u-wall { width: auto; }
  #u2 .u-visitor { justify-content: flex-start; margin-top: 10px; }
  #u2 .u-examples { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; width: auto; margin: 14px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  #u2 .u-examples::-webkit-scrollbar { display: none; }
  #u2 .u-examples button { flex: none; }
  #u2 .u-shelf { margin-top: 22px; }
  #u2 .u-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #u2 .u-cards .u-card:nth-child(n+5) { display: none; }
  #u2 .u-makevid, #u2 .u-preview { text-align: left; }
  #u2 .u-makevid a, #u2 .u-preview a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; }
  #u2 .u-preview a { display: flex; }

  /* lesson: one screen, no page scroll: board, caption + player bar (⏯ first), ask box */
  #u2.u-v-lesson { height: 100dvh; min-height: 0; overflow: hidden; }
  #u2 .u-lesson { height: auto; flex: 1 1 auto; min-height: 0; padding: 8px; gap: 8px; }
  #u2 #board { padding: 10px 12px; border-radius: 14px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  #u2 #boardTitle { font-size: var(--t28); min-height: 34px; }
  #u2 #notes { max-height: 22dvh; gap: 4px; }
  #u2 #board:has(#notes .quiz) { grid-template-rows: auto minmax(70px, 1fr) auto; min-height: 0; }
  #u2 #board:has(#notes .quiz) #fig { min-height: 0; }
  #u2 #board:has(#notes .quiz) #notes { max-height: calc(100dvh - 370px); }
  #u2 .note { font-size: 23px; }
  #u2 .u-cap { padding: 8px 12px 0; }
  #u2 #caption { font-size: 17px; line-height: 1.35; min-height: 46px; max-height: 69px; overflow: hidden; scroll-behavior: smooth; }
  #u2 .u-player { gap: 6px; padding: 2px 6px 6px 6px; flex-wrap: nowrap; }
  #u2 .u-prog { min-width: 0; flex: 1 1 auto; }
  #u2 .u-status { position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 6px; padding: 8px 12px; background: var(--surface); border-radius: var(--r1); box-shadow: var(--shadow); flex: none; }
  #u2 #qa.u-ask { padding-left: 12px; margin-bottom: env(safe-area-inset-bottom); }
  #u2 #qa #tpTapBtn .lbl { display: none; }
  #u2 .u-end { inset: 0; left: 0; bottom: 0; width: auto; max-height: none; border-radius: 14px; padding: 16px; box-shadow: none; }
  #u2 .u-end ul { font-size: var(--t14); }
  #u2 .u-endrow .u-sep { display: none; }
  #u2 .u-endrow .u-btn { flex: 1 1 auto; }
  #u2 .u-endpill { left: 8px; bottom: 8px; }

  #u2 .u-sheetback { align-items: flex-end; padding: 0; }
  #u2 .u-sheet { width: 100%; max-height: 88dvh; border-radius: var(--r2) var(--r2) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #u2 .u-sheet #langPop { position: static; left: auto; right: auto; bottom: auto; padding: 0; box-shadow: none; }
  #u2 #uToast, #u2 #notice { bottom: 88px; }
  #u2.u-v-home #notice { bottom: 150px; }
  #u2 .zoom .expcard { width: calc(100vw - 24px); padding: 18px 16px; }
}
@media (max-width: 380px) {
  #u2 .u-brand { font-size: 15px; }
  #u2 .u-brand .dot { display: none; }
  #u2 #uNewTopic { padding: 0 10px; }
  #u2 .u-row2 { gap: 3px; }
  #u2 #ask .u-chip, #u2 #ask .photobtn { padding: 0 8px; }
  #u2 #uLangBtn > .ic:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #u2 .u-spin { animation: none; }
}
