.erc-app {
  --erc-bg: #ffffff;
  --erc-surface: #f5f7fb;
  --erc-text: #162033;
  --erc-muted: #687386;
  --erc-line: #dce3ec;
  --erc-accent: #2563eb;
  --erc-accent-soft: #eaf1ff;
  --erc-positive: #e5484d;
  --erc-negative: #14845f;
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 24px auto;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--erc-line);
  border-radius: 26px;
  background: var(--erc-bg);
  color: var(--erc-text);
  box-shadow: 0 18px 46px rgba(26, 42, 70, .08);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
  box-sizing: border-box;
}
.erc-app * { box-sizing: border-box; }
.erc-app button, .erc-app input, .erc-app select { font: inherit; }
.erc-header, .erc-section-title, .erc-favorite, .erc-history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.erc-header > div { min-width: 0; }
.erc-header h2, .erc-section h3 { margin: 0; color: var(--erc-text); }
.erc-header h2 { font-size: clamp(24px, 5vw, 34px); letter-spacing: -.04em; }
.erc-header p { margin: 4px 0 0; color: var(--erc-muted); font-size: 13px; }
.erc-kicker { color: var(--erc-accent); font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.erc-icon-button, .erc-swap {
  position: static !important;
  inset: auto !important;
  float: none !important;
  display: inline-grid !important;
  place-items: center;
  flex: 0 0 44px;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  border: 1px solid transparent !important;
  border-radius: 50% !important;
  background: var(--erc-accent-soft) !important;
  color: var(--erc-accent) !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer;
  box-shadow: none !important;
}
.erc-icon-button:hover, .erc-swap:hover { border-color: var(--erc-accent) !important; }
.erc-icon-button:disabled { cursor: wait; opacity: .65; }
.erc-icon-button.is-loading { animation: erc-spin 1s linear infinite; }
@keyframes erc-spin { to { rotate: 360deg; } }
.erc-status { margin: 20px 0 8px; padding: 11px 13px; border-radius: 12px; background: var(--erc-surface); color: var(--erc-muted); font-size: 14px; }
.erc-status[data-state="ready"] { color: #176b4f; background: #eaf8f1; }
.erc-status[data-state="offline"] { color: #7b5400; background: #fff3d8; }
.erc-status[data-state="error"] { color: #9a1b1b; background: #ffe7e7; }
.erc-update-info { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 20px; color: var(--erc-muted); font-size: 12px; }
.erc-update-info span { position: relative; }
.erc-update-info span + span::before { content: "•"; position: absolute; left: -10px; color: var(--erc-line); }
.erc-app [hidden] { display: none !important; }
.erc-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 24px; overflow: hidden; border: 1px solid var(--erc-line); border-radius: 14px; background: var(--erc-surface); }
.erc-tabs button { min-height: 52px; margin: 0 !important; padding: 10px 14px !important; border: 0 !important; border-right: 1px solid var(--erc-line) !important; border-radius: 0 !important; background: transparent !important; color: var(--erc-muted) !important; font-weight: 750; cursor: pointer; box-shadow: none !important; }
.erc-tabs button:last-child { border-right: 0 !important; }
.erc-tabs button[aria-selected="true"] { background: var(--erc-text) !important; color: var(--erc-bg) !important; }
.erc-tab-panel { animation: erc-panel-in .18s ease-out; }
@keyframes erc-panel-in { from { opacity: .55; translate: 0 4px; } }
.erc-toolbar { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .7fr); gap: 12px; margin-bottom: 24px; padding: 18px; border: 1px solid var(--erc-line); border-radius: 18px; background: var(--erc-surface); }
.erc-toolbar label, .erc-remit-form label { display: grid; gap: 6px; color: var(--erc-muted); font-size: 13px; font-weight: 700; }
.erc-toolbar input, .erc-toolbar select, .erc-remit-form input, .erc-remit-form select { width: 100%; min-height: 48px; margin: 0; padding: 10px 13px; border: 1px solid var(--erc-line); border-radius: 11px; outline: none; background: var(--erc-bg); color: var(--erc-text); box-shadow: none; }
.erc-toolbar input:focus, .erc-toolbar select:focus, .erc-remit-form input:focus, .erc-remit-form select:focus { border-color: var(--erc-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.erc-rate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.erc-rate-card { display: grid !important; gap: 4px; min-width: 0; margin: 0 !important; padding: 15px !important; border: 1px solid var(--erc-line) !important; border-radius: 14px !important; background: var(--erc-bg) !important; color: var(--erc-text) !important; text-align: left !important; cursor: pointer; box-shadow: none !important; }
.erc-rate-card:hover { border-color: var(--erc-accent) !important; translate: 0 -1px; }
.erc-rate-card span { overflow: hidden; color: var(--erc-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.erc-rate-card strong { overflow-wrap: anywhere; font-size: 17px; }
.erc-rate-card small { color: var(--erc-muted); font-size: 11px; }
.erc-source-card { margin-top: 24px; padding: 18px; border: 1px solid #bdd4ff; border-radius: 16px; background: var(--erc-accent-soft); }
.erc-source-card > div:first-child { display: flex; align-items: center; gap: 8px; color: var(--erc-text); }
.erc-source-dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.erc-source-card dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.erc-source-card dl div { min-width: 0; padding-right: 10px; border-right: 1px solid rgba(37, 99, 235, .16); }
.erc-source-card dl div:last-child { border-right: 0; }
.erc-source-card dt { color: var(--erc-muted); font-size: 11px; }
.erc-source-card dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--erc-text); font-size: 13px; font-weight: 750; }
.erc-source-card p { margin: 0; color: var(--erc-muted); font-size: 12px; line-height: 1.6; }
.erc-source-card a { color: var(--erc-accent); font-weight: 700; }
.erc-converter { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--erc-line); border-radius: 18px; background: linear-gradient(145deg, var(--erc-bg), var(--erc-surface)); }
.erc-converter label { display: grid; gap: 6px; color: var(--erc-muted); font-size: 13px; font-weight: 700; }
.erc-converter input, .erc-converter select { width: 100%; min-height: 50px; margin: 0; padding: 10px 13px; border: 1px solid var(--erc-line); border-radius: 12px; outline: none; background: var(--erc-bg); color: var(--erc-text); box-shadow: none; }
.erc-converter input:focus, .erc-converter select:focus { border-color: var(--erc-accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .16); }
.erc-search-box { position: relative; }
.erc-search-results { position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid var(--erc-line); border-radius: 12px; background: var(--erc-bg); box-shadow: 0 14px 32px rgba(0, 0, 0, .16); }
.erc-search-results button { display: block; width: 100%; margin: 0; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--erc-text); text-align: left; cursor: pointer; }
.erc-search-results button:hover, .erc-search-results button:focus { background: var(--erc-surface); }
.erc-search-selection { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: -10px 0 24px; padding: 16px 18px; border: 1px solid #bfdbfe; border-radius: 16px; background: #eff6ff; }
.erc-search-selection[hidden] { display: none !important; }
.erc-search-selection > div { display: grid; gap: 3px; min-width: 0; }
.erc-search-selection span { color: var(--erc-muted); font-size: 12px; font-weight: 750; }
.erc-search-selection strong { color: var(--erc-text); font-size: 20px; }
.erc-search-selection p { margin: 0 !important; color: var(--erc-muted); font-size: 12px; line-height: 1.5; }
.erc-search-selection button { flex: 0 0 auto; min-height: 40px; margin: 0 !important; padding: 8px 13px !important; border: 0 !important; border-radius: 10px !important; background: var(--erc-accent) !important; color: #fff !important; font-size: 12px !important; font-weight: 750 !important; cursor: pointer; }
.erc-search-selection[data-state="unavailable"] { border-color: #fecaca; background: #fff1f2; }
.erc-search-selection button:disabled { background: #9ca3af !important; cursor: default; }
.erc-rate-card.is-unavailable { border-style: dashed !important; background: var(--erc-surface) !important; }
.erc-swap-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.erc-swap-row span { height: 1px; background: var(--erc-line); }
.erc-result { padding: 20px; border-left: 4px solid var(--erc-accent); border-radius: 4px 15px 15px 4px; background: var(--erc-bg); }
.erc-result span { display: block; color: var(--erc-muted); font-size: 13px; }
.erc-result strong { display: block; margin-top: 4px; color: var(--erc-text); font-size: clamp(28px, 6vw, 44px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.erc-meta { color: var(--erc-muted); font-size: 13px; }
.erc-section { margin-top: 30px; }
.erc-section-title { margin-bottom: 12px; }
.erc-section-title button, .erc-favorite button { margin: 0; padding: 6px 8px; border: 0; background: transparent; color: var(--erc-accent); cursor: pointer; }
.erc-reference-chip { padding: 5px 9px; border-radius: 999px; background: var(--erc-accent-soft); color: var(--erc-accent); font-size: 12px; font-weight: 700; }
.erc-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.erc-chart-card { display: grid; gap: 4px; min-width: 0; padding: 15px; overflow: hidden; border: 1px solid var(--erc-line); border-radius: 15px; background: var(--erc-bg); }
.erc-chart-card > span { overflow: hidden; color: var(--erc-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.erc-chart-card > strong { color: var(--erc-text); font-size: 19px; letter-spacing: -.02em; }
.erc-chart-card > em { color: var(--erc-muted); font-size: 11px; font-style: normal; }
.erc-chart-card small { font-size: 12px; }
.erc-chart-card .is-up { color: var(--erc-positive); }
.erc-chart-card .is-down { color: var(--erc-negative); }
.erc-chart-card svg { width: 100%; height: 82px; margin-top: 7px; overflow: visible; }
.erc-chart-area { fill: rgba(48, 183, 139, .11); }
.erc-chart-line { fill: none; stroke: #48b991; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.erc-chart-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.erc-chart-pagination button { position: static !important; display: inline-grid !important; place-items: center; width: 36px !important; min-width: 36px !important; height: 36px !important; min-height: 36px !important; margin: 0 !important; padding: 0 !important; border: 1px solid var(--erc-line) !important; border-radius: 50% !important; background: var(--erc-bg) !important; color: var(--erc-text) !important; font-size: 22px !important; line-height: 1 !important; cursor: pointer; box-shadow: none !important; }
.erc-chart-pagination button:hover:not(:disabled) { border-color: var(--erc-accent) !important; color: var(--erc-accent) !important; }
.erc-chart-pagination button:disabled { opacity: .35; cursor: default; }
.erc-chart-pagination span { color: var(--erc-muted); font-size: 13px; }
.erc-chart-pagination b { color: var(--erc-accent); }
.erc-favorites, .erc-history { display: grid; gap: 8px; }
.erc-favorite, .erc-history-row { padding: 12px 14px; border: 1px solid var(--erc-line); border-radius: 12px; }
.erc-favorite > div { display: grid; }
.erc-favorite span, .erc-history-row span { color: var(--erc-muted); font-size: 12px; }
.erc-notice { margin: 0 !important; padding: 24px 0 0; color: var(--erc-muted); font-size: 12px; line-height: 1.55; }
.erc-remit-intro { margin-bottom: 18px; }
.erc-remit-intro h3 { margin: 2px 0 4px; font-size: 23px; }
.erc-remit-intro p { margin: 0; color: var(--erc-muted); font-size: 13px; }
.erc-remit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 20px; border: 1px solid var(--erc-line); border-radius: 18px; background: var(--erc-surface); }
.erc-input-unit { position: relative; display: block; }
.erc-input-unit input { padding-right: 58px; }
.erc-input-unit b { position: absolute; top: 50%; right: 13px; translate: 0 -50%; color: var(--erc-muted); font-size: 12px; }
.erc-remit-result { margin-top: 14px; padding: 22px; border-radius: 18px; background: var(--erc-text); color: var(--erc-bg); }
.erc-remit-result > span { display: block; opacity: .72; font-size: 13px; }
.erc-remit-result > strong { display: block; margin: 4px 0 16px; font-size: clamp(28px, 6vw, 43px); letter-spacing: -.04em; overflow-wrap: anywhere; }
.erc-remit-result > div { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.18); }
.erc-remit-result > div span { display: grid; gap: 3px; font-size: 11px; opacity: .75; }
.erc-remit-result > div b { font-size: 13px; opacity: 1; }
.erc-form-note { margin: 0 2px !important; padding-top: 20px; color: var(--erc-muted); font-size: 12px; line-height: 1.55; }
@media (prefers-color-scheme: dark) {
  .erc-app { --erc-bg:#121722; --erc-surface:#1c2431; --erc-text:#f2f5f9; --erc-muted:#aab4c2; --erc-line:#313b49; --erc-accent:#79aaff; --erc-accent-soft:#1d3153; box-shadow:none; }
}
@media (max-width: 680px) {
  .erc-app { padding: 20px; border-radius: 20px; }
  .erc-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erc-update-info { display: grid; }
  .erc-update-info span + span::before { display: none; }
  .erc-rate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erc-source-card dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .erc-source-card dl div { border-right: 0; }
}
@media (max-width: 440px) {
  .erc-app { margin: 8px 0; padding: 14px; border-radius: 18px; }
  .erc-header { align-items: flex-start; }
  .erc-header h2 { font-size: 28px; line-height: 1.15; }
  .erc-header p { margin-top: 6px; line-height: 1.5; }
  .erc-status { margin: 16px 0 8px; padding: 10px 12px; }
  .erc-update-info { gap: 3px; margin-bottom: 16px; line-height: 1.5; }
  .erc-tabs { margin: 16px 0 20px; border-radius: 12px; }
  .erc-tabs button { min-height: 46px; padding: 7px 3px !important; font-size: 12px; white-space: nowrap; }
  .erc-toolbar { gap: 10px; margin-bottom: 20px; padding: 14px; border-radius: 15px; }
  .erc-converter { gap: 12px; padding: 14px; border-radius: 15px; }
  .erc-section { margin-top: 24px; }
  .erc-section-title { align-items: flex-start; gap: 8px; margin-bottom: 10px; }
  .erc-section-title > div { min-width: 0; }
  .erc-section-title h3, .erc-section h3 { margin: 0 !important; font-size: 20px !important; line-height: 1.25 !important; letter-spacing: -.025em; word-break: keep-all; }
  .erc-section-title > button { flex: 0 0 auto; padding: 4px 2px !important; font-size: 12px; white-space: nowrap; }
  .erc-reference-chip { flex: 0 0 auto; margin-top: 1px; padding: 4px 7px; font-size: 11px; line-height: 1.35; white-space: nowrap; }
  .erc-charts { grid-template-columns: 1fr; }
  .erc-chart-card, .erc-rate-card { padding: 14px !important; }
  .erc-chart-pagination { margin-top: 14px; }
  .erc-favorites, .erc-history { gap: 7px; }
  .erc-favorite { align-items: center; flex-wrap: nowrap; gap: 8px; padding: 11px 12px; }
  .erc-favorite > div { min-width: 70px; }
  .erc-favorite > b { margin-left: auto; text-align: right; overflow-wrap: anywhere; }
  .erc-favorite button { flex: 0 0 auto; padding: 4px !important; font-size: 11px; }
  .erc-history-row { align-items: flex-start; flex-direction: column; gap: 4px; padding: 11px 12px; }
  .erc-toolbar, .erc-remit-form { grid-template-columns: 1fr; }
  .erc-search-selection { align-items: stretch; flex-direction: column; gap: 12px; margin-top: -8px; padding: 14px; }
  .erc-search-selection button { width: 100%; }
  .erc-rate-grid { grid-template-columns: 1fr; }
  .erc-source-card { margin-top: 20px; padding: 14px; border-radius: 14px; }
  .erc-source-card > div:first-child { align-items: flex-start; line-height: 1.4; }
  .erc-source-dot { flex: 0 0 9px; margin-top: 5px; }
  .erc-source-card dl { grid-template-columns: 1fr 1fr; gap: 12px 10px; margin: 14px 0; }
  .erc-source-card dl div { padding: 0; }
  .erc-source-card dd { line-height: 1.45; }
  .erc-source-card p { padding-top: 12px; border-top: 1px solid rgba(37, 99, 235, .15); line-height: 1.55; }
  .erc-remit-intro { margin-bottom: 14px; }
  .erc-remit-intro h3 { font-size: 21px !important; }
  .erc-remit-form { gap: 11px; padding: 14px; border-radius: 15px; }
  .erc-remit-result { margin-top: 12px; padding: 18px; border-radius: 16px; }
  .erc-remit-result > strong { margin-bottom: 14px; font-size: 29px; line-height: 1.2; }
  .erc-remit-result > div { grid-template-columns: 1fr; gap: 10px; }
  .erc-form-note { margin: 0 4px !important; padding-top: 20px; line-height: 1.65; }
  .erc-notice { margin: 0 !important; padding-top: 20px; border-top: 1px solid var(--erc-line); line-height: 1.65; }
}
