/* app/static/css/smart_contracts.css */

/* =========================================================
   SMART CONTRACTS PAGE — CLEAN BUILDER VERSION
   Removed old deployed-contract action panels.
   Includes dark theme, light theme, and mobile adaptation.
   ========================================================= */

/* ========================= */
/* PAGE */
/* ========================= */

.smart-contracts-page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 60px;
    box-sizing: border-box;
    color: #ffffff;
}

/* ========================= */
/* HERO */
/* ========================= */

.smart-contracts-hero {
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;

    min-height: 230px;
    padding: 22px 26px;
    margin-bottom: 22px;

    border: 2px solid #037d9c;
    border-radius: 20px;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.08) 45%, rgba(0, 0, 0, 0.02)),
        rgba(4, 22, 32, 0.55);

    box-shadow:
        0 0 18px rgba(3, 125, 156, 0.55),
        0 12px 30px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);

    box-sizing: border-box;
}

.smart-contracts-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;

    background: url("/static/img/smart_contracts_header.webp?v=1") center center / cover no-repeat;
    opacity: 1;

    pointer-events: none;
}

.smart-contracts-hero::after {
    content: none;
    display: none;
}

/* ========================= */
/* HERO TEXT */
/* Заголовок слева как в dApp, размеры шапки не меняем */
/* ========================= */

.smart-contracts-hero-text {
    position: relative;
    z-index: 3;

    min-width: 0;
    max-width: 560px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    text-align: left;
}

.smart-contracts-eyebrow {
    display: inline-flex;
    align-items: center;

    margin-bottom: 10px;
    padding: 6px 12px;

    border: 1px solid rgba(232, 251, 255, 0.34);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.62);
    color: #e8fbff;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    box-shadow:
        0 0 10px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    box-sizing: border-box;
    backdrop-filter: blur(6px);
}

.smart-contracts-hero h1 {
    position: relative;
    z-index: 3;

    margin: 0 0 10px;

    border: none;
    background: transparent;
    box-shadow: none;

    color: #ffffff;

    font-size: 31px;
    font-weight: 800;
    line-height: 1.15;

    text-align: left;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.smart-contracts-hero p {
    position: relative;
    z-index: 3;

    max-width: 520px;
    margin: 0;

    border: none;
    background: transparent;
    box-shadow: none;

    color: #e8fbff;

    font-size: 15px;
    line-height: 1.55;

    text-align: left;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================= */
/* HERO BADGE */
/* Правая плашка Solidity Templates */
/* ========================= */

.smart-contracts-hero-badge {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 20;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 44px;
    margin: 0;
    padding: 10px 18px;

    border: 1px solid rgba(232, 251, 255, 0.55);
    border-radius: 999px;

    background: rgba(0, 0, 0, 0.38);
    color: #ffffff;

    white-space: nowrap;

    box-shadow:
        0 0 14px rgba(255, 255, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(6px);
}

.smart-contracts-hero-badge i {
    color: #ffffff;
    font-size: 16px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

.smart-contracts-hero-badge span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* ========================= */
/* OLD HERO VISUAL LAYERS */
/* Отключены, потому что фон уже в smart_contracts_header.webp */
/* ========================= */

.smart-contracts-hero-visual,
.smart-earth-image,
.smart-hands-ring {
    display: none;
}

/* ========================= */
/* BUILDER STATUS */
/* Нижний статус Smart Builder Ready */
/* ========================= */

.smart-builder-status {
    position: absolute;
    right: 70px;
    bottom: 30px;
    z-index: 5;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    width: 112px;
    min-height: 25px;
    padding: 5px 8px;

    border: 1px solid rgba(232, 251, 255, 0.34);
    border-radius: 9px;

    background: rgba(15, 18, 22, 0.86);
    color: #ffffff;

    box-shadow:
        0 0 14px rgba(3, 125, 156, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.smart-builder-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;

    border-radius: 50%;

    background: #4df2a7;
    box-shadow: 0 0 16px rgba(77, 242, 167, 0.8);
}

#smart-builder-status-text {
    overflow: hidden;

    color: #ffffff;

    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.smart-builder-status[data-status="loading"] .smart-builder-status-dot {
    background: #06d9ff;
    box-shadow: 0 0 16px rgba(6, 217, 255, 0.78);
}

.smart-builder-status[data-status="generated"] .smart-builder-status-dot,
.smart-builder-status[data-status="valid"] .smart-builder-status-dot,
.smart-builder-status[data-status="success"] .smart-builder-status-dot {
    background: #5dff8b;
    box-shadow: 0 0 16px rgba(93, 255, 139, 0.76);
}

.smart-builder-status[data-status="error"] .smart-builder-status-dot {
    background: #ff6b6b;
    box-shadow: 0 0 16px rgba(255, 107, 107, 0.72);
}

.smart-builder-status[data-status="warning"] .smart-builder-status-dot {
    background: #ffd56a;
    box-shadow: 0 0 16px rgba(255, 213, 106, 0.72);
}

/* ========================= */
/* MAIN GRID / CARDS */
/* ========================= */

.smart-contracts-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.12fr);
    align-items: start;
    gap: 22px;

    margin-bottom: 22px;
}

.smart-card {
    padding: 20px;

    border: 1px solid rgba(6, 171, 212, 0.24);
    border-radius: 18px;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015)),
        rgba(0, 0, 0, 0.74);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);

    box-sizing: border-box;
}

.builder-panel {
    align-self: start;
}

/* Прижимаем верхние голубые шапки к верхнему краю темных карточек,
   чтобы над ними не выглядывал темный фон основной рамки. */
.builder-panel,
.code-panel {
    padding-top: 0;
    overflow: hidden;
}

.code-panel {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-self: start;
    height: var(--builder-panel-height, min(820px, calc(100vh - 120px)));
    max-height: var(--builder-panel-height, calc(100vh - 120px));
}

.code-panel .card-header {
    flex: 0 0 auto;
}

/* ========================= */
/* CARD HEADERS */
/* Голубые шапки внутри карточек */
/* ========================= */

.card-header {
    position: relative;
    overflow: hidden;

    min-height: 92px;
    width: calc(100% + 40px);
    margin: 0 -20px 17px;
    padding: 16px 24px;

    border: 2px solid #037d9c;
    border-radius: 15px;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.14) 48%, rgba(0, 0, 0, 0.04)),
        radial-gradient(circle at 78% 48%, rgba(3, 125, 156, 0.42), transparent 38%),
        linear-gradient(180deg, rgba(3, 125, 156, 0.38), rgba(4, 22, 32, 0.84));

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.48),
        0 10px 24px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);

    box-sizing: border-box;
}

.card-header::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 42%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 32%);

    pointer-events: none;
}

.card-header h2,
.card-header span {
    position: relative;
    z-index: 2;
}

.card-header h2 {
    margin: 0 0 6px;

    color: #ffffff;

    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.48);
}

.card-header span {
    display: block;

    color: #e8fbff;

    font-size: 13px;
    line-height: 1.4;

    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ========================= */
/* FORM */
/* ========================= */

.smart-contract-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #c6c6c6;
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 43px;
    padding: 11px 12px;
    border: 1px solid rgba(6, 171, 212, 0.34);
    border-radius: 11px;
    background: rgba(15, 18, 22, 0.98);
    color: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.38);
}

.form-group input:focus,
.form-group select:focus {
    border-color: rgba(6, 217, 255, 0.78);
    background: rgba(12, 16, 20, 1);
    box-shadow: 0 0 0 3px rgba(6, 217, 255, 0.12);
}

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

/* ========================= */
/* CUSTOM NETWORK SELECT */
/* ========================= */

.custom-network-select {
    position: relative;
    z-index: 50;
    width: 100%;
    user-select: none;
}

.custom-network-select.open {
    z-index: 5000;
}

.custom-network-trigger {
    position: relative;
    z-index: 2;

    width: 100%;
    min-height: 43px;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    border: 1px solid rgba(6, 171, 212, 0.34);
    border-radius: 11px;

    background: rgba(15, 18, 22, 0.98);
    color: #ffffff;

    font-size: 14px;
    text-align: left;

    cursor: pointer;
    box-sizing: border-box;
}

.custom-network-trigger:focus {
    outline: none;
    border-color: rgba(6, 217, 255, 0.78);
    box-shadow: 0 0 0 3px rgba(6, 217, 255, 0.12);
}

.custom-network-trigger-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.custom-network-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-network-logo {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    object-fit: contain;
}

.custom-network-arrow {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.25s ease;
}

.custom-network-select.open .custom-network-arrow {
    transform: rotate(180deg);
}

.custom-network-dropdown {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 9999;

    display: none;

    width: 100%;
    max-height: 285px;
    overflow-y: auto;

    border: 1px solid rgba(6, 171, 212, 0.45);
    border-radius: 11px;

    background: rgba(10, 14, 18, 0.98);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);

    pointer-events: auto;
}

.custom-network-select.open .custom-network-dropdown {
    display: block;
}

.custom-network-option {
    position: relative;
    z-index: 10000;

    width: 100%;
    padding: 10px 12px;

    display: flex;
    align-items: center;
    gap: 10px;

    border: none;
    background: transparent;
    color: #ffffff;

    font-size: 14px;
    text-align: left;

    cursor: pointer;
    pointer-events: auto;
    box-sizing: border-box;

    transition: background 0.2s ease;
}

.custom-network-option:hover {
    background: rgba(21, 135, 163, 0.35);
}

.custom-network-option.selected {
    background: rgba(3, 125, 156, 0.45);
}

.custom-network-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================= */
/* BUTTONS */
/* ========================= */

.builder-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.smart-primary-btn,
.smart-secondary-btn,
.smart-deploy-btn {
    min-height: 43px;
    padding: 0 14px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 11px;
    font-weight: 600;
    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.smart-primary-btn {
    grid-column: span 2;
    border: 1px solid rgba(6, 171, 212, 0.68);
    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.26), rgba(0, 255, 204, 0.11)),
        rgba(6, 171, 212, 0.14);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(6, 171, 212, 0.12);
}

.smart-primary-btn:hover {
    transform: translateY(-1px);
    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.36), rgba(0, 255, 204, 0.16)),
        rgba(6, 171, 212, 0.18);
    box-shadow: 0 0 18px rgba(6, 171, 212, 0.18);
}

.smart-primary-btn.generated-success {
    border-color: rgba(93, 255, 139, 0.7);
    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.28), rgba(0, 255, 204, 0.14)),
        rgba(93, 255, 139, 0.12);
    box-shadow: 0 0 18px rgba(93, 255, 139, 0.18);
}

.smart-secondary-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.055);
    color: #ffffff;
}

.smart-secondary-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(6, 171, 212, 0.58);
    background: rgba(6, 171, 212, 0.13);
}

.compile-check-btn {
    border-color: rgba(0, 255, 204, 0.34);
    color: #eafffa;
}

.compile-check-btn:hover {
    border-color: rgba(0, 255, 204, 0.75);
    background: rgba(0, 255, 204, 0.12);
}

.compile-check-btn.loading,
.smart-deploy-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.compile-check-btn.loading i,
.smart-deploy-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

.smart-deploy-btn {
    width: 100%;
    border: 1px solid rgba(255, 195, 60, 0.38);
    background: rgba(255, 195, 60, 0.10);
    color: #ffc34a;
}

.smart-deploy-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.smart-deploy-btn:not(:disabled) {
    border-color: rgba(255, 195, 60, 0.75);
    background:
        linear-gradient(90deg, rgba(255, 195, 60, 0.22), rgba(255, 145, 0, 0.12)),
        rgba(255, 195, 60, 0.12);
    color: #ffd56a;
}

.smart-deploy-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background:
        linear-gradient(90deg, rgba(255, 195, 60, 0.30), rgba(255, 145, 0, 0.16)),
        rgba(255, 195, 60, 0.16);
    box-shadow: 0 0 14px rgba(255, 195, 60, 0.12);
}

.builder-note {
    margin: 0;
    color: #a9a9a9;
    font-size: 13px;
    line-height: 1.45;
}

/* ========================= */
/* WALLET BALANCE PREVIEW */
/* ========================= */

.wallet-balance-preview {
    padding: 14px;
    border: 1px solid #037d9c;
    border-radius: 14px;
    background: rgba(3, 125, 156, 0.12);
    box-shadow: 0 0 12px rgba(3, 125, 156, 0.18);
}

.wallet-balance-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #e8fbff;
    font-weight: 700;
}

.wallet-balance-preview-header i {
    color: #00ccff;
}

.wallet-balance-preview-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.wallet-balance-preview-row span {
    color: #bdefff;
}

.wallet-balance-preview-row strong {
    overflow: hidden;
    color: #ffffff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-balance-preview-status {
    margin: 10px 0 0;
    color: #d7faff;
    font-size: 13px;
    line-height: 1.4;
}

.wallet-balance-preview-status.success {
    color: #5dff8b;
}

.wallet-balance-preview-status.warning {
    color: #ffc34a;
}

.wallet-balance-preview-status.error {
    color: #ff7777;
}

/* ========================= */
/* STATUS BADGE */
/* Бейдж статуса компиляции / генерации */
/* ========================= */

.contract-status-badge {
    position: absolute;
    right: 8px;
    bottom: 12px;
    left: auto;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 54px;
    padding: 12px 34px;

    border: 1px solid rgba(6, 217, 255, 0.68);
    border-radius: 999px;

    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.36), rgba(0, 255, 204, 0.18)),
        rgba(6, 171, 212, 0.20);

    color: #ffffff;

    font-size: 30px;
    font-weight: 900;
    line-height: 1;

    white-space: nowrap;

    box-shadow:
        0 0 22px rgba(6, 217, 255, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);

    box-sizing: border-box;
}

.contract-status-badge[data-status="ready"] {
    border-color: rgba(6, 217, 255, 0.52);
    color: #8feeff;
}

.contract-status-badge[data-status="generated"] {
    border-color: rgba(0, 255, 204, 0.52);

    background:
        linear-gradient(90deg, rgba(0, 255, 204, 0.22), rgba(6, 171, 212, 0.16)),
        rgba(15, 18, 22, 0.82);

    color: #00ffcc;

    box-shadow:
        0 0 14px rgba(0, 255, 204, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.contract-status-badge[data-status="valid"] {
    border-color: rgba(93, 255, 139, 0.52);

    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.22), rgba(0, 255, 204, 0.10)),
        rgba(15, 18, 22, 0.82);

    color: #5dff8b;
}

.contract-status-badge[data-status="warning"] {
    border-color: rgba(255, 195, 74, 0.56);

    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.22), rgba(255, 145, 0, 0.10)),
        rgba(15, 18, 22, 0.82);

    color: #ffd56a;
}

.contract-status-badge[data-status="error"] {
    border-color: rgba(255, 90, 90, 0.58);

    background:
        linear-gradient(90deg, rgba(255, 90, 90, 0.22), rgba(255, 145, 145, 0.08)),
        rgba(15, 18, 22, 0.82);

    color: #ff7777;
}

/* ========================= */
/* CODE PREVIEW */
/* ========================= */

.code-panel {
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-self: start;
}

.code-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;

    min-height: 92px;
    padding-bottom: 16px;
    padding-right: 130px;
}

.code-preview {
    flex: 1 1 auto;

    width: 100%;
    min-height: 0;
    height: 100%;

    margin: 0;
    padding: 17px;

    overflow: auto;

    border: 1px solid rgba(6, 171, 212, 0.20);
    border-radius: 15px;

    background:
        linear-gradient(180deg, rgba(6, 171, 212, 0.035), transparent 26%),
        rgba(4, 6, 9, 0.98);

    color: #d7faff;

    font-size: 13px;
    line-height: 1.56;

    scrollbar-width: thin;
    scrollbar-color: rgba(6, 217, 255, 0.5) rgba(255, 255, 255, 0.06);

    box-sizing: border-box;
}

.code-preview::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.code-preview::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
}

.code-preview::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(6, 217, 255, 0.45);
}

.code-preview code {
    display: block;

    min-height: 100%;

    font-family: Consolas, Monaco, "Courier New", monospace;
    white-space: pre;
}

.code-preview.generated-flash {
    animation: generatedPreviewFlash 0.9s ease;
}

/* ========================= */
/* TEMPLATE FEATURES */
/* ========================= */

.smart-features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.feature-card {
    min-height: 165px;
}

.feature-card i {
    margin-bottom: 12px;
    color: #06d9ff;
    font-size: 26px;
}

.feature-card h3 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 17px;
}

.feature-card p {
    margin: 0;
    color: #cfcfcf;
    font-size: 14px;
    line-height: 1.45;
}

/* ========================= */
/* ANIMATIONS */
/* ========================= */

@keyframes smartHandsPulse {
    0%,
    100% {
        opacity: 0.86;
        filter:
            brightness(0.96)
            saturate(1.02)
            drop-shadow(0 0 14px rgba(3, 125, 156, 0.26))
            drop-shadow(0 0 20px rgba(238, 253, 255, 0.12));
    }

    45% {
        opacity: 0.98;
        filter:
            brightness(1.13)
            saturate(1.22)
            drop-shadow(0 0 28px rgba(3, 125, 156, 0.62))
            drop-shadow(0 0 34px rgba(238, 253, 255, 0.34));
    }

    58% {
        opacity: 0.93;
        filter:
            brightness(1.04)
            saturate(1.12)
            drop-shadow(0 0 20px rgba(3, 125, 156, 0.42))
            drop-shadow(0 0 26px rgba(238, 253, 255, 0.20));
    }
}

@keyframes smartCompileSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes generatedPreviewFlash {
    0% {
        border-color: rgba(93, 255, 139, 0.95);
        box-shadow: 0 0 0 rgba(93, 255, 139, 0);
    }

    45% {
        border-color: rgba(93, 255, 139, 0.95);
        box-shadow: 0 0 22px rgba(93, 255, 139, 0.24);
    }

    100% {
        border-color: rgba(6, 171, 212, 0.20);
        box-shadow: none;
    }
}

/* ========================= */
/* LIGHT THEME */
/* ========================= */

.light-theme .smart-contracts-page {
    color: #20252a;
}


/* ========================= */
/* LIGHT THEME: HERO */
/* ========================= */

.light-theme .smart-contracts-hero {
    border-color: #037d9c;

    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.06) 45%, rgba(0, 0, 0, 0.02)),
        url("/static/img/smart_contracts_header.webp?v=1") center center / cover no-repeat;

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.28),
        0 10px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.light-theme .smart-contracts-hero::before {
    display: none;
}


.light-theme .smart-contracts-hero h1,
.light-theme .smart-contracts-hero p,
.light-theme .smart-contracts-hero-badge i,
.light-theme .smart-contracts-hero-badge span {
    color: #ffffff;
}

.light-theme .smart-contracts-hero-badge {
    border-color: rgba(232, 251, 255, 0.55);

    background: rgba(0, 0, 0, 0.32);
    color: #ffffff;
}

.light-theme .smart-earth-image {
    opacity: 0.62;
}

.light-theme .smart-builder-status {
    border-color: rgba(232, 251, 255, 0.34);

    background: rgba(15, 18, 22, 0.86);
    color: #ffffff;
}


/* ========================= */
/* LIGHT THEME: MAIN CARDS */
/* ========================= */

.light-theme .smart-card {
    border-color: rgba(3, 125, 156, 0.24);

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 253, 0.94));

    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}


/* ========================= */
/* LIGHT THEME: CARD HEADERS */
/* Голубые мини-шапки внутри карточек */
/* ========================= */

.light-theme .card-header {
    border-color: #037d9c;

    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.92), rgba(3, 125, 156, 0.72)),
        radial-gradient(circle at 78% 48%, rgba(255, 255, 255, 0.18), transparent 38%),
        #037d9c;

    box-shadow:
        0 0 16px rgba(3, 125, 156, 0.26),
        0 8px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.light-theme .card-header::before {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 42%),
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.16), transparent 32%);
}

.light-theme .card-header h2,
.light-theme .card-header span {
    color: #ffffff;
}

.light-theme .feature-card h3 {
    color: #20252a;
}

.light-theme .form-group label,
.light-theme .feature-card p,
.light-theme .builder-note {
    color: #4f5b63;
}


/* ========================= */
/* LIGHT THEME: FORM */
/* ========================= */

.light-theme .form-group input,
.light-theme .form-group select,
.light-theme .custom-network-trigger {
    border-color: rgba(3, 125, 156, 0.30);

    background: #ffffff;
    color: #1e252b;
}

.light-theme .form-group input::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

.light-theme .form-group input:focus,
.light-theme .form-group select:focus,
.light-theme .custom-network-trigger:focus {
    border-color: rgba(3, 125, 156, 0.72);
    box-shadow: 0 0 0 3px rgba(3, 125, 156, 0.11);
}


/* ========================= */
/* LIGHT THEME: CUSTOM NETWORK SELECT */
/* ========================= */

.light-theme .custom-network-dropdown {
    border-color: rgba(3, 125, 156, 0.35);

    background: rgba(250, 250, 250, 0.98);
}

.light-theme .custom-network-option {
    color: #20252a;
}

.light-theme .custom-network-option:hover {
    background: rgba(21, 135, 163, 0.16);
}

.light-theme .custom-network-option.selected {
    background: rgba(21, 135, 163, 0.22);
}


/* ========================= */
/* LIGHT THEME: WALLET BALANCE */
/* ========================= */

.light-theme .wallet-balance-preview {
    border-color: #037d9c;

    background: rgba(3, 125, 156, 0.08);
}

.light-theme .wallet-balance-preview-header {
    color: #037d9c;
}

.light-theme .wallet-balance-preview-row span {
    color: #405862;
}

.light-theme .wallet-balance-preview-row strong {
    color: #20252a;
}

.light-theme .wallet-balance-preview-status {
    color: #25323a;
}

.light-theme .wallet-balance-preview-status.success {
    color: #177b33;
}

.light-theme .wallet-balance-preview-status.warning {
    color: #9a6900;
}

.light-theme .wallet-balance-preview-status.error {
    color: #b32626;
}


/* ========================= */
/* LIGHT THEME: BUTTONS */
/* ========================= */

.light-theme .smart-primary-btn {
    border-color: rgba(3, 125, 156, 0.66);

    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.78), rgba(0, 170, 150, 0.70));

    color: #ffffff;
}

.light-theme .smart-primary-btn:hover {
    background:
        linear-gradient(90deg, rgba(3, 125, 156, 0.90), rgba(0, 170, 150, 0.82));

    box-shadow: 0 0 16px rgba(3, 125, 156, 0.16);
}

.light-theme .smart-primary-btn.generated-success {
    border-color: rgba(23, 123, 51, 0.55);

    background:
        linear-gradient(90deg, rgba(23, 123, 51, 0.78), rgba(0, 145, 120, 0.68));

    color: #ffffff;

    box-shadow: 0 0 16px rgba(23, 123, 51, 0.14);
}

.light-theme .smart-secondary-btn {
    border-color: rgba(0, 0, 0, 0.14);

    background: rgba(0, 0, 0, 0.035);
    color: #20252a;
}

.light-theme .smart-secondary-btn:hover {
    border-color: rgba(3, 125, 156, 0.52);

    background: rgba(3, 125, 156, 0.08);

    box-shadow: 0 0 12px rgba(3, 125, 156, 0.08);
}

.light-theme .compile-check-btn {
    border-color: rgba(0, 145, 120, 0.32);

    color: #176451;
}

.light-theme .compile-check-btn:hover {
    border-color: rgba(0, 145, 120, 0.62);

    background: rgba(0, 145, 120, 0.09);

    box-shadow: 0 0 12px rgba(0, 145, 120, 0.08);
}

.light-theme .compile-check-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.light-theme .compile-check-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

.light-theme .smart-deploy-btn {
    border-color: rgba(185, 125, 0, 0.34);

    background: rgba(255, 190, 60, 0.12);
    color: #9a6900;
}

.light-theme .smart-deploy-btn:disabled {
    opacity: 0.68;
    cursor: not-allowed;
}

.light-theme .smart-deploy-btn:not(:disabled) {
    border-color: rgba(185, 125, 0, 0.58);

    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.25), rgba(255, 145, 0, 0.12)),
        rgba(255, 195, 74, 0.10);

    color: #7a5200;
}

.light-theme .smart-deploy-btn:not(:disabled):hover {
    background:
        linear-gradient(90deg, rgba(255, 195, 74, 0.34), rgba(255, 145, 0, 0.18)),
        rgba(255, 195, 74, 0.14);

    box-shadow: 0 0 14px rgba(185, 125, 0, 0.12);
}

.light-theme .smart-deploy-btn.loading {
    opacity: 0.78;
    pointer-events: none;
}

.light-theme .smart-deploy-btn.loading i {
    animation: smartCompileSpin 1s linear infinite;
}

/* ========================= */
/* LIGHT THEME: STATUS BADGE */
/* ========================= */

.light-theme .contract-status-badge {
    border-color: rgba(232, 251, 255, 0.55);

    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(232, 251, 255, 0.08)),
        rgba(0, 0, 0, 0.26);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(255, 255, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
}

.light-theme .contract-status-badge[data-status="ready"] {
    border-color: rgba(232, 251, 255, 0.55);

    color: #ffffff;
}

.light-theme .contract-status-badge[data-status="generated"] {
    border-color: rgba(0, 255, 204, 0.42);

    background:
        linear-gradient(90deg, rgba(0, 255, 204, 0.20), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(0, 255, 204, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="valid"] {
    border-color: rgba(93, 255, 139, 0.42);

    background:
        linear-gradient(90deg, rgba(93, 255, 139, 0.20), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #ffffff;

    box-shadow:
        0 0 12px rgba(93, 255, 139, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="warning"] {
    border-color: rgba(255, 213, 106, 0.50);

    background:
        linear-gradient(90deg, rgba(255, 213, 106, 0.22), rgba(255, 255, 255, 0.10)),
        rgba(0, 0, 0, 0.24);

    color: #fff1c2;

    box-shadow:
        0 0 12px rgba(255, 213, 106, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.light-theme .contract-status-badge[data-status="error"] {
    border-color: rgba(255, 120, 120, 0.50);

    background:
        linear-gradient(90deg, rgba(255, 90, 90, 0.22), rgba(255, 255, 255, 0.08)),
        rgba(0, 0, 0, 0.24);

    color: #ffd6d6;

    box-shadow:
        0 0 12px rgba(255, 90, 90, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

@media (max-width: 1120px) {
    .smart-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 980px) {
    .smart-contracts-grid {
        grid-template-columns: 1fr;
    }

    .smart-contracts-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .smart-builder-status {
        position: relative;
        right: auto;
        bottom: auto;

        align-self: flex-start;

        margin-top: 12px;
    }

    .code-panel {
        height: auto;
        max-height: none;
    }

    .code-preview {
        min-height: 520px;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .smart-contracts-page {
        padding: 20px 12px 50px;
    }

    .smart-contracts-hero {
        min-height: auto;
        padding: 20px;
    }

    .smart-contracts-hero::before {
        opacity: 0.92;
    }

    .smart-contracts-hero h1 {
    position: relative;
    z-index: 4;

    margin: 0 0 10px;
    padding: 0;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    color: #ffffff;
    font-size: 31px;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}


    .builder-actions {
        grid-template-columns: 1fr;
    }

    .smart-primary-btn {
        grid-column: auto;
    }

    .wallet-balance-preview-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .smart-features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .smart-contracts-page {
        padding: 16px 10px 44px;
    }

    .smart-card {
        padding: 16px;
        border-radius: 16px;
    }

    .smart-contracts-hero {
        padding: 18px 16px;
        border-radius: 17px;
    }

    .smart-contracts-hero-badge {
        width: 100%;
        justify-content: center;

        padding: 10px 12px;

        white-space: normal;
    }

    .smart-contracts-hero h1 {
        font-size: 25px;
    }

    .smart-contracts-hero p {
    position: relative;
    z-index: 4;

    max-width: 520px;
    margin: 0;
    padding: 0;

    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    color: #e8fbff;
    font-size: 15px;
    line-height: 1.55;
}

    .card-header {
        min-height: 86px;
        width: calc(100% + 32px);
        margin: 0 -16px 17px;
        padding: 14px 16px;
        border-radius: 14px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .card-header span {
        font-size: 12px;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;

        padding-right: 110px;
        padding-bottom: 14px;
    }

    .contract-status-badge {
        right: 16px;
        bottom: 12px;
        left: auto;

        min-height: 26px;
        padding: 5px 11px;

        font-size: 11px;
    }

    .custom-network-dropdown {
        max-height: 235px;
    }

    .code-preview {
        min-height: 420px;
        max-height: none;
        padding: 14px;

        font-size: 12px;
        line-height: 1.5;
    }
}

/* ========================= */
/* HERO BADGE SIZE TWEAKS */
/* ========================= */

.smart-contracts-eyebrow {
    padding: 7px 14px;
    font-size: 13px;
}

.smart-contracts-hero p {
    max-width: 340px;
}

.smart-builder-status {
    right: 22px;
    gap: 9px;
    width: 148px;
    min-height: 34px;
    padding: 7px 12px;
}

.smart-builder-status-dot {
    width: 9px;
    height: 9px;
    flex-basis: 9px;
}

#smart-builder-status-text {
    font-size: 12px;
}

.smart-builder-status[data-status="generated"] #smart-builder-status-text {
    color: #5dff8b;
}

@media (max-width: 980px) {
    .smart-builder-status {
        right: auto;
    }
}


/* =========================================================
   SMART CONTRACTS — GLOBAL PAXOR WALLET INTEGRATION
   ========================================================= */

.wallet-balance-preview {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.smart-global-wallet-btn {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    padding: 9px 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    border: 1px solid rgba(6, 171, 212, 0.56);
    border-radius: 11px;

    background:
        linear-gradient(
            90deg,
            rgba(6, 171, 212, 0.22),
            rgba(0, 255, 204, 0.09)
        ),
        rgba(7, 18, 24, 0.94);

    color: #e8fbff;

    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 13px;
    font-weight: 750;

    cursor: pointer;

    box-shadow:
        0 0 14px rgba(6, 171, 212, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.smart-global-wallet-btn i {
    color: #67ddff;
    font-size: 15px;
}

.smart-global-wallet-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(6, 217, 255, 0.78);

    background:
        linear-gradient(
            90deg,
            rgba(6, 171, 212, 0.32),
            rgba(0, 255, 204, 0.13)
        ),
        rgba(7, 18, 24, 0.98);

    box-shadow:
        0 0 18px rgba(6, 171, 212, 0.17),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.smart-global-wallet-btn.connected {
    border-color: rgba(24, 200, 136, 0.58);

    background:
        linear-gradient(
            90deg,
            rgba(24, 200, 136, 0.20),
            rgba(3, 125, 156, 0.12)
        ),
        rgba(7, 18, 24, 0.96);
}

.smart-global-wallet-btn.connected i {
    color: #4df2a7;
}

.wallet-balance-preview-status {
    margin-bottom: 0;
}

.light-theme .smart-global-wallet-btn {
    border-color: rgba(3, 125, 156, 0.42);
    background: rgba(3, 125, 156, 0.08);
    color: #17323d;
}

.light-theme .smart-global-wallet-btn.connected {
    border-color: rgba(24, 160, 112, 0.46);
    background: rgba(24, 160, 112, 0.08);
}

@media (max-width: 520px) {
    .smart-global-wallet-btn {
        min-height: 44px;
        font-size: 12.5px;
    }
}


/* =========================================================
   SMART CONTRACTS COMPACT STICKY HEADER V1
   ========================================================= */

.smart-contracts-page
.smart-contracts-hero.smart-contracts-compact-header {

    position: sticky !important;

    /*
     * Сразу под верхним глобальным меню Paxor.
     */
    top: var(--paxor-right-panel-top, 62px) !important;

    z-index: 1200 !important;

    width: 100% !important;

    min-height: 46px !important;
    height: 46px !important;

    margin: 0 0 14px 0 !important;
    padding: 0 14px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;

    overflow: visible !important;

    box-sizing: border-box !important;

    border: 1px solid rgba(32, 217, 255, .18) !important;
    border-radius: 10px !important;

    background:
        linear-gradient(
            90deg,
            rgba(5, 37, 48, .98),
            rgba(6, 24, 31, .98)
        ) !important;

    box-shadow:
        0 4px 15px rgba(0, 0, 0, .26),
        inset 0 1px 0 rgba(255, 255, 255, .04)
        !important;

    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}


/*
 * Полностью убираем старую картинку hero.
 */
.smart-contracts-page
.smart-contracts-compact-header::before,
.smart-contracts-page
.smart-contracts-compact-header::after {

    content: none !important;
    display: none !important;
}


/*
 * Только название.
 */
.smart-contracts-page
.smart-contracts-compact-header h1 {

    position: static !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #ffffff !important;

    font-size: 17px !important;
    font-weight: 700 !important;

    line-height: 1 !important;

    letter-spacing: .01em !important;

    text-align: left !important;

    border: 0 !important;
    background: transparent !important;

    box-shadow: none !important;
    text-shadow: none !important;
}


/*
 * На случай старых элементов hero —
 * они больше не должны занимать место.
 */
.smart-contracts-page
.smart-contracts-compact-header
.smart-contracts-hero-text,

.smart-contracts-page
.smart-contracts-compact-header
.smart-contracts-eyebrow,

.smart-contracts-page
.smart-contracts-compact-header
.smart-contracts-hero-badge,

.smart-contracts-page
.smart-contracts-compact-header
.smart-builder-status,

.smart-contracts-page
.smart-contracts-compact-header p {

    display: none !important;
}


/* MOBILE */

@media (max-width: 760px) {

    .smart-contracts-page
    .smart-contracts-hero.smart-contracts-compact-header {

        min-height: 42px !important;
        height: 42px !important;

        padding: 0 12px !important;

        margin-bottom: 10px !important;

        border-radius: 8px !important;
    }


    .smart-contracts-page
    .smart-contracts-compact-header h1 {

        font-size: 16px !important;
    }

}

/* =========================================================
   SMART CONTRACTS COMPACT STICKY HEADER V1 END
   ========================================================= */


/* =========================================================
   SMART CONTRACTS MOBILE HEADER REFINEMENT V2
   ========================================================= */

@media (max-width:760px) {

    /* -----------------------------------------------------
       Убираем зазор сверху страницы
       ----------------------------------------------------- */

    html body .smart-contracts-page {

        padding-top:0 !important;
        margin-top:0 !important;
    }


    /* -----------------------------------------------------
       ВЕРХНЯЯ ШАПКА "Смарт-контракти"
       ----------------------------------------------------- */

    html body
    .smart-contracts-page
    .smart-contracts-hero.smart-contracts-compact-header {

        position:sticky !important;

        top:var(--paxor-right-panel-top, 62px) !important;

        z-index:1200 !important;

        width:calc(100% + 20px) !important;

        min-height:42px !important;
        height:42px !important;

        margin:
            0
            -10px
            12px
            -10px
            !important;

        padding:0 14px !important;

        display:flex !important;

        align-items:center !important;
        justify-content:center !important;

        box-sizing:border-box !important;

        /*
         * Рамка ближе по стилю
         * к нижнему блоку.
         */
        border:
            2px solid rgba(0, 204, 255, .50)
            !important;

        border-radius:
            0 0 13px 13px
            !important;

        background:
            linear-gradient(
                180deg,
                rgba(10, 54, 67, .97),
                rgba(5, 32, 42, .98)
            )
            !important;

        box-shadow:
            0 5px 16px rgba(0,0,0,.34),
            inset 0 1px 0 rgba(255,255,255,.06),
            0 0 12px rgba(0,204,255,.08)
            !important;

        backdrop-filter:blur(12px) !important;
        -webkit-backdrop-filter:blur(12px) !important;
    }


    html body
    .smart-contracts-page
    .smart-contracts-compact-header h1 {

        margin:0 !important;
        padding:0 !important;

        font-size:18px !important;
        font-weight:700 !important;

        line-height:1 !important;

        text-align:center !important;

        color:#fff !important;
    }


    /* -----------------------------------------------------
       НИЖНЯЯ ШАПКА
       "Налаштування контракту"
       ----------------------------------------------------- */

    html body
    .smart-contracts-page
    .builder-panel
    .card-header {

        min-height:0 !important;
        height:auto !important;

        /*
         * Было значительно выше.
         */
        padding:
            10px 14px
            9px
            14px
            !important;

        margin:
            0
            -16px
            14px
            -16px
            !important;

        display:flex !important;

        flex-direction:column !important;
        align-items:flex-start !important;
        justify-content:center !important;

        gap:4px !important;

        box-sizing:border-box !important;

        border-radius:14px !important;
    }


    /*
     * Заголовок.
     * Размер уменьшаем, чтобы две строки
     * занимали меньше высоты.
     */
    html body
    .smart-contracts-page
    .builder-panel
    .card-header h2 {

        margin:0 !important;
        padding:0 !important;

        font-size:24px !important;
        font-weight:700 !important;

        line-height:1.12 !important;

        white-space:normal !important;

        overflow:visible !important;
    }


    /*
     * Подпись под заголовком.
     */
    html body
    .smart-contracts-page
    .builder-panel
    .card-header span {

        display:block !important;

        margin:0 !important;
        padding:0 !important;

        font-size:14px !important;

        line-height:1.25 !important;

        white-space:normal !important;

        overflow:visible !important;
    }

}

/* =========================================================
   SMART CONTRACTS MOBILE HEADER REFINEMENT V2 END
   ========================================================= */


/* =========================================================
   SMART CONTRACTS MOBILE HEADER POSITION V3
   ========================================================= */

@media (max-width:760px) {

    html body
    .smart-contracts-page
    .smart-contracts-hero.smart-contracts-compact-header {

        /*
         * Чуть выше.
         * Было top: 62px
         */
        top:58px !important;

        /*
         * Закругляем и верх, и низ одинаково.
         */
        border-radius:13px !important;
    }

}

/* =========================================================
   SMART CONTRACTS MOBILE HEADER POSITION V3 END
   ========================================================= */


/* === SMART CONTRACTS MOBILE HEADER FLUSH V4 START === */

@media (max-width:760px) {

    html body
    .smart-contracts-page
    .smart-contracts-hero.smart-contracts-compact-header {

        /* фиксируется прямо под горизонтальным меню */
        top:58px !important;

        /* убираем оставшийся верхний промежуток */
        margin-top:-10px !important;

        /* все углы закруглены */
        border-radius:13px !important;
    }

}

/* === SMART CONTRACTS MOBILE HEADER FLUSH V4 END === */


/* === SMART CONTRACTS MOBILE HEADER ICON V1 === */
@media (max-width:760px) {

    html body
    .smart-contracts-page
    .smart-contracts-hero h1 {
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        gap:9px !important;
    }

    html body
    .smart-contracts-page
    .smart-contracts-hero h1::before {
        content:"\f121" !important;

        display:inline-block !important;

        font-family:"Font Awesome 6 Free" !important;
        font-weight:900 !important;
        font-size:16px !important;
        line-height:1 !important;

        color:#ffffff !important;
    }
}
/* === SMART CONTRACTS MOBILE HEADER ICON V1 END === */

/* Donation fields are visible only for the Donation template */
.donation-setting[hidden] {
    display: none !important;
}

/* =========================================================
   PAXOR CONTRACT DEPLOY CONFIRMATION MODAL
   ========================================================= */

.smart-deploy-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 86px 18px 116px;

    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);

    box-sizing: border-box;
}

@supports (height: 100dvh) {
    .smart-deploy-modal {
        min-height: 100dvh;
    }
}

.smart-deploy-modal.show {
    display: flex;
}

.smart-deploy-modal-card {
    position: relative;

    width: min(100%, 540px);
    max-height: calc(100vh - 202px);
    overflow-y: auto;

    padding: 22px;

    border: 1px solid rgba(6, 171, 212, 0.44);
    border-radius: 18px;

    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
        linear-gradient(180deg, rgba(6, 171, 212, 0.14), rgba(0, 0, 0, 0.10)),
        rgba(15, 18, 22, 0.98);

    color: #ffffff;

    box-shadow:
        0 0 24px rgba(6, 171, 212, 0.22),
        0 18px 50px rgba(0, 0, 0, 0.58),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    box-sizing: border-box;
}

.smart-deploy-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;

    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;

    cursor: pointer;
}

.smart-deploy-modal-close:hover {
    border-color: rgba(6, 217, 255, 0.68);
    background: rgba(6, 171, 212, 0.18);
}

.smart-deploy-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 18px;
    padding-right: 36px;

    text-align: left;
}

.smart-deploy-modal-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(6, 171, 212, 0.50);
    border-radius: 50%;

    background: rgba(6, 171, 212, 0.15);
    color: #00ccff;

    font-size: 20px;
}

.smart-deploy-modal-header h2 {
    margin: 0 0 5px;
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.15;
}

.smart-deploy-modal-header p {
    margin: 0;
    color: #cfefff;
    font-size: 13px;
    line-height: 1.4;
}

.smart-deploy-details {
    margin: 4px 0 16px;
    padding: 4px 14px;

    border: 1px solid rgba(6, 171, 212, 0.24);
    border-radius: 14px;

    background: rgba(5, 12, 17, 0.62);
}

.smart-deploy-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    min-height: 48px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.smart-deploy-detail-row:last-child {
    border-bottom: 0;
}

.smart-deploy-detail-row span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
}

.smart-deploy-detail-row strong {
    min-width: 0;

    color: #ffffff;
    font-size: 13px;
    font-weight: 800;

    text-align: right;
    overflow-wrap: anywhere;
}

#smart-deploy-gas {
    color: #00d9ff;
}

.smart-deploy-modal-warning {
    display: flex;
    align-items: flex-start;
    gap: 9px;

    margin: 4px 0 18px;
    padding: 10px 12px;

    border: 1px solid rgba(255, 195, 74, 0.28);
    border-radius: 12px;

    background: rgba(255, 195, 74, 0.08);
    color: #ffd56a;

    font-size: 12px;
    line-height: 1.4;
    text-align: left;
}

.smart-deploy-modal-warning i {
    margin-top: 2px;
}

.smart-deploy-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 14px;
}

.smart-deploy-modal-primary,
.smart-deploy-modal-secondary {
    min-height: 40px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 11px;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;
}

.smart-deploy-modal-primary {
    border: 1px solid rgba(6, 171, 212, 0.62);

    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.26), rgba(0, 255, 204, 0.11)),
        rgba(6, 171, 212, 0.14);

    color: #ffffff;
}

.smart-deploy-modal-primary:hover {
    border-color: rgba(6, 217, 255, 0.78);
    background:
        linear-gradient(90deg, rgba(6, 171, 212, 0.36), rgba(0, 255, 204, 0.16)),
        rgba(6, 171, 212, 0.18);
}

.smart-deploy-modal-secondary {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.smart-deploy-modal-secondary:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.10);
}

@media (max-width: 640px) {
    .smart-deploy-modal {
        padding: 76px 14px 108px;
    }

    .smart-deploy-modal-card {
        padding: 18px;
    }

    .smart-deploy-detail-row {
        gap: 12px;
    }

    .smart-deploy-modal-actions {
        flex-direction: column;
    }

    .smart-deploy-modal-primary,
    .smart-deploy-modal-secondary {
        width: 100%;
    }
}


/* ==================================================
   DEPLOYMENT RESULT
   ================================================== */

.smart-deployment-result[hidden] {
    display: none !important;
}

.smart-deployment-result {
    margin-top: 24px;
    margin-bottom: 28px;
}

.smart-deployment-result-card {
    padding: 24px;

    border: 1px solid rgba(0, 217, 255, 0.24);
    border-radius: 18px;

    background:
        radial-gradient(
            circle at top left,
            rgba(0, 217, 255, 0.10),
            transparent 42%
        ),
        rgba(8, 13, 22, 0.92);
}

.smart-deployment-result-header {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 22px;
}

.smart-deployment-result-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0, 255, 204, 0.30);
    border-radius: 14px;

    background: rgba(0, 255, 204, 0.08);
    color: #00ffcc;

    font-size: 21px;
}

.smart-deployment-result-header h2 {
    margin: 0 0 4px;

    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
}

.smart-deployment-result-header p {
    margin: 0;

    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    line-height: 1.45;
}

.smart-deployment-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.smart-deployment-result-item {
    min-width: 0;
    padding: 14px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;

    background: rgba(255, 255, 255, 0.035);
}

.smart-deployment-result-wide {
    grid-column: 1 / -1;
}

.smart-deployment-result-item > span {
    display: block;

    margin-bottom: 7px;

    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.smart-deployment-result-item strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.smart-deployment-result-value {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
}

.smart-deployment-result-value code {
    min-width: 0;
    flex: 1;

    color: #00d9ff;
    font-family: monospace;
    font-size: 13px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-result-icon-button {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;

    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.78);

    cursor: pointer;
}

.smart-result-icon-button:hover {
    border-color: rgba(0, 217, 255, 0.42);
    background: rgba(0, 217, 255, 0.09);
    color: #00d9ff;
}

.smart-deployment-result-actions {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-top: 18px;
}

.smart-result-primary-button,
.smart-result-secondary-button {
    min-height: 42px;
    padding: 0 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 11px;

    font-size: 13px;
    font-weight: 800;
    text-decoration: none;

    cursor: pointer;
}

.smart-result-primary-button {
    border: 1px solid rgba(6, 171, 212, 0.62);

    background:
        linear-gradient(
            90deg,
            rgba(6, 171, 212, 0.26),
            rgba(0, 255, 204, 0.11)
        ),
        rgba(6, 171, 212, 0.14);

    color: #ffffff;
}

.smart-result-primary-button:hover {
    border-color: rgba(6, 217, 255, 0.78);
    color: #ffffff;
}

.smart-result-secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.smart-result-secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.26);
    background: rgba(255, 255, 255, 0.09);
}

@media (max-width: 640px) {
    .smart-deployment-result {
        margin-top: 18px;
    }

    .smart-deployment-result-card {
        padding: 17px;
    }

    .smart-deployment-result-header {
        align-items: flex-start;
    }

    .smart-deployment-result-grid {
        grid-template-columns: 1fr;
    }

    .smart-deployment-result-wide {
        grid-column: auto;
    }

    .smart-deployment-result-value code {
        font-size: 11px;
    }

    .smart-deployment-result-actions {
        flex-direction: column;
    }

    .smart-result-primary-button,
    .smart-result-secondary-button {
        width: 100%;
    }
}


/* ==================================================
   MY CONTRACTS
   ================================================== */

.smart-my-contracts[hidden] {
    display: none !important;
}

.smart-my-contracts {
    margin-top: 24px;
    margin-bottom: 28px;
}

.smart-my-contracts-card {
    padding: 24px;

    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 18px;

    background: rgba(8, 13, 22, 0.92);
}

.smart-my-contracts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}

.smart-my-contracts-header h2 {
    margin: 0 0 4px;

    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
}

.smart-my-contracts-header p {
    margin: 0;

    color: rgba(255, 255, 255, 0.58);
    font-size: 13px;
}

.smart-my-contracts-count {
    min-width: 38px;
    height: 38px;
    padding: 0 11px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 11px;

    background: rgba(0, 217, 255, 0.08);
    color: #00d9ff;

    font-size: 13px;
    font-weight: 800;
}

.smart-my-contracts-list {
    display: grid;
    gap: 10px;
}

.smart-my-contract-item {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(130px, 0.65fr) minmax(220px, 1.6fr) auto;
    align-items: center;
    gap: 16px;

    min-width: 0;
    padding: 14px 15px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;

    background: rgba(255, 255, 255, 0.035);
}

.smart-my-contract-item:hover {
    border-color: rgba(0, 217, 255, 0.22);
    background: rgba(0, 217, 255, 0.045);
}

.smart-my-contract-main,
.smart-my-contract-network,
.smart-my-contract-address {
    min-width: 0;
}

.smart-my-contract-name {
    display: block;

    margin-bottom: 4px;

    color: #ffffff;
    font-size: 14px;
    font-weight: 800;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-my-contract-date {
    display: block;

    color: rgba(255, 255, 255, 0.44);
    font-size: 11px;
}

.smart-my-contract-label {
    display: block;

    margin-bottom: 5px;

    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.smart-my-contract-network strong {
    color: rgba(255, 255, 255, 0.86);
    font-size: 12px;
    font-weight: 700;
}

.smart-my-contract-address code {
    display: block;

    color: #00d9ff;
    font-family: monospace;
    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-my-contract-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.smart-my-contract-manage {
    min-height: 36px;
    padding: 0 13px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid rgba(6, 171, 212, 0.46);
    border-radius: 10px;

    background: rgba(6, 171, 212, 0.10);
    color: #ffffff;

    font-size: 12px;
    font-weight: 800;

    cursor: pointer;
}

.smart-my-contract-manage:hover {
    border-color: rgba(0, 217, 255, 0.72);
    background: rgba(0, 217, 255, 0.14);
}

@media (max-width: 800px) {
    .smart-my-contract-item {
        grid-template-columns: 1fr 1fr;
    }

    .smart-my-contract-address {
        grid-column: 1 / -1;
    }

    .smart-my-contract-actions {
        grid-column: 1 / -1;
    }

    .smart-my-contract-manage {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .smart-my-contracts {
        margin-top: 18px;
    }

    .smart-my-contracts-card {
        padding: 17px;
    }

    .smart-my-contract-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .smart-my-contract-address,
    .smart-my-contract-actions {
        grid-column: auto;
    }
}


/* ==================================================
   CONTRACT MANAGEMENT
   ================================================== */

.smart-contract-management[hidden] {
    display: none !important;
}

.smart-contract-management {
    margin-top: 24px;
    margin-bottom: 28px;
}

.smart-contract-management-card {
    padding: 24px;

    border: 1px solid rgba(0, 217, 255, 0.16);
    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            rgba(0, 217, 255, 0.035),
            transparent 42%
        ),
        rgba(8, 13, 22, 0.94);
}

.smart-contract-management-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 18px;
}

.smart-contract-management-eyebrow {
    display: block;

    margin-bottom: 7px;

    color: #00d9ff;
    font-size: 10px;
    font-weight: 800;

    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.smart-contract-management-header h2 {
    margin: 0 0 5px;

    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
}

.smart-contract-management-header p {
    margin: 0;

    color: rgba(255, 255, 255, 0.56);
    font-size: 13px;
}

.smart-management-close {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.70);

    cursor: pointer;
}

.smart-management-close:hover {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.smart-contract-management-address {
    min-width: 0;
    margin-bottom: 20px;
    padding: 13px 15px;

    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.03);
}

.smart-contract-management-address span {
    display: block;

    margin-bottom: 6px;

    color: rgba(255, 255, 255, 0.42);
    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.smart-contract-management-address code {
    display: block;

    color: #00d9ff;
    font-family: monospace;
    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-management-section {
    margin-top: 14px;
    padding: 17px;

    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;

    background: rgba(0, 0, 0, 0.14);
}

.smart-management-section[hidden] {
    display: none !important;
}

.smart-management-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    margin-bottom: 15px;
}

.smart-management-section-header h3 {
    margin: 0 0 4px;

    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
}

.smart-management-section-header p {
    margin: 0;

    color: rgba(255, 255, 255, 0.48);
    font-size: 11px;
}

.smart-management-refresh {
    min-height: 34px;
    padding: 0 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: 9px;

    background: rgba(0, 217, 255, 0.07);
    color: #ffffff;

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.smart-management-refresh:hover {
    border-color: rgba(0, 217, 255, 0.58);
    background: rgba(0, 217, 255, 0.12);
}

.smart-management-refresh:disabled {
    opacity: 0.55;
    cursor: wait;
}

.smart-management-refresh.is-loading i {
    animation: smart-management-spin 0.8s linear infinite;
}

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

.smart-management-read-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.smart-management-data-item {
    min-width: 0;
    padding: 13px;

    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 11px;

    background: rgba(255, 255, 255, 0.03);
}

.smart-management-data-label {
    display: block;

    margin-bottom: 6px;

    color: rgba(255, 255, 255, 0.43);
    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.smart-management-data-value {
    display: block;

    color: #ffffff;
    font-size: 13px;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.smart-management-data-value.is-accent {
    color: #00d9ff;
}

.smart-management-write-content {
    display: grid;
    gap: 12px;
}

@media (max-width: 800px) {
    .smart-management-read-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .smart-contract-management {
        margin-top: 18px;
    }

    .smart-contract-management-card {
        padding: 17px;
    }

    .smart-contract-management-header h2 {
        font-size: 18px;
    }

    .smart-management-section {
        padding: 14px;
    }

    .smart-management-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .smart-management-refresh {
        width: 100%;
    }

    .smart-management-read-grid {
        grid-template-columns: 1fr;
    }

    .smart-contract-management-address code {
        font-size: 11px;
    }
}
