* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121f;
    --bg-tertiary: #1a1a2a;
    --text-primary: #ffffff;
    --text-secondary: #98a1b2;
    --text-tertiary: #5e6573;
    --accent: #c8a951;
    --accent-hover: #b8993f;
    --neon-gold: #c8a951;
    --neon-gold-light: #d4b96a;
    --border: rgba(200, 169, 81, 0.15);
    --border-hover: rgba(200, 169, 81, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(500px, 80vw);
    height: min(500px, 80vw);
    background: url('moonswap.png') no-repeat center center;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
}

#app {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* ========== HEADER ========== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(6px, 1.5vw, 12px) clamp(10px, 3vw, 24px);
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 100;
    border-bottom: 1px solid rgba(200, 169, 81, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    overflow: visible;
    flex-shrink: 0;
    gap: clamp(4px, 1.5vw, 12px);
    min-height: clamp(40px, 8vw, 56px);
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: clamp(14px, 3vw, 20px);
    text-shadow: 0 0 10px rgba(200, 169, 81, 0.5);
    white-space: nowrap;
}

.logo img {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
    border-radius: 50%;
}

.nav {
    display: flex;
    gap: clamp(2px, 0.8vw, 8px);
    flex-shrink: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: clamp(5px, 1.2vw, 8px) clamp(8px, 2vw, 12px);
    border-radius: clamp(8px, 2vw, 12px);
    font-weight: 500;
    font-size: clamp(12px, 2.5vw, 14px);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.header-right {
    display: flex;
    gap: clamp(4px, 1.2vw, 8px);
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.network-btn {
    display: flex;
    align-items: center;
    gap: clamp(3px, 0.8vw, 6px);
    padding: clamp(5px, 1.2vw, 8px) clamp(6px, 1.5vw, 12px);
    background: rgba(200, 169, 81, 0.1);
    border: 1px solid rgba(200, 169, 81, 0.3);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(10px, 2.5vw, 14px);
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.1);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.network-btn:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.2);
}

.network-icon {
    width: clamp(16px, 3vw, 20px);
    height: clamp(16px, 3vw, 20px);
    border-radius: 50%;
    object-fit: cover;
}

.wallet-btn {
    padding: clamp(5px, 1.2vw, 8px) clamp(10px, 2.5vw, 16px);
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    border: none;
    border-radius: 24px;
    color: white;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(200, 169, 81, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.wallet-btn.connected {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 8px);
    padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 14px) clamp(4px, 1vw, 6px) clamp(4px, 1vw, 8px);
    background: rgba(26, 26, 37, 0.9);
    border: 1px solid rgba(200, 169, 81, 0.3);
    border-radius: 24px;
}

.wallet-btn.connected:hover {
    border-color: rgba(200, 169, 81, 0.5);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.2);
}

.wallet-avatar {
    width: clamp(20px, 4vw, 28px);
    height: clamp(20px, 4vw, 28px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wallet-btn:hover {
    box-shadow: 0 0 30px rgba(200, 169, 81, 0.5);
}

.wallet-wrapper {
    position: relative;
}

.wallet-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: clamp(240px, 50vw, 280px);
    background: rgba(18, 18, 26, 0.98);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(10px, 3vw, 16px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    padding: clamp(10px, 2.5vw, 16px);
}

.wallet-dropdown.show {
    display: block;
}

.wallet-dropdown-top {
    margin-bottom: clamp(8px, 2vw, 14px);
}

.wallet-dropdown-connected {
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: 500;
    color: #00ff88;
}

.wallet-dropdown-address {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px);
    background: rgba(255, 255, 255, 0.03);
    border-radius: clamp(6px, 1.5vw, 10px);
    margin-bottom: clamp(8px, 2vw, 14px);
}

.wallet-dropdown-address span {
    font-size: clamp(11px, 2.5vw, 14px);
    font-family: monospace;
    color: var(--text-primary);
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.wallet-copy-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wallet-copy-btn:hover {
    color: var(--neon-gold);
    background: rgba(200, 169, 81, 0.1);
}

.wallet-dropdown-balance {
    margin-bottom: clamp(8px, 2vw, 14px);
    font-size: clamp(12px, 2.5vw, 14px);
    color: var(--text-primary);
}

.wallet-disconnect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: clamp(6px, 1.5vw, 10px);
    background: none;
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: clamp(6px, 1.5vw, 10px);
    color: #ff4d4d;
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wallet-disconnect-btn:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: rgba(255, 77, 77, 0.5);
}

/* ========== PAGES ========== */
.page {
    display: none;
    flex: 1;
    padding: 0 clamp(8px, 3vw, 24px);
    min-height: 0;
    overflow: hidden;
}

.page.active {
    display: flex;
}

#swapPage.active {
    align-items: center;
    justify-content: center;
}

#poolPage.active {
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: clamp(12px, 3vw, 24px);
    padding-bottom: clamp(12px, 3vw, 24px);
}

/* ========== SWAP CARD ========== */
.swap-container {
    width: 100%;
    max-width: min(480px, 92vw);
}

.swap-card {
    background: #12121a;
    border-radius: clamp(12px, 3vw, 20px);
    border: 1px solid rgba(200, 169, 81, 0.2);
    box-shadow:
        0 0 30px rgba(200, 169, 81, 0.05),
        0 0 60px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.swap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 2.5vw, 16px) clamp(12px, 3vw, 20px);
}

.swap-title {
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
}

.swap-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.swap-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: clamp(4px, 1vw, 6px) clamp(5px, 1.2vw, 8px);
    border-radius: clamp(6px, 1.5vw, 8px);
    transition: all 0.2s;
    line-height: 1;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-icon-btn svg {
    width: clamp(16px, 3.5vw, 20px);
    height: clamp(16px, 3.5vw, 20px);
    stroke: currentColor;
    fill: none;
}

.swap-icon-btn:hover {
    background: rgba(200, 169, 81, 0.1);
    color: #fff;
}

.swap-tx-wrapper {
    position: relative;
}

.swap-tx-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: clamp(280px, 70vw, 340px);
    max-height: 360px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: clamp(8px, 2vw, 12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
}

.swap-tx-dropdown.show {
    display: block;
}

.swap-tx-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    border-bottom: 1px solid var(--border);
}

.swap-tx-title {
    font-size: clamp(12px, 2.5vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
}

.swap-tx-clear {
    background: none;
    border: none;
    font-size: clamp(12px, 2.5vw, 14px);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.swap-tx-clear:hover {
    background: rgba(255, 77, 77, 0.15);
}

.swap-tx-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
}

.swap-tx-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 13px);
    padding: 24px 16px;
}

.swap-tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px);
    border-radius: 8px;
    transition: background 0.2s;
}

.swap-tx-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.swap-tx-item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.swap-tx-item-type {
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 500;
    color: var(--text-primary);
}

.swap-tx-item-amount {
    font-size: clamp(10px, 2.2vw, 12px);
    color: var(--text-secondary);
}

.swap-tx-item-status {
    font-size: clamp(9px, 2vw, 11px);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
}

.swap-tx-item-status.success {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.swap-tx-item-status.failed {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

.swap-tx-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.swap-tx-item-link {
    font-size: clamp(9px, 2vw, 10px);
    color: #a0aec0;
    text-decoration: underline;
    cursor: pointer;
}

.swap-tx-item-link:hover {
    color: #fff;
}

/* ========== SWAP INPUT CARDS ========== */
.swap-input-card {
    margin: 0 clamp(6px, 1.5vw, 12px);
    background: #1a1a28;
    border-radius: clamp(10px, 2.5vw, 16px);
    padding: clamp(10px, 2.5vw, 16px);
    border: 1px solid rgba(200, 169, 81, 0.1);
}

.swap-input-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: clamp(6px, 1.5vw, 12px);
}

.swap-label {
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 14px);
}

.swap-balance {
    color: var(--neon-gold);
    font-size: clamp(11px, 2.5vw, 14px);
    cursor: pointer;
    transition: all 0.2s;
}

.swap-balance:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(200, 169, 81, 0.5);
}

.swap-input-row {
    display: flex;
    gap: clamp(4px, 1vw, 8px);
    align-items: center;
}

.swap-input-row input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: clamp(20px, 6vw, 32px);
    font-weight: 500;
    outline: none;
    min-width: 0;
    -moz-appearance: textfield;
    -webkit-appearance: none;
    caret-color: var(--neon-gold);
}

.swap-input-row input::-webkit-outer-spin-button,
.swap-input-row input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.swap-input-row input::placeholder {
    color: var(--text-tertiary);
}

.token-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.8vw, 6px);
    padding: clamp(5px, 1.2vw, 8px) clamp(8px, 2vw, 12px);
    background: rgba(200, 169, 81, 0.1);
    border: 1px solid rgba(200, 169, 81, 0.3);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 15px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-width: fit-content;
    line-height: 1;
}

.token-select:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.3);
}

.token-btn-icon {
    width: clamp(18px, 4vw, 22px);
    height: clamp(18px, 4vw, 22px);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.token-icon-fallback {
    width: clamp(18px, 4vw, 22px);
    height: clamp(18px, 4vw, 22px);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.swap-usd {
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 14px);
    margin-top: clamp(4px, 1vw, 8px);
}

/* ========== SWAP ARROW ========== */
.swap-arrow-container {
    display: flex;
    justify-content: center;
    margin: clamp(-4px, -1vw, -8px) 0;
    position: relative;
    z-index: 10;
}

.swap-arrow-btn {
    width: clamp(28px, 6vw, 36px);
    height: clamp(28px, 6vw, 36px);
    background: rgba(26, 26, 37, 0.9);
    border: clamp(3px, 0.6vw, 4px) solid rgba(10, 10, 18, 0.9);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--neon-gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.2);
}

.swap-arrow-btn:hover {
    color: var(--accent);
    box-shadow: 0 0 25px rgba(200, 169, 81, 0.4);
    transform: translateY(2px);
}

.plus-icon {
    width: clamp(28px, 6vw, 36px);
    height: clamp(28px, 6vw, 36px);
    background: rgba(26, 26, 37, 0.8);
    border: clamp(3px, 0.6vw, 4px) solid var(--bg-secondary);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--neon-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 500;
}

/* ========== SWAP INFO ========== */
.swap-info {
    margin: 0 clamp(6px, 1.5vw, 12px);
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    background: rgba(26, 26, 37, 0.6);
    border-radius: clamp(8px, 2vw, 12px);
    border: 1px solid rgba(200, 169, 81, 0.1);
    margin-top: clamp(4px, 1vw, 8px);
    margin-bottom: 4px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 14px);
    margin-bottom: clamp(4px, 1vw, 8px);
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row span:last-child {
    color: var(--neon-gold);
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
}

/* ========== SWAP BUTTON ========== */
.swap-btn {
    width: calc(100% - clamp(12px, 3vw, 24px));
    margin: clamp(6px, 1.5vw, 12px);
    padding: clamp(10px, 2.5vw, 16px);
    background: #c8a951;
    border: none;
    border-radius: clamp(10px, 2.5vw, 16px);
    color: white;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 25px rgba(200, 169, 81, 0.3);
    position: relative;
    isolation: isolate;
}

.swap-btn:hover:not(:disabled) {
    box-shadow: 0 0 35px rgba(200, 169, 81, 0.5);
    transform: translateY(-2px);
}

.swap-btn:disabled {
    background: rgba(26, 26, 37, 0.5);
    color: var(--text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== POOL PAGE ========== */
.pool-container {
    width: 100%;
    max-width: min(480px, 92vw);
}

.pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(10px, 2.5vw, 16px);
}

.pool-header h2 {
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 600;
}

.btn-secondary {
    padding: clamp(5px, 1.2vw, 8px) clamp(10px, 2.5vw, 16px);
    background: var(--bg-secondary);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.pool-content {
    background: var(--bg-secondary);
    border-radius: clamp(12px, 3vw, 20px);
    border: 1px solid rgba(200, 169, 81, 0.15);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 6vw, 48px) clamp(12px, 3vw, 24px);
    text-align: center;
}

.empty-state p {
    color: var(--text-primary);
    font-weight: 500;
    margin-top: clamp(8px, 2vw, 16px);
    font-size: clamp(13px, 3vw, 16px);
}

.empty-state span {
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 14px);
    margin-top: clamp(2px, 0.5vw, 4px);
}

/* ========== MODALS ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: clamp(8px, 2vw, 16px);
}

.modal-content {
    background: rgba(18, 18, 26, 0.95);
    border-radius: clamp(12px, 3vw, 20px);
    width: 100%;
    max-width: min(420px, 92vw);
    max-height: 90vh;
    max-height: 90dvh;
    overflow: hidden;
    border: 1px solid rgba(200, 169, 81, 0.3);
    box-shadow: 0 0 50px rgba(200, 169, 81, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(10px, 2.5vw, 16px) clamp(12px, 3vw, 20px);
    border-bottom: 1px solid rgba(200, 169, 81, 0.2);
}

.modal-header span {
    font-size: clamp(14px, 3vw, 16px);
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: clamp(18px, 4vw, 24px);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: all 0.2s;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(200, 169, 81, 0.5);
}

/* ========== TOKEN MODAL ========== */
.token-search {
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    flex-shrink: 0;
}

.token-search input {
    width: 100%;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(13px, 3vw, 16px);
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.token-search input:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.2);
}

.token-search input::placeholder {
    color: var(--text-tertiary);
}

.token-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    -webkit-overflow-scrolling: touch;
}

.token-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px);
    border-radius: clamp(8px, 2vw, 12px);
    cursor: pointer;
    transition: all 0.2s;
}

.token-item:hover {
    background: rgba(200, 169, 81, 0.1);
}

.token-remove-btn {
    margin-left: auto;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #ff4d4d;
    border: none;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.token-remove-btn:hover {
    opacity: 1;
}

.token-badge {
    padding: clamp(2px, 0.6vw, 4px) clamp(6px, 1.5vw, 12px);
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    border-radius: clamp(8px, 2vw, 12px);
    font-size: clamp(10px, 2.2vw, 12px);
    font-weight: 600;
    color: white;
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.3);
}

.token-fetching {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
    color: var(--text-secondary);
    gap: 12px;
}

.fetching-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(200, 169, 81, 0.2);
    border-top-color: var(--neon-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.token-fetch-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 32px);
    color: var(--text-secondary);
    gap: 8px;
}

.error-address {
    font-size: clamp(10px, 2.2vw, 12px);
    color: var(--text-tertiary);
}

.token-icon {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
    border-radius: 50%;
    background: rgba(26, 26, 37, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(11px, 2.5vw, 14px);
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.token-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.token-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.token-name {
    font-weight: 500;
    font-size: clamp(12px, 2.8vw, 14px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-symbol {
    color: var(--text-secondary);
    font-size: clamp(10px, 2.2vw, 12px);
}

.token-balance {
    text-align: right;
}

.token-balance-amount {
    font-weight: 500;
}

.token-balance-usd {
    color: var(--text-secondary);
    font-size: clamp(12px, 2.8vw, 14px);
}

/* ========== SETTINGS MODAL ========== */
.settings-content {
    padding: clamp(12px, 3vw, 20px);
    overflow-y: auto;
    max-height: 70vh;
}

.setting-group {
    margin-bottom: clamp(14px, 3.5vw, 24px);
}

.setting-group label {
    display: block;
    color: var(--text-secondary);
    font-size: clamp(12px, 2.8vw, 14px);
    margin-bottom: clamp(6px, 1.5vw, 12px);
}

.slippage-options {
    display: flex;
    gap: clamp(4px, 1vw, 8px);
}

.slippage-btn {
    flex: 1;
    padding: clamp(8px, 2vw, 12px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.slippage-btn:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.slippage-btn.active {
    border-color: var(--accent);
    background: rgba(200, 169, 81, 0.15);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.3);
}

.custom-slippage-wrapper {
    position: relative;
    width: clamp(60px, 15vw, 80px);
    flex-shrink: 0;
}

.custom-slippage-wrapper input {
    width: 100%;
    padding: clamp(8px, 2vw, 12px) 24px clamp(8px, 2vw, 12px) clamp(6px, 1.5vw, 12px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 14px);
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.custom-slippage-wrapper input::-webkit-outer-spin-button,
.custom-slippage-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.custom-slippage-wrapper input:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.slippage-suffix {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: clamp(11px, 2.5vw, 14px);
    pointer-events: none;
}

.slippage-warning {
    margin-top: 8px;
    padding: clamp(6px, 1.5vw, 8px) clamp(8px, 2vw, 12px);
    background: rgba(243, 132, 30, 0.1);
    border: 1px solid rgba(243, 132, 30, 0.3);
    border-radius: 8px;
    color: #F3841E;
    font-size: clamp(10px, 2.2vw, 12px);
}

.deadline-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deadline-input input {
    width: clamp(70px, 18vw, 100px);
    padding: clamp(8px, 2vw, 12px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 14px);
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.deadline-input input::-webkit-outer-spin-button,
.deadline-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.deadline-input input:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.deadline-input span {
    color: var(--text-secondary);
    font-size: clamp(12px, 2.8vw, 14px);
}

/* ========== EXPERT MODE ========== */
.expert-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.expert-info {
    flex: 1;
    min-width: 0;
}

.expert-info label {
    display: block;
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 500;
    margin-bottom: 4px;
}

.expert-info span {
    color: var(--text-secondary);
    font-size: clamp(10px, 2.2vw, 12px);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: clamp(38px, 10vw, 48px);
    height: clamp(20px, 5.5vw, 26px);
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 37, 0.9);
    border: 1px solid rgba(200, 169, 81, 0.3);
    border-radius: 26px;
    transition: all 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: calc(100% - 4px);
    width: calc(100% - 4px);
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    border-color: transparent;
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.4);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(calc(100% - 2px));
    background: white;
}

.expert-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: clamp(8px, 2vw, 12px);
    background: rgba(243, 132, 30, 0.1);
    border: 1px solid rgba(243, 132, 30, 0.3);
    border-radius: 8px;
    color: #F3841E;
    font-size: clamp(10px, 2.2vw, 12px);
}

/* ========== NETWORK MODAL ========== */
.network-list {
    padding: 8px;
}

.network-item {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    width: 100%;
    padding: clamp(8px, 2vw, 12px);
    background: none;
    border: none;
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(14px, 3vw, 16px);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.network-item:hover {
    background: rgba(200, 169, 81, 0.1);
}

.network-item.active {
    background: rgba(200, 169, 81, 0.1);
    border-color: var(--neon-gold);
}

.network-item img {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
    border-radius: 50%;
}

/* ========== EXPERT MODAL ========== */
.expert-modal {
    max-width: min(400px, 92vw);
}

.expert-modal-content {
    padding: clamp(16px, 4vw, 24px);
    text-align: center;
}

.expert-warning-icon {
    margin-bottom: clamp(8px, 2vw, 16px);
}

.expert-warning-text {
    color: var(--text-secondary);
    font-size: clamp(12px, 2.8vw, 14px);
    line-height: 1.5;
    margin-bottom: clamp(6px, 1.5vw, 12px);
}

.expert-confirm-input {
    margin: clamp(12px, 3vw, 20px) 0;
    text-align: left;
}

.expert-confirm-input label {
    display: block;
    color: var(--text-secondary);
    font-size: clamp(12px, 2.8vw, 14px);
    margin-bottom: 8px;
}

.confirm-text {
    color: var(--neon-gold);
    font-weight: 600;
}

.expert-confirm-input input {
    width: 100%;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(13px, 3vw, 14px);
    outline: none;
}

.expert-confirm-input input:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.expert-confirm-input input::placeholder {
    color: var(--text-tertiary);
}

.expert-confirm-btn {
    width: 100%;
    padding: clamp(10px, 2.5vw, 14px);
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    border: none;
    border-radius: clamp(8px, 2vw, 12px);
    color: white;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.expert-confirm-btn:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(200, 169, 81, 0.5);
}

.expert-confirm-btn:disabled {
    background: rgba(26, 26, 37, 0.5);
    color: var(--text-tertiary);
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== ADD TOKEN MODAL ========== */
.token-input-full {
    width: 100%;
    padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--text-primary);
    font-size: clamp(12px, 2.8vw, 14px);
    outline: none;
}

.token-input-full:focus {
    border-color: var(--neon-gold);
    box-shadow: 0 0 10px rgba(200, 169, 81, 0.2);
}

.token-input-full::placeholder {
    color: var(--text-tertiary);
}

/* ========== CONFIRM MODAL ========== */
.confirm-modal {
    max-width: min(380px, 92vw);
}

.confirm-modal-content {
    padding: clamp(20px, 5vw, 32px) clamp(12px, 3vw, 24px);
    text-align: center;
}

.confirm-icon {
    margin-bottom: clamp(8px, 2vw, 16px);
}

.confirm-title {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: clamp(4px, 1vw, 8px);
}

.confirm-message {
    font-size: clamp(12px, 2.8vw, 14px);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: clamp(16px, 4vw, 24px);
}

.confirm-actions {
    display: flex;
    gap: clamp(6px, 1.5vw, 12px);
}

.confirm-btn {
    flex: 1;
    padding: clamp(10px, 2.5vw, 14px);
    border-radius: clamp(8px, 2vw, 12px);
    font-size: clamp(13px, 3vw, 15px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.confirm-btn.cancel {
    background: rgba(26, 26, 37, 0.8);
    border: 1px solid rgba(200, 169, 81, 0.2);
    color: var(--text-primary);
}

.confirm-btn.cancel:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 0 15px rgba(200, 169, 81, 0.2);
}

.confirm-btn.proceed {
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    color: white;
}

.confirm-btn.proceed:hover {
    box-shadow: 0 0 25px rgba(200, 169, 81, 0.5);
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: clamp(60px, 12vw, 80px);
    right: clamp(8px, 2vw, 20px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: min(400px, 85vw);
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(10px, 2.5vw, 16px);
    background: rgba(18, 18, 26, 0.95);
    border-radius: clamp(10px, 2.5vw, 16px);
    border: 1px solid rgba(200, 169, 81, 0.2);
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(200, 169, 81, 0.1), 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toastSlideIn 0.3s ease-out;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast:hover {
    border-color: rgba(200, 169, 81, 0.4);
    box-shadow: 0 0 40px rgba(200, 169, 81, 0.2), 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.toast-icon {
    width: clamp(18px, 4vw, 24px);
    height: clamp(18px, 4vw, 24px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: clamp(11px, 2.5vw, 14px);
}

.toast-icon.success { background: rgba(0, 255, 136, 0.15); color: #00ff88; box-shadow: 0 0 10px rgba(0, 255, 136, 0.2); }
.toast-icon.error { background: rgba(255, 80, 80, 0.15); color: #ff5050; box-shadow: 0 0 10px rgba(255, 80, 80, 0.2); }
.toast-icon.warning { background: rgba(243, 132, 30, 0.15); color: #F3841E; box-shadow: 0 0 10px rgba(243, 132, 30, 0.2); }
.toast-icon.info { background: rgba(200, 169, 81, 0.15); color: var(--neon-gold); box-shadow: 0 0 10px rgba(200, 169, 81, 0.2); }

.toast-content { flex: 1; min-width: 0; }

.toast-title {
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: clamp(11px, 2.5vw, 13px);
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 2px;
    font-size: clamp(13px, 3vw, 16px);
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover { color: var(--accent); }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--neon-gold));
    border-radius: 0 0 clamp(10px, 2.5vw, 16px) clamp(10px, 2.5vw, 16px);
    animation: toastProgress linear forwards;
}

@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

.toast-link {
    color: var(--neon-gold);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.toast-link:hover { color: var(--accent); text-decoration: underline; }

/* ========== POOL PAIR CARDS ========== */
.pool-pair-card {
    background: rgba(18, 18, 26, 0.9);
    border: 1px solid rgba(200, 169, 81, 0.15);
    border-radius: clamp(10px, 2.5vw, 16px);
    padding: clamp(10px, 2.5vw, 16px) clamp(12px, 3vw, 20px);
    transition: all 0.2s;
}

.pool-pair-card:hover {
    border-color: rgba(200, 169, 81, 0.3);
    box-shadow: 0 0 20px rgba(200, 169, 81, 0.05);
}

.pool-pair-header {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(8px, 2vw, 12px);
}

.pool-pair-icons { display: flex; align-items: center; }

.pool-pair-icons .pool-icon-circle:last-child { margin-left: -8px; }

.pool-icon-circle {
    width: clamp(24px, 5vw, 32px);
    height: clamp(24px, 5vw, 32px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(9px, 2vw, 11px);
    font-weight: 700;
    border: 2px solid var(--bg-primary);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.pool-icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.pool-pair-names {
    font-weight: 600;
    font-size: clamp(14px, 3vw, 16px);
    color: var(--text-primary);
}

.pool-pair-details {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.8vw, 6px);
    margin-bottom: clamp(8px, 2vw, 12px);
}

.pool-pair-row {
    display: flex;
    justify-content: space-between;
    font-size: clamp(11px, 2.5vw, 13px);
    color: var(--text-secondary);
}

.pool-pair-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.pool-pair-actions { display: flex; gap: clamp(4px, 1vw, 8px); }

.pool-add-btn,
.pool-remove-btn {
    flex: 1;
    padding: clamp(6px, 1.5vw, 10px);
    border-radius: clamp(8px, 2vw, 12px);
    font-size: clamp(12px, 2.8vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.pool-add-btn {
    background: linear-gradient(135deg, var(--accent), var(--neon-gold));
    color: white;
}

.pool-add-btn:hover {
    box-shadow: 0 0 20px rgba(200, 169, 81, 0.4);
}

.pool-remove-btn {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: #ff4d4d;
}

.pool-remove-btn:hover {
    background: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.5);
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.2);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(200, 169, 81, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    padding: clamp(6px, 1.5vw, 12px) clamp(8px, 2vw, 16px);
    flex-shrink: 0;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: clamp(10px, 2.2vw, 13px);
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.footer-brand strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.footer-powered { color: var(--text-tertiary); }

/* ========== TX MODAL ========== */
.tx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vw, 16px);
}

.tx-modal {
    background: #1e1e2e;
    border: 1px solid rgba(200, 169, 81, 0.15);
    border-radius: clamp(12px, 3vw, 20px);
    padding: clamp(24px, 6vw, 40px) clamp(20px, 5vw, 32px) clamp(20px, 5vw, 32px);
    width: min(340px, 88vw);
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.tx-modal-close {
    position: absolute;
    top: clamp(8px, 2vw, 12px);
    right: clamp(10px, 2.5vw, 14px);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: clamp(18px, 4vw, 22px);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tx-modal-close:hover { color: var(--text-primary); }

.tx-modal-icon {
    width: clamp(52px, 13vw, 72px);
    height: clamp(52px, 13vw, 72px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(12px, 3vw, 20px);
    background: rgba(200, 169, 81, 0.08);
    border: 3px solid rgba(200, 169, 81, 0.15);
}

.tx-modal-icon.success {
    background: rgba(0, 255, 136, 0.08);
    border-color: rgba(0, 255, 136, 0.25);
}

.tx-spinner {
    width: clamp(24px, 6vw, 32px);
    height: clamp(24px, 6vw, 32px);
    border: 3px solid rgba(200, 169, 81, 0.15);
    border-top-color: #c8a951;
    border-radius: 50%;
    animation: txSpin 0.8s linear infinite;
}

@keyframes txSpin { to { transform: rotate(360deg); } }

.tx-modal-icon.success .tx-spinner { display: none; }

.tx-modal-icon .tx-check {
    display: none;
    font-size: clamp(24px, 6vw, 32px);
    color: #00ff88;
}

.tx-modal-icon.success .tx-check { display: block; }

.tx-modal-title {
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: clamp(4px, 1vw, 8px);
}

.tx-modal-desc {
    font-size: clamp(12px, 2.8vw, 14px);
    color: var(--text-secondary);
    margin-bottom: clamp(12px, 3vw, 20px);
    line-height: 1.5;
}

.tx-modal-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2.5vw, 16px);
    background: rgba(200, 169, 81, 0.1);
    border: 1px solid rgba(200, 169, 81, 0.2);
    border-radius: clamp(8px, 2vw, 12px);
    color: var(--neon-gold);
    font-size: clamp(11px, 2.5vw, 13px);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: clamp(10px, 2.5vw, 16px);
    transition: all 0.2s;
}

.tx-modal-link:hover { background: rgba(200, 169, 81, 0.2); }

.tx-modal-done {
    width: 100%;
    padding: clamp(10px, 2.5vw, 14px);
    background: #c8a951;
    border: none;
    border-radius: clamp(10px, 2.5vw, 14px);
    color: white;
    font-size: clamp(13px, 3vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tx-modal-done:hover { opacity: 0.9; }

/* ========== SAFE AREA (iPhone notch) ========== */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(clamp(6px, 1.5vw, 12px) + env(safe-area-inset-top));
        padding-left: calc(clamp(10px, 3vw, 24px) + env(safe-area-inset-left));
        padding-right: calc(clamp(10px, 3vw, 24px) + env(safe-area-inset-right));
    }
    .footer {
        padding-bottom: calc(clamp(6px, 1.5vw, 12px) + env(safe-area-inset-bottom));
    }
    #app {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .toast-container {
        top: calc(clamp(60px, 12vw, 80px) + env(safe-area-inset-top));
        right: calc(clamp(8px, 2vw, 20px) + env(safe-area-inset-right));
    }
}

/* ========== LANDSCAPE ========== */
@media (orientation: landscape) and (max-height: 500px) {
    html, body { overflow: auto; }
    #app { height: auto; min-height: 100vh; min-height: 100dvh; }
    .header { padding: 4px clamp(8px, 2vw, 16px); min-height: 36px; }
    .page { padding: 4px clamp(8px, 2vw, 16px); }
    #swapPage.active { padding-top: 4px; }
    .swap-input-card { padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px); }
    .swap-btn { padding: clamp(6px, 1.5vw, 10px); }
    .footer { padding: 2px clamp(8px, 2vw, 16px); }
}

/* ========== TOUCH DEVICE ========== */
@media (hover: none) and (pointer: coarse) {
    .swap-icon-btn { min-width: 36px; min-height: 36px; }
    .close-btn { min-width: 36px; min-height: 36px; }
    .token-select { min-height: 36px; }
    .slippage-btn { min-height: 40px; }
    .confirm-btn { min-height: 44px; }
    .expert-confirm-btn { min-height: 44px; }
    .wallet-disconnect-btn { min-height: 40px; }
}

/* ========== HIGH DPI ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .swap-card { border-width: 0.5px; }
    .swap-input-card { border-width: 0.5px; }
    .pool-content { border-width: 0.5px; }
    .modal-content { border-width: 0.5px; }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
    .toast { animation: none; }
    .toast.removing { animation: none; display: none; }
}

/* ========== PRINT ========== */
@media print {
    .header, .footer, .modal, .tx-modal-overlay, .toast-container { display: none !important; }
    body { background: white; color: black; }
}
