:root {
  --bg: #1c1b18;
  --panel: #25231e;
  --panel-deep: #211f1b;
  --text: #f5f2eb;
  --muted: #b8b2a5;
  --muted-dark: #827c70;
  --gold: #d4b982;
  --gold-soft: rgba(212, 185, 130, 0.1);
  --gold-border: rgba(212, 185, 130, 0.22);
  --line: rgba(245, 242, 235, 0.09);
  --green: #8fbd8a;
  --red: #d38b86;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: radial-gradient(circle at 82% 3%, rgba(212, 185, 130, 0.09), transparent 27rem), var(--bg);
  font-family: "Plus Jakarta Sans", sans-serif;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.page-shell { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #e7d39e, #a98b55); color: var(--bg); font-size: 20px; font-weight: 800; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -0.5px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 9px; font-weight: 500; }
.topbar-note { color: var(--muted); font-size: 13px; }

.hero { min-height: 310px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 60px 0 46px; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: 0.09em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 18px; font-size: clamp(43px, 6.7vw, 78px); line-height: 0.99; letter-spacing: -0.065em; font-weight: 800; }
h1 span { color: var(--gold); }
.hero-copy { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-orb { flex: 0 0 190px; width: 190px; height: 190px; display: grid; place-items: center; border: 1px solid var(--gold-border); border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(212, 185, 130, 0.28), rgba(212, 185, 130, 0.06) 56%, transparent 57%); box-shadow: 0 0 70px rgba(212, 185, 130, 0.1); }
.hero-orb span { width: 112px; height: 112px; display: grid; place-items: center; border: 1px solid var(--gold-border); border-radius: 50%; background: rgba(212, 185, 130, 0.1); color: var(--gold); font-size: 54px; font-weight: 700; }

.panel { margin-bottom: 24px; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
h2 { margin-bottom: 0; font-size: clamp(25px, 3vw, 35px); letter-spacing: -0.045em; }
.date-control, .field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.date-control input, .field input, .field select { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--text); background: var(--panel-deep); padding: 0 14px; }
.date-control input:focus, .field input:focus, .field select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 185, 130, 0.11); }
.date-control input { color-scheme: dark; min-width: 170px; }

.currency-picker { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; margin: 30px 0 16px; padding-top: 22px; border-top: 1px solid var(--line); }
.currency-picker p { margin: 0; color: var(--muted); font-size: 12px; }
.toggle-list { display: flex; gap: 8px; flex-wrap: wrap; }
.currency-toggle { border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; padding: 7px 11px; font-size: 12px; font-weight: 700; transition: 160ms ease; }
.currency-toggle:hover { border-color: var(--gold-border); color: var(--text); }
.currency-toggle.is-active { border-color: var(--gold-border); background: var(--gold-soft); color: var(--gold); }
.status { min-height: 24px; margin-bottom: 15px; color: var(--muted); font-size: 13px; }
.status.is-error { color: var(--red); }
.status.is-success { color: var(--green); }

.rates-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.rate-card { min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(0, 0, 0, 0.12); }
.rate-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.currency-code { color: var(--gold); font-size: 14px; font-weight: 800; }
.currency-name, .rate-nominal { color: var(--muted); font-size: 11px; }
.rate-value { margin: 16px 0 4px; font-size: clamp(25px, 2.7vw, 33px); line-height: 1; letter-spacing: -0.06em; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-card.empty { justify-content: center; color: var(--muted); font-size: 13px; }

.converter-panel { background: linear-gradient(125deg, rgba(212, 185, 130, 0.12), rgba(255, 255, 255, 0.022) 55%); }
.section-note { max-width: 260px; margin-bottom: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: right; }
.converter-form { display: grid; grid-template-columns: 1.1fr 1fr auto 1fr auto; gap: 12px; align-items: end; margin-top: 30px; }
.field input, .field select { width: 100%; color-scheme: dark; }
.swap-button { width: 48px; height: 48px; border: 1px solid var(--gold-border); border-radius: 12px; color: var(--gold); background: var(--gold-soft); font-size: 21px; transition: transform 180ms ease, background 180ms ease; }
.swap-button:hover { transform: rotate(180deg); background: rgba(212, 185, 130, 0.18); }
.calculate-button { min-height: 48px; border: 0; border-radius: 12px; padding: 0 20px; color: #29251e; background: linear-gradient(135deg, #e5cf99, #c2a46a); box-shadow: 0 9px 24px rgba(212, 185, 130, 0.18); font-weight: 800; }
.calculate-button:hover { filter: brightness(1.06); }
.conversion-result { display: flex; align-items: baseline; gap: 10px; min-height: 80px; margin-top: 18px; padding: 18px 20px; border: 1px solid var(--gold-border); border-radius: 16px; background: rgba(0, 0, 0, 0.12); }
.conversion-result p { margin: 0; color: var(--muted); font-size: 13px; }
.conversion-result strong { color: var(--gold); font-size: clamp(30px, 4vw, 42px); letter-spacing: -0.055em; font-variant-numeric: tabular-nums; }
.conversion-result .result-label { color: var(--muted); font-size: 13px; }

footer { display: flex; justify-content: space-between; padding: 10px 2px 38px; color: var(--muted-dark); font-size: 12px; }
footer a { color: var(--gold); text-decoration: none; }

@media (max-width: 800px) {
  .rates-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .converter-form { grid-template-columns: 1fr 1fr; }
  .amount-field { grid-column: 1 / -1; }
  .swap-button { grid-column: 1; grid-row: 3; }
  .calculate-button { grid-column: 2; grid-row: 3; }
}
@media (max-width: 560px) {
  .page-shell { width: min(100% - 28px, 1160px); }
  .topbar { min-height: 68px; }
  .topbar-note { display: none; }
  .hero { min-height: auto; padding: 48px 0 38px; }
  .hero-orb { display: none; }
  .panel { padding: 21px 16px; border-radius: 19px; }
  .section-heading { align-items: start; flex-direction: column; }
  .date-control { width: 100%; }
  .date-control input { width: 100%; }
  .section-note { text-align: left; }
  .rates-grid { grid-template-columns: 1fr; }
  .rate-card { min-height: 125px; }
  .converter-form { grid-template-columns: 1fr; }
  .swap-button, .calculate-button { grid-column: auto; grid-row: auto; width: 100%; }
  footer { padding-bottom: 24px; }
}
