:root {
  --bg: #f3efe7;
  --surface: #fffcf7;
  --line: #e7e0d4;
  --line-strong: #d9d0c2;
  --text: #241f1a;
  --muted: #5f574e;
  --faint: #7a7268;
  --accent: #1f7a4d;
  --accent-soft: #e5f4ec;
  --good: #157a45;
  --bad: #b42318;
  --track: #e6dfd3;
  --best: #e8f6ee;
  --sans: Outfit, "Avenir Next", "Segoe UI", sans-serif;
  --display: Fraunces, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #cfe8d8;
  color: var(--text);
}

.top,
main {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.top {
  padding-top: 32px;
}

main {
  padding-bottom: 88px;
}

.top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.mark {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

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

h1 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 520;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h3 {
  margin-bottom: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lede,
.note,
.fine,
.meta,
.hint,
.aside {
  color: var(--muted);
}

.lede {
  max-width: 58ch;
  margin: 12px 0 0;
  font-size: 16px;
}

.note,
.fine {
  max-width: 72ch;
  margin-bottom: 0;
  font-size: 14px;
}

.chains {
  display: inline-flex;
  flex: none;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: #e7e1d6;
}

.chains button {
  min-width: 92px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.chains button + button {
  border-left: 0;
}

.chains button:hover {
  border-color: transparent;
  color: var(--text);
}

.chains button[aria-pressed="true"],
.chains button[aria-pressed="true"]:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(36, 31, 26, 0.08);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
}

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

button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

button:hover {
  background: rgba(36, 31, 26, 0.05);
  border-color: transparent;
  color: var(--text);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.panel .note {
  margin-top: 6px;
}

#prices {
  display: block;
}

.price-group {
  margin-top: 14px;
  padding: 16px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
  margin-top: 12px;
}

.price {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.price label {
  font-weight: 550;
}

.hint,
.err {
  min-height: 1.2em;
  font-size: 12px;
}

.err {
  color: var(--bad);
}

.price input {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.price input:hover {
  border-color: #c9bfb0;
}

.price input:focus {
  border-color: var(--accent);
}

.price input.is-invalid {
  border-color: var(--bad);
}

.verdict {
  margin-top: 28px;
  padding: 22px 22px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.verdict-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 4px;
}

.verdict h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.lead {
  max-width: 22ch;
  margin: 4px 0 6px;
  color: var(--text);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 520;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.verdict-num {
  margin: 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: 40px;
  font-weight: 560;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.num-label {
  display: block;
  margin-bottom: 6px;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.verdict-sub {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
}

.verdict .note {
  margin: 12px 0 8px;
}

.cmp {
  margin-top: 8px;
}

.cmp-head,
.cmp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7.2rem 9.2rem;
  column-gap: 16px;
  align-items: baseline;
}

.cmp-head {
  padding: 8px 12px 4px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 500;
}

.cmp-head .num,
.cmp-money,
.cmp-delta {
  text-align: right;
}

.cmp-row {
  position: relative;
  margin-top: 4px;
  padding: 10px 12px 8px;
  border-radius: 12px;
}

.cmp-row.is-best {
  background: var(--best);
}

.cmp-name {
  font-weight: 550;
}

.cmp-money,
.cmp-delta,
.cmp-meta,
.per {
  font-variant-numeric: tabular-nums;
}

.cmp-money {
  font-size: 16px;
  font-weight: 550;
}

.cmp-meta {
  grid-column: 1;
  color: var(--faint);
  font-size: 13px;
}

.cmp-row::after {
  content: "";
  grid-column: 1 / -1;
  height: 4px;
  width: var(--share);
  margin-top: 8px;
  border-radius: 99px;
  background: #d9efe3;
}

.cmp-row.is-best::after {
  background: var(--accent);
}

.cmp-row.is-open .cmp-money,
.cmp-row.is-open .cmp-delta {
  color: var(--faint);
}

.tag {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.per {
  margin-left: 8px;
}

.pos {
  color: var(--good);
}

.neg {
  color: var(--bad);
}

.miss,
.zero {
  color: var(--faint);
}

.tree {
  margin-top: 40px;
}

.tree > .note {
  margin-top: 6px;
}

.ingot-proof {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.proof-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.op {
  color: var(--accent);
}

.recipes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.recipe-group {
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.recipe-group ul,
.branch-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.recipe-group li,
.branch-list li {
  padding: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.step {
  margin-top: 12px;
  padding: 16px 16px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.step h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 520;
  letter-spacing: -0.02em;
}

.step.is-best {
  background: #f7fcf9;
  border-color: #b7dfc8;
}

.meta {
  margin: 2px 0 0;
  font-size: 13px;
}

.call {
  max-width: 68ch;
  margin: 8px 0 0;
}

.step .cmp {
  margin-top: 4px;
}

.aside {
  max-width: 68ch;
  margin: 8px 0 0;
  font-size: 14px;
}

.branch-title {
  margin-top: 28px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 520;
}

.branch-list {
  margin-bottom: 8px;
}

.foot {
  margin-top: 28px;
}

@media (max-width: 860px) {
  .recipes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .top-row,
  .verdict-head,
  .section-head {
    display: block;
  }

  .actions {
    margin-top: 10px;
  }

  .chains {
    margin-top: 16px;
  }

  h1 {
    font-size: 30px;
  }

  .lead {
    font-size: 26px;
  }

  .verdict,
  .price-group,
  .step {
    padding-left: 14px;
    padding-right: 14px;
  }

  .verdict-num,
  .num-label {
    margin-top: 12px;
    text-align: left;
  }

  .cmp-head {
    display: none;
  }

  .cmp-head,
  .cmp-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .cmp-delta {
    grid-column: 2;
    grid-row: 2;
  }

  .cmp-meta {
    padding-right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
