/* Teacher page (teachers/index.html, built by scripts/build-worksheets.mjs) */
:root {
  --t-bg: #f4f2ec;
  --t-card: #fff;
  --t-ink: #1b1d24;
  --t-muted: #5d6270;
  --t-line: #e2ded4;
  --t-accent: #2a51c0;
  --t-accent-soft: #e6ecfb;
  --t-on-accent: #fff;
  --t-gap: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --t-bg: #14161c;
    --t-card: #1d2029;
    --t-ink: #eceef3;
    --t-muted: #a3a8b6;
    --t-line: #2e3240;
    --t-accent: #7b9cff;
    --t-accent-soft: #252f4d;
    --t-on-accent: #0d1222;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--t-bg) !important; color: var(--t-ink) !important; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--t-accent); }

.t-top { max-width: 920px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: var(--t-gap); }
.t-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--t-ink); text-decoration: none; }
.t-logo span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--t-accent); color: var(--t-on-accent); }
.t-wrap { max-width: 920px; margin: 0 auto; padding: 0 16px 48px; display: flex; flex-direction: column; gap: 28px; }

/* Buttons: three sizes, like the app */
.t-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--t-accent); background: var(--t-accent); color: var(--t-on-accent); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.t-btn.light { background: var(--t-card); color: var(--t-accent); }
.t-btn.small { min-height: 40px; padding: 0 14px; font-size: .92rem; }
.t-btn:focus-visible, .t-chip:focus-visible, .t-search input:focus-visible { outline: 3px solid var(--t-accent); outline-offset: 2px; }
.t-link { background: none; border: 0; padding: 0; color: var(--t-accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }

.t-hero { padding-top: 12px; }
.t-kicker { margin: 0; color: var(--t-accent); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.t-hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.15; margin: 6px 0 12px; max-width: 18em; }
.t-lead { font-size: 1.1rem; color: var(--t-muted); margin: 0; max-width: 40em; }
.t-steps { list-style: none; counter-reset: step; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--t-gap); }
.t-steps li { counter-increment: step; background: var(--t-card); border: 1px solid var(--t-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.t-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--t-accent-soft); color: var(--t-accent); font-weight: 800; margin-bottom: 6px; }
.t-steps span { color: var(--t-muted); font-size: .95rem; }

.t-finder { display: flex; flex-direction: column; gap: 12px; }
.t-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.t-search input { width: 100%; min-height: 56px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--t-line); background: var(--t-card); color: var(--t-ink); font: inherit; font-size: 1.05rem; }
.t-subjects { display: flex; flex-wrap: wrap; gap: 8px; }
.t-chip { min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--t-line); background: var(--t-card); color: var(--t-ink); font: inherit; font-weight: 600; cursor: pointer; }
.t-chip[aria-pressed="true"] { border-color: var(--t-accent); background: var(--t-accent-soft); color: var(--t-accent); }
.t-count { margin: 0; color: var(--t-muted); font-size: .95rem; min-height: 1.5em; }
.t-results { display: flex; flex-direction: column; gap: var(--t-gap); }
.t-empty { text-align: center; color: var(--t-muted); padding: 24px 0; }
.t-more { align-self: center; }

.t-unit { background: var(--t-card); border: 1px solid var(--t-line); border-radius: 16px; padding: 16px; }
.t-unit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.t-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--t-accent-soft); font-size: 1.5rem; }
.t-unit h3 { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.t-meta { margin: 0; color: var(--t-muted); font-size: .85rem; }
.t-lessons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.t-lessons li { display: flex; align-items: center; justify-content: space-between; gap: var(--t-gap); padding: 10px 0; border-top: 1px solid var(--t-line); }
.t-lesson-text { display: flex; flex-direction: column; min-width: 0; }
.t-lesson-text span { color: var(--t-muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.t-actions { display: flex; gap: 8px; flex: none; }

.t-own { background: var(--t-card); border: 1px solid var(--t-line); border-radius: 16px; padding: 18px; }
.t-own h2 { margin: 0 0 6px; font-size: 1.2rem; }
.t-own p { margin: 0; color: var(--t-muted); }
.t-foot { color: var(--t-muted); font-size: .9rem; text-align: center; }

/* QR dialog: a small poster to show on the board or print */
.t-dialog { border: 0; border-radius: 20px; padding: 20px; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--t-card); color: var(--t-ink); }
.t-dialog::backdrop { background: rgb(10 12 20 / .6); }
.t-poster { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.t-poster p, .t-poster h2 { margin: 0; }
.t-poster-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.t-poster-brand span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--t-accent); color: var(--t-on-accent); font-size: .9rem; }
.t-poster-meta { color: var(--t-muted); font-size: .9rem; }
.t-poster h2 { font-size: 1.4rem; line-height: 1.25; }
.t-poster-qr { width: 100%; max-width: 300px; margin: 10px 0 6px; background: #fff; border-radius: 12px; line-height: 0; }
.t-poster-qr svg { width: 100%; height: auto; }
.t-poster-hint { font-weight: 600; }
.t-poster-url { color: var(--t-muted); font-size: .85rem; word-break: break-all; }
.t-dialog-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.t-dialog.big { width: calc(100vw - 32px); height: calc(100vh - 32px); max-width: none; }
.t-dialog.big .t-poster h2 { font-size: clamp(1.6rem, 4vw, 3rem); }
.t-dialog.big .t-poster-qr { max-width: min(70vh, 90vw); }

@media (max-width: 700px) {
  .t-steps { grid-template-columns: 1fr; }
  .t-lessons li { flex-direction: column; align-items: stretch; }
  .t-actions > * { flex: 1 1 0; padding: 0 8px; }
}

@media print {
  body { background: #fff !important; color: #000 !important; }
  .t-top, .t-foot, .t-own, .t-finder .t-search, .t-subjects, .t-more, .t-actions { display: none !important; }
  body.print-qr > *:not(dialog) { display: none !important; }
  body.print-qr .t-dialog { position: static; display: block; width: 100%; max-width: none; height: auto; max-height: none; border: 0; padding: 0; background: #fff; color: #000; }
  body.print-qr .t-dialog-actions { display: none; }
  body.print-qr .t-poster h2 { font-size: 30pt; }
  body.print-qr .t-poster-qr { max-width: 130mm; margin: 10mm 0 6mm; }
  body.print-qr .t-poster-hint { font-size: 16pt; }
}
@media (max-width: 700px) {
  .t-steps li { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: center; padding: 12px 14px; }
  .t-steps li::before { margin: 0; grid-row: span 2; }
  .t-top .t-btn { min-height: 40px; padding: 0 14px; font-size: .92rem; }
}
.t-chip small { color: var(--t-muted); font-weight: 500; }
