:root { font-family: system-ui,sans-serif; color: #191e31; background: #f4f6fb; --brand: #283f94; --border: #dbe2f0; --muted: #525b71; }
* { box-sizing: border-box; }
body { margin: 0; }
header { max-width: 1040px; margin: auto; padding: 22px 24px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { color: inherit; text-decoration: none; font-weight: 760; }
nav { display: flex; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
nav a { color: var(--brand); padding: 10px 9px; text-decoration: none; border-radius: 7px; font-size: .875rem; }
nav a[aria-current="page"] { background: #eef0ff; font-weight: 720; }
main { max-width: 920px; width: calc(100% - 44px); margin: 48px auto; }
h1 { font-size: clamp(1.7rem, 5vw, 2.65rem); line-height: 1.15; margin: 0 0 23px; letter-spacing: -.035em; }
.calculator { padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 10px 34px #172b6210; }
.exchange { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 13px; align-items: center; }
.money { align-self: stretch; border-radius: 13px; padding: 16px; min-width: 0; }
.pay { background: #f5f6fa; }
.receive { background: #eef4ff; color: var(--brand); }
.label { font-size: .875rem; font-weight: 710; margin: 0 0 9px; display: block; }
button, input { font: inherit; }
button { min-height: 44px; cursor: pointer; background: #fff; border: 1px solid var(--border); color: var(--brand); border-radius: 9px; padding: 8px 12px; }
button:disabled { opacity: .54; cursor: default; }
:focus-visible { outline: 3px solid #3659cb; outline-offset: 2px; }
[hidden] { display: none !important; }
.currency { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: start; width: 100%; margin-bottom: 15px; min-height: 49px; color: #191e31; font-weight: 650; overflow-wrap: anywhere; }
.amount,.result { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.amount { border: 1px solid var(--border); border-radius: 8px; background: white; padding-inline: 10px; }
.amount input { font-size: 1.35rem; width: 100%; min-width: 0; border: 0; background: transparent; }
.amount span,.result span { font-weight: 700; font-size: .875rem; }
.result { flex-wrap: wrap; align-content: center; }
output { font-size: clamp(1.75rem, 5vw, 2.8rem); font-weight: 780; overflow-wrap: anywhere; min-width: 0; }
output.long { font-size: 1.2rem; }
.swap { font-size: 1.45rem; line-height: 1; width: 48px; height: 48px; border-radius: 50%; background: #eef0ff; }
.reference { padding: 17px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reference h2,h2 { font-size: .95rem; margin: 0 0 6px; }
.reference p { margin: 4px 0; overflow-wrap: anywhere; }
.forward { font-weight: 700; }
.muted, #provenance, #status, #copy-status, footer { color: var(--muted); font-size: .875rem; }
details { border-block: 1px solid var(--border); padding: 13px 0; }
summary { cursor: pointer; font-weight: 700; }
details label { font-weight: 640; display: block; margin-bottom: 5px; }
details input:not([type=checkbox]), #currency-search { width: 100%; border: 1px solid var(--border); border-radius: 8px; min-height: 43px; padding: 8px; }
details .manual-toggle { display: flex; align-items: center; gap: 6px; margin: 12px 0; }
.fees { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 12px; }
.primary { background: var(--brand); color: white; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calculator > .actions { padding-top: 15px; }
.error { color: #962336; font-size: .875rem; }
footer { margin-top: 15px; line-height: 1.6; }
dialog { width: min(100% - 26px,520px); border: 1px solid var(--border); border-radius: 14px; color: #191e31; max-height: 85dvh; }
dialog::backdrop { background: #1b284480; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
#choices { list-style: none; padding: 4px; margin: 7px 0; max-height: 54dvh; overflow: auto; }
#choices button { width: 100%; text-align: start; border: 0; color: #191e31; overflow-wrap: anywhere; }
#choices button:hover,#choices button[aria-current=true] { background: #eef0ff; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
@media (max-width:650px) {
  header { padding: 12px 14px 0; }
  main { width: calc(100% - 24px); margin: 28px auto; }
  .calculator { padding: 12px; }
  .exchange,.reference { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .money { padding: 12px; }
  .swap { justify-self: center; transform: rotate(90deg); }
}
