:root {
  color-scheme: light;
  --bg: #eef7f4;
  --ink: #173c34;
  --muted: #62736d;
  --line: rgba(23, 60, 52, 0.14);
  --panel: rgba(255, 255, 255, 0.86);
  --gold: #d99a16;
  --green: #126c5b;
  --red: #d85b4a;
  --blue: #2563eb;
  --shadow: 0 18px 48px rgba(24, 48, 40, 0.16);
}

html {
  min-height: 100%;
  background: #08252b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(5, 30, 34, 0.82), rgba(13, 73, 78, 0.42)),
    url("/assets/school-future-bg-20260824.webp"),
    #08252b;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 420px);
  align-items: center;
  gap: 36px;
}

.brand-block {
  padding: 32px 0;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.28);
}

.eyebrow {
  margin: 0 0 14px;
  color: #bdf8ee;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 5vw, 4.5rem);
  line-height: 1.02;
  font-weight: 900;
}

.lead {
  max-width: 640px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.18rem;
  line-height: 1.75;
  font-weight: 500;
}

.login-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 16px;
  backdrop-filter: blur(18px);
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(18, 108, 91, 0.08);
}

.login-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.login-tab.active {
  background: var(--green);
  color: #fff;
}

.login-fields {
  display: grid;
  gap: 16px;
}

.coin-preview {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7df;
  color: #8a5300;
  font-weight: 900;
}

.teacher-preview {
  background: #e9fbf6;
  color: var(--green);
}

.coin-preview img,
.coin-pill img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

select,
input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 13px;
  outline: none;
}

select:focus,
input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 108, 91, 0.15);
}

.primary-btn,
.site-btn,
.mode-btn,
.logout-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.primary-btn {
  min-height: 52px;
  background: var(--green);
  color: #fff;
}

.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: #b42318;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(8, 36, 42, 0.14);
}

.topbar h1 {
  font-size: 1.55rem;
  line-height: 1.25;
}

.topbar .eyebrow {
  color: var(--green);
  text-shadow: none;
}

.student-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff7df;
  color: #7c4a00;
  border: 1px solid rgba(217, 154, 22, 0.28);
  font-weight: 900;
}

.logout-btn {
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 8px 0 22px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-btn {
  min-height: 46px;
  color: var(--muted);
  background: transparent;
}

.mode-btn.active {
  color: #fff;
  background: var(--green);
}

.category-stack {
  display: grid;
  gap: 24px;
}

.subject-home {
  display: grid;
  gap: 18px;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.subject-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(74px, auto);
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(8, 36, 42, 0.13);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.subject-card::after {
  content: none;
}

.subject-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(8, 36, 42, 0.18);
}

.subject-card:hover .subject-image {
  transform: scale(1.018);
}

.subject-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent), white 34%);
  outline-offset: 3px;
}

.subject-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 152px;
  background-position: center;
  background-size: cover;
  transition: transform 180ms ease;
}

.subject-info {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 76px;
  padding: 13px 15px 14px;
  border-top: 5px solid var(--accent);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(23, 60, 52, 0.08);
}

.subject-title {
  min-width: 0;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
}

.subject-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), white 89%);
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.back-btn {
  min-height: 42px;
  margin-bottom: 16px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.category-section {
  padding-top: 4px;
}

.category-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.category-head h2 {
  margin: 0;
  color: #fff;
  font-size: 1.35rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.26);
}

.category-count {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.site-card {
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(28, 49, 44, 0.10);
  display: grid;
  min-height: 100%;
}

.site-card-locked {
  filter: saturate(0.8);
}

.site-visual {
  position: relative;
  min-height: 160px;
  background-size: cover;
  background-position: center;
}

.site-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(8, 32, 29, 0.03), rgba(8, 32, 29, 0.38));
}

.site-school-crest {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 58px;
  height: 58px;
  object-fit: contain;
  padding: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(8, 32, 29, 0.22);
}

.site-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.site-kicker {
  color: var(--accent, var(--green));
  font-size: 0.88rem;
  font-weight: 900;
}

.site-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.32;
  font-weight: 900;
}

.site-subtitle {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.site-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.site-grade-note {
  min-height: 24px;
  color: var(--accent, var(--green));
  font-size: 0.88rem;
  font-weight: 900;
}

.mini-coin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #8a5300;
}

.mini-coin img {
  width: 18px;
  height: 18px;
}

.site-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 14px;
  color: #fff;
  background: var(--accent, var(--green));
  text-decoration: none;
}

.site-btn:disabled {
  cursor: not-allowed;
  color: rgba(23, 60, 52, 0.58);
  background: rgba(23, 60, 52, 0.12);
}

.grade-section {
  display: grid;
  gap: 14px;
}

.grade-subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 800;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grade-card {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background-color: #ffffff;
  background-position: center;
  background-size: cover;
  box-shadow: 0 14px 30px rgba(8, 36, 42, 0.13);
  cursor: pointer;
  text-align: left;
}

.grade-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 29, 36, 0.54), rgba(4, 29, 36, 0.05) 52%);
}

.grade-card:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.grade-card[aria-busy="true"] {
  cursor: wait;
  filter: saturate(0.9);
}

.grade-card-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 6px;
  width: min(42%, 260px);
  min-height: 100%;
  padding: 24px;
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.32);
}

.locked-state {
  display: grid;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.11);
}

.locked-state strong {
  color: var(--ink);
  font-size: 1.04rem;
}

.locked-state span {
  color: var(--muted);
  font-weight: 800;
}

.grade-label {
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 900;
}

.grade-title {
  font-size: 1.16rem;
  font-weight: 900;
}

.teacher-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.teacher-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.strategy-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  display: grid;
  gap: 6px;
  min-height: 110px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.11);
}

.summary-card span {
  color: var(--muted);
  font-weight: 800;
}

.summary-card strong {
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.strategy-dashboard article {
  display: grid;
  gap: 6px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid rgba(190, 18, 60, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.94));
  box-shadow: 0 12px 28px rgba(113, 63, 18, 0.09);
}

.strategy-dashboard span,
.strategy-dashboard small {
  color: var(--muted);
  font-weight: 800;
}

.strategy-dashboard strong {
  color: #9f1239;
  font-size: 1.45rem;
  line-height: 1.12;
}

.teacher-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0 0 18px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.64);
}

.personal-teacher-v2-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.teacher-view-picker {
  display: none;
}

.teacher-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.teacher-tab.active {
  background: var(--green);
  color: #fff;
}

.teacher-preview-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(236, 253, 245, 0.98));
  box-shadow: 0 16px 36px rgba(15, 62, 70, 0.1);
}

.teacher-preview-intro h2,
.teacher-preview-card h3 {
  margin: 4px 0 8px;
}

.teacher-preview-intro p,
.teacher-preview-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.teacher-preview-shield {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  background: #0f766e;
  color: white;
  font-size: 0.84rem;
  font-weight: 900;
}

.teacher-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.teacher-preview-grid.portal-grid-single {
  width: min(100%, 760px);
  margin-inline: auto;
  grid-template-columns: minmax(0, 1fr);
}

.portal-grid-single .primary-btn {
  width: 100%;
  margin-top: 14px;
}

.teacher-preview-card {
  display: grid;
  grid-template-columns: minmax(150px, 38%) 1fr;
  gap: 18px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 24px;
  background: white;
  box-shadow: 0 14px 34px rgba(15, 62, 70, 0.1);
}

.teacher-preview-card > img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  border-radius: 16px;
  object-fit: cover;
}

.teacher-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.teacher-preview-launch {
  width: auto;
  min-width: 132px;
}

.teacher-sites-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.teacher-site-form,
.teacher-guide {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.11);
}

.teacher-sync-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.11);
}

.teacher-sync-panel h2 {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.teacher-sync-panel p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.sync-btn {
  min-width: 180px;
  padding: 0 18px;
}

.teacher-site-form h2,
.teacher-guide h2 {
  margin: 0;
  font-size: 1.08rem;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.teacher-guide {
  max-width: 860px;
}

.teacher-guide ol {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.8;
}

.teacher-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.teacher-guide pre {
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #0f2f2b;
  color: #e5fff8;
  font-size: 0.88rem;
  line-height: 1.6;
}

.teacher-table-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.11);
}

.teacher-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.teacher-table th,
.teacher-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.teacher-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f4;
  color: var(--green);
  font-weight: 900;
}

.teacher-site-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.teacher-site-thumb {
  flex: 0 0 auto;
  width: 54px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-position: center;
  background-size: cover;
}

.teacher-report-intro {
  border-color: rgba(15, 118, 110, 0.22);
}

.teacher-report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(8, 36, 42, 0.08);
}

.teacher-report-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-weight: 900;
}

.teacher-report-filters select,
.teacher-report-filters input {
  width: 100%;
  min-width: 0;
}

.teacher-report-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 10px;
}

.teacher-report-actions .primary-btn,
.teacher-report-actions .logout-btn {
  width: auto;
  min-width: 170px;
}

.teacher-data-note {
  margin: 8px 0 16px;
  padding: 10px 14px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #204f4a;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.55;
}

.teacher-report-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.teacher-report-summary .summary-card {
  min-height: 96px;
  padding: 14px;
}

.teacher-report-summary .summary-card strong {
  font-size: 1.55rem;
}

.teacher-report-table-wrap {
  max-height: 68vh;
}

.teacher-report-table {
  min-width: 1500px;
  font-size: 0.88rem;
}

.teacher-report-table th,
.teacher-report-table td {
  vertical-align: top;
}

.teacher-report-table td:nth-child(3),
.teacher-report-table td:nth-child(8),
.teacher-report-table td:nth-child(9) {
  min-width: 190px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.teacher-report-table details summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 900;
}

.teacher-report-unfinished {
  margin-top: 6px;
  color: #7c2d12;
}

.teacher-report-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.teacher-report-badge.tracking-full,
.teacher-report-badge.status-completed {
  background: #dcfce7;
  color: #166534;
}

.teacher-report-badge.tracking-basic,
.teacher-report-badge.status-recorded,
.teacher-report-badge.status-in_progress {
  background: #fef3c7;
  color: #92400e;
}

.teacher-report-badge.tracking-pending,
.teacher-report-badge.status-tracking_pending {
  background: #fee2e2;
  color: #991b1b;
}

.teacher-report-badge.status-not_started {
  background: #e0f2fe;
  color: #075985;
}

.teacher-report-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 16px 0 6px;
  color: var(--muted);
  font-weight: 900;
}

.personal-teacher-v2-filters {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.personal-teacher-v2-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.65rem;
  min-height: 46px;
}

.personal-teacher-v2-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
}

.personal-teacher-v2-table td:nth-child(6),
.personal-teacher-v2-table td:nth-child(7) {
  min-width: 220px;
  white-space: normal;
}

.personal-teacher-v2-task-list {
  margin: 0.55rem 0 0;
  padding-left: 1.15rem;
}

.personal-teacher-v2-task-list li + li {
  margin-top: 0.45rem;
}

.personal-teacher-v2-task-list small {
  overflow-wrap: anywhere;
}

.empty-state {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 900px) {
  body {
    background-attachment: scroll;
  }

  .login-view {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 36px 0;
  }

  .subject-grid,
  .teacher-summary,
  .teacher-insight-grid,
  .strategy-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-sites-layout {
    grid-template-columns: 1fr;
  }

  .teacher-report-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-report-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grade-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .teacher-preview-intro {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .teacher-preview-card {
    grid-template-columns: 1fr;
  }

  .teacher-preview-card > img {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .teacher-preview-launch {
    width: 100%;
  }
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 12px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: space-between;
  }

  .site-grid {
    grid-template-columns: 1fr;
  }

  .subject-grid,
  .teacher-summary,
  .teacher-insight-grid,
  .strategy-dashboard {
    grid-template-columns: 1fr;
  }

  .subject-card {
    grid-template-columns: minmax(132px, 42%) minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-height: 132px;
  }

  .subject-image {
    height: 100%;
    min-height: 132px;
    aspect-ratio: auto;
  }

  .subject-info {
    align-self: stretch;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-height: 0;
    padding: 14px;
    border-top: 0;
    border-left: 5px solid var(--accent);
  }

  .subject-count {
    flex: 0 1 auto;
  }

  .teacher-tabs {
    display: none;
  }

  .teacher-tabs.personal-teacher-v2-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teacher-view-picker {
    display: grid;
    gap: 7px;
    width: 100%;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.64);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--muted);
    font-weight: 900;
  }

  .teacher-view-picker select {
    width: 100%;
  }

  .teacher-sync-panel {
    grid-template-columns: 1fr;
  }

  .teacher-report-filters,
  .teacher-report-summary {
    grid-template-columns: 1fr;
  }

  .teacher-report-actions,
  .teacher-report-actions .primary-btn,
  .teacher-report-actions .logout-btn {
    width: 100%;
  }

  .teacher-report-pagination {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
  }

  .teacher-report-table-wrap {
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .teacher-report-table,
  .teacher-report-table tbody,
  .teacher-report-table tr {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .teacher-report-table thead {
    display: none;
  }

  .teacher-report-table tr {
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 22px rgba(8, 36, 42, 0.08);
  }

  .teacher-report-table td,
  .teacher-report-table td:nth-child(3),
  .teacher-report-table td:nth-child(8),
  .teacher-report-table td:nth-child(9) {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    max-width: none;
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid rgba(15, 118, 110, 0.1);
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .teacher-report-table td:last-child {
    border-bottom: 0;
  }

  .teacher-report-table td::before {
    content: attr(data-label);
    color: #315f5a;
    font-weight: 900;
  }

  .category-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .grade-card {
    min-height: 180px;
  }

  .grade-card-copy {
    width: 48%;
    padding: 18px;
  }

  .grade-label {
    font-size: 2.25rem;
  }
}

/* Scoped to the new history evidence screen; other teacher views retain their layout. */
.topbar.history-header { position: static; }
.teacher-tabs.history-tabs { display: flex; flex-wrap: wrap; width: 100%; gap: 6px; }
.history-tabs .teacher-tab { flex: 0 1 auto; min-height: 40px; padding: 8px 12px; font-size: .9rem; }
.history-dashboard { margin-top: 20px; padding: 20px; background: #f8fcfa; border: 1px solid #d7e9e3; border-radius: 14px; color: #143d39; }
.history-dashboard h2 { margin-top: 0; }
.history-dashboard > p { line-height: 1.7; }
.history-dashboard .teacher-table td:nth-child(10),
.history-dashboard .teacher-table td:nth-child(11) { white-space: normal; min-width: 260px; max-width: 360px; line-height: 1.6; }
@media (max-width: 1024px) {
  .history-dashboard .teacher-table-wrap { max-height: none; overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .history-dashboard .teacher-table, .history-dashboard tbody, .history-dashboard tr { display: block; width: 100%; }
  .history-dashboard thead { display: none; }
  .history-dashboard tr { margin-top: 14px; padding: 10px; background: #fff; border: 1px solid #d7e9e3; border-radius: 10px; }
  .history-dashboard .teacher-table td { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: 8px; padding: 7px 0; border: 0; white-space: normal; min-width: 0 !important; max-width: none !important; overflow-wrap: anywhere; }
  .history-dashboard td::before { content: attr(data-label); font-weight: 700; color: #38605b; }
}
@media (max-width: 520px) {
  .history-dashboard { padding: 14px; }
  .history-tabs .teacher-tab { flex: 1 1 30%; font-size: .82rem; padding: 8px 6px; }
  .teacher-tabs.history-tabs { display: none; }
}
