:root {
  --schoolcal-primary: #315c86;
  --schoolcal-primary-deep: #234766;
  --schoolcal-soft: #eaf2f8;
  --schoolcal-warm: #c58b00;
  --schoolcal-ink: #17324a;
  --schoolcal-grid: #dce4eb;
}

html {
  min-height: 100%;
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  min-height: 100vh;
  color: var(--schoolcal-ink);
  background: #f7fafc;
}

.container {
  max-width: 1120px;
}

a {
  text-underline-offset: 2px;
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 0.85rem;
  color: white;
  background: var(--schoolcal-primary);
  font-size: 1.4rem;
  font-weight: 800;
}

.eyebrow {
  color: var(--schoolcal-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dashboard-section {
  padding: 1.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 1.25rem;
  background: var(--bs-body-bg);
  box-shadow: 0 0.65rem 2rem rgb(24 48 72 / 6%);
}

.schedule-section {
  padding: 0.75rem;
}

.day-navigation {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.day-nav-button {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--schoolcal-grid);
  border-radius: 50%;
  color: var(--schoolcal-primary-deep);
  background: #f5f8fa;
  font-size: 1.6rem;
  line-height: 1;
  text-decoration: none;
}

.day-nav-button:hover {
  color: #fff;
  border-color: var(--schoolcal-primary);
  background: var(--schoolcal-primary);
}

.day-date-time {
  min-width: 9.5rem;
  text-align: center;
}

.day-date-time h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.all-day-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--schoolcal-grid);
}

.all-day-label {
  padding-top: 0.55rem;
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.all-day-events {
  display: grid;
  gap: 0.5rem;
}

.all-day-event {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border-left: 4px solid var(--schoolcal-primary);
  border-radius: 0.55rem;
  color: var(--schoolcal-primary-deep);
  background: var(--schoolcal-soft);
}

.all-day-event.event-past {
  border-left-color: #9aa5ae;
  color: #66727c;
  background: #edf0f2;
}

.all-day-event.event-current {
  border-left-color: #c58b00;
  color: #674800;
  background: #fff1b8;
}

.timeline-empty-note {
  margin: 0 0 1rem;
  color: var(--bs-secondary-color);
  font-size: 0.88rem;
}

.day-timeline-wrap {
  overflow: hidden;
  border: 1px solid var(--schoolcal-grid);
  border-radius: 1rem;
  background: #fff;
}

.day-timeline {
  position: relative;
  min-width: 0;
}

.timeline-hour {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: center;
  transform: translateY(-0.5em);
}

.timeline-hour span {
  padding-right: 0.7rem;
  color: var(--bs-secondary-color);
  font-size: 0.7rem;
  font-weight: 600;
  text-align: right;
}

.timeline-hour i {
  display: block;
  height: 1px;
  background: var(--schoolcal-grid);
}

.timeline-events {
  position: absolute;
  inset: 0 0 0 4.5rem;
}

.timeline-event {
  position: absolute;
  right: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  min-height: 34px;
  padding: 0.45rem 0.7rem;
  overflow: hidden;
  border: 1px solid #aac4d9;
  border-radius: 0.65rem;
  color: var(--schoolcal-primary-deep);
  background: #dcecf7;
  box-shadow: 0 0.2rem 0.65rem rgb(49 92 134 / 10%);
}

.timeline-event strong,
.timeline-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-event strong {
  line-height: 1.15;
}

.timeline-event span {
  margin-top: 0.15rem;
  font-size: 0.75rem;
}

.timeline-event.event-past {
  border-color: #c9cfd4;
  color: #66727c;
  background: #e9edef;
  box-shadow: none;
}

.timeline-event.event-current {
  z-index: 3;
  border-color: #dab347;
  color: #604300;
  background: #ffe9a0;
  box-shadow: 0 0.25rem 0.8rem rgb(183 125 0 / 18%);
}

.current-time-marker {
  position: absolute;
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: center;
  color: var(--schoolcal-warm);
  pointer-events: none;
  transform: translateY(-0.55rem);
}

.current-time-marker[hidden] {
  display: none;
}

.current-time-marker span {
  padding-right: 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.current-time-marker i {
  position: relative;
  display: block;
  height: 2px;
  background: var(--schoolcal-warm);
}

.current-time-marker i::before {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--schoolcal-warm);
  content: "";
  transform: translateY(-50%);
}

.free-time-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #c4d7e5;
  border-radius: 0.7rem;
  color: var(--schoolcal-primary-deep);
  background: var(--schoolcal-soft);
  font-size: 0.86rem;
}

.free-time-status > span {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--schoolcal-primary);
}

.free-time-status.is-free-now {
  border-color: #d5a526;
  color: #604300;
  background: #fff1b8;
}

.free-time-status.is-free-now > span {
  background: #b77d00;
}

.event-cancelled {
  opacity: 0.55;
  text-decoration: line-through;
}

.empty-state {
  padding: 3.5rem 1rem;
  border: 1px dashed #bfd0de;
  border-radius: 1rem;
  background: #f8fbfd;
  text-align: center;
}

.empty-state > span {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--schoolcal-primary);
  font-size: 2rem;
}

.empty-state h3 {
  font-size: 1.15rem;
}

.empty-state p {
  max-width: 34rem;
  margin-right: auto;
  margin-left: auto;
  color: var(--bs-secondary-color);
}

.compact-empty-state {
  padding: 2rem 1rem;
}

.compact-empty-state h2 {
  font-size: 1.15rem;
}

.lunch-section {
  padding: 0.75rem;
}

.lunch-weeks {
  display: grid;
  gap: 0.75rem;
}

.lunch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(135px, 1fr));
  gap: 0.65rem;
  overflow-x: auto;
  padding: 0.15rem 0.05rem 0.5rem;
}

.lunch-day {
  min-height: 10rem;
  overflow: hidden;
  border: 1px solid var(--schoolcal-grid);
  border-radius: 0.85rem;
  background: #fff;
}

.lunch-day > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  color: var(--schoolcal-primary-deep);
  background: #f0f5f8;
}

.lunch-day > header span {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lunch-day > header strong {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
}

.lunch-day.is-highlighted {
  border-color: #d5a526;
  box-shadow: 0 0 0 2px rgb(197 139 0 / 15%);
}

.lunch-day.is-highlighted > header {
  color: #604300;
  background: #fff1b8;
}

.lunch-day.is-highlighted > header strong {
  color: #fff;
  background: #b77d00;
}

.lunch-day.is-past {
  opacity: 0.58;
}

.lunch-day-menu {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem 0.75rem;
}

.lunch-day-menu p {
  margin: 0;
  line-height: 1.3;
}

.lunch-day-menu strong {
  display: block;
}

.lunch-day-menu strong {
  font-size: 0.87rem;
}

.no-lunch {
  margin-top: 0.2rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.import-card {
  padding: 1.25rem;
  border: 1px solid var(--schoolcal-grid);
  border-radius: 1rem;
  background: #fbfdfe;
}

.import-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.import-card-heading p {
  color: var(--bs-secondary-color);
  font-size: 0.88rem;
}

.module-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 0.75rem;
  color: var(--schoolcal-primary);
  background: var(--schoolcal-soft);
  font-size: 1.15rem;
  font-weight: 800;
}

.source-details {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  border-radius: 0.75rem;
  background: #eef4f8;
  font-size: 0.8rem;
}

.source-details div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 0.75rem;
}

.source-details dt {
  color: var(--bs-secondary-color);
  font-weight: 600;
}

.source-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.remove-calendar-form {
  margin-top: 1rem;
}

.access-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem 0;
}

.access-card {
  width: min(100%, 26rem);
  padding: 2rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  background: var(--bs-body-bg);
  box-shadow: 0 1rem 3rem rgb(24 48 72 / 10%);
}

.shared-access-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: 1rem;
}

.build-version,
.build-version a,
.build-version code {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.build-version a {
  text-decoration: none;
}

.build-version a:hover {
  text-decoration: underline;
}

.shared-access-footer form {
  margin: 0;
}

@media (max-width: 767.98px) {
  .container {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }

  .dashboard-section {
    padding: 0.85rem;
    border-radius: 0.9rem;
  }

  .schedule-section,
  .lunch-section {
    padding: 0.45rem;
  }

  .day-navigation {
    min-height: 2.6rem;
    margin-bottom: 0.45rem;
  }

  .day-nav-button {
    width: 2.25rem;
    height: 2.25rem;
  }

  .day-date-time h1 {
    font-size: 1rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .all-day-row,
  .timeline-hour,
  .current-time-marker {
    grid-template-columns: 3.25rem 1fr;
  }

  .all-day-label,
  .timeline-hour span,
  .current-time-marker span {
    padding-right: 0.4rem;
    font-size: 0.64rem;
  }

  .timeline-events {
    left: 3.25rem;
  }

  .timeline-event {
    right: 0.3rem;
    left: 0.35rem;
    padding: 0.38rem 0.5rem;
    border-radius: 0.5rem;
  }

  .timeline-event strong {
    font-size: 0.88rem;
  }

  .timeline-event span {
    font-size: 0.68rem;
  }

  .lunch-weeks {
    gap: 0.55rem;
  }

  .lunch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    overflow-x: visible;
    padding-bottom: 0.1rem;
  }

  .lunch-day {
    min-height: 8rem;
  }

  .lunch-day > header,
  .lunch-day-menu {
    padding: 0.6rem;
  }
}

@media (max-width: 359.98px) {
  .lunch-grid {
    grid-template-columns: 1fr;
  }
}
