:root {
  color-scheme: dark;
  --bg: #201814;
  --panel: #2a201c;
  --panel-strong: #2f241f;
  --ink: #fff8ef;
  --muted: #b9aaa0;
  --soft: #8d7b70;
  --line: #514139;
  --accent: #d9793f;
  --accent-strong: #f39b5e;
  --accent-soft: #463022;
  --value: #ffb36f;
  --value-soft: #ffd0a1;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  background:
    radial-gradient(circle at 92% 0%, rgba(217, 121, 63, 0.14), transparent 28rem),
    linear-gradient(145deg, #241b17, #1b1817 62%, #211812);
  color: var(--ink);
}

input,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  align-content: center;
  gap: 14px;
  width: min(1440px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px 0;
}

.app-header {
  display: grid;
  gap: 6px;
  width: min(100%, 850px);
  margin: 0 auto;
}

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

h1 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(1rem, 1.9vw, 1.28rem);
  font-weight: 750;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(0.76rem, 1.35vw, 0.9rem);
  line-height: 1.35;
}

.calculator-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 850px);
  margin: 0 auto;
}

.calculator {
  display: grid;
  gap: 12px;
  width: 100%;
}

.input-topline {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 18px;
}

.input-topline > label:first-child {
  color: var(--ink);
  font-size: clamp(0.94rem, 1.65vw, 1.08rem);
  font-weight: 700;
}

.year-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.year-field select {
  width: 88px;
  min-height: 34px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 17px) 16px / 6px 6px
      no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) 16px / 6px 6px
      no-repeat,
    var(--panel);
  color: var(--ink);
  outline: none;
  padding: 0 30px 0 12px;
}

.amount-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(42, 32, 28, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 0 16px;
  max-width: 850px;
}

.rate-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
  padding: 0 10px;
}

#amount-input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: clamp(1.22rem, 3.5vw, 1.74rem);
  font-weight: 800;
  outline: none;
  text-align: left;
}

#amount-input::placeholder {
  color: rgba(255, 248, 239, 0.42);
}

.currency-suffix {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

#amount-hint {
  color: var(--muted);
  font-size: clamp(0.72rem, 1.35vw, 0.82rem);
  font-weight: 650;
  line-height: 1.35;
}

input:focus,
select:focus {
  box-shadow: 0 0 0 4px rgba(217, 121, 63, 0.16);
}

.section-title {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: clamp(1.14rem, 2.4vw, 1.48rem);
  font-weight: 750;
  letter-spacing: 0;
}

.results {
  display: grid;
  gap: 16px;
  max-width: 850px;
}

.result-card {
  display: grid;
  gap: 24px;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(42, 32, 28, 0.78);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 32px);
}

.result-card h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: clamp(1.16rem, 2.35vw, 1.52rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.result-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.55vw, 0.94rem);
  line-height: 1.35;
}

dl {
  display: grid;
  gap: 18px;
  margin: 0;
}

dl div {
  display: grid;
  gap: 6px;
}

dt {
  color: var(--muted);
  font-size: clamp(0.78rem, 1.45vw, 0.92rem);
  font-weight: 700;
}

dd {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.5rem);
  font-weight: 850;
  letter-spacing: 0;
}

.featured dd {
  color: var(--value);
  font-size: clamp(1.38rem, 4.4vw, 2.02rem);
}

.note {
  max-width: 920px;
  margin: 0;
  color: var(--soft);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.35;
}

.feedback-link {
  justify-self: start;
  width: fit-content;
  margin-top: -12px;
  border: 2px solid rgba(185, 170, 160, 0.16);
  border-radius: 999px;
  color: rgba(185, 170, 160, 0.58);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 9px;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease;
}

.feedback-link:hover,
.feedback-link:focus-visible {
  background: rgba(217, 121, 63, 0.08);
  border-color: rgba(217, 121, 63, 0.3);
  color: var(--accent-strong);
  outline: none;
}

@media (min-width: 760px) {
  .page-shell {
    width: min(1440px, calc(100% - 48px));
    gap: 14px;
    padding: 16px 0;
  }

  .calculator-panel {
    gap: 22px;
  }

  .calculator {
    gap: 14px;
  }

  .amount-shell {
    min-height: 76px;
  }

  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .section-title {
    margin-top: 6px;
  }

  .result-card {
    gap: 16px;
    min-height: 246px;
    padding: 24px;
  }

  dl {
    gap: 12px;
  }
}

@media (min-width: 1180px) and (min-height: 840px) {
  .page-shell {
    gap: 18px;
    padding: 26px 0;
  }

  .calculator-panel {
    gap: 26px;
  }

  .calculator {
    gap: 16px;
  }

  .amount-shell {
    min-height: 92px;
  }

  .results {
    gap: 28px;
  }

  .result-card {
    gap: 24px;
    min-height: 280px;
    padding: 32px;
  }

  dl {
    gap: 18px;
  }
}

@media (max-width: 759px) {
  .page-shell {
    align-content: start;
    gap: 8px;
    padding: 8px 0;
  }

  .app-header {
    display: none;
  }

  .input-topline {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .year-field {
    width: fit-content;
    justify-content: flex-start;
  }

  .amount-shell {
    min-height: 56px;
    gap: 8px;
    padding: 0 10px;
  }

  .rate-chip {
    min-height: 28px;
    font-size: 0.78rem;
    padding: 0 8px;
  }

  .currency-suffix {
    font-size: 0.86rem;
  }

  .section-title {
    margin-top: 0;
    font-size: 1.18rem;
  }

  .result-card {
    gap: 8px;
    min-height: 0;
    padding: 13px;
  }

  .result-card h3 {
    margin-bottom: 2px;
    font-size: 1.18rem;
  }

  .result-card p {
    font-size: 0.82rem;
  }

  dl {
    gap: 7px;
  }

  dt {
    font-size: 0.8rem;
  }

  dd {
    font-size: 1.08rem;
  }

  .featured dd {
    font-size: 1.45rem;
  }

  .note {
    font-size: 0.62rem;
    line-height: 1.24;
  }
}

@media (max-height: 760px) {
  .page-shell {
    align-content: start;
    gap: 10px;
    padding: 12px 0;
  }

  .calculator-panel {
    gap: 12px;
  }

  .amount-shell {
    min-height: 64px;
  }

  .result-card {
    gap: 12px;
    min-height: 0;
    padding: 16px;
  }

  dl {
    gap: 10px;
  }
}
