/* Góc thầy cô (tc-), soạn đề (ex-), bài giảng trình chiếu (sl-). Giao diện gọn, chuyên nghiệp, ưu tiên máy tính và iPad. */
body[data-theme="teacher"] { background: #f4f6f9; }
body[data-theme="teacher"] .topbar { background: rgba(244, 246, 249, .92); }
.ok-text { color: var(--good); }

.tc-wrap { max-width: 1040px; margin: 0 auto; }
.tc-card { max-width: 620px; margin: 24px auto; }
.tc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.tc-head h1 { margin: 0; font-size: 26px; }
.tc-nav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 18px; scrollbar-width: none; }
.tc-nav a {
  padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--ink-2); text-decoration: none;
  font-weight: 600; font-size: 16px; white-space: nowrap; min-height: 44px; display: flex; align-items: center;
}
.tc-nav a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-bottom: 16px; }
.tc-tile {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .12s, box-shadow .12s;
}
.tc-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(31, 42, 51, .1); }
.tc-tile b { display: block; font-size: 18px; margin-bottom: 4px; }
.tc-tile .small { display: block; line-height: 1.45; }
.tc-ico { flex: none; width: 46px; height: 46px; }
.tc-ico svg { width: 100%; height: 100%; }
.tc-subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px 16px; margin-top: 6px; }
.tc-grade-name { font-weight: 700; font-size: 14px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.tc-sub { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; font-size: 16px; }
.tc-sub input { width: 20px; height: 20px; accent-color: var(--accent); }
.tc-sub svg { width: 22px; height: 22px; vertical-align: -5px; }
.tc-list { list-style: none; margin: 0; padding: 0; }
.tc-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tc-list li:last-child { border-bottom: 0; }
.badge svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ── Soạn đề ─────────────────────────────────────────────── */
.ex-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 0 20px; }
.ex-headbox { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.ex-headbox summary { font-weight: 700; cursor: pointer; min-height: 32px; }
.ex-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px 14px; margin-top: 10px; }
.ex-bar {
  position: sticky; top: 64px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  background: rgba(244, 246, 249, .96); backdrop-filter: blur(6px); padding: 10px 0; margin-top: 8px;
}
.ex-bar .row-btns { margin: 0; }
.ex-page + .ex-page, .ex-page + .pr-answers { margin-top: 28px; padding-top: 22px; border-top: 2px dashed #ccc; }
.ex-head { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.ex-head td { width: 50%; text-align: center; vertical-align: top; padding: 0 6px; line-height: 1.4; }
.ex-up { text-transform: uppercase; font-weight: 700; }
.ex-runhead { font-style: italic; font-size: 13px; color: #555; text-align: center; margin: 0 0 10px; }
.ex-time { text-align: center; margin: 4px 0 8px; }
.ex-code { font-weight: 700; border: 1px solid #111; padding: 1px 10px; margin-left: auto; }
.ex-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; margin-bottom: 6px; }
.ex-rule { border-top: 1px solid #111; margin: 4px 0 10px; }
.ex-part { font-weight: 700; margin: 16px 0 2px; }
.ex-part span { font-weight: 400; font-style: italic; }
.ex-hint { font-style: italic; margin: 0 0 8px; }
.ex-pts { font-style: italic; }
.ex-stmts { list-style: none; margin: 6px 0 0; padding-left: 1.2em; }
.ex-stmts li { display: flex; align-items: baseline; gap: 8px; margin: 4px 0; line-height: 1.5; }
.ex-sl { flex: none; font-weight: 700; min-width: 1.4em; }
.ex-claim { margin-top: 2px; }
.ex-subpart { font-weight: 700; margin: 14px 0 6px; }
.ex-subpart span { font-weight: 400; font-style: italic; }
.ex-keycode { font-weight: 700; font-size: 17px; margin: 16px 0 4px; }
.ex-note { font-style: italic; font-size: 14px; margin: 4px 0 10px; }
.ex-t2 { margin-top: 0; font-size: 17px; }
.ex-grid.ex-tfgrid td, .ex-grid.ex-tfgrid th { min-width: 3.6em; text-align: center; }
.ex-grid.ex-essaygrid { width: 100%; }
.ex-grid.ex-essaygrid td { text-align: left; vertical-align: top; line-height: 1.5; padding: 6px 10px; }
.ex-grid.ex-essaygrid td.c { text-align: center; vertical-align: middle; width: 4.2em; }
.ex-grid.ex-essaygrid th { text-align: center; }
.ex-blank td { height: 2.2em; }
.ex-lines div { border-bottom: 1px dotted #888; height: 2em; }
.ex-structinfo { margin-top: 8px; overflow-x: auto; }
.ex-structtab td:nth-child(2), .ex-structtab th { text-align: left; }
.ex-warn { background: #fff7e6; border: 1px solid #f3d08a; border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: 15px; }
.ex-end { text-align: center; font-weight: 700; margin: 18px 0 4px; letter-spacing: .1em; }
.ex-foot { text-align: center; font-size: 11px; color: #888; margin-top: 10px; }
.ex-swap {
  margin-left: 6px; font-size: 13px; padding: 2px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--accent-soft);
  color: var(--accent); cursor: pointer; vertical-align: 2px;
}
.ex-key { margin: 10px 0 14px; }
.ex-grid { border-collapse: collapse; margin: 6px 0; font-size: 15px; }
.ex-grid th, .ex-grid td { border: 1px solid #777; padding: 3px 8px; text-align: center; min-width: 2.2em; }
.ex-grid th { background: #f2f2f2; font-weight: 600; text-align: left; }
.ex-short { margin: 6px 0; padding-left: 0; list-style: none; }

/* ── Bài giảng trình chiếu ──────────────────────────────── */
.sl-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 2px 14px; max-height: 360px; overflow: auto; padding-right: 4px; }
.sl-lessons input { accent-color: var(--accent); }
.sl-help { margin-top: 10px; line-height: 1.5; }
.sl-ol { margin: 0; padding-left: 1.4em; line-height: 1.7; }

@media (max-width: 640px) {
  .tc-head h1 { font-size: 22px; }
  .ex-bar { position: static; padding: 4px 0; }
  .ex-bar .row-btns { width: 100%; }
  .ex-bar .row-btns .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
  .ex-sheet { padding: 18px 14px; font-size: 16px; }
  .ex-head td { font-size: 14px; }
  .tc-list li { flex-direction: column; align-items: stretch; }
}

@media print {
  .ex-swap, .ex-bar, .tc-head, .tc-nav { display: none !important; }
  .ex-page { break-after: page; }
  .ex-page + .ex-page, .ex-page + .pr-answers { margin-top: 0; padding-top: 0; border-top: 0; }
  .pr-answers { break-before: page; }
  .ex-foot { position: static; }
}

/* ── Ma trận + bản đặc tả đề ───────────────────────────── */
.mt-page { overflow-x: auto; }
.mt-head { text-align: center; margin-bottom: 8px; line-height: 1.55; }
.mt-t1 { font-weight: 700; font-size: 1.05em; }
.mt-h { font-weight: 700; margin: 12px 0 4px; }
.mt-tab { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.mt-tab th, .mt-tab td { padding: 3px 4px; vertical-align: middle; min-width: 0; }
.mt-tab th { text-align: center; }
.mt-tab td.l { text-align: left; }
.mt-tab td.b { font-weight: 700; background: #f5f5f5; }
.mt-tab td.sm { font-size: 11px; }
.mt-editor { margin: 8px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); }
.mt-editor summary { cursor: pointer; line-height: 1.5; }
.mt-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px 14px; margin: 8px 0; }
.mt-scroll { overflow: auto; max-height: 420px; margin: 6px 0; }
.mt-edit { width: 100%; font-size: 13px; }
.mt-edit td.l { text-align: left; }
.mt-edit td.b { font-weight: 700; white-space: nowrap; }
.mt-edit .mt-grp td { background: #f5f5f5; }
.mt-edit select, .mt-edit input { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; max-width: 100%; }
.mt-edit input { width: 5.5em; }
@page ex-land { size: A4 landscape; margin: 10mm; }
@media print {
  .no-print { display: none !important; }
  .mt-page { page: ex-land; overflow: visible; }
  .mt-tab { font-size: 9.5px; }
}
