:root{color-scheme:dark;--bg:#09151b;--panel:#152631;--panel-soft:#112129;--panel-raised:#1a2d38;--text:#f5f8fa;--muted:#91a3af;--green:#59d36a;--green-dark:#37b94f;--line:rgba(151,178,191,.12);--danger:#ff747f;--amber:#f2c66c;--safe-top:max(env(safe-area-inset-top,0px),var(--tg-safe-area-inset-top,0px),var(--tg-content-safe-area-inset-top,0px),var(--telegram-runtime-safe-top,0px));--safe-bottom:max(env(safe-area-inset-bottom,0px),var(--tg-safe-area-inset-bottom,0px),var(--tg-content-safe-area-inset-bottom,0px),var(--telegram-runtime-safe-bottom,0px))}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{height:100%;margin:0;overflow:hidden;background:var(--bg);font-family:Roboto,"Segoe UI",sans-serif;color:var(--text)}body{overscroll-behavior:none;-webkit-user-select:none;user-select:none}button,input{font:inherit}.shell{position:relative;display:flex;width:min(100%,480px);height:100dvh;margin:auto;overflow:hidden;background:radial-gradient(ellipse 92% 42% at 100% -8%,rgba(74,204,105,.14),transparent 72%),var(--bg);flex-direction:column}.header{position:relative;z-index:5;display:grid;grid-template-columns:40px 1fr 40px;align-items:center;gap:10px;padding:max(12px,calc(var(--safe-top) + 6px)) 15px 10px;background:linear-gradient(180deg,rgba(9,21,27,.6),rgba(9,21,27,.2) 70%,transparent);flex:0 0 auto}.icon-button{display:grid;width:36px;height:36px;padding:0;place-items:center;border:0;border-radius:50%;background:rgba(118,151,167,.12);color:#dfe8ed}.icon-button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.brand{display:flex;align-items:center;justify-content:center;gap:9px}.brand img{width:29px;height:29px;border-radius:9px;object-fit:cover;transform:scale(1.42)}.brand div{display:grid}.brand strong{font-size:16px;font-weight:700}.brand span{font-size:9px;color:var(--muted);letter-spacing:.03em}main{position:relative;z-index:1;min-height:0;padding:4px 15px;overflow:hidden;flex:1}.screen{display:none;height:100%;min-height:0;padding-bottom:max(16px,calc(var(--safe-bottom) + 10px));overflow-x:hidden;overflow-y:auto;overscroll-behavior:none}.screen.active{display:flex;flex-direction:column}.screen-heading{display:flex;align-items:end;justify-content:space-between;padding:10px 2px 12px}.screen-heading>div:first-child{display:grid}.screen-heading span,.screen-title>span{color:var(--green);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.1em}.screen-heading h1,.screen-title h1{margin:3px 0 0;font-size:25px;line-height:1.08;letter-spacing:-.025em}.secure-mark{display:flex;align-items:center;gap:6px;padding-bottom:3px;color:var(--muted);font-size:10px}.secure-mark i{width:7px;height:7px;border-radius:50%;background:var(--green);box-shadow:0 0 12px var(--green)}
[hidden]{display:none!important}
.exchange-benefits{display:flex;min-height:28px;align-items:center;justify-content:center;gap:23px;margin:0 2px 8px;color:#71828c;font-size:10px;font-weight:700;white-space:nowrap}.exchange-benefits span{display:inline-flex;align-items:center;gap:5px}.exchange-benefits i{display:block;width:6px;height:6px;border-radius:50%;background:#3f89ff;box-shadow:0 0 8px rgba(63,137,255,.35)}
.exchange-card{padding:3px 16px;border-radius:22px;background:linear-gradient(145deg,#1a2e39,#14242d);box-shadow:0 18px 42px rgba(0,0,0,.16)}.currency-block{padding:14px 0 9px}.block-label{display:flex;align-items:center;justify-content:space-between;min-height:21px}.block-label>span,.field>span{color:#a7b7c0;font-size:12px;font-weight:500}.block-label button{border:0;background:transparent;color:var(--green);font-size:12px;font-weight:700}.amount-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:49px}.amount-row input,.amount-row output{width:55%;border:0;outline:0;background:transparent;color:#fff;font:700 29px/1.1 Roboto}.amount-row input::placeholder{color:#637580}.currency-picker{display:flex;width:118px;min-width:118px;height:42px;flex:0 0 118px;align-items:center;justify-content:flex-start;gap:7px;padding:0 11px;border:1px solid rgba(101,154,184,.32);border-radius:999px;background:#263b47;color:#fff}.currency-picker strong{min-width:0;flex:1;font-size:15px;font-weight:700;text-align:left}.currency-picker svg{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:#96a8b3;stroke-width:1.8}.coin,.flag{display:grid;width:25px;height:25px;min-width:25px;place-items:center;border-radius:50%;background:#50bea6;color:white;font-weight:700}.flag{overflow:hidden;background:transparent;font-size:21px;line-height:1}.balance-line{min-height:16px;color:var(--muted);font-size:11px}.exchange-divider{display:grid;grid-template-columns:1fr 34px 1fr;align-items:center;gap:7px}.exchange-divider>span{height:1px;background:var(--line)}.exchange-divider button{display:grid;width:34px;height:34px;padding:0;place-items:center;border:0;border-radius:50%;background:#0b1a20;color:var(--green);box-shadow:0 6px 15px rgba(0,0,0,.2)}.exchange-divider svg{width:19px;fill:none;stroke:currentColor;stroke-width:1.8}.receive-block{padding-top:7px}
.quote-card{display:grid;grid-template-columns:1.5fr .75fr;margin-top:9px;padding:11px 13px;border-radius:16px;background:rgba(20,36,45,.86)}.quote-card div{display:grid;gap:4px;padding:0 9px;border-right:1px solid var(--line)}.quote-card div:first-child{padding-left:0}.quote-card div:last-child{padding-right:0;border:0;text-align:right}.quote-card span{color:var(--muted);font-size:10px}.quote-card strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.method-preview{display:grid;grid-template-columns:38px 1fr 20px;align-items:center;gap:10px;width:100%;min-height:59px;margin-top:9px;padding:9px 13px;border:0;border-radius:17px;background:rgba(20,36,45,.86);color:#fff;text-align:left}.method-preview:disabled{opacity:.58}.method-preview>span:nth-child(2){display:grid;gap:3px}.method-preview small{color:var(--muted);font-size:10px}.method-preview strong{font-size:13px}.method-icon{display:grid;width:38px;height:38px;place-items:center;border-radius:12px;background:rgba(91,211,106,.13);color:var(--green)}.method-icon svg{width:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.chevron{width:20px;fill:none;stroke:#8496a1;stroke-width:1.8}.range-hint{min-height:31px;padding:9px 3px 7px;color:var(--muted);font-size:11px}.primary-button,.secondary-button{display:grid;width:100%;min-height:51px;place-items:center;border:0;border-radius:15px;font:700 15px Roboto;text-decoration:none}.primary-button{background:linear-gradient(135deg,var(--green),#4bc85a);color:#061108;box-shadow:0 12px 25px rgba(73,194,83,.14)}.primary-button:disabled{background:#22343d;color:#6f818c;box-shadow:none}.secondary-button{margin-top:8px;background:#172831;color:#dce5ea}.sticky-action{margin-top:15px;margin-bottom:max(8px,calc(var(--safe-bottom) + 4px));flex:0 0 auto}
.screen-title{padding:13px 2px 16px}.screen-title h1{font-size:26px}.screen-title p{margin:5px 0 0;color:var(--muted);font-size:12px;line-height:1.35}.screen-title.centered{text-align:center}.method-tabs{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin-bottom:13px;padding:3px;border-radius:14px;background:#13232c}.method-tabs button{height:36px;border:0;border-radius:11px;background:transparent;color:var(--muted);font-size:12px;font-weight:700}.method-tabs button.active{background:#2b414d;color:#fff}.section-caption{margin:0 3px 7px;color:var(--muted);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.09em}.bank-list{overflow:hidden;margin-bottom:10px;border-radius:19px;background:#14252f}.bank-option{display:flex;width:100%;min-height:58px;align-items:center;gap:11px;padding:8px 13px;border:0;border-bottom:1px solid var(--line);background:transparent;color:#fff;text-align:left}.bank-option:last-child{border:0}.bank-option .bank-logo{display:grid;width:39px;height:39px;place-items:center;overflow:hidden;border-radius:12px;background:#263d49;color:var(--green);font-size:12px;font-weight:700}.bank-logo img{width:100%;height:100%;object-fit:cover}.bank-option strong{flex:1;font-size:14px}.radio{width:21px;height:21px;border:2px solid #617681;border-radius:50%}.bank-option.selected{background:rgba(91,211,106,.045)}.bank-option.selected .radio{border:6px solid var(--green)}.field{display:block;margin:10px 0;padding:13px 14px;border-radius:16px;background:#14252f}.field>span{display:block;margin-bottom:8px}.field input{width:100%;border:0;outline:0;background:transparent;color:#fff;font:500 16px Roboto;user-select:text}.privacy-note{display:flex;align-items:center;gap:8px;margin:2px 4px 16px;color:var(--muted);font-size:10px;line-height:1.35}.privacy-note svg{flex:0 0 19px;width:19px;fill:none;stroke:var(--green);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.summary-card{overflow:hidden;margin:1px 0 12px;padding:4px 14px;border-radius:19px;background:#14252f}.summary-row{display:flex;justify-content:space-between;gap:18px;padding:11px 0;border-bottom:1px solid var(--line)}.summary-row:last-child{border:0}.summary-row span{color:var(--muted);font-size:12px}.summary-row strong{max-width:66%;font-size:13px;text-align:right}.warning{display:grid;gap:3px;margin:9px 0 14px;padding:12px 14px;border-radius:15px;background:rgba(242,198,108,.08);color:#dec27f;font-size:11px;line-height:1.35}.warning strong{font-size:12px}.payment-card{display:grid;justify-items:center;padding:15px;border-radius:22px;background:#14252f}.payment-qr{width:min(68vw,270px);aspect-ratio:1;padding:10px;border-radius:18px;background:#fff;object-fit:contain}.payment-card>strong{margin-top:13px;font-size:24px}.payment-card>span{margin:4px 0 12px;color:var(--muted);font-size:11px}.link-button{width:100%}.status-line{display:flex;align-items:center;justify-content:center;gap:8px;margin-top:14px;padding:12px;border-radius:14px;background:rgba(91,211,106,.07);color:var(--green);font-size:12px;font-weight:700}.status-line i{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 6px rgba(91,211,106,.09);animation:pulse 1.4s infinite}.payment-help{margin:10px 12px 14px;color:var(--muted);font-size:11px;line-height:1.4;text-align:center}@keyframes pulse{50%{opacity:.35}}
.result-screen{align-items:stretch}.result-icon{display:grid;width:82px;height:82px;margin:56px auto 18px;place-items:center;border-radius:50%;background:rgba(91,211,106,.15);color:var(--green);font-size:40px}.result-screen>h1,.result-screen>p{text-align:center}.result-screen>h1{margin:0;font-size:26px}.result-screen>p{margin:6px auto 22px;color:var(--muted);font-size:13px}.result-actions{margin-top:auto}.history-list{display:grid;gap:8px}.history-item{padding:13px 14px;border-radius:17px;background:#14252f}.history-head,.history-route,.history-foot{display:flex;justify-content:space-between;gap:10px}.history-head{align-items:center}.history-head strong{font-size:12px}.history-route{padding:13px 0 8px;font-size:16px;font-weight:700}.history-foot{color:var(--muted);font-size:10px}.status{padding:4px 8px;border-radius:99px;background:rgba(91,211,106,.12);color:var(--green);font-size:9px;font-weight:700}.empty{padding:48px 20px;color:var(--muted);text-align:center}.sheet-overlay{position:fixed;inset:0;z-index:10;background:rgba(0,0,0,.65)}.sheet{position:absolute;right:0;bottom:0;left:0;width:min(100%,480px);max-height:75dvh;margin:auto;padding:8px 15px max(20px,var(--safe-bottom));overflow:auto;border-radius:24px 24px 0 0;background:#101f28}.sheet-handle{width:38px;height:4px;margin:0 auto 9px;border-radius:99px;background:#53646e}.sheet-head{display:flex;align-items:center;justify-content:space-between}.sheet-head h2{font-size:20px}.sheet-head button{width:34px;height:34px;border:0;border-radius:50%;background:#263741;color:#fff;font-size:24px}.picker-list{display:grid;gap:7px}.picker-item{display:flex;min-height:60px;align-items:center;gap:11px;padding:9px 12px;border:0;border-radius:16px;background:#172832;color:#fff;text-align:left}.picker-item .picker-icon{display:grid;width:38px;height:38px;place-items:center;border-radius:50%;background:#23404a;font-size:19px}.picker-item div{display:grid}.picker-item strong{font-size:15px}.picker-item span{color:var(--muted);font-size:11px}.toast{position:fixed;z-index:30;right:14px;bottom:max(18px,var(--safe-bottom));left:14px;max-width:452px;margin:auto;padding:12px 15px;border-radius:14px;background:#452129;color:#ffdce0;text-align:center;font-size:12px}.auth-fallback{display:grid;min-height:100dvh;padding:28px;place-content:center;text-align:center}.auth-fallback img{width:66px;height:66px;margin:auto;border-radius:19px}.auth-fallback h1{margin-bottom:4px}.auth-fallback p{max-width:350px;color:var(--muted);line-height:1.45}.auth-fallback a{padding:13px 21px;border-radius:14px;background:var(--green);color:#07120b;font-weight:700;text-decoration:none}@media(max-height:680px){.destination{min-height:52px}.currency-block{padding-top:10px}.amount-row{min-height:43px}.quote-card{padding-top:9px;padding-bottom:9px}.method-preview{min-height:54px}.primary-button,.secondary-button{min-height:47px}}@media(min-width:700px){body{background:#050b0e}.shell{box-shadow:0 0 80px rgba(0,0,0,.5)}}

/* The runtime value is already normalized in app.js. Reading Telegram's CSS
   inset here as well double-counted the fullscreen header on some iPhones. */
:root{--safe-top:max(env(safe-area-inset-top,0px),var(--telegram-runtime-safe-top,0px));--safe-bottom:max(env(safe-area-inset-bottom,0px),var(--telegram-runtime-safe-bottom,0px))}

/* Telegram Desktop opens Mini Apps in a short phone-shaped webview. Keep the
   complete first exchange step inside that viewport without an inner scroll. */
@media(max-height:760px){
  .header{grid-template-columns:34px 1fr 34px;gap:7px;padding:max(7px,calc(var(--safe-top) + 3px)) 12px 6px}
  .icon-button{width:32px;height:32px}.icon-button svg{width:19px;height:19px}
  .brand{gap:7px}.brand img{width:25px;height:25px}.brand strong{font-size:14px}.brand span{font-size:8px}
  main{padding:0 12px}
  #exchangeScreen{overflow-y:hidden;padding-bottom:max(5px,calc(var(--safe-bottom) + 3px))}
  .screen-heading{padding:5px 1px 7px}.screen-heading h1{font-size:21px}.screen-heading span{font-size:8px}.secure-mark{font-size:8px;padding-bottom:2px}
  .exchange-benefits{min-height:22px;gap:18px;margin-bottom:5px;font-size:8px}.exchange-benefits i{width:5px;height:5px}
  .exchange-card{padding:2px 12px;border-radius:18px}.currency-block{padding:7px 0 5px}.block-label{min-height:17px}.block-label>span,.field>span,.block-label button{font-size:10px}.amount-row{min-height:38px}.amount-row input,.amount-row output{font-size:24px}.currency-picker{width:104px;min-width:104px;height:34px;flex-basis:104px;padding:0 8px;border-radius:999px}.currency-picker strong{font-size:13px}.coin,.flag{width:22px;height:22px;min-width:22px}.flag{font-size:18px}.balance-line{min-height:13px;font-size:9px}.exchange-divider{grid-template-columns:1fr 28px 1fr}.exchange-divider button{width:28px;height:28px}.exchange-divider svg{width:16px}.receive-block{padding-top:4px}
  .quote-card{margin-top:6px;padding:7px 10px;border-radius:13px}.quote-card div{gap:2px;padding:0 7px}.quote-card span{font-size:8px}.quote-card strong{font-size:9px}
  .method-preview{grid-template-columns:31px 1fr 17px;gap:8px;min-height:45px;margin-top:6px;padding:6px 10px;border-radius:13px}.method-icon{width:31px;height:31px;border-radius:10px}.method-icon svg{width:18px}.method-preview small{font-size:8px}.method-preview strong{font-size:11px}.chevron{width:17px}
  .range-hint{min-height:22px;padding:5px 2px 4px;font-size:9px}.primary-button,.secondary-button{min-height:40px;border-radius:12px;font-size:13px}.sticky-action{margin-top:5px;margin-bottom:max(4px,calc(var(--safe-bottom) + 2px))}
}

/* Keep the exchange content scrollable on compact phones while hiding the
   browser/WebView scrollbar, which otherwise appears as a bright rail over
   the right edge of the interface. */
.screen,.sheet{scrollbar-width:none;-ms-overflow-style:none}
.screen::-webkit-scrollbar,.sheet::-webkit-scrollbar{display:none;width:0;height:0}

/* In Telegram fullscreen the runtime inset already includes the top controls.
   A tight final padding places the Exch header directly below them without
   allowing the controls to overlap it. */
.telegram-mobile.telegram-fullscreen .header{padding-top:max(8px,calc(var(--safe-top) + 2px));padding-bottom:6px}

/* Swapora Exch: compact exchange workspace inspired by familiar exchange
   terminals while retaining Swapora's softer teal visual language. */
.exchange-benefits{margin-bottom:7px;color:#738791;font-size:9px;letter-spacing:.01em}
.exchange-workspace{display:grid;gap:0;padding:9px;border-radius:23px;background:linear-gradient(150deg,rgba(17,43,57,.96),rgba(10,29,39,.98));box-shadow:0 16px 38px rgba(0,0,0,.18)}
.exchange-workspace .asset-panel{padding:11px 12px 10px;border-radius:17px;background:rgba(4,17,25,.48);box-shadow:inset 0 0 0 1px rgba(85,151,183,.13)}
.asset-panel-head{gap:9px}.asset-panel-head>span{flex:0 0 auto}
.quick-amounts{display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:4px;overflow:hidden}
.quick-amounts button{min-width:28px;height:19px;padding:0 6px;border:0;border-radius:999px;background:rgba(50,93,116,.42);color:#9eb0ba;font-size:8px;font-weight:700;line-height:19px}
.quick-amounts button:active{background:rgba(91,211,106,.2);color:var(--green)}
.exchange-workspace .amount-row{min-height:52px}.exchange-workspace .amount-row input,.exchange-workspace .amount-row output{font-size:30px}
.exchange-workspace .currency-picker{height:43px;border-radius:999px;background:rgba(37,64,80,.92);box-shadow:0 7px 18px rgba(0,0,0,.12)}
.asset-meta{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:7px;min-height:16px}
.receive-block .asset-meta{grid-template-columns:minmax(0,1fr) auto}
.rate-line{overflow:hidden;color:#718691;font-size:9px;text-overflow:ellipsis;white-space:nowrap}
.asset-meta .balance-line{min-height:auto;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}
.asset-meta #maxButton{padding:0;border:0;background:transparent;color:var(--green);font-size:10px;font-weight:700}
.method-badge{max-width:58%;overflow:hidden;padding:4px 7px;border-radius:999px;background:rgba(57,130,255,.13);color:#76aafc!important;font-size:8px!important;text-overflow:ellipsis;text-transform:none!important;letter-spacing:0!important;white-space:nowrap}
.exchange-workspace .exchange-divider{position:relative;z-index:2;margin:-2px 0}.exchange-workspace .exchange-divider>span{background:rgba(96,131,148,.19)}
.exchange-workspace .exchange-divider button{width:38px;height:38px;background:linear-gradient(145deg,#274e74,#315e98);color:#dcefff;box-shadow:0 7px 18px rgba(4,15,22,.38)}
.quote-card{margin-top:7px;background:rgba(17,39,51,.78);box-shadow:none}
.method-options{display:grid;gap:6px;margin-top:7px}.method-options.waiting{opacity:.72}
.method-option{display:grid;grid-template-columns:34px 1fr 20px;align-items:center;gap:9px;width:100%;min-height:51px;padding:7px 11px;border:0;border-radius:15px;background:rgba(19,42,54,.82);color:#fff;text-align:left;transition:background .16s ease,transform .16s ease}
.method-option:active{transform:scale(.992)}.method-option.selected{background:linear-gradient(145deg,rgba(31,71,88,.96),rgba(20,47,60,.96));box-shadow:inset 0 0 0 1px rgba(91,211,106,.38)}
.method-option .method-icon{width:34px;height:34px;border-radius:11px}.method-option .method-icon svg{width:19px}
.method-option>span:nth-child(2){display:grid;gap:2px;min-width:0}.method-option strong{overflow:hidden;font-size:12px;text-overflow:ellipsis;white-space:nowrap}.method-option small{overflow:hidden;color:var(--muted);font-size:9px;text-overflow:ellipsis;white-space:nowrap}
.method-option>i{display:block;width:18px;height:18px;border:2px solid #566c78;border-radius:50%}.method-option.selected>i{border:5px solid var(--green);background:#fff}
.range-hint{padding-top:6px;padding-bottom:3px}.sticky-action{margin-top:6px}

@media(max-width:350px){.quick-amounts{gap:3px}.quick-amounts button{min-width:24px;padding:0 4px;font-size:7px}.exchange-workspace{padding:7px}.exchange-workspace .asset-panel{padding-right:10px;padding-left:10px}}
@media(max-height:760px){
  .exchange-benefits{min-height:20px;margin-bottom:4px}
  .exchange-workspace{padding:6px;border-radius:18px}.exchange-workspace .asset-panel{padding:7px 10px 6px;border-radius:14px}
  .quick-amounts button{height:17px;line-height:17px}.exchange-workspace .amount-row{min-height:37px}.exchange-workspace .amount-row input,.exchange-workspace .amount-row output{font-size:23px}
  .exchange-workspace .currency-picker{height:33px;border-radius:999px}.exchange-workspace .exchange-divider{grid-template-columns:1fr 28px 1fr}.exchange-workspace .exchange-divider button{width:28px;height:28px}
  .asset-meta{min-height:12px}.rate-line{font-size:8px}.method-options{gap:4px;margin-top:5px}.method-option{grid-template-columns:29px 1fr 17px;min-height:40px;padding:5px 9px;border-radius:12px}.method-option .method-icon{width:29px;height:29px}.method-option strong{font-size:10px}.method-option small{font-size:8px}.method-option>i{width:16px;height:16px}
}
