:root {
  --navy: #32475f;
  --navy-soft: #405a76;
  --accent: #14b8a6;
  --accent-soft: #ccfbf1;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #dbe4e8;
  --paper: #ffffff;
  --bg: #32475f;
  --success: #2f765e;
  --danger: #a23d3d;
  --radius: 24px;
  --shadow: 0 22px 55px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, .18), transparent 30rem),
    var(--bg);
  font-family: "Inter", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
a { color: inherit; }

.page-shell { max-width: 1180px; margin: 0 auto; padding: 0 28px 64px; }
.site-header { height: 92px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: #0f172a; background: var(--accent); font-size: 23px; font-weight: 800; box-shadow: 0 8px 20px rgba(20,184,166,.22); }
.brand-text { display: grid; line-height: 1.1; }
.brand-text strong { letter-spacing: .09em; font-size: 17px; color: #fff; }
.brand-text small { margin-top: 4px; color: #cbd5e1; font-size: 10px; }
.back-link { color: #fff; text-underline-offset: 5px; font-size: 14px; font-weight: 600; }

.hero { padding: 58px 0 50px; max-width: 760px; }
.eyebrow, .section-number { margin: 0 0 14px; color: var(--accent); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; font-weight: 700; }
h1 { margin: 0; max-width: 760px; color: #fff; font-size: clamp(42px, 7vw, 76px); line-height: .98; letter-spacing: -.055em; }
.lead { margin: 26px 0 0; max-width: 650px; color: #cbd5e1; font-size: clamp(17px, 2vw, 20px); line-height: 1.65; }

.panel { margin-bottom: 26px; padding: clamp(24px, 4vw, 48px); border: 1px solid rgba(23,45,62,.07); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-number { margin-bottom: 8px; }
h2 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 40px); letter-spacing: -.035em; }
.date-field, .control { display: grid; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
input, select { width: 100%; height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; outline: none; background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,.16); }
.date-field input { min-width: 185px; }
.muted, .rate-caption, .source-note { color: var(--muted); }
.muted { min-height: 22px; margin: -15px 0 22px; font-size: 13px; }

.rate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.rate-card { min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #fff, #f8fafb); }
.rate-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.currency-code { color: var(--navy); font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.currency-flag { font-size: 22px; }
.currency-name { min-height: 35px; margin: 8px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rate-value { color: var(--ink); font-size: 21px; font-weight: 700; }
.rate-unit { color: var(--muted); font-size: 11px; font-weight: 500; }

.currency-settings { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.currency-settings summary { cursor: pointer; color: var(--navy); font-size: 14px; font-weight: 700; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.check-option { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 11px; border-radius: 10px; background: #f1f5f9; font-size: 12px; }
.check-option input { width: 16px; height: 16px; accent-color: var(--navy); }

.rate-caption { margin: 0; font-size: 13px; }
.converter-grid { display: grid; grid-template-columns: 1.25fr 1fr 48px 1fr; gap: 14px; align-items: end; }
.swap { width: 48px; height: 54px; border: 0; border-radius: 12px; cursor: pointer; color: #fff; background: var(--navy); font-size: 22px; transition: transform .2s, background .2s; }
.swap:hover { background: var(--navy-soft); transform: translateY(-2px); }
.result-box { margin-top: 24px; padding: 28px; border-radius: 18px; color: #fff; background: var(--navy); }
.result-box span { display: block; margin-bottom: 10px; color: rgba(255,255,255,.68); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.result-box strong { display: block; overflow-wrap: anywhere; font-size: clamp(30px, 5vw, 52px); letter-spacing: -.04em; }
.result-box small { display: block; margin-top: 11px; color: rgba(255,255,255,.68); }
.source-note { margin: 24px 6px 0; color: #cbd5e1; font-size: 12px; line-height: 1.6; }
.source-note a { color: #5eead4; }
.status { position: fixed; right: 22px; bottom: 22px; max-width: min(430px, calc(100vw - 44px)); padding: 14px 18px; border-radius: 12px; color: #fff; background: var(--danger); box-shadow: var(--shadow); font-size: 13px; }

@media (max-width: 850px) {
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .converter-grid { grid-template-columns: 1fr 1fr 48px; }
  .amount-control { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .page-shell { padding: 0 16px 42px; }
  .site-header { height: 76px; }
  .back-link { display: none; }
  .hero { padding: 38px 0 34px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .date-field input { min-width: 0; }
  .rate-grid, .check-grid { grid-template-columns: 1fr 1fr; }
  .converter-grid { grid-template-columns: 1fr 48px; }
  .amount-control { grid-column: 1 / -1; }
  .converter-grid .control:nth-of-type(2) { grid-column: 1; }
  .swap { grid-column: 2; grid-row: 2; }
  .converter-grid .control:nth-of-type(3) { grid-column: 1 / -1; }
}
