:root {
    --bg: #080d14;
    --surface: #0d141e;
    --surface-raised: #121b27;
    --line: rgba(151, 166, 190, 0.12);
    --line-strong: rgba(151, 166, 190, 0.2);
    --text: #f4f7fb;
    --muted: #8390a3;
    --muted-bright: #aeb8c7;
    --green: #00c087;
    --green-deep: #062f28;
    --red: #f0445a;
    --red-deep: #38141d;
    --accent: #f2b731;
    --nav-height: 74px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Hiragino Sans", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #05090f;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -20%, rgba(45, 66, 96, 0.24), transparent 32rem),
        #05090f;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior-y: none;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    margin: 0;
    padding: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

.app-frame {
    position: relative;
    width: min(100%, 480px);
    min-height: 100vh;
    margin: 0 auto;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 72px);
    overflow: visible;
    background: var(--bg);
    box-shadow: 0 0 70px rgba(0, 0, 0, 0.44);
}

.page-view {
    animation: page-in 240ms ease-out both;
}

.topbar {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr);
    align-items: center;
    height: 68px;
    padding: max(8px, env(safe-area-inset-top, 0px)) 18px 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 13, 20, 0.88);
    backdrop-filter: blur(18px);
}

.topbar-action,
.language-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    min-height: 40px;
    padding: 0 3px;
    color: var(--muted-bright);
    font-size: 13px;
    font-weight: 650;
}

.topbar-action svg,
.language-trigger svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.language-trigger {
    justify-self: end;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-mark {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid rgba(242, 183, 49, 0.42);
    border-radius: 50%;
    background: linear-gradient(145deg, #ffe085, #e49b12);
    box-shadow: 0 5px 18px rgba(228, 155, 18, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #171006;
    font-size: 17px;
    font-weight: 900;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    white-space: nowrap;
}

.brand-copy strong {
    font-size: 14px;
    letter-spacing: 0.01em;
}

.brand-copy small {
    color: var(--muted);
    font-size: 10px;
}

.market-panel {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(17, 26, 39, 0.36), transparent 30%);
}

.quote-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 8px;
    align-items: stretch;
    min-height: 76px;
    padding: max(8px, calc(3px + env(safe-area-inset-top, 0px))) 16px 0;
}

.quote-main {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 66px;
    justify-content: center;
    flex-direction: column;
}

.pair-row {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.7vw, 8px);
}

.pair-row h1 {
    margin: 0;
    color: var(--muted-bright);
    font-size: clamp(10.5px, 3vw, 12px);
    font-weight: 650;
}

.live-dot {
    position: relative;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 192, 135, 0.1);
}

.live-dot::after {
    position: absolute;
    inset: -3px;
    border: 1px solid var(--green);
    border-radius: inherit;
    content: "";
    animation: live-pulse 2s ease-out infinite;
}

.quote-value {
    margin-top: 6px;
    font-size: clamp(27px, 7vw, 34px);
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1;
}

.quote-change {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 66px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    justify-self: end;
    gap: 4px;
    text-align: right;
}

.quote-tools {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 66px;
    align-items: center;
    justify-self: center;
}

.quote-language {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    height: 66px;
    min-height: 66px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted-bright);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.language-flag {
    display: inline-flex;
    width: 48px;
    height: 32.4px;
    flex: 0 0 32.4px;
    overflow: hidden;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.language-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quote-language .language-chevron {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.current-language-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.quote-language:active {
    opacity: 0.72;
}

.quote-change strong {
    max-width: 100%;
    font-size: clamp(27px, 7vw, 34px);
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    letter-spacing: -0.06em;
    line-height: 1;
    transform: scaleX(0.88);
    transform-origin: right center;
    white-space: nowrap;
}

.quote-up strong,
.positive {
    color: var(--red) !important;
}

.quote-down strong,
.negative {
    color: var(--green) !important;
}

.period-tabs {
    display: flex;
    height: 30px;
    flex: 0 0 42px;
    align-items: stretch;
    padding: 0;
    pointer-events: auto;
}

.period-tabs button {
    width: 42px;
    flex: 0 0 42px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
}

.period-tabs button.is-active {
    color: var(--text);
}

.chart-wrap {
    position: relative;
    display: grid;
    grid-template-rows: 30px minmax(0, 1fr);
    height: 326px;
    background: #080d14;
}

.chart-info-row {
    display: flex;
    height: 30px;
    align-items: center;
    gap: 8px;
    padding: 0 54px 0 14px;
    background: #080d14;
    pointer-events: none;
}

.market-chart {
    width: 100%;
    height: 100%;
    min-height: 0;
}

.ohlc-strip {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-wrap: nowrap;
    gap: 4px 8px;
    pointer-events: none;
    color: #657286;
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ohlc-strip b {
    margin-left: 2px;
    color: #94a0b1;
    font-weight: 550;
}

.wallet-card {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    height: 72px;
    min-height: 72px;
    margin: 20px 14px 0;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(19, 29, 43, 0.93), rgba(12, 19, 29, 0.93));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018), 0 12px 32px rgba(0, 0, 0, 0.12);
}

.balance-item {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
    min-width: 0;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.balance-item:last-child {
    grid-column: 3;
    align-items: flex-end;
    text-align: right;
}

.balance-item:first-child {
    grid-column: 1;
}

.balance-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.balance-item strong {
    overflow: hidden;
    font-size: clamp(14px, 4vw, 18px);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    letter-spacing: -0.025em;
    text-overflow: ellipsis;
}

.balance-refresh {
    display: grid;
    width: 24px;
    height: 20px;
    place-items: center;
    color: var(--accent);
    transition: color 140ms ease, transform 140ms ease;
}

.balance-item:last-child .balance-refresh {
    align-self: flex-end;
}

.balance-refresh:active {
    color: #ffd66b;
    transform: scale(0.9);
}

.balance-refresh svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.balance-refresh.is-refreshing svg {
    animation: balance-refresh-spin 620ms linear infinite;
}

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

.balance-rule {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    display: flex;
    width: 96px;
    max-width: none;
    height: 96px;
    align-items: center;
    justify-content: center;
    justify-self: center;
    flex-direction: column;
    gap: 7px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    background: var(--accent);
    color: #101925;
    box-shadow: 0 8px 22px rgba(242, 183, 49, 0.18);
    font-size: 16px;
    font-weight: 760;
    transform: translate(-50%, -50%);
    transition: transform 140ms ease, background 140ms ease;
}

.balance-rule:active {
    background: #ffd66b;
    transform: translate(-50%, -50%) scale(0.96);
}

.balance-rule svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.trade-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 20px 14px 14px;
}

.trade-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
}

.trade-button {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 70px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 13px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 140ms ease, filter 140ms ease;
}

.trade-button:active {
    transform: scale(0.975);
    filter: brightness(0.92);
}

.trade-label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.trade-button strong {
    font-size: 15px;
    font-weight: 760;
}

.trade-button small {
    max-width: 100%;
    overflow: hidden;
    font-size: 9px;
    opacity: 0.7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.trade-buy {
    border-color: rgba(0, 192, 135, 0.34);
    background: linear-gradient(135deg, #009e70, #00bd83);
    color: #f2fffb;
}

.trade-sell {
    border-color: rgba(240, 68, 90, 0.4);
    background: linear-gradient(135deg, #d9364c, #ef4b60);
    color: #fff7f8;
}

.trade-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.1);
    font-size: 17px;
    font-weight: 800;
}

.latest-order-card {
    min-width: 0;
    padding: 11px 12px 7px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: linear-gradient(150deg, rgba(17, 27, 40, 0.92), rgba(10, 17, 26, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.latest-order-card h2 {
    display: flex;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    color: var(--muted-bright);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.latest-order-card h2 > span {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
}

.latest-order-buy h2 > span {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(0, 192, 135, 0.08);
}

.latest-order-sell h2 > span {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(240, 68, 90, 0.08);
}

.latest-order-card dl {
    margin: 0;
}

.latest-order-card dl > div {
    display: flex;
    min-height: 29px;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    border-bottom: 1px solid rgba(151, 166, 190, 0.075);
}

.latest-order-card dl > div:last-child {
    border-bottom: 0;
}

.latest-order-card dt,
.latest-order-card dd {
    margin: 0;
    font-size: 10px;
    line-height: 1.3;
}

.latest-order-card dt {
    min-width: 0;
    flex: 0 1 auto;
    color: var(--muted);
}

.latest-order-card dd {
    max-width: none;
    flex: 0 0 auto;
    overflow: hidden;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.latest-order-card .order-amount {
    direction: ltr;
}

.latest-order-action {
    margin: 6px 0 0;
}

.latest-order-action-button {
    width: 100%;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(151, 166, 190, 0.18);
    border-radius: 7px;
    background: rgba(151, 166, 190, 0.06);
    color: var(--muted-bright);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.latest-order-action-button:hover:not(:disabled) {
    border-color: rgba(151, 166, 190, 0.36);
    background: rgba(151, 166, 190, 0.1);
    color: var(--text);
}

.latest-order-action-button:focus-visible {
    outline: 2px solid var(--muted-bright);
    outline-offset: 2px;
}

.latest-order-action-button:disabled {
    cursor: default;
    border-color: rgba(151, 166, 190, 0.08);
    background: rgba(151, 166, 190, 0.035);
    color: #697687;
}

.trade-action-feedback {
    margin: 0 14px;
    color: var(--muted-bright);
    font-size: 11px;
    line-height: 1.5;
}

.trade-action-feedback--error {
    color: var(--red);
}

.market-notice {
    margin: 1px 0 0;
    color: #536072;
    font-size: 10px;
    text-align: center;
}

.bottom-nav {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(100%, 480px);
    height: calc(var(--nav-height) + var(--safe-bottom));
    margin: 0 auto;
    padding: 7px 8px var(--safe-bottom);
    border-top: 1px solid var(--line-strong);
    background: rgba(10, 16, 24, 0.94);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(22px) saturate(130%);
}

.nav-item {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 11px;
    color: #69778a;
    font-size: 12px;
    font-weight: 600;
    transition: color 160ms ease, transform 160ms ease;
}

.nav-item:not(:last-child)::after {
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 32px;
    border-radius: 1px;
    background: var(--line-strong);
    content: "";
    transform: translateY(-50%);
}

.nav-item:active {
    transform: scale(0.94);
}

.nav-item svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.nav-item.is-active {
    color: var(--text);
}

.nav-item.is-active::before {
    position: absolute;
    top: -7px;
    width: 26px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: var(--accent);
    box-shadow: 0 2px 10px rgba(242, 183, 49, 0.4);
    content: "";
}

.nav-item.is-active svg {
    color: var(--accent);
}

.sheet-layer {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sheet-layer[hidden] {
    display: none;
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 8, 0.72);
    backdrop-filter: blur(3px);
    animation: fade-in 180ms ease both;
}

.bottom-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: min(76vh, 580px);
    padding: 0 18px calc(26px + var(--safe-bottom));
    overflow: auto;
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    background: #101923;
    box-shadow: 0 -26px 70px rgba(0, 0, 0, 0.46);
    animation: sheet-up 260ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.sheet-layer--rules {
    align-items: stretch;
    padding: max(8px,env(safe-area-inset-top,0px)) 14px max(12px,env(safe-area-inset-bottom,0px));
}

.sheet-layer--rules .rules-sheet {
    position: relative;
    display: flex;
    width: min(100%,452px);
    max-height: none;
    flex-direction: column;
    padding: 0 18px 14px;
    overflow: hidden;
    border-bottom: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: 0 24px 76px rgba(0,0,0,.56);
}

.rules-sheet__close {
    position: absolute;
    z-index: 2;
    top: 8px;
    inset-inline-end: 8px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    color: var(--muted-bright);
    background: rgba(151,166,190,.09);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.sheet-handle {
    width: 38px;
    height: 4px;
    margin: 9px auto 5px;
    border-radius: 10px;
    background: #394454;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 720;
}

.sheet-head > button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: rgba(151, 166, 190, 0.09);
    color: var(--muted-bright);
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.empty-state {
    display: flex;
    min-height: 250px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 17px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(151, 166, 190, 0.06);
    color: #5f6e82;
}

.empty-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.empty-state strong {
    font-size: 15px;
}

.empty-state p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.rules-content { display: flex; min-height: 0; flex: 1; flex-direction: column; padding: 32px 0 3px; overflow-y: auto; overscroll-behavior: contain; }
.rules-introduction { min-height: 96px; flex: 0 0 96px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg,rgba(242,183,49,.055),rgba(17,27,40,.82)); }
.rules-introduction__space { width: 100%; height: 100%; }
.rules-table-title { margin: 0; padding: 14px 2px 12px; color: var(--text); font-size: 17px; font-weight: 720; line-height: 1.3; }

.rules-table-shell {
    overflow: hidden;
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(10,18,28,.64);
}

.rules-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rules-table tr:not(:last-child) { border-bottom: 1px solid var(--line); }
.rules-table th,
.rules-table td { min-height: 52px; padding: 15px 16px; font-size: 12px; line-height: 1.4; }
.rules-table th { width: 38%; color: var(--muted); font-weight: 700; text-align: center; vertical-align: middle; }
.rules-table td { border-inline-start: 1px solid var(--line); color: var(--text); font-weight: 780; text-align: end; }
.rules-range-row > th span,
.rules-range-row > th strong { display: block; }
.rules-range-row > th strong { margin-top: 5px; color: var(--accent); font-size: 10px; font-weight: 820; letter-spacing: .02em; }
.rules-table > tbody > tr:not(.rules-range-row) > td { vertical-align: middle; text-align: center; }
.rules-table .rules-range-cell { padding: 0; }
.rules-range-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rules-range-grid tr:not(:last-child) { border-bottom: 1px solid var(--line); }
.rules-range-grid td { width: 50%; padding: 10px 3px; border-inline-start: 0; text-align: center; }
.rules-range-grid td + td { border-inline-start: 1px solid var(--line); }
.rules-range-grid__limits span,
.rules-range-grid__limits strong { display: inline; font-size: 10px; }
.rules-range-grid__limits span { margin-inline-end: 3px; color: var(--muted); font-weight: 700; }
.rules-range-grid__limits strong { color: #00c087; font-weight: 840; }
.rules-range-grid__limits td:last-child strong { color: #f0445a; }
.rules-range-grid__rates td { color: #dce4ee; font-size: 9px; font-weight: 700; white-space: nowrap; }

.language-options {
    display: flex;
    flex-direction: column;
    padding: 7px 0 2px;
}

.language-options button {
    display: flex;
    min-height: 67px;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.language-options button:last-child {
    border-bottom: 0;
}

.language-option-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-option-flag {
    display: block;
    width: 31px;
    height: 21px;
    flex: 0 0 31px;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.language-option-flag img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.language-option-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.language-options b {
    font-size: 14px;
}

.language-options i {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    background: var(--green);
    color: #03120e;
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
    opacity: 0;
}

.language-options button.is-active i {
    opacity: 1;
}

.toast {
    position: fixed;
    z-index: 90;
    top: 50%;
    left: 50%;
    display: flex;
    min-width: 172px;
    max-width: calc(100% - 48px);
    min-height: 54px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 18px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: rgba(24, 34, 47, 0.96);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.45);
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    transform: translate(-50%, -50%);
    animation: toast-in 190ms ease-out both;
    backdrop-filter: blur(14px);
}

.toast[hidden] {
    display: none;
}

.toast svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.translation-source {
    position: fixed;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.app-progress {
    position: fixed;
    z-index: 120;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #ffe293);
    box-shadow: 0 0 12px rgba(242, 183, 49, 0.65);
    opacity: 0;
    transition: width 300ms ease, opacity 180ms ease;
}

.app-progress.is-loading {
    width: 72%;
    opacity: 1;
}

.app-progress.is-complete {
    width: 100%;
    opacity: 0;
}

.app-loader {
    position: fixed;
    z-index: 150;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(3, 7, 12, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    backdrop-filter: blur(2px);
}

.app-loader[hidden] {
    display: none;
}

.app-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.app-loader-card {
    display: flex;
    min-width: 112px;
    min-height: 104px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    padding: 20px 24px;
    border: 1px solid rgba(151, 166, 190, 0.2);
    border-radius: 18px;
    background: rgba(16, 24, 35, 0.94);
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--muted-bright);
    transform: translateY(5px) scale(0.97);
    transition: transform 180ms ease;
    backdrop-filter: blur(18px);
}

.app-loader.is-visible .app-loader-card {
    transform: translateY(0) scale(1);
}

.app-loader-spinner {
    position: relative;
    display: block;
    width: 38px;
    height: 38px;
    border: 3px solid rgba(242, 183, 49, 0.17);
    border-top-color: var(--accent);
    border-right-color: rgba(242, 183, 49, 0.68);
    border-radius: 50%;
    box-shadow: 0 0 18px rgba(242, 183, 49, 0.1);
    animation: loader-spin 720ms linear infinite;
}

.app-loader-spinner::after {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffe293;
    box-shadow: 0 0 8px rgba(255, 226, 147, 0.72);
    content: "";
}

.app-loader-text {
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
}

.is-translating .app-frame {
    opacity: 0.72;
    transition: opacity 180ms ease;
}

#google_translate_element,
.goog-te-banner-frame,
.goog-te-balloon-frame,
.goog-te-gadget,
.skiptranslate iframe,
#goog-gt-tt {
    display: none !important;
}

body {
    top: 0 !important;
}

@media (max-width: 374px) {
    .topbar {
        padding-inline: 13px;
    }

    .brand-copy {
        display: none;
    }

    .quote-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 6px;
        padding-inline: 12px;
    }

    .pair-row {
        gap: 4px;
    }

    .pair-row h1 {
        font-size: 10.5px;
    }

    .live-dot {
        width: 6px;
        height: 6px;
    }

    .quote-language {
        gap: 5px;
        padding-inline: 5px;
        font-size: 13px;
    }

    .chart-wrap {
        height: 300px;
    }

    .wallet-card {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin-inline: 10px;
        padding-inline: 12px;
    }

    .balance-rule {
        width: 86px;
        max-width: none;
        height: 86px;
        font-size: 16px;
    }

    .balance-item {
        height: 100%;
        min-height: 0;
    }

    .trade-actions {
        gap: 8px;
        padding-inline: 10px;
    }

    .latest-order-card {
        padding-inline: 9px;
    }

    .trade-icon,
    .trade-button small {
        display: none;
    }
}

@media (max-height: 760px) {
    .chart-wrap {
        height: 268px;
    }

    .wallet-card {
        height: 68px;
        min-height: 68px;
        margin-top: 18px;
        padding-block: 0;
    }

    .balance-rule {
        width: 88px;
        max-width: none;
        height: 88px;
    }

    .trade-actions {
        padding-top: 18px;
    }

    .trade-column {
        gap: 8px;
    }

    .trade-button {
        min-height: 66px;
    }
}

@media (max-height: 700px) {
    .chart-wrap {
        height: 248px;
    }
}

.desktop-gate {
    display: none;
}

@media (min-width: 768px) {
    body {
        display: grid;
        min-height: 100vh;
        place-items: center;
        background:
            radial-gradient(circle at 50% 20%, rgba(57, 81, 115, 0.23), transparent 30rem),
            #05090f;
    }

    .app-frame,
    .bottom-nav,
    .sheet-layer,
    .toast,
    .app-progress,
    .translation-source {
        display: none !important;
    }

    .desktop-gate {
        display: flex;
        width: min(440px, calc(100% - 48px));
        min-height: 420px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 52px 44px;
        border: 1px solid var(--line-strong);
        border-radius: 24px;
        background: linear-gradient(145deg, rgba(19, 29, 43, 0.96), rgba(9, 15, 23, 0.96));
        box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.025);
        text-align: center;
    }

    .desktop-phone {
        position: relative;
        display: grid;
        width: 88px;
        height: 88px;
        margin-bottom: 27px;
        place-items: center;
        border: 1px solid rgba(242, 183, 49, 0.22);
        border-radius: 28px;
        background: rgba(242, 183, 49, 0.08);
        color: var(--accent);
    }

    .desktop-phone::after {
        position: absolute;
        inset: 11px;
        border: 1px solid rgba(242, 183, 49, 0.11);
        border-radius: 20px;
        content: "";
    }

    .desktop-phone svg {
        position: relative;
        z-index: 1;
        width: 42px;
        height: 42px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 1.3;
    }

    .desktop-gate h1 {
        margin: 0;
        font-size: 24px;
        letter-spacing: -0.025em;
    }

    .desktop-gate p {
        margin: 12px 0 24px;
        color: var(--muted);
        font-size: 13px;
        line-height: 1.75;
    }

    .desktop-domain {
        padding: 8px 15px;
        border: 1px solid var(--line);
        border-radius: 100px;
        color: var(--muted-bright);
        font-size: 11px;
        letter-spacing: 0.08em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes page-in {
    from { opacity: 0.45; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes live-pulse {
    0% { opacity: 0.8; transform: scale(0.5); }
    80%, 100% { opacity: 0; transform: scale(1.8); }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sheet-up {
    from { opacity: 0.5; transform: translateY(24%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, -44%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

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