/* MATIVIA: shared identity, light blue surfaces and accessible application colors. */
:root {
  --mativia-navy: #102e59;
  --mativia-blue: #2563eb;
  --mativia-green: #059669;
  --mativia-yellow: #f5b700;
  --mativia-white: #fff;
  --mativia-mist: #e4f1ff;
  --mativia-mint: #edf6f1;
  --mativia-cream: #fbf5e7;
  --ink: #183452;
  --text: var(--ink);
  --muted: #4f6b86;
  --green: #1462b8;
  --blue: #1462b8;
  --bg: #e5f3ff;
  --line: #cbdff0;
  --surface: #fff;
  --soft: #eaf4ff;
  --management-button-ink: #fff;
  --primary-background: var(--green);
  --shadow: 0 12px 38px #174d850a;
}

body {
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.main {
  padding-left: 24px;
  padding-right: 24px;
}

body.dark {
  --ink: #fff;
  --text: #fff;
  --muted: #fff;
  --green: #9dbed9;
  --blue: #aacbea;
  --bg: #14222e;
  --line: #33485a;
  --surface: #1b2e3e;
  --soft: #253d51;
  --mativia-mist: #253d51;
  --mativia-mint: #233e38;
  --mativia-cream: #423c2d;
  --management-button-ink: #fff;
  --primary-background: #1d4f85;
  --shadow: 0 12px 38px #0002;
  background: var(--bg);
  color: var(--ink);
}

.card,
.panel {
  border-color: var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

body.dark .card,
body.dark .panel,
body.dark .qbox,
body.dark .exam,
body.dark .answer,
body.dark .field,
body.dark .tab,
body.dark .timer,
body.dark .tablewrap {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 40px;
  max-width: 100%;
  border-radius: 11px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  vertical-align: middle;
  text-decoration: none;
  transition: background-color .18s, border-color .18s, box-shadow .18s;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.btn.primary {
  background: var(--primary-background);
  border-color: var(--primary-background);
  color: var(--management-button-ink);
}

.btn.secondary {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.danger {
  background: #fff1ef;
  border: 1px solid #ecc7c1;
  color: #943e37;
}

.btn:not(:disabled):hover {
  box-shadow: 0 3px 10px #21384b14;
}

.btn.secondary:not(:disabled):hover {
  background: var(--soft);
  border-color: var(--green);
}

.field {
  border-color: var(--line);
  border-radius: 11px;
}

.field:focus,
.btn:focus-visible,
.mativia-text-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  box-shadow: none;
}

body.dark .btn.danger {
  background: #4d3032;
  border-color: #77515b;
  color: #ffd7d2;
}

body.dark .answer.selected,
body.dark .tab.active {
  background: var(--soft);
  color: var(--ink);
}

body.dark .filterbar button.active,
body.dark .roster-quick-buttons .selected,
body.dark .pdfanswerchoices button.selected {
  background: var(--primary-background);
  color: var(--management-button-ink);
}

body.dark :is(h1,h2,h3,h4,h5,h6,label,legend,th,td,.muted,.eyebrow,.notice,.tag,.teacher-class-lesson-list,.teacher-agenda-item) {
  color: #fff;
}

body.dark :is(input,textarea,select,option) {
  color: #fff;
  background-color: var(--surface);
}

body.dark .field::placeholder { color: #fff; opacity: .8; }
body.dark :is(.filterbar button,.schedule-day-tab,.badge,.chip) {
  color: #fff;
  background: var(--surface);
  border-color: var(--line);
}

body.dark :is(.primary,.teacher-guide-launcher,.filterbar button.active,.schedule-day-tab.active) {
  color: #fff;
  background: var(--primary-background);
}

body.dark :is(.teacher-exam-groups button.active,#teacherCategoryButtons button.active) {
  color: #fff;
  background: var(--primary-background);
}

body.dark .schedule-block-card,
body.dark .schedule-editor-day-column,
body.dark .schedule-row {
  color: #fff;
  background: var(--surface) !important;
  border-color: var(--line);
}

body.dark .schedule-block-card span,
body.dark .schedule-editor-slot,
body.dark .schedule-editor-slot.active { color: #fff; }

body.dark .weekly-display td,
body.dark #homeWeeklyLegend span {
  color: #fff !important;
  background-image: linear-gradient(#000b,#000b) !important;
}

.mativia-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 12px;
  padding: 8px 12px;
  background: #ffffff;
  text-decoration: none;
}

.mativia-logo-link img {
  display: block;
  width: 260px;
  height: auto;
  object-fit: contain;
  border-radius: inherit;
}

.mativia-logo-link:focus-visible {
  outline: 3px solid var(--mativia-blue);
  outline-offset: 3px;
}

header.mativia-header {
  height: auto;
  min-height: 86px;
  background: #f5faff;
  border-bottom: 1px solid var(--line);
}

body.dark header.mativia-header {
  background: var(--surface);
}

.mativia-header .mativia-nav {
  height: auto;
  min-height: 86px;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.mativia-nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.mativia-nav-actions .btn {
  padding: 10px 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.mativia-nav-actions .btn[aria-current="page"],
.mativia-nav-actions .btn:hover {
  color: var(--ink);
  border-color: var(--line);
  background: var(--soft);
}

.mativia-signature {
  display: block;
  width: min(100%, 380px);
  height: auto;
  margin: 0 auto 24px;
  border-radius: 12px;
  background: transparent;
}

body.dark .mativia-signature {
  padding: 16px;
  background: #f5faff;
}

body.mativia-home .shell {
  max-width: 1180px;
}

.mativia-home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 44px;
  padding: 8px 0 44px;
}

.mativia-kicker {
  display: block;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.mativia-home-copy h1 {
  max-width: 620px;
  margin: 16px 0;
  font-size: clamp(32px, 3.8vw, 46px);
  line-height: 1.16;
  letter-spacing: -1.5px;
}

.mativia-home-copy h1 em {
  color: var(--green);
  font-style: normal;
}

.mativia-home-copy > p,
.mativia-access-story > p {
  max-width: 540px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.mativia-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 14px;
}

.mativia-text-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.mativia-hero-visual {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 16px 48px #21384b08;
}

.mativia-visual-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.mativia-visual-caption::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #08b99b;
}

.mativia-hero-visual .mativia-signature {
  width: 100%;
  margin: 20px 0;
}

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

.mativia-audience span {
  padding: 10px 4px;
  border-radius: 10px;
  background: var(--mativia-mist);
  color: var(--ink);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.mativia-audience span:nth-child(2) { background: var(--mativia-mint); }
.mativia-audience span:nth-child(3) { background: var(--mativia-cream); }

.mativia-student-card {
  max-width: 820px;
  margin: 4px auto 0;
  padding: 30px;
  scroll-margin-top: 24px;
}

.mativia-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.mativia-section-heading h2 {
  margin: 8px 0 0;
}

.mativia-step {
  padding: 8px 12px;
  border-radius: 30px;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
}

.mativia-about {
  margin-top: 64px;
  scroll-margin-top: 24px;
}

.mativia-about-intro {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 38px;
  align-items: start;
  margin-bottom: 28px;
}

.mativia-about-intro h2 {
  max-width: 360px;
  margin: 12px 0 0;
  font-size: 29px;
  line-height: 1.3;
  letter-spacing: -.6px;
}

.mativia-mission {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--mativia-mist);
}

.mativia-mission h3 { margin-bottom: 8px; }
.mativia-mission p { margin: 0; color: var(--muted); line-height: 1.8; }

.mativia-values-title {
  margin: 0 0 16px;
  font-size: 17px;
}

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

.mativia-value {
  min-width: 0;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.mativia-value-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 10px;
  background: var(--mativia-mist);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.mativia-value:nth-child(2) .mativia-value-number { background: var(--mativia-mint); }
.mativia-value:nth-child(3) .mativia-value-number { background: var(--mativia-cream); }
.mativia-value h4 { margin: 0 0 10px; font-size: 15px; line-height: 1.45; }
.mativia-value p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

.mativia-public-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.mativia-access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 48px;
  max-width: 1080px;
  margin: 12px auto;
}

.mativia-access-layout > .mativia-access-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 30px;
}

.mativia-access-card > h1 { font-size: 26px; }
.mativia-access-story { padding: 20px 0; min-width: 0; }
.mativia-access-story > h2 { margin: 15px 0; font-size: 35px; line-height: 1.25; letter-spacing: -.7px; }
.mativia-access-story .mativia-signature { width: min(100%, 340px); margin: 26px 0; }
.mativia-access-story .mativia-brand-promise { margin: -12px 0 26px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.6; }

.mativia-story-mission {
  padding: 20px;
  border-left: 3px solid #a6bdcf;
  border-radius: 0 14px 14px 0;
  background: var(--mativia-mist);
}

.mativia-story-mission h3 { margin: 0 0 8px; font-size: 14px; }
.mativia-story-mission p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.mativia-story-values { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; list-style: none; }
.mativia-story-values li { padding: 7px 11px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); font-size: 11px; }

@media (max-width: 980px) {
  .mativia-home-hero { gap: 24px; }
  .mativia-hero-visual { padding: 18px; }
  .mativia-access-layout { grid-template-columns: minmax(0, 1fr); max-width: 620px; gap: 28px; }
  .mativia-access-card { order: 0; }
  .mativia-access-story { order: 1; }
  .mativia-access-story > h2 { font-size: 29px; }
  .mativia-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main { padding-left: 16px; padding-right: 16px; }
  .mativia-header .mativia-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding-top: 8px;
    padding-bottom: 12px;
  }

  .mativia-nav-actions {
    width: 100%;
    justify-content: center;
  }

  .mativia-header .topnav-link,
  .mativia-nav-actions button {
    padding: 8px 10px;
    font-size: 11px;
  }

  .mativia-logo-link img {
    width: 240px;
    height: auto;
  }

  .mativia-signature {
    max-width: 360px;
    margin-bottom: 18px;
  }

  .mativia-home-hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 28px; gap: 24px; }
  .mativia-home-copy h1 { font-size: 34px; letter-spacing: -.9px; }
  .mativia-hero-visual { max-width: 460px; width: 100%; justify-self: center; }
  .mativia-hero-visual .mativia-signature { width: 100%; max-width: none; margin: 12px 0; }
  .mativia-section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .mativia-student-card { padding: 22px; }
  .mativia-step { display: none; }
  .mativia-about { margin-top: 40px; }
  .mativia-about-intro { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .mativia-about-intro h2 { font-size: 25px; }
  .mativia-access-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 0; }
  .mativia-access-card { order: 0; }
  .mativia-access-story { order: 1; padding: 12px 2px; }
  .mativia-access-layout > .mativia-access-card { padding: 22px; }
  .mativia-public-footer { flex-direction: column; }
}

@media (max-width: 430px) {
  .mativia-hero-actions .btn { flex: 1 1 calc(50% - 10px); padding: 12px 10px; }
  .mativia-hero-actions .primary { flex-basis: 100%; }
  .mativia-values { grid-template-columns: minmax(0, 1fr); }
  .mativia-value { padding: 22px; }
  .mativia-mission { padding: 22px; }
  .mativia-home-copy > p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* Compact student access; avatar creation opens only from the signed-in profile. */
body.mativia-home .main { padding-top: 26px; }
body.mativia-home .mativia-student-card { max-width: 620px; margin: 0 auto; padding: 24px; }
.student-access-heading { margin-bottom: 18px; }
.student-access-heading h1 { margin: 7px 0; font-size: 26px; }
.student-access-heading p { margin: 0; font-size: 13px; }
.mativia-student-card .group { gap: 5px; margin-bottom: 12px; }
.mativia-student-card .field { padding: 10px 12px; }
.student-ra-row { grid-template-columns: minmax(0, 1fr) 140px; }
.student-remember { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 4px 0 18px; }
.student-remember label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.student-remember input { margin: 0; accent-color: var(--green); }
body.mativia-home .mativia-public-footer { max-width: 620px; margin: 20px auto 0; padding-top: 14px; }
.student-profile-head h2 { margin: 4px 0 0; font-size: 20px; }
.student-profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.student-avatar-dialog { width: min(640px, calc(100vw - 28px)); max-height: 90vh; max-height: 90dvh; overflow: auto; padding: 26px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #102e5940; }
.student-avatar-dialog::backdrop { background: #102e5970; }
.student-avatar-heading h2 { margin: 7px 0; }
.student-avatar-heading p { margin: 0 0 22px; font-size: 13px; line-height: 1.65; }
.student-avatar-editor { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: start; }
.student-avatar-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.student-avatar-preview img { display: block; width: 144px; height: 144px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); }
.student-avatar-preview .btn { padding: 10px 12px; font-size: 12px; }
.student-avatar-dialog .avatar-traits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.student-avatar-dialog .avatar-traits label { font-size: 12px; }
.student-avatar-dialog .avatar-traits .field { font-size: 13px; padding: 10px; }
.student-avatar-styles { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.student-avatar-styles summary { padding: 6px 0; cursor: pointer; color: var(--green); font-size: 13px; font-weight: 700; }
.student-avatar-styles summary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.student-avatar-styles .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 12px; }
.student-avatar-status { margin: 14px 0; color: #b4232b; font-size: 13px; }
body.dark .student-avatar-status { color: #ffb3b3; }
.student-avatar-status:empty { display: none; }
.student-avatar-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.weekly-config { margin: 20px 0; padding: 22px; background: var(--soft); }
.weekly-config fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.weekly-config .weekly-days { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 24px; }
.weekly-days legend { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.weekly-days label,.weekly-checkbox { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.weekly-checkbox { margin: 0 0 18px; }
.weekly-editor-table { min-width: 680px; width: 100%; border-collapse: collapse; }
.weekly-editor-table th,.weekly-editor-table td { padding: 7px; text-align: left; }
.weekly-editor-table td:first-child { min-width: 180px; }
.weekly-editor-table input[type="time"] { min-width: 125px; }
.weekly-quick-periods { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 18px; }
.weekly-quick-periods label { display: grid; gap: 5px; font-size: 12px; flex: 1 1 120px; }
.weekly-reservation { display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: center; gap: 10px; margin: 10px 0; }
.weekly-issue { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.weekly-issue p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.weekly-issue .btn { flex-shrink: 0; }
.weekly-diagnostics { margin: 22px 0; }
.weekly-display { width: 100%; min-width: 760px; border-collapse: collapse; text-align: center; }
.weekly-display th { padding: 12px; background: #517da8; color: #fff; border: 1px solid #cbdff0; }
.weekly-display td { padding: 12px; border: 1px solid #cbdff0; }
.weekly-display td:has(.weekly-cell) { padding: 0; }
.weekly-cell { display:flex; width:100%; min-height:94px; padding:12px; flex-direction:column; gap:5px; justify-content:center; align-items:center; color:inherit; background:transparent; border:0; border-radius:0; font:inherit; }
button.weekly-cell { cursor:grab; touch-action:manipulation; }
button.weekly-cell:active { cursor:grabbing; }
button.weekly-cell:hover,button.weekly-cell:focus-visible { outline:3px solid #1466b3; outline-offset:-3px; background:#ffffff33; }
.weekly-selected { box-shadow:inset 0 0 0 4px #095eac; }
.weekly-drag-help { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:12px 0; }
.weekly-drag-help p { flex:1; margin:0; }
.weekly-move-preview { border:2px solid var(--primary,#1466b3); margin:16px 0; }
.weekly-export { display:flex; align-items:end; gap:12px; flex-wrap:wrap; padding:18px 0; }
.weekly-export label { display:grid; gap:6px; }
.weekly-export .notice { flex-basis:100%; margin:0; }
.weekly-tools { margin:18px 0; padding:18px; }
.weekly-tools summary { cursor:pointer; font-weight:700; }
.weekly-tools #homeWeeklyTutors { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin:16px 0; }
.weekly-fixed-periods { display:flex; flex-wrap:wrap; gap:14px; margin:12px 0 18px; }
.weekly-fixed-entry { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.teacher-agenda-grid { display:grid; grid-template-columns:repeat(5,minmax(155px,1fr)); gap:12px; overflow-x:auto; }
.teacher-agenda-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.teacher-agenda-toolbar h2 { margin:0; }
.teacher-agenda-toolbar .actions { display:flex; flex-wrap:wrap; gap:8px; }
#teacherAgendaView:fullscreen { width:100vw; height:100vh; height:100dvh; padding:22px; overflow:auto; box-sizing:border-box; background:var(--surface,#fff); color:var(--ink); }
#teacherWorkloadDialog.teacher-agenda-expanded { position:fixed; inset:0; margin:0; width:100vw!important; height:100vh; height:100dvh; max-width:none; max-height:none!important; border:0!important; border-radius:0!important; box-sizing:border-box; }
body.teacher-agenda-fullscreen { overflow:hidden; }
#teacherAgendaView:fullscreen .teacher-agenda-toolbar,.teacher-agenda-expanded .teacher-agenda-toolbar { position:sticky; top:-22px; z-index:2; padding:16px 0; background:var(--surface,#fff); border-bottom:1px solid var(--line); }
.teacher-agenda-day h3 { padding:10px; background:var(--soft); border-radius:8px; font-size:14px; }
.teacher-agenda-item { display:grid; gap:5px; padding:12px; margin-bottom:9px; border:1px solid var(--line); border-left:4px solid #2876ba; border-radius:8px; }
.teacher-agenda-item.agenda-HE { border-left-color:#919eab; }
.teacher-agenda-item.agenda-tutoria { border-left-color:#8c57bd; }
.teacher-agenda-item.agenda-planning { border-left-color:#26927d; }
.teacher-agenda-item.agenda-break { border-left-color:#e6a33d; }
.teacher-agenda-item.agenda-personal { border-left-color:#6c60b7; background:var(--soft); }
.teacher-agenda-calendar { display:flex; flex-wrap:wrap; align-items:end; gap:16px; border:0; padding:0; margin:18px 0; }
.teacher-agenda-calendar label { flex:1 1 200px; margin:0; }
.teacher-agenda-day h3 small { display:block; margin-top:5px; font-weight:400; }
.teacher-agenda-notes { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.teacher-agenda-updates { padding:18px; margin:0 0 22px; border:2px solid var(--green); border-radius:14px; background:var(--soft); }
.teacher-update { padding:14px; margin:12px 0; border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow-wrap:anywhere; }
.teacher-update p { margin:8px 0; }
.teacher-update .actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
#homeTeacherAgendaReport { margin-top:24px; }
#homeTeacherAgendaForm { margin-top:18px; background:var(--soft); }
.teacher-class-lesson-list { display:grid; gap:14px; margin:16px 0; }
.teacher-class-lesson-list section { border-bottom:1px solid var(--line); padding-bottom:10px; }
.teacher-class-lesson-list h4 { margin:0 0 8px; }
.teacher-class-lesson-list p { display:flex; flex-wrap:wrap; gap:12px; margin:6px 0; }
#teacherAgendaEditor { margin:18px 0; }
#teacherAgendaEditorFields { border:0; padding:0; min-width:0; }
.teacher-agenda-item .btn { font-size:12px; padding:8px; }
.school-linked-teacher [data-membership-control],.school-linked-teacher #rosterManagementCard { display:none!important; }
.weekly-view-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 18px 0; }
.weekly-view-toolbar h3 { margin: 0; }
.weekly-view:fullscreen,
.weekly-view.weekly-expanded { width: 100vw; height: 100vh; height: 100dvh; max-width: none; padding: 20px; overflow: auto; background: var(--bg); color: var(--ink); box-sizing: border-box; }
.weekly-view.weekly-expanded { position: fixed; inset: 0; z-index: 10000; }
body.weekly-fullscreen { overflow: hidden; }
.weekly-view:fullscreen .weekly-view-toolbar,
.weekly-view.weekly-expanded .weekly-view-toolbar { position: sticky; top: -20px; z-index: 2; margin: -20px -20px 18px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.weekly-view:fullscreen .weekly-display th,
.weekly-view:fullscreen .weekly-display td,
.weekly-view.weekly-expanded .weekly-display th,
.weekly-view.weekly-expanded .weekly-display td { padding: 8px; }
@media (max-width: 760px) {
  .weekly-reservation { grid-template-columns: 1fr 1fr; }
  .weekly-issue { align-items: flex-start; flex-direction: column; }
  .weekly-config { padding: 16px; }
}
@media (max-width: 650px) {
  body.mativia-home .main { padding-top: 18px; }
  body.mativia-home .mativia-student-card { padding: 20px; }
  .mativia-student-card .formrow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mativia-student-card .student-ra-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .student-profile-head { align-items: flex-start; flex-direction: column; }
  .student-avatar-dialog { padding: 20px; }
  .student-avatar-editor { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .student-avatar-preview { flex-direction: row; justify-content: center; gap: 20px; }
  .student-avatar-preview img { width: 100px; height: 100px; }
  .student-avatar-styles .avatar-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* One discipline, one color across the school. The stripe retains the chosen color in both themes. */
.subject-colored { background:var(--subject-soft,#eaf4ff) !important; color:var(--ink) !important; border-left:5px solid var(--subject-color,#2563eb) !important; }
body.dark .subject-colored { background:var(--subject-dark,#253d51) !important; color:#fff !important; box-shadow:none !important; }
body.dark .weekly-display td.subject-colored,body.dark #homeWeeklyLegend .subject-colored { background-image:none !important; }
.subject-legend { display:inline-flex; padding:8px 12px; border-radius:8px; }
.weekly-neutral { background:var(--soft) !important; color:var(--ink) !important; }
#homeSubjectColor { width:100%; min-height:44px; padding:5px; cursor:pointer; }
/* Home shortcuts share the same visual role. */
#managementHome > .actions > .btn { background:var(--primary-background); border:1px solid var(--primary-background); color:#fff; }
#managementHome > .actions > .btn:not(:disabled):hover { filter:brightness(1.12); background:var(--primary-background); }

.teacher-class-lesson-list .subject-colored { padding:10px 14px; border-radius:8px; }

/* Shared time axis keeps the teacher's week aligned with the school timetable. */
.teacher-subject-legend { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0; }
.teacher-agenda-grid.teacher-week-scroll { display:block; overflow:auto; max-height:72vh; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.teacher-week-table { table-layout:fixed; min-width:930px; width:100%; border-collapse:separate; border-spacing:0; }
.teacher-week-caption { padding:12px; text-align:left; font-weight:700; background:var(--soft); color:var(--ink); }
.teacher-week-table th,.teacher-week-table td { border:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.teacher-week-table thead th { position:sticky; top:0; z-index:2; background:#517da8; color:#fff; vertical-align:middle; padding:12px 8px; }
.teacher-week-table thead th:first-child { width:92px; left:0; z-index:3; }
.teacher-week-table th small { display:block; margin-top:4px; font-weight:400; }
.teacher-week-table tbody tr { height:72px; }
.teacher-week-table .teacher-time-axis { position:sticky; left:0; z-index:1; background:var(--soft); color:var(--ink); font-variant-numeric:tabular-nums; vertical-align:top; padding:12px 8px; }
.teacher-week-table td.teacher-agenda-slot { padding:0; vertical-align:top; text-align:left; background:var(--surface); }
.teacher-week-table .teacher-agenda-item { margin:0; padding:12px; border:0; border-left:4px solid var(--line); border-radius:0; min-height:100%; box-sizing:border-box; gap:6px; overflow-wrap:anywhere; }
.teacher-week-table .teacher-agenda-item + .teacher-agenda-item { border-top:1px solid var(--line); }
.teacher-week-table td.teacher-agenda-empty { background:var(--soft); color:var(--muted); vertical-align:middle; }
.teacher-block-time { white-space:nowrap; font-variant-numeric:tabular-nums; }
.teacher-block-title { font-weight:700; }
.teacher-week-table .agenda-tutoria { border-left-color:#8c57bd; background:var(--soft); }
.teacher-week-table :is(.agenda-break,.agenda-coffee,.agenda-lunch,.agenda-reservation) { border-left-color:#b58533; background:var(--soft); }
.teacher-week-table .agenda-HE { border-left-color:#919eab; }
.teacher-week-table .agenda-planning { border-left-color:#26927d; background:var(--soft); }
.teacher-week-table .agenda-meeting { border-left-color:#3979b8; background:var(--soft); }
.teacher-class-lesson-list p { display:grid; grid-template-columns:120px minmax(0,1fr); align-items:start; gap:14px; }
.teacher-class-lesson-list p b { white-space:nowrap; font-variant-numeric:tabular-nums; }
.teacher-class-lesson-list p span { overflow-wrap:anywhere; }
@media(max-width:600px) { .teacher-class-lesson-list p { grid-template-columns:105px minmax(0,1fr); gap:10px; } .teacher-week-table { min-width:880px; } }

.teacher-week-table td.subject-colored { border-left:0 !important; }

/* Movement feedback stays in the affected timetable cell. */
.weekly-cell-feedback:empty { display:none; }
.weekly-inline-move { margin:8px; padding:12px; border:2px solid #3979b8; border-radius:10px; background:var(--surface); color:var(--ink); text-align:left; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.weekly-inline-move p { margin:8px 0; }
.weekly-inline-error { border-color:#c4493c; }
.weekly-inline-success { border-color:#26825b; }
.weekly-inline-actions,.weekly-inline-options { display:flex; flex-direction:column; gap:8px; margin-top:10px; }
.weekly-move-option{padding:10px;border:1px solid var(--line,#cbd9e8);border-radius:9px;background:var(--surface,#fff)}
.weekly-move-option .btn{width:100%;margin-top:6px;white-space:normal}
body[data-guided-navigation="off"] #teacherGuideWidget{display:none!important}
#guideToggle{white-space:normal;font-size:12px}
.weekly-inline-move .btn { width:100%; min-height:40px; font-size:12px; padding:8px; cursor:pointer; }
.weekly-inline-preview { min-width:170px; }
body.dark .weekly-inline-move { background:var(--surface); color:#fff; }

/* The public entry puts the teaching community and preparation beside student access. */
.mativia-community-hero { align-items:start; padding:20px 0 42px; gap:48px; }
.mativia-community-hero .mativia-home-copy { padding-top:22px; }
body.mativia-home .mativia-community-hero .mativia-student-card { width:100%; max-width:none; margin:0; }
.mativia-community-hero .student-access-heading h2 { margin:7px 0; font-size:26px; }
.mativia-community-note { padding:18px 20px; margin-top:28px; border-left:4px solid var(--mativia-green); border-radius:0 14px 14px 0; background:var(--surface); }
.mativia-community-note strong { font-size:14px; }
.mativia-community-note p { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.7; }
.mativia-preparation { padding:30px; border:1px solid var(--line); border-radius:24px; background:var(--surface); scroll-margin-top:24px; }
.mativia-preparation > .muted { max-width:880px; line-height:1.75; font-size:14px; }
.mativia-preparation-label { display:inline-block; padding:8px 12px; border-radius:12px; background:var(--soft); color:var(--muted); font-size:12px; }
.mativia-resource-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:24px 0; }
.mativia-resource { display:flex; flex-direction:column; align-items:flex-start; gap:12px; padding:22px; border:1px solid var(--line); border-top:4px solid var(--mativia-blue); border-radius:16px; background:var(--bg); min-width:0; }
.mativia-resource:nth-child(2) { border-top-color:var(--mativia-green); }
.mativia-resource:nth-child(3) { border-top-color:var(--mativia-yellow); }
.mativia-resource-type { color:var(--muted); font-size:11px; line-height:1.6; }
.mativia-resource h3 { margin:0; font-size:21px; }
.mativia-resource p { margin:0 0 6px; color:var(--muted); font-size:13px; line-height:1.75; flex:1; }
.mativia-resource a { line-height:1.7; overflow-wrap:anywhere; }
.mativia-material-guide { padding:20px; background:var(--soft); border-radius:14px; }
.mativia-material-guide h3 { margin:0 0 10px; font-size:15px; }
.mativia-material-guide p { margin:8px 0 0; color:var(--muted); font-size:13px; line-height:1.75; }
.mativia-independence { color:var(--muted); font-size:12px; margin:20px 0 0; line-height:1.7; }
body.mativia-home .mativia-public-entry > .mativia-public-footer { max-width:none; margin-top:24px; }
.mativia-access-story > .mativia-text-link { display:inline-block; margin-bottom:24px; line-height:1.7; }
#studentAccess { scroll-margin-top:24px; }
@media(max-width:980px) { .mativia-community-hero { gap:28px; } .mativia-resource-grid { grid-template-columns:minmax(0,1fr); } }
@media(max-width:760px) { .mativia-community-hero { padding-top:0; } .mativia-community-hero .mativia-home-copy { padding-top:0; } .mativia-preparation { padding:22px; } }

.mativia-home-mission { margin-bottom:24px; }
.mativia-home-mission h2 { margin:0 0 10px; }
.mativia-mission p,
.mativia-story-mission p { text-align:justify; hyphens:auto; }
