:root {
  --surface: #ffffff;
  --surface-soft: #f3f5f3;
  --surface-strong: #e7ece8;
  --ink: #1a1f1c;
  --muted: #7b847d;
  --muted-2: #abb3ad;
  --line: rgba(20, 28, 22, 0.08);
  --green-soft: #cfe5d8;
  --green-press: #bad4c4;
  --orange: #ef8f3a;
  --orange-press: #d77a2a;
  --orange-soft: #fff0e4;
  --danger: #e05242;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --keyboard-inset: 0px;
  --tab-bar-height: 66px;
  --bottom-nav-space: calc(var(--tab-bar-height) + var(--safe-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans Arabic", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  align-items: center;
  background: #101411;
  color: var(--ink);
  display: flex;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
}

body::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  user-select: text;
}

.app-shell {
  background: var(--surface);
  color: var(--ink);
  height: 100dvh;
  max-height: 932px;
  max-width: 430px;
  min-height: 620px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.screen {
  background: var(--surface);
  inset: 0 0 var(--bottom-nav-space);
  overflow: hidden;
  position: absolute;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}

.app-shell.is-system-keyboard-open {
  --bottom-nav-space: 0px;
}

[dir="rtl"] .screen {
  transform: translateX(-100%);
}

.screen.is-active {
  transform: translateX(0);
  z-index: 4;
}

.screen.is-behind {
  transform: translateX(-28%);
}

[dir="rtl"] .screen.is-behind {
  transform: translateX(28%);
}

.main-screen {
  display: grid;
  grid-template-rows: minmax(236px, 34dvh) 1fr auto;
}

.hero {
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(17, 47, 40, 0.98), rgba(27, 55, 66, 0.94) 50%, rgba(72, 57, 42, 0.9)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  min-height: 236px;
  overflow: hidden;
  padding: calc(16px + var(--safe-top)) 16px 0;
  position: relative;
}

.hero::before {
  background:
    linear-gradient(100deg, transparent 0 18%, rgba(255, 255, 255, 0.055) 18% 18.45%, transparent 18.45% 48%, rgba(255, 255, 255, 0.04) 48% 48.35%, transparent 48.35%),
    linear-gradient(160deg, transparent 0 38%, rgba(239, 143, 58, 0.07) 38% 38.35%, transparent 38.35%);
  content: "";
  inset: 0;
  opacity: 0.28;
  position: absolute;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.top-bar {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.icon-button {
  align-items: center;
  aspect-ratio: 1;
  border-radius: 999px;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  transition:
    background-color 100ms ease,
    transform 100ms ease;
}

.icon-button:active,
.key-button:active,
.settings-row:active,
.manage-row:active,
.sheet-option:active,
.primary-button:active,
.text-button:active {
  filter: brightness(0.9);
  transform: scale(0.985);
}

.icon-button--ghost {
  background: rgba(0, 0, 0, 0.14);
  color: #ffffff;
}

.icon-button--plain {
  background: transparent;
  color: #6f7771;
}

.icon-button:disabled {
  cursor: default;
  opacity: 0.78;
}

.icon-button.is-refreshing .icon {
  animation: refresh-spin 900ms linear infinite;
}

.icon {
  display: block;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
  width: 22px;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.updated-text {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin: 14px 0 0;
  max-width: 260px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}

.market-pulse {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.market-pulse-head {
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  font-size: 12px;
  font-weight: 850;
  justify-content: space-between;
  letter-spacing: 0;
}

.market-pulse-head span:last-child {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.market-ticker {
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  min-height: 54px;
  overflow: hidden;
  position: relative;
}

.market-track {
  animation: ticker-scroll 34s linear infinite;
  display: flex;
  gap: 8px;
  padding-inline: 6px;
  width: max-content;
}

[dir="rtl"] .market-track {
  animation-direction: reverse;
}

.market-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  gap: 8px;
  min-width: 166px;
  padding: 9px 10px;
}

.market-code {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.market-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.market-change {
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-price {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

.market-card.is-up .market-change {
  color: #9ff0bd;
}

.market-card.is-down .market-change {
  color: #ffb29f;
}

.market-card.is-flat .market-change,
.market-card.is-pending .market-change {
  color: rgba(255, 255, 255, 0.78);
}

.market-ticker-empty {
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  padding: 12px 0;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.converter-panel {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  margin-top: -34px;
  min-height: 0;
  overflow: auto;
  padding: 10px 0 6px;
  position: relative;
  z-index: 2;
}

.currency-list {
  min-height: 100%;
}

.currency-row {
  align-items: center;
  background: var(--surface);
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 44px minmax(82px, 1fr) minmax(106px, auto) 24px;
  min-height: 68px;
  padding: 8px 16px;
  text-align: start;
  width: 100%;
}

.currency-row + .currency-row {
  border-top: 1px solid var(--line);
}

.currency-row.is-active {
  background: #fbf7f2;
}

.currency-row.is-active .amount {
  color: #cf6d21;
}

.flag {
  aspect-ratio: 4 / 3;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  display: block;
  overflow: hidden;
  position: relative;
  width: 42px;
}

.flag::before,
.flag::after {
  content: "";
  position: absolute;
}

.flag-image {
  display: block;
  height: 100%;
  object-fit: cover;
  position: relative;
  width: 100%;
  z-index: 2;
}

.flag.is-fallback {
  background: linear-gradient(180deg, #f7f8f7, #dfe5e0);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.flag.is-fallback .flag-image {
  display: none;
}

.flag:not(.is-fallback)::before,
.flag:not(.is-fallback)::after {
  display: none;
}

.flag[data-change-currency],
.crypto-icon[data-change-currency],
.currency-switch-trigger[data-change-currency],
.currency-arrow-trigger {
  cursor: pointer;
}

.crypto-icon {
  align-items: center;
  aspect-ratio: 1;
  background: #eef1ee;
  border: 1px solid rgba(20, 26, 22, 0.08);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: #3a423c;
  display: flex;
  font-size: 20px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.crypto-icon span {
  transform: translateY(-1px);
}

.crypto-btc {
  background: #fff3d6;
  color: #b66700;
}

.crypto-eth {
  background: #e7ecfb;
  color: #4d5f9d;
}

.crypto-usdt {
  background: #def5ec;
  color: #16805b;
}

.currency-arrow-trigger {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  height: 28px;
  justify-content: center;
  margin-inline: -4px;
  width: 28px;
}

.currency-switch-trigger[data-change-currency]:active,
.currency-arrow-trigger:active {
  background: rgba(0, 0, 0, 0.06);
}

.flag.is-fallback.flag-eu { background: #244aa5; }
.flag.is-fallback.flag-us { background: repeating-linear-gradient(180deg, #b22234 0 7.7%, #fff 7.7% 15.4%); }
.flag.is-fallback.flag-us::before { background: #3c3b6e; height: 54%; left: 0; top: 0; width: 48%; }
.flag.is-fallback.flag-gb { background: linear-gradient(90deg, transparent 42%, #fff 42% 58%, transparent 58%), linear-gradient(180deg, transparent 38%, #fff 38% 62%, transparent 62%), #1f3f8f; }
.flag.is-fallback.flag-gb::before { background: linear-gradient(90deg, transparent 46%, #c8102e 46% 54%, transparent 54%), linear-gradient(180deg, transparent 43%, #c8102e 43% 57%, transparent 57%); inset: 0; }
.flag.is-fallback.flag-ch { background: #d52b1e; }
.flag.is-fallback.flag-ch::before { background: #fff; height: 18%; left: 26%; top: 41%; width: 48%; }
.flag.is-fallback.flag-ch::after { background: #fff; height: 48%; left: 41%; top: 26%; width: 18%; }
.flag.is-fallback.flag-jp { background: #fff; }
.flag.is-fallback.flag-jp::before { background: #bc002d; border-radius: 50%; height: 44%; left: 28%; top: 28%; width: 44%; }
.flag.is-fallback.flag-cn { background: #de2910; }
.flag.is-fallback.flag-cn::before { background: #ffde00; border-radius: 50%; height: 18%; left: 14%; top: 18%; width: 18%; }
.flag.is-fallback.flag-tr { background: #e30a17; }
.flag.is-fallback.flag-tr::before { background: #fff; border-radius: 50%; height: 44%; left: 24%; top: 28%; width: 44%; }
.flag.is-fallback.flag-tr::after { background: #e30a17; border-radius: 50%; height: 34%; left: 34%; top: 33%; width: 34%; }
.flag.is-fallback.flag-ae { background: linear-gradient(90deg, #ff0000 0 25%, transparent 25%), linear-gradient(180deg, #009639 0 33.33%, #fff 33.33% 66.66%, #000 66.66%); }
.flag.is-fallback.flag-sa { background: #006c35; }
.flag.is-fallback.flag-qa { background: linear-gradient(90deg, #fff 0 30%, #8a1538 30%); }
.flag.is-fallback.flag-kw { background: linear-gradient(90deg, #000 0 24%, transparent 24%), linear-gradient(180deg, #007a3d 0 33.33%, #fff 33.33% 66.66%, #ce1126 66.66%); }
.flag.is-fallback.flag-bh { background: linear-gradient(90deg, #fff 0 32%, #ce1126 32%); }
.flag.is-fallback.flag-om { background: linear-gradient(90deg, #c8102e 0 28%, transparent 28%), linear-gradient(180deg, #fff 0 33.33%, #c8102e 33.33% 66.66%, #009a44 66.66%); }
.flag.is-fallback.flag-jo { background: linear-gradient(90deg, #ce1126 0 28%, transparent 28%), linear-gradient(180deg, #000 0 33.33%, #fff 33.33% 66.66%, #007a3d 66.66%); }
.flag.is-fallback.flag-eg, .flag.is-fallback.flag-sy, .flag.is-fallback.flag-iq, .flag.is-fallback.flag-ye { background: linear-gradient(180deg, #ce1126 0 33.33%, #fff 33.33% 66.66%, #000 66.66%); }
.flag.is-fallback.flag-ca { background: linear-gradient(90deg, #d52b1e 0 25%, #fff 25% 75%, #d52b1e 75%); }
.flag.is-fallback.flag-au, .flag.is-fallback.flag-nz { background: #012169; }
.flag.is-fallback.flag-se { background: linear-gradient(90deg, transparent 28%, #fecc00 28% 40%, transparent 40%), linear-gradient(180deg, transparent 38%, #fecc00 38% 54%, transparent 54%), #006aa7; }
.flag.is-fallback.flag-no { background: linear-gradient(90deg, transparent 28%, #fff 28% 44%, transparent 44%), linear-gradient(180deg, transparent 34%, #fff 34% 58%, transparent 58%), #ba0c2f; }
.flag.is-fallback.flag-no::before { background: linear-gradient(90deg, transparent 32%, #00205b 32% 40%, transparent 40%), linear-gradient(180deg, transparent 40%, #00205b 40% 52%, transparent 52%); inset: 0; }
.flag.is-fallback.flag-dk { background: linear-gradient(90deg, transparent 30%, #fff 30% 42%, transparent 42%), linear-gradient(180deg, transparent 42%, #fff 42% 58%, transparent 58%), #c60c30; }
.flag.is-fallback.flag-pl { background: linear-gradient(180deg, #fff 0 50%, #dc143c 50%); }
.flag.is-fallback.flag-cz { background: linear-gradient(135deg, #11457e 0 36%, transparent 36%), linear-gradient(180deg, #fff 0 50%, #d7141a 50%); }
.flag.is-fallback.flag-hu { background: linear-gradient(180deg, #ce2939 0 33.33%, #fff 33.33% 66.66%, #477050 66.66%); }
.flag.is-fallback.flag-ro { background: linear-gradient(90deg, #002b7f 0 33.33%, #fcd116 33.33% 66.66%, #ce1126 66.66%); }
.flag.is-fallback.flag-bg { background: linear-gradient(180deg, #fff 0 33.33%, #00966e 33.33% 66.66%, #d62612 66.66%); }
.flag.is-fallback.flag-in { background: linear-gradient(180deg, #ff9933 0 33.33%, #fff 33.33% 66.66%, #138808 66.66%); }
.flag.is-fallback.flag-in::before { border: 2px solid #000080; border-radius: 50%; height: 18%; left: 39%; top: 40%; width: 18%; }
.flag.is-fallback.flag-pk { background: linear-gradient(90deg, #fff 0 24%, #01411c 24%); }
.flag.is-fallback.flag-bd { background: #006a4e; }
.flag.is-fallback.flag-bd::before { background: #f42a41; border-radius: 50%; height: 42%; left: 36%; top: 29%; width: 42%; }
.flag.is-fallback.flag-id { background: linear-gradient(180deg, #ce1126 0 50%, #fff 50%); }
.flag.is-fallback.flag-my { background: repeating-linear-gradient(180deg, #cc0001 0 7.1%, #fff 7.1% 14.2%); }
.flag.is-fallback.flag-my::before { background: #010066; height: 57%; left: 0; top: 0; width: 50%; }
.flag.is-fallback.flag-sg { background: linear-gradient(180deg, #ef3340 0 50%, #fff 50%); }
.flag.is-fallback.flag-hk { background: #de2910; }
.flag.is-fallback.flag-th { background: linear-gradient(180deg, #a51931 0 16%, #fff 16% 32%, #2d2a4a 32% 68%, #fff 68% 84%, #a51931 84%); }
.flag.is-fallback.flag-ph { background: linear-gradient(135deg, #fff 0 32%, transparent 32%), linear-gradient(180deg, #0038a8 0 50%, #ce1126 50%); }
.flag.is-fallback.flag-kr { background: #fff; }
.flag.is-fallback.flag-kr::before { background: linear-gradient(180deg, #c60c30 0 50%, #003478 50%); border-radius: 50%; height: 38%; left: 31%; top: 31%; width: 38%; }
.flag.is-fallback.flag-mx { background: linear-gradient(90deg, #006847 0 33.33%, #fff 33.33% 66.66%, #ce1126 66.66%); }
.flag.is-fallback.flag-br { background: #009b3a; }
.flag.is-fallback.flag-br::before { background: #ffdf00; clip-path: polygon(50% 10%, 90% 50%, 50% 90%, 10% 50%); inset: 18% 18%; }
.flag.is-fallback.flag-ar { background: linear-gradient(180deg, #74acdf 0 33.33%, #fff 33.33% 66.66%, #74acdf 66.66%); }
.flag.is-fallback.flag-za { background: linear-gradient(90deg, #000 0 26%, transparent 26%), linear-gradient(180deg, #de3831 0 33.33%, #fff 33.33% 40%, #007a4d 40% 60%, #fff 60% 66.66%, #002395 66.66%); }
.flag.is-fallback.flag-ma { background: #c1272d; }
.flag.is-fallback.flag-tn { background: #e70013; }
.flag.is-fallback.flag-tn::before { background: #fff; border-radius: 50%; height: 42%; left: 29%; top: 29%; width: 42%; }
.flag.is-fallback.flag-dz { background: linear-gradient(90deg, #006233 0 50%, #fff 50%); }
.flag.is-fallback.flag-dz::before { background: #d21034; border-radius: 50%; height: 36%; left: 37%; top: 32%; width: 36%; }
.flag.is-fallback.flag-il { background: linear-gradient(180deg, #fff 0 18%, #0038b8 18% 30%, #fff 30% 70%, #0038b8 70% 82%, #fff 82%); }
.flag.is-fallback.flag-ru { background: linear-gradient(180deg, #fff 0 33.33%, #0039a6 33.33% 66.66%, #d52b1e 66.66%); }
.flag.is-fallback.flag-ua { background: linear-gradient(180deg, #0057b7 0 50%, #ffd700 50%); }

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

.code-line {
  align-items: center;
  display: flex;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}

.code {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.currency-row .name {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  white-space: normal;
}

.badge {
  background: #fce1d8;
  border-radius: 999px;
  color: #b9452e;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 6px;
}

.badge--central {
  background: #e4ecf7;
  color: #315b8f;
}

.badge--market {
  background: #fce1d8;
  color: #b9452e;
}

.badge--source {
  background: #eef1ee;
  color: #5d675f;
}

.badge--spToday {
  background: #e8f3ec;
  color: #31724b;
}

.badge--manual {
  background: #f0ece7;
  color: #77685a;
}

.badge--crypto {
  background: #e7ecfb;
  color: #4d5f9d;
}

.amount {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 800;
  line-height: 1.05;
  max-width: 156px;
  overflow: hidden;
  text-align: end;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-icon {
  color: #c9d0ca;
  justify-self: end;
}

.keypad {
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, 64px);
  height: 256px;
  transition:
    height 220ms ease,
    transform 220ms ease;
  z-index: 3;
}

.app-shell.is-keypad-hidden .keypad {
  height: 0;
  overflow: hidden;
  transform: translateY(14px);
}

.key-button {
  align-items: center;
  background: var(--surface-soft);
  border-bottom: 1px solid #ffffff;
  border-inline-end: 1px solid #ffffff;
  color: var(--ink);
  display: inline-flex;
  font-size: 27px;
  font-weight: 700;
  justify-content: center;
  transition:
    filter 100ms ease,
    transform 100ms ease;
}

.key-button--utility {
  background: var(--green-soft);
  color: #315442;
}

.key-button--accent {
  background: var(--orange);
  color: #ffffff;
}

.key-button .icon {
  height: 25px;
  width: 25px;
}

.show-keypad {
  align-items: center;
  background: var(--orange);
  border-radius: 999px;
  bottom: calc(16px + var(--bottom-nav-space));
  box-shadow: 0 12px 24px rgba(176, 87, 25, 0.3);
  color: #ffffff;
  display: none;
  height: 54px;
  justify-content: center;
  position: absolute;
  right: 18px;
  width: 54px;
  z-index: 7;
}

[dir="rtl"] .show-keypad {
  left: 18px;
  right: auto;
}

.app-shell.is-keypad-hidden .show-keypad {
  display: inline-flex;
}

.screen-header {
  align-items: center;
  background: var(--surface);
  display: flex;
  gap: 8px;
  min-height: calc(66px + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 12px 10px;
}

.screen-header h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.search-box {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 12px;
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
}

.search-box .icon {
  color: var(--muted);
  height: 19px;
  width: 19px;
}

.search-box input {
  background: transparent;
  border: 0;
  flex: 1;
  height: 44px;
  min-width: 0;
  outline: 0;
}

.replace-banner {
  align-items: center;
  background: var(--orange-soft);
  color: #9b501b;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  min-height: 46px;
  padding: 8px 16px;
}

.replace-banner[hidden] {
  display: none;
}

.manage-list-wrap {
  height: calc(100% - 66px - var(--safe-top));
  overflow: hidden;
  position: relative;
}

.manage-screen.is-replacing .manage-list-wrap {
  height: calc(100% - 112px - var(--safe-top));
}

.manage-list {
  height: 100%;
  overflow: auto;
  padding-bottom: calc(24px + var(--keyboard-inset));
}

.manage-row {
  align-items: center;
  background: var(--surface);
  display: grid;
  gap: 10px;
  grid-template-columns: 24px 42px minmax(0, 1fr) 34px;
  min-height: 68px;
  padding: 9px 16px;
  transition:
    background-color 120ms ease,
    transform 120ms ease;
}

.manage-row.is-dragging {
  background: #fff7ef;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  opacity: 0.92;
  position: relative;
  z-index: 2;
}

.manage-row.is-replace-source {
  background: #fff7ef;
}

.drag-handle {
  color: #aab2ad;
  touch-action: none;
}

.checkbox {
  align-items: center;
  background: #eef1ee;
  border-radius: 9px;
  display: flex;
  height: 26px;
  justify-content: center;
  justify-self: end;
  width: 26px;
}

.checkbox.is-checked {
  background: var(--orange);
  color: #ffffff;
}

.checkbox .icon {
  height: 17px;
  width: 17px;
}

.alphabet-index {
  align-items: center;
  bottom: calc(10px + var(--safe-bottom) + var(--keyboard-inset));
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
  position: absolute;
  right: 4px;
  top: 8px;
  width: 18px;
}

[dir="rtl"] .alphabet-index {
  left: 4px;
  right: auto;
}

.alphabet-index.is-hidden {
  display: none;
}

.alphabet-index button {
  background: transparent;
  color: #9ba39d;
  font-size: 9px;
  font-weight: 700;
  height: 14px;
  line-height: 1;
  padding: 0;
  width: 18px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  padding: 8px 12px 18px;
}

.settings-row {
  align-items: center;
  background: var(--surface);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 70px;
  padding: 10px 12px;
  text-align: start;
  transition:
    filter 100ms ease,
    transform 100ms ease;
}

.settings-row--static {
  cursor: default;
}

.settings-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-title {
  font-size: 17px;
  font-weight: 650;
}

.settings-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  unicode-bidi: plaintext;
}

.history-header {
  justify-content: space-between;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 10px;
  height: calc(100% - 66px - var(--safe-top));
  overflow: auto;
  padding: 10px 12px calc(18px + var(--safe-bottom));
}

.history-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  min-height: 104px;
  padding: 14px;
  text-align: start;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.history-item:active {
  transform: scale(0.992);
}

.history-item-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.history-main {
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  unicode-bidi: plaintext;
  white-space: nowrap;
}

.history-time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}

.history-results {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.history-result,
.history-extra {
  align-items: start;
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 10px;
  font-weight: 750;
  gap: 3px;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  padding: 8px;
  unicode-bidi: plaintext;
}

.history-result-code {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-result strong {
  color: var(--ink);
  display: block;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-extra {
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  justify-items: center;
  min-height: 48px;
  text-align: center;
}

.modal,
.sheet {
  display: none;
  inset: 0;
  position: absolute;
  z-index: 20;
}

.modal.is-open,
.sheet.is-open {
  display: block;
}

.modal-backdrop {
  background: rgba(10, 15, 12, 0.42);
  inset: 0;
  position: absolute;
}

.dialog {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  left: 18px;
  max-height: calc(100% - 36px - var(--safe-top) - var(--safe-bottom));
  overflow: auto;
  padding: 20px;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.app-shell.is-system-keyboard-open .dialog {
  bottom: calc(14px + var(--keyboard-inset));
  max-height: calc(100% - var(--keyboard-inset) - 28px - var(--safe-top));
  top: auto;
  transform: none;
}

.dialog h2,
.sheet-panel h2 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 8px;
}

.dialog-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.rate-input-wrap {
  display: grid;
  gap: 7px;
}

.rate-input-wrap span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.rate-input-wrap input {
  background: var(--surface-soft);
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 800;
  outline: 0;
  padding: 12px;
}

.rate-input-wrap input:focus {
  border-color: rgba(239, 143, 58, 0.55);
}

.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.text-button,
.primary-button {
  border-radius: 12px;
  font-weight: 800;
  min-width: 86px;
  padding: 11px 14px;
  transition:
    filter 100ms ease,
    transform 100ms ease;
}

.text-button {
  background: var(--surface-soft);
  color: var(--ink);
}

.text-button--compact {
  min-width: 0;
  padding: 8px 10px;
}

.primary-button {
  background: var(--orange);
  color: #ffffff;
}

.sheet-panel {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  bottom: var(--keyboard-inset);
  box-shadow: var(--shadow);
  left: 0;
  padding: 18px 16px calc(18px + var(--safe-bottom));
  position: absolute;
  right: 0;
}

.sheet-options {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sheet-option {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 12px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 50px;
  padding: 10px 14px;
  text-align: start;
}

.sheet-option-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.sheet-option-label {
  font-weight: 700;
  unicode-bidi: plaintext;
}

.sheet-option-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}

.sheet-option.is-selected {
  background: var(--orange-soft);
  color: #c7651f;
  font-weight: 800;
}

.empty-state {
  color: var(--muted);
  font-size: 14px;
  padding: 28px 18px;
  text-align: center;
}

.empty-state--history {
  align-content: center;
  display: grid;
  gap: 10px;
  min-height: 220px;
  place-items: center;
}

.empty-state-icon {
  align-items: center;
  background: var(--surface-soft);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.toast {
  background: rgba(20, 26, 22, 0.92);
  border-radius: 999px;
  bottom: calc(18px + var(--bottom-nav-space) + var(--keyboard-inset));
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  left: 50%;
  max-width: min(340px, calc(100% - 32px));
  opacity: 0;
  padding: 11px 16px;
  pointer-events: none;
  position: absolute;
  text-align: center;
  transform: translate(-50%, 16px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  z-index: 30;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bottom-tabs {
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  bottom: 0;
  box-shadow: 0 -10px 24px rgba(20, 26, 22, 0.08);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  min-height: calc(var(--tab-bar-height) + var(--safe-bottom));
  padding: 7px 12px calc(7px + var(--safe-bottom));
  position: absolute;
  transform: translateY(0);
  transition: transform 220ms ease;
  width: 100%;
  z-index: 8;
}

.app-shell.is-system-keyboard-open .bottom-tabs {
  transform: translateY(calc(100% + var(--safe-bottom)));
}

.bottom-tab {
  align-items: center;
  background: transparent;
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  font-size: 10.5px;
  font-weight: 800;
  gap: 3px;
  justify-items: center;
  min-height: 50px;
  padding: 5px 2px;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    transform 100ms ease;
}

.bottom-tab:active {
  transform: scale(0.97);
}

.bottom-tab .icon {
  height: 21px;
  width: 21px;
}

.bottom-tab.is-active {
  background: var(--orange-soft);
  color: #c7651f;
}

@media (max-height: 700px) {
  .main-screen {
    grid-template-rows: minmax(220px, 36dvh) 1fr auto;
  }

  .hero {
    min-height: 220px;
  }

  .keypad {
    grid-template-rows: repeat(4, 56px);
    height: 224px;
  }

  .currency-row {
    min-height: 64px;
  }
}

@media (min-width: 431px) {
  .app-shell {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  }
}

@media (prefers-color-scheme: dark) {
  .app-shell[data-theme="system"] {
    --surface: #151815;
    --surface-soft: #202620;
    --surface-strong: #2a322b;
    --ink: #f0f4f1;
    --muted: #a6b0a8;
    --line: rgba(255, 255, 255, 0.08);
    --green-soft: #294234;
  }

  .app-shell[data-theme="system"] .hero {
    background:
      radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.075), transparent 28%),
      linear-gradient(135deg, #092a25, #102d38 52%, #33281e),
      linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
      linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
  }

  .app-shell[data-theme="system"] .converter-panel,
  .app-shell[data-theme="system"] .currency-row,
  .app-shell[data-theme="system"] .screen-header,
  .app-shell[data-theme="system"] .settings-row,
  .app-shell[data-theme="system"] .manage-row,
  .app-shell[data-theme="system"] .history-item,
  .app-shell[data-theme="system"] .bottom-tabs {
    background: var(--surface);
  }

  .app-shell[data-theme="system"] .bottom-tab.is-active {
    background: #3a2a1d;
    color: #f0a45b;
  }

  .app-shell[data-theme="system"] .currency-row.is-active {
    background: #1b1f1b;
  }

  .app-shell[data-theme="system"] .currency-row.is-active .amount {
    color: #f0a45b;
  }

  .app-shell[data-theme="system"] .key-button {
    background: #1c211d;
    border-bottom-color: rgba(255, 255, 255, 0.1);
    border-inline-end-color: rgba(255, 255, 255, 0.1);
    color: #f0f4f1;
  }

  .app-shell[data-theme="system"] .key-button--utility {
    background: #254436;
    color: #bce6ca;
  }

  .app-shell[data-theme="system"] .key-button--accent {
    background: #e88734;
    color: #ffffff;
  }

  .app-shell[data-theme="system"] .chart-icon {
    color: #b8c3bc;
  }

  .app-shell[data-theme="system"] .badge--central {
    background: #26384f;
    color: #c9dcf7;
  }

  .app-shell[data-theme="system"] .history-result,
  .app-shell[data-theme="system"] .history-extra,
  .app-shell[data-theme="system"] .empty-state-icon {
    background: var(--surface-soft);
  }
}
