:root {
  --calendar-paper: #f6f7f8;
  --calendar-line: #eff1f3;
  --calendar-accent-ink: #075969;
  --radius: 30px;
  --shadow: 0 12px 36px rgba(17, 19, 24, .045);
}

body {
  background: #fff;
}

.app-shell {
  width: min(1080px, 100%);
  padding: 0 clamp(16px, 3vw, 32px) 88px;
}

.topbar {
  min-height: 66px;
  margin: 0 calc(clamp(16px, 3vw, 32px) * -1) 24px;
  padding: 12px clamp(16px, 3vw, 32px);
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, .90);
  box-shadow: 0 8px 28px rgba(25, 39, 52, .035);
  backdrop-filter: blur(12px);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: transparent url("/calendar-icon.png") center / cover no-repeat;
  box-shadow: none;
}

.brand-title-single {
  font-size: 16px;
  font-weight: 720;
}

.panel,
.card {
  border-radius: var(--radius);
  background: var(--calendar-paper);
  box-shadow: 0 10px 30px rgba(26, 42, 56, .035);
}

.today-dashboard {
  grid-template-columns: minmax(0, 1.55fr) minmax(220px, .65fr);
  gap: 12px;
  margin-bottom: 12px;
}

.today-card {
  min-height: 188px;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px;
}

.day-card {
  min-height: 132px;
  gap: 5px;
  border-radius: 24px;
  color: var(--calendar-accent-ink);
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.day-card strong {
  font-size: 54px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.day-card span {
  font-size: 12px;
  font-weight: 700;
}

.today-copy {
  gap: 8px;
}

.today-copy h1,
.view-head h1 {
  font-size: clamp(34px, 4.2vw, 48px);
  line-height: 1.04;
  font-weight: 760;
}

.today-copy p {
  font-size: 16px;
  line-height: 1.5;
}

.today-date-label {
  font-size: 14px;
}

.next-card {
  min-height: 188px;
  padding: 20px;
  border: 1px solid transparent;
  border-radius: 34px;
  background: #252629;
}

.next-thing strong {
  font-size: clamp(21px, 2.5vw, 30px);
  line-height: 1.12;
}

.date-panel,
.content-stack,
.mini-upcoming {
  margin-bottom: 12px;
}

.content-stack {
  gap: 12px;
}

.panel {
  padding: 18px;
}

.toolbar.compact h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 730;
}

.toolbar.compact {
  margin-bottom: 10px;
}

.ghost,
.button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 680;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.ghost {
  background: #fff;
  box-shadow: 0 3px 12px rgba(17, 19, 24, .035);
}

.ghost:hover {
  background: #eff1f3;
}

.button {
  background: var(--accent);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, #fff);
  outline-offset: 2px;
}

.date-rail {
  grid-auto-columns: 72px;
  gap: 7px;
  padding: 2px 1px 5px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
}

.date-chip {
  min-height: 72px;
  gap: 4px;
  padding: 9px;
  border-radius: 22px;
  box-shadow: 0 3px 12px rgba(17, 19, 24, .035);
  scroll-snap-align: start;
}

.date-chip:hover {
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 12%, transparent);
}

.date-chip strong {
  font-size: 20px;
  font-weight: 740;
  font-variant-numeric: tabular-nums;
}

.date-chip span {
  font-size: 11px;
}

.date-chip.active {
  color: var(--calendar-accent-ink);
  background: color-mix(in srgb, var(--accent) 18%, #fff);
  box-shadow: 0 5px 16px color-mix(in srgb, var(--accent) 14%, transparent);
}

.date-chip.active span {
  color: color-mix(in srgb, var(--calendar-accent-ink) 72%, #fff);
}

.date-chip.has-event {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent) 64%, #fff), 0 3px 12px rgba(17, 19, 24, .035);
}

.event-card,
.lesson,
.week-lesson,
.mini-card {
  border-radius: 23px;
  box-shadow: 0 6px 22px rgba(26, 42, 56, .035);
}

.event-card {
  gap: 9px;
  padding: 14px;
}

.event-card-rich::after {
  display: none;
}

.event-card h3,
.lesson h3,
.week-lesson strong {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 710;
}

.event-card p,
.lesson p {
  margin: 0;
  line-height: 1.45;
}

.time-range {
  min-height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--item-accent, var(--accent)) 13%, #fff);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--item-accent, var(--accent)) 9%, transparent);
  font-size: 12px;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
}

.lesson {
  gap: 7px;
  padding: 13px 14px;
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--item-accent, var(--accent)) 72%, #fff), 0 6px 22px rgba(26, 42, 56, .035);
}

.lesson:hover,
.clickable-card:hover {
  background: #fff;
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--item-accent, var(--accent)) 72%, #fff), 0 9px 26px rgba(26, 42, 56, .06);
}

.mini-upcoming {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mini-card {
  min-height: 104px;
  gap: 6px;
  padding: 12px;
  border: 0;
}

.mini-card:hover {
  background: #fff;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.empty-day {
  min-height: 280px;
  gap: 8px;
  padding: 24px;
}

.empty-mascot-image {
  width: min(174px, 48vw);
  margin-bottom: 2px;
  filter: none;
}

.empty-day h2 {
  font-size: clamp(28px, 3.8vw, 38px);
  line-height: 1.1;
  font-weight: 740;
}

.empty-day p {
  font-size: 15px;
  line-height: 1.5;
}

.week-panel {
  padding: 18px;
  border-radius: var(--radius);
}

.week-head h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.12;
  font-weight: 740;
}

.week-day {
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(26, 42, 56, .035);
}

.week-day.is-today {
  background: color-mix(in srgb, var(--accent) 7%, #fff);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 74%, #fff), 0 7px 22px rgba(26, 42, 56, .035);
}

.week-day-head > div {
  gap: 5px;
}

.week-day-head h3 {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 710;
}

.weekday-badge {
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
  box-shadow: none;
}

.week-lessons {
  gap: 7px;
}

.week-lesson {
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 14px;
  border-radius: 24px;
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--item-accent, var(--accent)) 72%, #fff), 0 5px 18px rgba(26, 42, 56, .035);
}

.week-lesson .time-range {
  width: fit-content;
}

.week-empty {
  min-height: 42px;
  justify-items: start;
  padding: 0 4px;
  background: transparent;
  font-size: 13px;
}

.detail-card {
  gap: 10px;
  padding: 12px;
}

.detail-hero {
  min-height: 230px;
  gap: 12px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: 32px;
  background: color-mix(in srgb, var(--item-accent, var(--accent)) 14%, #fff);
}

.detail-hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.05;
  font-weight: 750;
}

.detail-meta,
.detail-section {
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 23px;
  box-shadow: 0 6px 20px rgba(26, 42, 56, .03);
}

.detail-meta {
  min-height: 72px;
  padding: 12px;
}

.detail-section {
  padding: 14px;
}

.detail-section p {
  font-size: 15px;
}

.maintenance-card {
  border-radius: 32px;
  background: var(--calendar-paper);
}

.maintenance-mascot-image {
  filter: none;
}

.maintenance-card h1 {
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.05;
  font-weight: 750;
}

.maintenance-card p {
  font-size: 16px;
}

.bottom-actions {
  margin-top: 12px;
}

.modal {
  backdrop-filter: blur(5px);
}

.modal-card {
  border-radius: 32px;
}

@media (max-width: 860px) {
  .app-shell {
    padding-bottom: 84px;
  }

  .today-dashboard {
    grid-template-columns: 1fr;
  }

  .today-card {
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 150px;
    padding: 14px;
  }

  .day-card {
    min-height: 112px;
    border-radius: 22px;
  }

  .day-card strong {
    font-size: 46px;
  }

  .today-copy h1,
  .view-head h1 {
    font-size: 34px;
    line-height: 1.06;
  }

  .today-copy p {
    font-size: 14px;
  }

  .next-card {
    display: grid;
    min-height: 112px;
    gap: 10px;
    padding: 15px;
  }

  .panel {
    padding: 15px;
  }

  .week-panel {
    padding: 15px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0 12px 88px;
  }

  .topbar {
    min-height: 56px;
    margin: 0 -12px 12px;
    padding: 10px 14px;
  }

  .today-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 11px;
    padding: 11px;
  }

  .day-card {
    min-height: 96px;
    border-radius: 20px;
  }

  .day-card strong {
    font-size: 38px;
  }

  .day-card span {
    font-size: 10px;
  }

  .today-copy {
    gap: 6px;
  }

  .today-copy h1,
  .view-head h1 {
    font-size: 29px;
    line-height: 1.08;
  }

  .today-date-label {
    font-size: 12px;
  }

  .date-panel,
  .content-stack > .panel,
  #todayView > .panel,
  .week-panel {
    padding: 13px;
    border-radius: 26px;
  }

  .date-rail {
    grid-auto-columns: 64px;
    gap: 6px;
  }

  .date-chip {
    min-height: 66px;
    padding: 8px;
    border-radius: 20px;
  }

  .mini-upcoming {
    grid-template-columns: 1fr;
  }

  .mobile-tabs {
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    background: rgba(255, 255, 255, .90);
    box-shadow: 0 8px 30px rgba(17, 19, 24, .10);
    backdrop-filter: blur(14px);
  }

  .mobile-tabs button {
    min-height: 40px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 680;
  }

  .mobile-tabs button.active {
    color: var(--calendar-accent-ink);
    background: color-mix(in srgb, var(--accent) 18%, #fff);
  }

  .week-head {
    grid-template-columns: auto minmax(0, 1fr);
    justify-content: initial;
  }

  .week-head div {
    grid-column: auto;
    grid-row: auto;
  }

  .week-head h1 {
    font-size: 26px;
  }

  .week-day {
    padding: 12px;
    border-radius: 24px;
  }

  .week-day-head h3 {
    font-size: 19px;
  }

  .week-title-line {
    align-items: center;
  }

  .weekday-badges {
    gap: 5px;
  }

  .detail-hero {
    min-height: 190px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .empty-day {
    min-height: 240px;
  }

  .maintenance-view {
    min-height: calc(100svh - 90px);
  }

  .maintenance-mascot-image {
    width: min(190px, 52vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
