:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --card: #fffaf1;
  --ink: #221b15;
  --muted: #71665c;
  --line: #ded3c2;
  --accent: #9b3f25;
  --accent-2: #174c45;
  --soft: #eadfcc;
  --shadow: 0 18px 45px rgb(72 45 24 / 12%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgb(155 63 37 / 18%), transparent 32rem),
    linear-gradient(135deg, #f7f0e4 0%, #eee3d2 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.subtitle {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.stats {
  min-width: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgb(255 250 241 / 72%);
  box-shadow: var(--shadow);
  color: var(--muted);
  text-align: right;
}

.stats strong {
  display: block;
  color: var(--ink);
  font-size: 30px;
}

.panel,
.toolbar,
.course-card {
  border: 1px solid var(--line);
  background: rgb(255 250 241 / 84%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
}

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

.wide {
  grid-column: span 2;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(155 63 37 / 14%);
}

.checkbox {
  align-content: end;
  grid-template-columns: auto 1fr;
  gap: 10px;
  min-height: 66px;
  color: var(--ink);
}

.checkbox input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.actions {
  display: flex;
  align-items: end;
}

button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: #fffaf1;
  cursor: pointer;
  font-weight: 800;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 22px;
  color: var(--muted);
}

.toolbar label {
  min-width: 220px;
}

.results {
  display: grid;
  gap: 16px;
}

.course-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  padding: 22px;
  border-radius: 28px;
}

.course-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.course-title {
  margin: 12px 0 8px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.score-box {
  align-self: start;
  border-radius: 22px;
  background: #efe4d1;
  padding: 18px;
}

.score-main {
  color: var(--accent);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.score-box p {
  margin: 4px 0 0;
  color: var(--muted);
}

.comments {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
}

.comment {
  border-left: 4px solid var(--accent);
  background: #fffdf8;
  border-radius: 12px;
  padding: 12px 14px;
}

.comment-head {
  margin-bottom: 6px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.comment p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #40362f;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.empty {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 26px;
  color: var(--muted);
  text-align: center;
}

mark {
  border-radius: 4px;
  background: #ffd98a;
  padding: 0 2px;
}

@media (max-width: 900px) {
  .hero,
  .course-card {
    grid-template-columns: 1fr;
  }

  .stats {
    text-align: left;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 22px;
  }

  .filters,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .filters,
  .toolbar,
  .course-card {
    border-radius: 20px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar label {
    min-width: 0;
  }
}
