:root {
  --surround: var(--desk);
  --field: var(--chip);
  --ink: var(--fg);
  --muted: var(--dim);
  --soft-line: var(--line);
  --accent: var(--green);
  font: 16px/1.55 var(--ui-font);
}
* {box-sizing: border-box}
body {margin: 0; background: var(--shell); color: var(--ink)}
[hidden] {display: none !important}
::selection {background: var(--accent); color: var(--on-accent)}
:focus-visible {outline: 2px solid var(--accent); outline-offset: 3px}
a, button, input, select {font: inherit; color: inherit}
a {text-underline-offset: .25em}
button, select {touch-action: manipulation; cursor: pointer}
button {border: 0}
svg {
  display: block; width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
h1, h2, p, dl, dd {margin: 0}
.workspace {
  min-height: 100vh; min-height: 100svh; margin-inline: auto; background: var(--shell);
  padding: env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
}
.topbar {
  display: flex; direction: ltr; justify-content: space-between; align-items: center;
  min-height: 62px; gap: 9px; border-bottom: 1px solid var(--line);
}
.topbar a {display: inline-flex; align-items: center; min-height: 44px; text-decoration: none}
.wordmark {gap: 9px; font: 700 13px/1 var(--mono); white-space: nowrap}
.brand-mark {display: inline-flex; gap: 4px}
.brand-mark i {width: 8px; height: 8px; border-radius: 50%; background: #ed6b62}
.brand-mark i:nth-child(2) {background: #f2bf4f}
.brand-mark i:nth-child(3) {background: #64bf60}
.nav-actions {display: flex; align-items: center; gap: 3px; direction: rtl; color: var(--muted); font-size: .94rem}
.nav-actions a {padding-inline: 6px}
main {max-width: 1160px; margin-inline: auto}
.page-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-block: 22px 18px; border-bottom: 1px dashed var(--line);
}
h1 {font-size: 1.95rem; font-weight: 750; line-height: 1.4}
.page-heading p {margin-top: 3px; color: var(--muted); font-size: .93rem}
.shell-command {
  display: inline-flex; align-items: center; gap: .55ch; flex: none;
  color: var(--accent); font: 500 .71rem/1.4 var(--mono); white-space: nowrap;
}
.shell-command span {display: inline-block; overflow: hidden; color: var(--muted); border-right: .5ch solid var(--accent)}
@media(prefers-reduced-motion: no-preference) {
  .shell-command span {animation: type-command 850ms steps(11,end) both, idle-cursor 800ms step-end 900ms 3}
  @keyframes type-command {from {width: .5ch} to {width: 11.5ch}}
  @keyframes idle-cursor {50% {border-color: transparent}}
}
.converter {display: grid; align-items: start; gap: 22px; padding-block: 18px 22px}
#conversionForm, .currency-choice {min-width: 0}
.amount-label, .field-label {display: block; font-size: .9rem; font-weight: 600; color: var(--muted)}
.amount-line {
  display: flex; align-items: baseline; gap: 10px; direction: ltr; margin-top: 3px;
  padding: 3px 0 8px; border-bottom: 1px solid var(--line);
}
.amount-line:focus-within {border-color: var(--accent); box-shadow: 0 1px var(--accent)}
.amount-line input {
  min-width: 0; flex: 1; width: 100%; padding: 0; direction: ltr; text-align: left;
  appearance: none; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  caret-color: var(--accent); font: 500 2.28rem/1.28 var(--ui-font); letter-spacing: -.035em;
}
.amount-line input:focus-visible {outline: 0}
.amount-line bdi {font: 550 1rem/1.3 var(--mono); color: var(--muted)}
.currencies {display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: end; gap: 8px; margin-block: 14px}
.enhanced .currencies {grid-template-columns: minmax(0,1fr) 44px minmax(0,1fr); gap: 4px}
.field-label {margin-bottom: 4px}
.choice-body {position: relative; display: block; min-width: 0}
.choice-body select, .choice-face {
  width: 100%; min-height: 60px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--field); color: var(--ink); padding: 6px 10px 6px 22px;
}
.choice-body select {appearance: none; font-size: 1rem; line-height: 1.4}
.chevron {
  position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--muted); pointer-events: none;
}
.choice-face {display: none}
.enhanced .choice-face {display: flex; flex-direction: column; justify-content: center; pointer-events: none}
.choice-face bdi {font: 600 1rem/1.3 var(--mono); align-self: flex-start}
.choice-face span {font-size: .81rem; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere}
.enhanced select {position: absolute; inset: 0; height: 100%; opacity: 0; z-index: 1}
.enhanced select:focus-visible+.choice-face {outline: 2px solid var(--accent); outline-offset: 2px}
#swapCurrencies {
  border-radius: 4px; background: transparent; color: var(--accent); height: 44px; width: 44px;
  display: grid; place-items: center; align-self: end; margin-bottom: 8px;
}
#swapCurrencies svg {width: 22px; height: 22px}
.convert-button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 48px; padding: 8px 15px; border-radius: 4px;
  background: var(--accent); color: var(--on-accent); font-size: 1.05rem; font-weight: 750;
}
.convert-button svg {width: 20px; height: 20px}
.receipt {min-width: 0; container-type: inline-size; border-block: 1px solid var(--line)}
.result-heading {display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px}
.receipt h2 {font-size: 1rem; font-weight: 700}
#copyResult {
  background: transparent; color: var(--muted); min-height: 44px;
  padding: 4px 3px; text-decoration: underline; text-underline-offset: .25em; font-size: .84rem;
}
#copyResult:disabled {visibility: hidden}
.result-space {min-height: 82px; padding-block: 3px 14px}
.total {
  display: block; text-align: left; overflow-wrap: anywhere; color: var(--accent);
  font: 550 clamp(1.7rem,9.4cqw,3.5rem)/1.2 var(--ui-font); letter-spacing: -.04em;
}
[data-long=true] .total {font-size: clamp(1.05rem,6.7cqw,2.45rem)}
.exchange-rate {display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 3px 9px; margin-top: 7px; color: var(--muted); font-size: .88rem}
.exchange-rate bdi {font: 500 .88rem/1.5 var(--mono); color: var(--ink)}
#calcFeedback, .result-error {color: var(--muted); font-size: .93rem}
#calcFeedback:empty {display: none}
#marketInfo {border-top: 1px dashed var(--line); padding-block: 9px; display: grid; gap: 4px; font-size: .88rem}
#marketInfo div {display: flex; align-items: baseline; justify-content: space-between; gap: 10px}
#marketInfo dt {color: var(--muted)}
#marketInfo dd {text-align: end}
footer {display: flex; align-items: center; padding-top: 2px; border-top: 1px dashed var(--line); font-size: .92rem}
footer a {display: inline-flex; align-items: center; min-height: 44px; color: var(--muted)}
@media(hover:hover) {
  .topbar a:hover, footer a:hover, #calcTheme:hover, #copyResult:hover {color: var(--accent)}
  #swapCurrencies:hover {background: var(--field)}
  .convert-button:hover {filter: brightness(1.08)}
  .enhanced .choice-body:hover .choice-face {border-color: var(--muted)}
}
@media(max-width: 380px) {
  .page-heading {align-items: flex-start; flex-direction: column; gap: 8px}
  .shell-command {align-self: flex-end}
}
@media(min-width: 720px) {
  body {padding: clamp(20px,4vw,65px) clamp(20px,4vw,75px); background: var(--surround)}
  .workspace {max-width: 1660px; min-height: 0; padding: 0 clamp(28px,4vw,74px) 18px; border-radius: 20px}
  .topbar {min-height: 72px}
  .wordmark {gap: 14px; font-size: .98rem}
  .brand-mark {gap: 6px}
  .brand-mark i {width: 11px; height: 11px}
  .page-heading {padding-block: clamp(34px,5vw,72px) 27px}
  h1 {font-size: 3rem}
  .page-heading p {font-size: 1.05rem}
  .shell-command {font-size: .86rem}
  .converter {grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); gap: clamp(25px,4vw,72px); padding-block: 32px 40px}
  .amount-line input {font-size: 3rem}
  .currencies {margin-block: 22px}
  .receipt {padding: 3px clamp(15px,2vw,32px) 9px; background: var(--field); border: 1px solid var(--soft-line); border-radius: 5px}
  .result-space {padding-block: 13px 24px; min-height: 116px}
  #marketInfo {padding-block: 14px 8px; gap: 7px}
  footer {padding-top: 8px}
}


.swap-icons { display: grid; justify-items: center; gap: 0; }
.swap-icons .ui-icon { width: 15px; height: 12px; }
