:root {
    --bg: #eef9ff;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-solid: #ffffff;
    --text: #102033;
    --muted: #61758a;
    --primary: #38bdf8;
    --primary-strong: #0284c7;
    --primary-soft: #dff6ff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(14, 116, 144, 0.16);
    --shadow: 0 18px 55px rgba(2, 132, 199, 0.22);
}

[data-theme="dark"] {
    --bg: #07111d;
    --surface: rgba(12, 23, 38, 0.9);
    --surface-solid: #0c1726;
    --text: #eff8ff;
    --muted: #9db3c7;
    --primary: #7dd3fc;
    --primary-strong: #38bdf8;
    --primary-soft: rgba(56, 189, 248, 0.14);
    --border: rgba(125, 211, 252, 0.16);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.44);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(125, 211, 252, .34), transparent 38%), var(--bg);
    color: var(--text);
    overflow: hidden;
}
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #e0f7ff 0%, #ffffff 48%, #c7efff 100%);
    transition: opacity .35s ease, visibility .35s ease;
}
[data-theme="dark"] .loading-screen { background: linear-gradient(145deg, #07111d 0%, #0e2236 48%, #02111c 100%); }
.loading-screen.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-card {
    width: min(82vw, 340px);
    padding: 28px;
    border-radius: 34px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}
.loading-image { width: 116px; height: 116px; object-fit: contain; border-radius: 30px; margin-bottom: 14px; }
.loading-title { font-size: 1.45rem; font-weight: 850; letter-spacing: -.04em; }
.loading-subtitle { margin-top: 4px; color: var(--muted); font-size: .92rem; }
.loading-bar { height: 9px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: rgba(56, 189, 248, .18); }
.loading-bar span { display: block; height: 100%; width: 52%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-strong)); animation: loadMove 1s ease-in-out infinite alternate; }
@keyframes loadMove { from { transform: translateX(-68%); } to { transform: translateX(106%); } }

.creator-card {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 18px;
    padding: 11px 12px;
    border-radius: 20px;
    color: var(--text);
    text-decoration: none;
    background: var(--primary-soft);
    border: 1px solid var(--border);
    text-align: left;
}
.creator-photo { width: 48px; height: 48px; border-radius: 16px; object-fit: cover; flex: 0 0 auto; background: var(--primary-soft); }
.creator-card span { display: grid; gap: 2px; min-width: 0; flex: 1; }
.creator-card small { color: var(--muted); font-size: .74rem; font-weight: 700; }
.creator-card strong { font-size: .98rem; font-weight: 900; }
.creator-card b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); }

.app-shell { position: fixed; inset: 0; overflow: hidden; }
#map { width: 100%; height: 100%; background: var(--bg); }
#map .gm-style { font-family: inherit; }
.gm-style .gm-style-iw-c { border-radius: 16px; }
.gm-style .gm-style-iw-d { color: #102033; line-height: 1.35; }

.glass { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.topbar {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
    right: 14px;
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    border-radius: 24px;
}
.eyebrow { margin: 0 0 2px; color: var(--primary-strong); font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.22rem; letter-spacing: -.045em; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn, .avatar-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--text);
    background: var(--primary-soft);
    font-size: 1.13rem;
    overflow: hidden;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn span { font-weight: 900; }

.bottom-panel {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 700;
    padding: 14px;
    border-radius: 24px;
}
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats-row div { min-height: 58px; display: grid; align-content: center; padding: 10px; border-radius: 18px; background: var(--primary-soft); }
.stats-row span { display: block; font-size: 1.14rem; line-height: 1; font-weight: 900; }
.stats-row small { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.quick-actions button { min-height: 38px; border-radius: 14px; background: rgba(255,255,255,.55); color: var(--text); font-size: .75rem; font-weight: 850; }
[data-theme="dark"] .quick-actions button { background: rgba(255,255,255,.07); }
.hint { margin: 12px 2px 0; color: var(--muted); font-size: .82rem; line-height: 1.35; }

.ad-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 18px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    text-decoration: none;
}
.ad-card img { width: 42px; height: 42px; border-radius: 14px; object-fit: cover; background: var(--primary-soft); }
.ad-card span { display: grid; min-width: 0; flex: 1; }
.ad-card small { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ad-card strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-card em { color: var(--muted); font-size: .73rem; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-card b { flex: 0 0 auto; color: #fff; background: var(--primary-strong); border-radius: 999px; padding: 7px 10px; font-size: .72rem; }

.fab-group {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 710;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
}
.fab, .mini-fab {
    min-height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    box-shadow: 0 16px 38px rgba(2, 132, 199, .35);
    font-weight: 900;
}
.fab { font-size: 1.55rem; }
.fab span { font-size: 1rem; letter-spacing: -.02em; }
.mini-fab { font-size: 1.1rem; }

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 8, 23, .44);
}
.modal-overlay.is-open { display: flex; }
.modal-card {
    position: relative;
    width: min(100%, 460px);
    max-height: min(88vh, 760px);
    overflow: auto;
    padding: 22px;
    border-radius: 30px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(2, 8, 23, .38);
    animation: modalIn .22s ease-out;
}
.modal-card.compact { align-self: center; }
@keyframes modalIn { from { transform: translateY(18px); opacity: .75; } to { transform: translateY(0); opacity: 1; } }
.modal-card h2 { margin-bottom: 8px; font-size: 1.35rem; letter-spacing: -.04em; }
.modal-card p, .modal-copy { color: var(--muted); line-height: 1.45; font-size: .92rem; }
.close-btn { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 14px; color: var(--text); background: var(--primary-soft); font-size: 1.35rem; }

.field-label { display: block; margin: 14px 0 7px; color: var(--text); font-size: .83rem; font-weight: 800; }
.field {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    outline: 0;
    color: var(--text);
    background: var(--primary-soft);
}
.textarea { min-height: 96px; padding-top: 13px; resize: vertical; }
.field:focus { border-color: var(--primary-strong); box-shadow: 0 0 0 4px rgba(56, 189, 248, .18); }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0; color: var(--muted); font-size: .84rem; line-height: 1.35; }
.check-row input { width: 19px; height: 19px; accent-color: var(--primary-strong); flex: 0 0 auto; margin-top: 1px; }

.primary-btn, .secondary-btn, .success-btn, .warning-btn, .danger-btn, .danger-lite-btn, .ghost-btn, .link-btn {
    width: 100%;
    min-height: 52px;
    border-radius: 18px;
    font-weight: 900;
    text-decoration: none;
    display: grid;
    place-items: center;
    text-align: center;
}
.primary-btn { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); }
.secondary-btn { color: var(--primary-strong); background: var(--primary-soft); }
.success-btn { color: #fff; background: var(--success); }
.warning-btn { color: #fff; background: var(--warning); }
.danger-btn { color: #fff; background: var(--danger); margin-top: 10px; }
.danger-lite-btn { color: var(--danger); background: rgba(239, 68, 68, .12); margin-top: 12px; }
.ghost-btn { color: var(--text); background: rgba(148, 163, 184, .16); }

.toast {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: calc(178px + env(safe-area-inset-bottom));
    z-index: 1000;
    display: none;
    padding: 12px 14px;
    border-radius: 18px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    font-size: .9rem;
}
.toast.is-open { display: block; }

.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; padding: 6px; border-radius: 18px; background: var(--primary-soft); }
.auth-tabs button { min-height: 42px; border-radius: 14px; background: transparent; color: var(--muted); font-weight: 900; }
.auth-tabs button.active { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); }
 .auth-form { display: grid; gap: 0; }
.auth-form[hidden] { display: none !important; }
.auth-block .modal-card.compact { width: min(100%, 430px); max-height: min(92vh, 640px); padding: 20px; overflow-y: auto; }
.auth-block .modal-card.compact h2 { font-size: 1.24rem; margin-bottom: 6px; }
.auth-block .modal-card.compact > p { font-size: .86rem; margin-bottom: 10px; }
.auth-block .field-label { margin: 10px 0 6px; }
.auth-block .field { min-height: 48px; border-radius: 15px; }
.auth-block .primary-btn { min-height: 50px; margin-top: 12px; }
#googleLoginBox { display: grid; place-items: center; min-height: 42px; }
.divider { position: relative; text-align: center; margin: 16px 0; color: var(--muted); font-size: .78rem; }
.divider:before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.divider span { position: relative; padding: 0 10px; background: var(--surface-solid); }
.mini-note { margin: 14px 0 0; font-size: .78rem !important; }
.auth-block .modal-card { padding-bottom: max(22px, env(safe-area-inset-bottom)); }

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head img { width: 64px; height: 64px; border-radius: 22px; object-fit: cover; background: var(--primary-soft); }
.profile-head h2 { margin: 0 0 4px; }
.profile-points { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #fff; }
.profile-points strong { font-size: 1.6rem; }
.profile-points span { font-weight: 800; }
.mini-stats { grid-template-columns: repeat(2, 1fr); display: grid; }

.location-card { display: grid; gap: 12px; margin: 14px 0 4px; padding: 13px; border-radius: 20px; background: var(--primary-soft); border: 1px solid var(--border); }
.location-card small { display: block; color: var(--muted); font-size: .74rem; font-weight: 800; margin-bottom: 4px; }
.location-card strong { display: block; color: var(--text); font-size: .9rem; line-height: 1.35; word-break: break-word; }
.location-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.compact-btn { min-height: 44px; border-radius: 15px; font-size: .86rem; }
.pick-location-banner { position: fixed; left: 14px; right: 14px; top: calc(96px + env(safe-area-inset-top)); z-index: 800; display: none; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; }
.pick-location-banner.is-open { display: flex; }
.pick-location-banner div { display: grid; gap: 2px; flex: 1; }
.pick-location-banner span { color: var(--muted); font-size: .78rem; }
.pick-location-banner button { min-height: 38px; padding: 0 12px; border-radius: 14px; color: #fff; background: var(--danger); font-weight: 900; }
#map.is-picking-location { cursor: crosshair; }

.wifi-badge { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 20px; background: var(--primary-soft); font-size: 1.7rem; }
.status-pill { display: inline-flex; width: max-content; margin: 2px 0 10px; padding: 8px 10px; border-radius: 999px; color: #fff; background: var(--primary-strong); font-size: .76rem; font-weight: 900; }
.status-pill.verified { background: var(--success); }
.status-pill.warning { background: var(--warning); }
.status-pill.invalid { background: var(--danger); }
.status-pill.unverified { background: #64748b; }
.info-list { display: grid; gap: 10px; margin: 16px 0; }
.info-list div { padding: 13px; border-radius: 17px; background: var(--primary-soft); }
.info-list small { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; }
.info-list strong { display: block; word-break: break-word; }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.action-grid button { min-height: 48px; font-size: .86rem; }

.network-list { display: grid; gap: 10px; margin-top: 14px; }
.network-item { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--border); background: var(--primary-soft); border-radius: 18px; text-align: left; }
.network-item button { text-align: left; color: var(--text); background: transparent; padding: 0; }
.network-item strong { font-size: .98rem; }
.network-item small { color: var(--muted); }
.network-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.network-meta span { padding: 5px 8px; border-radius: 999px; background: var(--surface-solid); color: var(--muted); font-size: .72rem; font-weight: 800; }
.ranking-item { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--primary-soft); }
.ranking-item img { width: 42px; height: 42px; border-radius: 15px; object-fit: cover; }
.ranking-item b { width: 24px; text-align: center; }
.ranking-item span { display: grid; flex: 1; }
.ranking-item small { color: var(--muted); }

@media (max-width: 420px) {
    .modal-overlay.auth-block { align-items: center; padding: 10px; }
    .auth-block .modal-card.compact { max-height: calc(100vh - 20px); padding: 18px; border-radius: 24px; }
    .auth-tabs { margin: 10px 0; padding: 5px; border-radius: 16px; }
    .auth-tabs button { min-height: 40px; border-radius: 13px; }
    .auth-block .field { min-height: 46px; }
    .auth-block .primary-btn { min-height: 48px; }
    .divider { margin: 12px 0; }
}

@media (min-width: 720px) {
    body { overflow: auto; }
    .topbar, .bottom-panel, .fab-group { width: 430px; left: 22px; right: auto; }
    .fab-group { bottom: 26px; }
    .bottom-panel { bottom: 100px; }
    .pick-location-banner { width: 430px; left: 22px; right: auto; }
}

/* Ajustes v5 */
.loading-card {
    width: min(88vw, 360px);
    padding: 20px;
    border-radius: 28px;
}
.loading-image { width: 92px; height: 92px; border-radius: 24px; margin-bottom: 10px; }
.loading-title { font-size: 1.28rem; }
.loading-bar { margin-top: 14px; }
.creator-card.creator-card-compact {
    margin-top: 12px;
    padding: 8px 10px;
    border-radius: 16px;
    gap: 9px;
}
.creator-card-compact .creator-photo { width: 38px; height: 38px; border-radius: 13px; }
.creator-card-compact small { font-size: .67rem; }
.creator-card-compact strong { font-size: .86rem; }
.creator-card-compact b { width: 26px; height: 26px; border-radius: 10px; font-size: .82rem; }
.loading-ad-card {
    display: block;
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 22px;
    color: var(--text);
    text-decoration: none;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    text-align: left;
    transition: opacity .22s ease, transform .22s ease;
}
.loading-ad-card.is-changing { opacity: .35; transform: translateY(2px); }
.loading-ad-card img {
    display: block;
    width: 100%;
    height: 118px;
    object-fit: cover;
    background: var(--primary-soft);
}
.loading-ad-card span { display: grid; gap: 3px; padding: 10px 12px 4px; }
.loading-ad-card small { color: var(--muted); font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.loading-ad-card strong { font-size: .92rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loading-ad-card em { color: var(--muted); font-size: .72rem; font-style: normal; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loading-ad-card b { display: inline-flex; margin: 8px 12px 12px; padding: 7px 11px; border-radius: 999px; color: #fff; background: var(--primary-strong); font-size: .7rem; }

.mini-stats-strip {
    position: fixed;
    top: calc(94px + env(safe-area-inset-top));
    left: 18px;
    right: 18px;
    z-index: 680;
    display: flex;
    gap: 6px;
    align-items: center;
    pointer-events: none;
}
.stats-row.mini-stats-strip div {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    min-height: 0;
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(2, 132, 199, .13);
    backdrop-filter: blur(14px);
}
[data-theme="dark"] .stats-row.mini-stats-strip div { background: rgba(12, 23, 38, .74); }
.stats-row.mini-stats-strip span { display: inline; font-size: .82rem; line-height: 1; font-weight: 950; }
.stats-row.mini-stats-strip small { margin: 0; color: var(--muted); font-size: .58rem; font-weight: 850; line-height: 1; text-transform: uppercase; letter-spacing: .045em; }
.bottom-panel { bottom: calc(82px + env(safe-area-inset-bottom)); padding: 10px; border-radius: 22px; }
.quick-actions { gap: 6px; margin-top: 8px; }
.quick-actions button { min-height: 34px; border-radius: 13px; font-size: .69rem; font-weight: 900; padding: 0 5px; }
.ad-card { gap: 9px; margin-top: 0; padding: 9px; border-radius: 17px; min-height: 58px; transition: opacity .22s ease, transform .22s ease; }
.ad-card.is-changing { opacity: .28; transform: translateY(2px); }
.ad-card img { width: 38px; height: 38px; border-radius: 13px; }
.ad-card small { font-size: .62rem; font-weight: 850; }
.ad-card strong { font-size: .81rem; }
.ad-card em { font-size: .68rem; }
.ad-card b { padding: 6px 9px; font-size: .66rem; }
.fab-group { grid-template-columns: 50px 50px minmax(0, 1fr); gap: 8px; bottom: max(18px, env(safe-area-inset-bottom)); }
.fab, .mini-fab { min-height: 54px; border-radius: 20px; font-weight: 950; }
.fab { font-size: 1.42rem; }
.fab span { font-size: .94rem; }
.mini-fab { font-size: 1.02rem; }
[hidden] { display: none !important; }
