:root {
  --bg: #ffffff;
  --text: #1a1c1f;
  --muted: #5b6670;
  --border: rgba(26, 28, 31, 0.14);

  --brand: #004b8d; /* blue */
  --brand-2: #0b2b57; /* deep blue */
  --accent: #d4a017; /* gold */

  --tint: #f3f7ff;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.12);

  --serif: "Libre Caslon Text", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial,
    sans-serif;

  --radius: 14px;
  --container: 1180px;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #fff, var(--tint));
  color: var(--text);
  font: 16px/1.55 var(--sans);
}

/* Background video */
.video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #000;
}

.video-bg__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  border: 0;
  transform: scale(1.12);
  transform-origin: center;
  filter: blur(8px);
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-data: reduce) {
  .video-bg {
    display: none;
  }
}

/* Ensure app UI layers above background video */
.portal-header,
.portal-shell,
.auth-main {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(var(--container), calc(100% - 2.5rem));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 999;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.45rem 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn--lg {
  padding: 0.7rem 1.1rem;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 75, 141, 0.22);
}

.btn--primary:hover {
  filter: brightness(0.98);
}

.btn--secondary {
  background: #fff;
  border-color: rgba(0, 75, 141, 0.25);
  color: rgba(0, 75, 141, 0.98);
}

.btn--secondary:hover {
  border-color: rgba(0, 75, 141, 0.5);
}

.btn--ghost-dark {
  background: transparent;
  border-color: var(--border);
  color: rgba(26, 28, 31, 0.82);
}

.btn--ghost-dark:hover {
  border-color: rgba(26, 28, 31, 0.28);
}

/* Portal header */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 0;
  box-shadow: none;
}

.portal-header .container {
  width: 100%;
  margin-inline: 0;
}

.portal-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.portal-header__inner--classroom {
  grid-template-columns: 1fr auto;
}

.portal-header--classroom {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(26, 28, 31, 0.12);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.classroom-topbar {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.classroom-topbar__title {
  font-weight: 800;
  color: rgba(0, 75, 141, 0.98);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classroom-topbar__title:hover {
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(212, 160, 23, 0.8);
}

.portal-header--auth .portal-header__inner {
  grid-template-columns: auto;
  justify-content: start;
  padding: 1.25rem 1.75rem;
}

.portal-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 0.75rem;
}

.sidebar-toggle {
  display: none;
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-weight: 800;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.portal-brand__mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.portal-brand__logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

.portal-brand__text {
  display: grid;
  line-height: 1.05;
}

.portal-brand__name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.015em;
  font-variant: small-caps;
  font-feature-settings: "kern" 1, "liga" 1;
  color: var(--accent);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 2px 0 rgba(0, 0, 0, 0.25),
    0 12px 28px rgba(0, 0, 0, 0.45);
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .portal-brand__name {
    color: transparent;
    background: linear-gradient(
      110deg,
      #b88400 0%,
      #ffd56a 18%,
      #fff3c4 25%,
      #ffd56a 32%,
      #c99300 48%,
      #ffd56a 66%,
      #fff3c4 74%,
      #b88400 100%
    );
    background-repeat: repeat;
    background-size: 200% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-stroke: 0.6px rgba(60, 33, 0, 0.35);
    will-change: background-position;
    animation: gold-shine 6s linear infinite;
  }
}

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .portal-brand__sub {
    color: transparent;
    background: linear-gradient(
      110deg,
      #aeb6bf 0%,
      #f7f9fb 18%,
      #ffffff 26%,
      #d9dde2 36%,
      #9aa3ad 52%,
      #d9dde2 70%,
      #ffffff 78%,
      #aeb6bf 100%
    );
    background-repeat: repeat;
    background-size: 220% 100%;
    background-position: 0% 50%;
    -webkit-background-clip: text;
    background-clip: text;
    will-change: background-position;
    animation: silver-shine 7s linear infinite;
  }
}

@keyframes gold-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes silver-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 220% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-brand__name {
    animation: none !important;
  }
  .portal-brand__sub {
    animation: none !important;
  }
}

.portal-brand__sub {
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.16em;
  font-variant: small-caps;
  font-size: 0.9rem;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22),
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 10px 22px rgba(0, 0, 0, 0.5);
}

.portal-search input {
  width: min(520px, 100%);
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  background: #fff;
  outline: none;
}

.portal-search input:focus {
  border-color: rgba(0, 75, 141, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 75, 141, 0.12);
}

.portal-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  justify-content: end;
}

.portal-user__name {
  color: rgba(26, 28, 31, 0.78);
  font-weight: 800;
}

.user-menu__button {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

.user-menu__button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.user-menu__button:focus-visible {
  outline: 2px solid rgba(212, 160, 23, 0.9);
  outline-offset: 2px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 180px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 20, 24, 0.78);
  backdrop-filter: blur(8px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.85rem;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.user-menu__item--danger {
  color: rgba(255, 200, 200, 0.95);
}

.user-menu__item--danger:hover,
.user-menu__item--danger:focus-visible {
  background: rgba(255, 70, 70, 0.18);
}

/* Portal shell */
.portal-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 70px);
}

.portal-shell--classroom {
  grid-template-columns: 240px 1fr;
}

.portal-sidebar {
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
}

.classroom-sidebar__meta {
  padding: 0.9rem 1rem 0.25rem;
}

.classroom-sidebar__term {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(0, 75, 141, 0.95);
}

.portal-nav {
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
}

.portal-nav--classroom {
  padding-top: 0.25rem;
}

.portal-shell--classroom .portal-nav__link {
  border-radius: 10px;
  color: rgba(0, 75, 141, 0.96);
  font-weight: 700;
  padding: 0.55rem 0.65rem;
}

.portal-shell--classroom .portal-nav__link:hover {
  background: rgba(0, 75, 141, 0.07);
}

.portal-shell--classroom .portal-nav__link.is-active {
  background: rgba(0, 75, 141, 0.09);
  border: 1px solid rgba(0, 75, 141, 0.18);
  box-shadow: inset 4px 0 0 rgba(0, 75, 141, 0.9);
}
.portal-nav__link {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  font-weight: 800;
  color: rgba(26, 28, 31, 0.78);
}

.portal-nav__link:hover {
  text-decoration: none;
  background: rgba(0, 75, 141, 0.08);
  color: rgba(26, 28, 31, 0.92);
}

.portal-nav__link.is-active {
  background: rgba(0, 75, 141, 0.085);
  color: rgba(26, 28, 31, 0.95);
  border: 1px solid rgba(212, 160, 23, 0.28);
  box-shadow: inset 4px 0 0 rgba(212, 160, 23, 0.85);
}

.grade-tile {
  align-items: center;
}

.grade-tile__name {
  font-weight: 900;
  color: rgba(26, 28, 31, 0.9);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}

.grade-tile__grade {
  text-align: right;
  min-width: 5.25rem;
}

.grade-tile__letter {
  font-weight: 900;
  font-size: 1.1rem;
  color: rgba(0, 75, 141, 0.95);
  line-height: 1.1;
}

.grade-tile__percent {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: rgba(26, 28, 31, 0.62);
}

.portal-sidebar__footer {
  padding: 0.9rem 1rem 1.2rem;
}

.portal-sidebar__fineprint {
  margin: 0;
  color: rgba(26, 28, 31, 0.6);
  font-size: 0.95rem;
}

.portal-main {
  padding: 1.5rem 0 3rem;
}

.portal-main__inner {
  display: grid;
  gap: 1.25rem;
}

.portal-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.portal-eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: rgba(26, 28, 31, 0.62);
  font-size: 0.85rem;
}

.portal-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.7vw, 2.35rem);
  line-height: 1.1;
  position: relative;
  display: inline-block;
  padding-bottom: 0.35rem;
}

.portal-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 66%;
  max-width: 220px;
  background: var(--accent);
  border-radius: 999px;
}

.portal-titlebar__actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.portal-section {
  display: grid;
  gap: 1rem;
}

.portal-section--two {
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.tile-grid--compact {
  grid-template-columns: 1fr;
}

.tile-grid--rows .tile {
  grid-column: 1 / -1;
}

.tile {
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: transform 140ms ease, box-shadow 140ms ease,
    border-color 140ms ease;
}

.tile:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: rgba(212, 160, 23, 0.45);
  box-shadow: var(--shadow);
}

.tile__kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  font-size: 0.78rem;
  color: rgba(26, 28, 31, 0.6);
}

.tile__kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.16);
}

.tile__title {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.15;
}

.tile__text {
  margin: 0;
  color: var(--muted);
}

.tile--compact {
  padding: 0.85rem 0.9rem;
}

.tile--compact .tile__kicker {
  font-size: 0.72rem;
  margin-bottom: 0.2rem;
}

.tile--compact .tile__kicker::before {
  width: 7px;
  height: 7px;
}

.tile--compact .tile__title {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.tile--compact .tile__text {
  font-size: 0.95rem;
}

.tile--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tile__left {
  min-width: 0;
}

.tile__right {
  text-align: right;
  flex: 0 0 auto;
}

.tile__meta {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: rgba(26, 28, 31, 0.6);
}

.tile__code {
  margin: 0.15rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Announcement actions */
.feed__actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
}

.feed__actions--between {
  justify-content: space-between;
  align-items: center;
}

.feed__status {
  font-weight: 800;
  font-size: 0.95rem;
  color: rgba(26, 28, 31, 0.62);
}

.feed__status--submitted {
  color: rgba(20, 110, 60, 0.95);
}

.module-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.module-card + .module-card {
  margin-top: 0.9rem;
}

.module-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.module-card__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.15;
}

.module-card__desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.module-card__actions {
  display: inline-flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.btn--sm {
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
}

.assignment-form {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}

.assignment-list {
  margin-top: 0.9rem;
}

/* Student submission UI */
.submit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.8rem;
}

.submit-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.25rem 0 0.85rem;
}

.submit-type {
  border: 1px solid rgba(0, 75, 141, 0.25);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(0, 75, 141, 0.98);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  font-weight: 800;
  min-width: 110px;
}

.submit-type.is-active {
  border-color: rgba(0, 75, 141, 0.6);
  box-shadow: inset 0 0 0 2px rgba(0, 75, 141, 0.18);
}

.submit-type:hover {
  border-color: rgba(0, 75, 141, 0.45);
}

.submit-form {
  display: grid;
  gap: 0.75rem;
}

.btn--danger {
  border-color: rgba(200, 40, 40, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: rgba(150, 20, 20, 0.95);
}

.btn--danger:hover {
  border-color: rgba(200, 40, 40, 0.55);
  background: rgba(255, 230, 230, 0.75);
}

@media (max-width: 520px) {
  .tile--row {
    flex-direction: column;
    align-items: stretch;
  }

  .tile__right {
    text-align: left;
  }
}

/* Widgets */
.widget {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 1.05rem 1.1rem;
}

.widget__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.55rem;
  margin-bottom: 0.8rem;
}

.widget__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.widget__link {
  color: rgba(0, 75, 141, 0.98);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.widget__link:hover {
  text-decoration: none;
  box-shadow: inset 0 -2px 0 rgba(212, 160, 23, 0.8);
}

.feed__item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.feed__item:first-child {
  padding-top: 0;
}

.feed__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.people-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: rgba(0, 75, 141, 0.1);
  border: 1px solid rgba(0, 75, 141, 0.22);
  color: rgba(0, 75, 141, 0.95);
}

.people-missing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.4rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: rgba(220, 60, 60, 0.1);
  border: 1px solid rgba(220, 60, 60, 0.22);
  color: rgba(170, 20, 20, 0.95);
}

.feed__meta {
  margin: 0 0 0.25rem;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.feed__title {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.2;
}

.feed__text {
  margin: 0;
  color: var(--muted);
}

.feed__text a,
.announcement__body a {
  color: rgba(0, 75, 141, 0.98);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.feed__text a:hover,
.announcement__body a:hover {
  text-decoration-thickness: 3px;
}

.assignment-submissions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.assignment-submissions .feed__item {
  padding: 0.65rem 0;
}

.assignment-submissions .feed__title {
  font-size: 1.05rem;
}

.assignment-submissions .feed__meta {
  font-size: 0.72rem;
}

.submission-upload {
  display: grid;
  gap: 0.35rem;
}

.submission-upload__link {
  color: rgba(0, 75, 141, 0.98);
  font-weight: 900;
}

.submission-upload__meta {
  margin: 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 700;
  font-size: 0.9rem;
}

.submission-upload__preview {
  width: 100%;
  max-width: 680px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
}

.submission-upload__preview--doc {
  height: 520px;
}

.submission-upload__preview--media {
  max-height: 520px;
}

.gradebook {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.9rem;
}

.gradebook__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  border: 1px solid rgba(0, 75, 141, 0.16);
  border-radius: 16px;
  padding: 0.9rem 0.95rem;
  background: linear-gradient(180deg, rgba(0, 75, 141, 0.04), rgba(255, 255, 255, 0.9));
}

.gradebook__name {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.gradebook__meta {
  margin: 0.15rem 0 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 700;
}

.gradebook__right {
  display: grid;
  gap: 0.6rem;
}

.gradebook__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gradebook__status {
  margin: 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 700;
  font-size: 0.92rem;
}

.gradebook__name--link {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: rgba(0, 75, 141, 0.98);
}

.gradebook__submission {
  margin-top: 0.55rem;
}

.gradebook-head__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.gradebook-head__meta {
  margin: 0.2rem 0 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 800;
}

.grade-settings__categories,
.grade-settings__penalties {
  margin-top: 0.75rem;
}

.grade-settings__subhead {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.grade-settings__list,
.rubric-box__rows {
  display: grid;
  gap: 0.6rem;
}

.grade-settings__row,
.rubric-box__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  align-items: end;
}

.grade-settings__sum {
  margin: 0.4rem 0 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 800;
}

.rubric-box {
  margin-top: 0.8rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 75, 141, 0.14);
  background: rgba(255, 255, 255, 0.86);
}

.rubric-box__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.rubric-box__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.rubric-box__editor {
  margin-top: 0.75rem;
}

.rubric-scores {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.grade-breakdown {
  margin: 0.8rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 75, 141, 0.14);
  background: rgba(255, 255, 255, 0.86);
}

.grade-breakdown__title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1.15rem;
}

.grade-breakdown__list {
  display: grid;
  gap: 0.3rem;
}

.grade-breakdown__row {
  color: rgba(26, 28, 31, 0.72);
  font-weight: 800;
}

.grade-summary {
  margin: 0.25rem 0 1rem;
  padding: 1rem 1.05rem;
  border-radius: 16px;
  border: 1px solid rgba(0, 75, 141, 0.16);
  background: linear-gradient(180deg, rgba(0, 75, 141, 0.06), rgba(255, 255, 255, 0.92));
}

.grade-summary__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.grade-summary__title {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.grade-summary__meta {
  margin: 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.grade-summary__big {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.65rem;
  letter-spacing: 0.02em;
}

.grade-summary__points {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-weight: 800;
}

.grade-summary__points strong {
  color: rgba(0, 75, 141, 0.98);
}

@media (min-width: 620px) {
  .grade-settings__row,
  .rubric-box__row {
    grid-template-columns: 1fr 160px auto;
  }
}

@media (min-width: 860px) {
  .gradebook__row {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }

  .grade-settings__row,
  .rubric-box__row {
    grid-template-columns: 1fr 180px auto;
  }
}

.empty-state {
  margin: 0;
  padding: 0.5rem 0;
  color: rgba(26, 28, 31, 0.62);
  font-weight: 700;
}

.agenda {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.agenda__item {
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 75, 141, 0.16);
  background: linear-gradient(
    180deg,
    rgba(0, 75, 141, 0.07),
    rgba(0, 75, 141, 0.02)
  );
}

.agenda__time {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  font-size: 0.78rem;
  color: rgba(26, 28, 31, 0.62);
}

.agenda__title {
  margin: 0.25rem 0 0;
  font-weight: 900;
}

/* Auth pages */
.auth-main {
  min-height: calc(100vh - 84px);
  display: grid;
  align-items: center;
  padding: 2.25rem 0 3.5rem;
}

.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.12), transparent 48%),
    radial-gradient(circle at 82% 24%, rgba(255, 213, 106, 0.14), transparent 52%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.28));
}

.auth-card {
  width: min(520px, 100%);
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  padding: 1.65rem;
  box-shadow:
    0 42px 120px rgba(0, 0, 0, 0.36),
    0 18px 46px rgba(0, 0, 0, 0.22);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft), #ffd56a);
}

.auth-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
}

.auth-subtitle {
  margin: 0.55rem 0 1.2rem;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field__control {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.field__label {
  font-weight: 900;
  letter-spacing: 0.02em;
}

.field input {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  outline: none;
}

.field textarea {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  outline: none;
  resize: vertical;
  min-height: 120px;
  font: inherit;
}

.field--with-toggle input {
  padding-right: 0.5rem;
}

.field__toggle {
  border: 1px solid rgba(26, 28, 31, 0.14);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font-weight: 800;
  color: rgba(26, 28, 31, 0.78);
}

.field__toggle:hover {
  border-color: rgba(26, 28, 31, 0.28);
}

.field__toggle:focus-visible {
  outline: 3px solid rgba(0, 75, 141, 0.22);
  outline-offset: 2px;
}

.field input:focus {
  border-color: rgba(0, 75, 141, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 75, 141, 0.12);
}

/* Announcements */
.announcement-list {
  display: grid;
  gap: 0.85rem;
}

.announcement {
  border-radius: 14px;
  border: 1px solid rgba(0, 75, 141, 0.16);
  background: linear-gradient(180deg, rgba(0, 75, 141, 0.06), rgba(0, 75, 141, 0.015));
  padding: 0.95rem 1rem;
}

.announcement__meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26, 28, 31, 0.58);
}

.announcement__title {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
}

.announcement__body {
  margin: 0.5rem 0 0;
  color: rgba(26, 28, 31, 0.75);
  line-height: 1.55;
  white-space: pre-wrap;
}

.announcement-list--preview .announcement__body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.auth-form--settings {
  padding: 1rem;
}

.form-error {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(204, 0, 0, 0.25);
  background: rgba(204, 0, 0, 0.06);
  color: #a40000;
  font-weight: 700;
}

.form-success {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 150, 90, 0.22);
  background: rgba(0, 150, 90, 0.06);
  color: #005e3a;
  font-weight: 700;
}

.auth-foot {
  margin: 0.35rem 0 0;
  color: rgba(26, 28, 31, 0.7);
}

.auth-foot a {
  font-weight: 900;
  color: rgba(0, 75, 141, 0.98);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 transparent;
  transition: box-shadow 140ms ease, color 140ms ease;
}

.auth-foot a:hover,
.auth-foot a:focus-visible {
  color: rgba(0, 75, 141, 1);
  box-shadow: inset 0 -2px 0 rgba(212, 160, 23, 0.9);
}

/* Responsive */
@media (min-width: 740px) {
  .tile {
    grid-column: span 6;
  }

  .tile-grid--rows .tile {
    grid-column: 1 / -1;
  }

  .portal-section--two {
    grid-template-columns: 1.6fr 1fr;
    gap: 1.25rem;
    align-items: start;
  }
}

@media (min-width: 1020px) {
  .tile {
    grid-column: span 3;
  }

  .tile-grid--rows .tile {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .portal-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .portal-search {
    display: none;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .portal-sidebar.is-open {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }
}
