/* ===== BINDER POPUP ===== */
.binder-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: 300;
}

.binder-popup-overlay.open {
    display: flex;
}

.binder-popup {
    width: 420px;
    max-width: 92vw;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #11141c;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
    animation: popupFade 0.18s ease;
}

@keyframes popupFade {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.binder-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.binder-popup-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.close-popup-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    transition: 0.18s ease;
}

.close-popup-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.binder-popup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    overflow-y: auto;
}

.binder-popup-list::-webkit-scrollbar {
    width: 6px;
}

.binder-popup-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
}

.binder-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: white;
    cursor: pointer;
    transition: 0.18s ease;
}

.binder-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.binder-item.active {
    background: rgba(95, 98, 255, 0.12);
    border: 1px solid rgba(95, 98, 255, 0.25);
}

.binder-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.binder-item-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.binder-item-name {
    font-size: 13px;
    font-weight: 600;
}

.binder-item-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    opacity: 0.85;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.binder-item.active .binder-item-badge {
    background: rgba(95, 98, 255, 0.18);
    border-color: rgba(95, 98, 255, 0.25);
    color: #ffffff;
}

/* ===== MANUAL POPUP ===== */
.manual-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 500;
}

.manual-popup-overlay.open {
    display: flex;
}

.manual-popup {
    width: 720px;
    max-width: 94vw;
    max-height: 88vh;
    overflow-y: auto;
    padding: 20px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(19, 23, 34, 0.98) 0%, rgba(14, 18, 28, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    animation: popupFade 0.18s ease;
}

.manual-popup::-webkit-scrollbar {
    width: 6px;
}

.manual-popup::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.manual-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.manual-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.manual-subtitle {
    flex: 1;
    min-width: 0;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.close-manual-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    cursor: pointer;
    transition: 0.18s ease;
    flex-shrink: 0;
}

.close-manual-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.04);
}

.manual-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.manual-section {
    position: relative;
    padding: 14px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.03),
        0 8px 24px rgba(0, 0, 0, 0.12);
}

.manual-section h4 {
    margin-bottom: 12px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.46);
}

.manual-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manual-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: 0.18s ease;
}

.manual-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.manual-row span {
    min-width: 34px;
    height: 34px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #e7ecf8;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.manual-row p {
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.84);
    margin: 0;
}

.manual-note {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding: 13px 14px;
    border-radius: 16px;
    background: rgba(95, 98, 255, 0.08);
    border: 1px solid rgba(95, 98, 255, 0.14);
    font-size: 12px;
    font-weight: 500;
    color: rgba(226, 230, 255, 0.82);
}

@media (max-width: 760px) {
    .manual-popup {
        width: 94vw;
        max-height: 82vh;
        padding: 18px;
    }

    .manual-content {
        grid-template-columns: 1fr;
    }

    .manual-note {
        grid-column: auto;
    }

    .manual-header h3 {
        font-size: 18px;
    }
}

/* ===== APP MODAL ===== */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
}

.app-modal-overlay.open {
    display: flex;
}

.app-modal {
    width: 380px;
    max-width: 92vw;
    background: #11141c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    animation: appModalFade 0.18s ease;
}

@keyframes appModalFade {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.app-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.app-modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    transition: 0.18s ease;
}

.app-modal-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.app-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#appModalMessage {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.45;
}

.app-modal-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: white;
    font-size: 14px;
    outline: none;
    transition: 0.18s ease;
}

.app-modal-input:focus {
    border-color: rgba(95, 98, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 18px 18px;
}

.app-modal-btn {
    min-width: 88px;
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.18s ease;
}

.app-modal-btn.primary {
    background: #5f62ff;
    color: white;
}

.app-modal-btn.primary:hover {
    filter: brightness(1.08);
}

/* ===== CARD VIEWER ===== */
.card-viewer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
}

.card-viewer-panel {
    width: 680px;
    align-items: stretch;
    max-width: 94vw;
    max-height: 88vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    padding: 18px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(19, 23, 34, 0.98) 0%, rgba(14, 18, 28, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    animation: popupFade 0.18s ease;
}

.card-viewer-panel::-webkit-scrollbar {
    width: 6px;
}

.card-viewer-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
}

.card-viewer-left {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    padding-top: 40px;
}

.card-viewer-left img {
    width: 100%;
    max-width: 200px;
    display: block;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card-viewer-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-viewer-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.card-viewer-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
    transition: 0.18s ease;
    flex-shrink: 0;
}

.card-viewer-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.card-viewer-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.viewer-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
}

.viewer-textarea,
.viewer-input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: 0.18s ease;
}

.viewer-textarea:focus,
.viewer-input:focus {
    border-color: rgba(95, 98, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.viewer-textarea {
    min-height: 140px;
    resize: vertical;
    padding: 12px 14px;
    font-family: "Inter", sans-serif;
    line-height: 1.45;
}

.viewer-input {
    height: 42px;
    padding: 0 12px;
}

.card-viewer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.viewer-btn {
    min-width: 96px;
    height: 38px;
    padding: 0 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: 0.18s ease;
}

.viewer-btn.danger {
    background: rgba(255, 90, 90, 0.14);
    color: #ff8e8e;
    border: 1px solid rgba(255, 90, 90, 0.14);
}

.viewer-btn.danger:hover {
    background: rgba(255, 90, 90, 0.2);
}

.viewer-btn.primary {
    background: #5f62ff;
    color: white;
}

.viewer-btn.primary:hover {
    filter: brightness(1.08);
}

.viewer-price-input {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    gap: 3px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    transition: 0.18s ease;
}

.viewer-price-input:focus-within {
    border-color: rgba(95, 98, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.viewer-price-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    background-image: url("../assets/icons/token.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(1px);
}

.viewer-price-input .viewer-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #fff;
}

.viewer-price-input:has(input:placeholder-shown) .viewer-price-icon {
    opacity: 0.5;
}

/* ===== VIEWER META ===== */
.viewer-meta-top {
    position: absolute;
    top: 2px;
    left: 15px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
    letter-spacing: 0.01em;
    pointer-events: none;
    z-index: 3;
    opacity: 0.6;
}

.viewer-meta-top span {
    opacity: 0.8;
}

@media (max-width: 760px) {
    .card-viewer-panel {
        grid-template-columns: 1fr;
        width: 94vw;
        padding: 16px;
    }

    .card-viewer-left {
        justify-content: center;
    }

    .card-viewer-left img {
        max-width: 240px;
    }

    .viewer-textarea {
        min-height: 130px;
    }
}

/* ===== DISCORD ===== */
.discord-icon {
    width: 20px;
    height: 20px;
    display: block;
}

#discordBtn:hover {
    color: #5865F2;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    padding: 5px 10px;
    border-radius: 8px;
    background: rgba(39, 39, 39, 0.116);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 7px rgba(12, 12, 12, 0.836);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    color: #f3f5f7;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    gap: 4px;
    animation: toastIn 0.18s ease;
}

.toast.hide {
    animation: toastOut 0.18s ease forwards;
}

.toast-icon {
    width: 13px;
    height: 13px;
    color: #22c55e;
}

.toast.success .toast-icon {
    color: #22c55e;
}

.toast.error .toast-icon {
    color: #ff5a5a;
}

.toast.info .toast-icon {
    color: #5f62ff;
}

/* ===== EXPORT POPUP ===== */
/* .export-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
}

.export-popup-overlay.open {
    display: flex;
}

.export-popup {
    width: min(820px, 95vw);
    max-height: 88vh;
    overflow: hidden;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(19, 23, 34, 0.98) 0%, rgba(14, 18, 28, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
}

.export-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.export-popup-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.export-popup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-popup-btn,
.export-popup-close {
    height: 34px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.18s ease;
    font-weight: 700;
}

.export-popup-btn {
    padding: 0 13px;
    background: #5f62ff;
    color: white;
}

.export-popup-btn:hover {
    filter: brightness(1.08);
}

.export-popup-close {
    width: 34px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.export-popup-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.export-popup-body {
    flex: 1;
    padding: 32px; /* was 18px */
    /* overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-binder-preview {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* IMPORTANT */
/* }

.export-capture-area {
    width: 1038px;
    height: 545px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transform-origin: center center;
}

.export-mini-binder-wrap {
    position: relative;
    transform-origin: center center;
    transform: scale(0.84);
}

.export-mini-binder {
    display: flex;
    gap: 22px;
    padding: 16px;
    background: linear-gradient(180deg, #121520 0%, #0d1018 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.export-mini-page {
    display: grid;
    grid-template-columns: repeat(4, 136px);
    grid-template-rows: repeat(3, 188px);
    gap: 7px;
    padding: 10px;
    background: #0b0d15;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.export-mini-slot {
    width: 136px;
    height: 188px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.export-mini-slot::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    opacity: 0.9;
}

.export-mini-slot::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 10px;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.export-mini-slot img {
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    object-fit: cover;
    border-radius: 10px;
    position: absolute;
    top: 5px;
    left: 5px;
    display: block;
    z-index: 1;
}

.export-mini-empty {
    width: 100%;
    height: 100%;
}

.export-mini-price {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(39, 39, 39, 0.699);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgb(0, 0, 0);
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    color: #f3f5f7;
    white-space: nowrap;
    max-width: calc(100% - 12px);
}

.export-mini-price-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 35% 35%, #ffffff 0%, #d9dde8 18%, #9ea7b8 38%, #6d7583 62%, #434a56 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        inset 0 1px 1px rgba(255, 255, 255, 0.28),
        0 1px 3px rgba(0, 0, 0, 0.35);
}

.export-mini-price span:last-child {
    display: inline-block;
    line-height: 1;
}

.export-empty-state {
    min-width: 240px;
    padding: 24px 18px;
    border-radius: 14px;
    text-align: center;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 600;
}   */

/* ===== ANIMATIONS ===== */
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(6px);
    }
}