* {
    box-sizing: border-box;
}

:root {
    --bg-primary: #f7f8f2;
    --bg-secondary: #eef3ea;
    --bg-card: #ffffff;
    --bg-input: #fbfcf7;
    --text-primary: #18211b;
    --text-secondary: #556155;
    --text-muted: #849080;
    --accent-primary: #2f7d5b;
    --accent-secondary: #69a7d8;
    --accent-soft: #dff0e5;
    --accent-error: #c64848;
    --accent-warning: #b88422;
    --accent-success: #2f8a5f;
    --accent-rgb: 47, 125, 91;
    --accent-secondary-rgb: 105, 167, 216;
    --border-color: #dce5d9;
    --border-hover: #9fc4ab;
    --border-radius: 16px;
    --shadow-sm: 0 10px 24px rgba(48, 65, 49, 0.08);
    --shadow-md: 0 18px 44px rgba(48, 65, 49, 0.12);
    --shadow-lg: 0 26px 70px rgba(48, 65, 49, 0.16);
}

html {
    min-height: 100%;
    background: var(--bg-primary);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    font-family: "Manrope", "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at 8% 8%, rgba(105, 167, 216, 0.2), transparent 28%),
        radial-gradient(circle at 88% 0%, rgba(47, 125, 91, 0.14), transparent 26%),
        linear-gradient(180deg, #fbfcf7 0%, #eef4ec 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(47, 125, 91, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(47, 125, 91, 0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent 78%);
}

a {
    color: var(--accent-primary);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

img,
svg {
    max-width: 100%;
}

.container {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.main {
    min-height: calc(100vh - 170px);
    padding: clamp(18px, 4vw, 48px) 0;
}

.w-full { width: 100%; }
.h-full { height: 100%; }
.object-contain { object-fit: contain; }

.field-error,
.lookup-hint,
.email-msg.error,
.text-error {
    color: var(--accent-error);
    font-size: 12px;
    font-weight: 800;
}

.msg-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 16px;
    padding: 12px 14px;
    max-width: 720px;
    border-radius: 14px;
    font-weight: 800;
    line-height: 1.4;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.msg-alert.ok {
    color: #225f43;
    border: 1px solid #b7dbc4;
}

.msg-alert.err {
    color: #9e3838;
    border: 1px solid #efc2c2;
}

.btn-primary,
.btn-secondary,
.btn-action,
.email-btn,
.lookup-button,
.copy-button,
.deposit-copy-btn,
.swap-btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 900;
    border: 1px solid transparent;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn-primary,
.lookup-button,
.copy-button,
.deposit-copy-btn,
.swap-btn-main {
    color: #ffffff;
    border-color: #2f7d5b;
    background: linear-gradient(135deg, #2f7d5b 0%, #54a06f 100%);
    box-shadow: 0 12px 24px rgba(47, 125, 91, 0.18);
}

.btn-primary:hover,
.lookup-button:hover,
.copy-button:hover,
.deposit-copy-btn:hover,
.swap-btn-main:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(47, 125, 91, 0.22);
}

.btn-secondary,
.btn-action,
.email-btn {
    color: var(--text-primary);
    border-color: var(--border-color);
    background: #ffffff;
}

.btn-secondary:hover,
.btn-action:hover,
.email-btn:hover {
    border-color: var(--border-hover);
    background: #f7fbf6;
}

.rate-info-modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(43, 54, 44, 0.34);
    backdrop-filter: blur(16px);
}

.rate-info-modal.active {
    display: flex;
}

.modal-content,
.contacts-card {
    width: min(500px, 100%);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-lg);
}

.modal-content {
    position: relative;
    padding: 26px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: #fff;
    font-size: 22px;
    line-height: 1;
}

.contacts-card {
    display: grid;
    gap: 8px;
    width: 100%;
    padding: 14px;
}

.contacts-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color);
}

.contacts-row:last-child { border-bottom: 0; }
.contacts-key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}
.contacts-type-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: #fff;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}
.contacts-type-icon svg {
    width: 16px;
    height: 16px;
}
.contacts-val--accent {
    color: var(--accent-primary);
    font-weight: 900;
    text-decoration: none;
    word-break: break-word;
}

@media (max-width: 768px) {
    .container {
        width: min(100% - 18px, 1080px);
    }

    .main {
        padding: 14px 0 28px;
    }
}

@media (scripting: none) {
    .nojs-support {
        position: fixed;
        right: 20px;
        bottom: 20px;
        z-index: 9000;
    }

    .nojs-support__panel {
        position: fixed;
        right: 20px;
        bottom: 88px;
        z-index: 9000;
        display: grid;
        width: min(390px, calc(100vw - 24px));
        max-height: min(620px, calc(100vh - 112px));
        overflow: hidden;
    }
}
