/* Tairuma | Premium Nature UI v3.0 — Complete Overhaul */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700&display=swap');

/* ===========================
   RESET & BASE
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top left, #f1f8e9 0%, #fdfbf7 50%, #e8f5e9 100%);
    background-attachment: fixed;
    color: var(--earth-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--forest-deep);
}

::selection {
    background: rgba(94, 188, 103, 0.3);
    color: var(--forest-deep);
}

/* ===========================
   TOAST NOTIFICATION SYSTEM
   =========================== */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: all;
    animation: toastSlideIn 0.4s var(--ease-out-expo) forwards;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toastTimer 3s linear forwards;
    border-radius: 0 0 16px 16px;
}

.toast.success {
    background: rgba(232, 245, 233, 0.95);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.toast.error {
    background: rgba(255, 235, 238, 0.95);
    color: #c62828;
    border: 1px solid rgba(229, 57, 53, 0.3);
}

.toast.warning {
    background: rgba(255, 243, 224, 0.95);
    color: #e65100;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.toast.info {
    background: rgba(227, 242, 253, 0.95);
    color: #1565c0;
    border: 1px solid rgba(41, 182, 246, 0.3);
}

.toast .toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.toast .toast-msg {
    flex: 1;
    line-height: 1.3;
}

.toast .toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    transition: opacity 0.2s;
}

.toast .toast-close:hover {
    opacity: 1;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

@keyframes toastTimer {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* ===========================
   OFFLINE BANNER
   =========================== */
#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(135deg, var(--error), #d32f2f);
    color: white;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.4s var(--ease-out-expo);
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

#offline-banner.visible {
    transform: translateY(0);
}

/* ===========================
   SKELETON LOADING STATES
   =========================== */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.04) 25%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-text.large {
    height: 40px;
    width: 60%;
    margin: 10px auto;
}

.skeleton-text.medium {
    height: 20px;
    width: 40%;
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-md);
    margin-bottom: 15px;
}

/* ===========================
   HEADER
   =========================== */
.mobile-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(253, 251, 247, 0.97), rgba(253, 251, 247, 0));
    transition: background 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 90px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.05));
    transition: transform 0.5s var(--ease-out-expo);
}

.header-logo:active {
    transform: scale(0.9);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    position: relative;
    transition: var(--transition);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success), 0 0 20px rgba(76, 175, 80, 0.2);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.offline {
    background: var(--error);
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.4);
}

@keyframes pulse-dot {

    0%,
    100% {
        box-shadow: 0 0 8px var(--success), 0 0 20px rgba(76, 175, 80, 0.2);
    }

    50% {
        box-shadow: 0 0 12px var(--success), 0 0 30px rgba(76, 175, 80, 0.3);
    }
}

/* ===========================
   AVATARS
   =========================== */
.numa-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s var(--ease-out-expo);
}

.numa-avatar.small {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.numa-avatar.large {
    width: 100px;
    height: 100px;
    font-size: 3rem;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ===========================
   MAIN SCROLL AREA
   =========================== */
.app-content {
    flex: 1;
    margin-top: var(--header-height);
    padding-bottom: calc(var(--dock-height) + 40px);
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 0 24px;
    scrollbar-width: none;
}

.app-content::-webkit-scrollbar {
    display: none;
}

/* ===========================
   INPUTS
   =========================== */
input,
textarea,
select {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--forest-deep);
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--forest-mid);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.1), 0 0 0 3px rgba(46, 125, 50, 0.05);
}

input::placeholder,
textarea::placeholder {
    color: var(--earth-dark);
    opacity: 0.4;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--forest-deep);
    margin-bottom: 6px;
    opacity: 0.8;
}

/* ===========================
   BALANCE CARD (Hero Dashboard)
   =========================== */
.balance-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.45));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 15px 35px rgba(26, 60, 38, 0.08);
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 225, 87, 0.08) 0%, transparent 60%);
    pointer-events: none;
    animation: rotateGlow 20s linear infinite;
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.balance-card .label {
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}

.amount-row {
    font-size: 3.5rem;
    font-weight: 200;
    color: var(--forest-deep);
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 5px;
}

.amount-row small {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.7;
}

.svcdt-badge {
    background: rgba(26, 60, 38, 0.06);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(26, 60, 38, 0.08);
    transition: var(--transition);
}

/* ===========================
   QUICK ACTIONS (Grid)
   =========================== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

/* Ripple effect for buttons */
.action-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(94, 188, 103, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
}

.action-btn:active::after {
    opacity: 1;
}

.action-btn:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.06);
}

.action-btn:active {
    transform: scale(0.96);
}

.action-btn .icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s var(--transition-spring);
}

.action-btn:hover .icon {
    transform: scale(1.15);
}

.action-btn .label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--forest-deep);
}

/* ===========================
   LISTS & ITEMS
   =========================== */
.section-title {
    margin: 30px 0 15px;
    font-size: 1.2rem;
    opacity: 0.9;
    padding-left: 12px;
    border-left: 3px solid var(--accent-lime);
}

.product-card,
.referral-item,
.setting-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-card:active,
.setting-item:active {
    transform: scale(0.98);
}

/* ===========================
   FLOATING BOTTOM DOCK
   =========================== */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 68px;
    background: rgba(26, 60, 38, 0.92);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 40px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s var(--ease-out-expo);
}

.nav-item {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: var(--transition);
    width: 60px;
    position: relative;
}

.nav-item .nav-icon {
    font-size: 1.5rem;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-icon {
    transform: translateY(-10px) scale(1.2);
    filter: drop-shadow(0 0 12px rgba(212, 225, 87, 0.5));
}

.nav-item.active {
    color: white;
}

/* Active indicator dot */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-lime);
    box-shadow: 0 0 10px var(--accent-lime);
    animation: navPulse 2s ease-in-out infinite;
}

@keyframes navPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.3);
    }
}

.nav-label {
    font-size: 0.62rem;
    font-weight: 600;
    position: absolute;
    bottom: 3px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s var(--ease-out-expo);
    letter-spacing: 0.02em;
}

.nav-item.active .nav-label {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   BUTTONS
   =========================== */
.primary-btn {
    background: linear-gradient(135deg, var(--forest-mid), var(--forest-deep));
    color: white;
    padding: 18px 32px;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(46, 125, 50, 0.35);
    width: 100%;
    cursor: pointer;
    transition: all 0.25s var(--ease-out-expo);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.25);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--forest-mid);
    color: var(--forest-mid);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: 'Outfit', sans-serif;
}

.secondary-btn:hover {
    background: rgba(46, 125, 50, 0.06);
}

.secondary-btn:active {
    transform: scale(0.97);
}

.secondary-btn.small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.icon-btn {
    background: none;
    border: 1px solid rgba(46, 125, 50, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--forest-deep);
    transition: all 0.2s var(--ease-out-expo);
}

.icon-btn:active {
    transform: scale(0.85);
    background: var(--forest-mid);
    color: white;
    border-color: var(--forest-mid);
}

/* ===========================
   AUTH SCREEN
   =========================== */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 2000;
    background: radial-gradient(circle at 30% 20%, #f1f8e9, #dcedc8, #c8e6c9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.auth-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 36px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(26, 60, 38, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5);
    text-align: center;
    margin: auto;
    animation: authCardIn 0.6s var(--ease-out-expo);
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 15px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.08));
    animation: floatAuth 5s ease-in-out infinite;
}

@keyframes floatAuth {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.auth-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--forest-deep);
    margin: 0;
    line-height: 1;
}

.auth-subtitle {
    font-size: 1.1rem;
    color: var(--forest-mid);
    margin: 5px 0 25px 0;
    font-weight: 500;
    opacity: 0.8;
}

.auth-footer {
    margin-top: 15px;
}

.auth-footer a {
    color: var(--forest-mid);
    text-decoration: none;
    font-weight: 500;
}

.seed-box {
    background: rgba(26, 60, 38, 0.05);
    border: 1px dashed var(--forest-mid);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 0.95rem;
    word-break: break-all;
    line-height: 1.6;
}

.warning-box {
    background: var(--warning-light);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 12px;
    padding: 12px 15px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    color: #e65100;
}

/* ===========================
   MODALS (Universal)
   =========================== */
.modal-backdrop {
    background: rgba(20, 40, 30, 0.5);
    backdrop-filter: blur(8px);
}

.auth-screen .auth-card {
    animation: modalIn 0.35s var(--ease-out-expo);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===========================
   VIEW TRANSITIONS
   =========================== */
.app-view {
    display: none;
    opacity: 0;
}

.app-view.active {
    display: block;
    animation: viewFadeIn 0.4s var(--ease-out-expo) forwards;
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-view.active>* {
    animation: fadeInUp 0.5s var(--ease-out-expo) forwards;
    opacity: 0;
}

.app-view.active>*:nth-child(1) {
    animation-delay: 0.05s;
}

.app-view.active>*:nth-child(2) {
    animation-delay: 0.1s;
}

.app-view.active>*:nth-child(3) {
    animation-delay: 0.15s;
}

.app-view.active>*:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   BALANCE CARD WITH DETAIL
   =========================== */
.page-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

/* ===========================
   TABS
   =========================== */
.tabs-knob {
    display: flex;
    background: rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(10px);
    padding: 5px;
    border-radius: 50px;
    margin-bottom: 20px;
    justify-content: space-between;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 0;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--earth-dark);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    font-family: 'Outfit', sans-serif;
}

.tab-btn.active {
    background: white;
    color: var(--forest-deep);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===========================
   CHAT
   =========================== */
.chat-log {
    border-radius: var(--radius-sm);
}

.bosque-section {
    display: none;
}

.bosque-section.active {
    display: flex;
    flex-direction: column;
}

#bosque-chat {
    display: flex;
    flex-direction: column;
    min-height: 50vh;
}

.chat-log.full-height {
    flex: 1;
    overflow-y: auto;
    padding: 10px 5px;
    scrollbar-width: none;
}

.chat-log.full-height::-webkit-scrollbar {
    display: none;
}

.chat-input-area {
    display: flex;
    gap: 10px;
    padding: 12px 0;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    border-radius: 40px;
    padding: 14px 20px;
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--forest-mid), var(--forest-deep));
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.3);
    transition: all 0.2s var(--ease-out-expo);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:active {
    transform: scale(0.9);
}

.send-btn:disabled {
    opacity: 0.4;
}

/* --- Premium Chat Bubbles --- */
.chat-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

.chat-row.mine {
    justify-content: flex-end;
}

.chat-row.other {
    justify-content: flex-start;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 20px;
    max-width: 78%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition-fast);
}

.chat-bubble.mine {
    background: linear-gradient(135deg, var(--forest-deep), #1e4d2e);
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-bubble.other {
    background: white;
    color: var(--earth-dark);
    border-bottom-left-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.chat-avatar-container {
    align-self: flex-end;
    margin-bottom: 2px;
}

.msg-sender {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--forest-mid);
    margin-bottom: 4px;
}

.chat-bubble.mine .msg-content {
    color: white;
    line-height: 1.5;
}

.msg-content {
    line-height: 1.5;
    font-size: 0.95rem;
}

.msg-meta {
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: right;
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.msg-action {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px;
    transition: opacity 0.2s;
}

.msg-action:hover {
    opacity: 1;
}

/* ===========================
   GROUP SCROLLER
   =========================== */
.group-scroller {
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    scrollbar-width: none;
}

.group-scroller::-webkit-scrollbar {
    display: none;
}

/* ===========================
   MERCADO (Product Cards)
   =========================== */
.product-card.premium {
    display: flex;
    padding: 0;
    overflow: hidden;
    position: relative;
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease-out-expo);
}

.product-card.premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.product-image-placeholder {
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.product-title {
    font-size: 1.05rem;
    color: var(--forest-deep);
}

.product-meta {
    font-size: 0.8rem;
    color: var(--forest-mid);
    display: flex;
    gap: 10px;
    align-items: center;
}

.seller-alias {
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(46, 125, 50, 0.3);
    text-underline-offset: 2px;
}

.product-desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--forest-deep);
}

.product-price small {
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    opacity: 0.7;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge.small {
    padding: 2px 8px;
    font-size: 0.68rem;
}

/* ===========================
   GOVERNANCE
   =========================== */
.governance-card {
    background: var(--glass-surface) !important;
    backdrop-filter: var(--glass-blur) !important;
    color: var(--forest-deep) !important;
    padding: 24px !important;
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid var(--glass-border) !important;
    margin-bottom: 20px !important;
    border-radius: var(--radius-md) !important;
    position: relative;
    transition: transform 0.2s var(--ease-out-expo);
}

.governance-card:hover {
    transform: translateY(-2px);
}

.governance-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
}

/* ===========================
   REFERRALS
   =========================== */
.referrals-box {
    background: var(--glass-surface);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
}

.referral-item {
    padding: 12px 20px;
    margin-bottom: 8px;
    background: white;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

/* ===========================
   NODE TREE
   =========================== */
.node-tree-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    border-left: 4px solid var(--forest-mid);
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.node-tree-card.root-node {
    background: linear-gradient(135deg, #e8f5e9, white);
    border-left-color: var(--success);
}

.node-icon-area {
    width: 44px;
    height: 44px;
    background: rgba(46, 125, 50, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tree-icon {
    font-size: 1.6rem;
}

.tree-icon.small {
    font-size: 1.2rem;
}

.node-info {
    flex: 1;
}

.node-title {
    font-size: 1rem;
    color: var(--forest-deep);
    display: block;
    margin-bottom: 3px;
}

.node-stats {
    font-size: 0.82rem;
    color: #888;
    display: flex;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
    animation: pulse-dot 2s ease-in-out infinite;
}

/* ===========================
   PROFILE
   =========================== */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-header h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.profile-header .badge {
    background: var(--accent-lime);
    color: var(--forest-deep);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 20px;
}

.app-footer {
    text-align: center;
    padding: 20px 0;
    opacity: 0.5;
    font-size: 0.8rem;
}

/* ===========================
   QR CARD
   =========================== */
.qr-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    box-shadow: var(--shadow-soft);
}

.qr-placeholder {
    margin: 0 auto 1rem;
    display: flex;
    justify-content: center;
}

.receive-alias {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--forest-mid);
}

/* ===========================
   LANDING PAGE CLASSES
   =========================== */
.landing-actions {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--forest-mid), var(--forest-deep));
    border-radius: 40px;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(46, 125, 50, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s var(--ease-out-expo);
}

.landing-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(46, 125, 50, 0.4);
}

.landing-btn:active {
    transform: translateY(0) scale(0.98);
}

.landing-hint {
    font-size: 0.85rem;
    color: var(--earth-dark);
    opacity: 0.7;
    margin-top: 5px;
    line-height: 1.4;
}

.invite-box {
    background: #e8f5e9;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 25px 0;
    border: 1px dashed var(--forest-mid);
    text-align: center;
}

.invite-code {
    font-size: 1.5rem;
    color: var(--forest-mid);
    letter-spacing: 1px;
    margin: 10px 0;
    font-weight: 700;
}

.node-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.download-btn {
    background: var(--earth-dark);
    color: var(--sand-warm);
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(62, 59, 50, 0.3);
}

.setup-guide {
    background: white;
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-top: 15px;
    text-align: left;
    font-size: 0.9rem;
    box-shadow: var(--shadow-soft);
}

.footer-fixed {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    opacity: 0.6;
    font-size: 0.8em;
    pointer-events: none;
}

.landing-footer {
    margin-top: 40px;
    text-align: center;
    opacity: 0.6;
    font-size: 0.8rem;
    padding-bottom: 20px;
    width: 100%;
}

/* ===========================
   HINT TEXTS
   =========================== */
.hint {
    text-align: center;
    padding: 30px 20px;
    opacity: 0.5;
    font-size: 0.95rem;
    font-style: italic;
}

.helper-text small {
    font-size: 0.82rem;
    opacity: 0.6;
}

/* ===========================
   SCROLL REVEAL (Landing)
   =========================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out-expo);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===========================
   FLOATING PARTICLES (Landing)
   =========================== */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: particleFloat linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.15;
    }

    90% {
        opacity: 0.15;
    }

    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ===========================
   APP SHELL (Flex container)
   =========================== */
.app-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Sidebar logo — hidden on mobile */
.sidebar-logo {
    display: none;
}

/* ===========================
   RESPONSIVE — TABLET+ (≥768px)
   =========================== */
@media (min-width: 768px) {

    /* --- App Shell becomes horizontal --- */
    .app-shell {
        flex-direction: row;
    }

    /* --- Hide mobile header --- */
    .mobile-header {
        display: none;
    }

    /* --- Bottom nav ➜ Sidebar nav --- */
    .bottom-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        right: auto;
        width: var(--sidebar-width);
        height: 100vh;
        border-radius: 0;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px 0;
        gap: 8px;
        background: rgba(26, 60, 38, 0.95);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
        z-index: 200;
    }

    /* Show sidebar logo */
    .sidebar-logo {
        display: block;
        width: 48px;
        height: 48px;
        object-fit: contain;
        margin: 0 auto 20px;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) brightness(1.1);
    }

    /* Nav items go vertical */
    .nav-item {
        width: 100%;
        padding: 14px 0;
        flex-direction: column;
        gap: 4px;
    }

    .nav-item .nav-icon {
        font-size: 1.4rem;
    }

    .nav-item.active .nav-icon {
        transform: scale(1.2);
        filter: drop-shadow(0 0 12px rgba(212, 225, 87, 0.5));
    }

    .nav-label {
        position: static;
        font-size: 0.6rem;
        opacity: 0.5;
        transform: none;
    }

    .nav-item.active .nav-label {
        opacity: 1;
    }

    .nav-item.active::after {
        bottom: auto;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 4px;
        height: 24px;
        border-radius: 0 4px 4px 0;
    }

    /* --- Main content shifts right --- */
    .app-content {
        margin-top: 0;
        margin-left: var(--sidebar-width);
        padding: 40px 48px;
        padding-bottom: 40px;
        max-width: 900px;
        height: 100vh;
        overflow-y: auto;
    }

    /* --- Quick actions: 4 columns --- */
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    /* --- Auth card wider --- */
    .auth-card {
        max-width: 480px;
        padding: 50px;
    }

    /* --- Balance card: bigger text --- */
    .amount-row {
        font-size: 4rem;
    }

    /* --- Chat area: taller --- */
    #bosque-chat {
        min-height: 60vh;
    }

    .chat-log.full-height {
        min-height: 400px;
    }

    .chat-bubble {
        max-width: 65%;
    }

    /* --- Chat input not fixed --- */
    .chat-input-area.fixed-bottom {
        position: static;
    }

    /* --- Mercado: 2-column grid --- */
    .mercado-items.list-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    /* --- P2P network grid wider --- */
    #bosque-nodos .balance-card {
        max-width: 100%;
    }

    /* --- Profile settings: wider items --- */
    .settings-list {
        max-width: 700px;
    }

    .setting-item {
        padding: 24px;
    }

    /* --- QR card centered --- */
    .qr-card {
        max-width: 400px;
        margin: 2rem auto;
    }

    /* --- Forms wider & nicer --- */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 1.05rem;
    }

    /* --- Buttons slightly wider --- */
    .primary-btn {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    /* --- Proposal modal --- */
    #new-proposal-modal .auth-card,
    #new-item-modal .auth-card,
    #edit-msg-modal .auth-card,
    #delete-msg-modal .auth-card,
    #edit-group-modal .auth-card,
    #new-group-modal .auth-card {
        max-width: 520px;
    }

    /* --- Group explorer wider --- */
    #group-explorer-modal .auth-card {
        max-width: 600px;
        max-height: 85vh;
    }
}

/* ===========================
   RESPONSIVE — DESKTOP (≥1024px)
   =========================== */
@media (min-width: 1024px) {

    .app-content {
        max-width: 960px;
        padding: 40px 60px;
    }

    /* --- Wider sidebar --- */
    .bottom-nav {
        width: calc(var(--sidebar-width) + 10px);
    }

    .app-content {
        margin-left: calc(var(--sidebar-width) + 10px);
    }

    .sidebar-logo {
        width: 52px;
        height: 52px;
        margin-bottom: 30px;
    }

    /* --- Balance card hover effect --- */
    .balance-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 20px 50px rgba(26, 60, 38, 0.12);
    }

    /* --- Action buttons hover --- */
    .action-btn {
        padding: 30px;
    }

    .action-btn .icon {
        font-size: 2.5rem;
    }

    /* --- Chat: bigger bubbles, wider area --- */
    #bosque-chat {
        min-height: 65vh;
    }

    .chat-log.full-height {
        min-height: 500px;
    }

    .chat-bubble {
        max-width: 55%;
        padding: 14px 20px;
    }

    .msg-content {
        font-size: 1rem;
    }

    .chat-input-area input {
        padding: 16px 24px;
        font-size: 1.05rem;
    }

    .send-btn {
        width: 52px;
        height: 52px;
        font-size: 1.3rem;
    }

    /* --- Tabs: wider and padded --- */
    .tabs-knob {
        max-width: 600px;
    }

    .tab-btn {
        padding: 12px 0;
        font-size: 0.9rem;
    }

    /* --- Settings: multi-column feel --- */
    .profile-header {
        margin-bottom: 40px;
    }

    .profile-header h2 {
        font-size: 2.2rem;
    }

    .numa-avatar.large {
        width: 120px;
        height: 120px;
        font-size: 3.5rem;
    }

    /* --- Governance cards: wider --- */
    .governance-card {
        padding: 28px !important;
    }

    /* --- Product cards bigger --- */
    .product-image-placeholder {
        width: 120px;
    }

    .product-details {
        padding: 20px;
    }

    .product-title {
        font-size: 1.15rem;
    }
}

/* ===========================
   RESPONSIVE — WIDE DESKTOP (≥1400px)
   =========================== */
@media (min-width: 1400px) {
    .app-content {
        max-width: 1100px;
        padding: 50px 80px;
    }

    .mercado-items.list-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .quick-actions {
        gap: 20px;
    }

    .amount-row {
        font-size: 4.5rem;
    }
}

/* ===========================
   SAFE AREA (iOS)
   =========================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav {
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .app-content {
        padding-bottom: calc(var(--dock-height) + 40px + env(safe-area-inset-bottom));
    }
}

/* Mobile-only safe area — don't apply on desktop sidebar */
@media (min-width: 768px) {
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .bottom-nav {
            bottom: auto;
        }

        .app-content {
            padding-bottom: 40px;
        }
    }
}

/* ===========================
   BACKGROUND BLOBS (Auth)
   =========================== */
.background-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

/* ===========================
   MOBILE FIXES (≤767px)
   =========================== */
@media (max-width: 767px) {

    /* Chat input stays above bottom nav */
    .chat-input-area.fixed-bottom {
        position: fixed;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        left: 0;
        right: 0;
        padding: 10px 16px;
        background: rgba(253, 250, 245, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 150;
    }

    /* Give chat log space for the fixed input */
    #bosque-chat .chat-log.full-height {
        padding-bottom: 80px;
    }

    /* Product cards: prevent horizontal overflow */
    .product-card.premium {
        flex-direction: column;
    }

    .product-card.premium .product-image-placeholder {
        width: 100%;
        height: 80px;
    }

    .product-card.premium .product-details {
        padding: 12px;
    }

    .product-title {
        font-size: 0.95rem;
        word-break: break-word;
    }

    .product-desc {
        font-size: 0.82rem;
    }

    .product-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* QR container responsive */
    #qr-image {
        display: flex !important;
        justify-content: center;
        align-items: center;
    }

    #qr-image canvas,
    #qr-image img {
        max-width: 150px;
        height: auto;
    }

    /* Prevent body scroll when modal is open */
    .auth-screen[style*="display: flex"]~.app-shell {
        overflow: hidden;
    }

    /* Balance card text size on very small screens */
    .amount-row {
        font-size: 2.8rem;
    }

    /* Tabs: smaller text on mobile */
    .tab-btn {
        font-size: 0.78rem;
        padding: 8px 0;
    }

    /* Settings items compact */
    .setting-item {
        padding: 15px;
        overflow: hidden;
        word-break: break-word;
    }

    /* Invite section: stack vertically */
    .invite-section {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .invite-section>div {
        width: 100% !important;
    }

    /* Governance cards compact */
    .governance-card {
        padding: 16px !important;
    }

    /* Quick actions: 2 columns on small screens */
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .action-btn {
        padding: 18px 10px;
    }

    .action-btn .icon {
        font-size: 1.6rem;
    }

    .action-btn .label {
        font-size: 0.8rem;
    }

    /* Form inputs full width */
    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        box-sizing: border-box;
    }
}