:root {
  --school-color: #6554c0;
  --purple: var(--school-color);
  --surface: #ffffff;
  --surface-alt: #f6f5fb;
  --field-border: #dedfe9;
  --purple-dark: #483697;
  --lavender: #efecfb;
  --ink: #262c43;
  --muted: #7a8094;
  --line: #eceef5;
  --bg: #f7f8fc;
  --green: #257965;
  --amber: #946119;
  --radius: 18px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: var(--purple);
  text-decoration: none;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #c4b5fd;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 720;
  margin-bottom: 8px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 16px;
}
p {
  line-height: 1.6;
}
small,
.muted {
  color: var(--muted);
}
small {
  font-size: 12px;
}
svg.icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.initial-loading {
  height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 15px;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--purple);
  color: white;
  font-size: 37px;
  font-weight: 700;
  line-height: 1;
  position: relative;
  padding-bottom: 5px;
}
.brand-mark:after {
  content: "";
  position: absolute;
  right: 6px;
  top: 7px;
  width: 7px;
  height: 7px;
  background: #f3cd82;
  border-radius: 50%;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand-caption {
  font-size: 10px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 242px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar .brand {
  margin-left: 10px;
}
.sidebar .brand-caption {
  margin-left: 10px;
}
.nav-label {
  font-size: 10px;
  color: #9599ad;
  letter-spacing: 1.7px;
  margin: 44px 12px 15px;
  font-weight: 650;
}
.nav {
  display: grid;
  gap: 7px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #737a90;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 570;
}
.nav a:hover {
  background: #f8f7fc;
}
.nav a.active {
  background: var(--lavender);
  color: var(--purple);
}
.nav .nav-count {
  margin-left: auto;
  background: var(--purple);
  color: white;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 10px;
}
.sidebar-bottom {
  margin-top: auto;
}
.school-mini {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding: 20px 8px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.school-mini .icon {
  color: var(--purple);
  width: 28px;
  height: 28px;
}
.school-mini strong {
  font-size: 11px;
  display: block;
}
.school-mini small {
  font-size: 10px;
}
.workspace {
  margin-left: 242px;
}
.topbar {
  height: 92px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  gap: 16px;
}
.topbar-context {
  font-size: 13px;
  color: var(--muted);
}
.topbar-context strong {
  color: var(--ink);
  display: block;
  margin-bottom: 3px;
  font-size: 14px;
}
.topbar-right {
  display: flex;
  gap: 21px;
  align-items: center;
}
.student-switch {
  display: flex;
  align-items: center;
  gap: 11px;
  background: #faf9fe;
  border: 1px solid #e7e2f6;
  border-radius: 12px;
  padding: 9px 12px;
  max-width: 340px;
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: #e9e3fb;
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.student-switch label {
  display: block;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.student-switch select {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  max-width: 245px;
  cursor: pointer;
  padding: 0 18px 0 0;
}
.student-switch strong {
  font-size: 12px;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-menu strong {
  display: block;
  font-size: 12px;
}
.user-menu small {
  font-size: 10px;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  display: inline-flex;
}
.menu-button {
  display: none;
}
.content {
  max-width: 1370px;
  margin: auto;
  padding: 34px 42px 40px;
}
.eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--purple);
  font-weight: 650;
  margin-bottom: 12px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 26px;
}
.page-heading p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0;
}
.date-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
  white-space: nowrap;
}
.hero {
  background: #efedfa;
  border: 1px solid #e6e1f6;
  border-radius: var(--radius);
  padding: 31px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 178px;
}
.hero h2 {
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -1px;
  max-width: 420px;
  margin: 9px 0;
}
.hero p {
  font-size: 12px;
  color: #7a719a;
  max-width: 420px;
  margin: 0;
}
.hero .eyebrow {
  font-size: 9px;
}
.hero-art {
  position: relative;
  min-width: 190px;
  height: 120px;
  margin-right: 32px;
}
.art-book {
  width: 108px;
  height: 92px;
  background: var(--surface);
  border: 3px solid #9282d3;
  border-radius: 5px 22px 6px 6px;
  transform: rotate(-13deg);
  position: absolute;
  left: 40px;
  top: 20px;
  box-shadow: 10px 9px 0 #cfc5ee;
}
.art-book:before {
  content: "";
  position: absolute;
  height: 76px;
  width: 3px;
  left: 44px;
  top: 5px;
  background: #d4cbee;
}
.art-book:after {
  content: "✦";
  position: absolute;
  color: #deac54;
  font-size: 44px;
  left: 53px;
  top: 10px;
}
.art-leaf {
  width: 25px;
  height: 46px;
  border-radius: 100% 0 100% 0;
  background: #a0b9a1;
  position: absolute;
  left: 13px;
  top: 55px;
  transform: rotate(-25deg);
}
.art-star {
  position: absolute;
  color: #baa4df;
  font-size: 23px;
  right: -8px;
  top: 5px;
}
.art-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #efc574;
  border-radius: 50%;
  left: 14px;
  top: 7px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin: 23px 0 30px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  background: #f0edfb;
  color: var(--purple);
}
.stat:nth-child(2) .stat-icon {
  background: #eaf5ef;
  color: #5f927a;
}
.stat:nth-child(3) .stat-icon {
  background: #fff4e2;
  color: #c29956;
}
.stat-number {
  font-size: 23px;
  line-height: 1.1;
  font-weight: 700;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 25px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
}
.section-head a {
  font-size: 11px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.notice-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--lavender);
  color: var(--purple);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
}
.pill.green {
  background: #e8f4ee;
  color: var(--green);
}
.pill.amber {
  background: #fff2dc;
  color: var(--amber);
}
.pill.red {
  background: #fff0ed;
  color: #bc6551;
}
.pill.neutral {
  background: #f1f3f7;
  color: #72788b;
}
.notice-title {
  font-size: 16px;
  margin-bottom: 10px;
  line-height: 1.5;
}
.notice-body {
  font-size: 12px;
  color: #7b8091;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notice-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f2f7;
  padding-top: 15px;
  margin-top: 19px;
  flex-wrap: wrap;
}
.author {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}
.author .avatar {
  width: 27px;
  height: 27px;
  font-size: 9px;
  background: #f0f2f6;
  color: #8a91a6;
  border-radius: 50%;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--purple);
  border: 1px solid var(--purple);
  color: white;
  padding: 11px 17px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.button:hover {
  background: var(--purple-dark);
}
.button.secondary {
  background: var(--surface);
  color: var(--purple);
  border-color: #ded8ef;
}
.button.secondary:hover {
  background: var(--lavender);
}
.button.subtle {
  background: #f6f5fb;
  color: var(--purple);
  border-color: transparent;
}
.button.danger {
  background: #fff0ed;
  border-color: #fadbd3;
  color: #a74f40;
}
.button.small {
  padding: 7px 10px;
  font-size: 10px;
}
.button .icon {
  width: 16px;
  height: 16px;
}
.button-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.event-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.event-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.event-date {
  width: 43px;
  min-width: 43px;
  border-radius: 10px;
  background: #f4f2fc;
  text-align: center;
  padding: 7px 4px;
  color: var(--purple);
}
.event-date strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}
.event-date small {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--purple);
}
.event-row h3 {
  font-size: 12px;
  line-height: 1.5;
  margin: 0 0 4px;
}
.event-row p {
  font-size: 10px;
  margin-bottom: 3px;
  color: var(--muted);
}
.mini-calendar .calendar-grid {
  font-size: 10px;
  gap: 5px;
}
.calendar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.calendar-title strong {
  text-transform: capitalize;
  font-size: 13px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.weekday {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  padding: 5px;
}
.calendar-day {
  padding: 8px 2px;
  text-align: center;
  position: relative;
  min-width: 0;
  border-radius: 7px;
  font-size: 11px;
}
.calendar-day.outside {
  color: #ccd0dc;
}
.calendar-day.today {
  background: var(--purple);
  color: white;
}
.calendar-day.has-events:after {
  content: "";
  display: block;
  position: absolute;
  bottom: 3px;
  left: calc(50% - 2px);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b0a0de;
}
.calendar-day.today:after {
  background: #f4cd7f;
}
.full-calendar .calendar-day {
  text-align: left;
  min-height: 94px;
  border: 1px solid var(--line);
  padding: 8px;
}
.day-event {
  display: block;
  background: #f0edfb;
  color: var(--purple);
  margin: 4px 0;
  padding: 4px;
  font-size: 9px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.full-calendar .today .day-event {
  background: #8071ce;
  color: white;
}
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.album-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
}
.album-cover {
  height: 185px;
  width: 100%;
  object-fit: cover;
  background: #e9e5f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a292cf;
}
.album-cover .icon {
  width: 60px;
  height: 60px;
  stroke-width: 1;
}
.album-details {
  padding: 20px;
}
.album-details h3 {
  font-size: 14px;
  margin-bottom: 9px;
}
.album-details small {
  font-size: 10px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.photo-grid img {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
  border-radius: 10px;
}
.photo-grid figure {
  margin: 0;
}
.photo-grid figcaption {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
}
.empty {
  text-align: center;
  padding: 35px 20px;
  color: var(--muted);
  font-size: 12px;
}
.empty .icon {
  width: 33px;
  height: 33px;
  margin-bottom: 12px;
  color: #b2a9cc;
}
.empty strong {
  display: block;
  color: #73798d;
  margin-bottom: 7px;
}
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filter {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 13px;
  font-size: 11px;
}
.filter.active {
  background: var(--lavender);
  border-color: #e2dcf4;
  color: var(--purple);
}
.footer-note {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  font-size: 10px;
  color: #a0a5b5;
  margin-top: 25px;
}
.footer-note .icon {
  width: 12px;
  height: 12px;
}
.environment {
  background: #fff5de;
  border-bottom: 1px solid #f0e0bc;
  color: #90713c;
  text-align: center;
  padding: 5px;
  font-size: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid .wide {
  grid-column: 1/-1;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: #60667c;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dedfe9;
  border-radius: 9px;
  padding: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}
.field textarea {
  resize: vertical;
  min-height: 100px;
}
.field small {
  line-height: 1.5;
}
.checkbox {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.6;
  margin: 15px 0;
}
.checkbox input {
  margin-top: 4px;
  flex-shrink: 0;
}
.alert {
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 17px;
  background: #fff5df;
  color: #8c6c32;
}
.alert.info {
  background: var(--lavender);
  color: #75649f;
}
.alert.error {
  background: #fff0ed;
  color: #a75243;
}
.table-wrap {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table td strong {
  font-size: 12px;
}
.data-table td small {
  display: block;
  margin-top: 4px;
}
.reply {
  margin: 15px 0 0;
  padding: 15px;
  background: #f8f7fc;
  border-radius: 10px;
  font-size: 12px;
  white-space: pre-wrap;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.help-grid .card {
  margin: 0;
}
.help-grid p,
.help-grid li {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}
.help-grid ol {
  padding-left: 19px;
}
dialog {
  border: 1px solid #e9e5f3;
  border-radius: 20px;
  padding: 28px;
  width: calc(100% - 32px);
  max-width: 620px;
  max-height: 88vh;
  color: var(--ink);
  box-shadow: 0 25px 100px #29204133;
}
dialog::backdrop {
  background: #26233c77;
  backdrop-filter: blur(3px);
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.dialog-header h2 {
  margin: 0;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #302b45;
  color: white;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 100;
  transition: transform 0.2s;
  max-width: 90vw;
  box-shadow: 0 6px 25px #29204122;
}
#toast.visible {
  transform: translateX(-50%) translateY(0);
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 20px;
  z-index: 200;
  background: var(--purple);
  color: white;
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--surface);
}
.auth-story {
  background: #efecf9;
  padding: 54px 70px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-story h1 {
  font-size: 48px;
  line-height: 1.15;
  max-width: 450px;
  letter-spacing: -2px;
  margin-top: 85px;
}
.auth-story p {
  color: #8b80a5;
  font-size: 15px;
  max-width: 380px;
}
.auth-story .hero-art {
  transform: scale(1.9);
  margin: 85px auto 65px;
  width: 190px;
  flex-shrink: 0;
}
.auth-story .story-bottom {
  font-size: 11px;
  margin-top: auto;
  color: #998eaf;
}
.auth-content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form {
  width: 100%;
  max-width: 350px;
}
.auth-form h2 {
  font-size: 26px;
  margin-bottom: 10px;
}
.auth-form > p {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 27px;
}
.auth-form .button {
  width: 100%;
  padding: 13px;
}
.auth-form .brand {
  display: none;
  margin-bottom: 40px;
}
.auth-footnote {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 23px;
  line-height: 1.8;
}
.error-page {
  text-align: center;
  padding: 80px 20px;
}
.logout-label {
  display: none;
}
.mobile-overlay {
  display: none;
}
.school-picker {
  max-width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
}
.loading {
  padding: 65px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e8e3f5;
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 13px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@media (min-width: 1600px) {
  .content {
    padding-top: 45px;
  }
  .hero {
    min-height: 200px;
  }
  .hero-art {
    margin-right: 80px;
  }
}
@media (max-width: 1120px) {
  .sidebar {
    width: 205px;
    padding: 28px 15px;
  }
  .workspace {
    margin-left: 205px;
  }
  .topbar {
    padding: 0 25px;
  }
  .content {
    padding: 28px 25px;
  }
  .user-menu .user-info {
    display: none;
  }
  .hero-art {
    margin-right: 0;
    min-width: 160px;
  }
  .columns {
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 1fr);
  }
  .album-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat {
    padding: 17px 14px;
  }
  .student-switch {
    max-width: 290px;
  }
}
@media (max-width: 850px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: #24203666;
    z-index: 19;
  }
  .workspace {
    margin-left: 0;
  }
  .menu-button {
    display: inline-flex;
  }
  .topbar {
    height: auto;
    min-height: 80px;
    flex-wrap: wrap;
    padding: 16px 22px;
  }
  .topbar-context {
    display: none;
  }
  .topbar-right {
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
  }
  .student-switch {
    max-width: 100%;
  }
  .student-switch select {
    max-width: 210px;
  }
  .content {
    padding: 27px 22px;
  }
  .columns {
    grid-template-columns: 1fr 300px;
    gap: 18px;
  }
  .hero h2 {
    font-size: 25px;
  }
  .stats {
    gap: 10px;
  }
  .auth-story {
    padding: 45px;
  }
  .auth-story h1 {
    font-size: 38px;
  }
  .full-calendar .calendar-day {
    min-height: 70px;
  }
  .user-menu > .avatar {
    display: none;
  }
  .date-label {
    font-size: 10px;
  }
  .hero {
    padding: 26px;
  }
}
@media (max-width: 680px) {
  h1 {
    font-size: 25px;
  }
  .content {
    padding: 26px 17px;
  }
  .topbar {
    padding: 13px 13px;
  }
  .student-switch {
    padding: 7px 9px;
    gap: 7px;
  }
  .student-switch .avatar {
    width: 30px;
    height: 30px;
    font-size: 10px;
  }
  .student-switch select {
    font-size: 11px;
    max-width: 215px;
  }
  .student-switch label {
    font-size: 8px;
  }
  .topbar-right {
    gap: 2px;
  }
  .icon-button {
    padding: 7px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .hero {
    min-height: 165px;
    padding: 25px;
  }
  .hero h2 {
    font-size: 24px;
    max-width: 240px;
  }
  .hero p {
    font-size: 11px;
    max-width: 230px;
  }
  .hero-art {
    min-width: 95px;
    transform: scale(0.7);
    transform-origin: center right;
    margin-left: -30px;
  }
  .stats {
    gap: 8px;
    margin: 17px 0 25px;
  }
  .stat {
    padding: 14px 9px;
    display: block;
    text-align: center;
  }
  .stat-icon {
    width: 30px;
    height: 30px;
    margin: auto auto 8px;
    border-radius: 9px;
  }
  .stat-icon .icon {
    width: 17px;
    height: 17px;
  }
  .stat-number {
    font-size: 21px;
  }
  .stat-label {
    font-size: 9px;
    line-height: 1.4;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 20px;
  }
  .date-label {
    display: none;
  }
  .page-heading p {
    font-size: 11px;
  }
  .card {
    padding: 20px;
  }
  .notice-title {
    font-size: 15px;
  }
  .notice-footer {
    gap: 15px;
  }
  .notice-body {
    font-size: 12px;
  }
  .notice-footer .button-row {
    width: 100%;
  }
  .notice-footer .button-row .button {
    flex: 1;
  }
  .album-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .album-cover {
    height: 135px;
  }
  .album-details {
    padding: 14px;
  }
  .album-details h3 {
    font-size: 12px;
  }
  .photo-grid {
    grid-template-columns: 1fr;
  }
  .form-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .wide {
    grid-column: auto;
  }
  .auth-page {
    grid-template-columns: 1fr;
  }
  .auth-story {
    display: none;
  }
  .auth-content {
    padding: 35px 24px;
  }
  .auth-form .brand {
    display: flex;
  }
  .full-calendar .calendar-grid {
    gap: 3px;
  }
  .full-calendar .calendar-day {
    min-height: 65px;
    font-size: 10px;
    padding: 5px 2px;
  }
  .day-event {
    font-size: 8px;
    padding: 2px;
  }
  .calendar-title {
    flex-wrap: wrap;
    gap: 10px;
  }
  .school-picker {
    max-width: 145px;
  }
  .footer-note {
    font-size: 9px;
  }
  .logout-label {
    display: inline;
  }
  .user-menu {
    gap: 0;
  }
  .button {
    padding: 10px 13px;
  }
  .dialog-header h2 {
    font-size: 18px;
  }
  dialog {
    padding: 22px;
  }
}
.school-logo-preview {
  width: 140px;
  height: 140px;
  object-fit: contain;
  display: block;
  margin: 20px auto 30px;
}
.school-mini-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.category-pill {
  gap: 6px;
  background: #f6f1e8;
  color: #685642;
}
.push-toggle {
  position: relative;
}
.push-toggle.push-active::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  position: absolute;
  right: 7px;
  top: 7px;
  border: 2px solid white;
}
.push-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.push-heading h2 {
  margin-bottom: 8px;
}
.push-heading p {
  color: var(--muted);
  margin-bottom: 16px;
}
.push-privacy {
  display: block;
  margin-top: 14px;
  line-height: 1.6;
}
.album-card {
  border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
}
.album-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px #262c4312;
}
.album-mosaic {
  position: relative;
  height: 240px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: #eae6f4;
  overflow: hidden;
}
.mosaic-1 .album-preview {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}
.mosaic-2 .album-preview {
  grid-row: 1 / -1;
}
.mosaic-3 .album-preview:first-child {
  grid-row: 1 / -1;
}
.album-preview,
.album-photo-image {
  display: block;
  min-height: 0;
  overflow: hidden;
  background: #eae6f4;
}
.album-preview img,
.album-photo-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity .2s, transform .3s;
}
.album-card:hover .album-preview img {
  transform: scale(1.025);
}
[data-image-loading] {
  background-image: linear-gradient(110deg, #eae6f4 20%, #f8f6fc 45%, #eae6f4 70%);
  background-size: 220% 100%;
  animation: image-loading 1.6s ease infinite;
}
@keyframes image-loading {
  to { background-position: -220% 0; }
}
.image-unavailable {
  background: #eeeaf5;
}
.album-placeholder {
  grid-area: 1 / 1 / -1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  color: #8e80ab;
  background: radial-gradient(ellipse at top right, #ede5fc, #f4f0e7);
  font-size: 12px;
}
.album-placeholder .icon { width: 45px; height: 45px; }
.album-count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 100px;
  background: #242036cc;
  color: white;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.album-count .icon { width: 15px; height: 15px; }
.album-details h3 { font-size: 19px; line-height: 1.35; margin: 13px 0 10px; }
.album-event-date,
.album-intro p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.album-event-date .icon,
.album-intro .icon { width: 16px; height: 16px; }
.album-event-date { color: var(--purple); font-weight: 600; background: #f4f1fb; padding: 8px 10px; border-radius: 9px; width: fit-content; }
.album-open { color: var(--purple); font-size: 12px; font-weight: 650; }
dialog.album-dialog { width: min(1000px, calc(100vw - 30px)); max-width: 1000px; }
.album-intro { padding-bottom: 10px; }
.album-intro p { margin-top: 12px; }
.album-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.album-photo { padding: 0; border: 0; border-radius: 12px; background: #f8f7fb; overflow: hidden; text-align: left; color: var(--ink); }
.album-photo-image { aspect-ratio: 4 / 3; }
.album-photo-caption { display: block; font-size: 12px; padding: 12px 13px; overflow-wrap: anywhere; }
.album-upload { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.album-upload small { line-height: 1.6; }
.album-upload progress { width: 100%; accent-color: var(--purple); }
.upload-status { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
dialog.photo-viewer { width: min(1400px, calc(100vw - 24px)); max-width: 1400px; max-height: calc(100dvh - 24px); padding: 0; color: white; background: #181a23; border-radius: 15px; }
.photo-viewer::backdrop { background: #10121aee; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 18px; font-size: 13px; }
.viewer-top .icon-button { color: white; }
.viewer-stage { position: relative; display: flex; align-items: center; justify-content: center; background-color: #11131a; min-height: 240px; }
.viewer-stage img { display: block; width: 100%; height: min(72dvh, 1000px); object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); border: 1px solid #ffffff35; background: #181a23b3; color: white; border-radius: 100%; font-size: 32px; width: 44px; height: 44px; }
.viewer-nav.previous { left: 12px; }
.viewer-nav.next { right: 12px; }
.viewer-nav[hidden] { display: none; }
.viewer-footer { padding: 17px 20px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.viewer-footer strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.viewer-footer span { display: block; font-size: 11px; color: #b1b5c7; margin-top: 5px; }
@media (max-width: 680px) {
  .album-mosaic { height: 230px; }
  .album-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .album-photo-caption { font-size: 11px; padding: 9px; }
  .album-details h3 { font-size: 19px; }
  .viewer-stage img { height: 65dvh; }
  .viewer-footer { flex-wrap: wrap; padding: 14px; }
  .viewer-nav { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-image-loading] { animation: none; }
  .album-card, .album-preview img { transition: none; }
}
.install-steps {
  padding-left: 22px;
  line-height: 1.65;
  color: var(--muted);
}
.install-steps li {
  padding-bottom: 8px;
}
#install-dialog section + section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.content,
.auth-content {
  padding-bottom: 86px;
}

/* Tema persistente: los colores de institución conservan contraste en ambas apariencias. */
:root[data-theme="dark"] {
  --purple: var(--accent-dark, color-mix(in srgb, var(--school-color) 42%, #ffffff));
  --purple-dark: var(--accent-dark-hover, color-mix(in srgb, var(--school-color) 42%, #ffffff));
  --lavender: #303047;
  --ink: #eceef7;
  --muted: #b4b9cc;
  --line: #363c50;
  --bg: #151823;
  --surface: #202432;
  --surface-alt: #292e40;
  --field-border: #4e566d;
  --green: #8dd8b6;
  --amber: #edc37d;
}
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .auth-story { background: #29283e; border-color: var(--line); }
:root[data-theme="dark"] :is(.hero p, .auth-story p, .story-bottom, .field label, .notice-meta, .notice-body, .calendar-day.other, .data-table th, .nav-label, .brand-caption, .album-card p, .album-event-date, .photo-empty) { color: var(--muted); }
:root[data-theme="dark"] :is(.button:not(.secondary):not(.subtle):not(.danger), .nav a.active::before, .skip-link) { color: #181b29; }
:root[data-theme="dark"] :is(.button.secondary, .filter, .calendar-day, .student-switch, .school-picker, .field input, .field select, .field textarea) { background: var(--surface); border-color: var(--field-border); color: var(--ink); }
:root[data-theme="dark"] :is(.button.subtle, .event-date, .author .avatar, .album-event-date, .album-photo, .day-event, .nav a:hover, .student-switch:hover, .data-table tbody tr:hover) { background: var(--surface-alt); }
:root[data-theme="dark"] :is(.nav a.active, .filter.active, .calendar-day.today, .pill) { background: var(--lavender); color: var(--purple); }
:root[data-theme="dark"] :is(.alert, .pill.amber, .environment) { background: #403624; color: #f1d59e; }
:root[data-theme="dark"] :is(.alert.info, .calendar-event, .inquiry-message, .message-bubble) { background: #30334b; color: #d1d5f6; }
:root[data-theme="dark"] :is(.alert.error, .button.danger, .pill.red) { background: #4d2f35; border-color: #73424d; color: #ffbdad; }
:root[data-theme="dark"] .pill.green { background: #23483e; color: #a0e2bf; }
:root[data-theme="dark"] .pill.gray { background: #343b4e; color: #d0d4e2; }
:root[data-theme="dark"] :is(.stat-icon, .stat:nth-child(2) .stat-icon, .stat:nth-child(3) .stat-icon) { background: var(--surface-alt); color: var(--purple); }
:root[data-theme="dark"] .album-preview:has(.photo-placeholder),
:root[data-theme="dark"] .photo-placeholder { background: radial-gradient(ellipse at top right, #34304b, #343126); color: #cec1ef; }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #a8afc5; }
:root[data-theme="dark"] .field :disabled { opacity: .8; background: #2a2e3e; }
:root[data-theme="dark"] .school-mini { background: var(--surface-alt); }
.auth-theme { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.theme-toggle { flex-shrink: 0; }
.appearance-panel .field { max-width: 360px; margin-bottom: 0; }
#native-install[hidden], .mobile-nav[hidden] { display: none; }
#install-dialog .button-row { margin-top: 22px; }
#install-dialog { max-height: calc(100dvh - 36px); overflow-y: auto; }
.mobile-nav { display: none; }
@media (max-width: 850px) {
  .mobile-layout .workspace { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .mobile-layout .content { padding-bottom: 22px; }
  .mobile-layout .mobile-nav {
    position: fixed;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 25;
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    min-height: calc(68px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px #0000000d;
  }
  .mobile-nav :is(a, button) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 0; border-radius: 10px; background: transparent; padding: 5px 1px; color: var(--muted); font-size: 10px; font-weight: 600; min-height: 48px; }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .mobile-nav :is(a, button).active { color: var(--purple); background: var(--lavender); }
  .mobile-layout.editing-field .mobile-nav { display: none; }
  .mobile-layout #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
  .mobile-layout .sidebar { z-index: 45; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .mobile-layout .mobile-overlay { z-index: 40; }
  .mobile-layout .topbar { padding-top: max(14px, env(safe-area-inset-top)); }
  .topbar-right { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .mobile-nav { scroll-behavior: auto; } }
/* Controles y estados secundarios en tema oscuro. */
:root[data-theme="dark"] dialog { background: var(--surface); border-color: var(--line); }
:root[data-theme="dark"] :is(.nav a:not(.active), .empty strong) { color: var(--muted); }
:root[data-theme="dark"] .avatar { background: var(--lavender); }
:root[data-theme="dark"] .reply { background: var(--surface-alt); }
:root[data-theme="dark"] .calendar-day.outside { color: #818ba7; }
:root[data-theme="dark"] .full-calendar .today .day-event { background: #45405d; color: #f0eaff; }
:root[data-theme="dark"] :is(.album-cover, .album-mosaic, .album-preview, .album-photo-image, .image-unavailable) { background: var(--surface-alt); color: var(--purple); }
:root[data-theme="dark"] .album-placeholder { background: radial-gradient(ellipse at top right, #34304b, #343126); color: #cec1ef; }
:root[data-theme="dark"] [data-image-loading] { background-image: linear-gradient(110deg, #2c3043 20%, #3c4058 45%, #2c3043 70%); }
:root[data-theme="dark"] .push-toggle.push-active::after { border-color: var(--surface); }
@media (max-width: 680px) {
  .topbar { align-items: flex-start; gap: 8px; }
  .topbar-right { flex-wrap: wrap; min-width: 0; gap: 6px; }
  .student-switch { order: -1; flex: 1 1 100%; max-width: 100%; min-width: 0; }
  .student-switch > div { min-width: 0; flex: 1; }
  .student-switch select { max-width: 100%; width: 100%; }
  .user-info { display: none; }
  .sidebar { overflow-y: auto; }
}

/* Escala compartida de lectura, controles y estados. */
:root {
  --purple: var(--accent-light, var(--school-color));
  --muted: #626b82;
  --focus: #6751b9;
  --control-radius: 10px;
  --control-height: 42px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] {
  --purple: var(--accent-dark, color-mix(in srgb, var(--school-color) 42%, #ffffff));
  --muted: #b4b9cc;
  --focus: #c6b8ff;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
:where(button, a, input, select, textarea) { scroll-margin-block: 24px; }
:where(input, select, textarea, progress) { accent-color: var(--purple); }
:where(h1, h2, h3, .notice-body, .page-heading p, .student-switch strong, .album-details) { overflow-wrap: anywhere; }
:where(.workspace, .content, .columns > *, .stats > *, .card, .auth-form, .form-grid > *, .topbar-right, .album-grid > *) { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.icon-button { min-width: var(--control-height); min-height: var(--control-height); align-items: center; justify-content: center; border-radius: var(--control-radius); }
.icon-button:hover { color: var(--purple); background: var(--lavender); }
.button { min-height: var(--control-height); font-size: 13px; border-radius: var(--control-radius); }
.button.small { min-height: 36px; font-size: 12px; }
.button.subtle { color: var(--purple); }
.button:disabled { opacity: .7; cursor: not-allowed; }
[aria-busy="true"] .button:disabled { cursor: wait; }
.button-spinner { width: 15px; height: 15px; display: inline-block; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.nav a { font-size: 14px; min-height: 44px; }
.nav a:not(.active) { color: var(--muted); }
.sidebar { overflow-y: auto; overscroll-behavior: contain; }
.sidebar .sidebar-bottom { padding-top: 24px; }
.topbar { min-height: 92px; height: auto; padding-block: 16px; }
.student-switch select { min-height: 28px; }
.topbar-context { min-width: 0; }
.student-switch strong { line-height: 1.5; }
.page-heading { align-items: flex-start; }
.page-heading > :first-child { min-width: 0; }
.page-heading h1:focus { outline: 0; }
.page-heading p { font-size: 14px; line-height: 1.65; }
.page-heading .button { flex-shrink: 0; }
.stat-label { font-size: 12px; line-height: 1.5; }
.notice-meta { font-size: 12px; }
.pill { font-size: 11px; line-height: 1.45; max-width: 100%; overflow-wrap: anywhere; }
.notice-body, .help-grid p, .help-grid li { font-size: 14px; line-height: 1.75; }
.notice-footer { flex-wrap: wrap; }
.author { font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.filter { min-height: 40px; font-size: 13px; }
.section-head { flex-wrap: wrap; }
.section-head a { font-size: 13px; }
.field label { color: var(--ink); font-size: 13px; line-height: 1.5; }
.field :is(input, select, textarea) { font-size: 14px; min-height: var(--control-height); border-color: var(--field-border); border-radius: var(--control-radius); }
.field input[type="file"] { white-space: normal; overflow: hidden; padding: 9px; }
.field input[type="file"]::file-selector-button { font: inherit; border: 0; padding: 7px 10px; margin-right: 10px; border-radius: 6px; color: var(--purple); background: var(--lavender); cursor: pointer; }
.field small { font-size: 12px; line-height: 1.65; }
.checkbox { font-size: 13px; }
.checkbox input { width: 18px; height: 18px; }
:is(input, select, textarea)[aria-invalid="true"] { border-color: #b74343; outline-color: #b74343; }
.form-feedback { margin-bottom: 20px; font-size: 13px; }
.form-feedback:focus { outline: 2px solid currentColor; outline-offset: 3px; }
.table-wrap { max-width: 100%; border-radius: 10px; scrollbar-gutter: stable; overscroll-behavior-inline: contain; }
.data-table { font-size: 13px; }
.data-table th { font-size: 12px; }
.data-table td { overflow-wrap: anywhere; }
.data-table td small { font-size: 12px; }
.data-table td .button-row { min-width: 170px; }
.table-wrap:focus-visible { outline-offset: -3px; }
.alert { font-size: 13px; }
.empty { font-size: 13px; line-height: 1.7; }
.empty strong { font-size: 15px; color: var(--ink); }
.loading { font-size: 14px; padding: 64px 20px; }
.dialog-header { gap: 16px; align-items: flex-start; }
.dialog-header h2 { line-height: 1.4; margin-block: 6px 0; overflow-wrap: anywhere; }
.dialog-header .icon-button { flex-shrink: 0; margin-top: -2px; }
dialog { background: var(--surface); border-color: var(--line); padding: 28px; overscroll-behavior: contain; }
.dialog-header + p { line-height: 1.75; }
.auth-form > p { font-size: 14px; line-height: 1.75; }
.auth-footnote { font-size: 13px; }
.auth-form h2 { line-height: 1.3; }
.auth-footnote a { text-decoration: underline; text-underline-offset: 3px; }
.auth-story p, .hero p { color: var(--muted); }
.footer-note { font-size: 11px; color: var(--muted); line-height: 1.7; }
.viewer-top > span { overflow-wrap: anywhere; }
.viewer-footer { flex-wrap: wrap; }
:root[data-theme="dark"] .brand-mark { color: #181b29; }
:root[data-theme="dark"] .field label { color: var(--ink); }
:root[data-theme="dark"] :is(input, select, textarea)[aria-invalid="true"] { border-color: #ffb1a7; outline-color: #ffb1a7; }
@media (max-width: 1120px) and (min-width: 851px) {
  .topbar { gap: 12px; }
  .topbar-context { display: none; }
  .topbar-right { justify-content: flex-end; flex: 1; gap: 12px; }
  .student-switch { max-width: 320px; }
  .stat { gap: 10px; }
  .columns { grid-template-columns: minmax(0, 1.3fr) minmax(220px, 1fr); gap: 18px; }
}
@media (max-width: 850px) {
  :root { --control-height: 44px; }
  .topbar { min-height: 80px; padding-block: 14px; }
  .topbar-right { flex-wrap: wrap; gap: 8px; }
  .school-picker { min-height: 44px; max-width: min(210px, 100%); }
  .button.small, .filter { min-height: 44px; }
  .field :is(input, select, textarea) { font-size: 16px; }
  .columns { grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr); }
  .page-heading { flex-wrap: wrap; }
  .page-heading .button { margin-top: 4px; }
  .notice-footer .button-row .button { flex: 1 1 140px; }
  dialog { max-height: calc(100dvh - 24px); padding: 22px; width: calc(100% - 24px); }
  .mobile-layout .sidebar { width: min(300px, calc(100vw - 44px)); }
}
@media (max-width: 680px) {
  .columns, .help-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-right { gap: 6px; }
  .student-switch { width: 100%; }
  .student-switch select { font-size: 13px; }
  .student-switch label { font-size: 10px; letter-spacing: .5px; }
  .stat { padding: 15px 8px; }
  .stat-label { font-size: 11px; }
  .notice-body { font-size: 14px; }
  .page-heading p { font-size: 13px; }
  .album-details h3 { font-size: 16px; }
  .album-grid { gap: 12px; }
  .album-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .full-calendar .calendar-day { min-height: 80px; }
  .day-event { font-size: 10px; line-height: 1.4; padding: 3px; }
  .data-table { min-width: 520px; }
  .auth-content { min-height: 100dvh; padding-inline: 24px; }
}
@media (max-width: 380px) {
  .hero-art { display: none; }
  .album-grid { grid-template-columns: minmax(0, 1fr); }
  .album-mosaic { height: 220px; }
  .album-photo-grid { grid-template-columns: minmax(0, 1fr); }
  .button-row .button { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.filter-feedback { font-size: 14px; color: var(--muted); line-height: 1.7; padding: 18px 4px 0; margin-bottom: 0; }
:root:not([data-theme="dark"]) .pill.red { color: #a64f40; }
:root:not([data-theme="dark"]) .pill.neutral { color: #626b82; }
:root:not([data-theme="dark"]) .alert.info { color: #69558f; }
:root[data-theme="dark"] .pill.neutral { background: #343b4e; color: #d0d4e2; }
.nav-label, .author .avatar { color: var(--muted); }
.calendar-day.outside { color: var(--muted); }
.full-calendar .today .day-event { background: #5e4aa6; color: white; }
.drawer-close { display: none; }
@media (max-width: 850px) { .drawer-close { display: inline-flex; position: absolute; top: 18px; right: 12px; } .sidebar > .brand { padding-right: 34px; } }

.album-photo-item { min-width: 0; }
.album-photo-item .album-photo { width: 100%; }
.photo-review-action { margin-top: 10px; width: 100%; }

.album-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 16px 0; }

/* Composición móvil inspirada en las referencias escolares; el escritorio conserva su cabecera. */
.mobile-brand { display: none; }
.notice-card { box-shadow: 0 3px 12px #29204105; }
.notice-priority { display: flex; align-items: center; gap: 8px; margin: -24px -24px 18px; padding: 11px 24px; border-radius: var(--radius) var(--radius) 0 0; color: #fff; background: #ae353e; font-size: 12px; font-weight: 700; }
.notice-priority .icon { width: 17px; height: 17px; }
.notice-urgent { border-color: #e9b5b9; }
.priority-section { margin-bottom: 26px; }
.priority-section > .card:last-child { margin-bottom: 0; }
:root[data-theme="dark"] .notice-urgent { border-color: #8a4c57; }
:root[data-theme="dark"] .notice-priority { background: #8c2e3b; }
@media (max-width: 850px) {
  .mobile-layout { --mobile-chrome: var(--accent-light, #6554c0); background: var(--bg); }
  .mobile-layout .topbar { display: grid; grid-template-columns: 44px minmax(0, 1fr) repeat(3, 44px); align-items: center; gap: 8px 3px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 13px max(12px, env(safe-area-inset-left)); min-height: 70px; background: var(--mobile-chrome); border-bottom: 0; color: #fff; }
  .mobile-layout .topbar-context { display: none; }
  .mobile-layout .topbar-right { display: contents; }
  .mobile-layout .menu-button { grid-column: 1; grid-row: 1; }
  .mobile-layout .mobile-brand { display: flex; flex-direction: column; gap: 0; grid-column: 2; grid-row: 1; min-width: 0; }
  .mobile-brand .brand { font-size: 25px; letter-spacing: -1px; line-height: 1.1; gap: 0; }
  .mobile-brand .brand-mark { display: none; }
  .mobile-brand .muted { color: #fff; }
  .mobile-school-name { font-size: 10px; line-height: 1.5; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .mobile-layout .topbar .theme-toggle { grid-column: 3; grid-row: 1; }
  .mobile-layout .topbar .push-toggle { grid-column: 4; grid-row: 1; }
  .mobile-layout .topbar .user-menu { grid-column: 5; grid-row: 1; }
  .mobile-layout .topbar .icon-button { color: #fff; border-radius: 13px; }
  .mobile-layout .topbar .icon-button:hover { background: #00000018; }
  .mobile-layout .topbar :focus-visible, .mobile-layout .mobile-nav :focus-visible { outline-color: #fff; outline-offset: -2px; }
  .mobile-layout .student-switch :focus-visible, .mobile-layout .school-picker:focus-visible { outline-color: var(--focus); outline-offset: 2px; }
  .mobile-layout .user-menu .avatar, .mobile-layout .user-info { display: none; }
  .mobile-layout .student-switch { grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; max-width: 100%; padding: 9px 12px; gap: 10px; border: 1px solid #ffffff30; border-radius: 13px; background: #fff; color: #262c43; }
  .mobile-layout .student-switch .avatar { width: 33px; height: 33px; background: #efecfb; color: var(--mobile-chrome); border-radius: 10px; }
  .mobile-layout .student-switch > div { flex: 1; min-width: 0; }
  .mobile-layout .student-switch label { color: #626b82; font-size: 10px; line-height: 1.3; letter-spacing: .25px; margin-bottom: 1px; }
  .mobile-layout .student-switch :is(select, strong) { color: #262c43; font-size: 13px; max-width: 100%; width: 100%; line-height: 1.5; }
  .mobile-layout .school-picker { grid-column: 1 / -1; grid-row: 3; max-width: 100%; width: 100%; margin: 0; background: var(--surface); color: var(--ink); border-color: var(--field-border); }
  .mobile-layout .content { padding: 22px 18px 26px; }
  .mobile-layout .page-heading { margin-bottom: 20px; gap: 10px; }
  .mobile-layout .page-heading h1 { font-size: 25px; line-height: 1.25; margin-bottom: 5px; letter-spacing: -.7px; }
  .mobile-layout .page-heading p { line-height: 1.6; }
  .mobile-layout .hero { min-height: 126px; padding: 19px 21px; border-radius: 20px; }
  .mobile-layout .hero .eyebrow { font-size: 8px; letter-spacing: 1.15px; margin-bottom: 7px; }
  .mobile-layout .hero h2 { font-size: 22px; margin: 0; line-height: 1.25; }
  .mobile-layout .hero p { display: none; }
  .mobile-layout .hero-art { height: 100px; min-width: 100px; transform: scale(.65); transform-origin: center right; margin-left: -25px; }
  .mobile-layout .stats { gap: 9px; margin: 16px 0 26px; }
  .mobile-layout .stat { display: flex; flex-direction: column; text-align: center; justify-content: flex-start; gap: 8px; padding: 15px 7px; border: 0; border-radius: 17px; background: #eeeafb; }
  .mobile-layout .stat:nth-child(2) { background: #e9f5ee; }
  .mobile-layout .stat:nth-child(3) { background: #fff2dd; }
  .mobile-layout .stat-icon { width: 29px; height: 29px; margin: 0; border-radius: 9px; background: #ffffffa6; }
  .mobile-layout .stat:nth-child(2) .stat-icon { color: var(--green); }
  .mobile-layout .stat:nth-child(3) .stat-icon { color: var(--amber); }
  .mobile-layout .stat-number { font-size: 22px; }
  .mobile-layout .stat-label { font-size: 11px; line-height: 1.5; margin-top: 4px; color: #586176; }
  .mobile-layout .section-head { margin-bottom: 12px; gap: 8px; }
  .mobile-layout .section-head h2 { font-size: 17px; }
  .mobile-layout .section-head a { font-size: 12px; font-weight: 600; }
  .mobile-layout .card { padding: 20px; border-radius: 18px; }
  .mobile-layout .notice-card { margin-bottom: 14px; box-shadow: 0 4px 16px #2c234909; }
  .mobile-layout .notice-priority { margin: -20px -20px 16px; padding: 10px 20px; }
  .mobile-layout .priority-section { margin-bottom: 22px; }
  .mobile-layout .notice-meta { gap: 7px; margin-bottom: 12px; font-size: 11px; }
  .mobile-layout .pill { padding: 4px 8px; border-radius: 7px; }
  .mobile-layout .notice-title { font-size: 16px; line-height: 1.5; margin-bottom: 9px; }
  .mobile-layout .notice-body { line-height: 1.7; color: var(--muted); }
  .mobile-layout .notice-footer { margin-top: 17px; padding-top: 14px; border-color: var(--line); gap: 13px; }
  .mobile-layout .notice-footer .author .avatar { width: 30px; height: 30px; background: var(--lavender); color: var(--purple); }
  .mobile-layout .mini-calendar { padding: 18px; }
  .mobile-layout .mini-calendar .calendar-grid { gap: 5px; }
  .mobile-layout .mini-calendar .calendar-day { padding: 9px 2px; font-size: 12px; border-radius: 10px; }
  .mobile-layout .calendar-title strong { font-size: 14px; }
  .mobile-layout .event-row { padding-block: 14px; gap: 12px; }
  .mobile-layout .event-date { min-width: 46px; padding: 9px 5px; border-radius: 12px; }
  .mobile-layout .event-row h3 { font-size: 13px; }
  .mobile-layout .event-row p { font-size: 12px; }
  .mobile-layout .album-card { padding: 0; border-radius: 19px; }
  .mobile-layout .album-mosaic { height: 176px; }
  .mobile-layout .album-details { padding: 15px; }
  .mobile-layout .album-details h3 { font-size: 15px; line-height: 1.45; margin-bottom: 8px; }
  .mobile-layout .mobile-nav { background: var(--mobile-chrome); color: #fff; border-top: 0; box-shadow: 0 -3px 18px #31234f12; padding-top: 7px; }
  .mobile-layout .mobile-nav :is(a, button) { color: #fff; gap: 4px; font-size: 10px; border-radius: 12px; }
  .mobile-layout .mobile-nav :is(a, button).active { color: #fff; background: #00000024; }
  .mobile-layout .mobile-nav .icon { width: 22px; height: 22px; }
  :root[data-theme="dark"] .mobile-layout .student-switch { background: var(--surface); color: var(--ink); border-color: #ffffff35; }
  :root[data-theme="dark"] .mobile-layout .student-switch :is(select, strong) { color: var(--ink); }
  :root[data-theme="dark"] .mobile-layout .student-switch label { color: var(--muted); }
  :root[data-theme="dark"] .mobile-layout .student-switch .avatar { background: var(--lavender); color: var(--purple); }
  :root[data-theme="dark"] .mobile-layout .stat { background: #302d45; }
  :root[data-theme="dark"] .mobile-layout .stat:nth-child(2) { background: #233a35; }
  :root[data-theme="dark"] .mobile-layout .stat:nth-child(3) { background: #3c3427; }
  :root[data-theme="dark"] .mobile-layout .stat-label { color: var(--muted); }
  :root[data-theme="dark"] .mobile-layout .stat-icon { background: #ffffff0c; }
}
@media (max-width: 380px) {
  .mobile-layout .content { padding-inline: 14px; }
  .mobile-layout .album-mosaic { height: 200px; }
}
