/* ============ Acronix — global theme ============ */
:root {
  /* Refined Acronix — graphite glass, violet stays hero. Warmer ink + real
     surface depth (each step lifts ~6%) so layered panels read as glass, not flat black. */
  --bg:        #0a0a0f;   /* ink */
  --bg-app:    #0b0b11;
  --bg-side:   #0c0c13;
  --panel:     #14141b;   /* graphite */
  --panel-2:   #1a1a23;
  --panel-3:   #23232e;
  --border:    rgba(255,255,255,0.065);
  --border-2:  rgba(255,255,255,0.115);
  --edge:      rgba(255,255,255,0.06);   /* glass top-highlight hairline (inset) */
  --glass:     linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0) 44%);
  --text:      #f6f6f8;
  --text-2:    #9c9caa;
  --text-3:    #61616e;
  --accent:    #8b5cf6;
  --accent-2:  #a78bfa;
  --accent-3:  #7c3aed;
  --accent-soft: rgba(139,92,246,0.14);
  --accent-glow: rgba(139,92,246,0.40);
  --signal:      #f6b73c;   /* warm secondary accent — highlights, sparingly */
  --signal-soft: rgba(246,183,60,0.14);
  --green:     #34d399;
  --green-soft:rgba(52,211,153,0.13);
  --amber:     #fbbf24;
  --amber-soft:rgba(251,191,36,0.13);
  --red:       #f87171;
  --red-soft:  rgba(248,113,113,0.13);
  --blue:      #60a5fa;
  --radius:    16px;
  --radius-sm: 11px;
  --radius-xs: 9px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --ease-out:  cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.4,.5,1);
  --shadow:    0 1px 1px rgba(0,0,0,0.5), 0 2px 6px rgba(0,0,0,0.32), 0 16px 40px -18px rgba(0,0,0,0.72);
  --shadow-lg: 0 32px 80px -20px rgba(0,0,0,0.78);
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font:  'Inter', 'Plus Jakarta Sans', -apple-system, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, monospace;
  --team-civ:    #8b8b97;
  --team-police: #5b9dff;
  --team-sheriff:#d9a455;
  --team-fire:   #ff7a59;
  --team-dot:    #ffd24a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
#root { min-height: 100vh; }
::selection { background: var(--accent-glow); color: #fff; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); background-clip: padding-box; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.tnum { font-variant-numeric: tabular-nums; }

/* Type roles — Space Grotesk carries every display line; Inter (body) picks up its
   refined glyphs. Headings that are real h-tags inherit display automatically; the
   .display util covers the div-titles React renders. */
body { font-feature-settings: 'cv02','cv03','cv04','cv11'; }
h1, h2, h3, h4, .display { font-family: var(--font-display); letter-spacing: -0.022em; }
.display { font-weight: 600; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; height: 40px; border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform .2s var(--ease-spring), background .22s var(--ease), box-shadow .25s var(--ease), border-color .22s var(--ease), color .2s var(--ease), filter .22s var(--ease);
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 22px -8px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 12px 30px -8px var(--accent-glow); filter: brightness(1.06); }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); }
.btn-ghost:hover { background: var(--panel-3); border-color: rgba(255,255,255,0.2); }
.btn-subtle { background: transparent; color: var(--text-2); }
.btn-subtle:hover { background: var(--panel-2); color: var(--text); }
.btn-discord { background: #5865F2; color: #fff; box-shadow: 0 8px 22px -8px rgba(88,101,242,0.6); }
.btn-discord:hover { background: #4752e0; filter: brightness(1.04); }
.btn-danger { background: var(--red-soft); color: var(--red); border: 1px solid rgba(248,113,113,0.25); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }

/* ---- button micro-interactions (shine sweep + icon motion), same feel as the Access chip ---- */
.btn { position: relative; overflow: hidden; }
.btn svg { transition: transform .2s var(--ease-out); }
.btn:hover svg { transform: scale(1.1); }
.btn:active svg { transform: scale(.94); }
/* diagonal gloss sweep — solid/filled buttons only */
.btn-primary::before, .btn-discord::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 55%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.24), transparent);
  transform: translateX(-200%) skewX(-14deg); transition: transform .6s var(--ease-out);
}
.btn-primary:hover::before, .btn-discord:hover::before { transform: translateX(360%) skewX(-14deg); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(248,113,113,0.45); }
.btn-discord:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(88,101,242,0.6); }

/* server-card CAD chip — subtle lift + icon pop */
.sh-chip svg { transition: transform .18s var(--ease-out); }
.sh-chip:hover { transform: translateY(-1px); }
.sh-chip:hover svg { transform: scale(1.12); }
.sh-chip:active { transform: translateY(0) scale(.97); }

/* ============ cards ============ */
.card {
  position: relative;
  background: var(--glass), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 var(--edge);
}
.card-hover { transition: transform .35s var(--ease-out), border-color .3s var(--ease), box-shadow .35s var(--ease-out); }
.card-hover:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow-lg); }

/* honeypot trap-message editor: textarea + live V2 preview, side by side (stacks on mobile) */
.sec-msg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 720px) { .sec-msg-grid { grid-template-columns: 1fr; } }

/* ============ badges / pills ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: -0.01em;
  border: 1px solid var(--border-2);
}
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.badge-green { background: var(--green-soft); color: var(--green); border-color: rgba(52,211,153,0.25); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(251,191,36,0.25); }
.badge-red   { background: var(--red-soft);   color: var(--red);   border-color: rgba(248,113,113,0.25); }
.badge-violet{ background: var(--accent-soft); color: var(--accent-2); border-color: rgba(139,92,246,0.3); }
.badge-blue  { background: rgba(96,165,250,0.12); color: var(--blue); border-color: rgba(96,165,250,0.28); }
.badge-gray  { background: var(--panel-3); color: var(--text-2); }

/* ============ inputs ============ */
.input {
  display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px; border-radius: var(--radius-xs);
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text);
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--panel); }
.input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14px; }
.input input::placeholder { color: var(--text-3); }
.kbd {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border-2); border-radius: 5px; padding: 2px 5px; line-height: 1;
  background: var(--panel-3);
}

/* ============ animations ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes pingRing { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes shimmer { 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes gridmove { to { background-position: 40px 40px; } }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dashflow { to { stroke-dashoffset: -1000; } }
@keyframes viewEnter { from { opacity: 0; transform: translateY(12px) scale(.992); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes progressBar { 0% { transform: scaleX(0); } 60% { transform: scaleX(.7); } 100% { transform: scaleX(1); } }

.anim-fadeup { animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) both; }
.anim-fadein { animation: fadeIn .5s ease both; }
.anim-scalein { animation: scaleIn .4s cubic-bezier(.2,.7,.2,1) both; }
.live-dot { position: relative; }
.live-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: inherit; animation: pingRing 1.8s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============ route transition wrapper ============ */
/* fill-mode is `backwards`, NOT `both`, and that matters a lot: `both` holds the final keyframe
   forever, which left `filter: blur(0)` permanently applied. A filtered element becomes the
   containing block for its `position: fixed` descendants — so every modal/drawer inside a view was
   centring on the content pane (right of the sidebar, below the topbar) instead of the viewport.
   `backwards` still applies the `from` state before the run, and afterwards the element reverts to
   its base styles — which already equal the `to` values, so it looks identical. */
.route { animation: viewEnter .55s var(--ease-out) backwards; }
.page-enter { animation: pageEnter .5s var(--ease-out) both; }

/* scroll reveal */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* route progress bar */
.route-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px; z-index: 300; pointer-events: none;
  transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent-glow);
  animation: progressBar .55s var(--ease-out) forwards, fadeIn .15s ease;
}
.route-progress.done { animation: fadeOut .35s ease .1s forwards; }
@keyframes fadeOut { to { opacity: 0; } }

/* ============ demo sandbox banner ============
   Same bar as the CAD's (.cad-demo-banner in cad.css) so the two sandboxes read as one product.
   Fixed, 44px — the dashboard shell pads itself down by exactly that. */
.demo-banner { position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 210; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: linear-gradient(90deg, var(--accent-soft), var(--panel) 70%); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.demo-badge { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; }
.demo-text { min-width: 0; flex: 1; font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-act { height: 30px !important; padding: 0 12px !important; font-size: 12px !important; flex: none; }
@media (max-width: 760px) { .demo-text { display: none; } .demo-banner { gap: 8px; padding: 0 10px; } }

/* ============ utility ============ */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.spread { justify-content: space-between; }
.center { align-items: center; justify-content: center; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.grow { flex: 1; }
.txt-green { color: var(--green); } .txt-amber { color: var(--amber); } .txt-red { color: var(--red); }
.txt-accent { color: var(--accent-2); }
.hide-scroll::-webkit-scrollbar { display: none; }

/* gradient text */
.grad-text {
  background: linear-gradient(120deg, #fff 18%, var(--accent-2) 42%, #fff 64%, var(--accent-2) 86%, #fff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 7s ease-in-out infinite;
}
@keyframes gradShift { 0%,100% { background-position: 0% center; } 50% { background-position: 100% center; } }

/* icon button */
.iconbtn {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  color: var(--text-3); transition: background .15s var(--ease), color .15s var(--ease), transform .2s var(--ease-spring);
}
.iconbtn:hover { background: var(--panel-3); color: var(--text); transform: translateY(-1px) scale(1.08); }
.iconbtn:active { transform: scale(.92); }

/* nav item */
.navitem {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: var(--text-2); transition: all .16s; position: relative;
}
.navitem:hover { background: var(--panel-2); color: var(--text); }
.navitem:hover { transform: translateX(2px); }
.navitem:active { transform: translateX(2px) scale(.985); }
.navitem.active { background: var(--accent-soft); color: var(--text); transform: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.05); }
.navitem { transition: background .22s var(--ease), color .2s var(--ease), transform .22s var(--ease-spring); }
.navitem.active::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
  animation: navbar .4s var(--ease-spring) both;
}
@keyframes navbar { from { transform: translateY(-50%) scaleY(0); } to { transform: translateY(-50%) scaleY(1); } }

/* ===== collapsible nav group + tree connectors ===== */
.nav-group-head {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 9px; font-size: 14px; font-weight: 600;
  color: var(--text-2); transition: background .2s var(--ease), color .2s var(--ease);
}
.nav-group-head:hover { background: var(--panel-2); color: var(--text); }
.nav-group-chev { transition: transform .35s var(--ease-out); color: var(--text-3); }
.nav-group.open .nav-group-chev { transform: rotate(180deg); }
.nav-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .38s var(--ease-out); }
.nav-group.open .nav-collapse { grid-template-rows: 1fr; }
.nav-collapse > div { overflow: hidden; }

.nav-tree { position: relative; margin: 4px 0 2px 21px; padding-left: 14px; display: flex; flex-direction: column; gap: 2px; }
.nav-tree::before { content: ''; position: absolute; left: 0; top: 0; bottom: 16px; width: 1.5px; background: var(--border-2); border-radius: 2px; }
.nav-sub {
  position: relative; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background .18s var(--ease), color .18s var(--ease), transform .2s var(--ease-spring);
}
.nav-sub::before {
  content: ''; position: absolute; left: -14px; top: 50%; width: 12px; height: 12px;
  border-left: 1.5px solid var(--border-2); border-bottom: 1.5px solid var(--border-2);
  border-bottom-left-radius: 8px; transform: translateY(-100%);
  transition: border-color .2s var(--ease);
}
.nav-sub:hover { background: var(--panel-2); color: var(--text); transform: translateX(2px); }
.nav-sub.active { background: var(--accent-soft); color: var(--text); }
.nav-sub.active::before { border-color: var(--accent); }

/* ===== immersive ER:LC live widget ===== */
.erlc-widget {
  flex: none;
  border-radius: 14px; border: 1px solid var(--border);
  background:
    radial-gradient(130% 90% at 0% 0%, rgba(139,92,246,0.10), transparent 58%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
  overflow: hidden; transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.erlc-widget.open { border-color: rgba(139,92,246,0.28); box-shadow: 0 0 0 1px rgba(139,92,246,0.10), 0 18px 44px -24px rgba(139,92,246,0.55); }
.erlc-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 13px; text-align: left; }
.erlc-emblem {
  width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(150deg, var(--accent-2), var(--accent-3));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 6px 16px -6px var(--accent-glow); position: relative;
}
.erlc-emblem::after {
  content: ''; position: absolute; inset: 0; border-radius: 11px;
  background: linear-gradient(155deg, rgba(255,255,255,0.28), transparent 52%); pointer-events: none;
}
.erlc-emblem-dot {
  position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--green); border: 2.5px solid var(--bg-side); box-shadow: 0 0 8px var(--green);
}
.erlc-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 17px; padding: 0 7px; border-radius: 999px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--green);
  background: var(--green-soft); border: 1px solid rgba(52,211,153,0.28);
}
.erlc-livedot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); position: relative; flex: none; }
.erlc-livedot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--green); animation: pingRing 1.8s ease-out infinite; }
.erlc-chev { transition: transform .4s var(--ease-out); color: var(--text-3); flex: none; }
.erlc-widget.open .erlc-chev { transform: rotate(180deg); }

.erlc-cap { padding: 0 13px 12px; }
.erlc-cap-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.erlc-cap-label { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.erlc-cap-num { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.erlc-cap-num b { color: var(--text); font-weight: 700; }
.erlc-cap-bar { height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.erlc-cap-fill {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  box-shadow: 0 0 10px var(--accent-glow); transform-origin: left; animation: barGrow 1s var(--ease-out) both;
}

.erlc-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s var(--ease-out); }
.erlc-widget.open .erlc-collapse { grid-template-rows: 1fr; }
.erlc-collapse > div { overflow: hidden; }

.erlc-tree { position: relative; margin: 2px 8px 10px 16px; padding-left: 8px; display: flex; flex-direction: column; gap: 2px; }
.erlc-tree::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 8px; width: 1.5px; background: var(--border); border-radius: 2px; }
.erlc-tree-fill { display: none; }
.erlc-ind {
  position: absolute; left: 4px; right: 0; border-radius: 9px;
  background: var(--panel-2);
  transition: top .4s var(--ease-out), height .4s var(--ease-out), opacity .25s var(--ease); pointer-events: none; z-index: 0;
}
.erlc-ind::before {
  content: ''; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 2.5px; height: 60%; border-radius: 2px; background: var(--accent);
}
.erlc-sub {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 9px; color: var(--text-2);
  transition: color .2s var(--ease);
}
.erlc-sub:hover { color: var(--text); }
.erlc-sub:hover .erlc-chip { color: var(--text-2); }
.erlc-sub.active { color: var(--text); }
.erlc-chip {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center; color: var(--text-3);
  transition: color .22s var(--ease), transform .35s var(--ease-spring);
}
.erlc-sub.active .erlc-chip {
  color: var(--accent-2);
  filter: drop-shadow(0 2px 6px var(--accent-glow));
  animation: erlcChipPop .45s var(--ease-spring) both;
}
@keyframes erlcChipPop {
  0% { transform: scale(0.85); }
  55% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
.erlc-count {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: var(--panel-3); color: var(--text-3); border: 1px solid var(--border); flex: none;
  transition: all .25s var(--ease);
}
.erlc-sub.active .erlc-count { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(139,92,246,0.3); }

/* ===== Auto roles — advanced controls ===== */
.ar-select {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border-2); transition: border-color .18s var(--ease), background .18s var(--ease);
  cursor: pointer; width: 100%; text-align: left;
}
.ar-select:hover { border-color: rgba(255,255,255,0.2); background: var(--panel-3); }
.ar-pop {
  position: absolute; z-index: 40; margin-top: 6px; min-width: 240px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; animation: scaleIn .18s var(--ease-out) both; transform-origin: top left;
  max-height: 320px; overflow-y: auto;
}
.ar-pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; transition: background .14s var(--ease); cursor: pointer;
}
.ar-pop-item:hover { background: var(--panel-3); }
.ctx-row { transition: background .14s var(--ease); }
.ctx-row:hover { background: var(--panel-2); }
.role-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 11px 0 currentColor, 0 0 2px 0 currentColor; }
.role-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 8px;
  font-size: 13px; font-weight: 600; border: 1px solid var(--border-2); background: var(--panel-2);
  transition: border-color .16s var(--ease), background .16s var(--ease); cursor: pointer; max-width: 100%;
}
.role-pill:hover { border-color: rgba(255,255,255,0.22); background: var(--panel-3); }
.ar-rule { position: relative; transition: background .16s var(--ease); }
.ar-rule:focus-within { z-index: 30; }
.ar-rule:hover { background: var(--panel-2); }
.ar-rolerow { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; transition: background .14s var(--ease); }
.ar-rolerow:hover { background: var(--panel-2); }
@keyframes shimmerbar { 100% { background-position: 200% 0; } }
.ar-skeleton {
  height: 14px; border-radius: 6px;
  background: linear-gradient(90deg, var(--panel-3) 25%, var(--panel-2) 37%, var(--panel-3) 63%);
  background-size: 200% 100%; animation: shimmerbar 1.3s ease infinite;
}

/* glow blob */
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; pointer-events: none; }

/* ============ marquee ============ */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-rev .marquee-track { animation-direction: reverse; }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ============ FAQ accordion ============ */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; transition: border-color .2s var(--ease), background .2s var(--ease); }
.faq-item:hover { border-color: var(--border-2); }
.faq-item.open { border-color: var(--border-2); background: var(--panel-2); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; text-align: left; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.faq-chevron { transition: transform .35s var(--ease-out); color: var(--text-3); flex: none; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent-2); }
.faq-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s var(--ease-out); }
.faq-item.open .faq-body { grid-template-rows: 1fr; }
.faq-body > div { overflow: hidden; }
.faq-answer { padding: 0 20px 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }

/* ============ comparison table ============ */
.cmp { width: 100%; border-collapse: collapse; }
.cmp th, .cmp td { padding: 15px 18px; text-align: center; border-bottom: 1px solid var(--border); }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp .hl { position: relative; background: linear-gradient(180deg, rgba(139,92,246,0.10), rgba(139,92,246,0.04)); }
.cmp thead .hl { border-radius: 12px 12px 0 0; }
.cmp tbody tr:last-child .hl { border-radius: 0 0 12px 12px; }
.cmp-tick { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.cmp-dash { color: var(--text-3); }

/* ============ drawer / modal ============ */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  z-index: 80; animation: fadeIn .25s ease both;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 96vw);
  background: var(--panel); border-left: 1px solid var(--border-2);
  z-index: 90; box-shadow: -24px 0 70px -24px rgba(0,0,0,0.75);
  display: flex; flex-direction: column; animation: drawerIn .42s var(--ease-out) both;
}
@keyframes drawerIn { from { transform: translateX(48px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer { animation: drawerIn .5s var(--ease-spring) both; }
.drawer-overlay { animation: fadeIn .35s ease both; }
/* cascading fields */
.stagger > * { animation: fadeUp .5s var(--ease-out) both; }
.stagger > *:nth-child(1){animation-delay:.06s}
.stagger > *:nth-child(2){animation-delay:.10s}
.stagger > *:nth-child(3){animation-delay:.14s}
.stagger > *:nth-child(4){animation-delay:.18s}
.stagger > *:nth-child(5){animation-delay:.21s}
.stagger > *:nth-child(6){animation-delay:.24s}
.stagger > *:nth-child(7){animation-delay:.27s}
.stagger > *:nth-child(8){animation-delay:.30s}
.stagger > *:nth-child(9){animation-delay:.32s}
.stagger > *:nth-child(n+10){animation-delay:.34s}

/* checkbox */
.cbx {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-2);
  display: grid; place-items: center; transition: all .15s var(--ease); flex: none; cursor: pointer; color: transparent;
}
.cbx.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cbx:hover { border-color: var(--accent); }

/* admin badge */
.admin-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 19px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-3)); color: #fff;
  box-shadow: 0 2px 8px -2px var(--accent-glow);
}

/* platform-wide banners (maintenance + read-only impersonation) */
.gb-wrap { position: fixed; top: 0; left: 0; right: 0; z-index: 400; display: flex; flex-direction: column; pointer-events: none; }
.gb { pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 20px -8px rgba(0,0,0,0.6); }
.gb-amber { background: linear-gradient(90deg, #8a5a12, #c98a1f); color: #fff; }
.gb-violet { background: linear-gradient(90deg, #5b21b6, #7c3aed); color: #fff; }
.gb button { margin-left: 4px; padding: 3px 12px; border-radius: 7px; background: rgba(255,255,255,0.22); color: #fff; font-weight: 700; font-size: 12px; transition: background .15s ease; }
.gb button:hover { background: rgba(255,255,255,0.34); }

/* staff quota rows + horizontal number stepper */
.quota-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.quota-row:last-child { border-bottom: none; }
.num-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 9px; overflow: hidden; background: var(--panel-2); height: 38px; }
.num-stepper button { width: 34px; height: 100%; display: grid; place-items: center; color: var(--text-2); transition: background .14s ease, color .14s ease; }
.num-stepper button:hover:not(:disabled) { background: rgba(255,255,255,0.06); color: var(--accent-2); }
.num-stepper button:disabled { opacity: .35; cursor: default; }
.num-stepper input { width: 56px; height: 100%; text-align: center; border: none; background: transparent; color: var(--text); font-family: var(--mono); font-weight: 700; font-size: 14px; -moz-appearance: textfield; appearance: textfield; }
.num-stepper input::-webkit-outer-spin-button, .num-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* server-card icon: refined, softly-animated glow on card hover */
.srv-ico { transition: box-shadow .4s var(--ease), transform .4s var(--ease); border-radius: 12px; will-change: box-shadow, transform; }
.srv-card:hover .srv-ico { transform: translateY(-1px) scale(1.05); animation: srvGlow 2.6s ease-in-out infinite; }
@keyframes srvGlow {
  0%, 100% { box-shadow: 0 6px 18px -8px rgba(139,92,246,0.40), 0 0 18px -5px rgba(139,92,246,0.26); }
  50%      { box-shadow: 0 10px 26px -8px rgba(139,92,246,0.55), 0 0 30px -3px rgba(139,92,246,0.42); }
}
@media (prefers-reduced-motion: reduce) {
  .srv-card:hover .srv-ico { animation: none; box-shadow: 0 8px 22px -8px rgba(139,92,246,0.45); }
}

/* ===== Analytics view: settings panel + live states ===== */
.an-seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; height: 30px; }
.an-seg button { padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--text-3); transition: color .15s var(--ease), background .15s var(--ease); }
.an-seg button:hover { color: var(--text-2); }
.an-seg button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 10px -3px var(--accent-glow); }
.an-swatch { width: 22px; height: 22px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border), 0 1px 4px rgba(0,0,0,.3); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.an-swatch:hover { transform: scale(1.12); }
.an-swatch.on { border-color: var(--bg); box-shadow: 0 0 0 2px #fff, 0 0 10px -1px var(--accent-glow); }
/* settings bar */
.an-settings { background: linear-gradient(135deg, var(--accent-soft), transparent 58%); padding: 14px 18px; }
.an-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.an-ctl { display: flex; flex-direction: column; }
.an-vrule { width: 1px; align-self: stretch; min-height: 40px; background: var(--border); flex: none; }
.an-status { display: flex; align-items: center; gap: 12px; }
@media (max-width: 768px) { .an-vrule { display: none; } .an-status { margin-top: 4px; } }
/* empty states inside chart cards */
.an-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 190px; padding: 28px 24px; }
.an-empty-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-bottom: 12px; }
.an-empty-title { font-weight: 700; font-size: 14px; color: var(--text); }
.an-empty-text { font-size: 12.5px; color: var(--text-3); max-width: 320px; line-height: 1.55; margin-top: 3px; }
/* Live empty state: a faint animated ghost sparkline drifting behind, so the page never looks dead. */
.an-empty-live { position: relative; overflow: hidden; }
.an-empty-live > .an-empty-ico, .an-empty-live > .an-empty-title, .an-empty-live > .an-empty-text { position: relative; z-index: 1; }
.an-ghost { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 60%; color: var(--accent); opacity: .5; pointer-events: none; }
.an-ghost-line { stroke-dasharray: 620; stroke-dashoffset: 620; animation: anGhostDraw 2.4s var(--ease, ease) .1s forwards, anGhostDrift 9s ease-in-out 2.6s infinite alternate; }
.an-ghost-area { opacity: 0; animation: anGhostFade 1.2s ease 1.4s forwards; }
.an-empty-ico.an-pulse { animation: anPulse 2.4s ease-in-out infinite; }
@keyframes anGhostDraw { to { stroke-dashoffset: 0; } }
@keyframes anGhostFade { to { opacity: 1; } }
@keyframes anGhostDrift { from { transform: translateX(0); } to { transform: translateX(-6px); } }
@keyframes anPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(139,92,246,.25); } 50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(139,92,246,0); } }
@media (prefers-reduced-motion: reduce){ .an-ghost-line, .an-ghost-area, .an-empty-ico.an-pulse { animation: none; } .an-ghost-line { stroke-dashoffset: 0; } .an-ghost-area { opacity: 1; } }
.an-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.5); animation: anPulse 2.2s infinite; }
@keyframes anPulse { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5); } 70% { box-shadow: 0 0 0 6px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.an-skel { background: linear-gradient(90deg, var(--panel-2), rgba(255,255,255,.05), var(--panel-2)); background-size: 200% 100%; animation: anSkel 1.4s ease infinite; border-radius: 14px; border: 1px solid var(--border); }
@keyframes anSkel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
/* motion setting */
.dash-anim-off .an-live-dot { animation: none; }
.dash-anim-off *, .dash-anim-off *::before, .dash-anim-off *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition-duration: .05s !important; }
.dash-anim-lively .card { animation-duration: .38s !important; }
/* density setting */
.an-compact { gap: 12px !important; }
.an-compact .card { padding: 15px !important; }

/* ============ Servers Home — aurora glass (variant 5) ============ */
.sh-root{position:relative;min-height:100vh;background:var(--bg-app);padding:44px clamp(18px,4vw,48px) 90px;overflow:hidden}
.sh-aurora{display:none}
.sh-wrap{position:relative;z-index:1;max-width:1240px}
.sh-greet{display:flex;align-items:center;gap:15px;margin-bottom:22px}
.sh-avwrap{position:relative;width:54px;height:54px;flex:none}
.sh-greet .av{width:54px;height:54px;border-radius:50%;flex:none;object-fit:cover;display:grid;place-items:center;font-weight:800;font-size:19px;color:#fff;background:linear-gradient(135deg,#3a3a52,#20202c);box-shadow:0 10px 26px -10px rgba(0,0,0,.6);border:2px solid rgba(255,255,255,.14)}
/* Discord avatar decoration — the animated frame that sits around the profile pic (~1.35× the avatar). */
.sh-avdeco{position:absolute;top:50%;left:50%;width:73px;height:73px;transform:translate(-50%,-50%);pointer-events:none;object-fit:contain;z-index:1}
.sh-hello{font-size:27px;font-weight:800;letter-spacing:-.03em;line-height:1.15;background:linear-gradient(92deg,#fff 32%,var(--accent-2));-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.sh-sub{font-size:13.5px;color:var(--text-2);margin-top:3px}
.sh-actions{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:28px}
.sh-glassbtn{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 16px;border-radius:11px;font-size:13.5px;font-weight:700;
  background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);color:var(--text);transition:.18s var(--ease)}
.sh-glassbtn:hover{background:rgba(255,255,255,.09);transform:translateY(-1px)}
.sh-glassbtn svg{width:16px;height:16px}
.sh-sect{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:16px}
.sh-sect h2{font-size:17px;font-weight:800;letter-spacing:-.02em}
.sh-sect p{font-size:12.5px;color:var(--text-3);margin-top:3px}
.sh-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px}
.sh-glass{background:rgba(20,20,27,.55);backdrop-filter:blur(22px) saturate(1.4);-webkit-backdrop-filter:blur(22px) saturate(1.4);
  border:1px solid rgba(255,255,255,.09);box-shadow:0 22px 60px -28px rgba(0,0,0,.75),inset 0 1px 0 rgba(255,255,255,.09)}
.sh-card{border-radius:20px;padding:18px;display:flex;flex-direction:column;gap:16px;cursor:pointer;position:relative;
  transition:transform .2s var(--ease),box-shadow .2s var(--ease),border-color .2s}
.sh-card:hover{border-color:rgba(255,255,255,.18);box-shadow:0 24px 60px -30px rgba(0,0,0,.7)}
.sh-card.menu-open{z-index:40}  /* lift above sibling cards so the Access dropdown isn't covered */

/* ---- About page ---- */
.about-hero{ position:relative; overflow:hidden; padding-top:70px; padding-bottom:40px; }
.about-founders{ display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-top:44px; }
.about-card{ position:relative; overflow:hidden; border-radius:22px; padding:26px; background:rgba(18,18,26,.66); border:1px solid var(--border); transition:border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.about-card:hover{ transform:translateY(-4px); border-color:color-mix(in srgb, var(--c,#8b5cf6) 55%, var(--border)); box-shadow:0 30px 70px -34px rgba(0,0,0,.7); }
.about-card-glow{ position:absolute; inset:0; pointer-events:none; opacity:.5; background:radial-gradient(420px 200px at 15% -10%, color-mix(in srgb, var(--c,#8b5cf6) 26%, transparent), transparent 70%); }
.about-av{ width:64px; height:64px; flex:none; border-radius:18px; object-fit:cover; position:relative; z-index:1;
  border:2px solid color-mix(in srgb, var(--c,#8b5cf6) 60%, transparent);
  box-shadow:0 14px 34px -12px color-mix(in srgb, var(--c,#8b5cf6) 80%, transparent); }
.about-mono{ width:64px; height:64px; flex:none; border-radius:18px; display:grid; place-items:center; font-size:30px; font-weight:800; color:#fff;
  background:linear-gradient(140deg, color-mix(in srgb, var(--c,#8b5cf6) 92%, #fff), color-mix(in srgb, var(--c,#8b5cf6) 55%, #000));
  box-shadow:0 14px 34px -12px color-mix(in srgb, var(--c,#8b5cf6) 80%, transparent); position:relative; z-index:1; }
.about-role{ display:inline-block; margin-top:6px; font-size:12px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; color:var(--accent-2);
  background:var(--accent-soft); border:1px solid rgba(139,92,246,.3); border-radius:999px; padding:3px 11px; }
.about-chip{ font-size:12px; font-weight:600; color:var(--text-2); background:var(--panel-2); border:1px solid var(--border); border-radius:8px; padding:5px 10px; }
.about-values{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:40px; }
.about-value{ border-radius:16px; padding:22px; background:var(--panel); border:1px solid var(--border); transition:border-color .2s var(--ease), transform .2s var(--ease); }
.about-value:hover{ transform:translateY(-3px); border-color:rgba(139,92,246,.35); }
.about-value-ico{ width:46px; height:46px; border-radius:13px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-2); }
@media (max-width:820px){ .about-founders{ grid-template-columns:1fr; } .about-values{ grid-template-columns:1fr; } }

/* ---- About: cinematic load-up ---- */
.ab-intro{ position:fixed; inset:0; z-index:9999; display:grid; place-items:center; overflow:hidden;
  background:radial-gradient(120% 120% at 50% 42%, #15121f 0%, #08070c 68%);
  animation:abCurtain 1.5s cubic-bezier(.76,0,.24,1) forwards; will-change:transform; }
@keyframes abCurtain{ 0%,68%{ transform:translateY(0); } 100%{ transform:translateY(-102%); } }
.ab-intro-glow{ position:absolute; width:620px; height:620px; border-radius:50%; filter:blur(90px);
  background:radial-gradient(circle, rgba(139,92,246,.6), rgba(91,157,255,.25) 45%, transparent 66%); animation:abGlow 1.5s ease-out both; }
@keyframes abGlow{ 0%{ transform:scale(.2); opacity:0; } 38%{ opacity:.95; } 100%{ transform:scale(1.35); opacity:.28; } }
.ab-ring{ position:absolute; border-radius:50%; border:1px solid rgba(139,92,246,.45); z-index:1; animation:abRingExp 1.5s ease-out both; }
.ab-ring.r1{ width:190px; height:190px; } .ab-ring.r2{ width:350px; height:350px; animation-delay:.12s; } .ab-ring.r3{ width:540px; height:540px; animation-delay:.24s; }
@keyframes abRingExp{ 0%{ transform:scale(.3); opacity:0; } 32%{ opacity:.75; } 100%{ transform:scale(1.18); opacity:0; } }
.ab-intro-word{ position:relative; z-index:2; font-family:'Space Grotesk',sans-serif; font-weight:800; letter-spacing:.08em;
  font-size:clamp(46px,11vw,120px); text-shadow:0 0 70px rgba(139,92,246,.55); animation:abWord 1.35s cubic-bezier(.2,1,.28,1) both; }
@keyframes abWord{ 0%{ opacity:0; transform:scale(.8); letter-spacing:.42em; filter:blur(16px); } 46%{ opacity:1; filter:blur(0); } 62%{ transform:scale(1.02); letter-spacing:.08em; } 100%{ opacity:1; transform:scale(1); } }
.ab-intro-tag{ position:relative; z-index:2; margin-top:16px; font-size:13px; font-weight:600; text-transform:uppercase; letter-spacing:.4em; color:rgba(255,255,255,.55); animation:abTag 1.1s ease .34s both; }
@keyframes abTag{ 0%{ opacity:0; transform:translateY(12px); letter-spacing:.7em; } 100%{ opacity:1; transform:translateY(0); letter-spacing:.4em; } }

/* hero assembles as the curtain lifts */
.about-page.ab-loading .ab-rise{ opacity:0; }
.about-page.ab-loaded .ab-rise{ opacity:0; animation:abRise .85s cubic-bezier(.2,.8,.2,1) both; animation-delay:var(--d,0s); }
@keyframes abRise{ 0%{ opacity:0; transform:translateY(34px) scale(.98); filter:blur(9px); } 100%{ opacity:1; transform:translateY(0) scale(1); filter:blur(0); } }
.about-page.ab-loaded .ab-aurora{ animation:abAurora 1.5s ease both; }
@keyframes abAurora{ 0%{ opacity:0; transform:scale(1.25); } 100%{ opacity:1; transform:scale(1); } }
.about-page.ab-loaded .ab-sheen{ animation:abSheen 1.7s ease .95s both; }
@keyframes abSheen{ 0%,100%{ filter:drop-shadow(0 0 0 transparent); } 42%{ filter:drop-shadow(0 0 20px rgba(167,139,250,.75)); } }
@media (prefers-reduced-motion:reduce){ .ab-intro{ animation:abCurtainRM .4s ease forwards; } .ab-intro-word,.ab-ring,.ab-intro-glow,.ab-intro-tag,.about-page.ab-loaded .ab-rise,.about-page.ab-loaded .ab-aurora,.about-page.ab-loaded .ab-sheen{ animation-duration:.01s; } }
@keyframes abCurtainRM{ to{ opacity:0; visibility:hidden; } }
/* hero banner (owner image / gif) — fades to the card via a bottom scrim, name overlaid */
.sh-hero{position:relative;height:138px;margin:-18px -18px 0;border-radius:20px 20px 0 0;overflow:hidden}
.sh-hero-img{position:absolute;inset:0;background-size:cover;background-position:center;background-repeat:no-repeat;transition:transform .45s var(--ease)}
.sh-card.has-banner:hover .sh-hero-img{transform:scale(1.055)}
.sh-hero::after{content:'';position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(to bottom,rgba(10,10,14,0) 24%,rgba(11,11,16,.68) 68%,rgba(11,11,16,.95) 100%)}
.sh-hero-top{position:absolute;left:16px;right:16px;bottom:12px;z-index:1;display:flex;align-items:flex-end;gap:12px}
.sh-hero-top .sh-av{width:46px;height:46px;border-radius:50%;border:2px solid rgba(255,255,255,.92);box-shadow:0 4px 16px rgba(0,0,0,.6)}
.sh-hero-top .sh-name{color:#fff;text-shadow:0 2px 10px rgba(0,0,0,.8)}
.sh-hero-top .sh-role{background:rgba(255,255,255,.14);color:#fff;border-color:rgba(255,255,255,.28);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.sh-cardtop{display:flex;align-items:center;gap:13px;position:relative}
.sh-av{width:50px;height:50px;border-radius:15px;flex:none;object-fit:cover;display:grid;place-items:center;font-weight:800;font-size:18px;color:#fff;
  background:linear-gradient(135deg,var(--c,#8b5cf6),color-mix(in srgb,var(--c,#8b5cf6) 55%,#000));box-shadow:0 6px 16px -8px rgba(0,0,0,.5)}
.sh-name{font-size:15.5px;font-weight:800;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sh-role{display:inline-flex;align-items:center;gap:5px;margin-top:4px;height:20px;padding:0 8px;border-radius:999px;font-size:11px;font-weight:700;
  background:color-mix(in srgb,var(--c,#8b5cf6) 16%,transparent);color:var(--c,#a78bfa);border:1px solid color-mix(in srgb,var(--c,#8b5cf6) 32%,transparent)}
.sh-chips{display:flex;gap:9px;position:relative}
.sh-chip{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;border-radius:12px;font-size:12.5px;font-weight:700;
  background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08);color:var(--text-2);transition:.16s var(--ease)}
.sh-chip:hover{background:rgba(255,255,255,.09);color:var(--text)}
.sh-chip svg{width:15px;height:15px}
.sh-chip.pri{background:color-mix(in srgb,var(--c,#8b5cf6) 20%,transparent);color:#fff;border-color:color-mix(in srgb,var(--c,#8b5cf6) 40%,transparent)}
/* ---- Access dropdown chip ---- */
.sh-access{position:relative;overflow:hidden;justify-content:flex-start;padding:0 13px;gap:9px;
  background:linear-gradient(135deg,color-mix(in srgb,var(--c,#8b5cf6) 30%,transparent),color-mix(in srgb,var(--c,#8b5cf6) 12%,transparent));
  border-color:color-mix(in srgb,var(--c,#8b5cf6) 46%,transparent);
  transition:transform .18s var(--ease-out),box-shadow .25s var(--ease),border-color .2s var(--ease),background .2s var(--ease)}
.sh-access-ico{display:inline-flex;color:#fff;filter:drop-shadow(0 0 7px color-mix(in srgb,var(--c,#8b5cf6) 75%,transparent));transition:transform .2s var(--ease-out)}
.sh-access-lbl{letter-spacing:.01em;position:relative;z-index:1}
.sh-caret{margin-left:auto;display:inline-flex;opacity:.8;transition:transform .3s var(--ease-out),opacity .2s}
.sh-access:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--c,#8b5cf6) 66%,transparent);
  box-shadow:0 8px 22px -8px color-mix(in srgb,var(--c,#8b5cf6) 60%,transparent),inset 0 0 0 1px color-mix(in srgb,var(--c,#8b5cf6) 26%,transparent)}
.sh-access:hover .sh-access-ico{transform:scale(1.08) rotate(-3deg)}
.sh-access:hover .sh-caret{opacity:1}
.sh-access:active{transform:translateY(0) scale(.985)}
.sh-access.open{transform:translateY(0);border-color:color-mix(in srgb,var(--c,#8b5cf6) 70%,transparent);
  box-shadow:0 6px 20px -8px color-mix(in srgb,var(--c,#8b5cf6) 60%,transparent)}
.sh-access.open .sh-caret{transform:rotate(180deg);opacity:1}
/* shine sweep on hover */
.sh-access::before{content:'';position:absolute;top:0;bottom:0;left:0;width:60%;pointer-events:none;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.24),transparent);
  transform:translateX(-180%) skewX(-14deg);transition:transform .65s var(--ease-out)}
.sh-access:hover::before{transform:translateX(320%) skewX(-14deg)}
.sh-menu{position:absolute;top:calc(100% + 10px);left:0;right:0;z-index:20;background:var(--panel);border:1px solid var(--border-2);border-radius:13px;padding:6px;
  box-shadow:var(--shadow-lg),0 0 0 1px color-mix(in srgb,var(--c,#8b5cf6) 14%,transparent);transform-origin:top center;animation:shMenuIn .2s var(--ease-out) both}
@keyframes shMenuIn{from{opacity:0;transform:translateY(-8px) scale(.95)}to{opacity:1;transform:none}}
.sh-menu::after{content:'';position:absolute;top:-6px;left:22px;width:11px;height:11px;background:var(--panel);border-left:1px solid var(--border-2);border-top:1px solid var(--border-2);transform:rotate(45deg)}
.sh-menu-item{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border-radius:9px;font-size:13px;font-weight:600;color:var(--text-2);
  transition:background .14s,color .14s,transform .14s var(--ease-out);animation:shItemIn .26s var(--ease-out) both}
.sh-menu-item:nth-child(1){animation-delay:.03s}
.sh-menu-item:nth-child(2){animation-delay:.07s}
.sh-menu-item:nth-child(3){animation-delay:.11s}
@keyframes shItemIn{from{opacity:0;transform:translateX(-7px)}to{opacity:1;transform:none}}
.sh-menu-item:hover{background:var(--panel-3);color:var(--text);transform:translateX(3px)}
.sh-menu-item svg{color:var(--text-3);transition:color .14s}
.sh-menu-item:hover svg{color:color-mix(in srgb,var(--c,#8b5cf6) 90%,#fff)}
.sh-add{border:1px dashed rgba(255,255,255,.16)!important;align-items:stretch;justify-content:center}
.sh-modal-ov{position:fixed;inset:0;z-index:200;display:grid;place-items:center;padding:20px;background:rgba(6,7,10,.66);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:fadeIn .2s ease both}
.sh-modal{width:min(420px,94vw);border-radius:20px;padding:22px;animation:scaleIn .28s var(--ease-out) both}
.sh-toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);z-index:300;display:flex;align-items:center;gap:11px;padding:12px 18px;border-radius:14px;background:var(--panel);border:1px solid var(--border-2);box-shadow:var(--shadow-lg);font-size:13.5px;font-weight:600;animation:fadeUp .3s var(--ease-out) both}
.sh-spin{width:16px;height:16px;flex:none;border-radius:50%;border:2px solid rgba(255,255,255,.18);border-top-color:var(--accent-2);animation:spin .7s linear infinite}

/* ===== custom confirm dialog ===== */
.acx-ov{position:fixed;inset:0;z-index:9000;display:grid;place-items:center;padding:20px;background:rgba(6,7,10,.66);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);animation:fadeIn .18s ease both}
.acx-dialog{width:min(400px,94vw);background:var(--panel);border:1px solid var(--border-2);border-radius:16px;padding:22px;box-shadow:var(--shadow-lg);animation:scaleIn .22s var(--ease-out) both}
.acx-ico{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-2);margin-bottom:14px}
.acx-ico.danger{background:var(--red-soft);color:var(--red)}
.acx-title{font-size:16.5px;font-weight:800;letter-spacing:-.02em}
.acx-msg{font-size:13.5px;color:var(--text-2);line-height:1.55;margin-top:7px}
.acx-foot{display:flex;gap:9px;justify-content:flex-end;margin-top:20px}
.acx-del{background:linear-gradient(180deg,#fb7185,#e11d48);color:#fff;box-shadow:0 8px 20px -8px rgba(225,29,72,.5)}
.acx-del:hover{filter:brightness(1.07)}
@media (max-width:640px){ .sh-hello{font-size:23px} .sh-grid{grid-template-columns:1fr} }

/* ==================================================================
   ============  RESPONSIVE / MOBILE SUPPORT  =======================
   Canonical breakpoints — @media (max-width: N):
     1024  large tablet / small laptop
     768   PRIMARY stack point — multi-col grids collapse, drawers engage
     640   small tablet / large phone
     480   phone
     430   small phone
   (.fluid-sm collapses at 600; drawer-scrim / mobile-only guard at 769;
    CAD forms/modals additionally use 620 / 700 — see cad.css)
   Desktop (>768px) appearance is never changed: every rule below lives
   inside a max-width query or only overrides at a breakpoint.
   ================================================================== */

/* ===== show / hide helpers ===== */
.mobile-only { display: none !important; }
@media (max-width: 768px) {
  .mobile-only  { display: revert !important; }
  .desktop-only { display: none !important; }
}

/* ===== hamburger toggle — mobile-only 40x40 button ===== */
.nav-toggle {
  display: none; flex: none;
  width: 40px; height: 40px; border-radius: var(--radius-xs);
  place-items: center; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--border-2);
  transition: background .15s var(--ease), color .15s var(--ease), transform .2s var(--ease-spring);
}
.nav-toggle:hover { background: var(--panel-3); color: var(--text); }
.nav-toggle:active { transform: scale(.92); }
/* NB: this @768 rule sits AFTER .mobile-only above so its !important wins the
   tie when an element carries both classes (button stays a centered grid). */
@media (max-width: 768px) { .nav-toggle { display: grid !important; } }

/* ===== responsive grid collapse (override inline gridTemplateColumns) ===== */
@media (max-width: 768px) {
  .stack-2-md { grid-template-columns: repeat(2, 1fr) !important; }
  .stack-md   { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .stack-2-md { grid-template-columns: 1fr !important; }
  .stack-sm   { grid-template-columns: 1fr !important; }
}

/* ===== horizontal scroll wrapper for wide tables ===== */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table-scroll > table { min-width: 600px; }

/* ===== fixed-width blocks → fluid ===== */
@media (max-width: 600px) {
  .fluid-sm { width: 100% !important; max-width: 100% !important; }
}
@media (max-width: 480px) {
  .search-input { width: 100% !important; }
}

/* ===== marketing top nav ===== */
.site-nav {}   /* header wrapper — JSX layout hook, no desktop change */
.nav-links {}  /* absolute-centered links */
@media (max-width: 768px) { .nav-links { display: none; } }
.cta-row {}    /* hero CTA button row */
@media (max-width: 480px) {
  .cta-row { flex-wrap: wrap; }
  .cta-row .btn-lg { width: 100%; }
}

/* ===== dashboard + admin off-canvas drawer shell ===== */
@media (max-width: 768px) {
  .dash-shell, .admin-shell { grid-template-columns: 1fr !important; }
  .dash-sidebar {
    position: fixed !important; top: 0 !important; left: 0 !important;
    height: 100dvh !important; width: min(86vw, 300px) !important;
    transform: translateX(-100%); transition: transform .28s var(--ease);
    z-index: 200; overflow-y: auto;
  }
  .dash-sidebar.open { transform: none; }
}
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 190; animation: fadeIn .25s ease both;
}
@media (min-width: 769px) { .drawer-scrim { display: none; } }

/* ===== touch-target + component polish (audit) ===== */
@media (max-width: 768px) {
  .iconbtn { width: 40px; height: 40px; }
  .navitem, .nav-group-head, .erlc-sub { min-height: 44px; padding: 12px; }
}
@media (max-width: 640px) {
  .an-seg { height: 38px; }
  .an-seg button { padding: 0 14px; }
  .num-stepper button { width: 40px; }
  .quota-row { flex-wrap: wrap; gap: 10px; }
  .ar-pop { min-width: min(240px, calc(100vw - 24px)); max-width: calc(100vw - 24px); }
  .cmp th, .cmp td { padding: 11px 12px; font-size: 13px; }
}
@media (max-width: 480px) {
  .gb { flex-wrap: wrap; text-align: center; }
  .faq-q { padding: 15px 16px; font-size: 14.5px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   APPLICATIONS — form builder (drag) + public form theme engine
   ═══════════════════════════════════════════════════════════════════════════ */

/* ---------- builder: save bar ----------
   Only mounted while there are unsaved edits, so it announces itself (slides up, pulses) instead
   of sitting there permanently saying "All changes saved" — which is noise, not information. */
.f-savebar-wrap { position: sticky; bottom: 16px; display: flex; justify-content: center; pointer-events: none; z-index: 20; }
.f-savebar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(20, 20, 28, 0.82); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border-2);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  animation: fSaveIn .28s cubic-bezier(.2, .9, .3, 1) both;
}
.f-savebar-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--amber);
  box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); animation: fSavePulse 1.9s ease-out infinite;
}
.f-savebar-txt { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.f-savebar-btn { height: 32px !important; border-radius: 999px !important; padding: 0 14px !important; }
.f-spin {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: fSaveSpin .7s linear infinite;
}
@keyframes fSaveIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fSavePulse { 0% { box-shadow: 0 0 0 0 rgba(251,191,36,.5); } 70% { box-shadow: 0 0 0 7px rgba(251,191,36,0); } 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0); } }
@keyframes fSaveSpin { to { transform: rotate(360deg); } }
@media (max-width: 480px) { .f-savebar-txt { display: none; } .f-savebar { padding-left: 14px; } }

/* ---------- builder: draggable question cards ---------- */
.fq-list { display: flex; flex-direction: column; gap: 12px; position: relative; }

.fq-card {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 14px 14px 40px;
  transition: border-color .18s var(--ease), box-shadow .22s var(--ease), background .18s var(--ease);
  will-change: transform;
}
.fq-card:hover { border-color: var(--border-2); box-shadow: 0 8px 26px -14px rgba(0,0,0,.55); }
.fq-card.sel { border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent), 0 12px 34px -18px var(--accent-glow); }

/* FLIP: JS sets a transform to the OLD position, then removes it with this transition on,
   so the card glides from where it was to where it now is. */
.fq-card.flip { transition: transform .32s cubic-bezier(.22,1,.36,1); }

/* the lifted card follows the cursor — tilt + scale + deep shadow reads as "picked up" */
.fq-card.dragging {
  z-index: 30; cursor: grabbing;
  transform: scale(1.022) rotate(-.5deg);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 26px 60px -18px rgba(0,0,0,.75), 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--panel-2);
}
/* everything else dims so the dragged card visually wins */
.fq-list.is-dragging .fq-card:not(.dragging) { opacity: .72; }

/* grab handle — the dot rail */
.fq-handle {
  position: absolute; left: 10px; top: 14px; width: 20px; height: 26px;
  display: grid; place-items: center; border-radius: 7px; cursor: grab;
  color: var(--text-3); opacity: 0; transform: translateX(-3px);
  transition: opacity .18s var(--ease), transform .18s var(--ease-out), background .15s, color .15s;
}
.fq-card:hover .fq-handle, .fq-card.sel .fq-handle, .fq-card.dragging .fq-handle { opacity: 1; transform: none; }
.fq-handle:hover { background: var(--panel-3); color: var(--text); }
.fq-handle:active { cursor: grabbing; }
.fq-dots { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.fq-dots i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: block; }

/* the gap that opens where the card will land */
.fq-drop {
  height: 3px; border-radius: 3px; margin: -6px 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px 1px var(--accent-glow);
  animation: fqDrop .18s var(--ease-out) both;
}
@keyframes fqDrop { from { transform: scaleX(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* add / remove */
.fq-card.enter { animation: fqIn .34s var(--ease-spring) both; }
@keyframes fqIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.fq-card.leave { animation: fqOut .2s var(--ease) both; pointer-events: none; }
@keyframes fqOut { to { opacity: 0; transform: translateX(14px) scale(.96); } }

.fq-type { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); }

/* ---------- builder: theme picker ---------- */
.fm-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.fm-sw { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; cursor: pointer;
  transition: transform .16s var(--ease-spring), border-color .16s; }
.fm-sw:hover { transform: scale(1.12) translateY(-1px); }
.fm-sw.on { border-color: #fff; transform: scale(1.08); }
.fm-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fm-font { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
  text-align: left; font-size: 15px; transition: border-color .16s, background .16s, transform .16s var(--ease-out); }
.fm-font:hover { border-color: var(--border-2); transform: translateY(-1px); }
.fm-font.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fm-font small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; font-family: var(--font); }
.fm-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--panel); border: 1px solid var(--border); border-radius: 11px; }
.fm-seg button { padding: 6px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-3);
  transition: background .16s, color .16s; }
.fm-seg button.on { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--text); }
.fm-preview { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; position: sticky; top: 16px;
  max-height: calc(100vh - 140px); overflow-y: auto; }

/* ═══════════════ PUBLIC FORM — themed by CSS vars set inline from form.theme ═══════════════ */
.apf {
  --apf-accent: #8b5cf6; --apf-bg: #0a0a0e; --apf-radius: 18px;
  --apf-font: 'Plus Jakarta Sans', system-ui, sans-serif; --apf-hfont: var(--apf-font);
  --apf-text: #f2f3f7; --apf-text-2: #a9b0c0; --apf-text-3: #6f7686;
  --apf-card: rgba(22,22,30,.72); --apf-line: rgba(255,255,255,.10); --apf-field: rgba(255,255,255,.045);
  position: relative; min-height: 100vh; background: var(--apf-bg);
  font-family: var(--apf-font); color: var(--apf-text);
  padding: 40px 20px 80px; overflow-x: hidden;
  /* UA widgets (the native <select> popup above all) must follow the form's mode — without this the
     option list renders on a white surface while inheriting the near-white --apf-text = unreadable. */
  color-scheme: dark;
}
.apf.light {
  --apf-text: #14161c; --apf-text-2: #4d5563; --apf-text-3: #858c9a;
  --apf-card: rgba(255,255,255,.86); --apf-line: rgba(0,0,0,.10); --apf-field: rgba(0,0,0,.035);
  color-scheme: light;
}
.apf-bgimg { position: fixed; inset: 0; background-size: cover; background-position: center; z-index: 0; }
.apf-bgimg::after { content: ''; position: absolute; inset: 0; background: var(--apf-bg); opacity: calc(var(--apf-dim, 55) / 100); }
.apf-wrap { position: relative; z-index: 1; width: 100%; max-width: 720px; margin: 0 auto;
  animation: apfIn .7s cubic-bezier(.16,.84,.28,1) both; }
@keyframes apfIn { from { opacity: 0; transform: translateY(28px) scale(.985); } to { opacity: 1; transform: none; } }
.apf.center .apf-wrap { text-align: center; }
.apf.center .apf-opt { text-align: left; }

.apf-card { border-radius: var(--apf-radius); overflow: hidden; margin-bottom: 18px; }
/* NB: no backdrop-filter here. This card is TALL and scrolls over the FIXED background image, so a
   backdrop blur would recompute every scroll frame → the stutter users saw as "the scrolling". The
   card tint alone reads as frosted; the bg is already dimmed by .apf-bgimg::after. */
.apf-card.glass { background: color-mix(in srgb, var(--apf-card) 88%, var(--apf-bg));
  border: 1px solid var(--apf-line);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07); }
.apf-card.solid { background: var(--apf-card); border: 1px solid var(--apf-line); box-shadow: 0 24px 60px -30px rgba(0,0,0,.6); }
.apf-card.flat { background: transparent; border: none; box-shadow: none; }

.apf-hero { position: relative; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 18px 28px; }
.apf-hero::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, color-mix(in srgb, var(--apf-bg) 92%, transparent)); }
.apf-logo { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  border: 2px solid rgba(255,255,255,.9); box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.apf-head { padding: 26px 28px; }
.apf-title { font-family: var(--apf-hfont); font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.apf-desc { color: var(--apf-text-2); font-size: 15px; line-height: 1.6; margin-top: 10px; white-space: pre-wrap; }
.apf-body { padding: 18px 28px 30px; display: flex; flex-direction: column; gap: 34px; }

/* questions cascade in after the card settles — delay set inline per index via --d */
.apf-q { animation: apfQ .55s cubic-bezier(.16,.84,.28,1) both; animation-delay: var(--d, 0ms); }
@keyframes apfQ { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
/* the header (title + intro) leads the welcome, just before the questions */
.apf-head .apf-title { animation: apfQ .6s cubic-bezier(.16,.84,.28,1) both; animation-delay: 80ms; }
.apf-head .apf-desc { animation: apfQ .6s cubic-bezier(.16,.84,.28,1) both; animation-delay: 150ms; }
.apf-label { font-size: 15px; font-weight: 700; letter-spacing: -.01em; display: block; }
.apf-req { color: var(--apf-accent); margin-left: 4px; }
.apf-help { color: var(--apf-text-3); font-size: 13px; margin-top: 4px; line-height: 1.5; }
.apf-err { color: #f87171; font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 5px;
  animation: apfShake .32s var(--ease); }
@keyframes apfShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

.apf-input, .apf-textarea, .apf-select {
  width: 100%; margin-top: 13px; padding: 12px 14px; border-radius: calc(var(--apf-radius) * .55);
  background: var(--apf-field); border: 1px solid var(--apf-line); color: var(--apf-text);
  font-family: var(--apf-font); font-size: 14.5px; outline: none;
  transition: border-color .18s, box-shadow .22s, background .18s;
}
.apf-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.apf-input::placeholder, .apf-textarea::placeholder { color: var(--apf-text-3); }
.apf-input:focus, .apf-textarea:focus, .apf-select:focus {
  border-color: var(--apf-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--apf-accent) 18%, transparent);
  background: color-mix(in srgb, var(--apf-accent) 5%, var(--apf-field));
}
.apf-input.bad, .apf-textarea.bad, .apf-select.bad { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.14); }

/* radio / checkbox rows with a real animated control */
.apf-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.apf-opt { display: flex; align-items: center; gap: 11px; padding: 12px 14px; cursor: pointer;
  border-radius: calc(var(--apf-radius) * .5); background: var(--apf-field); border: 1px solid var(--apf-line);
  font-size: 14.5px; transition: border-color .16s, background .16s, transform .16s var(--ease-out); }
.apf-opt:hover { border-color: color-mix(in srgb, var(--apf-accent) 45%, transparent); transform: translateX(2px); }
.apf-opt.on { border-color: var(--apf-accent); background: color-mix(in srgb, var(--apf-accent) 11%, transparent); }
.apf-box { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--apf-line);
  display: grid; place-items: center; transition: border-color .16s, background .16s; }
.apf-box.round { border-radius: 50%; }
.apf-opt.on .apf-box { border-color: var(--apf-accent); background: var(--apf-accent); }
.apf-box svg { opacity: 0; transform: scale(.4); transition: opacity .16s, transform .2s var(--ease-spring); color: #fff; }
.apf-opt.on .apf-box svg { opacity: 1; transform: none; }

.apf-file { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 16px;
  border: 1.5px dashed var(--apf-line); border-radius: calc(var(--apf-radius) * .55); cursor: pointer;
  transition: border-color .18s, background .18s; }
.apf-file:hover { border-color: var(--apf-accent); background: color-mix(in srgb, var(--apf-accent) 6%, transparent); }

/* submit — style variants */
.apf-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; padding: 0 30px; border-radius: calc(var(--apf-radius) * .55); cursor: pointer;
  font-family: var(--apf-font); font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  background: var(--apf-accent); color: #fff; border: 1px solid transparent;
  transition: transform .18s var(--ease-out), box-shadow .25s var(--ease), filter .2s, background .2s; }
.apf-btn:hover { transform: translateY(-2px); filter: brightness(1.08);
  box-shadow: 0 16px 36px -12px color-mix(in srgb, var(--apf-accent) 70%, transparent); }
.apf-btn:active { transform: translateY(0) scale(.98); }
.apf-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.apf-btn.pill { border-radius: 999px; }
.apf-btn.outline { background: transparent; color: var(--apf-accent); border-color: var(--apf-accent); }
.apf-btn.outline:hover { background: color-mix(in srgb, var(--apf-accent) 12%, transparent); }
.apf-btn.glow { box-shadow: 0 0 26px -4px color-mix(in srgb, var(--apf-accent) 75%, transparent); }
.apf-btn.glow:hover { box-shadow: 0 0 44px -2px var(--apf-accent); }
.apf-btn::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 55%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.26), transparent);
  transform: translateX(-200%) skewX(-14deg); transition: transform .65s var(--ease-out); }
.apf-btn:hover::before { transform: translateX(360%) skewX(-14deg); }

/* success */
.apf-done { text-align: center; padding: 54px 28px; }
.apf-tick { width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--apf-accent) 16%, transparent); color: var(--apf-accent);
  animation: apfPop .5s var(--ease-spring) both; }
@keyframes apfPop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.apf-tick svg { stroke-dasharray: 40; stroke-dashoffset: 40; animation: apfDraw .5s .22s var(--ease-out) forwards; }
@keyframes apfDraw { to { stroke-dashoffset: 0; } }

.apf-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; border: 1px solid var(--apf-line); background: var(--apf-field); color: var(--apf-text-2); }
.apf-pill.ok  { color: #34d399; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.12); }
.apf-pill.no  { color: #f87171; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.12); }
.apf-pill.pend{ color: #f5b13d; border-color: rgba(245,177,61,.35); background: rgba(245,177,61,.12); }

@media (max-width: 640px) {
  .apf { padding: 0 0 60px; }
  .apf-card { border-radius: 0; margin-bottom: 0; }
  .apf-head, .apf-body { padding-left: 18px; padding-right: 18px; }
  .apf-title { font-size: 24px; }
  .apf-btn { width: 100%; }
}

/* ═══════════════ FLOW FOCUS ═══════════════
   Scrolling the flow canvas up to the top of the screen pins it there, grows it to fill the
   viewport, and fades the form header + dashboard topbar out of the way. --fz (0→1) is written by
   forms.jsx on each scroll frame, so every step below tracks the scroll instead of snapping.
   Desktop only: on a phone the canvas already hands vertical scrolling back to the page, and
   pinning it would trap the user inside a canvas they can't scroll past. */
.fb-root { --fz: 0; --fzpre: 0; }
.dash-topbar { transition: opacity .3s ease, transform .3s ease; }

@media (min-width: 769px) {
  .fb-fade {
    opacity: calc(1 - var(--fz));
    transform: translateY(calc(var(--fz) * -10px));
    will-change: opacity, transform;
  }
  body.flow-zen .fb-fade { pointer-events: none; }
  body.flow-zen .dash-topbar { opacity: 0; transform: translateY(-100%); pointer-events: none; }

  /* The zone is the canvas plus a runway, so the pinned canvas has somewhere to stay stuck.
     --fzpre opens that runway on approach (see forms.jsx); --fz then grows the canvas itself. */
  .fb-flowzone { height: calc(620px + var(--fzpre) * 26vh + var(--fz) * (100vh - 620px)); }
  .fb-flowpin {
    position: sticky;
    top: calc(72px * (1 - var(--fz)));   /* rests under the topbar, rises as the topbar leaves */
    z-index: 5;
  }
  .fb-flowpin .ff-wrap {
    height: calc(620px + var(--fz) * (100vh - 620px - 28px));
    box-shadow: 0 calc(var(--fz) * 40px) calc(var(--fz) * 90px) rgba(0, 0, 0, calc(var(--fz) * 0.5));
    border-color: rgba(139, 92, 246, calc(0.1 + var(--fz) * 0.28));
  }
  /* Only reachable once the toggle above has scrolled away — so it appears with the focus. */
  .fb-zenout {
    position: absolute; top: 14px; right: 14px; z-index: 6;
    display: flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; color: var(--text-2);
    background: rgba(20, 20, 28, 0.8); backdrop-filter: blur(10px);
    border: 1px solid var(--border-2);
    opacity: var(--fz); pointer-events: none;
    transition: color .15s, border-color .15s;
  }
  body.flow-zen .fb-zenout { pointer-events: auto; }
  .fb-zenout:hover { color: var(--text); border-color: var(--accent); }
}
@media (max-width: 768px) { .fb-zenout { display: none; } }

/* ═══════════════ FORM FLOW CANVAS — nodes + animated connector lines ═══════════════ */
.ff-wrap {
  position: relative; height: 620px; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); background: #0a0a0e;
  /* the dot grid */
  background-image: radial-gradient(circle, rgba(255,255,255,.075) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab; user-select: none; touch-action: none;
}
.ff-wrap.panning { cursor: grabbing; }
.ff-wrap::after { /* vignette so nodes read against the grid */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(0,0,0,.45));
}
.ff-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }

/* --- edges --- */
.ff-edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; z-index: 1; }
.ff-edge { fill: none; stroke-linecap: round; }
/* sequence: solid accent with a travelling dash on top (the "flowing" line) */
.ff-edge.seq { stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 2; }
.ff-edge.seq-flow {
  stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 12;
  animation: ffFlow 1.1s linear infinite;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}
@keyframes ffFlow { to { stroke-dashoffset: -18; } }
/* conditional (showIf): amber, marching dashes, curves out to the side */
.ff-edge.cond { stroke: #f5b13d; stroke-width: 1.8; stroke-dasharray: 5 6; opacity: .85;
  animation: ffFlow 1.4s linear infinite reverse; }
.ff-edge.dim { opacity: .18; }
.ff-edge.hot { stroke-width: 2.6; }

.ff-dot { fill: var(--accent); }
.ff-dot.cond { fill: #f5b13d; }
.ff-arrow { fill: var(--accent); }

/* --- nodes --- */
.ff-node {
  position: absolute; top: 0; left: 0; width: var(--ffw, 300px); z-index: 2;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.7);
  will-change: transform; cursor: grab;
  transition: border-color .16s, box-shadow .2s;
}
.ff-node:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.ff-node.sel { border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 16px 40px -16px var(--accent-glow); }
.ff-node.dragging {
  cursor: grabbing; z-index: 10;
  border-color: var(--accent);
  box-shadow: 0 34px 70px -20px rgba(0,0,0,.85), 0 0 0 1px var(--accent), 0 0 40px -8px var(--accent-glow);
}
.ff-node.ghost { opacity: .35; }

.ff-nhead { display: flex; align-items: center; gap: 8px; padding: 9px 11px;
  background: rgba(255,255,255,.035); border-bottom: 1px solid var(--border); }
.ff-nidx { width: 20px; height: 20px; border-radius: 6px; flex: none; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; font-family: var(--mono);
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-2); }
.ff-ntype { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.ff-nreq { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.ff-nbody { padding: 10px 12px 12px; }
.ff-nlabel { font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ff-nlabel.empty { color: var(--text-3); font-weight: 600; font-style: italic; }
.ff-nmeta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ff-chip { display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px; border-radius: 999px;
  font-size: 10px; font-weight: 700; background: var(--panel-3); color: var(--text-3); border: 1px solid var(--border); }
.ff-chip.cond { color: #f5b13d; border-color: rgba(245,177,61,.3); background: rgba(245,177,61,.1); }

/* connection ports */
.ff-port { position: absolute; left: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--accent); transform: translateX(-50%); z-index: 3; }
.ff-port.in  { top: -5px; }
.ff-port.out { bottom: -5px; }

/* insertion marker between nodes while dragging */
.ff-slot { position: absolute; left: 0; height: 3px; border-radius: 3px; z-index: 1;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 16px 2px var(--accent-glow);
  animation: ffSlot .2s var(--ease-out) both; }
@keyframes ffSlot { from { opacity: 0; transform: scaleX(.3); } to { opacity: 1; transform: none; } }

/* toolbar overlay */
.ff-bar { position: absolute; top: 12px; left: 12px; z-index: 20; display: flex; gap: 6px;
  padding: 5px; border-radius: 11px; background: rgba(16,16,22,.9); border: 1px solid var(--border-2);
  backdrop-filter: blur(10px); }
.ff-bar button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--text-3); transition: background .15s, color .15s; }
.ff-bar button:hover { background: var(--panel-3); color: var(--text); }
.ff-hint { position: absolute; bottom: 12px; left: 12px; z-index: 20; font-size: 11.5px; color: var(--text-3);
  background: rgba(16,16,22,.85); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  backdrop-filter: blur(8px); }
.ff-legend { position: absolute; bottom: 12px; right: 12px; z-index: 20; display: flex; gap: 12px;
  font-size: 11px; color: var(--text-3);
  background: rgba(16,16,22,.85); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  backdrop-filter: blur(8px); }
.ff-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ff-legend i { width: 14px; height: 2px; border-radius: 2px; display: block; }
.ff-legend i.s { background: var(--accent); }
.ff-legend i.c { background: #f5b13d; }
.ff-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 13.5px; z-index: 5; }

/* ═══════════════ custom dropdown (replaces the OS <select> popup) ═══════════════ */
.fs { position: relative; display: inline-block; }
.fs-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px;
  border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border-2);
  color: var(--text); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .18s;
}
.fs-btn:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--panel-3); }
.fs.open .fs-btn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.fs-btn .fs-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-btn .fs-val.ph { color: var(--text-3); font-weight: 500; }
.fs-caret { flex: none; color: var(--text-3); transition: transform .22s var(--ease-out); }
.fs.open .fs-caret { transform: rotate(180deg); color: var(--accent); }

.fs-pop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 100%;
  padding: 5px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border-2);
  box-shadow: 0 22px 50px -18px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03);
  max-height: 260px; overflow-y: auto; transform-origin: top center;
  animation: fsIn .16s var(--ease-out) both;
}
.fs-pop.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
@keyframes fsIn { from { opacity: 0; transform: translateY(-4px) scale(.97); } to { opacity: 1; transform: none; } }

.fs-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-2); text-align: left; cursor: pointer;
  transition: background .12s, color .12s, transform .12s var(--ease-out);
}
.fs-opt:hover, .fs-opt.cur { background: var(--panel-3); color: var(--text); }
.fs-opt.cur { transform: translateX(2px); }
.fs-opt.on { color: var(--text); }
.fs-opt.on .fs-tick { opacity: 1; transform: none; }
.fs-tick { margin-left: auto; flex: none; color: var(--accent); opacity: 0; transform: scale(.6);
  transition: opacity .14s, transform .18s var(--ease-spring); }
.fs-oico { flex: none; color: var(--text-3); }
.fs-opt.on .fs-oico, .fs-opt.cur .fs-oico { color: var(--accent-2); }
.fs-sub { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); margin-top: 1px; }

/* ---- small banner thumbnail (was a giant 16:6 slab) ---- */
.f-thumb {
  width: 190px; height: 72px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border);
  display: grid; place-items: center; position: relative;
}
.f-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-thumb span { font-size: 11px; color: var(--text-3); }

/* themed dropdown on the public form — inherits the form's accent / font / radius */
.apf-sel { position: relative; margin-top: 10px; }
.apf-selbtn {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; cursor: pointer;
  border-radius: calc(var(--apf-radius) * .55);
  background: var(--apf-field); border: 1px solid var(--apf-line); color: var(--apf-text);
  font-family: var(--apf-font); font-size: 14.5px; text-align: left;
  transition: border-color .18s, box-shadow .22s, background .18s;
}
.apf-selbtn:hover { border-color: color-mix(in srgb, var(--apf-accent) 45%, transparent); }
.apf-sel.open .apf-selbtn {
  border-color: var(--apf-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--apf-accent) 18%, transparent);
  background: color-mix(in srgb, var(--apf-accent) 5%, var(--apf-field));
}
.apf-selbtn.bad { border-color: #f87171; box-shadow: 0 0 0 4px rgba(248,113,113,.14); }
.apf-selbtn:disabled { opacity: .55; cursor: not-allowed; }
.apf-selval { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apf-selval.ph { color: var(--apf-text-3); }
.apf-selcaret { flex: none; color: var(--apf-text-3); transition: transform .22s var(--ease-out); }
.apf-sel.open .apf-selcaret { transform: rotate(180deg); color: var(--apf-accent); }

.apf-selpop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0;
  padding: 5px; border-radius: calc(var(--apf-radius) * .55);
  background: var(--apf-card); border: 1px solid var(--apf-line);
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 26px 60px -20px rgba(0,0,0,.75);
  max-height: 260px; overflow-y: auto; transform-origin: top center;
  animation: fsIn .16s var(--ease-out) both;
}
.apf-selpop.up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom center; }
.apf-selopt {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 11px;
  border-radius: calc(var(--apf-radius) * .4);
  font-family: var(--apf-font); font-size: 14px; color: var(--apf-text-2);
  text-align: left; cursor: pointer; transition: background .12s, color .12s, transform .12s var(--ease-out);
}
.apf-selopt:hover, .apf-selopt.cur { background: color-mix(in srgb, var(--apf-accent) 12%, transparent); color: var(--apf-text); transform: translateX(2px); }
.apf-selopt.on { color: var(--apf-text); }
.apf-seltick { margin-left: auto; flex: none; color: var(--apf-accent); opacity: 0; transform: scale(.6);
  transition: opacity .14s, transform .18s var(--ease-spring); }
.apf-selopt.on .apf-seltick { opacity: 1; transform: none; }

/* ---- response review drawer ---- */
.fr-drawer { width: min(580px, 100vw); }
.fr-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); flex: none; }
.fr-name { font-size: 16px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; flex: none;
  background: var(--border); border-bottom: 1px solid var(--border); }
.fr-stat { background: var(--panel-2); padding: 11px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fr-k { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.fr-v { font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fr-body { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.fr-q { padding: 12px 14px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 10px;
  transition: border-color .16s; }
.fr-q:hover { border-color: var(--border-2); }
.fr-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.fr-qn { width: 18px; height: 18px; border-radius: 5px; flex: none; display: grid; place-items: center;
  font-size: 10px; font-weight: 800; font-family: var(--mono);
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-2); }
.fr-qlabel { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-req { color: var(--accent); font-weight: 800; }
.fr-a { font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.fr-a.none { color: var(--text-3); font-style: italic; font-size: 12.5px; }
.fr-file { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-2); font-weight: 600; }
.fr-file:hover { text-decoration: underline; }

.fr-foot { display: flex; align-items: center; gap: 8px; padding: 14px 16px; flex: none;
  border-top: 1px solid var(--border); background: var(--panel-2); }

@media (max-width: 560px) { .fr-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- image drop zone (banner / logo / background) ---- */
.fdz {
  position: relative; overflow: hidden; cursor: pointer; outline: none;
  min-height: 96px; border-radius: 13px;
  background: var(--panel-2); border: 1.5px dashed var(--border-2);
  display: grid; place-items: center;
  transition: border-color .18s var(--ease), background .18s var(--ease), transform .16s var(--ease-out), box-shadow .2s;
}
.fdz:hover, .fdz:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--panel-3); }
.fdz.over {
  border-color: var(--accent); border-style: solid;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel-2));
  transform: scale(1.005);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), 0 18px 44px -20px var(--accent-glow);
}
.fdz.busy { cursor: progress; }
.fdz-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* the label plate — always legible, scrim only when an image sits behind it */
.fdz-face { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 18px; text-align: center; transition: opacity .18s; }
.fdz.has .fdz-face { opacity: 0; border-radius: 12px; padding: 16px 22px;
  background: rgba(10,10,14,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fdz.has:hover .fdz-face, .fdz.has.over .fdz-face, .fdz.has.busy .fdz-face { opacity: 1; }
.fdz-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2);
  transition: transform .2s var(--ease-spring); }
.fdz.over .fdz-ico { transform: translateY(-2px) scale(1.1); }
.fdz-t { font-size: 13px; font-weight: 700; color: var(--text); }
.fdz-s { font-size: 11.5px; color: var(--text-3); }
.fdz-x { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: #fff; background: rgba(10,10,14,.72);
  border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .16s, background .16s; }
.fdz:hover .fdz-x { opacity: 1; }
.fdz-x:hover { background: var(--red); }
.fdz-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-2);
  border-top-color: var(--accent); animation: fdzSpin .7s linear infinite; }
@keyframes fdzSpin { to { transform: rotate(360deg); } }

/* ---- "name your form" row: it appears far from the button that revealed it, so pull the eye over ---- */
.f-namerow { animation: fNameIn .32s var(--ease-spring) both; }
@keyframes fNameIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
/* a couple of attention pulses, then it settles into a normal focused field */
.f-hl { border-color: var(--accent) !important; animation: fHl 1.5s var(--ease-out) 2; }
@keyframes fHl {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  55%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
.f-hl:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent) !important; }

/* banner row: a compact tile beside its field, instead of a full-width slab */
.f-bannerrow { display: flex; gap: 18px; align-items: flex-start; margin-top: 18px;
  padding-top: 18px; border-top: 1px solid var(--border); }
.f-bannerrow .fdz { flex: none; }
@media (max-width: 720px) { .f-bannerrow { flex-direction: column; } .f-bannerrow .fdz { width: 100% !important; } }
/* the drop zone is always an explicit size now — never let it inherit a runaway width */
.fdz { max-width: 100%; }

/* Centred modal entrance. A modal that centres itself with `transform: translate(-50%,-50%)`
   CANNOT use .anim-scalein: that animation also drives `transform`, and an animation beats an
   inline style in the cascade — so its `to { transform: scale(1) }` wiped the centring translate
   and the modal drifted to the bottom-right by half its own size. The translate has to live
   INSIDE the keyframes. */
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.anim-modal { animation: modalIn .4s cubic-bezier(.2,.7,.2,1) both; }

/* a card can carry several role facets at once (staff + CAD + civilian) */
.sh-roles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.sh-roles .sh-role { margin-top: 0; }
.sh-role.staff { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.sh-role.civ { background: rgba(148,163,184,.12); color: #94a3b8; border-color: rgba(148,163,184,.28); }
.sh-role.own { background: rgba(245,177,61,.14); color: #f5b13d; border-color: rgba(245,177,61,.32); }

/* ==================================================================
   MOBILE — Applications workspace, flow canvas, drop-zones, dropdowns
   Extends the canonical system above (768 = primary stack point).
   Desktop (>768px) appearance is never changed.
   ================================================================== */

/* ---- SYSTEMIC: an <input> refuses to shrink below its intrinsic size ----
   .input input is flex:1 with flex-basis 0, but min-width stays `auto`, so its
   min-content width is ~197px. That single default is what made half the rows in
   the app overflow on a phone. */
@media (max-width: 768px) {
  .input input, .input textarea { min-width: 0; }
  .cad-input input { min-width: 0; }
}

/* ---- Tabs: scroll instead of overflowing (Build/Design/Settings/Responses ≈327px) ---- */
@media (max-width: 768px) {
  .ui-tabs {
    overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    justify-content: flex-start;
  }
  .ui-tabs::-webkit-scrollbar { display: none; }
}

/* ---- form builder: question cards ---- */
@media (max-width: 768px) {
  /* the drag handle is hover-revealed on desktop — there is no hover on touch, so the ONLY way to
     reorder was invisible. Pin it open and give it a real 40px target. */
  .fq-handle {
    opacity: 1 !important; transform: none !important;
    width: 34px; height: 40px; left: 3px; top: 10px;
  }
  .fq-card { padding: 14px 12px 14px 44px; }

  .fq-head { flex-wrap: wrap; row-gap: 10px; }
  .fq-head > .row { min-width: 0; }
  .fq-head .fs { width: 100% !important; }          /* the type dropdown gets its own line */

  .fq-optrow { flex-wrap: wrap; row-gap: 8px; }
  .fq-optrow .input { flex: 1 1 100%; }
}
@media (max-width: 480px) {
  .fq-scorelbl { display: none; }                    /* the field is self-evident; the word isn't */
}

/* ---- settings rows: label and control stack instead of squeezing the label to ~96px ---- */
@media (max-width: 640px) {
  .f-row { flex-wrap: wrap; row-gap: 10px; }
  .f-row > * { flex: 1 1 100% !important; min-width: 0; }
  .f-row input[type="datetime-local"], .f-row input[type="date"] { width: 100% !important; }
}

/* ---- custom dropdown popup must never render off-screen ---- */
@media (max-width: 768px) {
  .fs-pop { max-width: calc(100vw - 24px); }
  .fs-opt { padding: 11px 10px; }                    /* touch target */
  .apf-selopt { padding: 13px 12px; }
}

/* ---- image drop-zone: the remove/replace affordances were hover-only ---- */
@media (hover: none) {
  .fdz-x { opacity: 1; }                             /* ✕ was invisible on touch — undiscoverable */
  .fdz.has .fdz-face { opacity: 0; }                 /* keep the image clean… */
  .fdz.has:active .fdz-face { opacity: 1; }          /* …but reveal "Replace" on press */
}
@media (max-width: 768px) {
  .fdz { width: 100% !important; }                   /* the fixed 280px tile goes fluid */
  .fdz-x { width: 36px; height: 36px; }
  .f-bannerrow { gap: 12px; }
}

/* ---- Design tab: the sticky preview becomes a nested scroll trap once stacked ---- */
@media (max-width: 768px) {
  .fm-preview { position: static; max-height: none; }
  .fm-fonts { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .fm-seg { flex-wrap: wrap; }
}

/* ---- flow canvas ----
   .ff-wrap had `touch-action: none` + a fixed 620px height: a swipe anywhere on it panned the
   canvas instead of scrolling the PAGE, so everything below it (including Save) was unreachable.
   pan-y hands vertical scrolling back to the browser; the node itself keeps touch-action:none so
   dragging a card still works. */
@media (max-width: 768px) {
  .ff-wrap { height: 58vh; min-height: 320px; touch-action: pan-y; }
  .ff-node { touch-action: none; }
  .ff-bar button { width: 40px; height: 40px; }
  .ff-hint { display: none; }                        /* it said "scroll to zoom" — untrue on touch */
  .ff-legend { font-size: 10.5px; padding: 5px 8px; }
}
/* node width is published by the JS as --ffw so the two can't drift apart */
.ff-node { width: var(--ffw, 300px); }

/* ---- response review drawer ---- */
@media (max-width: 768px) {
  .fr-head { padding: 14px 16px; }
  .fr-body { padding: 14px 16px 20px; }
  .fr-foot { padding: 12px 14px; flex-wrap: wrap; }
  .fr-foot .btn { flex: 1; }
}

/* ---- CAD: .cad-editrow > * { flex: 1 } cancelled the children's explicit widths, so a 6-item
   rank row gave every control an equal ~55px share — name and role both unreadable. ---- */
.cad-editrow > .iconbtn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .cad-editrow > input, .cad-editrow > label, .cad-editrow > .cad-input { flex: 1 1 100%; }
}

/* ---- public application page (applicants are overwhelmingly on phones) ---- */
.apf { min-height: 100dvh; }                          /* avoid the iOS address-bar jump */
@media (max-width: 640px) {
  .apf-hero { max-height: 34vh; }                     /* bannerHeight can be set up to 420px */
}
@media (hover: none) {
  .apf-opt:hover { transform: none; }                 /* the hover transform sticks after a tap on iOS */
  .fq-card:hover .fq-handle { opacity: 1; }
}

/* ---- misc rows that overflow ---- */
@media (max-width: 640px) {
  .f-namerow { flex-wrap: wrap; row-gap: 8px; }
  .f-namerow .btn { flex: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMBED BUILDER — the composer, the Discord-faithful preview, and the SDK scope
   ═══════════════════════════════════════════════════════════════════════════ */
/* A dotted canvas with a soft purple glow behind the whole builder — same energy as the flow
   canvas. The two glow layers are viewport-anchored (background-attachment: fixed) so they sit
   behind the top of the tab and don't scroll away; the dot grid rides with the content. min-height
   keeps the canvas visible even for a short message. The background is on .emb-root itself (not a
   pseudo) so no ancestor's solid background can paint over it. */
.emb-root {
  display: flex; flex-direction: column; gap: 16px; position: relative;
  min-height: calc(100vh - 220px);
  margin: -8px; padding: 8px;   /* let the canvas bleed to the edges of the view area */
  background-image:
    radial-gradient(50% 46% at 72% -2%, rgba(139, 92, 246, 0.28), transparent 62%),
    radial-gradient(38% 40% at 4% 4%, rgba(167, 139, 250, 0.16), transparent 60%),
    radial-gradient(circle, rgba(150, 120, 255, 0.16) 1.4px, transparent 1.4px);
  background-attachment: fixed, fixed, local;
  background-size: 100% 100%, 100% 100%, 24px 24px;
  background-repeat: no-repeat, no-repeat, repeat;
}
.emb-top { gap: 12px; }
.emb-name { flex: 1; min-width: 220px; max-width: 420px; }
.emb-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.emb-left { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.emb-right { min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }

.emb-editor { display: flex; flex-direction: column; gap: 14px; }
.emb-sec { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.emb-sec-head { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.emb-field { display: flex; flex-direction: column; gap: 6px; }
.emb-label { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.emb-input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; color: var(--text); font: inherit; font-size: 13.5px; line-height: 1.5;
  resize: vertical; outline: none; transition: border-color .15s;
}
.emb-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.emb-colorin { width: 42px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: none; cursor: pointer; }
.emb-inline { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.emb-fields { display: flex; flex-direction: column; gap: 10px; }
.emb-fieldrow { background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* the character budgets — Discord rejects the whole message if any are broken, so this is loud */
.emb-count { font-size: 11px; font-weight: 700; color: var(--text-3); font-family: var(--mono); }
.emb-count.near { color: var(--amber); }
.emb-count.over { color: var(--red); }

.emb-via { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 11px; }
.emb-viabtn {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--text-3); transition: all .18s var(--ease);
}
.emb-viabtn:hover { color: var(--text-2); }
.emb-viabtn.on { background: var(--accent-soft); color: var(--accent-2); box-shadow: 0 0 16px -6px var(--accent); }
.emb-send { padding: 16px; display: flex; flex-direction: column; }
.emb-errs { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--amber); }
.emb-result { margin-top: 10px; display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.emb-result.ok { color: var(--green); }
.emb-result.bad { color: var(--red); }

.emb-templates { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.emb-tpl { display: flex; align-items: center; gap: 6px; }
.emb-tpl-main {
  flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0;
  padding: 9px 11px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--border);
  transition: all .15s var(--ease);
}
.emb-tpl-main:hover { border-color: var(--border-2); transform: translateX(2px); }
.emb-tpl.on .emb-tpl-main { border-color: var(--accent); background: var(--accent-soft); }
.emb-tpl-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the preview ----------
   Discord's real values, so what people see is what actually gets posted. The colour bar is a left
   border — that is how Discord builds it, and it stays aligned when the content reflows. */
.embp { background: #313338; border-radius: 10px; padding: 14px; overflow-x: auto; }
.embp-msg { display: flex; gap: 12px; font-family: 'gg sans', 'Noto Sans', Helvetica, Arial, sans-serif; }
.embp-avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.embp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.embp-author { font-size: 15px; font-weight: 600; color: #f2f3f5; }
.embp-bot { font-size: 10px; font-weight: 600; color: #fff; background: #5865f2; border-radius: 3px; padding: 1px 4px; }
.embp-time { font-size: 12px; color: #949ba4; }
.embp-content { font-size: 15px; color: #dbdee1; line-height: 1.375; margin-bottom: 6px; }

.embp-embed {
  max-width: 432px; background: #2b2d31; border-left: 4px solid #4f545c; border-radius: 4px;
  padding: 8px 16px 16px 12px; margin-top: 2px;
}
.embp-embed-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px; }
.embp-arow { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.embp-aicon { width: 24px; height: 24px; border-radius: 50%; }
.embp-aname { font-size: 14px; font-weight: 600; color: #f2f3f5; }
.embp-title { font-size: 16px; font-weight: 600; color: #f2f3f5; margin-top: 8px; }
.embp-title.link { color: #00a8fc; }
.embp-desc { font-size: 14px; color: #dbdee1; line-height: 1.375; margin-top: 8px; }
.embp-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; margin-top: 8px; }
.embp-image { display: block; width: 100%; border-radius: 4px; margin-top: 16px; }
.embp-fields { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; margin-top: 8px; }
.embp-field { min-width: 0; }
.embp-fname { font-size: 14px; font-weight: 600; color: #f2f3f5; margin-bottom: 2px; }
.embp-fval { font-size: 14px; color: #dbdee1; line-height: 1.375; }
.embp-footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: #949ba4; }
.embp-ficon { width: 20px; height: 20px; border-radius: 50%; }
.embp-dot { padding: 0 2px; }
.embp-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 432px; }
.embp-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 3px;
  background: #4e5058; color: #fff; font-size: 14px; font-weight: 500; text-decoration: none;
}
.embp-btn:hover { background: #6d6f78; }

.emb-md { white-space: pre-wrap; word-break: break-word; }
.emb-md h1 { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.emb-md h2 { font-size: 17px; font-weight: 700; margin: 6px 0 2px; }
.emb-md h3 { font-size: 15px; font-weight: 700; margin: 6px 0 2px; }
.emb-md code { background: #1e1f22; border-radius: 3px; padding: 1px 3px; font-family: var(--mono); font-size: 12.5px; }
.emb-md pre { background: #1e1f22; border: 1px solid #2b2d31; border-radius: 4px; padding: 8px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; }
.emb-md blockquote { border-left: 4px solid #4f545c; padding-left: 8px; margin: 2px 0; }
.emb-md a { color: #00a8fc; text-decoration: none; }
.emb-md a:hover { text-decoration: underline; }

/* ---------- the vendored SDK's scope ----------
   Its CSS-module class names are hashed, so none of ITS styling can leak into Acronix. The leak runs
   the other way: our global element selectors (button, input, textarea) land inside the SDK's DOM
   and wreck a layout that was written against browser defaults. Neutralise them here, once. */
/* The SDK sizes everything in rem against a ~10px root; our document root is 16px, so it renders
   oversized. zoom shrinks the whole editor uniformly AND reflows (unlike transform: scale), and it
   scales the absolutely-positioned menus with it so nothing drifts. */
.emb-sdk-scope { color-scheme: dark; zoom: 0.82; }
.emb-sdk-scope button, .emb-sdk-scope input, .emb-sdk-scope textarea, .emb-sdk-scope select {
  font: inherit; color: inherit;
}
.emb-sdk-scope .emb-input { background: #1e1f22; border-color: #3f4147; }
.emb-emoji {
  padding: 10px; width: 250px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(139, 92, 246, 0.1);
  animation: embMenuPop .16s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes embMenuPop { from { opacity: 0; transform: translateY(-6px) scale(.96); } to { opacity: 1; transform: none; } }
.emb-emoji-q {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; color: var(--text); font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.emb-emoji-q:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.emb-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-top: 10px; }
.emb-emoji-grid button {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 18px; line-height: 1;
  border-radius: 8px; transition: background .12s, transform .12s cubic-bezier(.2, 1.4, .5, 1);
}
.emb-emoji-grid button:hover { background: var(--accent-soft); transform: scale(1.18); }
.emb-emoji-use {
  margin-top: 10px; width: 100%; height: 32px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, 0.25);
  transition: background .14s;
}
.emb-emoji-use:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.emb-emoji-img { width: 20px; height: 20px; vertical-align: -4px; }
.emb-emoji-native { font-size: 16px; }
.emb-color {
  padding: 12px; width: 236px; display: flex; flex-direction: column; gap: 12px;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(139, 92, 246, 0.1);
  animation: embMenuPop .17s cubic-bezier(.2, .9, .3, 1) both;
}
.emb-color-row { display: flex; align-items: center; gap: 8px; }
.emb-color-row:first-child { display: grid; grid-template-columns: repeat(8, 1fr); gap: 7px; }
.emb-swatch {
  width: 100%; aspect-ratio: 1; border-radius: 7px; border: 2px solid transparent; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: transform .14s cubic-bezier(.2, 1.5, .5, 1), box-shadow .14s;
}
.emb-swatch:hover { transform: scale(1.16); }
.emb-swatch.on { transform: scale(1.08); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-2); }
.emb-swatch.on::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .5); animation: embDot .2s cubic-bezier(.2, 1.6, .5, 1) both;
}
@keyframes embDot { from { transform: scale(0); } to { transform: scale(1); } }

/* the native colour square — styled to match the fields around it */
.emb-color input[type="color"] {
  width: 38px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 9px;
  background: none; cursor: pointer; flex: none; transition: border-color .14s, transform .12s;
}
.emb-color input[type="color"]:hover { border-color: var(--accent); transform: translateY(-1px); }
.emb-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.emb-color input[type="color"]::-webkit-color-swatch { border: none; border-radius: 6px; }

.emb-hex { flex: 1; font-family: var(--mono); font-size: 12.5px; height: 34px; }
.emb-clear {
  flex: none; height: 34px; padding: 0 12px; border-radius: 9px; font-size: 12px; font-weight: 600;
  color: var(--text-3); background: var(--panel-2); border: 1px solid var(--border);
  transition: color .14s, border-color .14s, background .14s;
}
.emb-clear:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.emb-actionmenu { padding: 10px; width: 240px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.emb-actionmenu button { margin-top: 8px; font-size: 12.5px; color: var(--accent-2); }

@media (max-width: 1100px) {
  .emb-grid { grid-template-columns: 1fr; }
  .emb-right { position: static; }
}

/* embed send panel: sync button + the not-set-up notice */
.emb-syncbtn { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 700; color: var(--text-3); background: var(--panel-2); border: 1px solid var(--border); transition: color .14s, border-color .14s; }
.emb-syncbtn:hover { color: var(--accent-2); border-color: var(--accent); }
.emb-syncbtn:disabled { opacity: .6; }
.emb-notice { display: flex; gap: 9px; align-items: flex-start; margin-top: 8px; padding: 11px 12px; border-radius: 10px; background: var(--amber-soft); border: 1px solid rgba(251,191,36,0.25); font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.emb-notice svg { color: var(--amber); flex: none; margin-top: 1px; }

/* embed builder — add-block editor (the friendlier classic mode) */
.emb-titlerow { display: flex; align-items: center; gap: 8px; }
.emb-colorwrap { flex: none; display: block; }
.emb-colorin { width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: none; cursor: pointer; transition: border-color .14s, transform .12s; display: block; }
.emb-colorin:hover { border-color: var(--accent); transform: translateY(-1px); }
.emb-colorin::-webkit-color-swatch-wrapper { padding: 3px; }
.emb-colorin::-webkit-color-swatch { border: none; border-radius: 7px; }

.emb-block {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  animation: embBlockIn .22s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes embBlockIn { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.emb-block-head { display: flex; align-items: center; gap: 9px; }
.emb-block-ico { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent-2); }
.emb-block-name { font-size: 13px; font-weight: 700; flex: 1; }
.emb-block-x { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; color: var(--text-3); transition: color .14s, background .14s; }
.emb-block-x:hover { color: var(--red); background: var(--red-soft); }
.emb-block-hint { font-size: 11.5px; color: var(--text-3); margin: 6px 0 0; line-height: 1.5; }
.emb-block-body { margin-top: 11px; display: flex; flex-direction: column; gap: 8px; }

.emb-fmove { display: flex; flex-direction: column; gap: 2px; flex: none; }
.emb-fmove-b { width: 22px; height: 18px; display: grid; place-items: center; border-radius: 5px; color: var(--text-3); background: var(--panel-2); border: 1px solid var(--border); transition: color .12s, border-color .12s; }
.emb-fmove-b:hover:not(:disabled) { color: var(--accent-2); border-color: var(--accent); }
.emb-fmove-b:disabled { opacity: .35; }
.emb-addrow { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--accent-2); background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, .22); transition: background .14s, transform .12s; }
.emb-addrow:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.emb-addrow:active { transform: scale(.98); }

.emb-palette { background: var(--panel-2); border: 1px dashed var(--border-2); border-radius: 14px; padding: 12px 14px; }
.emb-palette-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.emb-palette-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.emb-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 10px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--panel); border: 1px solid var(--border);
  transition: color .14s, border-color .14s, transform .12s, box-shadow .14s;
}
.emb-chip svg { color: var(--text-3); transition: color .14s; }
.emb-chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px -8px var(--accent); }
.emb-chip:hover svg { color: var(--accent-2); }
.emb-chip:active { transform: translateY(0); }

/* ===== Form sections — a non-input heading that groups the questions under it ===== */
/* Public apply page + Design-tab preview (scoped to .apf, uses --apf-* vars) */
.apf-section { animation: apfQ .45s var(--ease-out) both; animation-delay: var(--d, 0ms); margin-top: 6px; padding-top: 20px; border-top: 1px solid var(--apf-line); }
.apf-body > .apf-section:first-child { border-top: none; padding-top: 2px; margin-top: 0; }
.apf-section-title { font-family: var(--apf-hfont); font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--apf-text); }
.apf-section-desc { color: var(--apf-text-2); font-size: 14px; line-height: 1.6; margin-top: 6px; white-space: pre-wrap; }
/* Builder card variant (dashboard scope, --accent available) */
.fq-section-card { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.fq-section-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
/* Staff response drawer */
.fr-section { margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.fr-body > .fr-section:first-child { margin-top: 0; }
.fr-section-title { font-size: 14px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.fr-section-desc { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }

/* ===== Apply page: sticky top bar ("always on top") + section pagination ===== */
/* Opaque, NOT blurred: a fixed backdrop-blur re-renders every scroll frame (stutter) and lets the
   scrolling content bleed through. A solid bar hides the content cleanly and scrolls for free. */
.apf-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 40; transform: translateY(-102%); opacity: 0; pointer-events: none;
  transition: transform .42s var(--ease-spring), opacity .3s var(--ease-out);
  background: var(--apf-bg);
  border-bottom: 1px solid var(--apf-line); box-shadow: 0 10px 30px -18px rgba(0,0,0,.7); }
.apf-topbar.on, .apf-topbar.always { transform: translateY(0); opacity: 1; pointer-events: auto; }
.apf-topbar-in { max-width: 720px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 14px; }
.apf-topbar-title { flex: 1; min-width: 0; font-family: var(--apf-hfont); font-weight: 800; font-size: 15px; letter-spacing: -.01em;
  color: var(--apf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apf.center .apf-topbar-in { justify-content: center; }
.apf.center .apf-topbar-title { flex: none; }
.apf-topbar-step { flex: none; font-size: 12px; font-weight: 700; color: var(--apf-text-2); font-variant-numeric: tabular-nums; }
.apf-topbar-prog { height: 3px; background: color-mix(in srgb, var(--apf-text-3) 20%, transparent); }
.apf-topbar-prog > span { display: block; height: 100%; background: var(--apf-accent); transform-origin: left center;
  transition: transform .55s var(--ease-spring); border-radius: 0 3px 3px 0; }

/* page swap: the container fades, and its remounted questions re-run their own stagger */
.apf-page.anim { animation: apfPageFade .32s var(--ease-out) both; }
@keyframes apfPageFade { from { opacity: 0; } to { opacity: 1; } }

.apf-pagenav { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--apf-line); }
.apf-pagenav-l, .apf-pagenav-r { flex: 1; display: flex; min-width: 0; }
.apf-pagenav-r { justify-content: flex-end; }
.apf-pageind { flex: none; font-size: 12.5px; font-weight: 700; color: var(--apf-text-3); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
@media (max-width: 560px) { .apf-topbar-in { padding: 11px 18px; } }

/* ===== Applications: folders + breadcrumb (organise forms) ===== */
.f-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: -4px; }
.f-crumb { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: transparent; border: 1px solid transparent; transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease); }
.f-crumb:hover { background: var(--panel-2); color: var(--text); }
.f-crumb.on { color: var(--text); }
.f-crumb-sep { color: var(--text-3); flex: none; }
.f-crumbs.live .f-crumb { border-color: color-mix(in srgb, var(--accent) 32%, transparent); border-style: dashed; }

.f-folder { padding: 14px !important; display: flex; align-items: center; gap: 10px; transition: border-color .18s var(--ease), background .18s var(--ease), transform .18s var(--ease-out), box-shadow .2s var(--ease); }
.f-folder:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: 0 8px 26px -14px rgba(0,0,0,.55); }
.f-folder.f-drop { border-color: var(--accent); border-style: dashed; background: var(--accent-soft); transform: scale(1.02); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.f-folder-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: none; text-align: left; padding: 0; cursor: pointer; }
.f-folder-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); transition: transform .18s var(--ease-spring); }
.f-folder:hover .f-folder-ico { transform: scale(1.06) rotate(-3deg); }
.f-folder-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.f-folder-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.f-folder-meta { font-size: 11.5px; color: var(--text-3); }
.f-folder-in { font: inherit; font-size: 14px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 7px; padding: 4px 8px; color: var(--text); width: 100%; max-width: 190px; outline: none; }
.f-folder-acts { display: flex; gap: 4px; flex: none; opacity: 0; transition: opacity .16s var(--ease); }
.f-folder:hover .f-folder-acts, .f-folder:focus-within .f-folder-acts { opacity: 1; }
.f-formcard { cursor: grab; }
.f-formcard:active { cursor: grabbing; }
.f-emptyfolder { animation: fadeUp .4s var(--ease-out) both; }
@media (max-width: 640px) { .f-folder-acts { opacity: 1; } }

/* ===== Documents: a document renders as a real sheet of paper =====
   Deliberately light in a dark grid so the item reads as a *document*. Signature: the peeled
   dog-ear corner that cuts through to the page behind and peels further on hover. */
.f-paper {
  position: relative; cursor: grab; overflow: visible;
  padding: 16px 20px 17px 30px;            /* left pad clears the red margin rule */
  border-radius: 3px;
  color: #26211a;
  background: linear-gradient(96deg, #FCFBF8, #F6F2E9 58%, #EFEADD);
  border: 1px solid #E5DED0;
  box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 16px 34px -20px rgba(0,0,0,.72);
  transition: transform .24s var(--ease-out), box-shadow .26s var(--ease), rotate .24s var(--ease-out);
}
.f-paper:active { cursor: grabbing; }
/* notebook ruling: faint horizontal rules + one red vertical margin */
.f-paper::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 22px, rgba(196,73,64,.38) 22px 23px, transparent 23px),
    repeating-linear-gradient(180deg, transparent 0 25px, rgba(58,74,120,.09) 25px 26px);
}
/* signature: peeled dog-ear — the corner cut reveals the dark page, a paper flap folds under it */
.f-paper-fold {
  position: absolute; top: 0; right: 0; width: 0; height: 0; z-index: 2;
  border-style: solid; border-width: 0 26px 26px 0;
  border-color: transparent var(--bg, #0a0a0e) transparent transparent;
  transition: border-width .24s var(--ease-out);
}
.f-paper-fold::after {
  content: ''; position: absolute; top: 0; right: -26px;
  border-style: solid; border-width: 26px 26px 0 0;
  border-color: #E2D9C6 transparent transparent transparent;
  filter: drop-shadow(-1.5px 1.5px 1px rgba(0,0,0,.3));
  transition: border-width .24s var(--ease-out);
}
.f-paper-open { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; background: none; padding: 2px 0; cursor: pointer; }
.f-paper-kicker { font: 700 9.5px/1 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .22em; text-transform: uppercase; color: #B23A32; }
.f-paper-title { font: 700 18.5px/1.24 'Newsreader', Georgia, serif; letter-spacing: -.005em; color: #221f1a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 20px; margin-top: 1px; }
.f-paper-meta { font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace; color: #9b917f; margin-top: 3px; }
.f-paper:hover { transform: translateY(-3px); rotate: -.5deg; box-shadow: 0 3px 4px rgba(0,0,0,.07), 0 28px 48px -20px rgba(0,0,0,.78); }
.f-paper:hover .f-paper-fold { border-width: 0 34px 34px 0; }
.f-paper:hover .f-paper-fold::after { border-width: 34px 34px 0 0; }
/* delete — an ink control on paper, tucked bottom-right, revealed on hover */
.f-doc-acts { position: absolute; right: 9px; bottom: 8px; z-index: 3; display: flex; gap: 4px; opacity: 0; transition: opacity .16s var(--ease); }
.f-paper:hover .f-doc-acts { opacity: 1; }
.f-paper .f-doc-acts .iconbtn { color: #9b917f; background: rgba(255,255,255,.55); border-color: transparent; }
.f-paper .f-doc-acts .iconbtn:hover { color: #B23A32; background: #fff; }

/* ===== Document editor ===== */
.doc-edit { display: flex; flex-direction: column; gap: 0; }
/* z-index: the theme picker's dropdown lives in this bar and must overlay the sticky toolbar (z:5)
   and the themed doc-sheet below — which became opaque with the per-theme canvas, so it was hiding
   the lower dropdown options (Mono/Zen). Lifting the bar into its own context floats the popup over both. */
.doc-topbar { position: relative; z-index: 30; display: flex; align-items: center; gap: 14px; padding-bottom: 14px; animation: docIn .4s var(--ease-out) both; }
@keyframes docIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes docSheetIn { from { opacity: 0; transform: translateY(16px) scale(.992); } to { opacity: 1; transform: none; } }
.doc-title-in { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 22px; font-weight: 800; letter-spacing: -.02em; padding: 4px 2px; }
.doc-title-in::placeholder { color: var(--text-3); }
.doc-status { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-3); transition: color .25s var(--ease); }
.doc-status .doc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); transition: background .25s var(--ease); }
.doc-status-saved .doc-dot { box-shadow: 0 0 7px -1px var(--cad-green, #34d399); }
.doc-coedit { animation: docIn .28s var(--ease-out) both; }
.doc-status-saved .doc-dot { background: var(--cad-green, #34d399); }
.doc-status-dirty .doc-dot { background: var(--cad-amber, #f5b544); }
.doc-status-error { color: var(--cad-red, #f87171); }
.doc-status-error .doc-dot { background: var(--cad-red, #f87171); }
.doc-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); animation: docSpin .7s linear infinite; }
.doc-spin.big { width: 26px; height: 26px; border-width: 3px; }
@keyframes docSpin { to { transform: rotate(360deg); } }

/* a centered floating toolbar, aligned to the page width, that blurs the page under it when scrolled */
.doc-toolbar { position: sticky; top: 8px; z-index: 5; align-self: center; width: 100%; max-width: 820px;
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 7px 9px;
  background: color-mix(in srgb, var(--panel) 86%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 12px 30px -18px rgba(0,0,0,.7);
  animation: docIn .45s var(--ease-out) .05s both; }
.doc-tbtn { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); background: none;
  transition: background .16s var(--ease), color .16s var(--ease), transform .18s var(--ease-spring); }
.doc-tbtn:hover { background: var(--panel-3); color: var(--text); transform: translateY(-1px); }
.doc-tbtn:active { transform: scale(.88); }
.doc-tbtn svg { transition: transform .18s var(--ease-spring); }
.doc-tbtn:hover svg { transform: scale(1.08); }
.doc-tsep { width: 1px; height: 20px; background: var(--border); margin: 0 5px; }

.doc-sheet { position: relative; margin-top: 18px; }
.doc-loading { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; }
.doc-body { min-height: 62vh; max-width: 820px; margin: 0 auto; padding: 46px 54px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; outline: none; color: var(--text); font-size: 15.5px; line-height: 1.75;
  box-shadow: 0 30px 70px -42px rgba(0,0,0,.72);
  transition: border-color .25s var(--ease), box-shadow .3s var(--ease-out);
  animation: docSheetIn .55s var(--ease-out) .08s both; }
.doc-body:empty:before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }
.doc-body:focus { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: 0 30px 72px -38px rgba(0,0,0,.78), 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent); }
.doc-body > :first-child { margin-top: 0; }
.doc-body h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; margin: 26px 0 10px; line-height: 1.2; }
.doc-body h2 { font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin: 22px 0 8px; line-height: 1.25; }
.doc-body h3 { font-size: 17.5px; font-weight: 700; margin: 18px 0 6px; }
.doc-body p { margin: 0 0 12px; }
.doc-body ul, .doc-body ol { margin: 0 0 12px; padding-left: 26px; }
.doc-body li { margin: 3px 0; }
.doc-body blockquote { margin: 0 0 14px; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); }
.doc-body pre { margin: 0 0 14px; padding: 14px 16px; background: var(--panel-3); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13.5px; line-height: 1.55; }
.doc-body code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .9em; background: var(--panel-3); padding: 1px 5px; border-radius: 5px; }
.doc-body pre code { background: none; padding: 0; }
.doc-body a { color: var(--accent-2, #a78bfa); text-decoration: underline; text-underline-offset: 2px; }
.doc-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
@media (max-width: 640px) { .doc-body { padding: 26px 20px; } .f-doc-acts { opacity: 1; } }

/* ===== Document RBAC: view-only, sharing panel, copy deterrent ===== */
.doc-viewonly { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); padding: 5px 10px; border-radius: 8px; background: var(--panel-3); }
.doc-guard .doc-body { user-select: none; -webkit-user-select: none; -moz-user-select: none; }
.doc-watermark { position: absolute; inset: -20% ; z-index: 3; pointer-events: none; overflow: hidden; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 54px 86px; transform: rotate(-24deg); opacity: .05; }
.doc-watermark span { font-size: 15px; font-weight: 800; letter-spacing: .12em; color: var(--text); white-space: nowrap; text-transform: uppercase; }
.doc-share { width: min(460px, calc(100vw - 32px)); padding: 20px; }
.doc-share-list { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; }
.doc-share-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--border); }
.doc-lvl { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.doc-lvl-view { color: var(--text-2); background: var(--panel-3); }
.doc-lvl-edit { color: var(--accent-2, #a78bfa); background: var(--accent-soft); }
.doc-share-protect { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ===== Document sharing: links section + standalone /d viewer ===== */
.doc-share-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.doc-share-h { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.doc-share-row.revoked { opacity: .5; }
.docview { min-height: 100vh; background: var(--bg, #0a0a0e); display: flex; flex-direction: column; }
.docview-mid { flex: 1; display: grid; place-items: center; }
.docview-card { max-width: 400px; margin: 13vh auto 0; text-align: center; padding: 34px 28px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.7); }
.docview-t { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-top: 12px; }
.docview-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: color-mix(in srgb, var(--bg, #0a0a0e) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.docview-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docview-toolbar { position: sticky; top: 12px; max-width: 820px; margin: 16px auto 0; width: calc(100% - 32px); }
.docview-sheet { padding: 0 16px 60px; }
.docview-sheet .doc-body { margin-top: 16px; }

/* ===== Real-time collaboration: presence avatars, co-edit badge, remote cursors ===== */
.collab-peers { display: inline-flex; align-items: center; flex: none; }
.collab-av { width: 26px; height: 26px; border-radius: 50%; margin-left: -7px; border: 2px solid var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; overflow: hidden; flex: none; }
.collab-av:first-child { margin-left: 0; }
.collab-av img { width: 100%; height: 100%; object-fit: cover; }
.collab-av.more { background: var(--panel-3) !important; color: var(--text-2); }
.collab-count { margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.doc-coedit { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--cad-amber, #f5b544); }
.collab-carets { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
.collab-caret { position: fixed; width: 2px; margin-left: -1px; border-radius: 1px; animation: collabBlink 1.1s step-end infinite; }
.collab-caret-lbl { position: absolute; top: -15px; left: -1px; font-size: 10px; font-weight: 700; color: #fff; padding: 1px 5px; border-radius: 4px; white-space: nowrap; line-height: 1.4; }
@keyframes collabBlink { 50% { opacity: .35; } }

/* ===== Smooth glide caret (custom cursor that eases to each position) ===== */
.doc-smoothcaret { caret-color: transparent; }
.doc-caret { position: fixed; top: 0; left: 0; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--accent, #8b5cf6); z-index: 4; pointer-events: none; will-change: transform; box-shadow: 0 0 7px -1px var(--accent, #8b5cf6); transition: transform .11s cubic-bezier(.22,.9,.28,1); animation: docCaretPulse 1.15s ease-in-out infinite; }
@keyframes docCaretPulse { 50% { opacity: .32; } }
@media (prefers-reduced-motion: reduce) { .doc-caret { transition: none; animation: none; } }

/* ============================================================================
   Document themes — glass (base/default) + paper / mono / zen skins.
   The theme class rides the editor root (.doc-edit / .docview); everything is
   scoped so autosave, collab, caret, sharing keep working across all of them.
   ========================================================================== */

/* ---------- PAPER: warm light page, serif ink, light toolbar ---------- */
.doc-theme-paper .doc-body { background: #FBFAF7; color: #221f1a; border: none; border-top: 3px solid #7c5cff; border-radius: 8px;
  padding: 66px 74px 88px; box-shadow: 0 50px 100px -34px rgba(0,0,0,.72); font-family: 'Newsreader', Georgia, serif; font-size: 18.5px; line-height: 1.78; }
.doc-theme-paper .doc-body:focus { border-top-color: #7c5cff; box-shadow: 0 50px 100px -30px rgba(0,0,0,.78), 0 0 0 4px rgba(124,92,255,.14); }
.doc-theme-paper .doc-body:empty:before { color: #9a948a; }
.doc-theme-paper .doc-body h1 { font: 700 34px/1.18 'Newsreader'; color: #221f1a; letter-spacing: -.01em; }
.doc-theme-paper .doc-body h2 { font: 700 23px/1.3 'Newsreader'; color: #221f1a; }
.doc-theme-paper .doc-body h3 { font: 700 19px 'Newsreader'; color: #221f1a; }
.doc-theme-paper .doc-body blockquote { border-left: 3px solid #7c5cff; color: #5a544a; font-style: italic; }
.doc-theme-paper .doc-body code { background: #efece4; color: #6a4bcf; }
.doc-theme-paper .doc-body pre { background: #f1eee6; border-color: #e4dfd4; color: #3a3730; }
.doc-theme-paper .doc-body a { color: #6a4bcf; }
.doc-theme-paper .doc-body hr { border-top-color: #e4dfd4; }
.doc-theme-paper .doc-caret { background: #7c5cff; box-shadow: 0 0 7px -1px #7c5cff; }
.doc-theme-paper .doc-toolbar { background: #fff; border-color: #ece7dd; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 14px 34px -14px rgba(0,0,0,.42); }
.doc-theme-paper .doc-tbtn { color: #45413a; }
.doc-theme-paper .doc-tbtn:hover { background: #efece5; color: #111; }
.doc-theme-paper .doc-tsep { background: #e2ddd2; }

/* ---------- MONO: monospace, cool slate, square, markdown headings ---------- */
.doc-theme-mono .doc-body { background: #10141a; color: #c4cdd9; border-color: #1c232c; border-radius: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14.5px; line-height: 1.75; padding: 38px 42px 46px; box-shadow: 0 30px 70px -42px rgba(0,0,0,.72); }
.doc-theme-mono .doc-body:focus { border-color: #2b6b57; box-shadow: 0 30px 72px -40px rgba(0,0,0,.78), 0 0 0 3px rgba(52,211,170,.14); }
.doc-theme-mono .doc-body:empty:before { color: #4a5665; }
.doc-theme-mono .doc-body h1 { font: 700 21px/1.5 'JetBrains Mono'; color: #eaf0f7; }
.doc-theme-mono .doc-body h1:before { content: '# '; color: #34d3aa; }
.doc-theme-mono .doc-body h2 { font: 700 16px/1.6 'JetBrains Mono'; color: #cfe0ff; }
.doc-theme-mono .doc-body h2:before { content: '## '; color: #34d3aa; }
.doc-theme-mono .doc-body h3 { font: 700 14.5px 'JetBrains Mono'; color: #cfe0ff; }
.doc-theme-mono .doc-body h3:before { content: '### '; color: #34d3aa; }
.doc-theme-mono .doc-body li::marker { color: #34d3aa; }
.doc-theme-mono .doc-body blockquote { border-left: 2px solid #34d3aa; color: #93a0ad; background: #0f1319; }
.doc-theme-mono .doc-body code, .doc-theme-mono .doc-body a { color: #34d3aa; }
.doc-theme-mono .doc-body pre { background: #0d1117; border-color: #1c232c; }
.doc-theme-mono .doc-caret { background: #34d3aa; box-shadow: 0 0 7px -1px #34d3aa; }
.doc-theme-mono .doc-toolbar { background: #0f1319; border-color: #1c232c; border-radius: 8px; -webkit-backdrop-filter: none; backdrop-filter: none; }
.doc-theme-mono .doc-tbtn { color: #8b97a4; font-family: 'JetBrains Mono'; }
.doc-theme-mono .doc-tbtn:hover { background: #1a212a; color: #dfe7ef; }
.doc-theme-mono .doc-tsep { background: #232a33; }
.doc-theme-mono .doc-title-in { font-family: 'JetBrains Mono'; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
/* mono status line under the page */
.doc-statusbar { max-width: 820px; margin: 10px auto 0; display: flex; gap: 18px; padding: 7px 4px; font: 500 11.5px 'JetBrains Mono'; color: #5c6773; letter-spacing: .02em; }
.doc-statusbar .a { color: #34d3aa; }
.doc-statusbar .r { margin-left: auto; }

/* ---------- ZEN: distraction-free, warm serif, full-bleed, ghost toolbar ---------- */
.doc-theme-zen .doc-sheet { margin-top: 6px; }
.doc-theme-zen .doc-body { background: transparent; border: none; box-shadow: none; padding: 24px 0 90px; max-width: 680px;
  font-family: 'Source Serif 4', Georgia, serif; font-size: 20px; line-height: 1.92; color: #e8e2d6; min-height: 66vh; }
.doc-theme-zen .doc-body:focus { box-shadow: none; }
.doc-theme-zen .doc-body:empty:before { color: #8a8172; }
.doc-theme-zen .doc-body h1 { font: 700 40px/1.2 'Source Serif 4'; color: #fbf6ec; letter-spacing: -.015em; }
.doc-theme-zen .doc-body h2 { font: 600 25px/1.35 'Source Serif 4'; color: #f2ecdf; }
.doc-theme-zen .doc-body h3 { font: 600 20px 'Source Serif 4'; color: #f2ecdf; }
.doc-theme-zen .doc-body li::marker { color: #d9a566; }
.doc-theme-zen .doc-body blockquote { border-left: 2px solid #d9a566; color: #c3b99f; font-style: italic; }
.doc-theme-zen .doc-body code, .doc-theme-zen .doc-body a { color: #e0b072; }
.doc-theme-zen .doc-caret { background: #d9a566; box-shadow: 0 0 7px -1px #d9a566; }
.doc-theme-zen .doc-toolbar { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.doc-theme-zen .doc-tbtn { color: #8a8172; }
.doc-theme-zen .doc-tbtn:hover { background: rgba(217,165,102,.15); color: #fbf6ec; }
.doc-theme-zen .doc-tsep { background: rgba(217,165,102,.22); }
.doc-theme-zen .doc-title-in { font-family: 'Source Serif 4'; }
/* zen reading-progress bar pinned to the top of the editor */
.doc-readbar { position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, #d9a566, #e7c08a); z-index: 30; border-radius: 0 2px 2px 0; transition: width .12s linear; }

/* ---------- /d share viewer: full-page background per theme ---------- */
.docview.doc-theme-paper { background: radial-gradient(1200px 600px at 50% -10%, #17161d, #0b0b0f 60%); }
.docview.doc-theme-mono { background: #0c0f13; }
.docview.doc-theme-zen { background: #17140f; }
.docview.doc-theme-glass { background: radial-gradient(900px 500px at 15% -5%, rgba(139,92,246,.16), transparent 60%), var(--bg, #0a0a0e); }

/* ---------- editor (.doc-edit): themed canvas behind the sheet ----------
   The /d viewer themes the WHOLE page, but the dashboard editor sits on the app's near-black bg.
   Without a themed backdrop the dark Mono sheet blends into the app and the transparent Zen sheet
   vanishes — the doc looks broken. Give the sheet its own themed canvas (mirrors the viewer bg). */
.doc-edit.doc-theme-mono  .doc-sheet { background: #0c0f13; border: 1px solid #1c232c; border-radius: 16px; padding: 24px 16px; }
.doc-edit.doc-theme-zen   .doc-sheet { background: #17140f; border: 1px solid #2a2418; border-radius: 16px; padding: 30px 16px; }
.doc-edit.doc-theme-paper .doc-sheet { background: radial-gradient(1000px 520px at 50% -10%, #17161d, #0b0b0f 62%); border-radius: 16px; padding: 26px 16px; }

/* ---------- theme picker control ---------- */
.doc-themepick { flex: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   PDF STUDIO — a new Applications item type. Its own cyan/ink accent (--ps-*)
   and a fanned-page card motif keep it visually distinct from both the app's
   violet chrome and the warm paper Document card (.f-paper above).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ----- PdfCard: a stack of pages, not a sheet of paper ----- */
.pdf-card, .pstudio-shell, .pdfview {
  --ps-accent: #22d3ee;
  --ps-accent-2: #67e8f9;
  --ps-accent-glow: rgba(34,211,238,.35);
  --ps-line: rgba(103,232,249,.14);
  --ps-tag: #d6473f;
}
.pdf-card {
  position: relative; cursor: pointer; overflow: visible;
  padding: 18px 18px 16px; border-radius: var(--radius);
  background: linear-gradient(165deg, #0d1a22, #0a141c 60%, #081019);
  border: 1px solid rgba(103,232,249,.16);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -24px rgba(0,0,0,.85);
  transition: transform .26s var(--ease-out), box-shadow .28s var(--ease), border-color .22s var(--ease);
}
.pdf-card:hover {
  transform: translateY(-3px);
  border-color: rgba(103,232,249,.36);
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 30px 56px -26px rgba(0,0,0,.9), 0 0 0 1px rgba(34,211,238,.14);
}
.pdf-card-open { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: none; padding: 2px 0; cursor: pointer; }
.pdf-card-open:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 3px; border-radius: 10px; }
.pdf-card-stack { position: relative; width: 44px; height: 54px; flex: none; }
.pdf-card-sheet { position: absolute; inset: 0; border-radius: 4px; border: 1px solid rgba(255,255,255,.08); transition: transform .26s var(--ease-spring); }
.pdf-card-sheet.s3 { background: #101c25; opacity: .5; transform: rotate(7deg) translate(3px, 1px); }
.pdf-card-sheet.s2 { background: #142230; opacity: .75; transform: rotate(-5deg) translate(-2px, 0); }
.pdf-card-sheet.s1 { display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px; background: linear-gradient(165deg, #1b2c37, #101c25); box-shadow: 0 8px 18px -8px rgba(0,0,0,.7); }
.pdf-card:hover .pdf-card-sheet.s1 { transform: translateY(-2px); }
.pdf-card:hover .pdf-card-sheet.s3 { transform: rotate(11deg) translate(5px, 2px); }
.pdf-card:hover .pdf-card-sheet.s2 { transform: rotate(-8deg) translate(-4px, 1px); }
.pdf-card-tag { font: 800 8px/1 var(--mono); letter-spacing: .06em; color: #fff; background: var(--ps-tag); padding: 2px 4px; border-radius: 3px; box-shadow: 0 2px 6px -2px rgba(214,71,63,.7); }
.pdf-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pdf-card-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-card-meta { font: 500 11px/1 var(--mono); color: #5c7a86; }
.pdf-card-acts { position: absolute; right: 9px; bottom: 8px; z-index: 3; display: flex; gap: 4px; opacity: 0; transition: opacity .16s var(--ease); }
.pdf-card:hover .pdf-card-acts, .pdf-card:focus-within .pdf-card-acts { opacity: 1; }
@media (max-width: 640px) { .pdf-card-acts { opacity: 1; } }

/* ----- the studio shell ----- */
.pstudio-shell { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 190px); animation: psIn .4s var(--ease-out) both; }
@keyframes psIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.pstudio-topbar { display: flex; align-items: center; gap: 14px; }
.pstudio-title-in { flex: 1; min-width: 0; background: none; border: none; outline: none; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -.02em; padding: 4px 6px; border-radius: 6px; transition: box-shadow .18s var(--ease); }
.pstudio-title-in::placeholder { color: var(--text-3); }
.pstudio-title-in:focus-visible { box-shadow: 0 0 0 3px var(--ps-accent-glow); }
.pstudio-status { flex: none; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-3); }
.pstudio-status .pstudio-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pstudio-status.saved .pstudio-dot { background: var(--green); box-shadow: 0 0 7px -1px var(--green); }
.pstudio-status.dirty .pstudio-dot { background: var(--amber); }
.pstudio-status.error { color: var(--red); }
.pstudio-status.error .pstudio-dot { background: var(--red); }
.pstudio-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ps-accent) 30%, transparent); border-top-color: var(--ps-accent); animation: docSpin .7s linear infinite; }

.pstudio-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 208px minmax(0,1fr) 248px; gap: 14px; align-items: stretch; }
.pstudio-panel { background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--border); border-radius: var(--radius); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 20px 50px -30px rgba(0,0,0,.7); }

.pstudio-rail { display: flex; flex-direction: column; padding: 14px 12px; gap: 10px; overflow-y: auto; }
.pstudio-rail-head { font: 800 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 0 2px; }
.pstudio-rail-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px 10px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.pstudio-rail-empty-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--ps-accent) 12%, transparent); color: var(--ps-accent); }
.pstudio-rail-thumb { flex: none; width: 100%; aspect-ratio: 3 / 4; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); }

.pstudio-stage {
  position: relative; display: flex; align-items: center; justify-content: center; padding: 32px; overflow: hidden;
  background-image:
    radial-gradient(60% 50% at 50% 8%, color-mix(in srgb, var(--ps-accent) 12%, transparent), transparent 68%),
    radial-gradient(circle, var(--ps-line) 1.2px, transparent 1.2px);
  background-size: 100% 100%, 22px 22px;
}
.pstudio-empty { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 320px; text-align: center; padding: 38px 30px; border-radius: 16px; border: 1px dashed var(--border-2); background: color-mix(in srgb, var(--panel) 55%, transparent); animation: fadeUp .5s var(--ease-out) .05s both; }
.pstudio-empty-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--ps-accent) 14%, transparent); color: var(--ps-accent); }
.pstudio-empty-title { font-size: 15.5px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.pstudio-empty-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }
.pstudio-empty-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.pstudio-loading { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--text-3); font-size: 12.5px; }

.pstudio-tools { display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: hidden; }
.pstudio-tools-head { font: 800 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.pstudio-tools-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px 12px; color: var(--text-3); font-size: 12px; line-height: 1.55; border-radius: 12px; border: 1px dashed var(--border); }
.pstudio-tools-empty b { color: var(--text-2); font-weight: 700; }

/* ----- P2-4: tool palette ----- */
.pstudio-tool-palette { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pstudio-tool-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 9px 4px 8px; border-radius: 10px; border: 1px solid transparent; background: var(--panel-2);
  color: var(--text-2); font-size: 10.5px; font-weight: 700; letter-spacing: -.005em; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease-spring);
}
.pstudio-tool-btn span { line-height: 1.15; text-align: center; }
.pstudio-tool-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-3); transform: translateY(-1px); }
.pstudio-tool-btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.pstudio-tool-btn:disabled { cursor: default; }
.pstudio-tool-btn.active { color: #06262b; background: linear-gradient(180deg, var(--ps-accent-2), var(--ps-accent)); border-color: transparent; box-shadow: 0 1px 0 rgba(255,255,255,.28) inset, 0 8px 20px -10px var(--ps-accent-glow); }
.pstudio-tool-btn:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }

/* ----- P2-4: contextual properties panel ----- */
.pstudio-prop-divider { flex: none; height: 1px; background: var(--border); }
.pstudio-prop-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding-right: 1px; }
.pstudio-prop-head { flex: none; font: 800 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ps-accent); }
.pstudio-prop-row { display: flex; flex-direction: column; gap: 6px; }
.pstudio-prop-row-stack { gap: 6px; }
.pstudio-prop-label { font-size: 11px; font-weight: 700; color: var(--text-3); }
.pstudio-prop-color-wrap { display: flex; align-items: center; gap: 8px; }
.pstudio-prop-color { width: 30px; height: 30px; flex: none; border-radius: 8px; border: 1px solid var(--border-2); background: none; padding: 2px; cursor: pointer; }
.pstudio-prop-color::-webkit-color-swatch-wrapper { padding: 0; border-radius: 6px; }
.pstudio-prop-color::-webkit-color-swatch { border: none; border-radius: 6px; }
.pstudio-prop-color-hex { font: 600 11px/1 var(--mono); color: var(--text-3); text-transform: lowercase; }
.pstudio-prop-fillnone { font: 700 10px var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 7px; padding: 6px 9px; cursor: pointer; }
.pstudio-prop-fillnone:hover { background: var(--panel-3); color: var(--text); }
.pstudio-prop-fillnone.on { color: var(--ps-accent); border-color: var(--ps-accent); background: color-mix(in srgb, var(--ps-accent) 12%, transparent); }
.pstudio-prop-slider-wrap { display: flex; align-items: center; gap: 10px; }
.pstudio-prop-slider-wrap input[type="range"] { flex: 1; min-width: 0; accent-color: var(--ps-accent); cursor: pointer; }
.pstudio-prop-slider-val { flex: none; min-width: 32px; text-align: right; font: 700 11px var(--mono); color: var(--text-2); }
.pstudio-prop-select { width: 100%; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); font-size: 12px; padding: 7px 8px; cursor: pointer; }
.pstudio-prop-select:focus-visible, .pstudio-prop-color:focus-visible, .pstudio-prop-textarea:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
.pstudio-prop-seg { display: flex; gap: 3px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 3px; }
.pstudio-prop-seg-btn { flex: 1; font: 700 10.5px var(--mono); color: var(--text-3); background: none; border: none; border-radius: 6px; padding: 5px 4px; cursor: pointer; }
.pstudio-prop-seg-btn:hover { color: var(--text-2); }
.pstudio-prop-seg-btn.on { color: #06262b; background: var(--ps-accent); }
.pstudio-prop-seg-btn:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 1px; }
.pstudio-prop-textarea { width: 100%; resize: vertical; min-height: 54px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; color: var(--text); font-size: 12.5px; line-height: 1.5; padding: 8px 9px; font-family: inherit; }

/* P3-2: Page panel (page adjustments) — action-button rows + note, plus the live crop rectangle. */
.pstudio-page-acts { display: flex; gap: 6px; }
.pstudio-page-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font: 700 10.5px var(--mono); color: var(--text-2); background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 8px 6px; cursor: pointer; white-space: nowrap; }
.pstudio-page-btn:hover:not(:disabled) { color: var(--text); background: var(--panel-3); border-color: var(--border); }
.pstudio-page-btn:disabled { opacity: .4; cursor: default; }
.pstudio-page-btn.on { color: #06262b; background: var(--ps-accent); border-color: transparent; }
.pstudio-page-btn:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
.pstudio-page-note { font-size: 11px; line-height: 1.5; color: var(--text-3); }
/* ----- P3-3: blur / redact note ----- */
.pstudio-blur-note { font-size: 11px; line-height: 1.5; color: var(--text-3); padding: 8px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border-2); }
.pstudio-croprect { fill: color-mix(in srgb, var(--ps-accent) 10%, transparent); stroke: var(--ps-accent-2); stroke-width: 1.5; stroke-dasharray: 5 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.pstudio-stage-page.cropping { cursor: crosshair; }

/* a button that carries the studio's cyan accent instead of the app's violet .btn-primary */
.pstudio-btn-accent { background: linear-gradient(180deg, var(--ps-accent-2), var(--ps-accent)); color: #06262b; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 22px -8px var(--ps-accent-glow); }
.pstudio-btn-accent:hover { filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 12px 28px -8px var(--ps-accent-glow); }

/* P2-5: signature modal (PsSignatureModal) — reuses the app's generic .drawer-overlay/.card/
   .anim-modal modal shell (see servers-home.jsx/dash-views.jsx for the same pattern), these rules
   only style the Draw/Type tab strip + the drawing pad + the typed-signature input. */
.pstudio-sig-tabs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; margin-bottom: 14px; }
.pstudio-sig-tab { padding: 6px 16px; border-radius: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-3); transition: color .15s var(--ease), background .15s var(--ease); }
.pstudio-sig-tab:hover { color: var(--text-2); }
.pstudio-sig-tab.on { background: var(--ps-accent); color: #06262b; }
.pstudio-sig-tab:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
.pstudio-sigpad { width: 100%; height: 160px; border-radius: 8px; border: 1px solid var(--border-2); touch-action: none; cursor: crosshair; display: block; }
.pstudio-sigpad:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }
.pstudio-sig-typein { width: 100%; height: 74px; background: #fff; color: #0f172a; border: 1px solid var(--border-2); border-radius: 8px; padding: 0 16px; outline: none; font-family: "Newsreader", serif; font-style: italic; font-size: 30px; }
.pstudio-sig-typein:focus-visible { box-shadow: 0 0 0 3px var(--ps-accent-glow); }
@media (prefers-reduced-motion: reduce) {
  .pstudio-sig-tab { transition: none; }
}

/* ----- Share links panel (PdfShare) — reuses .doc-share's layout, just re-tints the "Can edit"
   badge to the studio's cyan accent instead of the doc's violet one. ----- */
.pdf-share .doc-lvl-edit { color: var(--ps-accent); background: color-mix(in srgb, var(--ps-accent) 14%, transparent); }

/* ----- standalone shared-PDF viewer (/pd/<token>, PdfView) — same shell shape as .docview but
   its own cyan chrome, and a stacked-flat-page body instead of a rich-text sheet (read-only: every
   page here is already a flattened raster from psCompositePage, not a live editable canvas). ----- */
.pdfview { min-height: 100vh; background: radial-gradient(900px 500px at 15% -5%, rgba(34,211,238,.10), transparent 60%), var(--bg, #0a0a0e); display: flex; flex-direction: column; }
.pdfview-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: color-mix(in srgb, var(--bg, #0a0a0e) 82%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ps-line); }
.pdfview-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdfview-pages { width: 100%; max-width: 880px; box-sizing: border-box; margin: 22px auto 60px; padding: 0 16px; display: flex; flex-direction: column; gap: 22px; }
.pdfview-page { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; border: 1px solid var(--ps-line); box-shadow: 0 24px 60px -24px rgba(0,0,0,.65); }
@media (max-width: 640px) {
  .pdfview-bar { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .pdfview-pages { padding: 0 10px; gap: 16px; }
}

@media (max-width: 1100px) {
  .pstudio-body { grid-template-columns: 1fr; }
  .pstudio-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; align-items: center; }
  .pstudio-rail-empty { flex-direction: row; padding: 6px 4px; }
  .pstudio-rail-thumb { width: 70px; height: 90px; aspect-ratio: auto; }
}
@media (max-width: 640px) {
  .pstudio-topbar { flex-wrap: wrap; row-gap: 8px; }
  .pstudio-title-in { font-size: 17px; }
  .pstudio-shell { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .pstudio-shell, .pstudio-empty { animation: none; }
  .pdf-card, .pdf-card-sheet, .pstudio-tool-btn { transition: none; }
}

/* ============ Bot — per-command embed editor overlay (BotEmbedEditor) ============
   A full-screen takeover (not a side drawer) — editing a command's Discord message wants the
   same room the Embed Builder tab gets, and it reuses that tab's .emb-* grid/preview classes. */
.botemb-overlay {
  position: fixed; inset: 0; z-index: 400; background: var(--bg, #0a0a0e);
  display: flex; flex-direction: column; animation: fadeIn .2s ease both;
}
.botemb-head {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 12px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.botemb-head-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.botemb-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 48px; }
.botemb-vars {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px;
}
.botemb-vars-label { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.botemb-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.botemb-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 11.5px;
  font-weight: 600; color: var(--text-2); cursor: pointer; transition: color .14s, border-color .14s, background .14s;
}
.botemb-chip:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 720px) {
  .botemb-head { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .botemb-body { padding: 14px 14px 36px; }
}

/* ===== Bot section — Components V2 read-only preview (Discord-like) ===== */
.botv2-preview { display:flex; flex-direction:column; gap:8px; }
.botv2-container { background:#2b2d31; border:1px solid rgba(255,255,255,.06); border-radius:8px; padding:12px 14px; display:flex; flex-direction:column; gap:8px; }
.botv2-text { color:#dbdee1; font-size:13.5px; line-height:1.45; }
.botv2-h1 { font-size:19px; font-weight:800; color:#f2f3f5; margin:2px 0; line-height:1.25; }
.botv2-h2 { font-size:16px; font-weight:800; color:#f2f3f5; margin:2px 0; line-height:1.3; }
.botv2-h3 { font-size:14px; font-weight:700; color:#f2f3f5; margin:1px 0; }
.botv2-p { margin:1px 0; }
.botv2-br { height:6px; }
.botv2-gallery { display:flex; flex-direction:column; gap:5px; }
.botv2-img { width:100%; border-radius:8px; display:block; }
.botv2-img-ph { width:100%; height:70px; border-radius:8px; background:#1e1f22; display:flex; align-items:center; justify-content:center; color:#4e5058; }
.botv2-sep { height:1px; background:rgba(255,255,255,.08); margin:3px 0; }
.botv2-section { display:flex; align-items:center; gap:10px; }
.botv2-btnrow { display:flex; flex-wrap:wrap; gap:8px; margin-top:2px; }
.botv2-btn { display:inline-flex; align-items:center; font-size:13px; font-weight:600; color:#fff; padding:7px 14px; border-radius:8px; white-space:nowrap; }
.botv2-btn-link, .botv2-btn-primary { background:#5865f2; }
.botv2-btn-secondary { background:#4e5058; }
.botv2-btn-success { background:#248046; }
.botv2-btn-danger { background:#da373c; }
.botv2-code { background:#1e1f22; border-radius:4px; padding:1px 5px; font-family:var(--mono,monospace); font-size:12px; }
.botv2-mention { color:#c9cdfb; background:rgba(88,101,242,.3); border-radius:4px; padding:0 3px; }
.botv2-thumb { width:64px; height:64px; border-radius:8px; object-fit:cover; flex:none; }

/* ============ Dropdown responses — companion panel (DropdownResponses) ============
   Used by both the per-command editor (bot.jsx) and the Embed Builder (embeds.jsx). The dropdown
   itself (placeholder + options) now lives IN the Components-V2 tree, edited via the SDK's own
   "Add content -> Dropdown" — this panel just reads the tree's selects and shows one card per
   select, one row per option, each with a response badge + an Edit button that opens the same
   full-screen .botemb-overlay chrome the embed editors already use (see above). */
.ddr-root { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ddr-head-title { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ddr-select { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ddr-select-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.ddr-options { display: flex; flex-direction: column; gap: 8px; }
.ddr-option {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.ddr-option-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.ddr-option-emoji { flex: none; }
.ddr-option-label { font-weight: 600; font-size: 13px; }
.ddr-option-desc { color: var(--text-3); font-size: 12px; }
@media (max-width: 720px) {
  .ddr-option { flex-direction: column; align-items: flex-start; }
}
.botv2-file { display:inline-flex; align-items:center; gap:8px; background:#1e1f22; border:1px solid rgba(255,255,255,.06); border-radius:8px; padding:8px 12px; color:#dbdee1; font-size:12.5px; }
/* Closed String Select ("dropdown") chip — one per acx:menu:<token> action row, either standing
   alone or hoisted from a type:1 row (Discord rows are buttons OR one select, never both). */
.botv2-select { display:flex; align-items:center; justify-content:space-between; gap:10px; background:#2b2d31; border:1px solid rgba(255,255,255,.08); border-radius:8px; padding:9px 12px; margin-top:2px; }
.botv2-select-ph { color:#dbdee1; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.botv2-select-chevron { color:#949ba4; flex:none; }

/* ============ v2-style marketing Home (mkt-*) ============ */
.mkt-wrap{ max-width:1120px; margin:0 auto; padding:0 28px; position:relative; }
.mkt-eyebrow{ display:inline-flex; align-items:center; gap:7px; font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--accent-2); background:var(--accent-soft); border:1px solid rgba(139,92,246,.30); padding:5px 12px; border-radius:999px; }
.mkt-h2{ font-size:clamp(26px,4vw,42px); font-weight:800; letter-spacing:-.03em; line-height:1.08; margin:0; }
.mkt-sub{ color:var(--text-2); font-size:16px; line-height:1.6; }
.mkt-grad-num{ background:linear-gradient(180deg,#ffffff,#c4b5fd); -webkit-background-clip:text; background-clip:text; color:transparent; }
.mkt-head{ text-align:center; max-width:640px; margin:0 auto; }
.mkt-head .mkt-h2{ margin-top:14px; }
.mkt-head .mkt-sub{ margin:14px auto 0; }

.mkt-fcard{ position:relative; height:100%; border:1px solid var(--border); background:rgba(20,20,27,.55); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border-radius:14px; padding:22px; transition:border-color .25s, transform .25s, box-shadow .25s; }
.mkt-fcard:hover{ border-color:rgba(139,92,246,.45); transform:translateY(-3px); box-shadow:0 24px 50px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(139,92,246,.22); }
.mkt-ficon{ width:40px; height:40px; display:grid; place-items:center; border-radius:10px; background:var(--accent-soft); color:var(--accent-2); }

.mkt-scene{ position:absolute; inset:0; overflow:hidden; }
.mkt-scene>img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.mkt-kenburns{ animation:mktKen 28s ease-in-out infinite; }
@keyframes mktKen{ 0%,100%{ transform:scale(1.08) translate(0,0);} 50%{ transform:scale(1.15) translate(-1.6%,-1.1%);} }
.mkt-scrim{ position:absolute; inset:0; background:rgba(11,11,17,.62); }
.mkt-scrim2{ position:absolute; inset:0; background:linear-gradient(180deg,#0b0b11, transparent 24%, transparent 76%, #0b0b11); }
.mkt-wash{ position:absolute; width:320px; height:320px; border-radius:999px; filter:blur(90px); mix-blend-mode:screen; pointer-events:none; }
.mkt-wash.red{ background:rgba(240,86,63,.28); left:-90px; top:60px; animation:mktSiren 1.05s ease-in-out infinite; }
.mkt-wash.blue{ background:rgba(77,159,255,.28); right:-90px; bottom:60px; animation:mktSiren 1.05s ease-in-out infinite; animation-delay:.52s; }
@keyframes mktSiren{ 0%,100%{ opacity:.25;} 50%{ opacity:.95;} }

.mkt-car{ position:relative; width:100%; max-width:520px; margin:0 auto; }
.mkt-car>img{ width:100%; display:block; filter:drop-shadow(0 30px 60px rgba(0,0,0,.55)); animation:mktBob 4.6s ease-in-out infinite; }
@keyframes mktBob{ 0%,100%{ transform:translateY(0);} 50%{ transform:translateY(-10px);} }
.mkt-lb{ position:absolute; width:170px; height:170px; border-radius:999px; filter:blur(80px); mix-blend-mode:screen; top:8%; pointer-events:none; }
.mkt-lb.red{ background:rgba(240,86,63,.75); left:34%; transform:translateX(-50%); animation:mktSiren 1.05s ease-in-out infinite; }
.mkt-lb.blue{ background:rgba(77,159,255,.75); left:62%; transform:translateX(-50%); animation:mktSiren 1.05s ease-in-out infinite; animation-delay:.52s; }
.mkt-modchip{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); background:rgba(20,20,27,.6); color:var(--text-2); padding:6px 11px; border-radius:9px; font-size:13px; }

.mkt-mq{ overflow:hidden; -webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent); mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent); }
.mkt-mq-track{ display:flex; gap:12px; width:max-content; animation:mktMq 34s linear infinite; }
.mkt-mq:hover .mkt-mq-track{ animation-play-state:paused; }
@keyframes mktMq{ from{ transform:translateX(0);} to{ transform:translateX(-50%);} }
.mkt-cmd{ display:inline-flex; align-items:center; gap:6px; border:1px solid var(--border); background:rgba(20,20,27,.6); backdrop-filter:blur(8px); border-radius:10px; padding:9px 14px; font-family:'JetBrains Mono',monospace; font-size:13px; white-space:nowrap; }
.mkt-cmd b{ color:var(--accent-2); font-weight:600; }
.mkt-cmd i{ color:var(--text-3); font-style:normal; }

.mkt-cta{ position:relative; overflow:hidden; border:1px solid var(--border); border-radius:24px; padding:64px 24px; text-align:center; }
.mkt-aurora{ position:absolute; inset:-25%; filter:blur(58px); opacity:.92; background:
  radial-gradient(38% 48% at 20% 30%, rgba(210,21,112,.95), transparent 60%),
  radial-gradient(44% 54% at 76% 42%, rgba(140,63,248,.95), transparent 60%),
  radial-gradient(40% 50% at 55% 82%, rgba(86,255,195,.55), transparent 60%);
  animation:mktAurora 14s ease-in-out infinite; }
@keyframes mktAurora{ 0%,100%{ transform:translate(0,0) scale(1.2);} 33%{ transform:translate(4%,-3%) scale(1.28);} 66%{ transform:translate(-3%,2%) scale(1.18);} }
.mkt-cta-scrim{ position:absolute; inset:0; background:rgba(11,11,17,.45); }

.mkt-glass{ border:1px solid var(--border); background:rgba(20,20,27,.6); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-radius:16px; box-shadow:0 30px 60px -30px rgba(0,0,0,.8); }
.mkt-price{ border:1px solid var(--border); background:var(--panel); border-radius:18px; padding:30px; height:100%; }
.mkt-price.pop{ border-color:rgba(139,92,246,.45); box-shadow:0 0 0 1px var(--accent-3), 0 30px 80px -30px var(--accent-glow); position:relative; overflow:hidden; }

@media (prefers-reduced-motion:reduce){ .mkt-kenburns,.mkt-wash,.mkt-lb,.mkt-car>img,.mkt-mq-track,.mkt-aurora{ animation:none!important; } }

/* ---- elevated marketing: scroll reveal, spotlight, dual marquee, road, grain ---- */
.reveal{ opacity:0; transform:translateY(24px); transition:opacity .75s cubic-bezier(.22,.61,.36,1), transform .75s cubic-bezier(.22,.61,.36,1); will-change:opacity,transform; }
.reveal.in{ opacity:1; transform:none; }
.reveal.d1{ transition-delay:.07s; } .reveal.d2{ transition-delay:.14s; } .reveal.d3{ transition-delay:.21s; } .reveal.d4{ transition-delay:.28s; }

/* hero orchestrated entrance */
.mkt-hero-aurora{ position:absolute; left:-10%; right:-10%; top:-20%; height:82%; filter:blur(72px); opacity:.55; pointer-events:none; background:
  radial-gradient(38% 60% at 28% 0%, rgba(139,92,246,.55), transparent 62%),
  radial-gradient(40% 60% at 76% 8%, rgba(124,58,237,.42), transparent 62%),
  radial-gradient(30% 50% at 52% 30%, rgba(167,139,250,.30), transparent 60%);
  animation:mktAurora 18s ease-in-out infinite; }
.hs{ opacity:0; transform:translateY(16px); filter:blur(8px); animation:hsIn .7s cubic-bezier(.22,.61,.36,1) both; }
@keyframes hsIn{ to{ opacity:1; transform:none; filter:blur(0); } }

/* feature card cursor spotlight — v2 GlowCard style: a violet glowing BORDER that tracks the cursor,
   plus a soft inner wash. */
.mkt-fcard{ --mx:50%; --my:50%; }
.mkt-fcard::before{ content:''; position:absolute; inset:0; border-radius:inherit; padding:1.5px; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(240px circle at var(--mx) var(--my), rgba(167,139,250,.95), rgba(139,92,246,.35) 45%, transparent 72%);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite:exclude; }
.mkt-fcard::after{ content:''; position:absolute; inset:0; border-radius:inherit; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(220px circle at var(--mx) var(--my), rgba(139,92,246,.13), transparent 60%); }
.mkt-fcard:hover::before, .mkt-fcard:hover::after{ opacity:1; }

/* unitly drive-in + road */
.mkt-car.reveal{ transform:translateX(72px); }
.mkt-car.reveal.in{ transform:translateX(0); transition:opacity .9s ease, transform .95s cubic-bezier(.22,.61,.36,1); }
.mkt-road{ position:absolute; left:6%; right:6%; bottom:3%; height:2px; pointer-events:none; background:repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0, rgba(255,255,255,.35) 22px, transparent 22px, transparent 44px); -webkit-mask-image:linear-gradient(90deg,transparent,#000 20%,#000 80%,transparent); mask-image:linear-gradient(90deg,transparent,#000 20%,#000 80%,transparent); animation:mktRoad 1.3s linear infinite; }
@keyframes mktRoad{ from{ background-position:0 0; } to{ background-position:-44px 0; } }

/* dual marquee reverse row */
.mkt-mq-track.rev{ animation:mktMqRev 40s linear infinite; }
@keyframes mktMqRev{ from{ transform:translateX(-50%); } to{ transform:translateX(0); } }

/* subtle film grain for depth */
.mkt-grain{ position:fixed; inset:0; z-index:1; pointer-events:none; opacity:.04; mix-blend-mode:overlay; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }

/* button micro-press */
.mkt-press{ transition:transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.mkt-press:active{ transform:scale(.97); }
.mkt-btn-glow{ box-shadow:0 10px 34px -8px var(--accent-glow); }

@media (prefers-reduced-motion:reduce){
  .reveal{ opacity:1 !important; transform:none !important; }
  .hs{ opacity:1 !important; transform:none !important; filter:none !important; animation:none !important; }
  .mkt-hero-aurora,.mkt-road{ animation:none !important; }
}

/* marketing responsive grids + rhythm */
.mkt-sec{ padding:92px 0; position:relative; }
.mkt-statgrid{ display:grid; grid-template-columns:repeat(2,1fr); gap:22px; }
.mkt-fgrid{ display:grid; grid-template-columns:1fr; gap:18px; margin-top:52px; }
.mkt-pgrid{ display:grid; grid-template-columns:1fr; gap:18px; max-width:820px; margin:52px auto 0; }
.mkt-unitly{ display:grid; grid-template-columns:1fr; gap:44px; align-items:center; }
@media (min-width:700px){ .mkt-fgrid{ grid-template-columns:repeat(2,1fr);} .mkt-pgrid{ grid-template-columns:repeat(2,1fr);} }
@media (min-width:768px){ .mkt-statgrid{ grid-template-columns:repeat(4,1fr);} }
@media (min-width:900px){ .mkt-fgrid{ grid-template-columns:repeat(3,1fr);} .mkt-unitly{ grid-template-columns:1fr 1fr;} }

/* Departments — overview stat row */
.dept-stats{ display:grid; grid-template-columns:repeat(5,1fr); }
.dept-stat{ padding:6px 18px; }
.dept-stat + .dept-stat{ border-left:1px solid var(--border); }
@media (max-width:780px){ .dept-stats{ grid-template-columns:repeat(2,1fr); row-gap:14px; } .dept-stat+.dept-stat{ border-left:none; } .dept-stat{ padding:6px 14px; } }

/* Departments — elevated (KPI strip + rows) */
.dept-strip{ position:relative; overflow:hidden; }
.dept-strip::before{ content:''; position:absolute; top:-45%; right:-8%; width:340px; height:220px; background:radial-gradient(closest-side, rgba(139,92,246,.16), transparent 70%); pointer-events:none; }
.dept-strip::after{ content:''; position:absolute; left:20px; right:20px; bottom:0; height:1px; background:linear-gradient(90deg, transparent, var(--accent-2), transparent); opacity:.55; }
.dept-num{ font-size:27px; font-weight:800; margin-top:8px; letter-spacing:-0.02em; line-height:1; }
.dept-live-dot{ width:7px; height:7px; border-radius:50%; background:var(--green); animation:deptPulse 1.8s infinite; margin-left:1px; flex:none; }
@keyframes deptPulse{ 0%{ box-shadow:0 0 0 0 rgba(52,211,153,.5) } 70%{ box-shadow:0 0 0 6px rgba(52,211,153,0) } 100%{ box-shadow:0 0 0 0 rgba(52,211,153,0) } }
.dept-row{ transition:border-color .2s, box-shadow .2s, transform .2s; }
.dept-row:hover{ border-color:rgba(139,92,246,.45) !important; box-shadow:0 8px 26px -12px rgba(139,92,246,.55); transform:translateY(-1px); }
.dept-expbar{ height:3px; border-radius:3px; background:var(--panel); overflow:hidden; margin-top:8px; max-width:230px; }
.dept-expbar > span{ display:block; height:100%; border-radius:3px; background:linear-gradient(90deg, var(--accent-2), var(--accent)); transition:width .4s ease; }

/* Server directory (public) */
.dir-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(280px,1fr)); gap:16px; }
.dir-card{ padding:0; overflow:hidden; transition:transform .2s, box-shadow .2s, border-color .2s; }
.dir-card:hover{ transform:translateY(-3px); border-color:rgba(139,92,246,.4); box-shadow:0 14px 34px -16px rgba(139,92,246,.5); }
.dir-card-top{ height:56px; background-size:cover; background-position:center; background:linear-gradient(120deg, var(--accent-soft), transparent); }
.dir-stats{ display:grid; grid-template-columns:repeat(4,1fr); }
.dir-stat{ padding:6px 18px; }
.dir-stat + .dir-stat{ border-left:1px solid var(--border); }
@media (max-width:640px){ .dir-stats{ grid-template-columns:repeat(2,1fr); row-gap:14px; } .dir-stat + .dir-stat{ border-left:none; } }

/* Server profile — two-column (sidebar + content) */
.dir-profile-grid{ display:grid; grid-template-columns:340px 1fr; gap:20px; align-items:start; }
.dir-side{ display:flex; flex-direction:column; gap:16px; position:sticky; top:14px; }
.dir-side-card{ background:linear-gradient(180deg, rgba(139,92,246,.06), transparent 40%), var(--panel); }
.dir-side-stats{ margin-top:16px; padding-top:14px; border-top:1px solid var(--border); }
.dir-vote-btn{ font-weight:700; }
.dir-members .dir-memlist{ display:flex; flex-direction:column; gap:2px; max-height:340px; overflow-y:auto; margin:0 -6px; padding:0 6px; }
.dir-memrow{ display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:9px; transition:background .12s; }
.dir-memrow:hover{ background:var(--panel-2); }
.dir-memname{ font-size:13px; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dir-memdate{ font-size:11px; margin-left:auto; flex:none; }
.dir-memav{ width:30px; height:30px; border-radius:50%; flex:none; background:var(--accent-soft); color:var(--accent-2); display:grid; place-items:center; font-weight:700; font-size:12px; }
.dir-composer{ background:var(--panel-2); border:1px solid var(--border); border-radius:14px; padding:14px 16px; }
.dir-review{ padding:14px 0; border-top:1px solid var(--border); }
.dir-review:first-child{ border-top:none; }
@media (max-width:860px){
  .dir-profile-grid{ grid-template-columns:1fr; }
  .dir-side{ position:static; }
  .dir-members .dir-memlist{ max-height:300px; }
}

/* Profile page builder — Canva-style free canvas */
.pb-overlay{ position:fixed; inset:0; z-index:300; background:var(--bg); display:flex; flex-direction:column; }
.pb-bar{ display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid var(--border); background:var(--panel); z-index:4; }
.pb-toolbar{ position:absolute; top:60px; left:50%; transform:translateX(-50%); z-index:6; display:flex; align-items:center; gap:8px; padding:7px 10px; background:var(--panel-2); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow-lg); max-width:calc(100vw - 40px); overflow-x:auto; }
.pb-scroll{ flex:1; overflow:auto; position:relative; padding:96px 28px 60px 184px; }
.pb-dots{ background-image:radial-gradient(rgba(139,92,246,.16) 1px, transparent 1px); background-size:22px 22px; }
.pb-cwrap{ margin:0 auto; position:relative; }
.pb-cinner{ position:absolute; top:0; left:0; background:var(--panel); border:1px solid var(--border); border-radius:16px; box-shadow:0 26px 64px -22px rgba(0,0,0,.65); overflow:hidden; }
.pb-el{ outline:1px dashed transparent; transition:outline-color .12s; }
.pb-el:hover{ outline-color:rgba(139,92,246,.5); }
.pb-el.sel{ outline:2px solid var(--accent); }
.pb-resize{ position:absolute; right:-6px; bottom:-6px; width:13px; height:13px; border-radius:3px; background:var(--accent); border:2px solid var(--panel); cursor:nwse-resize; }
.pb-el.pb-drop{ outline:2px dashed var(--accent); outline-offset:2px; background:rgba(139,92,246,.10); }
.pb-drophint{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; font-size:11.5px; font-weight:600; color:var(--accent-2); pointer-events:none; opacity:.85; text-align:center; padding:6px; }
.pb-uploading{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; gap:8px; font-size:12px; font-weight:600; color:#fff; background:rgba(10,10,16,.55); border-radius:inherit; pointer-events:none; z-index:2; }
.pb-spin{ width:15px; height:15px; border-radius:50%; border:2px solid rgba(255,255,255,.3); border-top-color:#fff; animation:pbspin .7s linear infinite; display:inline-block; flex:none; }
@keyframes pbspin{ to{ transform:rotate(360deg); } }
.dir-card.dir-featured{ border-color:rgba(251,191,36,.4); box-shadow:0 0 0 1px rgba(251,191,36,.22), 0 10px 34px -14px rgba(251,191,36,.4); }
/* Under construction / coming soon gate */
.uc-wrap{ position:relative; min-height:100vh; display:grid; place-items:center; overflow:hidden; background:var(--bg); padding:24px; }
.uc-wrap.uc-inline{ min-height:62vh; border-radius:16px; }
.uc-blur{ position:absolute; inset:-60px; pointer-events:none; filter:blur(64px); opacity:.9;
  background:
    radial-gradient(600px 420px at 22% 26%, rgba(139,92,246,.30), transparent 60%),
    radial-gradient(520px 400px at 80% 30%, rgba(91,157,255,.22), transparent 62%),
    radial-gradient(560px 420px at 50% 92%, rgba(167,139,250,.22), transparent 62%);
  animation:ucfloat 15s ease-in-out infinite alternate; }
@keyframes ucfloat{ to{ transform:translate3d(0,-26px,0) scale(1.07); } }
.uc-card{ position:relative; z-index:1; max-width:460px; text-align:center; padding:42px 36px; border-radius:24px;
  background:rgba(18,18,26,.72); border:1px solid var(--border); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px);
  box-shadow:0 34px 90px -34px rgba(0,0,0,.75); }
.uc-badge{ width:66px; height:66px; margin:0 auto 20px; border-radius:19px; display:grid; place-items:center;
  color:var(--accent-2); background:var(--accent-soft); border:1px solid rgba(139,92,246,.35); }
.uc-title{ font-size:27px; font-weight:800; letter-spacing:-.02em; color:var(--text); }
.uc-tag{ display:inline-block; margin-top:11px; padding:5px 14px; border-radius:999px; font-size:11.5px; font-weight:700;
  letter-spacing:.09em; text-transform:uppercase; color:var(--accent-2); background:var(--accent-soft); border:1px solid rgba(139,92,246,.3); }
.uc-sub{ color:var(--text-2); font-size:14px; line-height:1.6; margin-top:16px; }

/* Roblox linking page — animated collage backdrop + centered status card */
.rbxlink-root{ position:fixed; inset:0; overflow:hidden; display:grid; place-items:center; background:#0b0b12; z-index:1; padding:20px; }
.rbxlink-bg{ position:absolute; inset:-7%; background:url('/roblox-bg.jpg') center/cover no-repeat; animation:rbxdrift 36s ease-in-out infinite alternate; will-change:transform; }
@keyframes rbxdrift{ 0%{ transform:scale(1.06) translate3d(0,0,0); } 100%{ transform:scale(1.15) translate3d(-2.5%,-2%,0); } }
.rbxlink-scrim{ position:absolute; inset:0; background:radial-gradient(125% 95% at 50% 42%, rgba(8,8,14,.32), rgba(8,8,14,.82) 68%, rgba(8,8,14,.96)); }
.rbxlink-card{ position:relative; z-index:2; width:min(92vw,420px); text-align:center; padding:38px 32px; border-radius:24px;
  background:rgba(16,16,24,.72); border:1px solid rgba(255,255,255,.09);
  backdrop-filter:blur(20px) saturate(1.1); -webkit-backdrop-filter:blur(20px) saturate(1.1);
  box-shadow:0 44px 110px -34px rgba(0,0,0,.88); }
.rbxlink-badge{ width:80px; height:80px; margin:0 auto 22px; border-radius:23px; display:grid; place-items:center; }
.rbxlink-wait{ background:var(--accent-soft); color:var(--accent-2); border:1px solid rgba(139,92,246,.32); }
.rbxlink-ok{ background:rgba(52,211,153,.16); color:#34d399; border:1px solid rgba(52,211,153,.4); animation:rbxpop .5s cubic-bezier(.2,1.3,.4,1) both; }
.rbxlink-bad{ background:rgba(248,113,113,.14); color:#f87171; border:1px solid rgba(248,113,113,.35); }
@keyframes rbxpop{ 0%{ transform:scale(.55); opacity:0; } 100%{ transform:scale(1); opacity:1; } }
.rbxlink-spin{ width:36px; height:36px; border-radius:50%; border:3px solid rgba(139,92,246,.25); border-top-color:var(--accent-2); animation:pbspin .8s linear infinite; }
.rbxlink-title{ font-size:23px; font-weight:800; letter-spacing:-.02em; color:#fff; }
.rbxlink-sub{ font-size:14px; color:rgba(255,255,255,.66); line-height:1.55; margin-top:10px; }
.rbxlink-actions{ display:flex; gap:10px; justify-content:center; margin-top:24px; flex-wrap:wrap; }
@media (prefers-reduced-motion: reduce){ .rbxlink-bg{ animation:none; } }
.pb-rail{ position:fixed; left:0; top:57px; bottom:0; width:160px; padding:16px 14px; background:var(--panel); border-right:1px solid var(--border); overflow-y:auto; z-index:5; }
.pb-add{ display:flex; align-items:center; gap:8px; width:100%; padding:9px 11px; border-radius:9px; font-size:13.5px; font-weight:600; color:var(--text-2); margin-bottom:6px; transition:background .15s, color .15s; }
.pb-add:hover{ background:var(--panel-2); color:var(--text); }
.pb-ico{ display:grid; place-items:center; width:28px; height:28px; border-radius:7px; color:var(--text-2); transition:background .15s; flex:none; }
.pb-ico:hover{ background:var(--panel); }
.pb-ico.on{ color:var(--accent-2); background:var(--accent-soft); }
.pb-fld{ display:flex; align-items:center; gap:5px; font-size:12px; color:var(--text-3); white-space:nowrap; }
.pb-fld input{ width:58px; height:28px; padding:0 6px; border:1px solid var(--border); border-radius:6px; background:var(--panel); color:var(--text); font-size:12.5px; }
.pb-url{ width:150px !important; }
.pb-color{ width:28px; height:28px; padding:0; border:1px solid var(--border); border-radius:6px; background:none; cursor:pointer; flex:none; }
.pb-sel{ height:28px; border:1px solid var(--border); border-radius:6px; background:var(--panel); color:var(--text); font-size:12.5px; padding:0 4px; }
.pb-div{ width:1px; height:20px; background:var(--border); margin:0 2px; }
@media (max-width:720px){ .pb-rail{ width:124px; } .pb-scroll{ padding-left:144px; } }

/* Site loading animation — cloud (Uiverse by andrew-manzyk) */
.loader { --cloud-color:#8b5cf6; --arrows-color:#a78bfa; --time-animation:1s; transform:scale(1); }
.loader #cloud { width:100px; height:100px; }
.loader #cloud rect { fill:var(--cloud-color); }
.loader #cloud g:nth-child(3) { transform-origin:50% 72.8938%; fill:var(--arrows-color); filter:drop-shadow(0 0 8px rgba(0,0,0,.6)); animation:rotation var(--time-animation) linear infinite; }
.loader #shapes g g circle { animation:cloud calc(var(--time-animation) * 2) linear infinite; }
.loader #shapes g g circle:nth-child(2) { animation-delay:calc((var(--time-animation) * 2) / -3); }
.loader #shapes g g circle:nth-child(3) { animation-delay:calc((var(--time-animation) * 2) / -1.5); }
.loader svg #lines g line { stroke-width:5; transform-origin:50% 50%; rotate:-65deg; animation:lines calc(var(--time-animation) / 1.33) linear infinite; }
@keyframes rotation { 0%{transform:rotate(0deg)} 50%{transform:rotate(180deg)} 100%{transform:rotate(360deg)} }
@keyframes lines { 0%{transform:translateY(-10px)} 100%{transform:translateY(8px)} }
@keyframes cloud { 0%{cx:20;cy:60;r:15} 50%{cx:50;cy:45;r:20} 100%{cx:80;cy:60;r:15} }
.page-loader { display:grid; place-items:center; min-height:100vh; gap:18px; align-content:center; }
.page-loader-label { color:var(--text-3); font-size:14px; letter-spacing:.01em; }

/* Server profile screenshot carousel */
.shot-strip { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:4px; }
.shot-img { height:300px; max-width:92%; object-fit:cover; border-radius:12px; scroll-snap-align:center; flex:none; background:var(--panel-2); }
@media (max-width:640px){ .shot-img{ height:190px; } }
