:root {
  --bg: #f2eef8;
  --surface: #ffffff;
  --surface-2: #f6f3fc;
  --line: #e7e0f1;
  --text: #221d2e;
  --muted: #7a7389;
  --brand1: #6d5efc;   /* icon violet */
  --brand2: #c2418f;   /* icon magenta */
  --purple: #8b3fd4;   /* solid accent */
  --purple-soft: #f0e6fb;
  --red: #e0405a;
  --radius: 18px;
  --grad: linear-gradient(135deg, var(--brand1), var(--brand2));
  --shadow: 0 10px 26px rgba(58, 28, 84, .12), 0 2px 8px rgba(58, 28, 84, .07);
  --shadow-sm: 0 4px 14px rgba(58, 28, 84, .10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1.2em; font-size: 14px; margin-top: 8px; }

/* Login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 28px 22px; text-align: center; box-shadow: var(--shadow);
}
.brand { font-weight: 800; letter-spacing: .2px; font-size: 22px; display: inline-flex; align-items: center; gap: 9px; }
.brand.sm { font-size: 17px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 12px rgba(139,63,212,.5); }
.who { display: flex; gap: 10px; margin: 18px 0 12px; }
.who-btn {
  flex: 1; padding: 14px; border-radius: 13px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px; font-weight: 600;
}
.who-btn.active { border-color: var(--purple); background: var(--purple-soft); color: var(--purple); }
#pin {
  width: 100%; padding: 15px; font-size: 22px; text-align: center; letter-spacing: 6px;
  border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text);
}
#pin:focus, .caption:focus, .reddit-fields input:focus { outline: none; border-color: var(--purple); }
button.primary { width: 100%; margin-top: 12px; padding: 15px; font-size: 17px; font-weight: 700;
  border: none; border-radius: 13px; background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
  background: rgba(255,255,255,.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); box-shadow: 0 4px 14px rgba(58,28,84,.05);
}
.spacer { flex: 1; }
.pill { font-size: 13px; color: var(--purple); background: var(--purple-soft);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.icon { background: var(--surface); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 11px; font-size: 18px; box-shadow: var(--shadow-sm); }

/* Tabs */
.tabs { display: flex; gap: 8px; padding: 12px 14px 0; overflow-x: auto; }
.tabs.sub { padding-top: 8px; padding-bottom: 10px; position: sticky;
  top: calc(env(safe-area-inset-top) + 61px); background: var(--bg); z-index: 4; }
.tab { white-space: nowrap; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-sm); }
.tab.active { color: #fff; border-color: transparent; background: var(--grad); }

/* Feed */
.feed { display: grid; gap: 16px; padding: 14px; max-width: 620px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); }
.media {
  width: 100%; background: #ece6f6 center/cover no-repeat;
  background-image:
    linear-gradient(135deg, rgba(139,63,212,.06) 25%, transparent 25%, transparent 50%,
    rgba(139,63,212,.06) 50%, rgba(139,63,212,.06) 75%, transparent 75%, transparent);
  background-size: 22px 22px;
}
.media.has { aspect-ratio: 1/1; max-height: 56vh; }
.media.tall { aspect-ratio: 3/4; max-height: 56vh; }
.media.wide { aspect-ratio: 3/2; max-height: 56vh; }
.body { padding: 15px; display: grid; gap: 10px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; letter-spacing: .3px; }
.tag.persona { background: var(--purple-soft); color: var(--purple); border: 1px solid var(--line); }
.tag.facebook { background: #1877f2; color: #fff; }
.tag.linkedin { background: #0a66c2; color: #fff; }
.tag.threads { background: #101010; color: #fff; }
.tag.instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.tag.reddit { background: #ff4500; color: #fff; }
.tag.twitter { background: #0f1419; color: #fff; }
.tag.onlyfans { background: #00aff0; color: #fff; }
.tag.type { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.tag.nsfw { background: #fbe1e7; color: #b21437; }
.tag.tier { border: 1px dashed var(--line); background: #fff; }
.tag.tier-sfw { color: #1f9d55; border-color: #bfe6cd; }
.tag.tier-tease { color: #c2418f; border-color: #edc9de; }
.tag.tier-of { color: #0089c0; border-color: #bfe8f8; }
.of-fields { display: grid; gap: 8px; }
.of-fields select, .of-fields input { background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.of-fields .of-type { flex: 1; min-width: 130px; }
.of-fields .of-price { flex: 1; min-width: 110px; }
.ready-banner { background: var(--purple-soft); color: var(--purple); font-weight: 600; font-size: 13px;
  padding: 9px 12px; border-radius: 10px; border: 1px solid #e4d3f6; }
.caption { width: 100%; resize: vertical; background: var(--surface-2); color: var(--text);
  border: 1.5px solid var(--line); border-radius: 11px; padding: 11px; font: inherit; }
.reddit-fields { display: grid; gap: 8px; }
.reddit-fields input { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px; font: inherit; }
.rd-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rd-row .rd-sub { flex: 2; min-width: 120px; }
.rd-row .rd-flair { flex: 1; min-width: 90px; }
.nsfw { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.nsfw input { accent-color: var(--purple); }
.meta { font-size: 13px; color: var(--muted); }
.actions { display: flex; gap: 8px; }
.btn { flex: 1; padding: 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 15px; box-shadow: var(--shadow-sm); }
.btn.reject { color: var(--red); }
.btn.save { color: var(--purple); }
.btn.approve { background: var(--grad); color: #fff; border-color: transparent; flex: 1.4; }
.btn:active { transform: scale(.98); }
.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; z-index: 20; box-shadow: var(--shadow); font-weight: 600; }
