:root {
  --bg: #0d0d12;
  --bg2: #16161f;
  --card: #1d1d28;
  --line: #2c2c3a;
  --text: #f4f4f8;
  --muted: #9a9ab0;
  --accent: #ff3d7f;
  --accent2: #ff8a3d;
  --ok: #2ed47a;
  --warn: #ffc93d;
  --bad: #ff5c5c;
  --grad: linear-gradient(135deg, #ff3d7f 0%, #ff8a3d 100%);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
a { color: var(--accent); text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

.btn { appearance: none; border: 0; border-radius: 12px; padding: 12px 18px; font: inherit; font-weight: 600; color: var(--text); background: var(--card); border: 1px solid var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; transition: transform .08s, opacity .2s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 20px -8px rgba(255, 61, 127, .7); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.icon { padding: 0; width: 44px; }

input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
input[type=range] { padding: 0; accent-color: var(--accent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--ok); border-color: rgba(46, 212, 122, .3); }
.pill.warn { color: var(--warn); border-color: rgba(255, 201, 61, .3); }
.pill.bad { color: var(--bad); border-color: rgba(255, 92, 92, .3); }
.pill.hot { color: #fff; background: var(--grad); border: 0; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; font-weight: 600; opacity: 0; transition: .25s; z-index: 1000; pointer-events: none; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--bad); color: #fff; }

.progress { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--grad); width: 0; transition: width .3s; }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; z-index: 500; backdrop-filter: blur(6px); }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; padding: 20px 18px calc(20px + var(--safe-b)); animation: up .22s ease-out; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 22px; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

.viewer { position: fixed; inset: 0; background: #000; z-index: 900; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; }

/* Instagram mockups (igmock.js) */
.ig { background: #000; color: #f5f5f5; border: 1px solid #262626; border-radius: 14px; overflow: hidden; max-width: 400px; margin: 0 auto; text-align: left; font-size: .9rem; }
.ig-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.ig-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; padding: 2px; background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf); }
.ig-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid #000; }
.ig-more { margin-left: auto; color: #aaa; letter-spacing: 1px; }
.ig-car { position: relative; }
.ig-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ig-track::-webkit-scrollbar { display: none; }
.ig-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 5; background: #111; }
.ig-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.65); border-radius: 12px; padding: 2px 8px; font-size: .75rem; font-weight: 600; }
.ig-actions { display: flex; align-items: center; gap: 14px; padding: 10px 12px 4px; }
.ig-actions svg { width: 24px; height: 24px; fill: none; stroke: #f5f5f5; stroke-width: 1.8; stroke-linejoin: round; }
.ig-actions svg:last-child { margin-left: auto; }
.ig-dots { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; }
.ig-actions { position: relative; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #555; display: block; }
.ig-dots i.on { background: #3897f0; }
.ig-likes, .ig-cap { padding: 2px 12px; }
.ig-cap { padding-bottom: 12px; color: #ddd; }
.ig-prof { padding: 16px; }
.ig-prof-top { display: flex; align-items: center; gap: 18px; margin-bottom: 10px; }
.ig-ring { width: 96px; height: 96px; flex-shrink: 0; border-radius: 50%; padding: 3px; background: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf); }
.ig-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 3px solid #000; display: block; }
.ig-stats { display: flex; flex: 1; justify-content: space-around; text-align: center; font-size: .78rem; color: #ccc; }
.ig-stats b { display: block; font-size: 1rem; color: #fff; }
.ig-name { display: block; }
.ig-bio { color: #aaa; font-size: .85rem; }
.ig-alt { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #262626; }
.ig-alt-av { position: relative; width: 52px; height: 52px; }
.ig-alt-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ig-alt-av span { position: absolute; right: -4px; bottom: -4px; background: #262626; border-radius: 8px; padding: 0 5px; font-size: .7rem; font-weight: 700; }
