.purchase-page {
  --purchase-ink: #1c2035;
  --purchase-muted: #565c72;
  --purchase-surface: #fff;
  --purchase-soft: #f0f3f9;
  --purchase-green: #e3f3eb;
  --purchase-shadow: 0 22px 80px #222a552b;
  min-block-size: 100svh;
  color: var(--purchase-ink);
  background:
    radial-gradient(ellipse at 12% 2%, #f6eafa 0, transparent 48%),
    radial-gradient(ellipse at 95% 16%, #e2edfa 0, transparent 66%),
    #f2f5fb;
  line-height: 1.4;
}

.purchase-shell {
  width: min(100%, 624px);
  margin-inline: auto;
  padding: 0 16px;
  min-block-size: 100svh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.purchase-page button, .purchase-page input, .purchase-page select { color: inherit; }
.purchase-page button { border: 0; cursor: pointer; }
.purchase-page button:disabled { cursor: default; }
.purchase-page svg { width: 20px; height: 20px; flex: none; }
.purchase-page :focus-visible { outline-offset: 3px; }

.purchase-header {
  min-block-size: 68px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.purchase-header h1 { font-size: 17px; font-weight: 750; }
.purchase-header p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-block-start: 2px;
  color: var(--purchase-muted);
  font-size: 12px;
}
.purchase-tool {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff9e;
}
[dir="rtl"] .purchase-back svg { rotate: 180deg; }
.purchase-card { background: var(--purchase-surface); }

.purchase-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-block-size: 76px;
  padding: 14px;
  border-radius: 22px;
}
.purchase-rate-text { display: flex; flex-direction: column; gap: 3px; align-items: end; }
.purchase-rate-text span { color: var(--purchase-muted); font-size: 11px; }
.purchase-rate-text strong { font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.purchase-category {
  display: flex;
  align-items: center;
  position: relative;
  min-inline-size: 0;
  min-block-size: 44px;
  padding-inline-start: 5px;
  border-radius: var(--radius-pill);
  background: var(--purchase-soft);
}
.purchase-category > img { inline-size: 36px; block-size: 36px; flex: none; }
.purchase-category select { border: 0; background: transparent; padding-inline: 3px 8px; }
.purchase-category .select-trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  min-block-size: 44px;
  padding-inline: 3px 12px;
  font-size: 13px;
  font-weight: 730;
  border-radius: var(--radius-pill);
  background: transparent;
}
.purchase-category .select-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid var(--purchase-muted);
  border-width: 0 1.5px 1.5px 0;
  rotate: 45deg;
  margin-block-end: 4px;
}
.purchase-category .select-trigger[aria-expanded="true"]::after { rotate: 225deg; margin-block-end: -4px; }
.purchase-category .select-menu {
  z-index: 1;
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(100% + 6px);
  min-inline-size: max(100%, 10rem);
  max-block-size: var(--select-space);
  overflow: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid #e6e9f1;
  border-radius: 18px;
  background: var(--purchase-surface);
  color: var(--purchase-ink);
  box-shadow: var(--purchase-shadow);
}
.purchase-category .select-menu[data-placement="above"] { inset-block: auto calc(100% + 6px); }
.purchase-category [role="option"] {
  cursor: pointer;
  padding: 9px 11px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 13px;
}
.purchase-category [aria-selected="true"] { font-weight: 750; }
.purchase-category .is-active { background: var(--purchase-soft); }

.purchase-amount {
  display: grid;
  justify-items: center;
  gap: 13px;
  padding: 18px 16px 13px;
  border-radius: 26px;
}
.purchase-amount > label { text-align: center; font-size: 14px; color: var(--purchase-muted); font-weight: 650; }
.purchase-figure {
  direction: ltr;
  width: min(100%, 460px);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
  padding-block: 7px;
}
.purchase-figure input {
  field-sizing: content;
  min-inline-size: 1.3ch;
  inline-size: auto;
  max-inline-size: calc(100% - 3.2rem);
  padding: 0;
  background: none;
  border: 0;
  text-align: end;
  font: 760 clamp(30px, 10.8vw, 45px)/1.15 var(--font-body);
  font-variant-numeric: tabular-nums;
}
.purchase-figure input::placeholder { color: inherit; opacity: 1; }
.purchase-amount:has(.purchase-figure input:focus-visible) { box-shadow: inset 0 0 0 2px var(--color-focus); }
.purchase-figure input:focus-visible { outline: none; }
.purchase-figure > span { font-size: 14px; font-weight: 700; color: var(--purchase-muted); }
.purchase-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  inline-size: 100%;
  min-block-size: 40px;
  padding-inline: 12px;
  border-radius: var(--radius-pill);
  background: var(--purchase-soft);
  font-size: 13px;
}
.purchase-swap svg { width: 18px; height: 18px; }
.purchase-swap b { display: inline-block; font-weight: 750; }
.purchase-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  width: 100%;
  color: var(--purchase-muted);
  font-size: 11px;
}
.purchase-clear {
  min-block-size: 30px;
  padding-inline: 10px;
  background: var(--purchase-soft);
  border-radius: var(--radius-pill);
  font-size: 11px;
  white-space: nowrap;
}
.purchase-corrections { display: flex; gap: 5px; }
.purchase-corrections [data-key="."] { min-inline-size: 30px; }
.purchase-error { justify-self: start; font-size: 12px; color: #983d3d; }

.purchase-projection {
  margin: 0;
  padding: 3px 14px;
  border-radius: 22px;
}
.purchase-projection > div, .purchase-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.purchase-projection > div { min-block-size: 58px; padding-block: 7px; }
.purchase-projection > div + div, .purchase-total { border-block-start: 1px solid #e9edf4; }
.purchase-projection dt {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--purchase-muted);
  font-size: 13px;
}
.purchase-projection dd, .purchase-breakdown dd {
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: end;
}
.purchase-disc {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--purchase-green);
  color: #387757;
  flex: none;
}
.purchase-disc-cost { background: #e9effb; color: #3c5990; }
.purchase-disc-cost svg { width: 17px; height: 17px; }

.purchase-dock {
  margin-block-start: auto;
  padding: 10px 12px max(16px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--purchase-surface);
}
.purchase-keypad {
  max-inline-size: 420px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.purchase-keypad button {
  display: grid;
  place-items: center;
  min-block-size: 46px;
  padding: 0;
  background: transparent;
  border-radius: var(--radius-pill);
  font-size: 21px;
  font-weight: 740;
}
.purchase-keypad [data-key="000"] { font-size: 17px; }
.purchase-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  inline-size: 100%;
  min-block-size: 50px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: var(--purchase-green);
  color: #204e3a;
  font-weight: 750;
}
.purchase-action:disabled { opacity: 1; background: var(--purchase-soft); color: var(--purchase-muted); }
.purchase-action:disabled img { opacity: 0.5; }
.purchase-review { margin-block-start: 10px; }
.purchase-tool:active, .purchase-swap:active, .purchase-keypad button:active, .purchase-clear:active {
  background: #e9eef7;
}
@media (hover: hover) {
  .purchase-tool:hover, .purchase-keypad button:hover { background: var(--purchase-soft); }
}

.purchase-page:has(dialog[open]) { overflow: hidden; }
.purchase-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 624px);
  max-width: 100%;
  max-height: calc(100% - 12px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 28px 28px 0 0;
  color: var(--purchase-ink);
  background: var(--purchase-surface);
  box-shadow: var(--purchase-shadow);
  overscroll-behavior: contain;
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
}
.purchase-sheet::backdrop { background: #1c20354d; backdrop-filter: blur(4px); }
@starting-style {
  .purchase-sheet[open] { opacity: 0; transform: translateY(24px); }
}
.purchase-sheet-body { position: relative; padding: 24px 20px max(24px, env(safe-area-inset-bottom)); }
.purchase-close { position: absolute; inset-block-start: 14px; inset-inline-end: 14px; }
.purchase-sheet-heading { display: grid; justify-items: center; gap: 5px; text-align: center; }
.purchase-sheet-heading h2 { font-size: clamp(20px, 5vw, 24px); }
.purchase-sheet-heading p { color: var(--purchase-muted); font-size: 13px; }
.purchase-breakdown { margin: 18px 0 10px; padding: 4px 14px; border-radius: 18px; background: var(--purchase-soft); }
.purchase-breakdown > div { min-block-size: 37px; padding-block: 5px; }
.purchase-breakdown dt { font-size: 13px; }
.purchase-total { font-weight: 750; }
.purchase-demo-note { margin: 10px 0 14px; color: var(--purchase-muted); font-size: 12px; text-align: center; }
.purchase-slide {
  --slide: 0%;
  display: grid;
  place-items: center;
  position: relative;
  min-block-size: 55px;
  border-radius: var(--radius-pill);
  padding-inline: 50px;
  color: #24543b;
  font-size: 12px;
  font-weight: 720;
  text-align: center;
  background: linear-gradient(90deg, #bce7cf var(--slide), var(--purchase-green) var(--slide));
}
[dir="rtl"] .purchase-slide { background: linear-gradient(270deg, #bce7cf var(--slide), var(--purchase-green) var(--slide)); }
.purchase-slide input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 5px;
  appearance: none;
  background: none;
  cursor: ew-resize;
  border-radius: var(--radius-pill);
}
.purchase-slide input::-webkit-slider-thumb {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #326b50 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 10h12m-5-5 5 5-5 5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
  border: 0;
}
.purchase-slide input::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #326b50 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M4 10h12m-5-5 5 5-5 5' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center no-repeat;
  border: 0;
}
[dir="rtl"] .purchase-slide input::-webkit-slider-thumb { rotate: 180deg; }
[dir="rtl"] .purchase-slide input::-moz-range-thumb { rotate: 180deg; }
.purchase-confirm-text, .purchase-store-link {
  display: block;
  margin: 8px auto 0;
  padding: 8px 12px;
  color: var(--purchase-muted);
  background: transparent;
  font-size: 13px;
  text-align: center;
  text-decoration: underline;
}
.purchase-receipt-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--purchase-green);
  color: #2f7350;
}
.purchase-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

@media (min-width: 650px) {
  .purchase-shell { padding-block-start: 12px; }
}
@media (max-width: 440px) {
  .purchase-dock { margin-inline: -16px; }
}
@media (max-width: 360px), (max-height: 740px) {
  .purchase-shell { gap: 9px; }
  .purchase-header { min-block-size: 60px; }
  .purchase-rate { min-block-size: 66px; padding-block: 10px; }
  .purchase-amount { padding-block: 13px 10px; gap: 7px; }
  .purchase-figure { padding-block: 4px; }
  .purchase-figure input { font-size: clamp(29px, 9.5vw, 38px); }
  .purchase-projection > div { min-block-size: 49px; }
  .purchase-keypad button { min-block-size: 42px; }
}
