@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --earth: #2C3E1F;
    --earth-mid: #3D5429;
    --field: #7A9A3C;
    --harvest: #C8962A;
    --harvest-light: #E8B84B;
    --cream: #F5F0E8;
    --cream-dark: #EDE4D4;
    --soil: #8B6914;
    --white: #FAFAF7;
    --text: #1A2410;
    --text-muted: #5A6B45;
    --danger: #C0392B;
    --success: #27AE60;
    --info: #2980B9;
    --card-shadow: 0 4px 24px rgba(44,62,31,0.10);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { font-family: 'Playfair Display', serif; }

/* ===== SCREEN MANAGEMENT ===== */
.screen { display:none !important; min-height:100vh; min-height:100dvh; }
.screen.active { display:block !important; }
.screen.active.landing { display:flex !important; }
.screen.active.auth-screen { display:flex !important; }
.panel { display:none; }
.panel.active { display:block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100% { opacity:0.4; } 50% { opacity:0.8; } }
@keyframes spin { to { transform:rotate(360deg); } }
@keyframes slideUp { from { transform:translateY(100%); } to { transform:translateY(0); } }
@keyframes blobFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(30px,-40px) scale(1.05); }
    66%      { transform: translate(-20px,20px) scale(0.97); }
}
@keyframes logoFloat {
    0%,100% { transform: translateY(0) rotate(0deg); box-shadow: 0 8px 32px rgba(200,150,42,0.35); }
    50%      { transform: translateY(-10px) rotate(2deg); box-shadow: 0 20px 48px rgba(200,150,42,0.5); }
}
@keyframes floatEmoji {
    0%,100% { transform: translateY(0) rotate(0deg); opacity: 0.18; }
    50%      { transform: translateY(-18px) rotate(8deg); opacity: 0.28; }
}
@keyframes landingIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}
@keyframes glow {
    0%,100% { box-shadow: 0 0 0 0 rgba(200,150,42,0); }
    50%      { box-shadow: 0 0 0 8px rgba(200,150,42,0.15); }
}

/* ===== LANDING ===== */
.landing {
    background: linear-gradient(160deg, #1a2710 0%, var(--earth) 40%, #1e2d14 100%);
    color: var(--cream);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

/* Animated blobs */
.landing-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}
.lb-1 {
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(122,154,60,0.22) 0%, transparent 70%);
    top: -80px; left: -80px;
    animation: blobFloat 12s ease-in-out infinite;
}
.lb-2 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(200,150,42,0.18) 0%, transparent 70%);
    bottom: -60px; right: -60px;
    animation: blobFloat 16s ease-in-out infinite reverse;
}
.lb-3 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(61,84,41,0.3) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%,-50%);
    animation: blobFloat 20s ease-in-out infinite 4s;
}

/* Floating emoji decorations */
.landing-float {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}
.lf-1 { top: 12%; left: 8%;  animation: floatEmoji 6s ease-in-out infinite; }
.lf-2 { top: 20%; right: 10%; animation: floatEmoji 8s ease-in-out infinite 1s; }
.lf-3 { bottom: 22%; left: 6%; animation: floatEmoji 7s ease-in-out infinite 2s; }
.lf-4 { bottom: 30%; right: 8%; animation: floatEmoji 9s ease-in-out infinite 0.5s; }
.lf-5 { top: 55%; left: 50%; animation: floatEmoji 10s ease-in-out infinite 3s; }

.landing-inner {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center;
    width: 100%;
}

.logo-mark {
    width: 84px; height: 84px;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 24px;
    animation: logoFloat 4s ease-in-out infinite;
}
.logo-mark svg { width: 42px; height: 42px; color: var(--earth); }
.logo-mark-anim { animation: logoFloat 4s ease-in-out infinite; }

.landing-title {
    font-size: clamp(2.6rem, 9vw, 4rem);
    font-weight: 900;
    margin-bottom: 14px;
    letter-spacing: -1.5px;
    line-height: 1;
    animation: landingIn 0.7s ease both 0.1s;
}
.landing-title .highlight {
    background: linear-gradient(90deg, var(--harvest-light), #f5c842, var(--harvest-light));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

.landing .tagline {
    font-size: 1.05rem;
    color: rgba(245,240,232,0.78);
    max-width: 300px;
    line-height: 1.6;
    margin-bottom: 24px;
    animation: landingIn 0.7s ease both 0.25s;
}

.landing-pills {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin-bottom: 32px;
    animation: landingIn 0.7s ease both 0.35s;
}
.landing-pill {
    background: rgba(245,240,232,0.09);
    border: 1px solid rgba(245,240,232,0.18);
    color: rgba(245,240,232,0.8);
    padding: 5px 13px; border-radius: 20px;
    font-size: 0.8rem; font-weight: 500;
    backdrop-filter: blur(4px);
}

.landing-ctas {
    width: 100%; max-width: 340px;
    display: flex; flex-direction: column; gap: 12px;
    margin-bottom: 44px;
    animation: landingIn 0.7s ease both 0.45s;
}
.landing-btn-primary {
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    color: var(--earth); font-weight: 700; font-size: 1rem;
    padding: 14px 24px; border-radius: 14px; border: none;
    width: 100%; cursor: pointer;
    box-shadow: 0 4px 20px rgba(200,150,42,0.4);
    transition: transform 0.15s, box-shadow 0.15s;
    animation: glow 3s ease-in-out infinite;
}
.landing-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(200,150,42,0.55); }
.landing-btn-secondary {
    background: rgba(245,240,232,0.08);
    border: 1.5px solid rgba(245,240,232,0.25);
    color: rgba(245,240,232,0.9); font-size: 1rem;
    padding: 13px 24px; border-radius: 14px;
    width: 100%; cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s, border-color 0.2s;
}
.landing-btn-secondary:hover { background: rgba(245,240,232,0.14); border-color: rgba(245,240,232,0.4); }

.landing-stats {
    display: flex; align-items: center; gap: 0;
    width: 100%; max-width: 340px;
    background: rgba(245,240,232,0.07);
    border: 1px solid rgba(245,240,232,0.12);
    border-radius: 16px; padding: 16px 0;
    backdrop-filter: blur(8px);
    animation: landingIn 0.7s ease both 0.55s;
}
.stat-item { flex: 1; text-align: center; }
.stat-divider { width: 1px; height: 36px; background: rgba(245,240,232,0.15); flex-shrink: 0; }
.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--harvest-light);
    line-height: 1;
}
.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(245,240,232,0.45);
    margin-top: 5px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    color: var(--earth);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(200,150,42,0.4); transform: translateY(-1px); }

.btn-secondary {
    background: transparent;
    color: var(--cream);
    border: 1.5px solid rgba(245,240,232,0.3);
}
.btn-secondary:hover { border-color: rgba(245,240,232,0.6); background: rgba(245,240,232,0.05); }

.btn-earth {
    background: var(--earth);
    color: var(--cream);
}
.btn-earth:hover { background: var(--earth-mid); }

.btn-outline {
    background: transparent;
    color: var(--earth);
    border: 1.5px solid var(--cream-dark);
}
.btn-outline:hover { border-color: var(--field); color: var(--field); }

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-full { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }
.btn-xs { padding: 7px 14px; font-size: 0.8rem; border-radius: 8px; }

.btn:disabled, .btn.loading {
    opacity: 0.6;
    pointer-events: none;
}
.btn.loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===== AUTH SCREENS ===== */
.auth-screen {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cream);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}
.auth-logo-icon {
    width: 44px; height: 44px;
    background: var(--earth);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.auth-logo-icon svg { width: 24px; height: 24px; color: var(--harvest-light); }
.auth-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--earth);
}
.auth-title {
    font-size: 1.6rem;
    color: var(--earth);
    margin-bottom: 8px;
    text-align: center;
}
.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
    text-align: center;
}
.auth-form {
    width: 100%;
    max-width: 400px;
}
.auth-switch {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--field);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }
.auth-link-sm {
    font-size: 0.82rem; color: var(--text-muted); cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
.auth-link-sm:hover { color: var(--field); }

/* Forgot password steps */
.forgot-step-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(139,105,20,0.1); border: 1px solid rgba(139,105,20,0.2);
    color: var(--soil); padding: 5px 14px; border-radius: 20px;
    font-size: 0.78rem; font-weight: 600; margin-bottom: 12px;
}
.forgot-step-badge.ok { background: rgba(39,174,96,0.1); border-color: rgba(39,174,96,0.2); color: var(--success); }

/* Password checklist */
.pw-checklist { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.pw-check {
    font-size: 0.78rem; color: #8B6914;
    display: flex; align-items: center; gap: 6px;
    transition: color 0.2s;
}
.pw-check::before { content: '○'; font-size: 0.7rem; color: #b0b8a8; flex-shrink: 0; }
.pw-check.ok { color: var(--success); }
.pw-check.ok::before { content: '✓'; color: var(--success); font-weight: 700; }
.pw-match-hint { font-size: 0.78rem; min-height: 16px; display: block; }
.pw-match-hint.ok { color: var(--success); }
.pw-match-hint.err { color: var(--danger); }

/* Settings divider */
.settings-divider {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-muted);
    border-top: 1px solid var(--cream-dark);
    padding-top: 20px; margin-top: 20px; margin-bottom: 14px;
}

.demo-accounts {
    margin-top: 24px;
    padding: 16px;
    background: rgba(122,154,60,0.08);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(122,154,60,0.15);
    width: 100%;
    max-width: 400px;
}
.demo-accounts h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--field);
    margin-bottom: 8px;
}
.demo-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(122,154,60,0.1);
}
.demo-account:last-child { border-bottom: none; }
.demo-account button {
    background: var(--earth);
    color: var(--cream);
    border: none;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.demo-account button:hover { background: var(--earth-mid); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--earth);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.char-counter {
    display: block;
    text-align: right;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}
.char-counter-warn { color: var(--harvest); font-weight: 600; }
.form-input, .form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    transition: border-color 0.2s;
    outline: none;
}
.form-input:focus, .form-select:focus {
    border-color: var(--field);
    box-shadow: 0 0 0 3px rgba(122,154,60,0.1);
}
.form-input.input-error, .form-select.input-error {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 3px rgba(229,57,53,0.13) !important;
    animation: shake 0.35s ease;
}
.loc-error, .image-upload-area.input-error {
    border: 1.5px solid #e53935 !important;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 0 3px rgba(229,57,53,0.13) !important;
    animation: shake 0.35s ease;
}
@keyframes shake {
    0%,100%{transform:translateX(0)}
    20%{transform:translateX(-5px)}
    40%{transform:translateX(5px)}
    60%{transform:translateX(-4px)}
    80%{transform:translateX(4px)}
}
.form-input::placeholder { color: #b0b8a0; }
textarea.form-input { resize: vertical; min-height: 100px; line-height: 1.5; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6B45' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; }

.geo-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(122,154,60,0.1);
    border: 1px solid rgba(122,154,60,0.2);
    border-radius: 8px;
    color: var(--field);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    margin-top: 8px;
}
.geo-btn:hover { background: rgba(122,154,60,0.15); }
.geo-btn svg { width: 14px; height: 14px; }
.geo-btn.active { background: rgba(39,174,96,0.1); border-color: var(--success); color: var(--success); }

/* ===== APP SHELL ===== */
.app-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--earth);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-left { display: flex; align-items: center; gap: 10px; }
.nav-logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.nav-logo-icon svg { width: 18px; height: 18px; color: var(--earth); }
.nav-logo-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--cream);
}
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-btn {
    width: 36px; height: 36px;
    background: rgba(245,240,232,0.1);
    border: none;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
.nav-btn:hover { background: rgba(245,240,232,0.15); }
.nav-btn svg { width: 18px; height: 18px; color: var(--cream); }
.nav-avatar {
    width: 34px; height: 34px;
    background: var(--field);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--white);
    cursor: pointer;
    position: relative;
}
.badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--earth);
}
.badge:empty, .badge.hidden { display: none; }

.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    border-top: 1px solid var(--cream-dark);
    display: flex;
    padding: 6px 0 8px;
}
.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    position: relative;
    font-family: 'DM Sans', sans-serif;
}
.tab-btn svg { width: 22px; height: 22px; transition: all 0.2s; }
.tab-btn span { font-size: 0.65rem; font-weight: 500; }
.tab-btn.active { color: var(--earth); }
.tab-btn.active svg { color: var(--field); }
.tab-btn .badge { top: 0; right: calc(50% - 18px); border-color: var(--white); }

.tab-btn-publish {
    position: relative;
    top: 0;
}
.tab-btn-publish .tab-icon-wrap {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(200,150,42,0.35);
}
.tab-btn-publish svg { color: var(--earth) !important; width: 18px; height: 18px; stroke-width: 2.5; }

.app-content {
    padding-bottom: 80px;
}

/* ===== HOME PANEL ===== */
.home-hero {
    background: linear-gradient(135deg, var(--earth), var(--earth-mid));
    padding: 28px 20px;
    color: var(--cream);
    position: relative;
    overflow: hidden;
}
.hero-float {
    position: absolute;
    font-size: 1.5rem;
    pointer-events: none;
    opacity: 0.18;
    z-index: 0;
}
.hf-1 { top: 6px; left: 8px;   animation: floatEmoji 6s ease-in-out infinite; }
.hf-2 { top: 6px; right: 10px; animation: floatEmoji 8s ease-in-out infinite 1s; }
.hf-3 { bottom: 8px; left: 12px;  animation: floatEmoji 7s ease-in-out infinite 2s; }
.hf-4 { bottom: 8px; right: 14px; animation: floatEmoji 9s ease-in-out infinite 0.5s; }
.hero-publish-header, .home-hero .quick-actions { position: relative; z-index: 1; }
.home-greeting { font-size: 0.9rem; opacity: 0.7; margin-bottom: 4px; }
.home-name { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; }
.hero-publish-header {
    display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px;
}
.hero-publish-name {
    font-size: 1rem; font-weight: 600; color: var(--cream); opacity: 0.85;
    display: none;
}
.hero-publish-question {
    font-size: 1.1rem; font-weight: 700; color: var(--cream);
}
@media (min-width: 480px) {
    .hero-publish-name { display: block; }
}
.home-name .wave { display: inline-block; }

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: rgba(245,240,232,0.1);
    border: 1px solid rgba(245,240,232,0.15);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.quick-action:hover { background: rgba(245,240,232,0.15); }
.quick-action-icon {
    width: 40px; height: 40px;
    background: rgba(245,240,232,0.1);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.quick-action-icon svg { width: 20px; height: 20px; color: var(--harvest-light); }
.quick-action-text h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cream);
    margin-bottom: 2px;
}
.quick-action-text p { font-size: 0.7rem; color: rgba(245,240,232,0.5); }

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 20px;
    margin-top: -10px;
}
.home-stat {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--card-shadow);
}
.home-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--earth);
}
.home-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 12px;
}
#section-mis-pub { padding-top: 28px; }
#section-comunidad { padding-top: 8px; }
.section-title { font-size: 1.1rem; color: var(--earth); }
.section-more {
    font-size: 0.8rem;
    color: var(--field);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    min-height: 32px;
    padding: 4px 6px;
}
.section-more svg { width: 14px; height: 14px; }

.my-resources-list {
    padding: 0 20px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.my-resources-list .empty-state-compact { grid-column: 1 / -1; }
.my-resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(44,62,31,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    min-width: 0;
}
.my-resource-item:hover { border-color: var(--cream-dark); transform: translateY(-2px); }
.my-pub-filters {
    display: flex;
    gap: 4px;
    padding: 0 20px 8px;
    flex-wrap: wrap;
}
.my-pub-chip {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 50px;
    border: 1px solid var(--cream-dark);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-family: 'DM Sans', sans-serif;
}
.my-pub-chip svg { width: 12px; height: 12px; }
.my-pub-chip:hover { background: var(--cream); border-color: var(--field); }
.my-pub-chip.active {
    background: var(--earth);
    color: var(--cream);
    border-color: var(--earth);
}
.my-resource-item.inactive { opacity: 0.5; border-left: 3px solid var(--danger); }
.my-resource-item.has-request { border-left: 3px solid var(--harvest); }
.my-resource-item.in-progress { border-left: 3px solid var(--field); }

.my-res-agr-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
}
.my-res-agr-badge svg { width: 11px; height: 11px; }
.my-res-agr-badge.pending { background: rgba(200,150,42,0.12); color: var(--harvest); }
.my-res-agr-badge.active { background: rgba(122,154,60,0.12); color: var(--field); }
.my-res-agr-badge.open { background: rgba(122,154,60,0.07); color: var(--text-muted); }
.my-res-agr-badge.scheduled { background: rgba(41,128,185,0.12); color: var(--info); }
.my-res-agr-badge.inactive { background: rgba(192,57,43,0.10); color: var(--danger); }
.my-resource-item.scheduled { border-left: 3px solid var(--info); opacity: 0.85; }
.publish-action-row { display: flex; gap: 10px; margin-top: 0; }
.publish-action-row .btn { flex: 1; }

.resource-scroll {
    display: flex;
    gap: 12px;
    padding: 0 20px 20px;
    overflow: hidden;
    scrollbar-width: none;
}
.resource-scroll .empty-state, .resource-scroll .empty-state-compact { width: 100%; }
.resource-scroll::-webkit-scrollbar { display: none; }

.resource-card {
    min-width: 260px;
    max-width: 280px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    scroll-snap-align: start;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}
.resource-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(44,62,31,0.15); border-color: var(--cream-dark); }
.resource-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.resource-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.resource-card-icon svg { width: 20px; height: 20px; }
.resource-card-icon.oferta { background: rgba(39,174,96,0.1); color: var(--success); }
.resource-card-icon.solicitud { background: rgba(41,128,185,0.1); color: var(--info); }
.resource-card-icon.prestamo { background: rgba(200,150,42,0.1); color: var(--harvest); }
.resource-card-icon.trueque { background: rgba(122,154,60,0.1); color: var(--field); }

.type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 50px;
}
.type-badge.oferta { background: rgba(39,174,96,0.1); color: var(--success); }
.type-badge.solicitud { background: rgba(41,128,185,0.1); color: var(--info); }
.type-badge.prestamo { background: rgba(200,150,42,0.1); color: var(--harvest); }
.type-badge.trueque { background: rgba(122,154,60,0.1); color: var(--field); }

.resource-card h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.resource-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}
.resource-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 0;
    flex-wrap: nowrap;
}
.resource-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.resource-card-meta svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ===== MARKETPLACE ===== */
.market-header { padding: 20px 20px 0; }
.market-search {
    position: relative;
    margin-bottom: 14px;
}
.market-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--text-muted);
}
.market-search input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    background: var(--white);
    outline: none;
    transition: border-color 0.2s;
}
.market-search input:focus { border-color: var(--field); }

.filter-section { margin-bottom: 14px; }
.filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1.5px solid var(--cream-dark);
    background: var(--white);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
}
.chip svg { width: 14px; height: 14px; }
.chip:hover { border-color: var(--field); }
.chip.active {
    background: var(--earth);
    color: var(--cream);
    border-color: var(--earth);
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.filter-select {
    padding: 9px 12px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    color: var(--text);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6B45' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}
.filter-select:focus { border-color: var(--field); }

.results-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.clear-filters {
    color: var(--field);
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
}

.market-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }

/* Cat + Sort en una fila (PC y móvil) */
.filter-row-cat-sort {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.filter-cat-flex { flex: 1 1 60%; min-width: 0; }
.filter-sort-flex { flex: 0 0 auto; min-width: 130px; max-width: 170px; }
@media (max-width: 380px) {
    .filter-sort-flex { min-width: 110px; max-width: 140px; font-size: 0.75rem; }
}

/* Selects bonitos (no grises) */
.filter-pretty {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--white);
    background-image: linear-gradient(45deg, transparent 50%, var(--field) 50%),
                      linear-gradient(135deg, var(--field) 50%, transparent 50%);
    background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    padding: 9px 32px 9px 12px;
    color: var(--earth);
    font-weight: 600;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
    box-shadow: 0 2px 6px rgba(44,62,31,0.05);
    line-height: 1.2;
}
.filter-pretty:hover { border-color: var(--field); background-color: var(--cream); }
.filter-pretty:focus { outline: none; border-color: var(--earth); box-shadow: 0 0 0 3px rgba(44,62,31,0.12); }
.filter-pretty option { color: var(--text); background: var(--white); padding: 6px; }
.filter-pretty optgroup {
    color: var(--earth);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: normal;
    background: var(--cream);
}

/* Lista/Mapa centrado debajo */
.view-toggle-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    position: relative;
}
.view-toggle-group-pretty {
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 999px;
    padding: 4px;
    gap: 0;
    box-shadow: 0 2px 8px rgba(44,62,31,0.06);
    display: inline-flex;
}
.view-toggle-group-pretty .view-toggle-btn {
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: 999px;
    color: var(--text-muted);
    transition: all 0.18s;
    letter-spacing: 0.2px;
}
.view-toggle-group-pretty .view-toggle-btn svg { width: 15px; height: 15px; }
.view-toggle-group-pretty .view-toggle-btn:hover:not(.active) { color: var(--earth); background: rgba(44,62,31,0.04); }
.view-toggle-group-pretty .view-toggle-btn.active {
    background: linear-gradient(135deg, var(--earth), var(--earth-mid));
    color: var(--cream);
    box-shadow: 0 3px 10px rgba(44,62,31,0.25);
    transform: translateY(-1px);
}
.clear-filters-link {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: 'DM Sans', sans-serif;
}
.clear-filters-link:hover { color: var(--danger); }
@media (max-width: 480px) {
    .clear-filters-link {
        position: static;
        transform: none;
        margin-left: 4px;
    }
    .view-toggle-row { flex-wrap: wrap; }
}
.market-view-toggle {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 20px 4px;
    flex-wrap: wrap;
}
.view-toggle-group {
    display: inline-flex;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    border-radius: 999px;
    padding: 3px;
    gap: 0;
}
.view-toggle-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    border: none; background: transparent;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.8rem; font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s;
}
.view-toggle-btn svg { width: 14px; height: 14px; }
.view-toggle-btn.active { background: var(--earth); color: var(--cream); }
.view-toggle-btn:hover:not(.active) { color: var(--earth); }
.view-toggle-lock { display: none; width: 12px !important; height: 12px !important; opacity: 0.85; margin-left: 2px; }
.view-toggle-btn.view-toggle-locked { color: var(--text-muted); opacity: 0.85; }
.view-toggle-btn.view-toggle-locked .view-toggle-lock { display: inline-block; }
.view-toggle-btn.view-toggle-locked:hover { color: var(--harvest); }

/* Market map */
.market-map-wrap {
    margin: 0 20px 20px;
    background: var(--white);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}
.market-map-legend {
    display: flex; flex-wrap: wrap; gap: 10px;
    padding: 8px 12px;
    background: var(--cream);
    border-bottom: 1px solid var(--cream-dark);
    font-size: 0.7rem;
    color: var(--text-muted);
}
.market-map-legend .legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.legend-dot-oferta { background: #27ae60; }
.legend-dot-solicitud { background: #2980b9; }
.legend-dot-prestamo { background: #c8962a; }
.legend-dot-trueque { background: #7a9a3c; }
.market-map { height: 480px; width: 100%; }
@media (max-width: 520px) {
    .market-map { height: 60vh; min-height: 360px; }
    .market-view-toggle { padding: 8px 16px 4px; }
    .market-map-wrap { margin: 0 16px 80px; }
}
.market-map-hint {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 14px;
    background: var(--cream);
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--cream-dark);
    margin: 0;
}
.market-map-hint svg { width: 16px; height: 16px; }

/* Pins */
.market-pin-wrap { background: transparent !important; border: none !important; }
.market-pin {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s;
}
.market-pin:hover { transform: scale(1.18); }
.market-pin-inner {
    width: 6px; height: 6px;
    background: rgba(255,255,255,0.85);
    border-radius: 50%;
}

/* Cluster bubbles (overrides MarkerCluster.Default.css) */
.marker-cluster, .marker-cluster div {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.market-cluster-wrap { background: transparent !important; border: none !important; }
.market-cluster {
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.32);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: 'DM Sans', sans-serif;
    font-weight: 800;
    transition: transform 0.15s;
}
.market-cluster:hover { transform: scale(1.08); }
.market-cluster::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.25;
    z-index: -1;
}
.market-cluster-count {
    font-size: 0.95rem;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.market-cluster-wrap { position: relative; }

/* Popup */
.leaflet-popup-content-wrapper.market-popup-wrap,
.market-popup-wrap .leaflet-popup-content-wrapper {
    border-radius: 10px;
    padding: 0;
}
.market-popup-wrap .leaflet-popup-content { margin: 0; padding: 0; }
.market-popup {
    padding: 10px 12px;
    font-family: 'DM Sans', sans-serif;
    min-width: 180px;
}
.market-popup-tipo {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.market-popup-tipo-oferta { background: #27ae60; }
.market-popup-tipo-solicitud { background: #2980b9; }
.market-popup-tipo-prestamo { background: #c8962a; }
.market-popup-tipo-trueque { background: #7a9a3c; }
.market-popup-title { display: block; color: var(--earth); font-size: 0.92rem; margin-bottom: 4px; }
.market-popup-muni { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.market-popup-cta {
    width: 100%;
    background: var(--earth); color: var(--cream);
    border: none; border-radius: 8px;
    padding: 7px 10px;
    font-weight: 600; font-size: 0.78rem;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: background 0.15s;
}
.market-popup-cta:hover { background: var(--earth-mid); }

/* Locate-me control */
.market-locate-btn {
    width: 34px; height: 34px;
    background: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--earth);
    transition: background 0.15s, color 0.15s;
    padding: 0;
}
.market-locate-btn:hover { background: var(--cream); color: var(--field); }
.market-locate-btn svg { width: 18px; height: 18px; }
.market-locate-btn.locating { animation: pulse 1.2s ease-in-out infinite; color: var(--field); }

/* User pin (current location) */
.market-user-pin-wrap { background: transparent !important; border: none !important; }
.market-user-pin {
    position: relative;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
}
.market-user-pin-inner {
    width: 14px; height: 14px;
    background: #2980b9;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 2;
}
.market-user-pin-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(41,128,185,0.35);
    animation: userPulse 2s ease-out infinite;
    z-index: 1;
}
@keyframes userPulse {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(2.2); opacity: 0; }
}

.market-item {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}
.market-item:hover { border-color: var(--cream-dark); transform: translateY(-1px); }
.market-item-top { display: flex; gap: 12px; margin-bottom: 10px; }
.market-item-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.market-item-icon svg { width: 22px; height: 22px; }
.market-item-info { flex: 1; min-width: 0; }
.market-item-info h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.market-item-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.market-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.market-item-meta { display: flex; gap: 12px; }
.market-item-meta span { display: flex; align-items: center; gap: 4px; }
.market-item-meta svg { width: 12px; height: 12px; }

/* ===== RESOURCE DETAIL ===== */
.detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1500;
    background: var(--cream);
    overflow-y: auto;
    animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1);
}
.detail-header {
    position: sticky;
    top: 0;
    background: var(--white);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--cream-dark);
    z-index: 1;
}
.detail-back {
    width: 36px; height: 36px;
    background: none;
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.detail-back svg { width: 18px; height: 18px; color: var(--text); }
.detail-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}

.detail-body { padding: 20px; }
.detail-type-badge { margin-bottom: 12px; }
.detail-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    line-height: 1.3;
}
.detail-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 20px;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.detail-info-item {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border: 1px solid var(--cream-dark);
    min-width: 0;
}
.detail-info-item.full-row { grid-column: 1 / -1; padding: 12px; }
.detail-desc-item { padding: 14px; }
.detail-info-label { font-size: 0.7rem; margin-bottom: 4px; }
.detail-info-label svg { width: 12px; height: 12px; }
.detail-info-item .detail-info-value {
    font-size: 0.88rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.3;
}
.detail-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.detail-info-label svg { width: 12px; height: 12px; }
.detail-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.detail-owner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--cream-dark);
    margin-bottom: 20px;
}
.detail-owner-avatar {
    width: 44px; height: 44px;
    background: var(--field);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.detail-owner-info { flex: 1; }
.detail-owner-info h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}
.detail-owner-info p { font-size: 0.8rem; color: var(--text-muted); }
.detail-owner-rating { display: flex; align-items: center; gap: 4px; color: var(--harvest); font-size: 0.85rem; font-weight: 600; }
.detail-owner-rating svg { width: 14px; height: 14px; fill: var(--harvest); }

.detail-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    position: sticky;
    bottom: 0;
    background: var(--cream);
    border-top: 1px solid var(--cream-dark);
}

/* ===== PUBLISH ===== */
.publish-header {
    padding: 24px 20px 16px;
}
.publish-header h2 { font-size: 1.3rem; color: var(--earth); margin-bottom: 6px; }
.publish-header p { font-size: 0.85rem; color: var(--text-muted); }

.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 20px 20px;
}
.type-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.type-opt:hover { border-color: var(--field); }
.type-opt.active { border-color: var(--earth); background: rgba(44,62,31,0.03); }
.type-opt-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.type-opt-icon svg { width: 22px; height: 22px; }
.type-opt h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
}
.type-opt p { font-size: 0.7rem; color: var(--text-muted); line-height: 1.3; }

.publish-form { padding: 0 20px 20px; }
.publish-form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--cream-dark);
}
.publish-form-section:last-child { border-bottom: none; }
.publish-form-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--earth);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.publish-form-section-title svg { width: 18px; height: 18px; color: var(--field); }

/* Toggle switch */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { display: none; }
.toggle-thumb {
    position: absolute;
    inset: 0;
    background: #b0b8a8;
    border-radius: 12px;
    transition: background 0.2s;
    border: 1.5px solid rgba(0,0,0,0.12);
}
.toggle-thumb::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px; left: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-thumb { background: var(--field); border-color: var(--earth-mid); }
.toggle-switch input:checked + .toggle-thumb::after { transform: translateX(20px); }

/* Segmented control (trueque tipo) */
.segmented-control {
    display: flex;
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    overflow: hidden;
}
.seg-opt {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    background: var(--white);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}
.seg-opt:not(:last-child) { border-right: 1.5px solid var(--cream-dark); }
.seg-opt.active {
    background: var(--earth);
    color: var(--cream);
    font-weight: 600;
}

/* ===== AGREEMENTS ===== */
.agreements-header { padding: 24px 20px 0; }
.agreements-header h2 { font-size: 1.3rem; color: var(--earth); margin-bottom: 14px; }

.status-tabs {
    display: flex;
    gap: 0;
    padding: 0 20px;
    border-bottom: 1px solid var(--cream-dark);
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: 'DM Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-tab:hover { color: var(--text); }
.status-tab.status-tab-empty { opacity: 0.55; }
.status-tab.status-tab-empty .count { opacity: 0.7; }
.status-tab.active { color: var(--earth); border-bottom-color: var(--field); }
.status-tab[data-status="pending"].active  { color: #d68910; border-bottom-color: #d68910; }
.status-tab[data-status="pending"].active .count { background: rgba(214,137,16,0.15); color: #d68910; }
.status-tab[data-status="active"].active   { color: var(--field); border-bottom-color: var(--field); }
.status-tab[data-status="active"].active .count { background: rgba(122,154,60,0.15); color: var(--field); }
.status-tab[data-status="completed"].active { color: #2471a3; border-bottom-color: #2471a3; }
.status-tab[data-status="completed"].active .count { background: rgba(36,113,163,0.13); color: #2471a3; }
.status-tab[data-status="cancelled"].active { color: var(--danger); border-bottom-color: var(--danger); }
.status-tab[data-status="cancelled"].active .count { background: rgba(192,57,43,0.12); color: var(--danger); }
.status-tab .count {
    background: var(--cream-dark);
    padding: 1px 7px;
    border-radius: 50px;
    font-size: 0.7rem;
}
.status-tab.active .count { background: rgba(122,154,60,0.15); color: var(--field); }

.agreements-list { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 10px; }

.agreement-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.agreement-card:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(44,62,31,0.1); }
.agreement-card { border-left: 3px solid transparent; }
.agreement-card.pending   { border-left-color: #d68910; }
.agreement-card.active    { border-left-color: var(--field); }
.agreement-card.completed { border-left-color: #2471a3; }
.agreement-card.cancelled, .agreement-card.rejected { border-left-color: #bbb; opacity: 0.65; }

/* -- Card rows -- */
.agr-card-row1 {
    display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
}
.agr-card-cat-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--cream);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--earth);
}
.agr-card-cat-icon svg { width: 15px; height: 15px; }
.agr-card-title {
    flex: 1; min-width: 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agr-card-date-top {
    font-size: 0.68rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap;
}
.agr-card-row2 {
    display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 6px;
}
.agr-card-role-row {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px;
}
.agr-card-sub {
    font-size: 0.74rem; color: var(--text-muted); line-height: 1.3;
}
.agr-card-upd {
    font-size: 0.65rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0;
}
/* legacy compat */
.agr-card-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.agr-card-info { flex: 1; min-width: 0; }
.agr-card-info h4 { font-family: 'DM Sans',sans-serif; font-size: 0.92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.agr-cat-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(122,154,60,0.1);
    color: var(--field);
    white-space: nowrap;
}

/* -- Bottom action buttons row -- */
.agr-card-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--cream-dark);
}
.agr-btn-done {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.agr-btn-done svg { width: 13px; height: 13px; color: var(--harvest); }

.status-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 50px;
    white-space: nowrap;
}
.status-badge.pending { background: rgba(200,150,42,0.1); color: var(--harvest); }
.status-badge.accepted { background: rgba(41,128,185,0.1); color: var(--info); }
.status-badge.active { background: rgba(122,154,60,0.1); color: var(--field); }
.status-badge.completed { background: rgba(39,174,96,0.1); color: var(--success); }
.status-badge.rejected { background: rgba(192,57,43,0.1); color: var(--danger); }
.status-badge.cancelled { background: rgba(192,57,43,0.1); color: var(--danger); }

.agreement-badges { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.tipo-badge {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 3px 8px;
    border-radius: 50px;
    white-space: nowrap;
    background: rgba(0,0,0,0.05);
    color: var(--text-muted);
}
.tipo-badge.oferta { background: rgba(41,128,185,0.1); color: #2980b9; }
.tipo-badge.solicitud { background: rgba(142,68,173,0.1); color: #8e44ad; }
.tipo-badge.prestamo { background: rgba(200,150,42,0.1); color: var(--harvest); }
.tipo-badge.trueque { background: rgba(122,154,60,0.1); color: var(--field); }

.agreement-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.agreement-date { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.agreement-date svg { width: 12px; height: 12px; }
.agreement-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.agreement-waiting {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-style: italic;
}
.agreement-waiting svg { width: 12px; height: 12px; }

/* ===== CHAT ===== */
.chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1);
}
.chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--cream);
    overflow: hidden;
}
.chat-close-desktop {
    display: none;
    width: 32px; height: 32px;
    background: rgba(245,240,232,0.1);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--cream);
}
.chat-close-desktop svg { width: 16px; height: 16px; }
@media (min-width: 900px) {
    .chat-overlay {
        background: rgba(15, 18, 22, 0.55);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        align-items: center;
        justify-content: center;
        padding: 5vh 5vw;
    }
    .chat-shell {
        flex: 0 1 auto;
        width: min(720px, 100%);
        height: min(85vh, 760px);
        border-radius: 18px;
        box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    }
    .chat-back { display: none; }
    .chat-close-desktop { display: inline-flex; }
}
.chat-header {
    background: var(--earth);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--cream);
}
.chat-back {
    width: 36px; height: 36px;
    background: rgba(245,240,232,0.1);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.chat-back svg { width: 18px; height: 18px; color: var(--cream); }
.chat-header-info { flex: 1; }
.chat-header-info h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
}
.chat-header-info p { font-size: 0.75rem; opacity: 0.7; }

.chat-status-bar {
    background: var(--white);
    border-bottom: 1px solid var(--cream-dark);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8rem;
}
.csb-info {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-weight: 500;
}
.csb-info svg { width: 15px; height: 15px; flex-shrink: 0; }
.csb-done { color: var(--success, #4caf50); }
.csb-cancelled { color: var(--text-muted); }
.csb-actions { display: flex; gap: 6px; flex-shrink: 0; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: fadeIn 0.2s ease;
}
.chat-msg.out {
    align-self: flex-end;
    background: var(--earth);
    color: var(--cream);
    border-bottom-right-radius: 4px;
}
.chat-msg.in {
    align-self: flex-start;
    background: var(--white);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chat-msg-time {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 4px;
}
.chat-msg.out .chat-msg-time { text-align: right; }

.chat-date-divider {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 8px 0;
}

.chat-input-bar {
    padding: 12px 20px;
    background: var(--white);
    border-top: 1px solid var(--cream-dark);
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.chat-input-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    outline: none;
    background: var(--cream);
}
.chat-input-bar input:focus { border-color: var(--field); }
.chat-input-locked {
    opacity: 0.5;
    pointer-events: none;
    background: var(--cream);
}
.chat-input-locked input { background: var(--cream-dark); }
.chat-send-btn {
    width: 44px; height: 44px;
    background: var(--earth);
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--earth-mid); }
.chat-send-btn svg { width: 18px; height: 18px; color: var(--cream); }

/* ===== PROFILE ===== */
.profile-header {
    background: linear-gradient(135deg, var(--earth), var(--earth-mid));
    padding: 32px 20px;
    color: var(--cream);
    text-align: center;
}
.profile-avatar {
    width: 72px; height: 72px;
    background: var(--field);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    border: 3px solid rgba(245,240,232,0.2);
    position: relative;
}
.avatar-verified-tick {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 26px;
    height: 26px;
    background: #1da1f2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: 2.5px solid var(--cream);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.avatar-verified-tick svg { width: 14px; height: 14px; }
.user-profile-avatar { position: relative; }
.profile-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.profile-role { font-size: 0.85rem; opacity: 0.7; }
.profile-location { font-size: 0.8rem; opacity: 0.5; display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 6px; }
.profile-location svg { width: 14px; height: 14px; }

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 20px;
    margin-top: -16px;
}
.profile-stat {
    background: linear-gradient(160deg, var(--white) 0%, var(--cream) 100%);
    border-radius: var(--radius-sm);
    padding: 14px 8px 12px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(44,62,31,0.10);
    border: 1px solid var(--cream-dark);
    position: relative;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.profile-stat-anim { animation: fadeUp .55s ease both; }
.profile-stat-anim:nth-child(1) { animation-delay: 0ms; }
.profile-stat-anim:nth-child(2) { animation-delay: 70ms; }
.profile-stat-anim:nth-child(3) { animation-delay: 140ms; }
.profile-stat-anim:nth-child(4) { animation-delay: 210ms; }
.profile-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(44,62,31,0.18);
}
.profile-stat-icon {
    width: 30px; height: 30px;
    border-radius: 9px;
    margin: 0 auto 6px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(200,150,42,0.18), rgba(122,154,60,0.18));
    color: var(--earth);
}
.profile-stat-icon svg { width: 16px; height: 16px; }
.profile-stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--earth), var(--field));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}
.profile-stat-label {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.profile-stat:nth-child(3) .profile-stat-icon {
    background: linear-gradient(135deg, rgba(200,150,42,0.25), rgba(232,184,75,0.25));
    color: var(--harvest);
}
.profile-stat:nth-child(4) .profile-stat-icon {
    background: linear-gradient(135deg, rgba(122,154,60,0.22), rgba(61,84,41,0.22));
    color: var(--field);
}
.profile-menu-disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(0.6);
}
.profile-menu-disabled:hover { background: none !important; }

.profile-section {
    margin: 16px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}
.profile-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 14px 16px 8px;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
}
.profile-menu-item:hover { background: rgba(122,154,60,0.04); }
.profile-menu-item + .profile-menu-item { border-top: 1px solid var(--cream-dark); }
.profile-menu-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.profile-menu-icon svg { width: 18px; height: 18px; }
.profile-menu-icon.green { background: rgba(122,154,60,0.1); color: var(--field); }
.profile-menu-icon.gold { background: rgba(200,150,42,0.1); color: var(--harvest); }
.profile-menu-icon.red { background: rgba(192,57,43,0.1); color: var(--danger); }
.profile-menu-text { flex: 1; }
.profile-menu-text h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}
.profile-menu-text p { font-size: 0.75rem; color: var(--text-muted); }
.profile-menu-arrow { color: var(--text-muted); }
.profile-menu-arrow svg { width: 16px; height: 16px; }

/* ===== SETTINGS PANELS ===== */
.settings-panel {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--cream);
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1);
}
.settings-header {
    position: sticky;
    top: 0;
    background: var(--white);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--cream-dark);
    z-index: 1;
}
.settings-back {
    width: 36px; height: 36px;
    background: none;
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.settings-back svg { width: 18px; height: 18px; color: var(--text); }
.settings-header h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}
.settings-body { padding: 20px; }

/* ===== REPUTATION BAR ===== */
.reputation-bar {
    position: relative;
    height: 12px;
    background-color: var(--cream-dark);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent calc(10% - 1px),
        rgba(255,255,255,0.65) calc(10% - 1px),
        rgba(255,255,255,0.65) 10%
    );
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}
.reputation-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--field), var(--harvest-light));
    border-radius: 6px;
    transition: width 0.5s ease;
}

/* ===== RATING STARS ===== */
/* ===== NEW RATING UI ===== */
.rating-prompt {
    text-align: center; font-size: 0.9rem; color: var(--text-muted);
    margin-bottom: 20px; transition: color 0.2s;
}
.rating-prompt.bad { color: #c0392b; }
.rating-prompt.good { color: var(--field); }
.rating-stars-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.rating-star-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--cream-dark); transition: transform 0.15s, color 0.15s;
}
.rating-star-btn svg { width: 36px; height: 36px; fill: transparent; transition: fill 0.15s; }
.rating-star-btn.active { color: var(--harvest); }
.rating-star-btn.active svg { fill: var(--harvest); }
.rating-star-btn:hover { transform: scale(1.2); }
.rating-label-badge { text-align: center; margin-bottom: 8px; }
.rating-emoji-big { text-align: center; font-size: 2.8rem; line-height: 1; margin: 4px 0 8px; min-height: 44px; transition: all 0.2s; }
.rating-divider { border: none; border-top: 1.5px solid var(--cream-dark); margin: 16px 0 14px; }
.rating-question { font-size: 0.95rem; font-weight: 600; color: var(--earth); margin-bottom: 8px; text-align: center; }
.rating-tags-row {
    display: flex; flex-wrap: wrap; gap: 8px;
    justify-content: center; margin: 8px 0 4px;
    min-height: 0;
}
.rating-tag-chip {
    padding: 6px 14px; border-radius: 20px; font-size: 0.82rem;
    border: 1.5px solid; cursor: pointer; transition: all 0.15s;
    background: transparent; font-family: 'DM Sans', sans-serif;
}
.rating-tag-chip.bad  { border-color: rgba(192,57,43,0.3); color: #c0392b; }
.rating-tag-chip.good { border-color: rgba(122,154,60,0.3); color: var(--field); }
.rating-tag-chip.bad.selected  { background: rgba(192,57,43,0.12); border-color: #c0392b; font-weight: 600; }
.rating-tag-chip.good.selected { background: rgba(122,154,60,0.12); border-color: var(--field); font-weight: 600; }
.rating-tag-chip:hover { transform: scale(1.04); }
.rating-label-chip {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    font-size: 0.82rem; font-weight: 600;
}
.rating-label-chip.bad { background: rgba(192,57,43,0.1); color: #c0392b; }
.rating-label-chip.good { background: rgba(122,154,60,0.12); color: var(--field); }

/* ===== CARD AUTHOR LINK ===== */
.card-author-link {
    display: inline-flex; align-items: center; gap: 4px;
    cursor: pointer; padding: 2px 0; border-radius: 4px;
    transition: color 0.15s;
}
.card-author-link:hover { color: var(--field); }
.card-rating-pill {
    font-size: 0.7rem; background: rgba(200,150,42,0.12); color: var(--harvest);
    padding: 1px 6px; border-radius: 10px; font-weight: 600;
}

/* ===== USER PUBLIC PROFILE ===== */
.user-profile-hero {
    display: flex; align-items: center; gap: 14px; margin-bottom: 16px;
}
.user-profile-avatar {
    width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--earth-mid), var(--field));
    color: var(--cream); display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 700; font-family: 'DM Sans', sans-serif;
}
.user-profile-name { font-size: 1.1rem; font-family: 'Playfair Display', serif; margin-bottom: 2px; }
.user-profile-tipo { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 2px; }
.user-profile-loc { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 3px; }
.user-profile-loc svg { width: 11px; height: 11px; }
.user-reputation-block {
    display: flex; align-items: center; gap: 12px;
    background: rgba(200,150,42,0.08); border-radius: var(--radius-sm);
    padding: 12px 16px; margin-bottom: 16px;
    border: 1px solid rgba(200,150,42,0.2);
}
.user-rep-score {
    font-size: 2.2rem; font-weight: 700; color: var(--harvest);
    font-family: 'Playfair Display', serif; line-height: 1;
}
.user-rep-stars { display: flex; gap: 2px; margin-bottom: 2px; }
.rep-star { width: 16px; height: 16px; color: var(--cream-dark); fill: transparent; }
.rep-star.filled { color: var(--harvest); fill: var(--harvest); }
.user-rep-count { font-size: 0.75rem; color: var(--text-muted); }
.user-bio-text {
    font-size: 0.85rem; color: var(--text-muted); font-style: italic;
    margin-bottom: 16px; line-height: 1.5; text-align: center;
}
.profile-section-label {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px;
}
.profile-section-label svg { width: 13px; height: 13px; }
.profile-resource-item { margin-bottom: 8px; }
.empty-mini {
    text-align: center; color: var(--text-muted); font-size: 0.82rem;
    padding: 12px; background: var(--cream); border-radius: var(--radius-sm);
}

/* ===== REVIEW CARDS ===== */
.review-card {
    background: var(--white); border: 1px solid var(--cream-dark);
    border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
}
.review-header {
    display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.review-emoji { font-size: 1.3rem; }
.review-stars { display: flex; gap: 1px; }
.review-author-name {
    font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
    margin-left: auto;
}
.review-tags-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.review-tag-pill {
    font-size: 0.75rem; padding: 3px 10px; border-radius: 12px;
    background: var(--cream); color: var(--text-muted);
    border: 1px solid var(--cream-dark);
}
.review-comment-text {
    font-size: 0.85rem; color: var(--text); line-height: 1.5;
    font-style: italic; margin: 0;
}

/* ===== LEGACY RATING (kept for any remaining usage) ===== */
.rating-stars { display: flex; gap: 4px; }
.rating-star {
    width: 32px; height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--cream-dark);
    transition: all 0.15s;
}
.rating-star svg { width: 28px; height: 28px; }
.rating-star.active { color: var(--harvest); }
.rating-star.active svg { fill: var(--harvest); }
.rating-star:hover { transform: scale(1.15); }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.empty-state-compact {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.empty-state svg, .empty-state-compact svg {
    width: 56px; height: 56px;
    margin-bottom: 18px;
    color: var(--growth);
    opacity: 0.5;
    stroke-width: 1.3;
}
.empty-state-compact svg { width: 40px; height: 40px; margin-bottom: 12px; }
.empty-state h3, .empty-state-compact h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--earth);
    margin-bottom: 8px;
}
.empty-state p, .empty-state-compact p {
    font-size: 0.85rem;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ===== SKELETON LOADER ===== */
.skeleton {
    background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s infinite;
    border-radius: var(--radius-sm);
}
.skeleton-card { height: 120px; margin: 0 20px 10px; border-radius: var(--radius); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--earth);
    color: var(--cream);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.confirm-dialog {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.confirm-dialog h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.confirm-dialog p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.4; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* ===== LAYOUT ===== */
.app-container {
    position: relative;
    background: var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 768px) {
    .auth-screen { justify-content: center; align-items: center; }
    .auth-form { max-width: 440px; width: 100%; }
    .landing-ctas { max-width: 440px; }
    .home-hero { padding: 32px 48px; }
    .home-stats, .section-header, .my-resources-list, .my-pub-filters { padding-left: 48px; padding-right: 48px; }
    .resource-scroll { padding-left: 48px; padding-right: 48px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
    .resource-scroll .resource-card { min-width: 0; max-width: none; padding: 12px; }
    .resource-scroll .resource-card h4 { font-size: 0.92rem; }
    .resource-scroll .resource-card p { font-size: 0.82rem; }
    .market-header { padding: 20px 48px 0; }
    .market-list { display: grid; grid-template-columns: 1fr 1fr; padding: 0 48px 20px; }
    .results-count { padding: 8px 48px; }
    .publish-header { padding: 24px 48px 16px; }
    .type-selector { padding: 0 48px 20px; }
    .publish-form { padding: 0 48px 20px; }
    .agreements-header { padding: 24px 48px 0; }
    .status-tabs { padding: 0 48px; }
    .agreements-list { display: grid; grid-template-columns: 1fr 1fr; padding: 0 48px 20px; }
    .detail-body { padding: 24px 48px; }
    .detail-actions { padding: 20px 48px; }
    .settings-body { padding: 24px 48px; }
    .detail-info-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1024px) {
    .market-list { grid-template-columns: 1fr 1fr 1fr; }
    .agreements-list { grid-template-columns: 1fr 1fr 1fr; }
    .home-stats { grid-template-columns: repeat(3, 1fr); max-width: 600px; margin-left: auto; margin-right: auto; }
    .profile-stats { grid-template-columns: repeat(4, 180px); justify-content: center; }
    .quick-actions { flex-wrap: nowrap; }
}
@media (min-width: 1280px) {
    .market-list { grid-template-columns: 1fr 1fr 1fr 1fr; }
    .agreements-list { grid-template-columns: 1fr 1fr 1fr 1fr; }
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal-backdrop {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
.confirm-modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px 24px 20px;
    max-width: 360px; width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.confirm-modal-icon { margin-bottom: 12px; color: var(--earth); opacity: 0.7; }
.confirm-modal-icon svg { width: 40px; height: 40px; }
.confirm-modal h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--earth); margin-bottom: 8px; }
.confirm-modal p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }
.confirm-modal-actions { display: flex; gap: 10px; }
.confirm-modal-actions .btn { flex: 1; }
.confirm-modal-actions .btn-cancel {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--cream-dark);
}
.confirm-modal-actions .btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

/* ===== IMAGE LIGHTBOX ===== */
.img-lightbox {
    position: fixed; inset: 0; z-index: 9100;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}
.img-lightbox img {
    max-width: 95vw; max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.15);
    border: none; border-radius: 50%;
    color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.lightbox-close svg { width: 20px; height: 20px; }

/* ===== IMAGE IN CHAT ===== */
.chat-input-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.chat-action-btn {
    width: 38px; height: 38px;
    background: none;
    border: 1.5px solid var(--cream-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}
.chat-action-btn:hover { border-color: var(--field); color: var(--field); }
.chat-action-btn svg { width: 16px; height: 16px; }
.chat-msg img {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 6px;
    cursor: pointer;
}
.chat-msg .location-link {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(122,154,60,0.1);
    border-radius: 10px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--field);
    text-decoration: none;
    max-width: 260px;
}
.chat-msg.out .location-link { background: rgba(245,240,232,0.15); color: var(--cream); }
.chat-msg .location-link svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.chat-msg .location-link-body { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; min-width: 0; }
.chat-msg .location-link-body strong { font-size: 0.82rem; font-weight: 600; }
.chat-msg .location-link-body .location-addr {
    font-size: 0.75rem;
    opacity: 0.92;
    white-space: normal;
    word-break: break-word;
}
.chat-msg .location-link-body small { font-size: 0.68rem; opacity: 0.7; }

/* ===== MAP BLOCK (shared: resource detail, publish preview) ===== */
.map-block {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--cream);
    border: 1px solid var(--cream-dark);
    margin-top: 4px;
}
.map-container {
    width: 100%;
    height: 180px;
    background: #e8eadf;
    z-index: 1;
}
.map-container.leaflet-container { background: #e8eadf; }
.map-address {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 10px 12px; background: var(--white);
    border-bottom: 1px solid var(--cream-dark); line-height: 1.4;
}
.map-addr-line {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.map-addr-line svg { width: 13px; height: 13px; color: var(--field); flex-shrink: 0; }
.map-addr-city { font-size: 0.78rem; color: var(--text-muted); margin-top: 1px; padding-left: 19px; }
.map-address svg { width: 14px; height: 14px; color: var(--field); flex-shrink: 0; }
.map-notes {
    display: flex; align-items: flex-start; gap: 6px;
    padding: 8px 12px; font-size: 0.82rem; color: var(--text-muted);
    background: rgba(200,150,42,0.05); border-bottom: 1px solid var(--cream-dark);
    font-style: italic;
}
.map-notes svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; color: var(--harvest); }
.map-open-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 12px; font-size: 0.85rem; font-weight: 600;
    color: var(--white); text-decoration: none;
    background: var(--field); transition: background 0.15s;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.map-open-btn:hover { background: var(--earth-mid); }
.map-open-btn svg { width: 15px; height: 15px; }
.map-open-link {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px; font-size: 0.78rem; color: var(--field);
    text-decoration: none; background: rgba(122,154,60,0.06);
    border-top: 1px solid var(--cream-dark); font-weight: 500; transition: background 0.15s;
}
.map-open-link:hover { background: rgba(122,154,60,0.12); }
.map-open-link svg { width: 13px; height: 13px; }

.detail-location-section {
    margin-top: 14px;
    margin-bottom: 4px;
}
.detail-location-section .detail-info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.detail-location-section .detail-info-label svg { width: 14px; height: 14px; }

.geo-map-preview {
    margin-top: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--cream-dark);
    display: none;
}

/* ===== LOCATION PICKER ===== */
.loc-picker { display: flex; flex-direction: column; gap: 8px; }
.loc-gps-row { display: flex; }
.loc-gps-full-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--field); border-radius: var(--radius-sm);
    background: rgba(122,154,60,0.07); color: var(--field); font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.loc-gps-full-btn:hover { background: rgba(122,154,60,0.14); }
.loc-gps-full-btn svg { width: 15px; height: 15px; }
.loc-map-preview-mini { cursor: pointer; }
.loc-map-container {
    height: 220px; border-radius: var(--radius-sm); overflow: hidden;
    border: 1.5px solid var(--cream-dark); background: #e8eadf;
}
.loc-map-large { height: 300px; }
.loc-map-preview-mini {
    height: 120px; cursor: pointer;
    transition: opacity 0.15s;
}
.loc-map-preview-mini:hover { opacity: 0.85; }
.loc-expand-trigger {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 11px 14px;
    background: rgba(122,154,60,0.07); border: 1.5px dashed rgba(122,154,60,0.4);
    border-radius: var(--radius-sm); color: var(--field); font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif; font-weight: 500; cursor: pointer;
    transition: background 0.15s;
}
.loc-expand-trigger:hover { background: rgba(122,154,60,0.13); }
.loc-expand-trigger svg { width: 15px; height: 15px; }

/* ===== FULLSCREEN MAP PICKER ===== */
.map-fullscreen-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--white); display: flex; flex-direction: column;
    animation: slideUp 0.2s ease;
}
.map-fullscreen-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--earth); color: var(--cream);
    flex-shrink: 0;
}
.map-fullscreen-back {
    background: none; border: none; cursor: pointer;
    color: var(--cream); padding: 4px; display: flex;
}
.map-fullscreen-back svg { width: 22px; height: 22px; }
.map-fullscreen-title h4 { font-family: 'DM Sans',sans-serif; font-size: 1rem; font-weight: 600; }
.map-fullscreen-title p { font-size: 0.75rem; opacity: 0.75; margin: 0; }
.map-fullscreen-gps-row {
    padding: 10px 12px; background: var(--white);
    border-bottom: 1px solid var(--cream-dark); flex-shrink: 0;
}
.map-fullscreen-search-row {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 10px 12px; background: var(--white);
    border-bottom: 1px solid var(--cream-dark); flex-shrink: 0;
    position: relative;
}
.map-search-wrap { flex: 1; position: relative; }
.map-search-wrap .form-input { font-size: 0.9rem; padding: 10px 12px; }
.map-search-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--white); border: 1.5px solid var(--cream-dark);
    border-radius: var(--radius-sm); box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 99999; max-height: 220px; overflow-y: auto;
}
.map-search-result {
    padding: 10px 12px; font-size: 0.84rem; cursor: pointer;
    border-bottom: 1px solid var(--cream); color: var(--text); line-height: 1.4;
}
.map-search-result:last-child { border-bottom: none; }
.map-search-result:hover { background: var(--cream); }
.loc-gps-icon-btn {
    flex-shrink: 0; width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(122,154,60,0.1); color: var(--field);
    border: 1.5px solid var(--cream-dark); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s;
}
.loc-gps-icon-btn:hover { background: rgba(122,154,60,0.2); }
.loc-gps-icon-btn svg { width: 18px; height: 18px; }
.map-fullscreen-map { flex: 1; z-index: 1; }
.map-fullscreen-footer {
    flex-shrink: 0; padding: 12px 16px; background: var(--white);
    border-top: 1px solid var(--cream-dark);
    display: flex; flex-direction: column; gap: 10px;
}
.map-fullscreen-addr {
    font-size: 0.85rem; color: var(--text); font-weight: 500;
    display: flex; align-items: center; gap: 6px;
}
#fs-confirm { align-self: stretch; }
.loc-addr-display {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 0.82rem; color: var(--field); font-weight: 500;
    padding: 8px 10px; background: rgba(122,154,60,0.07);
    border-radius: var(--radius-xs); border: 1px solid rgba(122,154,60,0.2);
}
.loc-addr-display svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.loc-addr-text { display: block; font-weight: 600; }
.loc-addr-city { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 400; margin-top: 1px; }

/* Disabled input when toggled */
.form-input.input-disabled,
.form-input:disabled {
    background: var(--cream);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Fix for Leaflet tile rendering inside scrollable panels */
.leaflet-container a { color: var(--field); }
.leaflet-control-attribution {
    font-size: 10px !important;
    background: rgba(255,255,255,0.8) !important;
}

/* ===== IMAGE PREVIEW ===== */
.image-preview-bar {
    padding: 8px 20px;
    background: var(--white);
    border-top: 1px solid var(--cream-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}
.image-preview-bar img {
    width: 48px; height: 48px;
    border-radius: 8px;
    object-fit: cover;
}
.image-preview-bar .remove-preview {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px; height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.image-preview-bar span { font-size: 0.8rem; color: var(--text-muted); flex: 1; }

/* ===== PUBLISH IMAGE ===== */
.image-upload-area {
    border: 2px dashed var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.image-upload-area:hover { border-color: var(--field); color: var(--field); }
.image-upload-area svg { width: 28px; height: 28px; margin-bottom: 6px; }
.image-upload-area img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin-top: 8px;
}

/* ===== RESPONSIVE ===== */
/* ===== MOBILE: stack form-rows on small screens ===== */
@media (max-width: 520px) {
    /* Stack two-column form rows */
    .form-row { grid-template-columns: 1fr; gap: 0; }

    /* Auth screens */
    .auth-screen { padding: 20px 16px 32px; justify-content: flex-start; }
    .auth-title { font-size: 1.5rem; }
    .auth-subtitle { font-size: 0.85rem; }

    /* Landing */
    .landing-inner { padding: 0 4px; }
    .landing-title { font-size: clamp(2.2rem, 10vw, 3rem); }
    .landing .tagline { font-size: 0.92rem; }
    .landing-pills { gap: 6px; }
    .landing-pill { font-size: 0.72rem; padding: 4px 10px; }
    .landing-btn-primary, .landing-btn-secondary { font-size: 0.92rem; padding: 12px 20px; }
    .landing-stats { padding: 12px 0; }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: 0.6rem; }
    .logo-mark { width: 70px; height: 70px; margin-bottom: 18px; }
    .logo-mark svg { width: 34px; height: 34px; }

    /* Tab bar — tighter on tiny screens */
    .tab-btn span { font-size: 0.6rem; }
    .tab-btn { padding: 6px 0; }
    .tab-btn svg { width: 20px; height: 20px; }

    /* Home */
    .home-hero { padding: 20px 16px; }
    .home-greeting { font-size: 0.85rem; }
    .home-name { font-size: 1.4rem; }
    .quick-action { padding: 10px 8px; }
    .quick-action-icon { width: 32px; height: 32px; }
    .quick-action-text h4 { font-size: 0.8rem; }
    .quick-action-text p { font-size: 0.68rem; }
    .section-header { padding: 0 16px; }
    .section-title { font-size: 1rem; }
    .my-resources-list { padding: 0 16px; }
    .resource-scroll { padding: 0 16px 16px; }

    /* Cards — compact on mobile */
    .my-resource-item { padding: 8px 10px; gap: 8px; }
    .resource-card { min-width: 210px; max-width: 230px; padding: 11px; }
    .resource-card h4 { font-size: 0.85rem; }
    .resource-card p { font-size: 0.78rem; }
    .resource-card-icon { width: 34px; height: 34px; }
    .market-item { padding: 11px 12px; }
    .market-item-icon { width: 36px; height: 36px; }
    .market-item-icon svg { width: 18px; height: 18px; }
    .agreement-card { padding: 9px 11px; }
    .agr-card-cat-icon { width: 30px; height: 30px; }

    /* Market */
    .market-header { padding: 12px 16px 0; }
    .market-list { padding: 0 16px 16px; }
    .results-count { padding: 6px 16px; font-size: 0.78rem; }
    .filter-row { grid-template-columns: 1fr; }
    .market-item-top { gap: 10px; }
    .market-item-info h4 { font-size: 0.88rem; }

    /* Publish */
    .publish-header { padding: 16px 16px 10px; }
    .publish-header h2 { font-size: 1.2rem; }
    .type-selector { grid-template-columns: 1fr 1fr; padding: 0 16px 16px; gap: 8px; }
    .type-opt { padding: 10px 8px; }
    .type-opt h4 { font-size: 0.8rem; }
    .type-opt p { font-size: 0.68rem; }
    .publish-form { padding: 0 16px 16px; }
    .publish-form-section { padding: 14px; margin-bottom: 10px; }
    .publish-action-row { flex-direction: column; gap: 8px; }

    /* Detail overlay */
    .detail-header { padding: 12px 16px; }
    .detail-header h3 { font-size: 1rem; }
    .detail-body { padding: 16px; }
    .detail-title { font-size: 1.2rem; }
    .detail-actions { padding: 12px 16px; gap: 8px; flex-direction: column; }
    .detail-info-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
    .detail-info-item { padding: 8px 10px; }
    .detail-info-item .detail-info-value { font-size: 0.84rem; }

    /* Agreements */
    .agreements-header { padding: 12px 14px 0; }
    .agreements-list { padding: 0 12px 16px; gap: 8px; }
    .status-tabs { padding: 0 12px; gap: 0; }
    .status-tab { padding: 7px 9px; font-size: 0.68rem; flex-shrink: 0; }
    .status-tab .count { display: none; }
    .agreement-card { padding: 10px 12px; }
    .agr-card-top { gap: 8px; margin-bottom: 7px; }
    .agr-card-cat-icon { width: 28px; height: 28px; border-radius: 8px; }
    .agr-card-cat-icon svg { width: 13px; height: 13px; }
    .agr-card-info h4 { font-size: 0.84rem; }
    .agr-card-sub { font-size: 0.7rem; }
    .agr-cat-badge { display: none; }
    .agr-card-btns { padding-top: 7px; gap: 5px; }
    .agreement-badges { gap: 3px; }
    .agreements-list { padding: 0 16px 16px; }

    /* Profile */
    .profile-header { padding: 24px 16px 16px; }
    .profile-name { font-size: 1.4rem; }
    .profile-stats { gap: 6px; }
    .profile-stat { padding: 10px 4px 8px; }
    .profile-stat-value { font-size: 1.15rem; }
    .profile-stat-label { font-size: 0.58rem; letter-spacing: 0.3px; }
    .profile-stat-icon { width: 26px; height: 26px; margin-bottom: 4px; }
    .profile-stat-icon svg { width: 14px; height: 14px; }
    .profile-section { margin: 0 16px 12px; }
    .settings-body { padding: 16px; }

    /* Modals */
    .confirm-modal { padding: 20px 16px; margin: 8px; }
    .confirm-modal h3 { font-size: 1rem; }

    /* Fullscreen map */
    .map-fullscreen-footer { padding: 10px 12px; gap: 8px; }
    .map-fullscreen-addr { font-size: 0.78rem; }

    /* Rating */
    .rating-stars-row { gap: 4px; }
    .rating-star-btn svg { width: 30px; height: 30px; }

    /* User profile overlay */
    .user-profile-hero { gap: 10px; }
    .user-profile-name { font-size: 1rem; }
    .user-reputation-block { padding: 10px 12px; gap: 10px; }
    .user-rep-score { font-size: 1.8rem; }

    /* Chat */
    .chat-header { padding: 10px 12px; }
    .chat-messages { padding: 10px 12px; }
}

@media (max-width: 420px) {
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .type-selector { grid-template-columns: 1fr 1fr; }
    .quick-action { padding: 10px; }
    .quick-action-icon { width: 32px; height: 32px; }

    /* Extra tiny screens: stack detail actions horizontally collapsed */
    .tab-btn-publish .tab-icon-wrap { width: 20px; height: 20px; border-radius: 6px; }
    .tab-btn-publish svg { width: 16px; height: 16px; }

    /* Espacio entre título "Mis publicaciones" y los chips de filtros */
    .my-pub-filters { padding-top: 6px; }

    /* Comunidad: misma forma que "Mis publicaciones" en móvil (grid 2-col) */
    .resource-scroll {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        overflow: visible;
    }
    .resource-card {
        min-width: 0;
        max-width: none;
        width: auto;
    }

    /* Reservar espacio para sticky ad arriba del tab-bar + pequeño respiro arriba */
    .app-content { padding-bottom: 130px; padding-top: 0; }

    /* Sticky ad pegado a la tab-bar (sin hueco entre ambas) */
    .sub-ads-sticky { bottom: 60px !important; left: 0 !important; right: 0 !important; border-radius: 0 !important; border-left: none !important; border-right: none !important; }

    /* Promo banner: ocultar figuras decorativas (roban 44% ancho) y elementos de relleno */
    .promo-grab { display: none; }
    .promo-banner-figs { display: none; }
    .promo-banner { padding: 6px 8px; gap: 4px; }
    .promo-banner-inner {
        font-size: 0.72rem;
        gap: 4px;
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
    }
    .promo-banner-text {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.72rem;
        color: var(--earth);
    }
    .promo-banner-text > * { white-space: nowrap; }
    .promo-rotator { font-size: 0.72rem; margin: 0 2px; }
    .promo-rotator s { display: none; }
    .promo-tag {
        font-size: 0.6rem;
        padding: 1px 6px;
        margin-right: 3px;
        letter-spacing: 0;
    }
    .promo-banner-cta {
        padding: 4px 7px;
        font-size: 0.68rem;
        gap: 2px;
        flex-shrink: 0;
    }
    .promo-banner-cta svg { width: 11px; height: 11px; }
    .promo-banner-close { width: 22px; height: 22px; }
    .promo-banner-close svg { width: 11px; height: 11px; }
}

/* ===== TOUR / TUTORIAL ===== */
.tour-root {
    position: fixed; inset: 0;
    z-index: 9998;
    pointer-events: auto;
}
.tour-spotlight {
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 30, 0.72);
    transition: all 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    outline: 2px solid rgba(255,255,255,0.85);
    outline-offset: 1px;
}
.tour-spotlight.tour-centered {
    box-shadow: 0 0 0 9999px rgba(15, 23, 30, 0.78);
    outline: none;
}
.tour-tooltip {
    position: absolute;
    width: min(340px, calc(100vw - 32px));
    background: var(--white, #fff);
    border-radius: 14px;
    padding: 18px 18px 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    z-index: 9999;
    transition: top 0.32s cubic-bezier(0.4,0,0.2,1), left 0.32s cubic-bezier(0.4,0,0.2,1);
}
.tour-tooltip h4 {
    margin: 6px 0 6px;
    font-size: 1.05rem;
    color: var(--earth, #2d3a2e);
}
.tour-tooltip p {
    margin: 0 0 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-muted, #555);
}
.tour-progress {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--field, #6b8e4e);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.tour-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.tour-nav { display: flex; gap: 8px; }
.tour-skip, .tour-prev, .tour-next {
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
}
.tour-skip {
    background: transparent;
    color: var(--text-muted, #777);
}
.tour-skip:hover { color: var(--earth, #2d3a2e); }
.tour-prev {
    background: rgba(0,0,0,0.06);
    color: var(--earth, #2d3a2e);
}
.tour-prev:hover { background: rgba(0,0,0,0.1); }
.tour-prev:disabled { opacity: 0.4; cursor: not-allowed; }
.tour-next {
    background: var(--field, #6b8e4e);
    color: white;
}
.tour-next:hover { background: var(--earth, #2d3a2e); }

.tour-target-active {
    position: relative;
    z-index: 9999 !important;
}

@keyframes tourPulse {
    0%, 100% { box-shadow: 0 0 0 9999px rgba(15,23,30,0.72), 0 0 0 0 rgba(107,142,78,0.55); }
    50%      { box-shadow: 0 0 0 9999px rgba(15,23,30,0.72), 0 0 0 12px rgba(107,142,78,0); }
}
.tour-spotlight:not(.tour-centered) { animation: tourPulse 2s ease-out infinite; }

#nav-tour-btn { color: var(--cream); }

/* Tour: pretty flow card for multi-step explanations */
.tour-flow { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.tour-flow-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px;
    background: var(--cream, #f5f0e8);
    border-radius: 10px;
    border-left: 3px solid var(--field, #6b8e4e);
    animation: tourFlowIn 0.32s ease-out both;
}
.tour-flow-step:nth-child(1) { animation-delay: 0.05s; }
.tour-flow-step:nth-child(2) { animation-delay: 0.15s; }
.tour-flow-step:nth-child(3) { animation-delay: 0.25s; }
.tour-flow-num {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--field, #6b8e4e), var(--earth, #2d3a2e));
    color: var(--cream, #fff);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.tour-flow-body { flex: 1; min-width: 0; }
.tour-flow-title {
    display: flex; align-items: center; gap: 6px;
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--earth, #2d3a2e);
    margin-bottom: 3px;
}
.tour-flow-title svg { width: 14px; height: 14px; color: var(--field, #6b8e4e); flex-shrink: 0; }
.tour-flow-desc {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted, #555);
}
.tour-flow-desc strong { color: var(--earth, #2d3a2e); }

@keyframes tourFlowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.tour-flow-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--field, #6b8e4e), var(--earth, #2d3a2e));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.tour-flow-icon svg { width: 16px; height: 16px; color: var(--cream, #fff); }
.tour-flow-icon-star {
    background: linear-gradient(135deg, #f5b840, #d68a1c);
}
.tour-flow-step:nth-child(4) { animation-delay: 0.35s; }
.tour-flow-step:nth-child(5) { animation-delay: 0.45s; }

/* ===================== SUBSCRIPTION / PRO / BILLING ===================== */

/* Promo banner (top) */
.promo-banner {
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light), var(--harvest));
    background-size: 250% 100%;
    color: var(--earth);
    padding: 12px 16px;
    cursor: pointer;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 4px 14px rgba(200, 150, 42, 0.35);
    font-weight: 600;
    overflow: hidden;
    animation: fadeIn 0.4s, partyShift 8s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 10px;
}
.promo-banner-figs {
    position: absolute;
    top: 0; bottom: 0;
    width: 22%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}
.promo-banner-figs-left  { left: 0; }
.promo-banner-figs-right { right: 0; }
@keyframes promoWave {
    0%   { transform: translateX(-14px) translateY(0)    rotate(-8deg); opacity: 0.15; }
    20%  { opacity: 0.6; }
    50%  { transform: translateX(14px)  translateY(-3px) rotate(8deg);  opacity: 0.6; }
    80%  { opacity: 0.6; }
    100% { transform: translateX(-14px) translateY(3px)  rotate(-8deg); opacity: 0.15; }
}
.promo-banner-figs span {
    position: absolute;
    font-size: 1rem;
    animation: promoWave 5s ease-in-out infinite;
    will-change: transform, opacity;
}
.promo-banner-figs-left  span:nth-child(1) { left: 8%;  top: 12%; animation-delay: 0s;   }
.promo-banner-figs-left  span:nth-child(2) { left: 55%; top: 58%; animation-delay: 1.2s; font-size: 0.85rem; }
.promo-banner-figs-left  span:nth-child(3) { left: 28%; top: 65%; animation-delay: 2.4s; font-size: 0.9rem; }
.promo-banner-figs-left  span:nth-child(4) { left: 70%; top: 18%; animation-delay: 3.6s; font-size: 0.8rem; }
.promo-banner-figs-right span:nth-child(1) { right: 8%;  top: 14%; animation-delay: 0.6s; }
.promo-banner-figs-right span:nth-child(2) { right: 55%; top: 60%; animation-delay: 1.8s; font-size: 0.85rem; }
.promo-banner-figs-right span:nth-child(3) { right: 28%; top: 65%; animation-delay: 3s;   font-size: 0.9rem; }
.promo-banner-figs-right span:nth-child(4) { right: 70%; top: 20%; animation-delay: 4.2s; font-size: 0.8rem; }
.promo-banner.hidden { display: none; }
.promo-banner-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    font-size: clamp(0.62rem, 1.35vw, 0.88rem);
    text-align: center;
    flex-wrap: nowrap;
    position: relative;
    z-index: 1;
    min-width: 0;
}
.promo-banner-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    justify-content: center;
}
.promo-banner-text > * { white-space: nowrap; }
.promo-banner-cta { flex-shrink: 0; }
.promo-banner-text s { opacity: 0.55; margin-right: 4px; }
.promo-banner-text strong { font-weight: 700; }
.promo-tag {
    background: #fff;
    color: #d62828;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-right: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18), 0 0 0 2px rgba(255,255,255,0.4);
    display: inline-block;
    animation: tagPulse 1.4s ease-in-out infinite;
}
.promo-grab {
    display: inline-block;
    font-weight: 800;
    letter-spacing: 0.4px;
    animation: grabBounce 1.1s ease-in-out infinite;
}
.promo-rotator {
    display: inline-block;
    margin: 0 4px;
    transition: opacity 0.28s ease, transform 0.28s ease;
    will-change: opacity, transform;
}
.promo-rotator s { opacity: 0.55; margin-right: 4px; }
.promo-rotator.rot-out { opacity: 0; transform: translateY(-6px); }
.promo-rotator.rot-in { animation: rotIn 0.32s cubic-bezier(.22,.85,.4,1.05); }
@keyframes rotIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes tagPulse {
    0%, 100% { transform: scale(1) rotate(-2deg); box-shadow: 0 2px 6px rgba(0,0,0,0.18), 0 0 0 2px rgba(255,255,255,0.4); }
    50%      { transform: scale(1.12) rotate(2deg); box-shadow: 0 4px 12px rgba(0,0,0,0.28), 0 0 0 3px rgba(255,255,255,0.7); }
}
@keyframes grabBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
@keyframes partyShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes confettiDrift {
    0%   { background-position: 0 10px, 30px 25px, 15px 5px, 50px 30px; }
    100% { background-position: 60px 10px, 110px 25px, 85px 5px, 140px 30px; }
}
.promo-banner-cta {
    background: var(--earth);
    color: var(--cream);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.promo-banner-cta:hover { background: var(--earth-mid); }
.promo-banner-cta svg { width: 14px; height: 14px; }
.promo-banner-close {
    background: rgba(0,0,0,0.2);
    border: none;
    color: inherit;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    z-index: 2;
    position: relative;
    margin-left: auto;
}
.promo-banner-close:hover { background: rgba(0,0,0,0.3); }
.promo-banner-close svg { width: 14px; height: 14px; }

/* ===== Mobile ad placements (in-feed, native, sticky) ===== */
.ad-infeed {
    display: block;
    background: linear-gradient(135deg, #fff, #faf7f0);
    border: 1px solid var(--cream-dark);
    border-left: 3px solid var(--harvest);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin: 6px 0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}
.ad-infeed:active { transform: scale(0.98); }
.ad-infeed-tag {
    display: inline-block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: var(--cream);
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: 600;
}
.ad-infeed-body {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ad-infeed-icon {
    font-size: 1.6rem;
    width: 40px; height: 40px;
    background: var(--cream);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ad-infeed-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ad-infeed-text strong { font-size: 0.88rem; color: var(--earth); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-infeed-text span { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-infeed-cta {
    background: var(--harvest);
    color: var(--earth);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
}
.ad-infeed-cta:hover { background: var(--harvest-light); }

/* Sticky bottom banner (panel publicar móvil) */
.sub-ads-sticky {
    display: none;
}
@media (max-width: 520px) {
    .sub-ads-sticky {
        display: block;
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 70px;
        z-index: 25;
        background: #fff;
        border: 1px solid var(--cream-dark);
        border-radius: 12px;
        box-shadow: 0 4px 14px rgba(0,0,0,0.12);
        padding: 2px 28px 2px 6px;
        animation: stickyAdRise 0.3s ease-out;
    }
    .sub-ads-sticky .ad-infeed {
        margin: 0;
        padding: 2px 4px;
        border: none;
        border-left: none;
        background: transparent;
        box-shadow: none;
    }
    .sub-ads-sticky .ad-infeed-tag { display: none; }
    .sub-ads-sticky .ad-infeed-icon { width: 30px; height: 30px; font-size: 1.2rem; }
    .sub-ads-sticky .ad-infeed-text strong { font-size: 0.78rem; }
    .sub-ads-sticky .ad-infeed-text span { font-size: 0.68rem; }
    .sub-ads-sticky-close {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: rgba(0,0,0,0.08);
        border: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        color: var(--text-muted);
        z-index: 2;
    }
    .sub-ads-sticky-close:hover { background: rgba(0,0,0,0.16); }
    .sub-ads-sticky-close svg { width: 12px; height: 12px; }
}
@keyframes stickyAdRise {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Native ad card (móvil inicio + perfil) */
.sub-ads-mobile-native {
    display: none;
}
@media (max-width: 520px) {
    .sub-ads-mobile-native {
        display: block;
        margin: 10px 16px;
    }
    /* En móvil, ocultar slots de sidebar derecho */
    .sub-ads-slot-right { display: none; }
}

.promo-leaf-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    margin: 0 4px;
    border-radius: 10px;
    background: rgba(255,255,255,0.4);
    box-shadow: inset 0 0 0 1px rgba(74,124,89,0.25);
    font-weight: 700;
    perspective: 400px;
    vertical-align: middle;
}
.promo-leaf-countdown .leaf-unit { display: inline-flex; align-items: baseline; gap: 1px; }
.promo-leaf-countdown .leaf-num {
    display: inline-block;
    min-width: 1.7em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    transform-origin: 50% 100%;
    color: var(--earth);
}
.promo-leaf-countdown .leaf-num.flip { animation: leafFlip 0.55s cubic-bezier(.22,.85,.4,1.05); }
.promo-leaf-countdown .leaf-lbl { font-size: 0.7em; opacity: 0.65; margin-left: 1px; font-weight: 600; }
.promo-leaf-countdown .leaf-sep {
    display: inline-block;
    font-size: 0.85em;
    animation: leafSway 2.6s ease-in-out infinite;
    transform-origin: 50% 100%;
}
.promo-leaf-countdown .leaf-sep:nth-of-type(4) { animation-delay: -1.3s; }

@keyframes leafFlip {
    0%   { transform: rotateX(0deg)   translateY(0); opacity: 1; }
    45%  { transform: rotateX(-90deg) translateY(2px); opacity: 0.4; }
    55%  { transform: rotateX(90deg)  translateY(-2px); opacity: 0.4; }
    100% { transform: rotateX(0deg)   translateY(0); opacity: 1; }
}
@keyframes leafSway {
    0%, 100% { transform: rotate(-12deg) translateY(0); }
    50%      { transform: rotate(12deg)  translateY(-2px); }
}

/* Home card */
.sub-home-card {
    margin: 12px 16px 16px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--cream-dark);
}
.sub-home-card.sub-card-expired { border-left: 4px solid var(--danger); background: #fff5f3; }
.sub-home-card.sub-card-free { border-left: 4px solid var(--harvest); }
.sub-home-card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.sub-home-card-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600;
    color: var(--earth);
}
.sub-home-card-title svg { width: 18px; height: 18px; color: var(--harvest); }
.sub-home-card-action {
    background: var(--earth);
    color: var(--cream);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.sub-home-card-action:hover { background: var(--earth-mid); }
.sub-posts-line {
    display: flex; justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.sub-posts-count strong { color: var(--earth); font-size: 1rem; }
.sub-posts-bar {
    height: 6px;
    background: var(--cream-dark);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
}
.sub-posts-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--field), var(--harvest));
    transition: width 0.3s;
}
.sub-home-card-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}
.sub-home-card-hint strong { color: var(--earth); }

/* Ads sidebar */
.sub-ads-bar { margin: 10px 16px 0; }
.sub-ads-slot { margin: 10px 16px; cursor: pointer; }
.sub-ads-slot-top { margin-top: 8px; }
.sub-ads-slot-bottom { margin-bottom: 80px; }
/* Panel con ad lateral derecha reserva espacio a la derecha */
.panel-with-right-ad {
    padding-right: 170px;
}
.sub-ads-slot-right {
    position: fixed;
    top: var(--ad-top, 64px);
    right: 0;
    bottom: 100px; /* respeto adicional sobre tab-bar */
    width: 160px;
    margin: 0;
    padding: 8px 8px 16px;
    background: transparent;
    border-left: none;
    overflow: hidden;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 0;
}
/* Cabecera pequeña del slot */
.sub-ads-slot .ad-slot-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.sub-ads-slot .ad-slot-header .ad-sponsored { margin: 0; font-size: 0.65rem; }
.sub-ads-slot .ad-slot-header .ad-remove { position: static; padding: 2px; }
/* Contenedor tiles */
.ad-tiles { display: flex; gap: 8px; }
.ad-tiles-v { flex-direction: column; }
.ad-tiles-h { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
.ad-tiles-h::-webkit-scrollbar { height: 4px; }
.ad-tiles-h::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 4px; }

/* Tile individual */
.ad-tile {
    background: linear-gradient(135deg, #fff, #faf7f0);
    border: 1px solid var(--cream-dark,#e8dfc8);
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    display: flex;
    transition: transform 0.15s, box-shadow 0.15s;
}
.ad-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.ad-tile-v {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    flex: 1 1 0;
    min-height: 110px;
    max-height: 180px;
    padding: 10px 8px;
    justify-content: flex-start;
}
.ad-tile-v .ad-tile-cta { margin-top: auto !important; }
.sub-ads-slot-right .ad-tiles-v {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.ad-tile-v .ad-tile-cta { padding: 4px 8px; font-size: 0.68rem; margin-top: 2px; }
.ad-tile-v .ad-tile-text strong { font-size: 0.78rem; }
.ad-tile-v .ad-tile-text span {
    font-size: 0.68rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ad-tile-h {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 200px;
    max-width: 240px;
    flex: 1 0 auto;
}
.ad-tile-icon { font-size: 1.8rem; line-height: 1; }
.ad-tile-v .ad-tile-icon { font-size: 2rem; }
.ad-tile-text { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.ad-tile-text strong { font-size: 0.82rem; color: var(--earth); line-height: 1.2; }
.ad-tile-text span { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.ad-tile-cta {
    background: var(--earth);
    color: var(--cream);
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    align-self: stretch;
}
.ad-tile-h .ad-tile-cta { align-self: flex-start; }

@media (max-width: 520px) {
    .panel-with-right-ad { padding-right: 0; }
    .sub-ads-slot-right {
        position: static;
        width: auto;
        height: auto;
        bottom: auto;
        top: auto;
        margin: 10px 16px;
        border: none;
        background: transparent;
    }
    .ad-tiles-v { flex-direction: row; overflow-x: auto; }
    .ad-tile-v { min-width: 140px; flex: 0 0 auto; }
}
.ad-slot-vertical .ad-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.ad-slot-vertical .ad-body .ad-cta { align-self: stretch; text-align: center; }
.ad-slot-compact { padding: 8px 10px; }
.ad-slot-compact .ad-icon { font-size: 1.4rem; }
.ad-slot-compact .ad-text strong { font-size: 0.85rem; }
.ad-slot-compact .ad-text span { font-size: 0.72rem; }
.ad-slot-compact .ad-cta { padding: 5px 10px; font-size: 0.72rem; }
.ad-card-overlay-inner {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 18px;
    max-width: 420px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.ad-card-hero {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--cream-dark);
    padding-bottom: 10px;
}
.ad-card-icon {
    font-size: 2.8rem;
    background: var(--cream);
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}
.ad-slot {
    background: linear-gradient(135deg, #fff, #faf7f0);
    border: 1px dashed var(--cream-dark);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    position: relative;
}
.ad-sponsored {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
.ad-body {
    display: flex; align-items: center; gap: 10px;
}
.ad-icon { font-size: 1.8rem; }
.ad-text { flex: 1; display: flex; flex-direction: column; }
.ad-text strong { font-size: 0.92rem; color: var(--earth); }
.ad-text span { font-size: 0.78rem; color: var(--text-muted); }
.ad-cta {
    background: var(--earth);
    color: var(--cream);
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.ad-remove {
    position: absolute;
    top: 6px; right: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.ad-remove svg { width: 14px; height: 14px; }
.ad-remove:hover { color: var(--earth); }

/* Overlays */
.sub-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,36,16,0.7);
    z-index: 200;
    display: none;
    overflow-y: auto;
    padding: 20px;
    align-items: flex-start;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.sub-overlay.visible { display: flex; }
.sub-overlay > div {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    padding: 24px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: fadeIn 0.25s;
    margin: auto;
}
.plans-close {
    position: absolute;
    top: 12px; right: 12px;
    background: var(--cream);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--earth);
    z-index: 2;
}
.plans-close:hover { background: var(--cream-dark); }
.plans-close svg { width: 18px; height: 18px; }

body.no-scroll { overflow: hidden; }

/* Plans overlay */
.plans-hero {
    text-align: center;
    padding: 16px 0 20px;
    border-bottom: 1px solid var(--cream-dark);
    margin-bottom: 20px;
}
.plans-crown {
    width: 64px; height: 64px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(200,150,42,0.35);
}
.plans-crown svg { width: 32px; height: 32px; color: var(--white); }
.plans-hero h2 {
    font-size: 1.6rem;
    color: var(--earth);
    margin-bottom: 4px;
}
.plans-hero p { color: var(--text-muted); margin-bottom: 18px; font-size: 0.9rem; }
.plans-price-box { margin-bottom: 16px; position: relative; }
.plans-discount-badge {
    position: absolute;
    top: -6px; right: 20%;
    background: var(--danger);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    transform: rotate(-6deg);
}
.plans-price-old { color: var(--text-muted); font-size: 1rem; }
.plans-price-now {
    display: flex; align-items: baseline; justify-content: center;
    gap: 4px;
    margin-top: 4px;
}
.plans-price-amount {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--earth);
    font-weight: 700;
    line-height: 1;
}
.plans-price-per { color: var(--text-muted); font-size: 0.95rem; }
.plans-price-promo-hint {
    margin-top: 6px;
    color: var(--harvest);
    font-size: 0.85rem;
    font-weight: 600;
}
.plans-cta { margin: 8px 0 10px; }
.plans-legal {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
}
/* Plan cards (two-tier) */
.plans-hero-compact { padding: 16px 12px 8px; }
.plan-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 14px 0 18px;
}
@media (max-width: 520px) {
    .plan-cards { grid-template-columns: 1fr; }
}
.plan-card {
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: 14px;
    padding: 16px 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.plan-card-highlight {
    border-color: var(--harvest);
    background: linear-gradient(180deg, #fffaef, var(--white));
    box-shadow: 0 6px 18px rgba(200,150,42,0.15);
}
.plan-card-ribbon {
    position: absolute;
    top: -10px; right: 12px;
    background: var(--harvest);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0.04em;
}
.plan-card-head { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.plan-card-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--cream);
    display: flex; align-items: center; justify-content: center;
    color: var(--earth);
    margin-bottom: 4px;
}
.plan-card-highlight .plan-card-icon { background: var(--harvest); color: #fff; }
.plan-card-head h3 { font-family: var(--font-serif,'Playfair Display', serif); font-size: 1.15rem; color: var(--earth); margin: 0; }
.plan-card-tag { font-size: 0.72rem; color: var(--text-muted); margin: 0; }
.plan-card-price {
    text-align: center;
    padding: 10px 8px;
    border-top: 1px solid var(--cream-dark);
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    gap: 4px 6px;
    line-height: 1.1;
}
.plan-card-price s { opacity: 0.5; font-size: 0.8rem; }
.plan-card-price strong { font-size: 1.6rem; color: var(--earth); font-weight: 800; }
.plan-card-price span { color: var(--text-muted); font-size: 0.78rem; }
.plan-card-disc {
    display: inline-block;
    background: var(--harvest);
    color: #fff;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-basis: 100%;
    margin-top: 2px;
    align-self: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 480px) {
    .plan-card-price {
        flex-direction: column;
        gap: 2px;
        padding: 12px 6px;
    }
    .plan-card-price > .plan-card-price-row {
        display: flex; align-items: baseline; justify-content: center; gap: 4px;
    }
    .plan-card-price s { font-size: 0.75rem; }
    .plan-card-price strong { font-size: 1.5rem; }
    .plan-card-disc { margin-top: 4px; }
}
.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.plan-card-features li {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.82rem;
    padding: 4px 0;
}
.plan-card-features li i[data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }
.plan-feat-ok { color: var(--text); }
.plan-feat-ok i[data-lucide] { color: var(--success,#16a34a); }
.plan-feat-no { color: var(--text-muted); text-decoration: line-through; }
.plan-feat-no i[data-lucide] { color: var(--text-muted); }

.plans-features h3, .plans-comparison h3 {
    font-size: 1rem;
    color: var(--earth);
    margin-bottom: 12px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
}
.plans-feature {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--cream-dark);
}
.plans-feature:last-child { border-bottom: none; }
.plans-feature-icon {
    width: 40px; height: 40px;
    background: var(--cream);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.plans-feature-icon svg { width: 20px; height: 20px; color: var(--earth); }
.plans-feature-text { flex: 1; display: flex; flex-direction: column; }
.plans-feature-text strong { color: var(--earth); font-size: 0.92rem; }
.plans-feature-text span { color: var(--text-muted); font-size: 0.8rem; }
.plans-feature-check { color: var(--success); flex-shrink: 0; }
.plans-feature-check { width: 20px; height: 20px; }
.plans-comparison { margin: 20px 0; }
.plans-comparison table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.plans-comparison th, .plans-comparison td {
    padding: 8px 4px;
    text-align: left;
    border-bottom: 1px solid var(--cream-dark);
}
.plans-comparison th {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plans-comparison td:nth-child(2), .plans-comparison td:nth-child(3) {
    text-align: center;
    color: var(--earth);
    font-weight: 600;
}
.plans-comparison td:nth-child(3) { color: var(--harvest); }

/* Paywall overlay */
.paywall-overlay-inner { text-align: center; }
.paywall-icon {
    width: 72px; height: 72px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--danger), #e65a4b);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(192,57,43,0.3);
}
.paywall-icon svg { width: 36px; height: 36px; color: var(--white); }
.paywall-overlay-inner h2 { color: var(--earth); margin-bottom: 10px; }
.paywall-message { color: var(--text-muted); margin-bottom: 18px; font-size: 0.9rem; }
.paywall-price {
    display: flex; align-items: baseline; justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
    position: relative;
}
.paywall-price s { color: var(--text-muted); font-size: 1rem; }
.paywall-price strong {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--earth);
}
.paywall-price span:not(.paywall-discount) { color: var(--text-muted); font-size: 0.9rem; }
.paywall-discount {
    background: var(--success);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

/* Checkout */
.checkout-wompi-header {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #00d084 0%, #00b8d9 100%);
    color: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 184, 217, 0.25);
}
.wompi-brand { display: flex; align-items: center; gap: 8px; }
.wompi-logo {
    background: #fff;
    color: #00b8d9;
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    font-family: -apple-system, sans-serif;
}
.wompi-name { font-weight: 800; font-size: 1.05rem; letter-spacing: 0.5px; }
.wompi-secure {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255,255,255,0.18);
    padding: 4px 10px;
    border-radius: 999px;
}
.wompi-secure svg { width: 14px; height: 14px; }
.checkout-summary-slim {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px !important;
    margin-bottom: 16px;
}
.checkout-summary-slim span { color: var(--earth); font-weight: 600; font-size: 0.95rem; }
.checkout-summary-slim strong { color: var(--earth); font-size: 1.15rem; font-weight: 800; }
.checkout-secure-bar {
    display: flex; align-items: center; gap: 8px;
    background: #f0f8f0;
    border: 1px solid #c8e6c9;
    color: var(--success);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-bottom: 16px;
}
.checkout-secure-bar svg { width: 16px; height: 16px; }
.checkout-brands {
    margin-left: auto;
    display: flex; gap: 4px;
}
.checkout-brands span {
    background: var(--white);
    border: 1px solid var(--cream-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--earth);
}
.checkout-overlay-inner h2 { color: var(--earth); margin-bottom: 14px; }
.checkout-summary {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 18px;
}
.checkout-summary div {
    display: flex; justify-content: space-between;
    padding: 4px 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.checkout-summary div strong { color: var(--earth); }
.checkout-total {
    border-top: 1px solid var(--cream-dark);
    margin-top: 6px;
    padding-top: 8px !important;
    font-size: 1rem !important;
}
.checkout-total strong { font-size: 1.2rem; color: var(--earth) !important; }
.checkout-form .form-group { margin-bottom: 12px; }
.checkout-demo-note {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fff9e0;
    border: 1px solid #f0d97c;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--soil);
    margin: 10px 0 14px;
}
.checkout-demo-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.checkout-demo-note code {
    background: var(--white);
    padding: 1px 4px;
    border-radius: 4px;
    font-size: 0.75rem;
}
.checkout-legal {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

/* ===== Fireworks ===== */
#fireworks-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}
.firework-burst {
    position: absolute;
    width: 0; height: 0;
}
.firework-particle {
    position: absolute;
    left: 0; top: 0;
    width: 7px; height: 7px;
    border-radius: 50%;
    transform: translate(0, 0) scale(1);
    opacity: 1;
    animation: fwBurst 1.2s cubic-bezier(.18,.7,.4,1) forwards;
    box-shadow: 0 0 8px currentColor;
}
@keyframes fwBurst {
    0%   { transform: translate(0,0) scale(0.4); opacity: 1; }
    60%  { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(0.6); opacity: 0; }
}

/* ===== Success paid (estilo welcome) ===== */
.success-paid-inner .success-trophy {
    background: linear-gradient(135deg, #ffd166, #ff9966, #ef476f);
    color: #fff;
    box-shadow: 0 6px 18px rgba(239,71,111,0.35);
    animation: trophyPulse 1.4s ease-in-out infinite;
}
.success-paid-inner .success-receipt {
    margin-top: 14px;
}
@keyframes trophyPulse {
    0%, 100% { transform: scale(1) rotate(-3deg); }
    50%      { transform: scale(1.08) rotate(3deg); }
}
.spin { animation: spin 1s linear infinite; }
.btn.loading { opacity: 0.7; pointer-events: none; }

/* Success */
.success-overlay-inner { text-align: center; }
.success-check {
    width: 80px; height: 80px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--success), #2ecc71);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(39,174,96,0.3);
    animation: fadeIn 0.4s;
}
.success-check svg { width: 44px; height: 44px; color: var(--white); }
.success-overlay-inner h2 { color: var(--earth); margin-bottom: 8px; }
.success-overlay-inner p { color: var(--text-muted); margin-bottom: 20px; }
.success-receipt {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    text-align: left;
}
.success-receipt div {
    display: flex; justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
}
.success-receipt strong { color: var(--earth); font-family: 'DM Sans', monospace; }

/* Matches */
.matches-overlay-inner h2 { color: var(--earth); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.matches-intro { color: var(--text-muted); font-size: 0.82rem; margin: 0; line-height: 1.4; }
.matches-header { margin-bottom: 14px; }
.matches-title-row { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.matches-icon-wrap {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.matches-icon-wrap svg { width: 22px; height: 22px; }
.matches-filter-row {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding-top: 4px;
}
.match-filter-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--white);
    border: 1px solid var(--cream-dark);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.match-filter-chip svg { width: 12px; height: 12px; }
.match-filter-chip:hover { border-color: var(--field); color: var(--earth); }
.match-filter-chip.active { background: var(--earth); color: var(--cream); border-color: var(--earth); }
.match-filter-count {
    background: rgba(0,0,0,0.08);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}
.match-filter-chip.active .match-filter-count { background: rgba(255,255,255,0.22); }

.matches-list { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 2px; }
.matches-empty { padding: 32px 16px; text-align: center; }
.matches-empty svg { width: 32px; height: 32px; color: var(--text-muted); margin-bottom: 8px; }
.matches-empty h3 { color: var(--earth); font-size: 1rem; margin: 0 0 6px; }
.matches-empty p { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 12px; }

.match-card {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--cream-dark);
    border-left: 4px solid var(--field);
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 2px 6px rgba(44,62,31,0.04);
}
.match-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(44,62,31,0.08); border-color: var(--field); }
.match-card-oferta { border-left-color: var(--success); }
.match-card-solicitud { border-left-color: var(--info); }
.match-card-prestamo { border-left-color: var(--harvest); }
.match-card-trueque { border-left-color: var(--field); }

.match-card-top {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.match-tipo-pill {
    display: inline-flex; align-items: center; gap: 4px;
    text-transform: none;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--earth);
    color: var(--cream);
}
.match-tipo-pill svg { width: 12px; height: 12px; }
.match-tipo-oferta { background: var(--success); }
.match-tipo-solicitud { background: var(--info); }
.match-tipo-prestamo { background: var(--harvest); }
.match-tipo-trueque { background: var(--field); }
.match-muni { display: inline-flex; align-items: center; gap: 3px; }
.match-muni svg { width: 12px; height: 12px; }
.match-ago { margin-left: auto; opacity: 0.85; }

.match-title { color: var(--earth); font-size: 0.95rem; font-weight: 700; margin: 0 0 4px; font-family: 'DM Sans', sans-serif; }
.match-desc { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 8px; line-height: 1.4; }
.match-meta-row {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.75rem; color: var(--text-muted);
    margin-bottom: 6px;
}
.match-author { display: inline-flex; align-items: center; gap: 4px; }
.match-author svg { width: 12px; height: 12px; }
.match-rating { background: var(--cream); border-radius: 999px; padding: 1px 7px; font-weight: 600; margin-left: 4px; font-size: 0.7rem; }
.match-hint {
    font-size: 0.72rem;
    color: var(--soil);
    margin: 6px 0;
    background: var(--cream);
    padding: 5px 8px;
    border-radius: 6px;
    font-style: italic;
}
.match-hint em { font-style: normal; font-weight: 600; color: var(--earth); }
.match-cta {
    width: 100%;
    margin-top: 4px;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}
.match-cta svg { width: 14px; height: 14px; }

.btn-sm { padding: 4px 10px; font-size: 0.78rem; }
.verified-inline { width: 14px; height: 14px; color: var(--info); vertical-align: middle; }

/* Support */
.support-overlay-inner h2 { color: var(--earth); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.support-priority-note {
    background: #fff4d6;
    border: 1px solid var(--harvest-light);
    color: var(--soil);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 14px;
}
.support-priority-note svg { width: 14px; height: 14px; color: var(--harvest); }
.support-normal-note { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 14px; }
.support-normal-note a { color: var(--earth); font-weight: 600; cursor: pointer; text-decoration: underline; }
.support-tickets { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.ticket-item {
    background: var(--cream);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
.ticket-item:hover { background: var(--cream-dark); }
.ticket-item.ticket-priority { border-left: 3px solid var(--harvest); }
.ticket-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.ticket-head strong { color: var(--earth); font-size: 0.9rem; }
.ticket-status {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
}
.ticket-open { background: var(--success); color: var(--white); }
.ticket-pending { background: var(--harvest); color: var(--earth); }
.ticket-closed { background: var(--text-muted); color: var(--white); }
.ticket-item p { font-size: 0.8rem; color: var(--text-muted); margin: 2px 0; }
.ticket-item small { font-size: 0.7rem; color: var(--text-muted); }

/* Ticket thread */
.ticket-overlay-inner h3 { color: var(--earth); margin-bottom: 4px; }
.ticket-overlay-inner small { color: var(--text-muted); font-size: 0.78rem; }
.priority-tag {
    background: var(--harvest);
    color: var(--earth);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}
.ticket-messages {
    max-height: 40vh; overflow-y: auto;
    margin: 14px 0;
    padding: 10px;
    background: var(--cream);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column; gap: 8px;
}
.ticket-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
}
.ticket-msg-head { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 2px; }
.ticket-msg-user { align-self: flex-end; background: var(--earth); color: var(--cream); }
.ticket-msg-user .ticket-msg-head { color: rgba(245,240,232,0.7); }
.ticket-msg-admin { align-self: flex-start; background: var(--white); border: 1px solid var(--cream-dark); color: var(--text); }
.ticket-reply-bar {
    display: flex; gap: 8px;
    border-top: 1px solid var(--cream-dark);
    padding-top: 10px;
}
.ticket-reply-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--cream-dark);
    border-radius: 999px;
    font-size: 0.88rem;
}
.ticket-reply-bar button { padding: 8px 14px; }

/* Chat-style ticket modal */
.ticket-chat-inner {
    display: flex; flex-direction: column;
    height: 80vh; max-height: 80vh;
    padding: 0 !important;
}
.ticket-chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--cream-dark);
    background: var(--cream);
    border-radius: var(--radius) var(--radius) 0 0;
}
.ticket-chat-header .plans-close {
    position: static;
    background: transparent; border: none; cursor: pointer;
    color: var(--earth);
}
.ticket-chat-messages {
    flex: 1;
    max-height: none !important;
    padding: 12px 14px;
    background: var(--cream);
}
.ticket-chat-input {
    padding: 10px 12px;
    border-top: 1px solid var(--cream-dark);
    background: var(--white);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* New ticket */
.new-ticket-inner h2 { color: var(--earth); margin-bottom: 14px; }

/* Invoices */
.invoices-overlay-inner h2 { color: var(--earth); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.invoices-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.invoice-item {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}
.invoice-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 4px;
}
.invoice-head strong { color: var(--earth); font-size: 1.1rem; }
.invoice-status {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}
.invoice-paid { background: var(--success); color: var(--white); }
.invoice-declined { background: var(--danger); color: var(--white); }
.invoice-item small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.invoice-ref { font-family: monospace; margin-top: 2px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 8px; opacity: 0.5; }
.empty-state p { font-size: 0.88rem; }

/* Verified tick on avatar */
.nav-avatar { position: relative; }
.verified-tick {
    position: absolute;
    bottom: -2px; right: -2px;
    width: 16px; height: 16px;
    background: var(--info);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--white);
}
.verified-tick svg { width: 10px; height: 10px; color: var(--white); }

/* Pro chip (inline in menu items) */
.pro-chip {
    display: inline-block;
    background: linear-gradient(135deg, var(--harvest), var(--harvest-light));
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
}

/* Admin subscription badges */
.sub-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sub-badge-trial { background: #e8f1ff; color: var(--info); }
.sub-badge-active { background: #e0f5e5; color: var(--success); }
.sub-badge-expired { background: #ffe4e0; color: var(--danger); }
.sub-badge-cancelled { background: #f0f0f0; color: var(--text-muted); }

/* Welcome trial modal */
.welcome-overlay-inner { text-align: center; }
.welcome-gift {
    width: 84px; height: 84px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--field), var(--harvest));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(200,150,42,0.35);
    animation: fadeIn 0.4s;
}
.welcome-gift svg { width: 42px; height: 42px; color: var(--white); }
.welcome-overlay-inner h2 { color: var(--earth); margin-bottom: 8px; }
.welcome-sub { color: var(--text-muted); margin-bottom: 18px; font-size: 0.95rem; }
.welcome-sub strong { color: var(--earth); font-size: 1.1rem; }
.welcome-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}
.welcome-features li {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--earth);
}
.welcome-features svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

.plans-active-notice {
    display: flex; align-items: center; gap: 10px;
    background: #e0f5e5;
    border: 1px solid #b7e0c2;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 8px 0 10px;
    text-align: left;
}
.plans-active-notice svg { width: 24px; height: 24px; color: var(--success); flex-shrink: 0; }
.plans-active-notice strong { display: block; color: var(--earth); font-size: 0.92rem; }
.plans-active-notice small { color: var(--text-muted); font-size: 0.78rem; }

/* Password visibility toggle */
.pw-wrap { position: relative; width: 100%; }
.pw-wrap input.form-input { padding-right: 42px; width: 100%; }
.pw-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.pw-eye:hover { background: var(--cream); color: var(--earth); }
.pw-eye:focus { outline: 2px solid var(--field); outline-offset: 2px; }
.pw-eye svg { width: 18px; height: 18px; }

/* Promo banner — mobile compact */
@media (max-width: 640px) {
    .promo-banner {
        padding: 8px 10px;
        box-shadow: none;
        margin-bottom: -1px;
        border-bottom: none;
    }
    .promo-banner-inner {
        font-size: 0.68rem;
        gap: 6px;
        overflow: hidden;
        flex-wrap: nowrap;
    }
    .promo-banner-text {
        gap: 3px;
        justify-content: flex-start;
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .promo-banner-text > * { white-space: nowrap; }
    .promo-banner-text strong { font-weight: 600; }
    .promo-rotator { font-size: 0.66rem; margin: 0 2px; }
    .promo-banner-text s { font-size: 0.62rem; margin-right: 2px; opacity: 0.6; display: inline; }
    .promo-banner-text .promo-grab { display: none; }
    .promo-tag {
        font-size: 0.6rem;
        padding: 1px 5px;
        margin-right: 3px;
        letter-spacing: 0;
    }
    .promo-banner-cta {
        padding: 7px 9px;
        border-radius: 6px;
        min-height: 32px;
        flex-shrink: 0;
        gap: 0;
    }
    .promo-banner-cta-label { display: none; }
    .promo-banner-cta svg { width: 14px; height: 14px; }
    .promo-banner-close {
        width: 32px; height: 32px;
    }
}
@media (max-width: 380px) {
    .promo-banner-inner { font-size: 0.62rem; }
    .promo-rotator { font-size: 0.6rem; }
    .promo-banner-cta { padding: 6px 7px; min-height: 30px; }
}


/* ===== DETAIL: image as field, centered title, description as info-item, NA gray ===== */
.detail-image-field {
    margin: 0 0 12px;
    cursor: zoom-in;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--cream-dark);
    background: var(--cream);
    aspect-ratio: 1 / 1;
    position: relative;
}
.detail-image-field img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform .2s;
    background: var(--cream);
}
.detail-image-field-wrap {
    display: flex;
    flex-direction: column;
    max-width: 380px;
    margin: 0 auto;
}
.detail-image-field-wrap .detail-image-field { margin: 0; }
.detail-media-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0 auto 18px;
    max-width: 760px;
}
.detail-media-row .detail-image-field-wrap,
.detail-media-row .detail-map-field {
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.detail-media-row .detail-image-field {
    flex: 1 1 auto;
    width: 100%;
    aspect-ratio: auto;
    min-height: 0;
}
.detail-media-row .detail-image-field img { height: 100%; }
.detail-media-row .detail-map-field .map-block {
    background: transparent;
    border: none;
    margin-top: 0;
    overflow: visible;
    display: block;
}
.detail-media-row .detail-map-field .map-container {
    height: 150px !important;
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    overflow: hidden;
    margin-bottom: 6px;
}
.detail-media-row .detail-map-field .map-open-btn { display: flex !important; position: relative; z-index: 2; margin-bottom: 16px; }
.detail-media-row .detail-map-field .detail-indicaciones-item {
    flex: 0 0 auto;
    margin-top: 32px !important;
    padding: 8px 10px;
    clear: both;
}
.detail-media-row .detail-map-field .detail-indicaciones-item .detail-info-label { font-size: 0.62rem; margin-bottom: 2px; }
.detail-media-row .detail-map-field .detail-indicaciones-item .detail-info-value { font-size: 0.72rem; line-height: 1.3; }
.detail-media-row .detail-map-field .map-address { display: none; }
.detail-media-row .detail-map-field .map-open-btn {
    margin-top: 6px;
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}
.detail-media-row .detail-map-field .map-open-btn svg { width: 12px; height: 12px; }
.detail-title-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 4px 0 14px;
    padding: 18px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(245,240,232,0.7));
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(61,84,41,0.12), 0 1px 3px rgba(61,84,41,0.08);
    border: 1px solid var(--cream-dark);
}
.detail-owner-compact {
    padding: 10px 12px;
    margin-bottom: 16px;
    gap: 10px;
}
.detail-owner-compact .detail-owner-avatar { width: 36px; height: 36px; border-radius: 10px; font-size: 0.85rem; }
.detail-owner-compact h4 { font-size: 0.9rem; }
.detail-owner-compact p { font-size: 0.72rem; }
.detail-section {
    background: var(--white);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.detail-section-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}
.detail-section-heading svg { width: 14px; height: 14px; color: var(--field); }
.detail-section-body {
    white-space: pre-wrap;
    line-height: 1.55;
    color: var(--text);
    font-size: 0.92rem;
}
.detail-section .detail-info-grid { margin-bottom: 0; }
.detail-title-big {
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.5px;
    color: var(--earth);
    text-align: center;
    text-shadow: 0 2px 4px rgba(61,84,41,0.18), 0 1px 2px rgba(0,0,0,0.08);
}
.detail-title-badge { flex-shrink: 0; }
@media (max-width: 480px) {
    .detail-title-big { font-size: 1.65rem; }
    .detail-title-row { padding: 14px 12px; }
}
@media (max-width: 720px) {
    .detail-media-row {
        grid-template-columns: 1fr 1fr;
        max-width: 540px;
        gap: 14px;
    }
}
.detail-image-field:hover img { transform: scale(1.02); }
.detail-image-zoom-hint {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 0;
    background: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.detail-image-zoom-hint svg { width: 12px; height: 12px; }
.detail-title-centered {
    text-align: center;
    font-size: 1.45rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 6px 0 14px;
    color: var(--earth);
}
.detail-desc-item {
    margin-bottom: 14px;
}
.detail-info-na .detail-info-value {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}
.detail-indicaciones-item { background: var(--cream); }
.detail-info-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    grid-column: 1 / -1;
}
.detail-info-pair .detail-info-item { margin: 0; }
@media (max-width: 480px) {
    .detail-info-pair { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ===== STATS GRID (animated) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 540px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
.stat-card {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    padding: 20px 14px 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(44,62,31,0.10);
    border: 1px solid var(--cream-dark);
    overflow: hidden;
    animation: fadeUp .55s ease both;
    transition: transform .25s, box-shadow .25s;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(44,62,31,0.18);
}
.stat-card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    animation: logoFloat 4s ease-in-out infinite;
}
.stat-card-icon svg { width: 24px; height: 24px; }
.stat-card-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--earth);
    line-height: 1;
}
.stat-card-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-card-deco {
    position: absolute;
    width: 80px; height: 80px;
    border-radius: 50%;
    bottom: -40px; right: -40px;
    background: radial-gradient(circle, rgba(200,150,42,0.10) 0%, transparent 70%);
    pointer-events: none;
}
.stat-card-green .stat-card-icon { background: linear-gradient(135deg, rgba(122,154,60,0.20), rgba(61,84,41,0.20)); color: var(--field); }
.stat-card-green .stat-card-deco { background: radial-gradient(circle, rgba(122,154,60,0.12) 0%, transparent 70%); }
.stat-card-blue .stat-card-icon  { background: linear-gradient(135deg, rgba(41,128,185,0.18), rgba(41,128,185,0.10)); color: var(--info); }
.stat-card-blue .stat-card-deco  { background: radial-gradient(circle, rgba(41,128,185,0.10) 0%, transparent 70%); }
.stat-card-gold .stat-card-icon  { background: linear-gradient(135deg, rgba(200,150,42,0.22), rgba(232,184,75,0.22)); color: var(--harvest); }
.stat-card-gold .stat-card-deco  { background: radial-gradient(circle, rgba(200,150,42,0.14) 0%, transparent 70%); }
.stat-card-red .stat-card-icon   { background: linear-gradient(135deg, rgba(192,57,43,0.18), rgba(192,57,43,0.10)); color: var(--danger); }

/* ===== PLANS CURRENT INFO BANNER ===== */
.plans-current-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(122,154,60,0.10), rgba(200,150,42,0.10));
    border: 1px solid rgba(122,154,60,0.25);
    border-radius: 12px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.85rem;
    color: var(--earth);
    line-height: 1.4;
}
.plans-current-info svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--field); }
.plans-current-info strong { color: var(--earth); }

/* ===== MOBILE: my-pub cards, stats, profile-stats ===== */
@media (max-width: 520px) {
    .my-resources-list { padding: 0 16px 12px; }
    .my-resource-item { padding: 8px 8px; }
    .my-resource-item h4 { font-size: 0.78rem !important; }
    .my-resource-item .type-badge { font-size: 0.55rem !important; padding: 1px 5px !important; }
    .stats-grid { gap: 10px; }
    .stat-card { padding: 16px 10px 12px; }
    .stat-card-icon { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 6px; }
    .stat-card-icon svg { width: 20px; height: 20px; }
    .stat-card-value { font-size: 1.5rem; }
    .stat-card-label { font-size: 0.62rem; }
    .my-pub-filters { padding: 0 16px 6px; }
    .my-pub-chip { font-size: 0.65rem; padding: 3px 8px; }
}

/* ===== TRIM OVERLAY (post-downgrade) ===== */
.trim-overlay-inner { text-align: left; }
.trim-header { text-align: center; margin-bottom: 16px; }
.trim-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
    display: flex; align-items: center; justify-content: center;
}
.trim-icon svg { width: 28px; height: 28px; }
.trim-overlay-inner h2 { color: var(--earth); margin-bottom: 8px; font-family: 'DM Sans', sans-serif; }
.trim-sub { color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; }
.trim-counter {
    background: var(--cream);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.trim-counter strong { color: var(--earth); font-size: 1rem; }
.trim-list {
    max-height: 50vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--cream-dark);
    border-radius: 12px;
    padding: 8px;
}
.trim-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1.5px solid transparent;
}
.trim-item:hover { background: var(--cream); }
.trim-item:has(input:checked) {
    background: rgba(76, 138, 90, 0.08);
    border-color: var(--earth);
}
.trim-item input[type="checkbox"] {
    width: 20px; height: 20px;
    accent-color: var(--earth);
    flex-shrink: 0;
}
.trim-item-body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.trim-thumb {
    width: 48px; height: 48px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--cream);
}
.trim-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.trim-thumb-empty svg { width: 22px; height: 22px; }
.trim-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.trim-item-text strong {
    font-size: 0.9rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.trim-item-text span { font-size: 0.72rem; color: var(--text-muted); }
.trim-item-text small { font-size: 0.7rem; color: var(--text-muted); opacity: 0.8; }
.trim-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===== CHAT LOCATION CHOOSER ===== */
.chat-loc-chooser {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}
.chat-loc-chooser-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 22, 0.55);
    backdrop-filter: blur(2px);
}
.chat-loc-chooser-card {
    position: relative;
    background: var(--white);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 20px 18px max(20px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.22s cubic-bezier(0.16,1,0.3,1);
}
.chat-loc-chooser-card h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--earth);
    margin-bottom: 4px;
    text-align: center;
}
.chat-loc-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--cream);
    border: 1.5px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.chat-loc-opt:hover {
    background: var(--cream-dark);
    border-color: var(--earth);
}
.chat-loc-opt > svg {
    width: 24px; height: 24px;
    color: var(--earth);
    flex-shrink: 0;
}
.chat-loc-opt > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.chat-loc-opt strong {
    font-size: 0.9rem;
    color: var(--text);
}
.chat-loc-opt span {
    font-size: 0.75rem;
    color: var(--text-muted);
}
@media (min-width: 600px) {
    .chat-loc-chooser { align-items: center; }
    .chat-loc-chooser-card { border-radius: 18px; padding: 22px; }
}
