* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(157, 75, 34, 0.14), transparent 28%),
    linear-gradient(180deg, #f8f1e7 0%, #efe1ca 100%);
  color: #2f2418;
  font-family: "Bricolage Grotesque", sans-serif;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.hero,
.panel,
.result-card {
  background: rgba(255, 250, 244, 0.94);
  border: 1px solid rgba(87, 57, 29, 0.12);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(79, 50, 25, 0.12);
}

.hero {
  padding: 1.5rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(135deg, rgba(157, 75, 34, 0.96), rgba(110, 47, 18, 0.95));
  color: #fff8f0;
  display: grid;
  gap: 1rem;
}

.hero-copy {
  display: grid;
  gap: 0.7rem;
}

.hero-points,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Literata", serif;
}

.search-panel,
.result-card {
  padding: 1.2rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.panel-copy {
  margin: 0.4rem 0 0;
  max-width: 54ch;
  color: rgba(47, 36, 24, 0.78);
}

.stack {
  display: grid;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.selection-flow {
  gap: 0.85rem;
}

.selector-stage,
.selection-summary,
.verification-panel {
  border: 1px solid rgba(87, 57, 29, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 241, 231, 0.88));
  border-radius: 20px;
  padding: 1rem;
}

.selection-summary,
.selection-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.selection-summary {
  justify-content: space-between;
}

.selection-pills.compact {
  margin-bottom: 0.75rem;
}

.selection-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(157, 75, 34, 0.1);
  color: #6e2f12;
  font-size: 0.92rem;
}

.change-selection {
  white-space: nowrap;
}

.verification-head {
  margin-bottom: 0.85rem;
}

.verification-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  min-width: 0;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.94rem;
  color: #49321b;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(87, 57, 29, 0.16);
  border-radius: 16px;
  background: #fffdfa;
  color: #2f2418;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6e2f12 50%),
    linear-gradient(135deg, #6e2f12 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 1.1rem) calc(50% - 0.18rem),
    calc(100% - 0.8rem) calc(50% - 0.18rem),
    100% 0;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem, 2.4rem 100%;
  background-repeat: no-repeat;
}

input:disabled,
select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  background-color: #f1e5d8;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(157, 75, 34, 0.18);
  outline-offset: 2px;
}

button {
  padding: 0.9rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: #9d4b22;
  color: #fff8f0;
  font-weight: 700;
  cursor: pointer;
}

button.secondary {
  background: rgba(255, 252, 247, 0.78);
  color: #6e2f12;
  border: 1px solid rgba(87, 57, 29, 0.12);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status {
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(157, 75, 34, 0.08);
  color: #6e2f12;
}

.is-hidden {
  display: none;
}

.results {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.result-card {
  display: grid;
  gap: 1rem;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.subject-table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.subject-table th,
.subject-table td {
  padding: 0.7rem;
  border-bottom: 1px solid rgba(87, 57, 29, 0.1);
  text-align: left;
}

.pill {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 248, 240, 0.18);
  color: inherit;
  font-weight: 700;
}

@media (max-width: 900px) {
  .grid,
  .meta,
  .verification-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .page {
    padding: 1rem 0.8rem 2rem;
  }

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

  .grid,
  .meta,
  .verification-grid {
    grid-template-columns: 1fr;
  }

  .selection-summary {
    align-items: stretch;
  }

  .hero-points,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
}
