:root {
  --bg: #fbfaf7;
  --panel: #fffefd;
  --text: #191816;
  --muted: #706c66;
  --soft: #f2eee8;
  --border: #ddd7cf;
  --primary: #1f332d;
  --primary-soft: #eef3ef;
  --accent: #a06c5f;
  --accent-soft: #f7eee9;
  --error: #9d341f;
}

html {
  font-size: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.intro {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  padding: 18px 120px 34px 0;
}

.intro #resetButton {
  position: absolute;
  top: 18px;
  right: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 12px;
  color: #11100f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  color: #151412;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary {
  max-width: 590px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(360px, 1.18fr);
  gap: 40px;
  align-items: start;
}

.workspace {
  margin-top: 30px;
}

.options-column,
.results-layout {
  display: grid;
  gap: 38px;
  align-items: start;
}

.results-layout {
  position: sticky;
  top: 28px;
  scroll-margin-top: 24px;
}

.panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.form-panel,
.list-panel,
.results-panel,
.pick-panel {
  padding: 0;
}

.form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 22px 26px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 2px;
}

input::placeholder {
  color: #aaa39a;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 1px 0 var(--primary);
}

.rating-grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.button-row,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.button-row {
  justify-content: flex-start;
  margin-top: 19px;
}

.section-heading {
  min-height: 44px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-bottom: 4px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 42px;
  border-radius: 0;
  padding: 0 18px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.primary-button:hover {
  background: #111d19;
  transform: translateY(-1px);
}

.secondary-button,
.icon-button {
  border: 1px solid var(--border);
  background: rgba(255, 254, 253, 0.72);
  color: var(--text);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.icon-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
}

.danger-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #7a4437;
}

.error-message {
  margin: 12px 0 0;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 700;
}

.error-message:empty {
  display: none;
}

.empty-state {
  border: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 254, 253, 0.58);
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

.option-list,
.ranking-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option-card,
.ranking-card {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 18px 0;
}

.option-card:last-child,
.ranking-card:last-child {
  border-bottom: 1px solid var(--border);
}

.option-card,
.ranking-card {
  display: grid;
  gap: 13px;
}

.option-main,
.ranking-main {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.option-name,
.ranking-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.score-pill {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 700;
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 254, 253, 0.7);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ranking-list {
  counter-reset: ranking;
}

.ranking-card {
  counter-increment: ranking;
  position: relative;
  padding-left: 42px;
}

.ranking-card::before {
  content: counter(ranking);
  position: absolute;
  left: 0;
  top: 18px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--primary);
  border-radius: 50%;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.ranking-card:first-child {
  background: linear-gradient(90deg, rgba(247, 238, 233, 0.72), rgba(247, 238, 233, 0));
}

.pick-panel {
  border-top: 1px solid var(--border);
  padding-top: 32px;
}

.pick-result {
  min-height: 104px;
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 22px 0;
  line-height: 1.55;
}

.pick-result strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 400;
}

.hidden {
  display: none;
}

@media (max-width: 800px) {
  .app-shell {
    width: min(100% - 28px, 1080px);
    padding: 22px 0 40px;
  }

  .intro,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .intro {
    padding: 18px 0 24px;
  }

  .intro #resetButton {
    position: static;
    align-self: flex-end;
    width: auto;
  }

  h1 {
    font-size: 2.4rem;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 24px;
  }

  .options-column,
  .results-layout {
    gap: 28px;
  }

  .results-layout {
    position: static;
  }

  .form-panel {
    padding: 20px 22px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .button-row {
    flex-direction: column;
  }

  .option-main,
  .ranking-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .pick-panel {
    padding-top: 28px;
  }
}
