:root {
  --beige: #efe3cc;
  --azul: #092f57;
  --cafe: #6d4a2f;
  --vinotinto: #7b1836;
  --blanco: #fffaf2;
  --linea: rgba(9,47,87,.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--beige);
  color: #1f252b;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: var(--azul);
  color: white;
  border-bottom: 3px solid var(--vinotinto);
}
.logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: white;
  border-radius: 5px;
  padding: 2px;
}
h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0;
}
.user-badge {
  margin-left: auto;
  max-width: 34vw;
  overflow: hidden;
  color: #fffaf2;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-link {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 4px;
  padding: 6px 8px;
  color: #fffaf2;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.user-badge:not([hidden]) + .site-link { margin-left: 4px; }
.site-link:hover,
.site-link:focus-visible {
  background: rgba(255,255,255,.12);
  outline: 1px solid rgba(255,255,255,.45);
  outline-offset: 1px;
}
.settings-menu {
  margin-left: 0;
  position: relative;
  flex: 0 0 auto;
}
.settings-menu summary {
  display: grid;
  place-items: center;
  width: 32px;
  height: 30px;
  border: 1px solid var(--azul);
  border-radius: 3px;
  background: var(--azul);
  color: white;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  list-style: none;
}
.settings-menu[open] summary,
.settings-menu summary:focus-visible {
  outline: 1px solid rgba(255,255,255,.35);
  outline-offset: 1px;
}
.settings-menu summary::-webkit-details-marker { display: none; }
.time-controls {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 142px;
  padding: 8px;
  background: var(--blanco);
  color: var(--azul);
  border: 1px solid var(--cafe);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(9,47,87,.18);
}
.time-controls label {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
}
.time-controls select,
.time-controls input {
  width: 100%;
  min-width: 0;
  height: 26px;
  border: 1px solid rgba(9,47,87,.25);
  border-radius: 4px;
  background: #fffaf2;
  color: var(--azul);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 3px;
}
.time-controls .toggle-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: space-between;
  min-height: 26px;
}
.time-controls .toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--vinotinto);
}
.menu-view {
  height: 28px;
  border: 1px solid var(--cafe);
  border-radius: 5px;
  background: var(--azul);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}
main { max-width: 1200px; margin: 0 auto; }
.install-card {
  position: sticky;
  top: 45px;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  background: var(--vinotinto);
  color: white;
  border-bottom: 2px solid #ffcf33;
}
.install-card[hidden] { display: none; }
.install-card div {
  flex: 1 1 auto;
  display: grid;
  gap: 1px;
  min-width: 0;
}
.install-card strong {
  font-size: 12px;
  line-height: 1;
}
.install-card span {
  font-size: 10px;
  line-height: 1.15;
}
.install-card button {
  flex: 0 0 auto;
  border: 1px solid #ffcf33;
  border-radius: 4px;
  background: #ffcf33;
  color: var(--vinotinto);
  font-weight: 900;
  font-size: 11px;
  padding: 5px 7px;
}
#dismiss-install {
  width: 25px;
  height: 25px;
  padding: 0;
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,.45);
  font-size: 17px;
  line-height: 1;
}
.tabs {
  position: sticky;
  top: 45px;
  z-index: 9;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 5px 8px;
  background: var(--beige);
  border-bottom: 1px solid var(--linea);
}
.tab {
  flex: 0 0 auto;
  border: 1px solid var(--cafe);
  background: var(--blanco);
  color: var(--azul);
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 700;
}
.tab.active { background: var(--vinotinto); color: white; border-color: var(--vinotinto); }
.content { padding: 2px 6px 6px; }
.conventions-line {
  margin: 0 auto 6px;
  max-width: 1492px;
  color: var(--azul);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-short { display: none; }
.toolbar { display: none; }
.hint { display: none; }
.slider {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 0 8px;
}
.slide {
  min-width: min(100%, 920px);
  scroll-snap-align: start;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 6px;
  overflow: hidden;
}
.slide-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 7px;
  background: var(--cafe);
  color: white;
  font-weight: 800;
}
.title-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  flex: 1 1 auto;
  min-width: 0;
}
.title-main > span {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.title-main small {
  color: #ffcf33;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.special-badge {
  margin-left: auto;
  color: #ffcf33;
  font-size: 13px;
  white-space: nowrap;
}
.nav-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 5px;
  background: var(--azul);
  color: white;
  font-size: 20px;
  line-height: 1;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}
.nav-buttons {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.slider-special-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--vinotinto);
  font-size: 12px;
  font-weight: 800;
}
.slider-special-note strong {
  color: var(--azul);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 410px; table-layout: fixed; }
th, td {
  border: 1px solid rgba(9,47,87,.18);
  padding: 2px 1px;
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  white-space: pre-line;
}
th { background: #ead5b4; color: var(--azul); position: sticky; top: 0; z-index: 1; }
td:first-child, th:first-child {
  width: 34px;
  max-width: 40px;
  padding-left: 1px;
  padding-right: 1px;
  font-weight: 800;
  background: #f7eddc;
  color: var(--azul);
  overflow-wrap: anywhere;
}
.cell {
  border-radius: 3px;
  padding: 1px 1px;
  min-height: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.area-cell {
  min-height: 48px;
  padding: 4px 3px;
  text-align: center;
  white-space: normal;
}
.area-cell strong,
.area-cell span {
  display: block;
}
.area-cell strong {
  margin-bottom: 3px;
  font-size: 1.03em;
  font-weight: 900;
  text-transform: uppercase;
}
.area-cell span {
  font-weight: 800;
  line-height: 1.08;
}
.area-schedule .table-scroll table {
  min-width: 620px;
}
.period-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1;
}
.period-label small {
  font-size: 8px;
  font-weight: 800;
  opacity: .9;
}
.break-label.time-only small {
  display: block;
  white-space: nowrap;
  font-size: 8px;
}
.period-label.stacked {
  display: inline-grid;
  gap: 2px;
}
.break-head,
.break-period,
.break-cell {
  background: #dcc6a4 !important;
  color: var(--cafe) !important;
  font-weight: 900;
}
.break-cell span {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 0;
  transform: rotate(-90deg);
}
.break-row .break-cell span {
  transform: none;
}
.narrow-break {
  width: 28px;
}
.day-schedule .narrow-break {
  width: 42px;
}
.day-schedule .break-cell span {
  font-size: 15px;
  font-weight: 900;
  transform: none;
}
.active-col,
.active-row > td,
.active-cell {
  position: relative;
  outline: 2px solid var(--vinotinto);
  outline-offset: -2px;
  background: #fff1bd !important;
}
th.active-col,
th.active-day,
.active-period {
  position: relative;
  outline: 2px solid var(--vinotinto);
  outline-offset: -2px;
  background: var(--vinotinto) !important;
  color: #ffcf33 !important;
}
.is-current-period {
  box-shadow: inset 0 0 0 1px var(--vinotinto), inset 0 0 0 2px #ffcf33;
}
.active-col .cell,
.active-row .cell,
.active-cell .cell {
  box-shadow: inset 0 0 0 1px var(--vinotinto), 0 0 0 1px #ffcf33;
}
.active-row > td:first-child {
  background: var(--vinotinto) !important;
  color: #ffcf33 !important;
}
.empty { color: #9d9284; font-weight: 400; }
.cards { display: grid; gap: 8px; }
.alpha {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 0 4px;
  margin-bottom: 4px;
}
.alpha a,
.alpha button {
  flex: 0 0 auto;
  min-width: 30px;
  text-align: center;
  text-decoration: none;
  background: var(--azul);
  color: white;
  border: 0;
  padding: 5px 7px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 13px;
}
.teacher-card { scroll-margin-top: 88px; }
.special-panel,
.novedades {
  margin: 0 0 8px;
  padding: 8px;
  background: var(--blanco);
  border: 1px solid var(--linea);
  border-radius: 6px;
}
.special-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.special-top label {
  display: grid;
  gap: 3px;
  color: var(--azul);
  font-size: 12px;
  font-weight: 800;
}
.special-top input {
  height: 30px;
  border: 1px solid rgba(9,47,87,.25);
  border-radius: 4px;
  background: white;
  color: var(--azul);
  font-weight: 700;
}
.special-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.special-actions button,
.picker-list button {
  border: 1px solid var(--cafe);
  border-radius: 5px;
  background: var(--azul);
  color: white;
  font-weight: 800;
  padding: 7px 9px;
}
.absence-box {
  margin-top: 8px;
  color: var(--azul);
  font-size: 12px;
  font-weight: 800;
}
.absence-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 5px;
  margin-top: 7px;
}
.absence-row {
  display: grid;
  grid-template-columns: 18px minmax(74px, 1fr) 110px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(9,47,87,.12);
  border-radius: 5px;
  background: #fff;
}
.absence-hours {
  position: relative;
  min-width: 0;
}
.absence-hours summary {
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(9,47,87,.25);
  border-radius: 4px;
  background: white;
  color: var(--azul);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
}
.absence-hours[aria-disabled="true"] summary {
  opacity: .55;
}
.absence-hours > div {
  position: absolute;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 3px;
  width: 132px;
  max-height: 190px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(9,47,87,.25);
  border-radius: 5px;
  background: #fffaf2;
  box-shadow: 0 10px 20px rgba(9,47,87,.18);
}
.absence-hours label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--azul);
  font-size: 11px;
  font-weight: 800;
}
.special-cell {
  width: 100%;
  min-height: 22px;
  border: 1px dashed rgba(9,47,87,.35);
  border-radius: 3px;
  background: #fff;
  color: var(--azul);
  font-size: 10px;
  font-weight: 800;
}
.special-cell.filled {
  border-style: solid;
  color: var(--vinotinto);
  font-style: italic;
  font-weight: 900;
}
.special-cell.no-class {
  border-style: solid;
  color: #6b5a49;
  background: #f8f1e6;
}
.special-cell.original {
  display: block;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.special-cell.original .cell {
  min-height: 18px;
}
.special-cell.advance {
  box-shadow: inset 0 -3px 0 #ffcf33;
}
.special-cell.moved-away {
  display: block;
  border-style: solid;
  border-color: rgba(123,24,54,.35);
  background: white;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(9,47,87,.42);
}
.picker-modal {
  width: min(460px, 100%);
  max-height: 86vh;
  overflow: hidden;
  background: var(--blanco);
  border: 2px solid var(--vinotinto);
  border-radius: 7px;
  box-shadow: 0 16px 40px rgba(9,47,87,.35);
}
.picker-modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  background: var(--vinotinto);
  color: white;
}
.picker-modal header button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 4px;
  background: transparent;
  color: white;
  font-size: 18px;
}
.picker-list {
  display: grid;
  gap: 6px;
  max-height: calc(86vh - 54px);
  overflow: auto;
  padding: 9px;
}
.picker-list button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
.picker-section {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}
.picker-section + .picker-section {
  border-top: 1px solid rgba(9,47,87,.14);
  margin-top: 3px;
  padding-top: 8px;
}
.picker-section h3 {
  margin: 0;
  color: var(--azul);
  font-size: 12px;
}
.picker-list small {
  color: #ffcf33;
  font-weight: 800;
}
.picker-list .no-class-choice {
  background: var(--cafe);
}
.picker-list .active {
  outline: 2px solid #ffcf33;
}
.voice-alert-popup {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 120;
  display: grid;
  gap: 3px;
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 13px;
  border: 2px solid #ffcf33;
  border-radius: 7px;
  background: var(--vinotinto);
  color: white;
  box-shadow: 0 12px 30px rgba(9,47,87,.32);
}
.voice-alert-popup strong {
  color: #ffcf33;
  font-size: 12px;
  line-height: 1.1;
}
.voice-alert-popup span {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}
.novedades h2 {
  margin: 0 0 6px;
  color: var(--vinotinto);
  font-size: 16px;
}
.novedades ul {
  margin: 0;
  padding-left: 18px;
}
.novedades li {
  margin: 3px 0;
  font-size: 13px;
}
@media (max-width: 640px) {
  .topbar { padding: 3px 8px; }
  .logo { width: 30px; height: 30px; }
  h1 { font-size: 12px; max-width: 190px; }
  .user-badge { max-width: 112px; font-size: 10.5px; }
  .site-link { padding: 6px; font-size: 10px; }
  .settings-menu summary { width: 30px; height: 28px; font-size: 18px; }
  .install-card { top: 39px; }
  .time-controls { min-width: 136px; gap: 5px; padding: 7px; }
  .time-controls select,
  .time-controls input {
    height: 23px;
    font-size: 10px;
    padding: 1px;
  }
  .tabs { top: 39px; padding: 4px 6px; }
  .tab { padding: 6px 8px; font-size: 13px; }
  .content { padding: 2px 4px 6px; }
  .conventions-line { font-size: 9.5px; line-height: 1.1; padding: 0 2px; }
  .conv-full { display: none; }
  .conv-short { display: inline; }
  .slide { min-width: 100%; }
  table { min-width: 540px; }
  th, td { font-size: 8.5px; padding: 1px; }
  td:first-child, th:first-child { width: 26px; max-width: 30px; }
  .cell { min-height: 16px; padding: 1px; border-radius: 3px; line-height: .95; }
  .day-schedule table { min-width: 648px; }
  .day-schedule th,
  .day-schedule td { font-size: 10.2px; padding: 2px 1px; }
  .day-schedule td:first-child,
  .day-schedule th:first-child { width: 31px; max-width: 36px; }
  .day-schedule .cell { min-height: 19px; font-size: 10.2px; line-height: 1; }
  .day-schedule .narrow-break { width: 42px; }
  .day-schedule .break-cell span { font-size: 17px; }
  .compact-schedule table { min-width: 320px; }
  .compact-schedule th,
  .compact-schedule td { font-size: 8px; padding: 1px 0; }
  .compact-schedule td:first-child,
  .compact-schedule th:first-child { width: 24px; max-width: 26px; }
  .compact-schedule .cell { min-height: 15px; font-size: 8px; line-height: .9; padding: 1px 0; }
  .area-schedule .table-scroll table { min-width: 520px; }
  .area-schedule .area-cell { min-height: 42px; font-size: 8px; padding: 2px 1px; }
  .area-schedule .area-cell strong { margin-bottom: 2px; font-size: 8.2px; }
  .area-schedule .area-cell span { line-height: 1; }
  .title-main { gap: 10px; }
  .title-main small { font-size: 9px; }
  .period-label small { font-size: 7px; }
  .break-label.time-only small { font-size: 7.5px; }
  .break-cell span { font-size: 7px; }
  .day-schedule .break-cell span { font-size: 17px; }
  .absence-list { grid-template-columns: 1fr; }
  .special-cell { font-size: 8.5px; min-height: 19px; padding: 1px; }
  .compact-schedule .special-cell {
    min-height: 15px;
    font-size: 8px;
    line-height: .9;
    padding: 1px 0;
  }
  .special-actions button { padding: 6px 8px; font-size: 12px; }
  .voice-alert-popup {
    right: 8px;
    bottom: 8px;
    max-width: calc(100vw - 16px);
  }
}
