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

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a {
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell__header {
  background: var(--background);
  border-bottom: 1px solid var(--rule);
}

.shell__footer {
  border-top: 1px solid var(--rule);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.shell__bar,
.shell__container {
  width: min(100% - var(--space-8), 56rem);
  margin-inline: auto;
}

.shell__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 3.5rem;
  padding-block: var(--space-3);
}

.shell__brand {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.shell__user {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.875rem;
}

.shell__user form {
  margin: 0;
}

.shell__main {
  flex: 1;
  padding-block: var(--space-12);
}

.shell__footer .shell__container {
  padding-block: var(--space-4);
}

.card {
  background: var(--surface-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  color: var(--card-foreground);
}

.card--panel {
  max-width: 28rem;
  margin-inline: auto;
  border-radius: var(--radius-panel);
  padding: var(--space-8);
}

.card__state {
  display: inline-block;
  margin: 0 0 var(--space-3);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brown);
}

.card--open {
  border-left: 4px solid var(--brown);
}

.card--locked-time,
.card--locked-prereq {
  background: var(--muted);
  color: var(--muted-foreground);
}

.card--locked-time .card__state,
.card--locked-prereq .card__state {
  color: var(--muted-foreground);
}

.card--locked-prereq {
  border-style: dashed;
}

.card--expired {
  color: var(--ink);
  opacity: 0.65;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.btn--primary {
  background: var(--brown);
  color: var(--brown-foreground);
}

.btn--primary:hover {
  background: color-mix(in oklch, var(--brown) 78%, var(--ink));
}

.btn--secondary {
  background: var(--secondary);
  color: var(--ink);
  border-color: var(--border);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-block: var(--space-4);
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
}

.field__input,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 2.5rem;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
}

.field__input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

.field__help {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.field__error {
  margin: 0;
  font-size: 0.875rem;
  color: var(--destructive);
}

.form-errors {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--destructive);
  border-radius: var(--radius-card);
  background: color-mix(in oklch, var(--destructive) 12%, var(--card));
  color: var(--destructive);
}

.empty-state {
  padding: var(--space-12) var(--space-6);
  font-family: var(--font-serif);
  font-style: italic;
  text-align: center;
  color: var(--muted-foreground);
}

.alert {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--card);
}

.alert--success {
  border-color: var(--success);
  background: color-mix(in oklch, var(--success) 12%, var(--card));
  color: var(--success);
}

.alert--warning {
  border-color: var(--warning);
  background: color-mix(in oklch, var(--warning) 12%, var(--card));
  color: var(--warning);
}

.alert--danger {
  border-color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 12%, var(--card));
  color: var(--destructive);
}

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

.visually-hidden:focus {
  top: var(--space-3);
  left: var(--space-3);
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  clip: auto;
  overflow: visible;
  white-space: normal;
  background: var(--card);
  color: var(--ink);
}
