:root {
  color-scheme: dark;
  --bg: #050c13;
  --panel: rgba(10, 30, 43, .72);
  --panel-solid: #0a1a25;
  --line: rgba(53, 207, 255, .20);
  --line-strong: rgba(53, 207, 255, .48);
  --cyan: #35cfff;
  --cyan-soft: rgba(53, 207, 255, .08);
  --text: #f4f9ff;
  --copy: #c5d5e5;
  --muted: #96adbf;
  --danger: #ff8d8d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 500 15px/1.55 Manrope, Arial, sans-serif;
}
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.container { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }

.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.ambient-one { width: 520px; height: 520px; top: 90px; right: -240px; background: radial-gradient(circle, rgba(53,207,255,.09), transparent 68%); }
.ambient-two { width: 420px; height: 420px; bottom: 0; left: -260px; background: radial-gradient(circle, rgba(53,207,255,.05), transparent 70%); }

.site-header { height: 82px; border-bottom: 1px solid rgba(53,207,255,.10); background: rgba(5,12,19,.78); backdrop-filter: blur(18px); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 600 13px/1 Unbounded, sans-serif; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px; color: var(--cyan); }
.back-link { color: var(--muted); font-size: 12px; font-weight: 800; transition: color .2s ease; }
.back-link span { color: var(--cyan); margin-left: 6px; }
.back-link:hover { color: var(--text); }

.hero { min-height: 330px; padding: 82px 0 66px; display: flex; align-items: flex-end; justify-content: space-between; gap: 60px; }
.eyebrow, .section-index { margin: 0 0 18px; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 22px; height: 1px; margin: 0 9px 3px 0; background: var(--cyan); opacity: .65; }
h1, h2 { margin: 0; font-family: Unbounded, Manrope, sans-serif; font-weight: 600; letter-spacing: -.04em; }
h1 { font-size: clamp(42px, 6vw, 72px); line-height: 1.02; }
h1 em { color: var(--cyan); font-style: normal; }
.hero-copy { width: min(400px, 100%); margin: 0 0 8px; color: var(--copy); font-size: 17px; line-height: 1.7; }

.workspace { padding: 34px 40px 40px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(13,35,49,.86), rgba(7,20,29,.75)); box-shadow: 0 30px 90px rgba(0,0,0,.24); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 32px; border-bottom: 1px solid rgba(150,173,191,.13); }
.date-control { display: grid; grid-template-columns: auto auto; align-items: center; gap: 5px 16px; }
.date-control label, .converter-field label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.date-control input { grid-row: span 2; grid-column: 2; width: 176px; min-height: 50px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 14px; outline: none; background: var(--cyan-soft); color: var(--text); font-weight: 700; }
.date-control input:focus, .converter-field input:focus, .converter-field select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(53,207,255,.08); }
.date-caption { color: var(--copy); font-size: 12px; }
.source-badge { display: flex; align-items: center; gap: 12px; }
.source-badge strong, .source-badge small { display: block; }
.source-badge strong { font-size: 12px; }
.source-badge small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }

.notice { margin-top: 24px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(53,207,255,.05); color: var(--copy); font-size: 12px; }
.notice.error { border-color: rgba(255,141,141,.34); color: #ffd0d0; background: rgba(255,141,141,.06); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 34px 0 22px; }
.section-index { margin-bottom: 8px; font-size: 9px; }
h2 { font-size: clamp(23px, 3vw, 34px); line-height: 1.2; }
.text-button { padding: 8px 0; border: 0; background: transparent; color: var(--cyan); font-size: 12px; font-weight: 800; }
.text-button span { margin-left: 5px; }

.currency-panel { margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(5,12,19,.58); }
.currency-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.currency-panel-head strong, .currency-panel-head small { display: block; }
.currency-panel-head small { color: var(--muted); font-size: 11px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: var(--cyan-soft); color: var(--cyan); font-size: 20px; }
.currency-options { display: flex; flex-wrap: wrap; gap: 8px; }
.currency-choice { position: relative; }
.currency-choice input { position: absolute; opacity: 0; pointer-events: none; }
.currency-choice label { display: inline-block; padding: 8px 12px; border: 1px solid rgba(150,173,191,.18); border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.currency-choice input:checked + label { border-color: var(--cyan); background: var(--cyan-soft); color: var(--cyan); }
.currency-choice input:disabled + label { opacity: .35; cursor: not-allowed; }

.rates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; min-height: 144px; }
.rate-card { position: relative; min-width: 0; padding: 20px; overflow: hidden; border: 1px solid rgba(53,207,255,.16); border-radius: 15px; background: rgba(53,207,255,.035); transition: transform .2s ease, border-color .2s ease; }
.rate-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.rate-top { display: flex; justify-content: space-between; gap: 12px; }
.rate-code { font: 600 20px/1 Unbounded, sans-serif; }
.rate-symbol { color: rgba(53,207,255,.28); font: 500 26px/1 Unbounded, sans-serif; }
.rate-name { min-height: 37px; margin: 10px 0 20px; color: var(--muted); font-size: 11px; }
.rate-value { margin: 0; color: var(--text); font-size: 22px; font-weight: 800; white-space: nowrap; }
.rate-value small { color: var(--muted); font-size: 10px; font-weight: 600; }
.rate-unit { margin-top: 4px; color: var(--muted); font-size: 10px; }
.skeleton { min-height: 144px; border-radius: 15px; background: linear-gradient(90deg, rgba(53,207,255,.03), rgba(53,207,255,.10), rgba(53,207,255,.03)); background-size: 200% 100%; animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.divider { height: 1px; margin-top: 36px; background: rgba(150,173,191,.13); }
.converter-heading { padding-top: 36px; }
.cross-note { margin: 0; color: var(--muted); font-size: 11px; }
.converter-card { display: grid; grid-template-columns: 1.1fr .9fr 42px .9fr 1.45fr; align-items: end; gap: 12px; }
.converter-field { min-width: 0; }
.converter-field label { display: block; margin: 0 0 8px 4px; }
.converter-field input, .converter-field select { width: 100%; height: 60px; padding: 0 16px; border: 1px solid rgba(53,207,255,.20); border-radius: 14px; outline: none; background: rgba(5,12,19,.72); color: var(--text); transition: .2s ease; }
.amount-field input { font-size: 20px; font-weight: 800; }
.select-field select { font-weight: 800; }
.swap-button { width: 42px; height: 42px; margin-bottom: 9px; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--cyan-soft); color: var(--cyan); font-size: 20px; transition: transform .2s ease, background .2s ease; }
.swap-button:hover { transform: rotate(180deg); background: rgba(53,207,255,.14); }
.result-block { min-width: 0; min-height: 86px; padding: 14px 18px; border: 1px solid var(--cyan); border-radius: 15px; background: linear-gradient(135deg, rgba(53,207,255,.15), rgba(53,207,255,.05)); }
.result-block span, .result-block strong, .result-block small { display: block; }
.result-block span { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.result-block strong { overflow: hidden; margin: 2px 0; color: var(--text); font: 600 clamp(20px, 2.2vw, 29px)/1.25 Unbounded, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.result-block small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

footer { display: flex; justify-content: space-between; gap: 30px; padding: 26px 0 42px; color: var(--muted); font-size: 10px; }
footer p { margin: 0; }

@media (max-width: 980px) {
  .rates-grid { grid-template-columns: repeat(2, 1fr); }
  .converter-card { grid-template-columns: 1fr 1fr 42px 1fr; }
  .result-block { grid-column: 1 / -1; margin-top: 6px; }
}
@media (max-width: 700px) {
  .container { width: min(100% - 28px, 1180px); }
  .site-header { height: 68px; }
  .brand { font-size: 11px; }
  .back-link { font-size: 0; }
  .back-link span { font-size: 18px; }
  .hero { min-height: 0; padding: 56px 0 42px; display: block; }
  .hero-copy { margin-top: 24px; font-size: 15px; }
  .workspace { padding: 22px 16px 24px; border-radius: 16px; }
  .toolbar { align-items: flex-start; }
  .date-control { display: flex; flex-direction: column; align-items: stretch; }
  .date-control input { width: 160px; order: 2; }
  .date-caption { order: 3; }
  .source-badge strong { font-size: 10px; }
  .source-badge small { display: none; }
  .rates-grid { grid-template-columns: 1fr; }
  .rate-card { padding: 18px; }
  .converter-card { grid-template-columns: 1fr 42px 1fr; }
  .amount-field { grid-column: 1 / -1; }
  .swap-button { grid-column: 2; grid-row: 2; }
  .select-field:nth-of-type(2) { grid-column: 1; grid-row: 2; }
  .select-field:nth-of-type(3) { grid-column: 3; grid-row: 2; }
  .converter-heading { align-items: flex-start; }
  .cross-note { text-align: right; }
  footer { display: block; }
  footer p + p { margin-top: 8px; }
}
@media (max-width: 430px) {
  h1 { font-size: 36px; }
  .toolbar { display: block; }
  .source-badge { margin-top: 18px; }
  .section-heading { align-items: flex-start; }
  .converter-card { grid-template-columns: 1fr 38px 1fr; gap: 8px; }
  .converter-field input, .converter-field select { padding-inline: 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
