:root {
  font-family: monospace;
  font-size: 14px;
  --color-text: #222;
  --color-text-secondary: #666;
  --color-text-active: #000;
  --color-error: #d73a49;
  --color-error-bg: #fff5f5;
  --color-error-border: #fdaeb7;
  --page-background: white;
  --spacing-unit: 1ch;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: inherit;
  font-family: inherit;
}

body {
  color: var(--color-text);
  background: var(--page-background);
  line-height: 1.4;
}

.hidden {
  display: none !important;
}

.two-column-layout {
  display: grid;
  grid-template-columns: auto 2fr;
  height: 100vh;
}

@media screen and (max-width: 40rem) {
  .two-column-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 16ch 1fr;
  }

  .search-form {
    border-bottom: 1px solid var(--color-text-secondary);
  }
}

.search-form {
  overflow-y: auto;
  scrollbar-gutter: stable;
  background-color: white;
}

.results-panel {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.search-form {
  padding: 2ch;
  gap: 2ch;
  display: flex;
  flex-direction: column;
}

fieldset {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1ch;
}

legend {
  font-weight: bold;
  color: var(--color-text-active);
  margin-bottom: 1ch;
}

label {
  display: flex;
  align-items: center;
  gap: 0.25ch 1ch;
  flex-wrap: wrap;
}

label.block-field {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.25ch;
  align-items: start;
}

input[type="text"],
input[type="search"],
input[type="number"] {
  padding: 0.5ch;
  background: white;
  border: 1px solid var(--color-text-secondary);
  color: var(--color-text);
}

input[type="text"],
input[type="search"] {
  width: 100%;
}

input[type="number"] {
  min-width: 5ch;
  max-width: 8ch;
  field-sizing: content;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="number"]:focus {
  outline: 1px solid var(--color-text-active);
  border-color: var(--color-text-active);
}

input[type="checkbox"],
input[type="radio"] {
  margin: 0;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 1ch;
}

.form-row {
  display: flex;
  gap: 1ch;
}

.form-row > * {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 1ch;
}

button {
  padding: 0.5ch 1ch;
  background: white;
  border: 1px solid var(--color-text-secondary);
  color: var(--color-text);
  cursor: pointer;
}

button:hover {
  border-color: var(--color-text-active);
}

button:active {
  color: var(--color-text-active);
  border-color: var(--color-text-active);
}

.sort-label:has(button) {
  justify-content: space-between;
}

.sort-label > button {
  margin-left: auto;
}

.course-card {
  padding: 2ch;
  width: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 1ch;
}

.course-title {
  display: flex;
  flex-direction: column;
  gap: 0.5ch;
}

.course-meta-primary {
  color: var(--color-text-secondary);
  font-size: inherit;
}

.course-description {
  line-height: 1.5;
}

.course-meta-secondary {
  color: var(--color-text-secondary);
  font-size: inherit;
}

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

a:hover {
  text-decoration: underline;
}

mark {
  background-color: yellow;
  color: black;
  padding: 0;
}

.support-link {
  color: var(--color-text-secondary);
}
