/* Site chrome follows MiniCanva. Activity content keeps its semantic colors. */
body.tl-app {
  --bg: #f5f6fa; --card: #fff; --surface: #fff;
  --text: #20243a; --ink: #20243a; --muted: #626980; --line: #dde1ec;
  --primary: #3949c7; --primary-dark: #171c44; --soft: #edf0fb;
  --brand: #3949c7; --brand-deep: #171c44; --brand-soft: #edf0fb;
  --sun: #ffd43b; --earth: #626980; --warm: #171c44;
  --radius: 14px; --shadow: 0 1px 2px rgb(23 28 68 / 4%);
  --shadow-up: 0 6px 20px rgb(23 28 68 / 10%);
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: calc(16px * var(--ts, 1));
  word-break: keep-all; overflow-wrap: anywhere;
}
.tl-app [hidden] { display: none !important; }
.tl-app .tl-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 10px max(20px, calc((100% - 1140px) / 2));
  background: #fff; border-bottom: 1px solid var(--line); font-size: 14px;
}
.tl-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: #171c44; text-decoration: none; white-space: nowrap; }
.tl-brand { flex-shrink:0; }
.tl-brand-logo { display:block; width:222px; height:auto; }
@media(max-width:700px) { .tl-brand-logo { width:180px; } }
.tl-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #171c44; color: #ffd43b; }
.tl-mark svg, .tl-icon svg { width: 22px; height: 22px; display: block; }
.tl-title { display: flex; align-items: center; gap: 10px; }
.tl-title .tl-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; background: #edf0fb; border-radius: 10px; }
.tl-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tl-links a { padding: 8px 12px; border-radius: 8px; color: #626980; text-decoration: none; font-weight: 600; }
.tl-links a:hover, .tl-links a[aria-current] { background: #edf0fb; color: #171c44; }
.tl-links .tl-textbook { padding: 8px 12px; border: 0; border-radius: 8px; background: #fff6d6; color: #6b5410; font: inherit; font-weight: 700; cursor: pointer; }
.tl-links .tl-textbook:hover { background: #ffeaa0; color: #171c44; }
.tl-links .tl-textbook:focus-visible { outline: 3px solid #3949c7; outline-offset: 2px; }
.tl-skip { position: fixed; left: 12px; top: -100px; z-index: 1000; background: #171c44; color: #fff; padding: 12px 20px; border-radius: 10px; }
.tl-skip:focus { top: 12px; }
.tl-app :is(a, button, input, textarea, select, summary):focus-visible { outline: 3px solid #3949c7; outline-offset: 3px; }
.tl-app :is(.green-top, .eco-top, .app-header) { padding: 12px 24px; gap: 12px 20px; border-bottom: 1px solid var(--line); box-shadow: none; }
.tl-app :is(.green-top, .eco-top) h1 { font-size: 1.3rem; color: var(--primary-dark); line-height: 1.3; }
.tl-app :is(.green-top, .eco-top) .home { font-size: .9rem; color: var(--muted); padding: 6px 0; }
.tl-app :is(.green-top, .eco-top) .kicker { color: var(--muted); }
.tl-app .card { border: 1px solid var(--line); border-radius: 14px; box-shadow: none; padding: 22px; }
.tl-app .btn { border-width: 1px; border-radius: 10px; min-height: 44px; }
.tl-app .btn-primary { background: #ffd43b; color: #171c44; border-color: #ffd43b; }
.tl-app .btn-primary:hover:not(:disabled) { background: #ffe066; border-color: #ffe066; }
.tl-app .btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.tl-app .btn.small { min-height: 40px; }
.tl-app :is(.field input, .field textarea, .gate input, .row input) { border-width: 1px; border-radius: 10px; }
.tl-app :is(.tabs, .green-tabs) { gap: 4px; }
.tl-app .tab { border-radius: 10px; font-size: .95rem; }
.tl-app .tab[aria-selected="true"] { background: #171c44; color: #fff; box-shadow: none; }
.tl-app .btn.chip { background: #edf0fb; color: #171c44; }
.tl-app .btn.chip.on { background: #171c44; color: #fff; }
.tl-app .gate { margin-top: 40px; padding: 32px 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.tl-app .gate h1 { font-size: 1.6rem; }
/* Hub and unit cards share a real footer; no overlaid controls. */
.tl-app:has(.hub-main) { padding: 0 0 48px; }
.tl-app .page { max-width: 1140px; padding: 0 24px; }
.tl-app .hub-top { padding: 28px 32px; margin: 24px 0; background: #171c44; border-radius: 18px; color: #fff; }
.tl-app .wordmark { font-size: clamp(1.8rem, 4vw, 2.8rem); margin: 14px 0 12px; }
.tl-app :is(.wm-a, .wm-b) { color: #fff; }
.tl-app .wm-b { color: #ffd43b; }
.tl-app .hub-top .lead { color: #c8cdf1; font-size: 1rem; }
.tl-app .hub-top .kicker { background: rgb(255 255 255 / 9%); color: #e5e8ff; font-size: .8rem; }
.tl-app .hub-art { width: 150px; }
.tl-app .unit-home { color: #c8cdf1; font-size: .85rem; margin-bottom: 12px; }
.tl-app .teacher-hint { font-size: .9rem; margin: 0; padding: 12px 16px; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.tl-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 0; }
.tl-filter { min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 10px; cursor: pointer; font: inherit; font-size: .9rem; font-weight: 700; }
.tl-filter[aria-pressed="true"] { background: #171c44; border-color: #171c44; color: #fff; }
.tl-app .grade { margin-top: 28px; }
.tl-app .grade-title { color: #171c44; font-size: 1.1rem; }
.tl-app .grade-title::after { background: var(--line); height: 1px; }
.tl-app .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.tl-app .lesson { border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.tl-app .lesson::before { content: none; }
.tl-app .lesson:hover { transform: none; border-color: #b6bedb; box-shadow: var(--shadow-up); }
.tl-app .lesson-main, .tl-app .lesson.has-note .lesson-main { min-height: 0; padding: 22px; gap: 10px; border-radius: 14px 14px 0 0; }
.tl-app .emoji { width: 44px; height: 44px; border-radius: 12px; color: #171c44; background: #edf0fb; }
.tl-app .subject { font-size: .8rem; color: var(--muted); }
.tl-app .title { font-size: 1.25rem; margin-top: 4px; }
.tl-app .desc { font-size: .95rem; line-height: 1.65; }
.tl-app .lesson-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 22px; margin-top: auto; border-top: 1px solid var(--line); }
.tl-app .lesson-foot { padding: 0; margin: 0; }
.tl-app .go { width: auto; height: auto; margin: 0; padding: 7px 14px; border-radius: 8px; background: #edf0fb; color: #171c44; font-size: .9rem; }
.tl-app .lesson:hover .go { transform: none; background: #edf0fb; color: #171c44; }
.tl-app .lesson.is-open .go { background: #ffd43b; }
.tl-app .lesson.is-closed .go { color: var(--muted); }
.tl-enter { margin-left: auto; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.tl-app .badge { font-size: .8rem; border: 0; padding: 5px 10px; }
.tl-app .badge-toggle { position: static; margin: 0; height: auto; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #20243a; box-shadow: none; }
.tl-app .badge-toggle:hover:not(:disabled) { transform: none; box-shadow: none; background: #f5f6fa; }
.tl-app .teacher-space { border: 1px solid var(--line); margin-top: 28px; }
.tl-app .teacher-link { border-radius: 8px; padding: 10px 14px; font-size: .85rem; }
.tl-app .unit-next { margin-top: 24px; }
/* TV lobby: admission and participation are visible together. */
.tl-app .race-hostmain.is-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: stretch; max-width: 1140px; }
.tl-app .race-hostmain.is-lobby > .card { margin: 0; min-width: 0; }
.tl-app .race-hostmain.is-lobby > .card:last-child { grid-column: 1 / -1; }
.tl-app .race-door { background: #171c44; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.tl-app .race-door :is(.race-kicker, .race-roomno span, .race-note) { color: #c8cdf1; }
.tl-app .race-roomno b { color: #ffd43b; font-size: clamp(4rem, 8vw, 7rem); }
.tl-app .race-howto { font-size: 1rem; }
.tl-app .race-joinsteps { text-align: left; padding-left: 24px; font-size: .95rem; }
.tl-app .race-joinsteps li { margin: 8px 0; }
.tl-app .race-empty { border: 1px dashed #b6bedb; background: #f5f6fa; padding: 28px 18px; }
.tl-app .race-hostmain.is-lobby .race-actions { margin-top: 24px; }
.tl-app .race-hostmain.is-lobby .race-actions .btn-primary { min-height: 56px; }
.tl-app:has(.top) { padding: 0 20px 48px; }
.tl-app:has(.top) .tl-nav { margin: 0 -20px; }
.tl-app .hero { background: #171c44; box-shadow: none; border-radius: 18px; }
body.tl-app.tv { --bg: #171c44; --text: #f8fafc; --muted: #c8cdf1; background: var(--bg); color: var(--text); font-size: 1.35rem; }
body.tl-app.gb-tv { font-size: 1.25rem; }
.tl-app:is(.tv, .gb-tv, .slides-open) .tl-nav { display: none; }
@media (max-width: 720px) {
  .tl-app .tl-nav { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .tl-links a, .tl-links .tl-textbook { padding: 6px 9px; }
  .tl-app .page { padding: 0 16px; }
  .tl-app .hub-top { padding: 24px; }
  .tl-app .hub-art { display: none; }
  .tl-app .hub-top { grid-template-columns: 1fr; }
  .tl-app .race-hostmain.is-lobby { grid-template-columns: 1fr; }
  .tl-app :is(.green-top, .eco-top, .app-header) { padding: 12px 16px; }
  .tl-app .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .tl-app *, .tl-app *::before, .tl-app *::after { scroll-behavior: auto; } }
@media print { .tl-nav, .tl-skip, .tl-filters { display: none !important; } body.tl-app { background: #fff; padding: 0; } }

/* Closed classroom cards: visible but clearly locked and non-actionable for students. */
.tl-app .lesson.is-closed:not(.has-toggle){background:#f8f9fb;border-color:#e5e8ef}
.tl-app .lesson.is-closed:not(.has-toggle) .lesson-main{opacity:.62;cursor:not-allowed}
.tl-app .lesson.is-closed:not(.has-toggle) .tl-enter{cursor:not-allowed}
.tl-app .lesson.is-closed:not(.has-toggle) .go{background:#eef0f4;color:#81899d}
.tl-app .lesson.is-closed:not(.has-toggle) .emoji{filter:grayscale(.5)}
