:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #647084;
  --line: #d7dde8;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --accent: #2357c6;
  --accent-dark: #173d91;
  --danger: #9b1c1c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

body.modal-open {
  overflow: hidden;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.intro {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 320px);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 780px;
  color: var(--accent);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.45rem;
}

.lede {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.privacy,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.privacy {
  padding: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.privacy strong {
  display: block;
  color: var(--ink);
  margin-bottom: 6px;
}

.panel {
  padding: 24px;
  box-shadow: 0 16px 40px rgb(28 39 63 / 8%);
}

.hidden {
  display: none;
}

.verify-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 3px solid rgb(35 87 198 / 18%);
  border-color: var(--accent);
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  background: #b7c0cf;
  color: #f7f9fc;
  cursor: not-allowed;
}

button:disabled:hover {
  background: #b7c0cf;
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.toolbar,
.savebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.muted,
.message {
  color: var(--muted);
}

.message.error {
  color: var(--danger);
}

.class-list {
  display: grid;
  gap: 6px;
  margin: 18px 0;
}

.class-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.9fr);
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.course-code {
  display: inline;
  font-size: 0.98rem;
}

.course-title {
  display: inline;
  margin-left: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.professor-input {
  padding: 9px 10px;
}

.professor-input.saved-entry {
  border-color: #138a36;
  box-shadow: 0 0 0 2px rgb(19 138 54 / 18%);
}

.professor-input.saved-entry:focus {
  border-color: #138a36;
  outline-color: rgb(19 138 54 / 22%);
}

.notes {
  margin-bottom: 16px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 50px rgb(24 33 47 / 24%);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(24 33 47 / 48%);
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(420px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 24px 80px rgb(24 33 47 / 30%);
}

.modal p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 820px) {
  .intro,
  .verify-grid,
  .class-row,
  .toolbar,
  .savebar {
    grid-template-columns: 1fr;
  }

  .class-row {
    gap: 8px;
  }

  .course-title {
    display: block;
    margin: 2px 0 0;
  }

  .toolbar,
  .savebar {
    display: grid;
  }

  button {
    width: 100%;
  }

  .modal-actions {
    display: grid;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}
