:root {
  --navy: #071e49;
  --text: #2f2f2f;
  --muted: #5c5c5c;
  --icon: #4a4a4a;
  --line: #e6e6e6;
  --hover: #f4f4f4;
  --active: #eef2f8;
  --sidebar-width: 240px;
  --header-height: 72px;
  --font: Lato, "Helvetica Neue", Arial, sans-serif;
  --font-sidebar: Inter, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

body.is-landing {
  overflow: auto;
  height: auto;
  min-height: 100%;
}

body.is-landing #app-shell {
  display: none !important;
}

body.is-app {
  overflow: hidden;
  height: 100%;
}

body.is-app #landing {
  display: none !important;
}

/* Already signed in: show the app immediately while Firebase restores the session. */
html.has-session body.is-landing {
  overflow: hidden;
  height: 100%;
}

html.has-session body.is-landing #landing {
  display: none !important;
}

html.has-session body.is-landing #app-shell,
html.has-session body.is-landing #app-shell[hidden] {
  display: flex !important;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  padding: 0 16px;
  background: var(--navy);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-left: -6px;
  border-radius: 8px;
  color: #fff;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-backdrop {
  display: none;
}

.app-logout {
  color: #fff;
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: normal;
  line-height: 24px;
  padding: 0;
  border-radius: 0;
  background: none;
  margin-left: auto;
}

.app-logout:hover {
  background: none;
  opacity: 0.85;
}

/* —— Landing (pre-login) —— */
.landing {
  min-height: 100vh;
  background: #f7f7f5;
}

.landing-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 86px;
  min-height: 86px;
  padding: 0 clamp(16px, 4vw, 72px);
  background: #071d49;
}

.landing-logo {
  display: block;
  height: 76px;
  width: auto;
  max-width: min(420px, 72vw);
  object-fit: contain;
  object-position: left center;
}

.landing-auth-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.landing-auth-link {
  color: #fff;
  font-family: Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: normal;
  line-height: 24px;
}

.landing-auth-link:hover {
  opacity: 0.85;
}

.landing-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 280px;
  max-height: 560px;
  overflow: hidden;
  background: #071e49;
  isolation: isolate;
}

.landing-hero-img {
  position: absolute;
  left: 0;
  top: -12%;
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: center 40%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.landing-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(7, 30, 73, 0.08) 0%,
    rgba(7, 30, 73, 0.18) 55%,
    rgba(7, 30, 73, 0.35) 100%
  );
  will-change: transform;
}

.landing-hero-title {
  margin: 0;
  color: #fff;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2rem, 5.5vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero-img,
  .landing-hero-overlay {
    transform: none !important;
    will-change: auto;
  }
}

.landing-about {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  padding: 64px 28px 72px;
  text-align: center;
  background: #f7f7f5;
}

.landing-about-title {
  margin: 0 0 22px;
  color: var(--navy);
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.landing-about-copy {
  margin: 0 auto;
  max-width: 640px;
  color: #4a4a4f;
  font-size: 1.05rem;
  line-height: 1.65;
}

.landing-about-credit {
  margin-top: 18px;
  font-weight: 600;
  color: #3a3a3f;
}

.landing-disclaimer {
  padding: 28px 24px 36px;
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.landing-disclaimer p {
  margin: 0 auto;
  max-width: 920px;
  font-size: 0.92rem;
  line-height: 1.55;
  font-weight: 400;
}

.landing-disclaimer p + p {
  margin-top: 10px;
}

/* Auth page — full-screen campus bg + centered white card */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #071e49;
}

.auth-modal[hidden] {
  display: none !important;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background-image: url("../assets/auth-bg.png?v=42");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.auth-backdrop::after {
  content: none;
}

.auth-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 44px 44px 36px;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
}

.auth-dialog.is-signup {
  padding-top: 40px;
  padding-bottom: 32px;
}

.auth-dialog.is-signup h2 {
  margin-bottom: 28px;
  font-size: 1.75rem;
}

.auth-field[hidden] {
  display: none !important;
}

.auth-back {
  position: absolute;
  top: 16px;
  left: 18px;
  color: #616161;
  font-size: 13px;
  font-weight: 400;
}

.auth-back:hover {
  color: #111;
}

.auth-dialog h2 {
  margin: 28px 0 32px;
  color: #1b1b1b;
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  letter-spacing: -0.01em;
}

.auth-copy {
  margin: -12px 0 24px;
  color: #616161;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

.auth-form {
  display: grid;
  gap: 28px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  color: #616161;
}

.auth-field input {
  width: 100%;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 1px solid #605e5c;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: #1b1b1b;
}

.auth-field select {
  width: 100%;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 1px solid #605e5c;
  border-radius: 0;
  background-color: transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 400;
  color: #1b1b1b;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1.4 1.4 6 6l4.6-4.6L12 2.8 6 8.8 0 2.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 22px;
}

.auth-field select:invalid,
.auth-field select option[value=""] {
  color: #616161;
}

.auth-field select:focus {
  outline: none;
  border-bottom-color: #0067b8;
  border-bottom-width: 2px;
  padding-bottom: 9px;
}

.auth-field input:focus {
  outline: none;
  border-bottom-color: #0067b8;
  border-bottom-width: 2px;
  padding-bottom: 9px;
}

.auth-status {
  margin: 0;
  font-size: 0.9rem;
  color: #2f6b3a;
}

.auth-status.is-error {
  color: #b42318;
}

.auth-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.auth-switch-link {
  color: #0067b8;
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

.auth-switch-link:hover {
  text-decoration: underline;
  color: #004578;
}

.auth-primary {
  margin: 0;
  width: auto;
  flex-shrink: 0;
  padding: 10px 22px;
  border-radius: 0;
  background: #071e49;
  color: #fff;
  font-family: "Segoe UI", Lato, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-primary:hover {
  filter: brightness(1.12);
}

@media (max-width: 520px) {
  .auth-dialog {
    width: calc(100vw - 32px);
    padding: 40px 28px 28px;
  }

  .auth-form {
    gap: 22px;
  }

  .auth-footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-primary {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .landing-top {
    height: 72px;
    min-height: 72px;
    padding: 0 16px;
  }

  .landing-logo {
    height: 56px;
    max-width: 68vw;
  }

  .landing-auth-nav {
    gap: 16px;
  }

  .landing-auth-link {
    font-size: 14px;
    line-height: 20px;
  }

  .landing-hero {
    aspect-ratio: 4 / 3;
    max-height: 420px;
  }

  .landing-about {
    padding: 44px 20px 56px;
  }
}

.logo {
  display: block;
  height: 58px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  outline: none;
  border: 0;
}

.shell {
  display: flex;
  height: calc(100vh - var(--header-height));
}

.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  font-family: var(--font-sidebar);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 8px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  color: #555555;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: var(--hover);
}

.nav-item.is-active {
  background: #e8e8e8;
  color: #333333;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #555555;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.nav-item.is-active .nav-icon {
  stroke: #333333;
}

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.profile:hover {
  background: var(--hover);
}

.avatar {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
}

.avatar > img,
.avatar > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar:not(.has-photo) > img {
  display: none !important;
}

.avatar.has-photo > svg {
  display: none !important;
}

.profile-photo:not(.has-photo) .profile-photo-avatar > img {
  display: none !important;
}

.profile-photo.has-photo .profile-photo-avatar > svg {
  display: none !important;
}

.profile-name {
  font-size: 14px;
  font-weight: 400;
  color: #333333;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: #fff;
  overflow: auto;
}

.main:has(#page-calendar.is-active) {
  overflow: hidden;
}

.page {
  display: none;
  min-height: 100%;
}

.page.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#page-home {
  flex: 1 0 auto;
  align-items: center;
  width: 100%;
  min-height: 100%;
  height: auto;
  background-color: #071e49;
  background-image: url("../assets/home-bg.png");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: local;
}

.home-cards {
  display: grid;
  grid-template-columns: 455px 455px;
  align-self: center;
  gap: 36px 40px;
  width: max-content;
  max-width: calc(100% - 48px);
  padding: 40px 0 80px;
}

.home-card {
  display: flex;
  flex-direction: column;
  width: 455px;
  height: 585px;
  max-width: 100%;
  padding: 32px 32px 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.home-card-title {
  margin: 0;
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.home-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
  padding-top: 64px;
  text-align: center;
}

.home-card-empty-title {
  margin: 0 0 4px;
  color: #4a4a4a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.home-card-empty-copy {
  margin: 0;
  color: #8a8a8a;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.home-card-link {
  align-self: center;
  color: #9e7d51;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-card-link:hover {
  color: #86683f;
}

.home-event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.home-event-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-event-list strong {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.home-event-list span {
  color: #8a8a8a;
  font-size: 12px;
}

.import-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 30, 73, 0.45);
}

.import-modal[hidden] {
  display: none;
}

.import-dialog {
  position: relative;
  width: min(520px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.import-dialog h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 20px;
}

.import-copy,
.import-hint {
  margin: 0 0 16px;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
}

.import-hint {
  margin-top: 8px;
}

.import-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 22px 16px;
  border: 1.5px dashed #c5c5c5;
  border-radius: 12px;
  background: #fafafa;
  text-align: center;
  cursor: pointer;
}

.import-drop.is-dragover {
  border-color: var(--navy);
  background: #f3f6fb;
}

.import-drop strong {
  color: var(--navy);
  font-size: 14px;
}

.import-drop span,
.import-drop em {
  color: #666;
  font-size: 12px;
  font-style: normal;
}

.import-drop em:empty {
  display: none;
}

.import-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  /* Let drag/drop hit the label; clicks still open via label[for] */
  pointer-events: none;
}

.import-preview {
  margin: -6px 0 14px;
}

.import-preview img {
  display: block;
  max-width: 100%;
  max-height: 160px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
}

.import-status {
  margin: 0 0 12px;
  color: #2e7d32;
  font-size: 13px;
}

.import-status.is-error {
  color: #c62828;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.import-actions button {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.import-actions button:hover {
  background: var(--hover);
}

.import-primary {
  background: var(--navy);
  color: #fff;
}

.import-primary:hover {
  background: #0b2c66;
  color: #fff;
}

.calendar {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

#page-calendar.is-active {
  overflow: hidden;
}

.cal-week,
.cal-day {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.cal-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.cal-sticky-chrome {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #fff;
  box-shadow: 0 1px 0 #ebebeb;
}

.cal-week-head,
.cal-day-head {
  display: grid;
  flex-shrink: 0;
  border-top: 1px solid #ebebeb;
  border-bottom: 0;
  background: #fff;
}

.cal-week-head {
  grid-template-columns: 72px repeat(7, 1fr);
}

.cal-day-head {
  grid-template-columns: 72px 1fr;
}

.cal-allday-row {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: 72px repeat(var(--allday-days, 7), minmax(0, 1fr));
  grid-template-rows: repeat(var(--allday-lanes, 1), auto);
  gap: 3px 0;
  align-items: start;
  padding: 4px 0 6px;
  border-bottom: 1px solid #ebebeb;
  background: #fff;
  max-height: 132px;
  overflow-x: hidden;
  overflow-y: auto;
}

.cal-day .cal-allday-row {
  grid-template-columns: 72px minmax(0, 1fr);
}

.cal-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.cal-main.is-topics-collapsed .cal-topics {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.cal-topics {
  display: flex;
  flex-direction: column;
  width: 248px;
  flex-shrink: 0;
  padding: 14px 16px 20px;
  border-top: 1px solid #ebebeb;
  border-right: 1px solid var(--line);
  background: #fafafa;
  overflow: auto;
  transition:
    width 0.2s ease,
    padding 0.2s ease,
    opacity 0.15s ease,
    border-right-width 0.2s ease;
}

.mini-cal {
  margin-bottom: 22px;
  padding: 4px 2px 2px;
}

.mini-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-cal-label {
  margin: 0;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mini-cal-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mini-cal-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 13px;
  color: #c7c7cc;
}

.mini-cal-nav button:hover {
  color: #8e8e93;
}

.mini-cal-nav svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 0 4px;
}

.mini-dows span {
  color: #c7c7cc;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  text-align: center;
}

.mini-grid {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mini-week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.mini-week.is-current::before {
  content: "";
  position: absolute;
  inset: 3px 1px;
  border-radius: 8px;
  background: #e8e8ed;
}

.mini-day {
  position: relative;
  z-index: 1;
  height: 26px;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 600;
  line-height: 26px;
  text-align: center;
  border-radius: 7px;
}

.mini-day.is-outside {
  color: #d1d1d6;
  font-weight: 500;
}

.mini-day.is-today {
  background: #ef5343;
  color: #fff;
  font-weight: 700;
}

.mini-day.is-selected {
  background: #3a3a3c;
  color: #fff;
}

.mini-day:hover:not(.is-today):not(.is-selected) {
  background: rgba(0, 0, 0, 0.05);
}

.cal-topic-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cal-topic-group {
  display: flex;
  flex-direction: column;
}

.cal-topics-label {
  margin: 0 2px 10px;
  overflow: hidden;
  color: #8e8e93;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-topic-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cal-topic {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}

.cal-topic:hover {
  background: rgba(0, 0, 0, 0.03);
}

.cal-topic-swatch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
}

.cal-topic-swatch {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--topic);
  flex-shrink: 0;
}

.cal-topic.is-off .cal-topic-swatch {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--topic);
}

.cal-topic.is-off .cal-topic-name {
  color: #c7c7cc;
}

.cal-topic-name-btn {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  text-align: left;
  border-radius: 6px;
}

.cal-topic-name-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
}

.cal-topic-name-btn:disabled {
  cursor: default;
}

.cal-topic-name {
  overflow: hidden;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-topic-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  color: #c7c7cc;
  font-size: 15px;
  line-height: 1;
}

.cal-topic-remove:hover {
  color: #3a3a3c;
}

.cal-topic-add {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 4px 2px;
  width: 100%;
  color: #c7c7cc;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
}

.cal-topic-add:hover {
  background: rgba(0, 0, 0, 0.03);
  color: #8e8e93;
}

.cal-topic-add-plus {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 12px;
  flex-shrink: 0;
}

.cal-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cal-topics-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  color: #3a3a3c;
}

.cal-topics-toggle:hover {
  background: var(--hover);
}

.cal-topics-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-topics-toggle[aria-expanded="false"] svg {
  opacity: 0.72;
}

.cal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}

.cal-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.cal-import-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.cal-import-btn:hover {
  background: var(--hover);
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 10px;
  border-radius: 6px;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 500;
}

.cal-nav button:hover {
  background: var(--hover);
}

.cal-nav svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cal-views {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f7;
}

.cal-views button {
  padding: 5px 12px;
  border-radius: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
}

.cal-views button.is-active {
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cal-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(6, 1fr);
  flex: 1;
  min-height: 0;
  border-top: 1px solid #ebebeb;
}

.cal-dow {
  padding: 8px 12px 10px;
  color: #8e8e93;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.cal-cell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid #ebebeb;
  border-right: 1px solid #ebebeb;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.cal-cell:nth-child(7n) {
  border-right: 0;
}

.cal-date {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  color: #3a3a3c;
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  border-radius: 7px;
}

.cal-cell.is-outside .cal-date {
  color: #c7c7cc;
  font-weight: 500;
}

.cal-cell.is-today .cal-date {
  background: #ef5343;
  color: #fff;
  font-weight: 700;
}

.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 32px 6px 6px;
  overflow: hidden;
}

.cal-chip {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 2px 6px 2px 8px;
  border: 0;
  border-left: 3px solid var(--event, var(--navy));
  border-radius: 5px;
  background: var(--event-bg, #dce6f8);
  color: var(--event, var(--navy));
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip.is-striped {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--event-bg, #dce6f8),
    var(--event-bg, #dce6f8) 3px,
    rgba(255, 255, 255, 0.65) 3px,
    rgba(255, 255, 255, 0.65) 6px
  );
}

.cal-chip.is-more {
  border-left: 0;
  background: #ececf0;
  color: #555;
}

.cal-allday-gutter {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px 8px 4px 0;
  border-right: 1px solid #ebebeb;
  z-index: 0;
}

.cal-allday-gutter span {
  color: #8e8e93;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  text-align: right;
}

.cal-allday-col {
  min-width: 0;
  min-height: 28px;
  border-right: 1px solid #ebebeb;
  pointer-events: none;
  z-index: 0;
}

.cal-allday-col.is-last {
  border-right: 0;
}

.cal-allday-event {
  display: block;
  box-sizing: border-box;
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0 3px;
  justify-self: stretch;
  overflow: hidden;
  padding: 4px 7px 4px 8px;
  border: 0;
  border-left: 3.5px solid var(--event, var(--navy));
  border-radius: 7px;
  background: var(--event-bg, #dce6f8);
  color: var(--event, var(--navy));
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  z-index: 1;
}

.cal-allday-event.is-striped {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--event-bg, #dce6f8),
    var(--event-bg, #dce6f8) 4px,
    rgba(255, 255, 255, 0.62) 4px,
    rgba(255, 255, 255, 0.62) 8px
  );
}

.cal-allday-event strong,
.cal-allday-event span {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.cal-allday-event strong {
  font-weight: 600;
}

.cal-allday-event span {
  opacity: 0.88;
  font-weight: 400;
  font-size: 10px;
}

.cal-head-gutter {
  border-right: 1px solid #ebebeb;
}

.cal-head-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 12px;
  border-right: 1px solid #ebebeb;
}

.cal-head-day:last-child {
  border-right: 0;
}

.cal-head-dow {
  color: #8e8e93;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cal-head-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 600;
  border-radius: 8px;
}

.cal-head-day.is-today .cal-head-dow {
  color: #ef5343;
  font-weight: 600;
}

.cal-head-day.is-today .cal-head-num {
  background: #ef5343;
  color: #fff;
  font-weight: 700;
}

.cal-time-grid {
  --hour-height: 56px;
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: calc(24 * var(--hour-height));
}

.cal-hours {
  position: relative;
}

.cal-hour {
  position: relative;
  height: var(--hour-height);
}

.cal-hour span {
  position: absolute;
  top: 0;
  right: 8px;
  color: #8e8e93;
  font-size: 11px;
  line-height: 1;
  transform: translateY(-50%);
}

.cal-hour:first-child span {
  display: none;
}

.cal-cols {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day .cal-cols {
  grid-template-columns: 1fr;
}

.cal-col {
  position: relative;
  border-left: 1px solid #ebebeb;
}

.cal-slot {
  height: var(--hour-height);
  border-bottom: 1px solid #f0f0f0;
}

.cal-event {
  position: absolute;
  left: 4px;
  right: 4px;
  z-index: 1;
  overflow: hidden;
  padding: 4px 7px 4px 8px;
  border: 0;
  border-left: 3.5px solid var(--event, var(--navy));
  border-radius: 7px;
  background: var(--event-bg, #dce6f8);
  color: var(--event, var(--navy));
  font-size: 11px;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
}

.cal-event.is-striped {
  background-image: repeating-linear-gradient(
    -45deg,
    var(--event-bg, #dce6f8),
    var(--event-bg, #dce6f8) 4px,
    rgba(255, 255, 255, 0.62) 4px,
    rgba(255, 255, 255, 0.62) 8px
  );
}

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

.cal-event strong {
  font-weight: 600;
}

.cal-event span {
  opacity: 0.88;
  font-weight: 400;
  font-size: 10px;
}


.event-modal {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(32, 33, 36, 0.45);
}

.event-modal[hidden] {
  display: none;
}

.event-dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 18px 20px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.event-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #5f6368;
}

.event-close:hover {
  background: #f1f3f4;
}

.event-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.event-title-input {
  width: calc(100% - 44px);
  margin: 8px 0 14px;
  padding: 6px 2px 10px;
  border: 0;
  border-bottom: 1px solid #dadce0;
  border-radius: 0;
  color: #3c4043;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.event-title-input:focus {
  outline: none;
  border-bottom-color: #1a73e8;
  box-shadow: 0 1px 0 #1a73e8;
}

.event-title-input::placeholder {
  color: #80868b;
}

.event-type-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
}

.event-type-tabs span {
  padding: 7px 14px;
  border-radius: 999px;
  color: #3c4043;
  font-size: 13px;
  font-weight: 500;
}

.event-type-tabs span.is-active {
  background: #e8f0fe;
  color: #1967d2;
}

.event-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 4px 8px;
  padding: 8px 0;
}

.event-row-icon {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  color: #5f6368;
}

.event-row-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-row-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.event-chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.event-chip-input,
.event-plain-input {
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: #f1f3f4;
  color: #3c4043;
  font: inherit;
  font-size: 14px;
}

.event-chip-input:focus,
.event-plain-input:focus {
  outline: 2px solid rgba(26, 115, 232, 0.28);
  background: #fff;
}

.event-time-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-time-pair[hidden] {
  display: none;
}

.event-time-dash {
  color: #5f6368;
}

.event-inline-check,
.event-series-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3c4043;
  font-size: 13px;
  font-weight: 500;
}

.event-series-check {
  margin: 8px 0 0 48px;
}

.event-series-check[hidden] {
  display: none;
}

.event-repeat {
  position: relative;
  align-self: flex-start;
}

.event-repeat-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  color: #1967d2;
  font-size: 13px;
  font-weight: 500;
}

.event-repeat-trigger:hover {
  background: #e8f0fe;
}

.event-repeat-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 6;
  min-width: 240px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border: 1px solid #ebebeb;
}

.event-repeat-menu[hidden] {
  display: none;
}

.event-repeat-option {
  padding: 9px 12px;
  border-radius: 8px;
  color: #3c4043;
  font-size: 13px;
  cursor: pointer;
}

.event-repeat-option:hover,
.event-repeat-option.is-selected {
  background: #f1f3f4;
}

.event-desc-input {
  resize: vertical;
  min-height: 42px;
}

.topic-picker {
  position: relative;
  max-width: 260px;
}

.topic-picker-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}

.topic-picker-trigger.event-chip-input {
  padding: 8px 12px;
}

.topic-picker-swatch,
.topic-picker-option-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--topic, #8e8e93);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.topic-picker-label,
.topic-picker-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-picker-caret {
  color: #5f6368;
  font-size: 11px;
}

.topic-picker-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  max-height: 220px;
  overflow: auto;
}

.topic-picker-menu[hidden] {
  display: none;
}

.topic-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.topic-picker-option:hover,
.topic-picker-option.is-selected {
  background: #e8f0fe;
}

.topic-picker-option-swatch {
  background: var(--topic);
}

.topic-picker-check {
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
}

.event-error {
  margin: 10px 0 0 48px;
  color: #d93025;
  font-size: 13px;
}

.event-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ebebeb;
}

.event-delete-link {
  margin-right: auto;
  color: #d93025;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
}

.event-delete-link:hover {
  background: #fce8e6;
}

.event-save {
  min-width: 78px;
  padding: 9px 22px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.event-save:hover {
  background: #1765cc;
}

.event-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #333;
  font-size: 13px;
  font-weight: 600;
}

.event-field input,
.event-field select,
.event-field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-weight: 400;
  color: #1d1d1f;
}

.topic-edit-modal {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 30, 73, 0.45);
}

.topic-edit-modal[hidden] {
  display: none;
}

.topic-edit-dialog {
  width: min(380px, 100%);
  padding: 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.topic-edit-dialog h2 {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 20px;
}

.topic-color-picker {
  position: relative;
}

.topic-color-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f1f3f4;
}

.topic-color-trigger:hover {
  background: #e8eaed;
}

.topic-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--topic, #5b8def);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.topic-color-caret {
  color: #5f6368;
  font-size: 11px;
}

.topic-color-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.topic-color-panel[hidden] {
  display: none;
}

.topic-color-grid {
  display: grid;
  grid-template-columns: repeat(8, 22px);
  gap: 8px;
  justify-content: start;
}

.topic-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--topic);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.topic-color-swatch.is-selected {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy);
}

.topic-color-swatch:hover {
  transform: scale(1.08);
}

.topic-color-custom-btn {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #1967d2;
  font-size: 13px;
  font-weight: 600;
}

.topic-color-custom-btn:hover {
  background: #e8f0fe;
}

.topic-color-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  color: #5f6368;
  font-size: 13px;
  font-weight: 400;
}

.topic-color-custom[hidden] {
  display: none;
}

.topic-color-custom input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
  border: 1px solid #dadce0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.event-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.event-actions button {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.event-actions .event-save {
  min-width: auto;
  border-radius: 8px;
  background: var(--navy);
}

#topic-edit-delete {
  margin-right: auto;
  color: #c62828;
}

.cal-now {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 2px;
  background: #111;
  pointer-events: none;
}

.cal-now::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111;
  transform: translateY(-50%);
}

.cal-now-label {
  position: absolute;
  top: 50%;
  left: -68px;
  width: 58px;
  color: #111;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
  transform: translateY(-50%);
  white-space: nowrap;
}

.curriculum {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.curr-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 28px 16px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.curr-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}

.curr-subtitle {
  margin: 0;
  color: #8e8e93;
  font-size: 13px;
}

.curr-years {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f7;
}

.curr-years button {
  padding: 6px 14px;
  border-radius: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
}

.curr-years button.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.curr-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 28px 32px;
}

.curr-note {
  margin: 16px 0 8px;
  color: #8e8e93;
  font-size: 12px;
  line-height: 1.45;
}

.curr-list {
  display: flex;
  flex-direction: column;
}

.curr-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 88px 120px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.curr-row.is-group {
  grid-template-columns: minmax(0, 1fr) 88px;
  padding-top: 20px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.curr-code {
  color: #1a5fb4;
  font-size: 14px;
  font-weight: 700;
}

.curr-name {
  color: #2f2f2f;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.curr-units {
  color: #2f2f2f;
  font-size: 14px;
  text-align: right;
  white-space: nowrap;
}

.curr-status {
  justify-self: end;
  width: 120px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #6b6b6b;
  font-size: 12px;
  font-weight: 600;
}

.curr-status[data-status="complete"] {
  border-color: #c8e6c9;
  background: #edf7ed;
  color: #2e7d32;
}

.curr-status[data-status="planned"] {
  border-color: #d7c4a3;
  background: #f7f1e6;
  color: #9e7d51;
}

.curr-status[data-status="incomplete"] {
  border-color: #e6e6e6;
  background: #f6f6f6;
  color: #6b6b6b;
}

.curr-elective {
  grid-template-columns: 118px minmax(0, 1fr) 88px 120px;
}

.curr-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  background: #fff;
  color: #2f2f2f;
  font-size: 14px;
}

.curr-input-code {
  color: #2f2f2f;
  font-weight: 400;
}

.curr-row [data-edit-elective] {
  cursor: pointer;
}

.curr-input-name {
  font-weight: 400;
}

.curr-input::placeholder {
  color: #b0b0b0;
  font-weight: 400;
}

.curr-input:focus {
  outline: 2px solid rgba(26, 95, 180, 0.22);
  border-color: #1a5fb4;
  background: #fff;
}

.curr-total {
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  padding: 16px 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.curr-total span:last-child {
  width: 88px;
  text-align: right;
}

.assignments {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.asgn-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px 28px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.asgn-years {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f7;
}

.asgn-years button {
  padding: 6px 14px;
  border-radius: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  outline: none;
  box-shadow: none;
  cursor: pointer;
}

.asgn-years button:focus,
.asgn-years button:focus-visible {
  outline: none;
}

.asgn-years button.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.asgn-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.asgn-courses-empty {
  color: #8e8e93;
  font-size: 13px;
}

.asgn-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}

.asgn-subtitle {
  margin: 0;
  max-width: 720px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.45;
}

.asgn-toolbar-actions {
  display: none;
}

.asgn-courses {
  display: flex;
  flex-wrap: wrap;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f7;
}

.asgn-courses button {
  padding: 6px 14px;
  border-radius: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  outline: none;
  box-shadow: none;
  cursor: pointer;
}

.asgn-courses button:focus,
.asgn-courses button:focus-visible {
  outline: none;
}

.asgn-courses button.is-active {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.asgn-add-course,
.asgn-add-item {
  padding: 7px 14px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.asgn-add-item {
  align-self: flex-start;
  margin-top: 12px;
  background: #fff;
  color: var(--navy);
}

.asgn-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 28px 40px;
}

.asgn-empty {
  padding: 48px 8px;
  color: #8e8e93;
  font-size: 14px;
}

.asgn-course {
  display: flex;
  flex-direction: column;
  padding: 20px 0 12px;
}

.asgn-course + .asgn-course {
  border-top: 1px solid var(--line);
}

.asgn-course-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.asgn-course-head h2 {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.asgn-course-head p {
  margin: 0;
  color: #8e8e93;
  font-size: 13px;
}

.asgn-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.asgn-mark-label {
  color: #8e8e93;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.asgn-mark-score {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
}

.asgn-mark-letter {
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f4a8c0;
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.asgn-table-wrap {
  overflow: auto;
  border: 1px solid #c5c5c5;
  border-radius: 0;
}

.asgn-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.asgn-table th,
.asgn-table td {
  padding: 4px 8px;
  border: 1px solid #c5c5c5;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.asgn-table thead th {
  background: #fff;
  color: #1d1d1f;
  font-weight: 700;
}

.asgn-table thead th:nth-child(1) {
  width: 72px;
  text-align: left;
}

.asgn-table thead th:nth-child(2) {
  width: auto;
}

.asgn-table thead th:nth-child(3) {
  width: 148px;
}

.asgn-table thead th:nth-child(4),
.asgn-table thead th:nth-child(5) {
  width: 92px;
}

.asgn-table thead th:nth-child(6) {
  width: 72px;
}

.asgn-table thead th:nth-child(7),
.asgn-table tbody td:nth-child(7),
.asgn-table tfoot td:nth-child(7) {
  width: 28px;
  padding-left: 2px;
  padding-right: 2px;
  text-align: center;
}

.asgn-table tbody tr:nth-child(odd) td {
  background: var(--asgn-odd, #d4dff0);
  color: #1d1d1f;
}

.asgn-table tbody tr:nth-child(even) td {
  background: var(--asgn-even, #e6eef8);
  color: #1d1d1f;
}

.asgn-table tfoot td {
  background: #fff;
  border-top: 1px solid #c5c5c5;
}

.asgn-table tfoot .asgn-total-score,
.asgn-table tfoot .asgn-total-grade {
  background: var(--asgn-accent, #f4a8c0);
  color: #1d1d1f;
  font-weight: 700;
  text-align: center;
}

.asgn-grade-cell {
  text-align: left;
  font-weight: 600;
}

.asgn-empty-row td {
  text-align: left;
  font-weight: 500;
}

.asgn-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.asgn-title-input {
  font-weight: 600;
}

.asgn-table td.asgn-due,
.asgn-table td.asgn-num,
.asgn-table td.asgn-grade-cell {
  display: table-cell;
}

.asgn-due {
  white-space: nowrap;
  text-align: left;
}

.asgn-due .asgn-input {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.asgn-due-sep {
  color: rgba(7, 30, 73, 0.55);
  font-weight: 600;
}

.asgn-num {
  text-align: left;
  white-space: nowrap;
}

.asgn-num .asgn-input,
.asgn-num-input {
  width: 52px;
  display: inline-block;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.asgn-num span {
  display: inline;
  margin-left: 2px;
}

.asgn-input:focus {
  outline: 2px solid rgba(7, 30, 73, 0.28);
  outline-offset: 1px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
}

.asgn-status-cell {
  text-align: left;
}

.asgn-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #3a4a6b;
  position: relative;
  z-index: 1;
}

.asgn-check svg {
  width: 16px;
  height: 16px;
  display: block;
  pointer-events: none;
}

.asgn-check rect {
  fill: rgba(255, 255, 255, 0.75);
  stroke: #3a4a6b;
  stroke-width: 1.6;
}

.asgn-check path {
  fill: none;
  stroke: transparent;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asgn-check.is-complete rect {
  fill: #3a4a6b;
  stroke: #3a4a6b;
}

.asgn-check.is-complete path {
  stroke: #fff;
}

.asgn-check:focus-visible {
  outline: 2px solid rgba(7, 30, 73, 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.asgn-actions {
  text-align: center;
}

.asgn-delete {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: rgba(7, 30, 73, 0.7);
  font-size: 15px;
  line-height: 1;
}

.asgn-delete:hover {
  background: rgba(7, 30, 73, 0.12);
  color: #7a1020;
}

.asgn-input[type="date"] {
  color-scheme: light;
}

.profile-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f4f5f7;
}

.profile-hero {
  background: #fff;
}

.profile-banner {
  position: relative;
  height: 210px;
  background-color: #071e49;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.profile-banner-edit {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #3c4043;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.profile-banner-edit:hover {
  background: #fff;
}

.profile-banner-edit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-identity {
  position: relative;
  display: flex;
  gap: 18px;
  padding: 0 28px 22px;
  min-height: 88px;
}

.profile-photo {
  position: relative;
  width: 112px;
  height: 112px;
  margin-top: -56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
  cursor: pointer;
}

.profile-photo-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.profile-photo-avatar > img,
.profile-photo-avatar > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-edit {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.profile-photo-edit svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #5f6368;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-meta {
  padding-top: 14px;
  min-width: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-display-name {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.profile-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  color: #6b6b6b;
  font-size: 14px;
}

.profile-detail svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: #8e8e93;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #9e7d51;
}

.profile-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.profile-copy.is-copied {
  color: #2e7d32;
}

.profile-progress {
  margin: 18px 28px 32px;
  padding: 20px 22px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.profile-progress-title {
  margin: 0 0 14px;
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 700;
}

.profile-progress-track {
  height: 10px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}

.profile-progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #1a73e8;
  transition: width 0.25s ease;
}

.profile-years {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.profile-year {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f3f3f3;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
}

.profile-year-mark {
  display: flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.profile-year-mark svg {
  width: 100%;
  height: 100%;
}

/* Grades */
.grades {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px 32px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.grades-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.grades-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}

.grades-subtitle {
  margin: 0;
  max-width: 520px;
  color: #8e8e93;
  font-size: 13px;
  line-height: 1.45;
}

.grades-toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.grades-years {
  display: flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f7f7;
}

.grades-years button {
  padding: 5px 12px;
  border-radius: 6px;
  color: #555;
  font-size: 13px;
  font-weight: 500;
}

.grades-years button.is-active {
  background: #fff;
  color: #1d1d1f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.grades-import-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.grades-import-btn:hover {
  background: #0b2c66;
}

.grades-edit-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.grades-edit-btn:hover {
  background: #f3f6fb;
}

.exam-import-colour {
  margin: 0 0 14px;
}

.grades-summary {
  display: flex;
  gap: 12px;
}

.grades-summary:empty {
  display: none;
}

.grades-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 280px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f9fc;
}

.grades-summary-label {
  display: block;
  margin-bottom: 2px;
  color: #8e8e93;
  font-size: 12px;
  font-weight: 600;
}

.grades-summary-gpa {
  color: #1d1d1f;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.grades-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #5f6368;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.grades-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grades-empty {
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: #5f6368;
  text-align: center;
}

.grades-empty p {
  margin: 0;
  font-size: 14px;
}

.grades-section-title {
  margin: 0 0 10px;
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 700;
}

.grades-table-wrap {
  overflow: auto;
  border: 1px solid #c5c5c5;
}

.grades-scroll-hint {
  display: none;
}

.grades-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.grades-table th,
.grades-table td {
  padding: 4px 8px;
  border: 1px solid #c5c5c5;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.grades-table thead th {
  background: #fff;
  color: #1d1d1f;
  font-weight: 700;
}

.grades-table thead th:nth-child(1) {
  width: 120px;
}

.grades-table thead th:nth-child(2) {
  width: 110px;
}

.grades-table thead th:nth-child(4),
.grades-table thead th:nth-child(5) {
  width: 80px;
}

.grades-table tbody tr:nth-child(odd) td {
  background: #d4dff0;
  color: #1d1d1f;
}

.grades-table tbody tr:nth-child(even) td {
  background: #e6eef8;
  color: #1d1d1f;
}

.grades-code,
.grades-letter {
  font-weight: 700;
}

.grades-letter-select,
.transcript-review-letter {
  font: inherit;
  font-weight: 700;
  border: 1px solid #b7c6dc;
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  padding: 4px 6px;
  min-width: 4.5rem;
}

.grades-term-input {
  width: 100%;
  min-width: 7.5rem;
  font: inherit;
  font-weight: 600;
  border: 1px solid #b7c6dc;
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  padding: 4px 6px;
}

.grades-code-input,
.grades-title-input,
.grades-units-input {
  width: 100%;
  font: inherit;
  border: 1px solid #b7c6dc;
  border-radius: 6px;
  background: #fff;
  color: #1d1d1f;
  padding: 4px 6px;
}

.grades-code-input {
  min-width: 6.5rem;
  font-weight: 700;
}

.grades-title-input {
  min-width: 10rem;
}

.grades-units-input {
  min-width: 4rem;
  max-width: 5rem;
  font-weight: 600;
  text-align: right;
}

.grades-edit-dialog {
  width: min(920px, 100%);
}

.grades-edit-table-wrap {
  max-height: min(52vh, 480px);
  margin-bottom: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.grades-edit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.grades-edit-table th,
.grades-edit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.grades-edit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: #555;
  font-size: 12px;
  font-weight: 600;
}

.grades-edit-table tbody tr:last-child td {
  border-bottom: none;
}

.grades-edit-remove {
  padding: 4px 8px;
  border-radius: 6px;
  color: #b42318;
  font-size: 12px;
  font-weight: 600;
}

.grades-edit-remove:hover {
  background: #fef3f2;
}

.grades-edit-add {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1.5px dashed #b7c6dc;
  border-radius: 10px;
  background: #fafafa;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.grades-edit-add:hover {
  border-color: var(--navy);
  background: #f3f6fb;
}

.grades-edit-empty {
  margin: 0;
  padding: 24px 16px;
  color: #8e8e93;
  font-size: 13px;
  text-align: center;
}

.grades-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.transcript-review {
  margin-top: 12px;
}

.transcript-review-copy {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: #4a4a4f;
}

.transcript-review-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.transcript-review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.transcript-review-table th,
.transcript-review-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e8e8ea;
}

.transcript-review-table th {
  position: sticky;
  top: 0;
  background: #f6f7f9;
  font-weight: 600;
}

.transcript-raw {
  margin-top: 10px;
  font-size: 0.85rem;
}

.transcript-raw pre {
  max-height: 160px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  background: #f6f7f9;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.grades-table tfoot td {
  background: #fff;
}

.grades-table tfoot .grades-total-units,
.grades-table tfoot .grades-total-gpa {
  background: #f4a8c0;
  color: #1d1d1f;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }

  .logo {
    height: 46px;
    max-width: min(260px, 52vw);
  }

  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    z-index: 40;
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }

  body.is-nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.is-nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.is-nav-open .nav-backdrop[hidden] {
    display: block;
  }

  /* No page-level horizontal scroll; nested panes may still scroll intentionally. */
  .app-shell,
  .shell,
  .main,
  .page {
    max-width: 100%;
    overflow-x: hidden;
  }

  #page-home {
    align-items: stretch;
    padding: 0 16px;
  }

  .home-cards {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    padding: 20px 0 32px;
  }

  .home-card {
    width: 100%;
    height: auto;
    min-height: 280px;
    padding: 22px 20px 18px;
  }

  .home-card-body {
    padding-top: 28px;
  }

  .profile-progress {
    margin: 12px 16px 24px;
    padding: 16px;
  }

  .profile-years {
    grid-template-columns: 1fr;
  }

  .cal-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 10px;
    padding: 10px 12px 8px;
  }

  .cal-toolbar-right {
    order: -1;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cal-toolbar-left {
    width: 100%;
    min-width: 0;
  }

  .cal-title {
    font-size: 16px;
  }

  .cal-topics-toggle {
    display: none !important;
  }

  .cal-main .cal-topics,
  .cal-main.is-topics-collapsed .cal-topics {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    border-right-width: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  .cal-views button {
    padding: 5px 10px;
    font-size: 12px;
  }

  .cal-body,
  .cal-scroll,
  .cal-week,
  .cal-day,
  .cal-month {
    max-width: 100%;
    overflow-x: hidden;
  }

  .curr-row {
    grid-template-columns: minmax(0, 1fr) minmax(108px, 120px);
    gap: 8px;
  }

  .curr-row.is-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .curr-name,
  .curr-units,
  .curr-input-name {
    display: none !important;
  }

  .curr-input-code {
    grid-column: 1;
  }

  .grades {
    padding: 16px 12px 28px;
  }

  .grades-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin: 0 0 8px;
    color: #5c5c5c;
    font-size: 12px;
    font-weight: 600;
  }

  .grades-table-wrap {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    background:
      linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center / 28px 100% no-repeat local,
      linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center / 36px 100% no-repeat local,
      radial-gradient(farthest-side at right, rgba(0, 0, 0, 0.18), transparent) right center / 14px 100% no-repeat local;
    background-attachment: local, local, scroll;
  }
}

@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-backdrop {
    transition: none;
  }
}
