:root {
  --bg: #F7F4FB;
  --surface: #ffffff;
  --surface-2: #f5f2fa;
  --border: #e3dced;
  --text: #292431;
  --muted: #716a7c;
  --accent: #7040b8;
  --accent-2: #8a5bd1;
  --ok: #7040b8;
  --badge: #38bdf8;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(42,30,58,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
.page {
  width: 100%;
  max-width: var(--layout-max, 440px);
  margin: 0 auto;
  padding: 12px 12px calc(40px + env(safe-area-inset-bottom));
}
.profile-side { min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 10px; color: var(--muted);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.brand-mark { color: var(--accent); font-size: 18px; }
.brand strong { color: var(--accent-2); }
.icon-btn { background: transparent; border: 1px solid var(--border); color: var(--muted); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.hero { position: relative; }
.cover { height: var(--cover-height, 170px); position: relative; overflow: hidden; }
.cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 85%; display: block;
}
.hero-lower { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 14px; margin-top: -44px; gap: 8px; }
.avatar-wrap {
  position: relative;
  width: var(--avatar-size, 88px);
  height: var(--avatar-size, 88px);
  flex: 0 0 auto;
}
.avatar {
  width: var(--avatar-size, 88px); height: var(--avatar-size, 88px);
  border-radius: 50%; border: 4px solid var(--surface);
  object-fit: cover; display: block; background: #f5f2fa;
}
.online-dot { position: absolute; right: 6px; bottom: 8px; width: 14px; height: 14px; background: var(--accent-2); border: 3px solid var(--surface); border-radius: 50%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; padding-bottom: 6px; }
.stat { text-align: center; font-size: 11px; color: var(--muted); }
.stat strong { display: block; color: var(--text); font-size: 13px; margin-top: 1px; }
.stat small { font-size: 10px; }
.stat .ico { display: none; }

.bio { padding: 10px 16px 14px; }
.name-row h1 { font: 800 22px/1.2 "Manrope", sans-serif; margin: 4px 0 0; letter-spacing: -.3px; }
.badge { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--badge, #38bdf8); color: #041018; font-size: 11px; vertical-align: middle; box-shadow: 0 0 0 1px color-mix(in srgb, var(--badge, #38bdf8) 35%, transparent); }
.badge[hidden] { display: none; }
.handle { color: var(--accent-2); margin: 2px 0 8px; font-weight: 500; }
.bio-text { color: var(--muted); margin: 0 0 12px; line-height: 1.55; font-size: 14px; }
.bio-actions { display: flex; gap: 8px; }
.btn {
  font: 600 14px "DM Sans", sans-serif; border-radius: 12px; padding: 11px 14px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: .15s transform, .15s background;
}
.btn:hover { transform: translateY(-1px); background: #eee9f6; }
.btn.primary { background: linear-gradient(110deg, var(--accent), var(--accent-2)); color: #ffffff; border-color: var(--accent); flex: 1; }
.btn.ghost { background: #f5f2fa; }
.btn.icon-only { flex: 0 0 44px; padding: 0; display: grid; place-items: center; }
.btn.icon-only svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn.profile-like { flex: 0 0 44px; padding: 0; display: grid; place-items: center; }
.btn.profile-like svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.btn.profile-like.liked { border-color: var(--accent); color: var(--accent-2); }
.btn.profile-like.liked svg { fill: var(--accent-2); stroke: var(--accent-2); }
.btn.profile-like:disabled { cursor: default; opacity: 1; transform: none; }
.btn.full { width: 100%; }

.tabs { border-top: 1px solid var(--border); }
.tab-bar { display: grid; grid-template-columns: 1fr 1fr; }
.tab { background: none; border: none; color: var(--muted); padding: 14px; font: 600 14px "DM Sans", sans-serif; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding: 12px; }
.tab-panel.active { display: block; }

.feed { display: flex; flex-direction: column; gap: 12px; }
.post { background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.post-head strong { color: var(--text); }
.post-media { height: 260px; position: relative; display: grid; place-items: center; overflow: hidden; }
.ph { position: absolute; inset: 0; }
.ph.a { background: linear-gradient(145deg, #e9ddf7, #c7b2e5 58%, #f3eafa); }
.ph.b { background: linear-gradient(145deg, #f0e8fa, #d3c1eb 58%, #faf7fd); }
.ph.c { background: linear-gradient(145deg, #dfd0f1, #bda2df 58%, #efe7f8); }
.ph.d { background: linear-gradient(145deg, #f5effb, #d8c8ed 58%, #eee4f7); }
.post-media.locked .ph { filter: blur(18px) brightness(.7); transform: scale(1.08); }
.lock-overlay { position: relative; z-index: 1; text-align: center; padding: 16px; }
.lock-overlay .lock-label { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.lock-overlay p { margin: 4px 0 10px; color: #ffffff; font-weight: 600; }
.lock-overlay .btn { padding: 8px 14px; font-size: 13px; }
.post-body { padding: 10px 12px 12px; }
.post-body p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.post-actions { display: flex; gap: 14px; color: var(--muted); font-size: 13px; }
.post-actions button { background: none; border: none; color: inherit; cursor: pointer; font: inherit; padding: 0; }
.post-actions button.liked { color: var(--accent-2); }

.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.media-item { aspect-ratio: 1; border-radius: 10px; position: relative; overflow: hidden; border: 1px solid var(--border); cursor: pointer; }
.media-item .ph { position: absolute; inset: 0; }
.media-item.locked .ph { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item .mini-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #ffffff; text-transform: uppercase; background: rgba(35,25,48,.38); }

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(35,25,48,.52); backdrop-filter: blur(6px); }
.modal-dialog {
  position: relative; width: min(420px, 100%); background: var(--surface);
  border: 1px solid var(--border); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); z-index: 1;
  max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
}
.modal-dialog h3 { margin: 0 0 4px; font: 700 20px "Manrope", sans-serif; }
.modal-dialog .muted { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; font-size: 18px; }
.plans { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.plan { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.plan.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(112,64,184,.22); }
.plan small { display: block; color: var(--muted); font-weight: 400; }
.plan .price { color: var(--accent-2); font-weight: 700; }
.variant-modal { z-index: 60; }
.variant-dialog { width: min(520px, 100%); }
.variant-dialog .plan-variants { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.plan-variant { min-height: 76px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.plan-variant.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(112,64,184,.22); }
.plan-variant.vip { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 6px 18px rgba(85,45,135,.12); }
.plan-variant:disabled { opacity: .55; cursor: not-allowed; }
.plan-variant small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 6px; }
.plan-variant .price { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.variant-back { margin-top: 2px; }
@media (max-width: 420px) { .variant-dialog .plan-variants { gap: 8px; } .plan-variant { min-height: 70px; padding: 13px; } }
.fake-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fake-form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.fake-form input { background: #f5f2fa; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; }

.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(20px);
  background: #f5f2fa; color: var(--text); border: 1px solid var(--border); padding: 10px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 60; font-size: 14px; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 380px) {
  .hero-lower { flex-direction: column; align-items: flex-start; margin-top: -40px; }
  .stats { width: 100%; padding-top: 4px; }
}

/* ---------- post media (photo / video) ---------- */
.post-img, .post-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.post-media.locked .post-img,
.post-media.locked .post-video { filter: blur(18px) brightness(.7); transform: scale(1.08); }
.video-badge {
  position: relative; z-index: 0;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 3px;
  background: rgba(112,64,184,.88); border: 1px solid rgba(255,255,255,.18);
  color: #ffffff; font-size: 15px; line-height: 1;
}
.media-item .video-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 30px; height: 30px; font-size: 11px; padding-left: 2px;
}

/* ---------- polls ---------- */
.poll { padding: 2px 2px 4px; }
.poll-question { margin: 0 0 10px !important; color: var(--text) !important; font-weight: 600; font-size: 14px; line-height: 1.45; }
.poll-options { display: flex; flex-direction: column; gap: 8px; }
.poll-option {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font: 500 13px "DM Sans", sans-serif; cursor: pointer; text-align: left;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option.voted { cursor: default; border-color: var(--border); }
.poll-fill {
  position: absolute; inset: 0; width: 0; z-index: 0;
  background: linear-gradient(90deg, rgba(112,64,184,.24), rgba(138,91,209,.10));
  transition: width .35s ease;
}
.poll-label, .poll-pct { position: relative; z-index: 1; }
.poll-pct { color: var(--accent-2); font-weight: 700; font-size: 12px; }
.poll-total { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

/* ---------- media sale ---------- */
.media-img, .media-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item.locked .media-img,
.media-item.locked .media-video { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item .media-price-tag {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  padding: 4px 7px; border-radius: 999px;
  background: var(--accent-2); color: #ffffff;
  font: 800 11px/1 "Manrope", sans-serif;
  letter-spacing: .01em; pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}

body.subscribed .post.locked .lock-overlay { display: none; }
body.subscribed .post.locked .ph,
body.subscribed .post.locked .post-img,
body.subscribed .post.locked .post-video { filter: none; transform: none; }
body.subscribed .media-item .mini-lock { display: none; }
body.subscribed .media-item.locked .ph,
body.subscribed .media-item.locked .media-img,
body.subscribed .media-item.locked .media-video { filter: none; transform: none; }
.media-item.is-sale:not(.purchased) .ph,
.media-item.is-sale:not(.purchased) .media-img,
.media-item.is-sale:not(.purchased) .media-video { filter: blur(10px) brightness(.6); transform: scale(1.05); }
.media-item.is-sale .mini-lock { display: none; }
.media-item.purchased .mini-lock { display: none; }
.media-item.purchased .ph,
.media-item.purchased .media-img,
.media-item.purchased .media-video { filter: none; transform: none; }

/* ---------- media purchase modal ---------- */
.media-modal-preview {
  position: relative; height: 160px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px;
  background: var(--surface-2);
}
.media-modal-preview .ph,
.media-modal-preview img,
.media-modal-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.media-modal-preview img,
.media-modal-preview video,
.media-modal-preview .ph { filter: blur(12px) brightness(.6); transform: scale(1.06); }
.media-price { font: 800 22px "Manrope", sans-serif; color: var(--accent-2); margin: 0 0 12px; }
.selected-payment { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); color: var(--text); font-weight: 700; }
.selected-payment:empty { display: none; }
.btn.primary:disabled { transform: none; opacity: .8; cursor: default; }

.viewer-dialog { padding: 12px; }
.viewer-media {
  position: relative; height: min(62vh, 520px); overflow: hidden;
  border-radius: 14px; background: #0d0d10; border: 1px solid var(--border);
}
.viewer-media img,
.viewer-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.viewer-media .ph { position: absolute; inset: 0; }
.viewer-media .video-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.viewer-dialog h3 { margin: 12px 4px 4px; font: 700 16px "Manrope", sans-serif; }
.viewer-dialog .close { z-index: 2; background: rgba(20,20,22,.8); }
.media-modal-preview .video-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .page {
    max-width: 1120px;
    padding: 28px 24px 64px;
  }
  .topbar { padding: 4px 6px 16px; }

  .profile-card {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    align-items: stretch;
    overflow: visible;
  }
  .profile-side {
    position: sticky;
    top: 24px;
    align-self: start;
    background: var(--surface);
    border-right: 1px solid var(--border);
    border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
    overflow: hidden;
  }
  .cover { height: max(220px, var(--cover-height, 170px)); }
  .hero-lower { margin-top: -54px; padding: 0 20px; }
  .avatar-wrap,
  .avatar {
    width: max(96px, var(--avatar-size, 88px));
    height: max(96px, var(--avatar-size, 88px));
  }
  .bio { padding: 12px 22px 24px; }
  .name-row h1 { font-size: 26px; }
  .handle { font-size: 16px; }
  .bio-text { font-size: 15px; }

  .tabs {
    min-width: 0;
    border-top: 0;
    border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
    overflow: hidden;
    background: var(--surface);
  }
  .tab { padding: 16px; }
  .tab-panel { padding: 18px; }
  .feed { gap: 14px; }
  .post { border-radius: 14px; }
  .post-media { height: 320px; }
  .post-body p { font-size: 15px; }
  .media-grid { gap: 8px; }
  .media-item { border-radius: 12px; }

  .modal-dialog { width: min(460px, 100%); }
  .viewer-media { height: min(68vh, 620px); }
}

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  .page { padding: 8px 8px calc(32px + env(safe-area-inset-bottom)); }
  .topbar { padding: 4px 4px 8px; }
  .bio { padding: 10px 14px 14px; }
  .name-row h1 { font-size: 21px; }
  .bio-text { font-size: 13px; }
  .btn { padding: 10px 12px; font-size: 13px; }
  .btn.icon-only,
  .btn.profile-like { flex-basis: 42px; }
  .tab { padding: 12px; }
  .tab-panel { padding: 10px; }
  .feed { gap: 10px; }
  .post-media { height: 240px; }
  .media-grid { gap: 5px; }
  .modal { padding: 10px; }
  .modal-dialog {
    padding: 18px;
    border-radius: 18px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }
  .viewer-media { height: min(58vh, 460px); }
  .toast { width: calc(100% - 28px); text-align: center; }
}

/* ---------- acesso e pagamento ---------- */

.access-link {
  display: inline-block; margin-top: 10px; padding: 0; background: none; border: none;
  color: var(--muted); font: 600 12px "DM Sans", sans-serif; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer;
}
.access-link:hover { color: var(--accent-2); }

.form-error { margin: 0 0 10px; color: #ff9c8a; font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }


.owned-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2; padding: 3px 7px; border-radius: 999px;
  background: rgba(112, 64, 184, .92); color: #ffffff; font-size: 9px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}

.btn.ghost.full { width: 100%; margin-top: 8px; }


.turnstile {
  display: flex;
  justify-content: center;
  min-height: 0;
  margin: 10px 0 2px;
}

html.devtools-guard-open,
html.devtools-guard-open body {
  overflow: hidden !important;
}

html.devtools-guard-open body > *:not(#devtools-guard) {
  visibility: hidden !important;
}

#devtools-guard {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 50% -10%, rgba(112, 64, 184, .12), transparent 65%),
    var(--bg);
}

html.devtools-guard-open #devtools-guard {
  display: flex;
}

.devtools-guard-card {
  width: min(430px, 100%);
  padding: 30px 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.devtools-guard-mark {
  display: block;
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(112, 64, 184, .18);
}

.devtools-guard-mark::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  margin: 12px auto;
  border-radius: 50%;
  background: var(--accent-2);
}

.devtools-guard-card strong {
  display: block;
  font: 800 22px/1.2 "Manrope", system-ui, sans-serif;
  letter-spacing: -.3px;
}

.devtools-guard-card p {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.devtools-guard-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
