.currency-context {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 7px 0 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
}

.currency-context strong {
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  letter-spacing: .015em;
  transition: color 120ms ease, opacity 120ms ease;
}

.currency-context:active strong {
  color: var(--text);
  opacity: .66;
}

.debts-summary .currency-context {
  padding-top: 8px;
}

.currency-screen {
  position: fixed;
  z-index: 27;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(28px, env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateX(14px);
  pointer-events: none;
  visibility: hidden;
  transition: none;
}

.currency-screen::-webkit-scrollbar {
  display: none;
}

.currency-screen.open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  transition:
    opacity 160ms ease,
    transform 190ms var(--ease);
}

.currency-header {
  min-height: 48px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  margin-bottom: 28px;
}

.currency-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 44px;
  height: 44px;
  margin-left: -8px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.currency-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.currency-back:active {
  color: var(--text);
  transform: scale(.94);
}

.currency-title {
  margin: 0;
  text-align: center;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 690;
  letter-spacing: -0.035em;
}

.currency-section-title {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.currency-list {
  display: flex;
  flex-direction: column;
}

.currency-row {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 100%;
  min-height: 72px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.currency-row::after {
  content: '';
  position: absolute;
  left: 62px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--line);
}

.currency-row:last-child::after {
  display: none;
}

.currency-row:active {
  opacity: .58;
}

.currency-symbol {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.currency-copy {
  min-width: 0;
}

.currency-code {
  display: block;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 630;
  letter-spacing: -0.02em;
}

.currency-name {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 480;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.currency-check {
  width: 23px;
  height: 23px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: transparent;
  color: transparent;
  justify-self: end;
}

.currency-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.currency-row.selected .currency-check {
  color: var(--selected-text);
  background: var(--selected);
}

body.currency-open .tab-bar {
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 700px) {
  .currency-screen {
    inset: 20px auto;
    left: 50%;
    width: min(440px, calc(100% - 40px));
    transform: translateX(calc(-50% + 14px));
    border: 1px solid var(--line);
    border-radius: 28px;
  }

  .currency-screen.open {
    transform: translateX(-50%);
  }
}
