:root {
    color-scheme: dark;
    --bg: #070b11;
    --panel: rgba(18, 25, 36, 0.94);
    --panel-strong: #0d131c;
    --field: rgba(10, 15, 23, 0.72);
    --field-hover: rgba(17, 24, 34, 0.9);
    --border: rgba(169, 181, 200, 0.2);
    --border-strong: rgba(126, 144, 255, 0.46);
    --text: #f6f7fb;
    --muted: #a2acbb;
    --muted-2: #707a89;
    --accent: #5368ff;
    --accent-2: #25c19f;
    --danger: #ff6b6b;
    --success: #63d49e;
    --warning: #ffd166;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
    font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 18%, rgba(78, 92, 132, 0.18), transparent 34rem),
        radial-gradient(circle at 78% 78%, rgba(37, 193, 159, 0.1), transparent 26rem),
        linear-gradient(180deg, #0b111a 0%, #080d14 48%, #070b11 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 32% 38%, rgba(83, 104, 255, 0.09), transparent 22rem),
        radial-gradient(circle at 70% 58%, rgba(38, 122, 255, 0.08), transparent 24rem);
    filter: blur(18px);
    animation: ambientGlow 14s ease-in-out infinite alternate;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.site-header {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Archivo", sans-serif;
    font-weight: 800;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff, #8fb0ff 48%, var(--accent));
    color: #07101d;
}

.nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link {
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(83, 104, 255, 0.18);
}

.main {
    width: 100%;
    display: grid;
    place-items: start center;
    padding: clamp(22px, 5vw, 58px) 20px 48px;
}

.swap-card,
.history-card,
.info-card {
    width: min(100%, 630px);
    padding: clamp(24px, 4vw, 40px);
    background: linear-gradient(180deg, rgba(20, 27, 38, 0.94), rgba(13, 19, 28, 0.92));
    border: 1px solid rgba(151, 164, 185, 0.18);
    border-radius: 18px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    animation: cardEnter 520ms cubic-bezier(.2, .8, .2, 1) both;
}

.info-card {
    display: grid;
    gap: 22px;
    overflow: hidden;
    position: relative;
}

.info-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 82% 12%, rgba(37, 193, 159, 0.12), transparent 30%),
        radial-gradient(circle at 12% 20%, rgba(83, 104, 255, 0.13), transparent 34%);
}

.info-header,
.info-list {
    position: relative;
}

.info-header h1 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 0.96;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-item {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(7, 11, 17, 0.46);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.info-item:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(83, 104, 255, 0.09);
}

.info-index {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        linear-gradient(135deg, rgba(83, 104, 255, 0.26), rgba(37, 193, 159, 0.16)),
        rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(126, 144, 255, 0.32);
    color: #9badff;
    font-family: "Archivo", sans-serif;
    font-weight: 900;
}

.info-item h2 {
    margin: 0 0 5px;
    font-family: "Archivo", sans-serif;
    font-size: 1.08rem;
}

.info-item p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.swap-card.invoice-mode {
    width: min(100%, 900px);
}

.swap-card.invoice-mode {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
    gap: 18px;
    align-items: start;
}

.swap-card.invoice-mode .swap-widget-header {
    grid-column: 1 / -1;
    width: 100%;
}

.swap-card.status-only-mode {
    width: min(100%, 620px);
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.swap-card.status-only-mode .swap-widget-header {
    grid-column: auto;
    width: min(100%, 480px);
}

.swap-widget-header,
.settings-header,
.picker-header,
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.swap-widget-header { margin-bottom: 22px; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.card-title,
.deposit-panel h2,
.status-tracker h2,
.history-card h1,
.picker-header h2,
.settings-header h2,
.modal-header h2 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1.55rem;
    line-height: 1.12;
}

.field-group {
    display: grid;
    gap: 12px;
}

.field-label {
    color: #c8ced9;
    font-size: 0.98rem;
    font-weight: 700;
}

.currency-row {
    min-height: 82px;
    display: grid;
    grid-template-columns: minmax(170px, 220px) 1fr;
    background: var(--field);
    border: 1px solid var(--border);
    border-radius: 13px;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.currency-row:hover,
.currency-row:focus-within {
    background: var(--field-hover);
    border-color: rgba(169, 181, 200, 0.32);
    box-shadow: 0 0 0 4px rgba(83, 104, 255, 0.055);
}

.token-trigger {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px 0 22px;
    border: 0;
    border-right: 1px solid rgba(169, 181, 200, 0.18);
    border-radius: 12px 0 0 12px;
    background: transparent;
    color: var(--text);
}

.token-trigger:hover,
.token-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.035);
    outline: 0;
}

.token-icon,
.token-icon-stack,
.picker-token-icons {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
}

.token-code {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.08rem;
    font-weight: 800;
}

.chevron {
    width: 20px;
    height: 20px;
    color: var(--muted);
}

.chevron svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.amount-stack {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 12px 20px 12px 12px;
}

.amount-input,
.text-input,
.token-search {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.amount-input {
    text-align: right;
    font-family: "Archivo", sans-serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 700;
}

.amount-input::placeholder,
.text-input::placeholder,
.token-search::placeholder {
    color: var(--muted-2);
}

.amount-usd {
    min-height: 18px;
    color: var(--muted);
    text-align: right;
    font-size: 0.84rem;
    font-weight: 700;
}

.amount-stack.quote-loading .amount-input {
    color: transparent;
}

.amount-stack.quote-loading::before {
    content: "";
    width: min(168px, 72%);
    height: 28px;
    justify-self: end;
    grid-area: 1 / 1;
    border-radius: 12px;
    background:
        linear-gradient(90deg, transparent, rgba(146, 160, 255, 0.3), transparent),
        rgba(255, 255, 255, 0.07);
    background-size: 180% 100%, 100% 100%;
    animation: quoteShimmer 920ms ease-in-out infinite;
}

.flip-button {
    width: 54px;
    height: 54px;
    margin: 20px auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(169, 181, 200, 0.18);
    border-radius: 999px;
    background: rgba(12, 18, 27, 0.76);
    color: var(--accent);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.flip-button:hover,
.flip-button:focus-visible {
    transform: translateY(-1px);
    border-color: var(--border-strong);
    background: rgba(83, 104, 255, 0.16);
    outline: 0;
}

.recipient-group { margin-top: 28px; }

.text-input,
.token-search {
    height: 56px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--field);
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.text-input:hover,
.text-input:focus,
.token-search:focus {
    background: var(--field-hover);
    border-color: rgba(169, 181, 200, 0.32);
    box-shadow: 0 0 0 4px rgba(83, 104, 255, 0.055);
}

.quote-box {
    display: grid;
    gap: 9px;
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.quote-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    font-size: 0.92rem;
}

.quote-row span:last-child {
    color: var(--text);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.quote-row.muted span:last-child {
    color: var(--muted);
    font-weight: 600;
}

.swap-button,
.secondary-button,
.preset-btn,
.icon-btn,
.picker-close {
    border: 0;
    color: inherit;
}

.swap-button {
    width: 100%;
    height: 64px;
    border-radius: 11px;
    background: linear-gradient(135deg, #3551ff, #5368ff);
    color: #fff;
    font-size: 1.16rem;
    font-weight: 800;
    box-shadow: 0 18px 36px rgba(53, 81, 255, 0.22);
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.swap-button:hover:not(:disabled),
.swap-button:focus-visible:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 22px 42px rgba(53, 81, 255, 0.28);
    outline: 0;
}

.swap-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
    font-weight: 800;
}

.icon-btn,
.picker-close {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
}

.picker-close {
    font-size: 30px;
    line-height: 1;
}

.icon-btn:hover,
.picker-close:hover,
.secondary-button:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(83, 104, 255, 0.13);
}

.form-message,
.error-text,
.warning-text,
.hint-text {
    color: var(--muted);
    font-size: 0.9rem;
}

.error,
.error-text { color: var(--danger); }

.warning-text {
    color: var(--warning);
    line-height: 1.45;
    margin: -4px 0 12px;
}

.hidden { display: none !important; }

.deposit-panel,
.status-tracker {
    display: grid;
    gap: 14px;
    animation: cardEnter 260ms ease both;
}

.status-tracker {
    justify-items: stretch;
    width: min(100%, 480px);
    justify-self: center;
    padding: 20px;
    border: 1px solid rgba(169, 181, 200, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(83, 104, 255, 0.08), rgba(255, 255, 255, 0.025)),
        rgba(8, 13, 20, 0.56);
}

.status-tracker h2 {
    text-align: center;
}

.deposit-panel {
    position: relative;
    padding: 18px;
    border: 1px solid rgba(169, 181, 200, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025)),
        rgba(8, 13, 20, 0.62);
    overflow: hidden;
}

.deposit-panel::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 3px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.deposit-panel h2 {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.deposit-panel h2::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 0 5px rgba(255, 209, 102, 0.12);
}

.deposit-panel > p:first-of-type {
    position: relative;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    line-height: 1.45;
}

.deposit-panel > p:first-of-type strong {
    display: inline-block;
    color: var(--text);
    font-family: "Archivo", sans-serif;
    font-size: 1.05rem;
}

.deposit-address {
    position: relative;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: rgba(7, 11, 17, 0.7);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.84rem;
    line-height: 1.45;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    word-break: normal;
    scrollbar-width: thin;
    scrollbar-color: rgba(126, 144, 255, 0.55) transparent;
}

.deposit-address::before {
    content: "Deposit address";
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-family: "DM Sans", sans-serif;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-family: "DM Sans", sans-serif;
    position: sticky;
    left: 0;
    width: max-content;
    padding-right: 16px;
    background: rgba(7, 11, 17, 0.92);
}

.address-edge {
    color: #9badff;
    font-weight: 900;
}

.qr-wrap {
    display: flex;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.06), transparent 64%),
        rgba(0, 0, 0, 0.12);
}

.qr-wrap canvas,
.qr-wrap img {
    border-radius: 12px;
    padding: 8px;
    background: #fff;
}

.deposit-panel .secondary-button {
    width: 100%;
}

.deposit-panel .quote-box {
    margin: 2px 0 0;
    background: rgba(7, 11, 17, 0.42);
}

.deposit-asset {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.status-steps {
    display: grid;
    gap: 0;
    padding: 4px 0;
}

#refundPanel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 209, 102, 0.28);
    border-radius: 12px;
    background: rgba(255, 209, 102, 0.08);
}

.refund-header {
    display: grid;
    gap: 3px;
}

.refund-header h3 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
}

.refund-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

#refundBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.status-info-widget {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 15px;
    border: 1px solid rgba(83, 104, 255, 0.28);
    border-radius: 13px;
    background:
        linear-gradient(180deg, rgba(83, 104, 255, 0.12), rgba(255, 255, 255, 0.035)),
        rgba(7, 11, 17, 0.48);
}

.status-info-widget h3 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1rem;
}

.status-info-widget p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.complete-widget {
    display: grid;
    justify-items: center;
    gap: 13px;
    text-align: center;
    padding: 8px 0;
}

.complete-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(99, 212, 158, 0.14);
    border: 1px solid rgba(99, 212, 158, 0.34);
    color: var(--success);
    font-family: "Archivo", sans-serif;
    font-size: 1.55rem;
    font-weight: 900;
    box-shadow: 0 0 0 8px rgba(99, 212, 158, 0.06);
}

.complete-widget h3 {
    margin: 0;
    font-family: "Archivo", sans-serif;
    font-size: 1.2rem;
}

.complete-widget p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.complete-details {
    width: 100%;
    display: grid;
    gap: 9px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    text-align: left;
}

.status-step {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    min-height: 36px;
    padding-left: 2px;
}

.status-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 24px;
    bottom: -12px;
    width: 1px;
    background: rgba(169, 181, 200, 0.18);
}

.status-step.active { color: var(--text); }
.status-step.done { color: var(--success); }

.status-dot {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #273142;
    border: 1px solid rgba(169, 181, 200, 0.22);
}

.status-step.active .status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(83, 104, 255, 0.16);
}

.status-step.done .status-dot { background: var(--success); }

.status-step.done:not(:last-child)::after {
    background: rgba(99, 212, 158, 0.38);
}

.status-tracker > .quote-box {
    width: 100%;
    margin: 2px 0 0;
    background: rgba(7, 11, 17, 0.44);
}

.status-tracker .swap-button {
    margin-top: 4px;
}

.picker-backdrop,
.settings-backdrop,
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(8px);
}

.picker-backdrop[hidden] { display: none; }

.picker-modal,
.settings-modal,
.modal {
    width: min(760px, calc(100vw - 32px));
    max-height: min(92vh, 900px);
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
    animation: cardEnter 180ms ease both;
}

.settings-modal,
.modal {
    width: min(420px, calc(100vw - 32px));
}

.modal-header {
    margin-bottom: 14px;
}

.modal-close-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(83, 104, 255, 0.13);
    transform: translateY(-1px);
    outline: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.modal-primary-action {
    width: auto;
    min-width: 180px;
    height: 48px;
    padding: 0 22px;
    font-size: 0.98rem;
}

.picker-modal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
        "header header"
        "search search"
        "tokens networks";
    gap: 14px;
    padding: 20px;
}

.picker-header,
.picker-modal > .token-search {
    grid-column: auto;
}

.picker-header { grid-area: header; }
.picker-modal > .token-search { grid-area: search; }
.picker-list-wrap { grid-area: tokens; }
.picker-chains { grid-area: networks; }

.picker-list-wrap {
    min-width: 0;
    padding-right: 12px;
    border-right: 1px solid var(--border);
}

.picker-chains {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
    gap: 10px;
    min-width: 0;
    padding-left: 4px;
}

.picker-list {
    display: grid;
    gap: 8px;
    max-height: 480px;
    overflow: auto;
    padding-right: 4px;
}

.picker-section-title {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.picker-chain,
.picker-token {
    width: 100%;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    text-align: left;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.picker-chain {
    position: relative;
    min-height: 58px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.picker-chain .icon-wrap,
.picker-chain .network-multi-icon {
    flex: 0 0 auto;
}

.picker-chain span:last-child {
    margin-left: auto;
}

.picker-chain span:not(.network-check):last-of-type {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.picker-chain:hover,
.picker-chain.active,
.picker-token:hover,
.picker-token.active {
    border-color: var(--border-strong);
    background: rgba(83, 104, 255, 0.13);
}

.picker-chain:hover,
.picker-chain.active {
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(126, 144, 255, 0.24);
    transform: translateY(-1px);
}

.picker-token {
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 22px;
    gap: 14px;
    padding: 12px 13px;
}

.picker-token-meta {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.picker-token-title {
    display: flex;
    gap: 7px;
    align-items: baseline;
}

.picker-token-meta strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: "Archivo", sans-serif;
    font-size: 1.02rem;
}

.picker-token-meta small,
.token-standard {
    color: var(--muted);
    font-size: 0.8rem;
}

.picker-token-arrow {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    justify-self: end;
    align-self: center;
    border-radius: 50%;
    color: var(--muted-2);
    background: rgba(255, 255, 255, 0.045);
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.picker-token-arrow::before {
    content: ">";
    transform: translateY(-1px);
    font-family: "Archivo", sans-serif;
    font-size: 0.9rem;
    font-weight: 900;
}

.picker-token:hover .picker-token-arrow,
.picker-token.active .picker-token-arrow {
    color: var(--text);
    background: rgba(83, 104, 255, 0.26);
    transform: translateX(2px);
}

.picker-token:hover,
.picker-token.active {
    transform: translateY(-1px);
}

.icon-wrap,
.icon-fallback {
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
}

.icon-fallback {
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.token-icon-main,
.picker-token-icon,
.token-icon-chain,
.picker-token-chain,
.icon-img {
    border-radius: 50%;
    object-fit: cover;
}

.token-icon-stack > .icon-wrap:last-child,
.picker-token-icons > .icon-wrap:last-child {
    position: absolute !important;
    right: 0;
    bottom: 0;
    width: 15px !important;
    height: 15px !important;
    border: 2px solid var(--panel-strong);
}

.network-multi-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(83, 104, 255, 0.18);
    color: #9badff;
    font-size: 9px;
    font-weight: 900;
}

.network-check {
    display: none;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 900;
}

.picker-chain.active .network-check {
    display: grid;
}

.settings-modal {
    display: grid;
    gap: 14px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.preset-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.preset-btn {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
    font-weight: 800;
}

.preset-btn:hover,
.preset-btn.active {
    background: rgba(83, 104, 255, 0.2);
    border-color: var(--border-strong);
}

.site-footer {
    padding: 0 20px 32px;
    color: rgba(190, 198, 212, 0.62);
    text-align: center;
    font-size: 0.92rem;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    max-width: 360px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.order-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.order-item,
.history-loading,
.empty-state {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.04);
}

.order-item {
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease;
}

.order-item:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.order-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.order-item-header strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-chain {
    color: var(--muted);
    font-size: 0.78em;
    font-weight: 800;
}

.muted-value {
    color: var(--muted);
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    width: fit-content;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--warning);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.status-badge.completed { color: var(--success); }
.status-badge.failed,
.status-badge.expired,
.status-badge.refunded { color: var(--danger); }

@keyframes cardEnter {
    from { opacity: 0; transform: translateY(18px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ambientGlow {
    from { transform: translate3d(-1.5%, -1%, 0) scale(1); opacity: 0.78; }
    to { transform: translate3d(1.5%, 1%, 0) scale(1.04); opacity: 1; }
}

@keyframes quoteShimmer {
    from { background-position: 140% 0, 0 0; opacity: 0.58; }
    50% { opacity: 1; }
    to { background-position: -40% 0, 0 0; opacity: 0.58; }
}

@media (max-width: 680px) {
    .site-header {
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
    }

    .nav { width: 100%; }
    .nav-link { flex: 1; text-align: center; }
    .main { padding: 12px 14px 36px; }
    .swap-card, .history-card { padding: 22px; border-radius: 16px; }
    .currency-row { grid-template-columns: 1fr; }
    .token-trigger {
        min-height: 62px;
        border-right: 0;
        border-bottom: 1px solid rgba(169, 181, 200, 0.18);
        border-radius: 12px 12px 0 0;
    }
    .amount-stack { min-height: 64px; }
    .picker-modal {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "search"
            "networks"
            "tokens";
    }
    .picker-header,
    .picker-modal > .token-search { grid-column: auto; }
    .picker-list-wrap {
        padding-right: 0;
        border-right: 0;
    }
    .picker-chains {
        display: flex;
        flex-wrap: wrap;
        grid-template-columns: none;
    }
    .picker-chain { width: auto; min-height: 38px; }
    .quote-row,
    .order-item-header {
        display: grid;
        grid-template-columns: 1fr;
    }
    .order-item-header strong,
    .status-badge {
        white-space: normal;
    }
    .quote-row span:last-child { text-align: left; }
    .swap-card.invoice-mode { grid-template-columns: 1fr; }
    .toast { left: 12px; right: 12px; max-width: none; }
}

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

@media (max-width: 680px) {
    html { -webkit-text-size-adjust: 100%; }

    .site-header {
        padding: 14px;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .brand {
        justify-content: center;
        font-size: 0.98rem;
    }

    .nav {
        width: 100%;
        border-radius: 14px;
    }

    .nav-link {
        flex: 1;
        text-align: center;
        padding: 9px 8px;
        font-size: 0.86rem;
    }

    .main { padding: 8px 12px 32px; }

    .swap-card,
    .history-card,
    .info-card {
        width: 100%;
        padding: 18px;
        border-radius: 15px;
    }

    .swap-widget-header {
        align-items: flex-start;
        margin-bottom: 18px;
    }

    .card-title { font-size: 1.35rem; }
    .currency-row { grid-template-columns: 1fr; }

    .token-trigger {
        min-height: 62px;
        padding: 0 16px;
        border-right: 0;
        border-bottom: 1px solid rgba(169, 181, 200, 0.18);
        border-radius: 12px 12px 0 0;
    }

    .amount-stack {
        min-height: 66px;
        padding: 10px 16px;
    }

    .amount-input {
        text-align: left;
        font-size: 1.85rem;
    }

    .amount-usd { text-align: left; }

    .flip-button {
        width: 48px;
        height: 48px;
        margin: 16px auto;
    }

    .recipient-group { margin-top: 20px; }

    .text-input,
    .token-search { height: 52px; }

    .swap-button {
        height: 58px;
        font-size: 1.04rem;
    }

    .quote-box {
        padding: 13px;
        border-radius: 12px;
    }

    .picker-backdrop,
    .settings-backdrop,
    .modal-backdrop {
        padding: 10px;
    }

    .picker-backdrop {
        align-items: center;
    }

    .picker-modal {
        width: min(100%, 420px);
        max-height: calc(100vh - 20px);
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "search"
            "networks"
            "tokens";
        gap: 12px;
        padding: 14px;
        border-radius: 16px;
    }

    .picker-header,
    .picker-modal > .token-search { grid-column: auto; }

    .picker-list-wrap {
        padding-right: 0;
        border-right: 0;
    }

    .picker-chains {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding-left: 0;
        max-height: none;
        overflow: visible;
    }

    .picker-chain {
        width: 100%;
        min-height: 38px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .network-check {
        width: 17px;
        height: 17px;
        font-size: 0.62rem;
    }

    .picker-list {
        max-height: 46vh;
        gap: 7px;
        padding-right: 0;
    }

    .picker-token {
        min-height: 62px;
        grid-template-columns: 38px minmax(0, 1fr) 22px;
        gap: 11px;
        padding: 10px 11px;
    }

    .picker-token-meta strong { font-size: 0.95rem; }

    .token-standard,
    .picker-token-meta small { font-size: 0.74rem; }

    .quote-row,
    .order-item-header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .quote-row span:last-child { text-align: left; }

    .order-item-header strong,
    .status-badge { white-space: normal; }

    .swap-card.invoice-mode {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .swap-card.invoice-mode .swap-widget-header,
    .status-tracker { width: 100%; }

    .status-tracker,
    .deposit-panel {
        padding: 16px;
        border-radius: 13px;
    }

    .status-step {
        min-height: 34px;
        font-size: 0.84rem;
    }

    .deposit-address { font-size: 0.78rem; }
    .qr-wrap { padding: 12px; }

    .qr-wrap canvas,
    .qr-wrap img {
        max-width: 178px;
        height: auto !important;
    }

    .info-item {
        grid-template-columns: 36px minmax(0, 1fr);
        padding: 14px;
    }

    .info-index {
        width: 32px;
        height: 32px;
    }

    .order-item,
    .history-loading,
    .empty-state { padding: 14px; }

    .modal,
    .settings-modal {
        width: 100%;
        max-height: calc(100vh - 20px);
        border-radius: 16px;
        padding: 16px;
    }

    .modal-header { align-items: center; }

    .modal-actions { justify-content: stretch; }

    .modal-primary-action {
        width: 100%;
        min-width: 0;
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }
}
