:root {
  --paper: #f7f7f2;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --blue: #335cff;
  --blue-dark: #1737bb;
  --mint: #d9fbe8;
  --green: #087a55;
  --amber: #fff3cc;
  --shadow: 0 20px 60px rgba(16, 24, 40, 0.09);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(51, 92, 255, 0.105) 1px, transparent 0);
  background-size: 28px 28px;
  content: "";
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
  pointer-events: none;
}
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link {
  position: absolute;
  z-index: 999;
  top: -80px;
  left: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
.site-header {
  border-bottom: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(247, 247, 242, 0.94);
}
.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 760;
  letter-spacing: -0.035em;
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(51, 92, 255, 0.26);
  color: #fff;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: 0;
}
.brand-dot { color: var(--blue); }
.nav-links, .footer-links { display: flex; align-items: center; gap: 6px; }
.nav-links a, .footer-links a {
  padding: 9px 12px;
  border-radius: 10px;
  color: #475467;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"], .footer-links a:hover {
  background: #fff;
  color: var(--ink);
}
main { overflow: hidden; }
h1, h2, h3, p { margin-top: 0; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 7px 11px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #344054;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #12b76a;
  box-shadow: 0 0 0 4px rgba(18, 183, 106, 0.13);
}
.home-hero { padding: 78px 0 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  align-items: center;
  gap: 64px;
}
h1 {
  margin-bottom: 20px;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 790;
  letter-spacing: -0.065em;
  line-height: 0.98;
  text-wrap: balance;
}
h1 .accent { color: var(--blue); }
.hero-copy {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
  text-wrap: balance;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--blue);
  box-shadow: 0 9px 22px rgba(51, 92, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(51, 92, 255, 0.25); }
.button-secondary { border-color: #d0d5dd; background: #fff; box-shadow: none; color: var(--ink); }
.button-secondary:hover { box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08); }
.market-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: var(--radius);
  background: #111a2e;
  box-shadow: var(--shadow);
  color: #fff;
}
.market-card::before {
  position: absolute;
  width: 230px;
  height: 230px;
  top: -110px;
  right: -90px;
  border-radius: 50%;
  background: #4468ff;
  content: "";
  opacity: 0.68;
}
.market-card > * { position: relative; }
.market-top { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 64px; }
.market-pair { font-size: 13px; font-weight: 760; letter-spacing: 0.08em; }
.live-label { display: flex; align-items: center; gap: 7px; color: #b9f5d2; font-size: 12px; font-weight: 680; }
.market-label { margin-bottom: 7px; color: #98a2b3; font-size: 13px; }
.market-value { margin-bottom: 8px; font-size: clamp(42px, 5vw, 66px); font-weight: 760; letter-spacing: -0.06em; line-height: 1; }
.market-foot { margin-bottom: 0; color: #d0d5dd; font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.78); }
.stat strong { display: block; font-size: 15px; }
.stat span { color: var(--muted); font-size: 12px; }
.section { padding: 48px 0 82px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.05em; line-height: 1.08; }
.section-heading p { max-width: 430px; margin-bottom: 4px; color: var(--muted); font-size: 14px; }
.conversion-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.conversion-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.conversion-card:hover { transform: translateY(-4px); border-color: #b9c4ff; box-shadow: 0 15px 36px rgba(16, 24, 40, 0.08); }
.pair-label { color: var(--blue); font-size: 13px; font-weight: 780; letter-spacing: 0.08em; }
.conversion-card h3 { margin: auto 0 18px; font-size: 24px; letter-spacing: -0.035em; line-height: 1.1; }
.card-action { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.card-arrow { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #f2f4f7; color: var(--blue); font-size: 16px; }
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; margin-top: 18px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.value-item { padding: 24px; }
.value-item + .value-item { border-left: 1px solid var(--line); }
.value-item strong { display: block; margin-bottom: 7px; font-size: 15px; }
.value-item span { color: var(--muted); font-size: 13px; }
.page-hero { padding: 72px 0 34px; }
.page-hero h1 { max-width: 900px; font-size: clamp(48px, 7vw, 82px); }
.page-hero .hero-copy { max-width: 760px; }
.article-wrap { padding: 24px 0 82px; }
.article-card { overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: #fff; box-shadow: var(--shadow); }
.article-intro { padding: clamp(28px, 5vw, 56px); border-bottom: 1px solid var(--line); background: #111a2e; color: #fff; }
.article-intro h2 { max-width: 740px; margin-bottom: 14px; font-size: clamp(28px, 4vw, 48px); letter-spacing: -0.05em; line-height: 1.08; }
.article-intro p { max-width: 700px; margin-bottom: 0; color: #d0d5dd; }
.article-body { max-width: 850px; padding: clamp(28px, 6vw, 72px); }
.article-body > p:first-child { color: var(--muted); font-size: 14px; }
.content-section { margin-bottom: 46px; }
.content-section:last-child { margin-bottom: 0; }
.content-section h2 { margin-bottom: 14px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.035em; line-height: 1.2; }
.content-section h3 { margin-bottom: 8px; font-size: 18px; }
.content-section p { color: #475467; }
.content-section p:last-child { margin-bottom: 0; }
.content-section ul { margin: 12px 0 0; padding-left: 22px; color: #475467; }
.content-section li { margin-bottom: 9px; padding-left: 5px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.feature-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fafafa; }
.feature-number { display: grid; width: 34px; height: 34px; place-items: center; margin-bottom: 32px; border-radius: 10px; background: #e8ecff; color: var(--blue); font-size: 12px; font-weight: 800; }
.feature-card h3 { margin-bottom: 7px; }
.feature-card p { margin-bottom: 0; font-size: 14px; }
.callout { margin-top: 24px; padding: 20px 22px; border-radius: 17px; background: var(--amber); color: #5d4a00; font-size: 14px; }
.site-footer { padding: 31px 0 38px; border-top: 1px solid rgba(16, 24, 40, 0.08); }
.footer-inner { display: grid; grid-template-columns: auto minmax(260px, 1fr) auto; align-items: center; gap: 32px; }
.brand-small { font-size: 16px; }
.brand-small .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 17px; }
.footer-inner p { max-width: 560px; margin: 0; color: var(--muted); font-size: 12px; }
:focus-visible { outline: 3px solid rgba(51, 92, 255, 0.36); outline-offset: 3px; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .market-card { max-width: 620px; }
  .conversion-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { margin-left: -12px; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 28px, 1180px); }
  .header-inner { min-height: 68px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 33px; height: 33px; }
  .nav-links { gap: 0; }
  .nav-links a { padding: 8px; font-size: 12px; }
  .home-hero, .page-hero { padding-top: 44px; }
  h1 { font-size: clamp(42px, 14vw, 62px); }
  .hero-copy { font-size: 16px; }
  .market-card { padding: 22px; }
  .market-top { margin-bottom: 48px; }
  .stats, .conversion-grid, .value-grid, .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 34px 0 60px; }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .value-item + .value-item { border-top: 1px solid var(--line); border-left: 0; }
  .article-wrap { padding-bottom: 58px; }
  .article-card { border-radius: 23px; }
  .footer-links { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .conversion-card { transition: none; }
}

/* Dynamic currency pages */
.hero { padding: 72px 0 40px; }
.rate-panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  border-radius: var(--radius);
  background: #111a2e;
  box-shadow: var(--shadow);
  color: #fff;
}
.rate-panel::before {
  position: absolute;
  width: 220px;
  height: 220px;
  top: -100px;
  right: -90px;
  border-radius: 50%;
  background: #4468ff;
  content: "";
  opacity: 0.65;
}
.rate-panel > * { position: relative; }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 54px; }
.pair { display: flex; align-items: center; gap: 9px; }
.currency-chip {
  min-width: 54px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.05em;
}
.pair-arrow { color: #98a2b3; }
.panel-kicker { margin: 0 0 8px; color: #98a2b3; font-size: 13px; font-weight: 650; }
.panel-value { margin: 0; font-size: clamp(42px, 5vw, 66px); font-weight: 760; letter-spacing: -0.06em; line-height: 1.05; overflow-wrap: anywhere; }
.panel-unit { margin: 9px 0 0; color: #d0d5dd; font-size: 14px; }
.micro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.micro-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.76); }
.micro-card strong { display: block; margin-bottom: 4px; font-size: 14px; }
.micro-card span { color: var(--muted); font-size: 12px; }
.rate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rate-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.02);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.rate-card:hover { transform: translateY(-4px); border-color: #b9c4ff; box-shadow: 0 15px 36px rgba(16, 24, 40, 0.08); }
.card-head { display: flex; align-items: center; gap: 12px; }
.flag { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: #f2f4f7; font-size: 24px; }
.currency-meta { min-width: 0; }
.currency-code { display: block; font-size: 15px; font-weight: 780; letter-spacing: 0.05em; }
.currency-name { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.card-rate { margin: auto 0 14px; font-size: clamp(30px, 3vw, 42px); font-weight: 730; letter-spacing: -0.055em; line-height: 1; overflow-wrap: anywhere; }
.card-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.change { font-weight: 720; }
.change-positive { color: var(--green); }
.change-negative { color: #c4324b; }
.change-neutral { color: var(--muted); }
.result-wrap { padding: 72px 0 34px; }
.result-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr); overflow: hidden; border: 1px solid var(--line); border-radius: 32px; background: #fff; box-shadow: var(--shadow); }
.result-main { padding: clamp(30px, 6vw, 70px); }
.result-aside { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(26px, 4vw, 44px); background: #111a2e; color: #fff; }
.result-label { margin-bottom: 15px; color: var(--muted); font-size: 13px; font-weight: 760; letter-spacing: 0.09em; text-transform: uppercase; }
.result-equation { margin-bottom: 20px; font-size: clamp(38px, 6vw, 74px); font-weight: 780; letter-spacing: -0.065em; line-height: 1.02; text-wrap: balance; }
.result-equation .accent { color: var(--blue); }
.result-note { max-width: 560px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.aside-pair { font-size: 14px; font-weight: 720; letter-spacing: 0.08em; }
.aside-rate { margin: 50px 0; }
.aside-rate small { display: block; margin-bottom: 8px; color: #98a2b3; }
.aside-rate strong { display: block; font-size: clamp(30px, 4vw, 48px); font-weight: 730; letter-spacing: -0.05em; overflow-wrap: anywhere; }
.aside-foot { color: #d0d5dd; font-size: 12px; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.quick-amounts a { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #344054; font-size: 13px; font-weight: 700; text-decoration: none; }
.quick-amounts a:hover { border-color: #aebcff; color: var(--blue); }
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); overflow: hidden; margin-top: 18px; border: 1px solid var(--line); border-radius: 22px; background: #fff; }
.trust-item { padding: 22px; }
.trust-item + .trust-item { border-left: 1px solid var(--line); }
.trust-item strong { display: block; margin-bottom: 6px; font-size: 14px; }
.trust-item span { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .hero { padding-top: 52px; }
  .result-card { grid-template-columns: 1fr; }
  .rate-panel { max-width: 620px; }
  .rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-aside { min-height: 320px; }
}
@media (max-width: 620px) {
  .hero { padding: 42px 0 24px; }
  .rate-panel { padding: 22px; }
  .panel-top { margin-bottom: 42px; }
  .micro-grid, .rate-grid, .trust-strip { grid-template-columns: 1fr; }
  .rate-card { min-height: 190px; }
  .trust-item + .trust-item { border-top: 1px solid var(--line); border-left: 0; }
  .result-wrap { padding: 42px 0 22px; }
  .result-card { border-radius: 24px; }
  .result-main, .result-aside { padding: 26px; }
  .result-equation { font-size: clamp(38px, 12vw, 56px); }
  .aside-rate { margin: 32px 0; }
}
@media (max-width: 480px) {
  .header-inner { min-height: auto; align-items: flex-start; flex-direction: column; gap: 5px; padding: 12px 0 9px; }
  .nav-links { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .rate-card { transition: none; }
}

/* Homepage: live dollar rates */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.section-tight { padding-top: 0; }
.market-foot a { color: #fff; text-underline-offset: 3px; }
.market-card .change-positive { color: #75e0a7; }
.market-card .change-negative { color: #fda29b; }
.market-card .change-neutral { color: #d0d5dd; }
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 56px;
}
.board-intro { position: sticky; top: 32px; }
.board-intro h2 { margin-bottom: 14px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.05em; line-height: 1.08; }
.board-intro p { max-width: 420px; color: var(--muted); font-size: 15px; }
.rate-board { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.board-head,
.board-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto) minmax(96px, auto) 16px;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
}
.board-head { min-height: 46px; border-bottom: 1px solid var(--line); background: #fafafa; color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase; }
.board-head span:nth-child(2),
.board-head span:nth-child(3) { text-align: right; }
.board-list { margin: 0; padding: 0; list-style: none; }
.board-list li + li { border-top: 1px solid var(--line); }
.board-row { min-height: 68px; color: var(--ink); text-decoration: none; transition: background-color 0.15s ease; }
.board-row:hover { background: #f7f8ff; }
.board-row:focus-visible { outline-offset: -3px; }
.board-currency { display: flex; min-width: 0; align-items: center; gap: 12px; }
.board-currency .flag { width: 38px; height: 38px; flex: none; border-radius: 12px; font-size: 21px; }
.board-meta { min-width: 0; }
.board-code { display: block; font-size: 14px; font-weight: 780; letter-spacing: 0.05em; }
.board-name { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.board-rate { font-size: 19px; font-weight: 720; letter-spacing: -0.02em; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-change { justify-self: end; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 720; white-space: nowrap; font-variant-numeric: tabular-nums; }
.board-change.change-positive { background: #ecfdf3; color: #067647; }
.board-change.change-negative { background: #fef3f2; color: #b42318; }
.board-change.change-neutral { background: #f2f4f7; color: #475467; }
.board-arrow { color: var(--blue); font-size: 15px; text-align: right; }
.board-empty { margin: 0; padding: 28px; color: #475467; font-size: 14px; }
.conversion-card--price h3 { margin-bottom: 8px; color: var(--muted); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.pair-price { margin: 0 0 16px; font-size: clamp(30px, 3vw, 38px); font-weight: 740; letter-spacing: -0.05em; line-height: 1; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pair-unit { color: var(--muted); font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }
@media (max-width: 900px) {
  .board-layout { grid-template-columns: 1fr; gap: 24px; }
  .board-intro { position: static; }
}
@media (max-width: 620px) {
  .board-head,
  .board-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; padding: 0 14px; }
  .board-arrow { display: none; }
  .board-row { min-height: 62px; }
  .board-currency { gap: 10px; }
  .board-currency .flag { width: 32px; height: 32px; border-radius: 10px; font-size: 18px; }
  .board-rate { font-size: 16px; }
  .board-change { padding: 4px 7px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .board-row { transition: none; }
}

/* Flags: self-hosted circle flags, or a lettered badge for crypto, metals, and regional currencies */
.flag-img { display: block; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.08); }
.flag-badge { display: inline-grid; flex: none; place-items: center; border-radius: 50%; background: #e8ecff; color: var(--blue); font-size: 12px; font-weight: 800; }

/* Hero search box (opens the currency search dialog) */
.search-trigger {
  display: flex; width: 100%; max-width: 560px; min-height: 60px; align-items: center; gap: 12px;
  margin-top: 30px; padding: 0 14px 0 18px; border: 1px solid #d0d5dd; border-radius: 18px;
  background: #fff; box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07); color: var(--muted);
  font: inherit; font-size: 16px; text-align: left; cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.search-trigger:hover { border-color: #aebcff; box-shadow: 0 14px 34px rgba(51, 92, 255, 0.12); }
.search-trigger .icon { flex: none; color: var(--blue); }
.search-trigger-text { flex: none; color: var(--ink); font-weight: 650; }
.search-trigger-hint { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.search-trigger kbd, .search-close { flex: none; border: 1px solid var(--line); border-radius: 8px; background: #f9fafb; color: var(--muted); font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.search-trigger kbd { margin-left: auto; padding: 3px 9px; }

/* Two-way converter inside the dark hero card */
.market-card--converter .market-top { align-items: center; margin-bottom: 22px; }
.converter-title { margin: 0; font-size: 13px; font-weight: 760; letter-spacing: 0.08em; text-transform: uppercase; }
.converter-label { display: block; margin-bottom: 7px; color: #98a2b3; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.converter-box {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 18px; background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.converter-box:focus-within { border-color: #8da2ff; box-shadow: 0 0 0 3px rgba(141, 162, 255, 0.28); }
.converter-input {
  width: 100%; min-width: 0; flex: 1; padding: 6px 0; border: 0; outline: 0; background: transparent; color: #fff;
  font: inherit; font-size: clamp(24px, 3vw, 32px); font-weight: 740; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.converter-input[aria-invalid="true"] { color: #fda29b; }
.currency-picker {
  display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: 46px; padding: 0 10px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #fff;
  font: inherit; font-size: 15px; font-weight: 760; letter-spacing: 0.04em; cursor: pointer;
}
.currency-picker:hover { background: rgba(255, 255, 255, 0.16); }
.picker-flag { display: inline-flex; }
.converter-swap {
  display: grid; width: 40px; height: 40px; place-items: center; margin: 12px auto 2px; padding: 0;
  border: 0; border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer;
}
.converter-swap:hover { color: var(--blue); }
.converter-rate { margin: 18px 0 6px; color: #d0d5dd; font-size: 14px; }
.converter-link { color: #fff; font-size: 14px; font-weight: 700; text-underline-offset: 3px; }

/* Popular currency cards: 8 per row on desktop, 4 on tablets and phones */
.currency-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.currency-tile {
  display: flex; height: 100%; min-height: 138px; flex-direction: column; padding: 14px;
  border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.currency-tile:hover { transform: translateY(-3px); border-color: #b9c4ff; box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 12px; }
.tile-sign { overflow: hidden; color: var(--muted); font-size: 14px; font-weight: 700; white-space: nowrap; }
.tile-code { font-size: 14px; font-weight: 780; letter-spacing: 0.05em; }
.tile-name { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.tile-rate { margin-top: auto; padding-top: 10px; font-size: 18px; font-weight: 740; letter-spacing: -0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid-more { display: flex; justify-content: center; margin-top: 22px; }
.grid-more .button { font: inherit; font-size: 14px; font-weight: 750; cursor: pointer; }

/* Currency search dialog */
html:has(.search-dialog[open]) { overflow: hidden; }
.search-dialog {
  width: min(640px, calc(100% - 24px)); max-width: none; max-height: none; margin: 8vh auto auto; padding: 0;
  border: 0; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: 0 30px 80px rgba(16, 24, 40, 0.28);
}
.search-dialog::backdrop { background: rgba(16, 24, 40, 0.48); }
.search-panel { display: flex; max-height: min(640px, 84vh); flex-direction: column; }
.search-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.search-head .icon { flex: none; color: var(--blue); }
.search-input { width: 100%; min-width: 0; flex: 1; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-close { min-height: 32px; padding: 0 10px; cursor: pointer; }
.search-count { margin: 0; padding: 10px 18px 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.search-results { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 4px 8px 10px; list-style: none; overscroll-behavior: contain; }
.search-item {
  display: grid; width: 100%; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 10px;
  border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.search-item:hover, .search-item:focus-visible { background: #f2f4ff; }
.search-item:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.search-item[aria-current="true"] { background: #eef2ff; box-shadow: inset 3px 0 0 var(--blue); }
.search-meta { min-width: 0; }
.search-meta strong { display: block; font-size: 14px; letter-spacing: 0.03em; }
.search-meta span { display: block; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.search-rate { font-size: 15px; font-weight: 720; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 1024px) {
  .currency-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .market-card--converter .market-top { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 18px; }
  .search-trigger { min-height: 54px; margin-top: 24px; }
  .search-trigger-hint, .search-trigger kbd { display: none; }
  .converter-box { padding-left: 12px; }
  .currency-picker { min-height: 42px; font-size: 14px; }
  .board-currency .flag-img, .board-currency .flag-badge { width: 32px !important; height: 32px !important; }
  .currency-grid { gap: 8px; }
  .currency-tile { min-height: 0; padding: 10px 7px; border-radius: 14px; }
  .tile-top { gap: 3px; margin-bottom: 8px; }
  .tile-top .flag-img, .tile-top .flag-badge { width: 22px !important; height: 22px !important; }
  .tile-sign { font-size: 11px; }
  .tile-code { font-size: 12px; }
  .tile-name { display: none; }
  .tile-rate { padding-top: 6px; font-size: 13px; }
  .search-dialog { width: 100%; height: 100%; margin: 0; border-radius: 0; }
  .search-panel { height: 100%; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .currency-tile, .search-trigger, .converter-box { transition: none; }
}
