/*
  Rostra remodel override: library, class home, report, modals, and display support.
  This file is intentionally CSS-only. app.js owns the child-window student display
  template today; notes near the end mark styles that should move there when the
  parent/child display styling is integrated.
*/

:root {
  --remodel-bg: #08090b;
  --remodel-surface: #111318;
  --remodel-surface-2: #181b22;
  --remodel-surface-3: #222632;
  --remodel-raised: #1c2029;
  --remodel-ink: #f4f7fb;
  --remodel-ink-soft: #c8d0dc;
  --remodel-ink-muted: #8993a3;
  --remodel-line: #2a2f3a;
  --remodel-line-strong: #3a4150;
  --remodel-green: #38d27d;
  --remodel-amber: #ffbf4d;
  --remodel-red: #ff5d5d;
  --remodel-blue: #5aa8ff;
  --remodel-cyan: #35d6ff;
  --remodel-magenta: #d36bff;
  --remodel-panel-shadow: inset 0 1px rgba(255, 255, 255, 0.065), 0 18px 44px rgba(0, 0, 0, 0.28);
  --remodel-control-shadow: inset 0 1px rgba(255, 255, 255, 0.08), inset 0 -1px rgba(0, 0, 0, 0.34), 0 1px 2px rgba(0, 0, 0, 0.32);
}

:root[data-theme="light"] {
  --remodel-bg: #f5f7fa;
  --remodel-surface: #ffffff;
  --remodel-surface-2: #f3f6fa;
  --remodel-surface-3: #e8edf5;
  --remodel-raised: #ffffff;
  --remodel-ink: #16202b;
  --remodel-ink-soft: #465466;
  --remodel-ink-muted: #69778a;
  --remodel-line: #d6dee8;
  --remodel-line-strong: #bcc8d6;
  --remodel-green: #117b47;
  --remodel-amber: #98630f;
  --remodel-red: #c43d3d;
  --remodel-blue: #275fb8;
  --remodel-cyan: #087a95;
  --remodel-magenta: #8a42c7;
  --remodel-panel-shadow: 0 12px 32px rgba(22, 32, 43, 0.08), inset 0 1px rgba(255, 255, 255, 0.82);
  --remodel-control-shadow: inset 0 1px rgba(255, 255, 255, 0.86), inset 0 -1px rgba(22, 32, 43, 0.12), 0 1px 2px rgba(22, 32, 43, 0.1);
}

.screen-launcher .workspace,
.screen-class-home .workspace {
  background: transparent;
}

.screen-launcher .main-panel,
.screen-class-home .main-panel {
  border-color: color-mix(in srgb, var(--remodel-line) 76%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--remodel-surface-2) 92%, transparent), color-mix(in srgb, var(--remodel-surface) 98%, transparent)),
    var(--remodel-surface);
  box-shadow: var(--remodel-panel-shadow);
}

.screen-class-home .main-panel {
  padding: clamp(20px, 2vw, 34px);
}

.launcher.library-manager,
.class-home.class-setup-console,
.class-home.class-dashboard,
.session-report {
  gap: clamp(20px, 2vw, 30px);
}

.library-toolbar,
.roster-import-panel,
.new-session-card,
.report-panel,
.app-modal {
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 58%),
    var(--remodel-surface);
  box-shadow: var(--remodel-panel-shadow);
}

.library-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 22px;
}

.library-title-block h1,
.class-home .activity-title h1 {
  color: var(--remodel-ink);
  font-size: clamp(2.2rem, 4.8vw, 4.4rem);
  line-height: 1;
}

.library-title-block .muted,
.class-home .activity-title .muted,
.roster-import-copy .muted,
.new-session-card .muted {
  color: var(--remodel-ink-muted);
  line-height: 1.55;
}

.activity-kicker,
.setup-option-label,
.session-list-title,
.class-stat-card span,
.report-activity-card span,
.report-activity-card small,
.report-export-grid legend {
  color: var(--remodel-ink-muted);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.command-cluster {
  border-color: color-mix(in srgb, var(--remodel-blue) 24%, var(--remodel-line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--remodel-surface-2) 82%, transparent);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}

.class-file-row,
.session-file-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--remodel-cyan) 7%, transparent), transparent 42%),
    var(--remodel-surface-2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.class-file-row:hover,
.session-file-row:hover {
  border-color: var(--remodel-line-strong);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--remodel-blue) 10%, transparent), transparent 48%),
    var(--remodel-surface-2);
}

.file-leading {
  width: 48px;
  height: 48px;
  border-color: color-mix(in srgb, var(--remodel-cyan) 42%, var(--remodel-line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--remodel-cyan) 16%, transparent), transparent),
    var(--remodel-raised);
  color: var(--remodel-cyan);
  box-shadow: var(--remodel-control-shadow);
}

.file-glyph {
  letter-spacing: 0.05em;
}

.file-meta .count-pill,
.program-meta .count-pill,
.roster-stats .count-pill,
.report-cell-note,
.muted-count {
  color: var(--remodel-ink-muted);
}

.project-card-main h2,
.file-main h2,
.new-session-card h3,
.roster-import-card strong,
.class-stat-card strong,
.report-activity-card strong {
  color: var(--remodel-ink);
}

.roster-import-panel {
  grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1.42fr);
  gap: clamp(22px, 2vw, 32px);
  padding: clamp(26px, 2.4vw, 38px);
}

.roster-import-copy {
  gap: 16px;
  padding-block: 4px;
}

.roster-import-copy h2 {
  max-width: 12ch;
  color: var(--remodel-ink);
  font-size: clamp(2.35rem, 4.8vw, 5.25rem);
  line-height: 1;
}

.roster-import-copy p {
  max-width: 38rem;
}

.roster-import-grid {
  grid-template-columns: minmax(230px, 0.92fr) minmax(300px, 1.08fr);
  gap: clamp(16px, 1.6vw, 24px);
}

.roster-import-card {
  gap: 17px;
  min-height: 328px;
  padding: clamp(22px, 2vw, 28px);
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--remodel-surface-2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.roster-import-card strong {
  line-height: 1.15;
}

.roster-import-card .muted {
  line-height: 1.5;
}

.file-import-card input[type="file"] {
  align-self: end;
  margin-top: auto;
  padding: 8px;
}

.file-import-card {
  border-color: color-mix(in srgb, var(--remodel-cyan) 32%, var(--remodel-line));
}

.manual-import-card {
  border-color: color-mix(in srgb, var(--remodel-blue) 28%, var(--remodel-line));
}

.manual-import-card textarea {
  min-height: 178px;
  padding: 16px 18px;
  line-height: 1.45;
}

.manual-import-card .secondary-button {
  min-height: 54px;
  padding: 12px 18px;
  line-height: 1.15;
}

.manual-import-card textarea,
.date-control input,
.select-option select,
.report-export-grid input,
.app-modal input,
.app-modal textarea,
.app-modal select {
  border-color: var(--remodel-line);
  background: var(--remodel-bg);
  color: var(--remodel-ink);
}

.class-stat-grid.report-overview-grid,
.class-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.class-stat-card {
  gap: 10px;
  min-width: 0;
  min-height: 118px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--remodel-surface-2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.class-stat-card strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(1.8rem, 2.2vw, 2.65rem);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-stat-card.latest-stat-card strong {
  font-size: clamp(1.35rem, 1.7vw, 1.95rem);
  line-height: 1.08;
}

.new-session-card {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px) minmax(160px, 220px);
  gap: clamp(18px, 1.8vw, 26px);
  padding: clamp(20px, 1.8vw, 28px);
}

.new-session-card h3 {
  line-height: 1.08;
}

.archive-drawer {
  display: grid;
  gap: 10px;
}

.archive-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  cursor: pointer;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  padding: 0 14px;
  background: color-mix(in srgb, var(--remodel-surface-2) 80%, transparent);
  color: var(--remodel-ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 780;
}

.archive-summary::after {
  content: "+";
  color: var(--remodel-ink-muted);
  font-family: var(--font-mono);
}

.archive-drawer[open] .archive-summary::after {
  content: "-";
}

.class-dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(14px, 1.4vw, 20px);
}

.class-dashboard-title {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.class-dashboard-title h1 {
  min-width: 0;
  overflow: hidden;
  color: var(--remodel-ink);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.1vw, 3.5rem);
  line-height: 0.96;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.dashboard-launch-panel {
  display: grid;
  grid-template-columns: minmax(150px, 178px) auto;
  align-items: end;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    color-mix(in srgb, var(--remodel-surface-2) 84%, transparent);
  box-shadow: var(--remodel-control-shadow);
}

.compact-date-control {
  gap: 4px;
}

.compact-date-control span {
  color: var(--remodel-ink-muted);
  font-family: var(--font-label);
  font-size: 0.66rem;
  font-weight: 840;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compact-date-control input {
  min-height: 38px;
}

.dashboard-launch-panel .go-live-button {
  min-height: 38px;
  min-width: 86px;
}

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

.progress-card {
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr);
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent),
    var(--remodel-surface-2);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.045);
}

.progress-card-head {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.progress-card-head strong {
  overflow: hidden;
  color: var(--remodel-ink);
  font-family: var(--font-numeric);
  font-size: clamp(1.45rem, 1.8vw, 2.1rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-card-head small {
  color: var(--remodel-ink-muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.progress-chart {
  width: 100%;
  min-height: 150px;
  overflow: visible;
}

.chart-grid-line {
  stroke: color-mix(in srgb, var(--remodel-line) 86%, transparent);
  stroke-width: 1;
}

.chart-grid-line.faint {
  opacity: 0.42;
}

.trend-area {
  fill: color-mix(in srgb, var(--remodel-green) 14%, transparent);
}

.trend-line-path,
.average-line-path {
  fill: none;
  stroke: var(--remodel-green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.bar-point rect {
  fill: color-mix(in srgb, var(--remodel-blue) 70%, var(--remodel-cyan));
}

.average-line-path {
  stroke: var(--remodel-amber);
}

.average-point circle,
.chart-point circle {
  fill: var(--remodel-surface-2);
  stroke: var(--remodel-green);
  stroke-width: 3;
}

.average-point circle {
  stroke: var(--remodel-amber);
}

.chart-value-label,
.chart-average-label,
.chart-date-label {
  fill: var(--remodel-ink);
  font-family: var(--font-label);
  font-size: 0.58rem;
  font-weight: 840;
}

.chart-average-label,
.chart-date-label {
  fill: var(--remodel-ink-muted);
}

.progress-discussion .bar-point rect {
  fill: color-mix(in srgb, var(--remodel-blue) 78%, var(--remodel-cyan));
}

.progress-fillers .bar-point rect {
  fill: color-mix(in srgb, var(--remodel-amber) 72%, var(--remodel-red));
}

.progress-empty-chart {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 1px dashed var(--remodel-line);
  border-radius: 8px;
  color: var(--remodel-ink-muted);
  font-family: var(--font-label);
  font-size: 0.74rem;
  font-weight: 820;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.class-session-panel {
  display: grid;
  gap: 12px;
}

.class-session-panel .session-list {
  gap: 8px;
}

.class-session-panel .session-file-row {
  min-height: 58px;
  padding: 10px 12px;
}

.class-session-panel .file-main h2 {
  font-size: 1rem;
}

.date-control,
.select-option {
  gap: 8px;
  line-height: 1.25;
}

.go-live-button {
  min-height: 54px;
}

.setup-strip.preflight-strip {
  border-color: var(--remodel-line);
  border-radius: 8px;
  background: var(--remodel-surface);
  box-shadow: var(--remodel-panel-shadow);
}

.setup-strip.preflight-strip summary {
  min-height: 50px;
  padding: 14px 18px;
  color: var(--remodel-ink);
  line-height: 1.3;
}

.setup-body.preflight-tools {
  gap: 16px;
  padding: 16px 18px 18px;
  border-top-color: var(--remodel-line);
}

.setup-item label,
.file-label {
  gap: 8px;
  color: var(--remodel-ink-soft);
  line-height: 1.25;
}

.setup-item.compact button {
  min-height: 42px;
  padding-inline: 14px;
}

.report-panel {
  padding: clamp(18px, 1.6vw, 24px);
  container-type: inline-size;
}

.report-export-grid,
.report-activity-grid {
  gap: 14px;
}

.report-export-grid fieldset {
  border-color: var(--remodel-line);
  border-radius: 8px;
  background: var(--remodel-surface-2);
}

.check-option,
.select-option {
  color: var(--remodel-ink-soft);
}

.check-option input[type="checkbox"] {
  accent-color: var(--remodel-cyan);
}

.report-activity-card {
  border-color: var(--remodel-line);
  border-radius: 8px;
  background: var(--remodel-surface-2);
}

.report-student-table {
  overflow-x: auto;
  overflow-y: visible;
}

.report-student-table .grid-row {
  grid-template-columns: minmax(142px, 1.08fr) minmax(76px, 0.54fr) minmax(62px, 0.38fr) minmax(58px, 0.36fr) minmax(70px, 0.44fr) minmax(74px, 0.46fr) minmax(74px, 0.46fr) minmax(126px, 0.7fr);
  gap: 5px;
  min-width: 820px;
  padding: 4px 6px;
  border-color: var(--remodel-line);
  overflow: visible;
}

.report-student-table .table-header {
  min-height: 25px;
  padding-block: 3px;
  background: var(--remodel-surface-3);
  color: var(--remodel-ink-soft);
  font-size: 0.64rem;
}

.report-student-table .grid-row > [role="cell"],
.report-student-table .table-header > [role="columnheader"] {
  min-width: 0;
}

.report-student-row:nth-child(odd),
.event-timeline .log-row:nth-child(odd) {
  background: color-mix(in srgb, var(--remodel-surface-2) 86%, transparent);
}

.report-student-table .student-meta {
  gap: 0;
}

.report-student-table .student-name {
  font-size: 0.78rem;
  line-height: 1.05;
}

.report-student-table .student-id,
.report-student-table .report-cell-note {
  margin-top: 1px;
  font-size: 0.62rem;
  line-height: 1;
  white-space: nowrap;
}

.report-student-table .status-pill {
  min-height: 18px;
  padding: 2px 5px;
  font-size: 0.62rem;
  line-height: 1;
}

.report-student-table .report-score-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: visible;
}

.report-student-table .report-score-value {
  color: var(--remodel-ink);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.report-student-table .report-score-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  min-width: 0;
  width: auto;
  overflow: visible;
}

.report-student-table .report-score-actions .small-button {
  min-height: 20px;
  min-width: 0;
  padding: 2px 5px;
  border-color: color-mix(in srgb, var(--remodel-blue) 30%, var(--remodel-line));
  background: color-mix(in srgb, var(--remodel-blue) 9%, var(--remodel-surface-2));
  color: color-mix(in srgb, var(--remodel-blue) 72%, var(--remodel-ink));
  font-size: 0.6rem;
  line-height: 1;
  white-space: nowrap;
}

.report-student-table .report-score-actions .report-feedback-button {
  border-color: color-mix(in srgb, var(--remodel-green) 30%, var(--remodel-line));
  background: color-mix(in srgb, var(--remodel-green) 9%, var(--remodel-surface-2));
  color: color-mix(in srgb, var(--remodel-green) 72%, var(--remodel-ink));
}

@container (max-width: 980px) {
  .report-student-table {
    overflow-x: visible;
  }

  .report-student-table .grid-row {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    min-width: 0;
    gap: 6px;
    padding: 8px;
  }

  .report-student-table .table-header {
    display: none;
  }

  .report-student-table .report-student-row > [role="cell"] {
    display: grid;
    gap: 2px;
    align-content: start;
    min-height: 44px;
    padding: 6px 7px;
    border: 1px solid color-mix(in srgb, var(--remodel-blue) 18%, var(--remodel-line));
    border-radius: 8px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent),
      color-mix(in srgb, var(--remodel-surface-2) 80%, transparent);
  }

  .report-student-table .report-student-row > [role="cell"]::before {
    color: var(--remodel-ink-muted);
    font-family: var(--font-label);
    font-size: 0.58rem;
    font-weight: 840;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
  }

  .report-student-table .report-student-row > [role="cell"]:first-child,
  .report-student-table .report-score-cell {
    grid-column: 1 / -1;
  }

  .report-student-table .report-student-row > [role="cell"]:first-child {
    min-height: auto;
    padding: 0 0 2px;
    border: 0;
    background: transparent;
  }

  .report-student-table .report-student-row > [role="cell"]:first-child::before {
    content: none;
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(2)::before {
    content: "Attendance";
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(3)::before {
    content: "Fillers";
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(4)::before {
    content: "Presence";
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(5)::before {
    content: "Discuss";
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(6)::before {
    content: "Think Fast";
  }

  .report-student-table .report-student-row > [role="cell"]:nth-child(7)::before {
    content: "Never Met";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(2)::before {
    content: "Status";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(3)::before {
    content: "Fillers";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(4)::before {
    content: "Time";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(5)::before {
    content: "Penalties";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(6)::before {
    content: "Final Score";
  }

  .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(7)::before {
    content: "Actions";
  }

  .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(2)::before {
    content: "Wins";
  }

  .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(3)::before {
    content: "Takeaways";
  }

  .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(4)::before {
    content: "Presence";
  }

  .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(5)::before {
    content: "Participation Score";
  }

  .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(6)::before {
    content: "Actions";
  }

  .report-student-table .report-score-cell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    min-height: 34px;
    padding: 6px 7px;
    border-color: color-mix(in srgb, var(--remodel-blue) 24%, var(--remodel-line));
  }

  .report-student-table .report-score-cell::before {
    content: "Report Summary";
  }

  .presentation-score-table .presentation-score-row > .report-score-cell::before {
    content: "Final Score";
  }

  .presentation-participation-table .presentation-participation-row > .report-score-cell::before {
    content: "Participation Score";
  }

  .report-student-table .report-score-actions {
    justify-content: end;
  }
}

.event-timeline .log-row strong {
  color: var(--remodel-ink);
}

.app-modal-backdrop {
  background: rgba(3, 5, 8, 0.74);
  backdrop-filter: blur(0);
}

.app-modal {
  width: min(560px, 100%);
  color: var(--remodel-ink);
}

.app-modal h2,
.app-modal h3 {
  color: var(--remodel-ink);
}

.app-modal-body {
  color: var(--remodel-ink-soft);
}

.app-modal .app-modal-close {
  --modal-close-size: 38px;
  --modal-close-stroke: 15px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--modal-close-size);
  min-width: var(--modal-close-size);
  min-height: var(--modal-close-size);
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--remodel-blue) 22%, var(--remodel-line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--remodel-blue) 10%, transparent), transparent 58%),
    color-mix(in srgb, var(--remodel-surface-2) 76%, transparent);
  color: var(--remodel-ink-soft);
  box-shadow: 2px 2px 0 color-mix(in srgb, #000 42%, transparent);
  transform: none;
}

.app-modal .app-modal-close::before,
.app-modal .app-modal-close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--modal-close-stroke);
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: 50% 50%;
}

.app-modal .app-modal-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.app-modal .app-modal-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.app-modal .app-modal-close:hover,
.app-modal .app-modal-close:focus-visible {
  border-color: color-mix(in srgb, var(--remodel-blue) 42%, var(--remodel-line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--remodel-blue) 20%, transparent), transparent 58%),
    color-mix(in srgb, var(--remodel-surface-2) 86%, transparent);
  color: var(--remodel-ink);
  box-shadow:
    2px 2px 0 color-mix(in srgb, #000 42%, transparent),
    0 0 0 3px color-mix(in srgb, var(--remodel-blue) 16%, transparent);
  transform: translate(-1px, -1px);
}

.app-modal .app-modal-close:active {
  background: color-mix(in srgb, var(--remodel-blue) 18%, var(--remodel-surface-2));
  box-shadow: 1px 1px 0 color-mix(in srgb, #000 42%, transparent);
  transform: translate(1px, 1px);
}

.roster-drawer {
  gap: 12px;
}

.roster-drawer > summary {
  color: var(--remodel-ink);
}

.roster-summary-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-color: var(--remodel-line);
  border-radius: 8px;
  background: var(--remodel-bg);
}

.roster-summary-meter {
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-color: var(--remodel-line);
  border-radius: 6px;
  background: var(--remodel-surface-2);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  box-shadow: var(--remodel-control-shadow);
}

.roster-summary-meter:hover {
  transform: translateY(-1px);
  border-color: var(--remodel-line-strong);
}

.roster-summary-meter:focus-visible {
  outline: 2px solid var(--remodel-cyan);
  outline-offset: 2px;
}

.roster-summary-meter.active,
.roster-summary-meter[aria-pressed="true"] {
  background:
    linear-gradient(180deg, color-mix(in srgb, currentColor 13%, transparent), transparent),
    var(--remodel-surface-3);
  box-shadow: inset 0 0 0 1px currentColor, var(--remodel-control-shadow);
}

.roster-summary-meter span {
  color: var(--remodel-ink-muted);
}

.roster-summary-meter strong {
  color: var(--remodel-ink);
}

.roster-summary-meter.status-available {
  border-color: color-mix(in srgb, var(--remodel-green) 52%, var(--remodel-line));
}

.roster-summary-meter.status-late,
.roster-summary-meter.status-discussion {
  border-color: color-mix(in srgb, var(--remodel-amber) 52%, var(--remodel-line));
}

.roster-summary-meter.status-left,
.roster-summary-meter.status-absent {
  border-color: color-mix(in srgb, var(--remodel-red) 48%, var(--remodel-line));
}

.roster-summary-meter.status-notSeen {
  border-color: var(--remodel-line-strong);
}

.roster-operator-sheet .table-row {
  border-color: var(--remodel-line);
  background: var(--remodel-surface-2);
}

.roster-status-group,
.roster-status-group.status-available,
.roster-status-group.status-late,
.roster-status-group.status-left,
.roster-status-group.status-absent,
.roster-status-group.status-notSeen {
  display: grid;
  gap: 6px;
  background: transparent;
  color: var(--remodel-ink);
}

.roster-operator-sheet .roster-group-heading.table-header,
.roster-group-heading {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-color: var(--remodel-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--remodel-surface-2);
  color: var(--remodel-ink-soft);
  line-height: 1;
  position: static;
  z-index: auto;
}

.roster-status-group.status-available .roster-group-heading {
  border-left: 3px solid var(--remodel-green);
}

.roster-status-group.status-late .roster-group-heading {
  border-left: 3px solid var(--remodel-amber);
}

.roster-status-group.status-left .roster-group-heading,
.roster-status-group.status-absent .roster-group-heading {
  border-left: 3px solid var(--remodel-red);
}

.roster-status-group.status-notSeen .roster-group-heading {
  border-left: 3px solid var(--remodel-line-strong);
}

.roster-signal-cell {
  gap: 5px;
}

.roster-status-buttons {
  gap: 5px;
}

.roster-status-buttons .small-button,
.status-actions .small-button {
  min-height: 30px;
  border-radius: 6px;
}

.roster-status-buttons .small-button.active,
.status-actions .small-button.active {
  border-color: color-mix(in srgb, var(--remodel-green) 56%, var(--remodel-line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--remodel-green) 24%, transparent), color-mix(in srgb, var(--remodel-green) 10%, transparent)),
    var(--remodel-surface-2);
  color: color-mix(in srgb, var(--remodel-green) 86%, var(--remodel-ink));
}

.screen-active .side-panel {
  border-color: var(--remodel-line);
  background: var(--remodel-surface);
}

.screen-active .side-panel {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.screen-active .side-panel .roster-drawer {
  display: block;
  height: auto;
  min-height: max-content;
  overflow: visible;
}

.screen-active .side-panel .roster-drawer > summary {
  position: sticky;
  top: 0;
  z-index: 4;
  margin-bottom: 12px;
  background: var(--remodel-surface);
}

.screen-active .side-panel .roster-drawer-body {
  display: block;
  min-height: auto;
  overflow: visible;
}

.screen-active .side-panel .roster-summary-board {
  position: sticky;
  top: 48px;
  z-index: 3;
  margin-bottom: 12px;
  background: var(--remodel-bg);
}

.screen-active .side-panel .roster-list {
  overflow: visible;
  padding-bottom: 72px;
}

.student-meta {
  min-width: 0;
}

.student-name {
  color: var(--remodel-ink);
}

.student-id {
  color: var(--remodel-ink-muted);
}

.status-pill.available {
  border-color: color-mix(in srgb, var(--remodel-green) 48%, var(--remodel-line));
  color: var(--remodel-green);
}

.status-pill.late {
  border-color: color-mix(in srgb, var(--remodel-amber) 48%, var(--remodel-line));
  color: var(--remodel-amber);
}

.status-pill.left,
.status-pill.absent {
  border-color: color-mix(in srgb, var(--remodel-red) 42%, var(--remodel-line));
  color: var(--remodel-red);
}

.status-pill.notSeen {
  border-color: var(--remodel-line-strong);
  color: var(--remodel-ink-muted);
}

/*
  Student display integration notes:
  - app.js currently writes .display, .activity, .title, .subtitle, .timer,
    .next, .article-board, .article-overline, .article-content,
    .article-headline, .article-summary, .article-topic, and .article-footer
    into the child window as inline CSS.
  - When the parent can share a stylesheet with rostraStudentDisplay, move the
    presentation tokens below into that template instead of duplicating them.
  - Keep the display private-safe: no filler counts, roster statuses, grades, or
    instructor-only controls.
*/

.student-display-support,
.display-support-panel {
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--remodel-blue) 8%, transparent), transparent),
    var(--remodel-surface);
  color: var(--remodel-ink);
  box-shadow: var(--remodel-panel-shadow);
}

.student-display-support .display-preview,
.display-support-panel .display-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--remodel-cyan) 30%, var(--remodel-line));
  border-radius: 8px;
  background: var(--remodel-bg);
  color: var(--remodel-ink-soft);
}

.display-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--remodel-green) 42%, var(--remodel-line));
  border-radius: 999px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--remodel-green) 12%, transparent);
  color: var(--remodel-green);
  font-family: var(--font-label);
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.display-status-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

:root[data-theme="light"] .library-toolbar,
:root[data-theme="light"] .roster-import-panel,
:root[data-theme="light"] .new-session-card,
:root[data-theme="light"] .progress-card,
:root[data-theme="light"] .report-panel,
:root[data-theme="light"] .app-modal,
:root[data-theme="light"] .setup-strip.preflight-strip,
:root[data-theme="light"] .screen-active .side-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 247, 250, 0.86)),
    var(--remodel-surface);
}

:root[data-theme="light"] .class-file-row,
:root[data-theme="light"] .session-file-row,
:root[data-theme="light"] .roster-import-card,
:root[data-theme="light"] .class-stat-card,
:root[data-theme="light"] .archive-summary,
:root[data-theme="light"] .report-activity-card,
:root[data-theme="light"] .report-export-grid fieldset,
:root[data-theme="light"] .roster-operator-sheet .table-row,
:root[data-theme="light"] .roster-summary-meter {
  background: var(--remodel-surface-2);
}

:root[data-theme="light"] .manual-import-card textarea,
:root[data-theme="light"] .date-control input,
:root[data-theme="light"] .select-option select,
:root[data-theme="light"] .app-modal input,
:root[data-theme="light"] .app-modal textarea,
:root[data-theme="light"] .app-modal select {
  background: #ffffff;
}

:root[data-theme="light"] .app-modal-backdrop {
  background: rgba(22, 32, 43, 0.42);
}

:root[data-theme="light"] .nav-button.active {
  border-color: var(--remodel-ink, #1e293b);
  background: color-mix(in srgb, var(--nav-accent, var(--remodel-blue)) 28%, var(--remodel-surface, #ffffff));
  color: var(--remodel-ink, #1e293b);
  box-shadow: 3px 3px 0 var(--remodel-ink, #1e293b);
}

:root[data-theme="light"] .nav-button.active .nav-icon {
  border-color: var(--remodel-ink, #1e293b);
  background: var(--nav-accent, var(--remodel-blue));
  color: #ffffff;
}

.dashboard-launch-panel .session-type-control select,
.dashboard-launch-panel .presentation-title-control input {
  min-height: 40px;
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background: var(--remodel-bg);
  color: var(--remodel-ink);
  padding: 0 10px;
}

.presentation-report .presentation-score-table .grid-row {
  grid-template-columns: minmax(220px, 1.25fr) minmax(112px, 0.72fr) minmax(72px, 0.45fr) minmax(82px, 0.5fr) minmax(150px, 0.9fr) minmax(116px, 0.62fr) minmax(126px, 0.68fr);
}

.presentation-report .presentation-participation-table .grid-row {
  grid-template-columns: minmax(220px, 1.35fr) minmax(110px, 0.65fr) minmax(120px, 0.72fr) minmax(120px, 0.72fr) minmax(140px, 0.8fr) minmax(92px, 0.46fr);
}

.presentation-report .presentation-detail-row {
  grid-template-columns: 1fr !important;
}

.presentation-report .presentation-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.presentation-report .presentation-detail-item,
.presentation-report .presentation-notes-detail {
  border: 1px solid var(--remodel-line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--remodel-surface-2) 82%, transparent);
  padding: 12px;
}

.presentation-report .presentation-detail-item span,
.presentation-report .presentation-notes-detail strong {
  display: block;
  color: var(--remodel-ink-muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.presentation-report .presentation-detail-item strong {
  color: var(--remodel-ink);
}

.presentation-report .presentation-notes-detail {
  margin-top: 12px;
}

.presentation-report .presentation-notes-detail p {
  margin: 0;
  color: var(--remodel-ink-soft);
  white-space: pre-wrap;
}

.presentation-report .presentation-penalty-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@container (max-width: 980px) {
  .presentation-report .presentation-score-table .grid-row,
  .presentation-report .presentation-participation-table .grid-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .presentation-report .presentation-score-row > .report-score-actions[role="cell"],
  .presentation-report .presentation-participation-row > .report-score-actions[role="cell"] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
  }

  .presentation-report .report-square-action {
    width: 36px;
    height: 36px;
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(2)::before {
    content: "Status";
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(3)::before {
    content: "Fillers";
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(4)::before {
    content: "Time";
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(5)::before {
    content: "Penalties";
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(6)::before {
    content: "Final Score";
  }

  .presentation-report .presentation-score-table .presentation-score-row > [role="cell"]:nth-child(7)::before {
    content: "Actions";
  }

  .presentation-report .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(2)::before {
    content: "Wins";
  }

  .presentation-report .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(3)::before {
    content: "Takeaways";
  }

  .presentation-report .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(4)::before {
    content: "Presence";
  }

  .presentation-report .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(5)::before,
  .presentation-report .presentation-participation-table .report-score-cell::before {
    content: "Participation Score";
  }

  .presentation-report .presentation-participation-table .presentation-participation-row > [role="cell"]:nth-child(6)::before {
    content: "Actions";
  }
}

@media (max-width: 1180px) {
  .library-toolbar,
  .roster-import-panel,
  .roster-import-grid,
  .new-session-card,
  .class-dashboard-header,
  .dashboard-launch-panel,
  .progress-card-grid {
    grid-template-columns: 1fr;
  }

  .command-cluster,
  .file-actions {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .library-toolbar,
  .roster-import-panel,
  .new-session-card,
  .report-panel,
  .app-modal {
    padding: 16px;
  }

  .roster-import-card,
  .class-stat-card {
    min-height: auto;
    padding: 18px;
  }

  .setup-strip.preflight-strip summary {
    padding: 14px 16px;
  }

  .setup-body.preflight-tools {
    grid-template-columns: 1fr;
    padding: 14px 16px 16px;
  }

  .class-file-row,
  .session-file-row {
    grid-template-columns: 1fr;
  }

  .file-leading {
    display: none;
  }

  .file-actions,
  .new-session-card .go-live-button {
    width: 100%;
  }

  .file-actions .primary-button,
  .file-actions .ghost-button,
  .file-actions .danger-button,
  .file-actions .secondary-button,
  .new-session-card .go-live-button {
    width: 100%;
  }

  .report-student-table .grid-row {
    min-width: 0;
  }
}
