:root {
    --bg: #080d0f;
    --bg-subtle: #0c1214;
    --surface: #111a1e;
    --surface-hover: #162226;
    --border: #1e2e34;
    --border-subtle: #172429;
    --text: #e8f4f0;
    --text-muted: #7a9a8e;
    --accent: #2ecc71;
    --accent-hover: #4ae88c;
    --accent-muted: rgba(46, 204, 113, 0.12);
    --accent2: #3498db;
    --accent2-muted: rgba(52, 152, 219, 0.12);
    --success: #2ecc71;
    --warning: #f1c40f;
    --error: #e74c3c;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 40% at 30% -15%, var(--accent2-muted), transparent),
        radial-gradient(ellipse 60% 40% at 70% -15%, var(--accent-muted), transparent);
    pointer-events: none;
    z-index: 0;
}

.nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border-subtle);
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 100px;
    width: auto;
    display: block;
}

.footer-logo-img {
    height: 42px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-menu-btn {
    display: none;
}

.nav-close-btn {
    display: none;
}

.nav-links-panel {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links-header {
    display: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--accent);
}

.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4.5rem 1.5rem 3.5rem;
    max-width: 660px;
    margin: 0 auto;
}

.trusted-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: var(--accent-muted);
    border: 1px solid rgba(46, 204, 113, 0.2);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.section {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--text);
}

.section-desc {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
    max-width: 540px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.swap-section {
    padding-top: 0;
    overflow: visible;
}

.swap-section .swap-card {
    max-width: 480px;
    margin: 0 auto;
    overflow: visible;
    position: relative;
}

.swap-section .swap-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent2), var(--accent), transparent);
    border-radius: 2px;
    opacity: 0.6;
}

.swap-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.swap-form .field {
    margin-bottom: 1rem;
    overflow: visible;
}

.swap-form .input-row {
    overflow: visible;
}

.swap-form {
    overflow: visible;
}

.swap-form label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.input-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-row input[type="number"],
.input-row input[type="text"] {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
}

.input-row input:focus {
    outline: none;
    border-color: var(--accent);
}

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

.native-select {
    position: relative;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    flex-shrink: 0;
    align-self: stretch;
}

.native-select-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 100%;
    min-height: 48px;
    padding: 0.75rem 2.25rem 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.native-select-input:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.native-select-input:focus {
    outline: none;
    border-color: var(--accent);
}

.native-select-caret {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    transform: translateY(-35%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--text-muted);
    opacity: 0.9;
}

.native-select-input:focus + .native-select-caret {
    border-top-color: var(--accent);
}

.coin-select {
    position: relative;
    min-width: 140px;
    flex-shrink: 0;
    align-self: stretch;
}

.coin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.coin-btn:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
}

.coin-btn img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.coin-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.coin-modal-wrap[aria-hidden="false"] {
    display: flex;
}

.coin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.coin-modal-panel {
    position: relative;
    z-index: 1;
    width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #252a32;
    border-radius: 12px;
    background: #15181c;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #252a32;
}

.dropdown-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f4f8;
}

.dropdown-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1e24;
    border: none;
    color: #8b95a1;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 8px;
}

.dropdown-close:hover {
    background: #252a32;
    color: #f0f4f8;
}

.dropdown-search-wrap {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #252a32;
}

.dropdown-search {
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: #0a0c0e;
    border: 1px solid #252a32;
    border-radius: 8px;
    color: #f0f4f8;
    font-size: 0.9rem;
}

.dropdown-search:focus {
    outline: none;
    border-color: #2ecc71;
}

.dropdown-search::placeholder {
    color: #8b95a1;
}

.dropdown-list {
    overflow-y: auto;
    padding: 0.5rem;
    max-height: 320px;
}

.dropdown-empty {
    padding: 2rem;
    text-align: center;
    color: #8b95a1;
}

.coin-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    border-radius: 10px;
    color: #f0f4f8;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
}

.coin-group:hover {
    background: #1a1e24;
}

.coin-group img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: contain;
}

.coin-option-name {
    color: #8b95a1;
    font-size: 0.85rem;
    margin-left: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.coin-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(46, 204, 113, 0.15);
    color: #6ee7a0;
    font-size: 0.8rem;
    font-weight: 600;
}

.coin-back {
    width: 100%;
    padding: 0.6rem 1rem;
    margin: 0.25rem 0.5rem 0.5rem;
    border-radius: 10px;
    border: 1px solid #252a32;
    background: #0a0c0e;
    color: #f0f4f8;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.coin-back:hover {
    border-color: #2ecc71;
}

.coin-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    border: none;
    border-radius: 8px;
    color: #f0f4f8;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.coin-option:hover {
    background: #1a1e24;
}

.coin-option img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: contain;
}

.coin-option-ticker {
    font-weight: 600;
}

.coin-option-network {
    color: #8b95a1;
    font-size: 0.85rem;
}


.swap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0.5rem auto;
    background: var(--border);
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.swap-arrow:hover {
    background: var(--accent);
    transform: rotate(180deg);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.address-field input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.address-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.memo-input {
    margin-top: 0.5rem !important;
}

.aff-code-field input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.aff-code-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.optional-tag {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0.7;
}

.swap-fee-row {
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.swap-fee-items {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.swap-fee-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.swap-fee-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.swap-fee-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text);
}

.swap-fee-value.fee-green {
    color: var(--accent);
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.99);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.rate-panel {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.rate-summary {
    margin-bottom: 1rem;
}

.rate-summary p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.rate-type {
    font-size: 0.8rem !important;
    margin-top: 0.25rem;
}

.trade-panel {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

.trade-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.status-badge.waiting,
.status-badge.confirming {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.status-badge.sending {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.finished {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-badge.failed,
.status-badge.expired,
.status-badge.halted {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.status-badge.review {
    background: var(--accent-muted);
    color: var(--accent);
}

.trade-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.trade-body .trade-amount {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.deposit-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.deposit-box label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.deposit-address,
.deposit-memo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.deposit-address code,
.deposit-memo code {
    flex: 1;
    min-width: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--accent);
}

.copy-btn {
    padding: 0.35rem 0.6rem;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.deposit-memo {
    margin-top: 0.75rem;
}

.deposit-review-note {
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 0.75rem;
}

.deposit-warning {
    font-size: 0.75rem;
    color: var(--warning);
    margin-top: 0.75rem;
}

.processing-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.processing-card {
    width: 420px;
    max-width: 90vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    text-align: center;
}

.processing-spinner {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent);
    margin: 0 auto 1.25rem;
    animation: spin 0.9s linear infinite;
}

.processing-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.processing-step {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.step:hover {
    border-color: rgba(46, 204, 113, 0.3);
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.06), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.step-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--accent2-muted);
    color: var(--accent2);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--border);
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 1rem;
    margin-left: 0.5rem;
}

.step h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
    border-color: rgba(46, 204, 113, 0.3);
    box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.06), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: 11px;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.recent-swaps-section {
    padding-top: 2rem;
    padding-bottom: 1rem;
}

.recent-swaps {
    max-width: 600px;
    margin: 1.5rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.swap-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.swap-row-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.swap-pair {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.swap-pair svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.swap-coin {
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.15rem 0.45rem;
    border-radius: 5px;
}

.swap-coin.from {
    background: var(--accent2-muted);
    color: var(--accent2);
}

.swap-coin.to {
    background: var(--accent-muted);
    color: var(--accent);
}

.swap-amounts {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swap-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.swap-status {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.swap-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.trust-bar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.trust-item svg {
    color: var(--success);
    flex-shrink: 0;
}

.faq-list {
    max-width: 700px;
    margin: 2rem auto 0;
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background: none;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s;
}

.faq-q:hover {
    color: var(--accent);
}

.faq-q::after {
    content: '+';
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 1rem;
}

.faq-item.open .faq-q::after {
    content: '−';
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.faq-item.open .faq-a {
    max-height: 500px;
}

.faq-a {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.faq-a p {
    padding: 0 0 1rem 0;
}

.contact-block {
    max-width: 560px;
    margin: 2rem auto 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-align: center;
}

.contact-block p {
    margin-bottom: 0.5rem;
}

.contact-note {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.contact-block a {
    color: var(--accent);
    text-decoration: none;
}

.contact-block a:hover {
    text-decoration: underline;
}

.footer {
    position: relative;
    z-index: 1;
    margin-top: 5rem;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-tagline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.page-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    width: 90%;
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.page-updated {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.page-content section {
    margin-bottom: 2rem;
}

.page-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.page-content p,
.page-content li {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.page-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.page-content a {
    color: var(--accent);
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

.back-link {
    margin-top: 2rem;
}

.back-link a {
    color: var(--text-muted);
}

.back-link a:hover {
    color: var(--accent);
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.aff-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.aff-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.25s;
}

.aff-stat-card:hover {
    border-color: rgba(46, 204, 113, 0.3);
}

.aff-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.aff-stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.aff-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: 800px;
    margin: 1.5rem auto 0;
}

.aff-tier {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color 0.25s;
}

.aff-tier:hover {
    border-color: rgba(46, 204, 113, 0.3);
}

.aff-tier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.aff-tier-name {
    font-weight: 600;
    font-size: 1rem;
}

.aff-tier-rate {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.aff-tier p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.api-docs {
    max-width: 800px;
}

.api-docs code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: var(--bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--accent);
}

.api-docs pre code {
    background: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.65;
}

.api-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.api-info-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.api-info-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.api-info-item code {
    font-size: 0.8rem;
    background: none;
    padding: 0;
}

.api-endpoint {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.api-method-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.api-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.6rem;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.api-method.get {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.api-method.post {
    background: var(--accent2-muted);
    color: var(--accent2);
}

.api-path {
    font-size: 0.95rem !important;
    background: none !important;
    padding: 0 !important;
    color: var(--text) !important;
    font-weight: 500;
}

.api-code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    overflow: hidden;
}

.api-code-header {
    padding: 0.5rem 1rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.api-code-block pre {
    padding: 1rem;
    overflow-x: auto;
    margin: 0;
}

.api-status-table {
    margin: 1rem 0;
}

.api-status-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.api-status-row code {
    min-width: 90px;
    flex-shrink: 0;
}

.api-status-row span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.api-apply-box {
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1rem 0;
}

.api-apply-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.api-apply-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .nav {
        padding: 0.9rem 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .nav-logo {
        flex-shrink: 0;
    }

    .nav-logo-img {
        height: 70px;
    }

    .nav-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 42px;
        min-width: 42px;
        padding: 0 0.9rem;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text);
        font: inherit;
        font-weight: 600;
        cursor: pointer;
        flex-shrink: 0;
    }

    .nav-menu-btn:hover {
        border-color: var(--accent);
        background: var(--surface-hover);
    }

    .nav-menu-btn .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 22px;
        height: 18px;
    }

    .nav-menu-btn .hamburger-bar {
        display: block;
        width: 22px;
        height: 2.5px;
        background: currentColor;
        border-radius: 2px;
        transition: transform 0.22s ease, opacity 0.18s ease;
    }

    .nav-menu-btn[aria-expanded="true"] .hamburger-bar:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }

    .nav-menu-btn[aria-expanded="true"] .hamburger-bar:nth-child(2) {
        opacity: 0;
    }

    .nav-menu-btn[aria-expanded="true"] .hamburger-bar:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        inset: 0;
        z-index: 10001;
        background: rgba(0, 0, 0, 0.72);
        padding: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.22s ease, visibility 0.22s ease;
    }

    .nav-links[aria-hidden="false"] {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links-panel {
        position: absolute;
        top: 0;
        right: 0;
        width: min(280px, 85vw);
        height: 100%;
        background: var(--surface);
        border-left: 1px solid var(--border);
        padding: 5rem 1.5rem 2rem;
        display: flex;
        flex-direction: column;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.26s ease;
    }

    .nav-links[aria-hidden="false"] .nav-links-panel {
        transform: translateX(0);
    }

    .nav-links a {
        display: flex;
        align-items: center;
        padding: 1rem 0.25rem;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
        color: var(--text);
        text-decoration: none;
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: -0.01em;
        transition: color 0.15s ease;
    }

    .nav-links a:first-child {
        border-top: 1px solid var(--border);
    }

    .nav-links a:hover,
    .nav-links a:active {
        color: var(--accent);
        background: transparent;
    }
    .hero-stats {
        gap: 2rem;
    }

    .hero {
        padding: 3rem 1rem 2.5rem;
    }

    .hero-title {
        letter-spacing: -0.01em;
        line-height: 1.15;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .swap-row {
        flex-wrap: wrap;
        gap: 0.4rem 0.75rem;
        padding: 0.65rem 0.75rem;
    }

    .swap-amounts {
        order: 3;
        flex-basis: 100%;
        text-align: left;
        font-size: 0.72rem;
    }

    .swap-meta {
        gap: 0.5rem;
    }

    .swap-status {
        font-size: 0.68rem;
    }

    .swap-time {
        font-size: 0.7rem;
    }

    .trust-bar {
        gap: 1rem 1.5rem;
        padding: 1.5rem 1rem;
    }

    .trust-item {
        font-size: 0.8rem;
    }

    .section-title {
        line-height: 1.25;
        letter-spacing: -0.01em;
    }

    .section {
        padding: 2.5rem 1rem;
    }

    .swap-section .swap-card {
        max-width: 100%;
        padding: 1.25rem;
    }

    .swap-card {
        padding: 1.25rem;
    }

    .swap-form .input-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .swap-form .coin-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .native-select {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .processing-card {
        width: 92vw;
        padding: 1.5rem;
    }

    .deposit-address code {
        word-break: break-all;
        overflow-wrap: anywhere;
    }

    .trade-body {
        padding-bottom: 0.5rem;
    }
}
