:root {
  --bg: #0b0718;
  --bg2: #120a2a;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --glass-hi: rgba(255, 255, 255, 0.16);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-hi: rgba(255, 255, 255, 0.3);
  --text: #f4f1ff;
  --muted: #a9a2c9;
  --dim: #6f6893;
  --pink: #ff5ea8;
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --lime: #a3e635;
  --amber: #fbbf24;
  --red: #fb7185;
  --green: #34d399;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --grad: linear-gradient(120deg, var(--pink), var(--violet) 45%, var(--cyan));
  --font: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --display: 'Unbounded', 'Space Grotesk', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--pink); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- animated background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: radial-gradient(1200px 800px at 10% -10%, #2a1260 0%, transparent 60%), radial-gradient(900px 700px at 110% 110%, #08324a 0%, transparent 60%), var(--bg); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; mix-blend-mode: screen; animation: float 22s ease-in-out infinite alternate; }
.b1 { width: 520px; height: 520px; background: var(--pink); top: -120px; left: 18%; }
.b2 { width: 600px; height: 600px; background: var(--violet); bottom: -200px; left: -120px; animation-duration: 28s; }
.b3 { width: 460px; height: 460px; background: var(--cyan); top: 30%; right: -120px; animation-duration: 25s; animation-delay: -6s; }
.b4 { width: 300px; height: 300px; background: var(--lime); bottom: 6%; right: 30%; opacity: .25; animation-duration: 31s; animation-delay: -12s; }
@keyframes float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33% { transform: translate(80px, 60px) scale(1.15) rotate(40deg); }
  66% { transform: translate(-60px, 90px) scale(.9) rotate(-30deg); }
  100% { transform: translate(40px, -70px) scale(1.08) rotate(20deg); }
}
.grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.grain { position: absolute; inset: -50%; opacity: .07; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); animation: grain 8s steps(10) infinite; }
@keyframes grain { 0%,100% { transform: translate(0,0) } 20% { transform: translate(-5%,3%) } 40% { transform: translate(3%,-6%) } 60% { transform: translate(-7%,2%) } 80% { transform: translate(5%,5%) } }
.cursor-glow { position: fixed; z-index: 1; width: 420px; height: 420px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(124,92,255,.18), transparent 65%); transform: translate(-50%, -50%); transition: opacity .3s; left: -999px; top: -999px; }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 2; display: grid; grid-template-columns: 240px 1fr; gap: 22px; padding: 22px; min-height: 100vh; }
.glass { background: var(--glass); border: 1px solid var(--stroke); border-radius: var(--radius); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); box-shadow: var(--shadow); }
.sidebar { position: sticky; top: 22px; height: calc(100vh - 44px); display: flex; flex-direction: column; padding: 22px 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.brand-orb { width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(from 0deg, var(--pink), var(--violet), var(--cyan), var(--lime), var(--pink)); animation: spin 6s linear infinite; position: relative; box-shadow: 0 0 30px rgba(255,94,168,.5); }
.brand-orb::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.brand-logo { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 14px rgba(124,92,255,.55)); animation: logoFloat 5s ease-in-out infinite; transition: transform .4s; }
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.08); }
@keyframes logoFloat { 50% { translate: 0 -3px; } }
.brand-text { font-family: var(--display); font-size: 13px; line-height: 1.15; letter-spacing: .02em; color: var(--muted); }
.brand-text b { font-size: 19px; color: var(--text); background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--muted); font-weight: 500; transition: all .25s cubic-bezier(.2,.8,.2,1); position: relative; }
.nav a i { font-style: normal; width: 22px; text-align: center; font-size: 16px; }
.nav a:hover { color: var(--text); background: var(--glass); transform: translateX(4px); }
.nav a.active { color: #fff; background: linear-gradient(120deg, rgba(255,94,168,.25), rgba(124,92,255,.22)); border: 1px solid rgba(255,255,255,.14); }
.nav a.active::before { content: ''; position: absolute; left: -16px; top: 50%; width: 4px; height: 22px; transform: translateY(-50%); border-radius: 4px; background: var(--grad); box-shadow: 0 0 14px var(--pink); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; padding: 10px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(163,230,53,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(163,230,53,0); } 100% { box-shadow: 0 0 0 0 rgba(163,230,53,0); } }

.view { min-width: 0; padding-bottom: 60px; }
.view > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.stagger > * { animation: rise .55s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }

/* ---------- header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 4px 22px; }
.page-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3.4vw, 44px); margin: 0; letter-spacing: -.02em; line-height: 1.05; }
.page-head h1 .g { background: var(--grad); background-size: 200% 200%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: shimmer 6s ease infinite; }
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--glass-2); cursor: pointer; font-weight: 600; font-size: 14px; transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); background: var(--glass-hi); border-color: var(--stroke-hi); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { border: 0; background: var(--grad); background-size: 180% 180%; color: #fff; box-shadow: 0 10px 30px -10px rgba(255,94,168,.7); animation: shimmer 5s ease infinite; }
.btn.primary:hover { box-shadow: 0 14px 40px -10px rgba(124,92,255,.9); }
.btn.lime { background: var(--lime); color: #142000; border: 0; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: rgba(251,113,133,.15); border-color: rgba(251,113,133,.5); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn.icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.input, .select, textarea.input { width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); outline: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.input:focus, .select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124,92,255,.22); background: rgba(0,0,0,.35); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.select option { background: #1a1233; }
label.field { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
label.field > :is(input, select, textarea, div, .copy) { margin-top: 6px; }
label.field > input, label.field > select, label.field > textarea { display: block; }
label.field .hint { color: var(--dim); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); font-size: 13.5px; }
.check input { accent-color: var(--pink); width: 16px; height: 16px; }
.toggle { position: relative; width: 44px; height: 24px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: rgba(255,255,255,.12); transition: .25s; cursor: pointer; }
.toggle span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .25s cubic-bezier(.2,.8,.2,1); }
.toggle input:checked + span { background: var(--grad); }
.toggle input:checked + span::after { transform: translateX(20px); }

/* ---------- cards ---------- */
.card { padding: 20px; position: relative; overflow: hidden; }
.card h3 { margin: 0 0 12px; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.card .sub { color: var(--muted); font-size: 13px; }
.tilt { transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s; transform-style: preserve-3d; will-change: transform; }
.tilt:hover { border-color: var(--stroke-hi); box-shadow: 0 30px 70px -25px rgba(124,92,255,.55), inset 0 1px 0 rgba(255,255,255,.12); }
.shine::before { content: ''; position: absolute; inset: 0; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.12), transparent 45%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.shine:hover::before { opacity: 1; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { padding: 18px 20px; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.stat .v { font-family: var(--display); font-size: 38px; font-weight: 800; margin-top: 6px; line-height: 1; }
.stat .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c, var(--grad)); box-shadow: 0 0 18px var(--c, var(--pink)); }
.stat .emoji { position: absolute; right: 14px; top: 12px; font-size: 26px; opacity: .85; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-6deg); } }

.dash { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }

/* ---------- client cards ---------- */
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.client-card { padding: 22px; cursor: pointer; min-height: 200px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.client-card .halo { pointer-events: none; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -90px; background: var(--c); filter: blur(50px); opacity: .45; transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .4s; }
.client-card:hover .halo { transform: scale(1.35) translate(-20px, 20px); opacity: .7; }
.avatar { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 40%, #000)); box-shadow: 0 10px 30px -8px var(--c); flex: none; }
.avatar.lg { width: 74px; height: 74px; border-radius: 22px; font-size: 28px; }
.client-card h3 { font-size: 19px; margin: 14px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { --pc: #999; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--pc) 22%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 45%, transparent); transition: transform .2s; position: relative; }
.pchip:hover { transform: translateY(-3px) scale(1.08); }
.pchip svg { width: 15px; height: 15px; fill: var(--pc); }
.pchip.linked::after { content: ''; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); border: 2px solid var(--bg); }
.pchip.unlinked::after { content: ''; position: absolute; right: -3px; top: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); border: 2px solid var(--bg); }
.picon { display: inline-grid; place-items: center; }
.picon svg { width: 1em; height: 1em; fill: currentColor; }
.counts { display: flex; gap: 14px; margin-top: auto; padding-top: 16px; font-size: 12.5px; color: var(--muted); }
.counts b { color: var(--text); font-family: var(--display); font-size: 16px; margin-right: 4px; }
.add-card { display: grid; place-items: center; border-style: dashed; color: var(--muted); font-weight: 600; gap: 8px; text-align: center; }
.add-card .plus { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--grad); color: #fff; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.add-card:hover .plus { transform: rotate(90deg) scale(1.1); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(0,0,0,.25); border: 1px solid var(--stroke); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 18px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; transition: .25s; border: 0; background: none; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--glass-hi); color: #fff; box-shadow: inset 0 0 0 1px var(--stroke-hi); }
.tab .n { font-size: 11px; background: rgba(255,255,255,.12); padding: 1px 7px; border-radius: 99px; }

/* ---------- posts ---------- */
.day-group { margin-bottom: 22px; }
.day-label { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 13px; color: var(--muted); margin: 0 4px 10px; letter-spacing: .04em; }
.day-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--stroke), transparent); }
.day-label .today { color: var(--lime); }
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.post { padding: 0; display: flex; flex-direction: column; cursor: pointer; position: relative; overflow: hidden; }
.stat { position: relative; overflow: hidden; }
.post .thumb { height: 170px; background: rgba(0,0,0,.35); position: relative; overflow: hidden; display: grid; place-items: center; color: var(--dim); }
.post .thumb img, .post .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.post:hover .thumb img, .post:hover .thumb video { transform: scale(1.06); }
.post .thumb .badge-media { position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 99px; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); font-size: 11.5px; }
.post .thumb .pbadge { position: absolute; left: 10px; top: 10px; }
.post .thumb.text-only { padding: 18px; place-items: start; font-size: 14px; color: var(--muted); line-height: 1.45; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 25%, transparent), rgba(0,0,0,.3)); }
.post .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post .cap { color: var(--text); font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.post .meta { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.post .post-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.post .err { font-size: 12px; color: var(--red); line-height: 1.35; }
.post .warn { font-size: 12px; color: var(--amber); }
.pbig { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--pc); box-shadow: 0 6px 20px -6px var(--pc); }
.pbig svg { width: 16px; height: 16px; fill: #fff; }
.pbig.light svg { fill: #111; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.draft { color: #c4bce8; }
.pill.scheduled { color: var(--cyan); }
.pill.platform-scheduled { color: var(--cyan); }
.pill.platform-scheduled::before, .pill.scheduled::before, .pill.publishing::before { animation: blink 1.4s infinite; }
.pill.publishing { color: var(--violet); }
.pill.published { color: var(--lime); }
.pill.failed, .pill.missed { color: var(--red); }
.pill.needs-action { color: var(--amber); }
@keyframes blink { 50% { opacity: .2; } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 56px; margin-bottom: 8px; animation: bob 3s ease-in-out infinite; display: inline-block; }
.empty h3 { font-family: var(--display); color: var(--text); margin: 6px 0; }

/* list rows */
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid transparent; transition: .2s; cursor: pointer; }
.li:hover { background: rgba(255,255,255,.07); border-color: var(--stroke); transform: translateX(3px); }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { color: var(--muted); font-size: 12px; }
.li .when { font-family: var(--display); font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }

/* ---------- calendar ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal .cell { min-height: 124px; padding: 8px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); display: flex; flex-direction: column; gap: 4px; transition: background .2s, border-color .2s, transform .2s; overflow: hidden; }
.cal .cell:hover { background: rgba(255,255,255,.07); border-color: var(--stroke); }
.cal .cell.out { opacity: .35; }
.cal .cell.today { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 30px -8px var(--lime); }
.cal .cell.drop { background: rgba(124,92,255,.2); border-color: var(--violet); transform: scale(1.02); }
.cal .dn { font-family: var(--display); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.cal .ev { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 9px; font-size: 11.5px; background: color-mix(in srgb, var(--c) 22%, rgba(0,0,0,.2)); border-left: 3px solid var(--c); cursor: grab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .15s; }
.cal .ev:hover { transform: translateX(2px); }
.cal .ev svg { width: 11px; height: 11px; flex: none; fill: var(--pc); }
.cal .ev .st { width: 6px; height: 6px; border-radius: 50%; flex: none; margin-left: auto; }
.cal .more { font-size: 11px; color: var(--muted); padding-left: 4px; }

/* ---------- modal / drawer ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 2, 15, .55); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 5vh 20px; overflow-y: auto; animation: fade .25s both; }
.overlay.drawer { justify-content: flex-end; align-items: stretch; padding: 0; overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(640px, 100%); padding: 26px; background: rgba(22, 14, 46, .78); animation: pop .4s cubic-bezier(.2,1.2,.3,1) both; }
.modal.wide { width: min(980px, 100%); }
.drawer .modal { width: min(1080px, 96vw); height: 100vh; border-radius: 26px 0 0 26px; overflow-y: auto; animation: slide .45s cubic-bezier(.2,.9,.2,1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes slide { from { transform: translateX(60px); opacity: 0; } }
.modal h2 { font-family: var(--display); margin: 0 0 18px; font-size: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.close-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer; font-size: 18px; transition: .3s; }
.close-x:hover { transform: rotate(90deg); background: var(--glass-hi); }

.editor { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.counter { font-size: 11.5px; color: var(--muted); text-align: right; margin-top: -8px; }
.counter.over { color: var(--red); font-weight: 700; }
.taginput { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-radius: 14px; border: 1px solid var(--stroke); background: rgba(0,0,0,.25); min-height: 46px; cursor: text; }
.taginput:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124,92,255,.22); }
.taginput input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; padding: 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 99px; font-size: 12.5px; background: linear-gradient(120deg, rgba(255,94,168,.3), rgba(124,92,255,.3)); border: 1px solid rgba(255,255,255,.15); animation: pop .3s both; }
.tag.kw { background: linear-gradient(120deg, rgba(34,211,238,.25), rgba(163,230,53,.2)); }
.tag button { border: 0; background: rgba(0,0,0,.3); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: 11px; line-height: 1; }
.dropzone { border: 2px dashed var(--stroke-hi); border-radius: 18px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; transition: .25s; position: relative; }
.dropzone:hover, .dropzone.over { border-color: var(--pink); background: rgba(255,94,168,.08); color: var(--text); }
.dropzone.over { transform: scale(1.01); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.mitem { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--stroke); background: #000; animation: pop .35s both; cursor: grab; }
.mitem img, .mitem video { width: 100%; height: 100%; object-fit: cover; }
.mitem .n { position: absolute; left: 6px; top: 6px; font-size: 11px; background: rgba(0,0,0,.65); padding: 2px 7px; border-radius: 99px; }
.mitem .x { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); cursor: pointer; opacity: 0; transition: .2s; }
.mitem:hover .x { opacity: 1; }
.mitem.dragging { opacity: .4; }
.issues { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.issues .e { color: var(--red); } .issues .w { color: var(--amber); }
.issues div { padding: 8px 12px; border-radius: 12px; background: rgba(0,0,0,.25); }

/* phone preview */
.phone { width: 100%; max-width: 360px; margin: 0 auto; border-radius: 34px; padding: 12px; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(255,255,255,.04)); border: 1px solid var(--stroke-hi); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.phone-screen { border-radius: 24px; background: #0d0d12; overflow: hidden; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 12px; font-size: 13px; font-weight: 600; }
.pv-head .av { width: 32px; height: 32px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-size: 12px; }
.pv-media { aspect-ratio: 1; background: #1a1a22; display: grid; place-items: center; color: #555; position: relative; }
.pv-media img, .pv-media video { width: 100%; height: 100%; object-fit: cover; }
.pv-media .dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; }
.pv-media .dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.pv-media .dots i:first-child { background: #fff; }
.pv-text { padding: 12px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }
.pv-text .h { color: #7aa8ff; }
.pv-title { padding: 10px 12px 0; font-weight: 700; font-size: 14px; }

/* ---------- connections ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }
.conn-card .top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.conn-card .help { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin: 8px 0 14px; }
.acct { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.25); font-size: 13px; }
.acct img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.acct .ph { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-hi); font-size: 11px; }
.conn-block { border-top: 1px solid var(--stroke); padding-top: 12px; margin-top: 12px; }
.conn-block .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; font-size: 11.5px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.35); overflow-x: auto; white-space: nowrap; color: var(--cyan); }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0; list-style: none; }
details summary::before { content: '▸ '; display: inline-block; transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }

.platform-rows { display: flex; flex-direction: column; gap: 10px; }
.prow { display: grid; grid-template-columns: 36px 1fr 1.1fr 34px; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: rgba(0,0,0,.2); border: 1px solid rgba(255,255,255,.06); animation: rise .35s both; }
.prow .opts { grid-column: 2 / 4; display: flex; gap: 10px; flex-wrap: wrap; }
.prow .opts .select, .prow .opts .input { flex: 1; min-width: 160px; padding: 8px 12px; font-size: 13px; }
.picker { display: flex; flex-wrap: wrap; gap: 8px; }
.picker button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--stroke); background: var(--glass); cursor: pointer; font-size: 12.5px; transition: .2s; }
.picker button:hover { transform: translateY(-2px); border-color: var(--pc); background: color-mix(in srgb, var(--pc) 20%, transparent); }
.picker button svg { width: 13px; height: 13px; fill: var(--pc); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { padding: 12px 16px; border-radius: 16px; background: rgba(22,14,46,.9); border: 1px solid var(--stroke); backdrop-filter: blur(16px); box-shadow: var(--shadow); max-width: 420px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .45s cubic-bezier(.2,1.3,.3,1) both; }
.toast.out { animation: toastOut .3s both; }
.toast .ic { font-size: 16px; }
.toast.ok { border-color: rgba(163,230,53,.45); } .toast.err { border-color: rgba(251,113,133,.5); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.1), rgba(255,255,255,.04)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 12.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.sep { height: 1px; background: var(--stroke); margin: 16px 0; }
.kbd { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--stroke); font-size: 11.5px; background: rgba(0,0,0,.3); }
pre.code { background: rgba(0,0,0,.35); border: 1px solid var(--stroke); border-radius: 14px; padding: 14px; font-size: 12px; overflow-x: auto; color: #d6ccff; line-height: 1.55; }
.feed .li { cursor: default; }
.feed .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .dash, .editor { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { position: relative; top: 0; height: auto; flex-direction: row; align-items: center; padding: 10px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; } .brand-text, .sidebar-foot { display: none; }
  .nav { flex-direction: row; } .nav a span { display: none; } .nav a.active::before { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .cal .cell { min-height: 80px; } .cal .ev span { display: none; }
  .conn-grid { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 36px 1fr 34px; } .prow > :nth-child(3) { grid-column: 2 / 4; } .prow .opts { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- per-client login panel ---- */
.login-panel { padding: 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(124,92,255,.16), rgba(34,211,238,.08)); border: 1px solid rgba(124,92,255,.35); display: grid; gap: 10px; animation: rise .4s both; }
.login-panel.flash { animation: rise .4s both, loginFlash 1.4s .3s 2; }
@keyframes loginFlash { 50% { box-shadow: 0 0 0 4px rgba(124,92,255,.35), 0 0 40px rgba(124,92,255,.35); } }
.login-list { display: grid; gap: 8px; }
.login-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); }
.login-item .ic { display: flex; gap: 4px; }
.login-item .ic svg { width: 18px; height: 18px; fill: currentColor; }
.login-item .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.login-item.ok { border-color: rgba(163,230,53,.3); }
.btn.glow { animation: glowPulse 2s infinite; }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,94,168,.45); } 50% { box-shadow: 0 0 0 8px rgba(255,94,168,0); } }
.login-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 18px; }

/* ---- server mode (portal hosted online) ---- */
.server-only { display: none !important; }
body.server-mode .server-only { display: inline-flex !important; }
body.server-mode .local-only, body.server-mode [data-folder], body.server-mode #cp-folder, body.server-mode #e-folder, body.server-mode #c-open { display: none !important; }

/* ---- login page ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; z-index: 1; }
.login-card { width: min(420px, 100%); padding: 34px 30px; display: grid; gap: 18px; text-align: center; animation: pop .5s both; }
.login-card img { width: 96px; height: 96px; margin: 0 auto; filter: drop-shadow(0 0 22px rgba(124,92,255,.55)); animation: logoFloat 5s ease-in-out infinite; }
.login-card h1 { margin: 0; font-size: 26px; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card .err { color: var(--red); min-height: 18px; font-size: 13px; }
