/* =========================================================
   Interest Cards Admin — futuristic glass UI
   ========================================================= */
:root {
    --bg: #05050b;
    --bg-2: #0b0b17;
    --panel: rgba(255, 255, 255, .035);
    --panel-2: rgba(255, 255, 255, .06);
    --border: rgba(255, 255, 255, .08);
    --border-2: rgba(255, 255, 255, .16);
    --text: #eeedff;
    --muted: #9896b8;
    --a1: #7c5cff;
    --a2: #00e5ff;
    --a3: #ff3d8b;
    --a4: #ffb547;
    --ok: #2ee6a6;
    --warn: #ffb547;
    --err: #ff4d6d;
    --grad: linear-gradient(135deg, var(--a1), var(--a2));
    --grad-hot: linear-gradient(135deg, var(--a3), var(--a1));
    --radius: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
    --glow: 0 0 0 1px rgba(124, 92, 255, .35), 0 8px 30px -6px rgba(124, 92, 255, .55);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display: "Space Grotesk", "Inter", system-ui, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
    font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; font-weight: 600; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.1; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1.15rem; }
a { color: inherit; text-decoration: none; }
p { margin: .3rem 0; }
code, .mono { font-family: var(--mono); font-size: .86em; }
::selection { background: rgba(124, 92, 255, .45); }
img { display: block; max-width: 100%; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; justify-content: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.gap { gap: .6rem; }
.end { justify-content: flex-end; }
.link { color: var(--a2); font-weight: 500; font-size: .85rem; }
.link:hover { text-decoration: underline; }
.w-40 { width: 40%; }
.love { color: var(--a3); }

/* ---------- Icons ---------- */
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.tiny { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.i.lg { width: 30px; height: 30px; }
.i.love, .pill.love .i { fill: currentColor; }

/* ---------- Background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 28s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: var(--a1); top: -25vmax; left: -15vmax; }
.aurora span:nth-child(2) { background: var(--a2); bottom: -30vmax; right: -20vmax; animation-delay: -9s; opacity: .14; }
.aurora span:nth-child(3) { background: var(--a3); top: 30%; left: 45%; width: 38vmax; height: 38vmax; animation-delay: -17s; opacity: .1; }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vmax, 4vmax) scale(1.12); } 100% { transform: translate(-4vmax, 7vmax) scale(.95); } }
.grid-overlay { position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem 1rem;
    background: linear-gradient(180deg, rgba(14, 13, 28, .85), rgba(8, 8, 18, .85)); border-right: 1px solid var(--border);
    backdrop-filter: blur(18px); z-index: 20;
}
.brand { display: flex; align-items: center; gap: .75rem; padding: .3rem .5rem 1rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; position: relative; overflow: hidden;
    background: radial-gradient(circle at 30% 25%, #2b2560, #0d0b20 75%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 8px 24px -10px rgba(124, 92, 255, .8); }
.brand-mark::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 5s ease-in-out infinite; }
.brand-mark svg { width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark.lg { width: 68px; height: 68px; border-radius: 20px; }
/* CANVAS logo: a canvas on an easel; three brush strokes paint themselves in, hold, then wipe and repeat. */
.brand-mark .cv-canvas { fill: rgba(255, 255, 255, .12); stroke: #fff; stroke-width: 1.5; }
.brand-mark .cv-leg { stroke: rgba(255, 255, 255, .75); stroke-width: 1.5; }
.brand-mark .cv-stroke { stroke: var(--c); stroke-width: 2.1; stroke-dasharray: 16; stroke-dashoffset: 16; filter: drop-shadow(0 0 1.4px var(--c));
    animation: cv-paint 4.2s cubic-bezier(.5, 0, .3, 1) infinite; animation-delay: calc(var(--n) * .35s); }
@keyframes cv-paint { 0% { stroke-dashoffset: 16; } 28%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -16; } }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
/* Wordmark: "CANVAS" in a paint-spectrum gradient, the city (from the subdomain) in spaced caps underneath. */
.wordmark { display: inline-flex; flex-direction: column; font-family: var(--display); line-height: 1; }
.wordmark .wm-1 { font-weight: 700; font-size: 1.45rem; letter-spacing: .12em; padding-right: .02em;
    background: linear-gradient(90deg, #ff3d6e, #ffb020, #7cffb2, #00e0ff, #a78bff, #ff3d6e); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: wm-shimmer 12s linear infinite; }
.wordmark .wm-2 { margin-top: .22rem; font: 600 .7rem/1 var(--font); letter-spacing: .34em; text-transform: uppercase; color: var(--text); opacity: .85; }
.wordmark.lg { align-items: center; margin: .9rem 0 .2rem; }
.wordmark.lg .wm-1 { font-size: 2.4rem; letter-spacing: .16em; padding-left: .16em; }
.wordmark.lg .wm-2 { font-size: .9rem; letter-spacing: .5em; padding-left: .5em; }
@keyframes wm-shimmer { to { background-position: 300% 0; } }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-section { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 1rem .8rem .35rem; opacity: .7; }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; position: relative; transition: color .25s, background .25s, transform .25s var(--ease); }
.nav-link:hover { color: var(--text); background: var(--panel-2); transform: translateX(3px); }
.nav-link.active { color: var(--text); background: linear-gradient(90deg, rgba(124, 92, 255, .22), rgba(0, 229, 255, .06)); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .3); }
.nav-link.active::before { content: ""; position: absolute; left: -1rem; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 12px var(--a2); }
.nav-link.active .i { color: var(--a2); }
.me { display: flex; align-items: center; gap: .65rem; padding: .7rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); }
.me-text { flex: 1; min-width: 0; line-height: 1.2; }
.me-text b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .72rem; }
.me form { margin: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font: 600 .78rem var(--display); color: #fff; background: var(--grad-hot); box-shadow: 0 0 0 2px rgba(255,255,255,.08); }
.avatar.sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.7rem; box-shadow: 0 0 0 4px rgba(124, 92, 255, .25), 0 12px 40px -8px var(--a1); }
.icon-btn.menu-toggle { display: none; }
.main { padding: 2rem clamp(1rem, 3vw, 2.6rem) 4rem; min-width: 0; max-width: 1400px; width: 100%; }

/* ---------- Motion ---------- */
.page-enter { animation: page-in .55s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.reveal { animation: rise .6s var(--ease) both; animation-delay: calc(var(--d, 0) * 60ms + 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.eyebrow { font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--a2); font-weight: 600; margin: 0 0 .35rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; margin-bottom: .5rem; transition: color .2s, gap .2s; }
.back-link:hover { color: var(--text); gap: .55rem; }

/* ---------- Buttons ---------- */
.btn {
    --bg: var(--panel-2); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .66rem 1.1rem; border-radius: 12px; border: 1px solid var(--border-2); background: var(--bg); color: var(--text);
    font: 600 .88rem var(--font); cursor: pointer; overflow: hidden; isolation: isolate; white-space: nowrap;
    transition: transform .25s var(--spring), box-shadow .3s, border-color .3s, background .3s;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.3); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary { border: 0; background: var(--grad); box-shadow: var(--glow); color: #fff; }
.btn.primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 25%, rgba(255,255,255,.35) 50%, transparent 75%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover::before { transform: translateX(120%); }
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(0, 229, 255, .5), 0 12px 40px -6px rgba(0, 229, 255, .5); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: linear-gradient(135deg, #ff4d6d, #ff3d8b); border: 0; color: #fff; box-shadow: 0 8px 30px -8px rgba(255, 77, 109, .7); }
.btn.danger-text { color: var(--err); border-color: rgba(255, 77, 109, .3); }
.btn.danger-text:hover { background: rgba(255, 77, 109, .1); }
.btn.sm { padding: .42rem .75rem; font-size: .8rem; border-radius: 10px; }
.btn.lg { padding: .9rem 1.3rem; font-size: .95rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.loading { pointer-events: none; opacity: .75; }
.btn.loading .i { display: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; border: 1px solid transparent;
    background: transparent; color: var(--muted); cursor: pointer; transition: all .2s var(--ease);
}
.icon-btn:hover:not([disabled]) { color: var(--text); background: var(--panel-2); border-color: var(--border); transform: translateY(-1px); }
.icon-btn.danger:hover { color: var(--err); background: rgba(255, 77, 109, .12); }
.icon-btn[disabled] { opacity: .3; cursor: default; }
.icon-btn.copied { color: var(--ok); }

/* ---------- Panels ---------- */
.panel {
    position: relative; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
    border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; backdrop-filter: blur(14px); margin-bottom: 1.2rem;
}
.panel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, rgba(124, 92, 255, .35), transparent 35%, transparent 70%, rgba(0, 229, 255, .25));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-head h2 small { font-family: var(--font); font-weight: 400; font-size: .8rem; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.split.wide-left { grid-template-columns: 1.15fr 1fr; }
.split > .panel { margin-bottom: 1.2rem; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi {
    position: relative; padding: 1.15rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); overflow: hidden; display: grid; gap: .25rem;
    transition: transform .35s var(--ease), border-color .35s;
}
.kpi:hover { transform: translateY(-4px); border-color: var(--border-2); }
.kpi::after { content: ""; position: absolute; width: 140px; height: 140px; right: -50px; top: -60px; border-radius: 50%; background: var(--c, var(--a1)); filter: blur(50px); opacity: .25; transition: opacity .35s; }
.kpi:hover::after { opacity: .45; }
.kpi:nth-child(2) { --c: var(--a2); } .kpi:nth-child(3) { --c: var(--a3); } .kpi:nth-child(4) { --c: var(--a4); }
.kpi-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .4rem; }
.v1 { --tone: 124, 92, 255; } .v2 { --tone: 0, 229, 255; } .v3 { --tone: 255, 61, 139; } .v4 { --tone: 255, 181, 71; }
.kpi-icon.v1, .kpi-icon.v2, .kpi-icon.v3, .kpi-icon.v4 { background: rgba(var(--tone), .15); color: rgb(var(--tone)); box-shadow: inset 0 0 0 1px rgba(var(--tone), .35); }
.kpi-label { color: var(--muted); font-size: .8rem; }
.kpi-value { font: 700 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.kpi-value small { font-size: .95rem; color: var(--muted); font-weight: 500; }

/* ---------- Charts ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding-top: 1.2rem; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.bar small { color: var(--muted); font-size: .68rem; }
.bar-fill { position: relative; width: 100%; max-width: 34px; height: var(--h); border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--a2), var(--a1)); box-shadow: 0 0 18px -4px var(--a1); transform-origin: bottom; animation: grow-y .9s var(--ease) both; }
.bar:nth-child(n) .bar-fill { animation-delay: calc(var(--i, 0) * 30ms); }
.bar-fill em { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font: 600 .68rem var(--display); color: var(--text); font-style: normal; }
@keyframes grow-y { from { transform: scaleY(0); } }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.hbar-label { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; font-size: .88rem; }
.hbar-track { position: relative; height: 10px; border-radius: 99px; background: rgba(255,255,255,.06); overflow: hidden; }
.hbar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 99px; transform-origin: left; animation: grow-x 1s var(--ease) both; }
.hbar.views { background: rgba(0, 229, 255, .35); }
.hbar.fav { background: linear-gradient(90deg, var(--a1), var(--a3)); box-shadow: 0 0 14px -2px var(--a3); animation-delay: .15s; }
.hbar.drop { background: var(--warn); height: 3px; top: auto; opacity: .9; animation-delay: .3s; }
@keyframes grow-x { from { transform: scaleX(0); } }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); }
.legend .lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg.views::before { background: rgba(0, 229, 255, .5); } .lg.fav::before { background: linear-gradient(90deg, var(--a1), var(--a3)); } .lg.drop::before { background: var(--warn); }
.ring { --p: 0; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font: 600 .72rem var(--display);
    background: radial-gradient(closest-side, var(--bg-2) 76%, transparent 78% 100%), conic-gradient(var(--a2) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -.3rem; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.table th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: .4rem .8rem; white-space: nowrap; }
.table td { padding: .75rem .8rem; background: rgba(255,255,255,.025); border-block: 1px solid transparent; vertical-align: middle; transition: background .25s, border-color .25s; }
.table td:first-child { border-radius: 12px 0 0 12px; border-left: 1px solid transparent; }
.table td:last-child { border-radius: 0 12px 12px 0; border-right: 1px solid transparent; }
.table tbody tr { animation: rise .5s var(--ease) both; }
.table tbody tr:nth-child(n) { animation-delay: calc(var(--row, 0) * 30ms); }
.table tbody tr:hover td { background: rgba(124, 92, 255, .09); border-color: rgba(124, 92, 255, .25); }
.table.compact td { padding: .55rem .8rem; }
.row-link { cursor: pointer; }
.who { display: inline-flex; align-items: center; gap: .6rem; }

/* ---------- Pills / status ---------- */
.pill { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .62rem; border-radius: 99px; font-size: .76rem; font-weight: 600; background: rgba(255,255,255,.07); border: 1px solid var(--border); white-space: nowrap; }
.pill.tiny { padding: .05rem .45rem; font-size: .66rem; margin-left: .35rem; }
.pill.v1, .pill.v2, .pill.v3, .pill.v4 { background: rgba(var(--tone), .14); border-color: rgba(var(--tone), .35); color: rgb(var(--tone)); }
.pill.love { background: rgba(255, 61, 139, .14); border-color: rgba(255, 61, 139, .35); color: #ff7aac; }
.pill.ok { background: rgba(46, 230, 166, .12); border-color: rgba(46, 230, 166, .35); color: var(--ok); }
.pill.warn { background: rgba(255, 181, 71, .12); border-color: rgba(255, 181, 71, .35); color: var(--warn); }
.pill.info { background: rgba(0, 229, 255, .1); border-color: rgba(0, 229, 255, .3); color: var(--a2); }
.pill.muted, .pill.off { color: var(--muted); }
.pill.glassy { background: rgba(0,0,0,.45); backdrop-filter: blur(8px); border-color: rgba(255,255,255,.18); color: #fff; }
.status { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status.on::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(46, 230, 166, .15), 0 0 10px var(--ok); animation: blink 2.4s ease-in-out infinite; }
.status.off { color: var(--muted); } .status.off::before { background: var(--muted); }
@keyframes blink { 50% { opacity: .45; } }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-size: .9rem; }
.alert .i { margin-top: 2px; }
.alert.err { background: rgba(255, 77, 109, .1); border-color: rgba(255, 77, 109, .35); color: #ffb3c1; }
.alert.warn { background: rgba(255, 181, 71, .08); border-color: rgba(255, 181, 71, .35); color: #ffd79c; }
.alert.info { background: rgba(0, 229, 255, .07); border-color: rgba(0, 229, 255, .3); color: #a9f4ff; }
.alert ul { margin: 0; padding-left: 1rem; }
.empty-hide.validation-summary-valid { display: none; }
.field-error { color: var(--err); font-size: .8rem; display: block; margin: -.5rem 0 .6rem .2rem; }
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: grid; gap: .6rem; z-index: 1000; max-width: min(420px, calc(100vw - 2.4rem)); }
.toast { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; background: rgba(18, 17, 34, .92); backdrop-filter: blur(16px); border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: toast-in .55s var(--spring) both; font-size: .9rem; }
.toast.ok .i { color: var(--ok); } .toast.err .i { color: var(--err); }
.toast.ok { border-color: rgba(46, 230, 166, .35); } .toast.err { border-color: rgba(255, 77, 109, .35); }
.toast.out { animation: toast-out .4s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px) scale(.95); } }

/* ---------- Empty states ---------- */
.empty-state { display: grid; justify-items: center; gap: .6rem; text-align: center; padding: 2rem 1rem; }
.empty-state.big { padding: 5rem 1rem; }
.empty-state h1, .empty-state h2 { margin-top: .4rem; }
.empty-state .btn { margin-top: .8rem; }
.empty-glyph { width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; background: rgba(124, 92, 255, .14); color: var(--a1); box-shadow: inset 0 0 0 1px rgba(124, 92, 255, .4), 0 0 50px -10px var(--a1); animation: float 4s ease-in-out infinite; }
.empty-glyph .i { width: 32px; height: 32px; }
.empty-glyph.danger { background: rgba(255, 77, 109, .12); color: var(--err); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, .4), 0 0 50px -10px var(--err); }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Forms ---------- */
.field { position: relative; display: block; margin-bottom: 1rem; }
.field input, .field textarea, .select {
    width: 100%; padding: 1.35rem .95rem .55rem; border-radius: 13px; border: 1px solid var(--border-2); background: rgba(5, 5, 14, .55);
    color: var(--text); font: 500 .95rem var(--font); outline: none; resize: vertical; transition: border-color .25s, box-shadow .25s, background .25s;
}
.field > span { position: absolute; left: .95rem; top: 1rem; color: var(--muted); pointer-events: none; font-size: .95rem; transition: all .22s var(--ease); }
.field input:focus, .field textarea:focus, .select:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18), 0 0 30px -10px var(--a1); background: rgba(10, 9, 24, .8); }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span { top: .42rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--a2); }
.field.prefix { display: flex; align-items: stretch; }
.field.prefix em { display: flex; align-items: center; padding: 1.35rem .2rem .55rem .95rem; border: 1px solid var(--border-2); border-right: 0; border-radius: 13px 0 0 13px; background: rgba(255,255,255,.04); color: var(--muted); font: .82rem var(--mono); font-style: normal; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.field.prefix input { border-radius: 0 13px 13px 0; }
.field.prefix > span { left: auto; right: .95rem; }
.select { padding: .62rem 2.2rem .62rem .9rem; appearance: none; cursor: pointer; width: auto; min-width: 180px; font-size: .88rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239896b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; background-size: 16px; }
.select option { background: var(--bg-2); }
.search { display: inline-flex; align-items: center; gap: .5rem; padding: 0 .8rem; border-radius: 12px; border: 1px solid var(--border-2); background: rgba(5, 5, 14, .55); transition: border-color .25s, box-shadow .25s; }
.search:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .15); }
.search .i { color: var(--muted); }
.search input { border: 0; outline: 0; background: transparent; color: var(--text); padding: .62rem 0; font: .88rem var(--font); width: 200px; }
.check { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; margin: .2rem 0 1.2rem; color: var(--muted); font-size: .9rem; }
.check input { position: absolute; opacity: 0; }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 1px solid var(--border-2); display: grid; place-items: center; transition: all .25s var(--spring); }
.check-box .i { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: all .25s var(--spring); stroke-width: 3; }
.check input:checked + .check-box { background: var(--grad); border-color: transparent; box-shadow: var(--glow); }
.check input:checked + .check-box .i { opacity: 1; transform: none; color: #fff; }
.switch { display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; margin: .3rem 0 1rem; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch-track { width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid var(--border-2); position: relative; transition: background .3s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.switch input:checked + .switch-track { background: var(--grad); border-color: transparent; box-shadow: var(--glow); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--a2); outline-offset: 2px; }
.segmented { display: flex; padding: 4px; border-radius: 13px; background: rgba(255,255,255,.05); border: 1px solid var(--border); margin-bottom: 1rem; gap: 4px; }
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: .55rem .6rem; border-radius: 10px; font-size: .84rem; font-weight: 600; color: var(--muted); transition: all .3s var(--ease); }
.segmented input:checked + span { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.segmented input:disabled + span { opacity: .5; cursor: not-allowed; }

/* ---------- Modals ---------- */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: min(460px, calc(100vw - 2rem)); width: 100%; overflow: visible; }
.modal::backdrop { background: rgba(3, 3, 10, .6); backdrop-filter: blur(6px); animation: fade .3s ease both; }
.modal[open] .modal-card { animation: pop .45s var(--spring) both; }
.modal.closing .modal-card { animation: pop-out .25s var(--ease) forwards; }
.modal.closing::backdrop { animation: fade .25s ease reverse forwards; }
.modal-card { position: relative; display: block; padding: 1.6rem; border-radius: 22px; background: linear-gradient(180deg, rgba(26, 24, 50, .96), rgba(14, 13, 30, .96)); border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 80px -30px var(--a1); }
.modal-card h3 { margin-bottom: 1.1rem; padding-right: 2rem; }
.modal-x { position: absolute; top: .9rem; right: .9rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.modal-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 1rem; }
.modal-icon.danger { background: rgba(255, 77, 109, .14); color: var(--err); box-shadow: inset 0 0 0 1px rgba(255, 77, 109, .4); }
.confirm-modal h3 { margin-bottom: .4rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.92); } }
@keyframes pop-out { to { opacity: 0; transform: translateY(10px) scale(.95); } }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; position: relative; overflow: hidden; }
.login-orbit { position: absolute; width: 720px; height: 720px; pointer-events: none; }
.login-orbit i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(124, 92, 255, .18); animation: orbit 30s linear infinite; }
.login-orbit i::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--a2); box-shadow: 0 0 20px 4px var(--a2); }
.login-orbit i:nth-child(2) { inset: 90px; animation-duration: 22s; animation-direction: reverse; border-color: rgba(0, 229, 255, .14); }
.login-orbit i:nth-child(2)::before { background: var(--a3); box-shadow: 0 0 20px 4px var(--a3); }
.login-orbit i:nth-child(3) { inset: 180px; animation-duration: 16s; border-style: dashed; }
@keyframes orbit { to { transform: rotate(360deg); } }
.login-card { position: relative; width: min(410px, 100%); padding: 2.4rem 2rem 2rem; border-radius: 26px; background: rgba(16, 15, 34, .72); border: 1px solid var(--border-2); backdrop-filter: blur(24px); box-shadow: var(--shadow), 0 0 120px -40px var(--a1); animation: pop .7s var(--spring) both; }
.login-logo { display: grid; place-items: center; margin-bottom: 1.2rem; }
.login-title { margin-top: .4rem; }
.login-title { text-align: center; font-size: 1.8rem; }
.login-card .muted.center { margin-bottom: 1.6rem; }
body.bare .main, body.bare > main { padding: 0; }

/* ---------- Cards grid ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
.icard { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; border: 1px solid var(--border); isolation: isolate; transition: transform .45s var(--ease), box-shadow .45s, border-color .45s; }
.icard:hover { transform: translateY(-6px) rotate(-.4deg); border-color: rgba(124, 92, 255, .55); box-shadow: 0 24px 50px -18px rgba(124, 92, 255, .6); }
.icard.inactive { filter: grayscale(.8) brightness(.7); }
.icard-media, .icard-media img, .icard-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icard-media img { transition: transform 1.2s var(--ease); }
.icard:hover .icard-media img { transform: scale(1.08); }
.icard-placeholder { display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, hsl(var(--hue) 90% 60% / .9), transparent 60%), linear-gradient(160deg, hsl(calc(var(--hue) + 60) 80% 30%), hsl(calc(var(--hue) + 140) 70% 12%)); color: rgba(255,255,255,.7); }
.icard-placeholder .i { width: 40px; height: 40px; }
.icard-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(4, 4, 12, .92)); z-index: 1; }
.icard-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem; z-index: 2; }
.icard-body h3 { font-size: 1.25rem; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.tags span { font-size: .72rem; color: rgba(255,255,255,.75); }
.icard-meta { position: absolute; top: .7rem; right: .7rem; z-index: 2; display: flex; gap: .35rem; }

/* ---------- Card editor ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; align-items: start; }
.editor-side { position: sticky; top: 1.5rem; }
.preview-card { position: relative; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 60px -20px var(--a1); }
.preview-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.1s ease, transform 6s linear; }
.preview-card img.on { opacity: 1; transform: scale(1.14); }
.preview-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem; z-index: 2; }
.preview-body h3 { font-size: 1.5rem; }
.preview-body p { color: rgba(255,255,255,.75); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; padding: .55rem .7rem; border-radius: 13px; border: 1px solid var(--border-2); background: rgba(5, 5, 14, .55); margin-bottom: 1rem; transition: border-color .25s, box-shadow .25s; }
.tag-input:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
.tag-list { display: contents; }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .35rem .25rem .65rem; border-radius: 99px; background: rgba(124, 92, 255, .2); border: 1px solid rgba(124, 92, 255, .4); font-size: .8rem; animation: pop .35s var(--spring) both; }
.tag button { border: 0; background: rgba(255,255,255,.1); color: inherit; width: 18px; height: 18px; border-radius: 50%; cursor: pointer; font-size: .7rem; line-height: 1; }
.tag button:hover { background: var(--err); }
.tag-entry { flex: 1; min-width: 140px; border: 0; outline: 0; background: transparent; color: var(--text); font: .92rem var(--font); padding: .4rem 0; }
.dropzone { position: relative; display: grid; justify-items: center; gap: .35rem; text-align: center; padding: 1.6rem 1rem; margin-bottom: 1.2rem; border-radius: 16px; border: 1.5px dashed rgba(124, 92, 255, .45); background: rgba(124, 92, 255, .05); color: var(--muted); cursor: pointer; transition: all .3s var(--ease); }
.dropzone b { color: var(--text); }
.dropzone .i.lg { color: var(--a1); }
.dropzone:hover, .dropzone.over { border-color: var(--a2); background: rgba(0, 229, 255, .06); transform: scale(1.01); box-shadow: 0 0 40px -14px var(--a2); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.compact { aspect-ratio: 4 / 3; margin: 0; align-content: center; }
.drop-previews { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.drop-previews img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; animation: pop .4s var(--spring) both; }
.dropzone.busy::after { content: "Optimizing & uploading…"; position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: rgba(5, 5, 14, .8); color: var(--a2); font-weight: 600; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-item { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); animation: rise .5s var(--ease) both; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item figcaption { position: absolute; left: .4rem; right: .4rem; bottom: .4rem; display: flex; justify-content: center; gap: .2rem; padding: .25rem; border-radius: 12px; background: rgba(5, 5, 14, .7); backdrop-filter: blur(10px); opacity: 0; transform: translateY(8px); transition: all .3s var(--ease); }
.gallery-item:hover figcaption, .gallery-item:focus-within figcaption { opacity: 1; transform: none; }
.gallery-item figcaption form { margin: 0; }
.gallery-item .icon-btn { color: #fff; width: 32px; height: 32px; }
.cover-badge { position: absolute; top: .5rem; left: .5rem; }

/* ---------- Surveys ---------- */
.survey-list { display: grid; gap: 1rem; }
.survey-row { display: flex; gap: 1.2rem; align-items: center; justify-content: space-between; margin: 0; transition: transform .35s var(--ease), border-color .35s; }
.survey-row:hover { transform: translateY(-3px); border-color: var(--border-2); }
.survey-main { min-width: 0; flex: 1; display: grid; gap: .5rem; }
.survey-main h2 { font-size: 1.25rem; }
.survey-side { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; }
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(46, 230, 166, .15), 0 0 14px var(--ok); animation: blink 2s infinite; }
.live-dot.off { background: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.link-box { display: flex; align-items: center; gap: .4rem; padding: .3rem .3rem .3rem .8rem; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--border); max-width: 100%; }
.link-box > .i { color: var(--a2); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c8f8ff; }
.stat-bubble { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; text-align: center; line-height: 1.1;
    background: radial-gradient(circle at 30% 25%, rgba(124, 92, 255, .4), rgba(0, 229, 255, .08)); border: 1px solid rgba(124, 92, 255, .4); transition: transform .4s var(--spring), box-shadow .4s; }
.stat-bubble:hover { transform: scale(1.07); box-shadow: 0 0 40px -6px var(--a1); }
.stat-bubble b { font: 700 1.6rem var(--display); display: block; }
.stat-bubble small { color: var(--muted); font-size: .7rem; }
.link-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: linear-gradient(120deg, rgba(124, 92, 255, .16), rgba(0, 229, 255, .08)); }
.big-link { font-size: 1rem; color: #c8f8ff; word-break: break-all; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: .6rem; border-radius: 9px; background: var(--grad); color: #fff; font-size: .8rem; box-shadow: var(--glow); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.option-tile { cursor: pointer; }
.option-tile input { position: absolute; opacity: 0; }
.option-tile > span { position: relative; display: grid; gap: .15rem; padding: 1rem 1rem 1rem 3.2rem; border-radius: 16px; border: 1px solid var(--border-2); background: rgba(255,255,255,.03); transition: all .35s var(--ease); height: 100%; }
.option-tile .i { position: absolute; left: 1rem; top: 1.05rem; color: var(--muted); transition: color .3s; }
.option-tile small { color: var(--muted); font-size: .78rem; }
.option-tile > span::after { content: ""; position: absolute; top: .8rem; right: .8rem; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-2); transition: all .3s var(--spring); }
.option-tile:hover > span { border-color: rgba(124, 92, 255, .5); transform: translateY(-2px); }
.option-tile input:checked + span { border-color: transparent; background: linear-gradient(140deg, rgba(124, 92, 255, .25), rgba(0, 229, 255, .08)); box-shadow: var(--glow); }
.option-tile input:checked + span .i { color: var(--a2); }
.option-tile input:checked + span::after { background: var(--a2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305050b' stroke-width='3.5'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--a2); box-shadow: 0 0 12px var(--a2); }
.option-tile input:focus-visible + span { outline: 2px solid var(--a2); outline-offset: 2px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.pick { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: transform .35s var(--spring), border-color .3s, box-shadow .3s; isolation: isolate; }
.pick input { position: absolute; opacity: 0; }
.pick img, .pick .icard-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .4s; filter: saturate(.6) brightness(.7); }
.pick-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(4, 4, 12, .9)); z-index: 1; }
.pick-title { position: absolute; left: .7rem; right: .7rem; bottom: .6rem; z-index: 2; font: 600 .95rem var(--display); }
.pick-title small { color: var(--muted); font-weight: 400; }
.pick-badge { position: absolute; top: .55rem; right: .55rem; z-index: 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 .8rem var(--display); border: 1.5px solid rgba(255,255,255,.4); background: rgba(0,0,0,.35); backdrop-filter: blur(6px); transition: all .35s var(--spring); }
.pick:hover { transform: translateY(-3px); }
.pick:hover img { transform: scale(1.08); filter: saturate(.9) brightness(.85); }
.pick.on { border-color: var(--a2); box-shadow: 0 0 0 4px rgba(0, 229, 255, .15), 0 14px 34px -12px var(--a2); }
.pick.on img, .pick.on .icard-placeholder { filter: none; }
.pick.on .pick-badge { background: var(--grad); border-color: transparent; transform: scale(1.1); box-shadow: var(--glow); }
.pick.inactive { opacity: .55; }
.pick.bump .pick-badge { animation: bump .45s var(--spring); }
@keyframes bump { 50% { transform: scale(1.45); } }
.save-bar { position: sticky; bottom: 1rem; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem; border-radius: 18px; background: rgba(14, 13, 30, .85); border: 1px solid var(--border-2); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
[data-search].hidden { display: none; }

/* ---------- Responses ---------- */
.filters { align-items: center; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1rem; flex-wrap: wrap; }
.profile { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.facts { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .9rem 1.4rem; margin: 0; }
.facts dt { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: .15rem 0 0; font-weight: 500; word-break: break-word; }
.facts .wide { grid-column: 1 / -1; }
.card-journey { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.journey-item { padding: .85rem 1rem; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-left: 3px solid var(--muted); animation: rise .5s var(--ease) both; transition: transform .3s var(--ease), background .3s; }
.journey-item:hover { transform: translateX(4px); background: rgba(255,255,255,.05); }
.journey-item.ok { border-left-color: var(--a3); } .journey-item.warn { border-left-color: var(--warn); } .journey-item.info { border-left-color: var(--a2); }
.journey-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.journey-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.06); margin: .6rem 0 .45rem; overflow: hidden; }
.journey-bar span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--grad); transform-origin: left; animation: grow-x 1s var(--ease) both; }
.journey-meta { display: flex; gap: 1rem; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 .3rem; position: relative; max-height: 640px; overflow-y: auto; }
.timeline::before { content: ""; position: absolute; left: 1.15rem; top: .5rem; bottom: .5rem; width: 2px; background: linear-gradient(180deg, var(--a1), var(--a2), transparent); opacity: .5; }
.tl-item { position: relative; display: flex; gap: .8rem; padding: .45rem 0; animation: rise .45s var(--ease) both; }
.tl-dot { position: relative; z-index: 1; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--border-2); color: var(--muted); }
.tl-dot .i { width: 15px; height: 15px; }
.tl-heart .tl-dot { color: var(--a3); border-color: rgba(255, 61, 139, .5); box-shadow: 0 0 14px -2px var(--a3); }
.tl-heart .tl-dot .i { fill: currentColor; }
.tl-heart-off .tl-dot { color: var(--warn); }
.tl-eye .tl-dot { color: var(--a2); }
.tl-send .tl-dot, .tl-play .tl-dot { color: var(--ok); border-color: rgba(46, 230, 166, .5); }
.role-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.legend-item { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.explainer { display: flex; gap: 1.1rem; align-items: flex-start; }
.explainer-icon { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(0, 229, 255, .12); color: var(--a2); box-shadow: inset 0 0 0 1px rgba(0, 229, 255, .35), 0 0 40px -10px var(--a2); }
.explainer-icon .i { width: 26px; height: 26px; }
.explainer h2 { margin-bottom: .3rem; }
.sync-box h2 { margin-bottom: .3rem; }
.sync-box .segmented { margin-top: 1rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .split, .split.wide-left, .editor { grid-template-columns: 1fr; }
    .editor-side { position: static; max-width: 340px; }
}
@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .45s var(--ease); box-shadow: var(--shadow); }
    .sidebar.open { transform: none; }
    .icon-btn.menu-toggle { display: inline-grid; position: fixed; top: .8rem; left: .8rem; z-index: 30; background: rgba(14, 13, 30, .85); border: 1px solid var(--border-2); backdrop-filter: blur(10px); }
    .main { padding-top: 4rem; }
    .survey-row { flex-direction: column; align-items: stretch; }
    .survey-side { flex-direction: row; justify-content: space-between; }
    .kpis.three { grid-template-columns: 1fr; }
    .search input { width: 140px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } .kpi-value { font-size: 1.6rem; } }

/* ---------- Layout picker ---------- */
.layout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .9rem; }
.layout-tile { cursor: pointer; }
.layout-tile input { position: absolute; opacity: 0; }
.layout-tile > span { display: grid; gap: .2rem; padding: 1rem; border-radius: 18px; border: 1px solid var(--border-2); background: rgba(255,255,255,.03); height: 100%; transition: all .35s var(--ease); }
.layout-tile small { color: var(--muted); font-size: .78rem; }
.layout-tile:hover > span { transform: translateY(-3px); border-color: rgba(124, 92, 255, .5); }
.layout-tile input:checked + span { border-color: transparent; background: linear-gradient(140deg, rgba(124, 92, 255, .25), rgba(0, 229, 255, .08)); box-shadow: var(--glow); }
.layout-tile input:focus-visible + span { outline: 2px solid var(--a2); outline-offset: 2px; }
.layout-art { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 5px; height: 92px; margin-bottom: .6rem; border-radius: 12px; background: rgba(0,0,0,.3); padding: 8px; }
.layout-art i { display: block; background: linear-gradient(140deg, var(--a1), var(--a2)); opacity: .85; transition: transform .4s var(--spring); }
.layout-tile:hover .layout-art i:nth-child(odd) { transform: translateY(-3px); }
.layout-art.classic i { width: 26px; height: 34px; border-radius: 6px; }
.layout-art.honeycomb { background: #eef2f8; gap: 3px 4px; padding: 6px 30px; }
.layout-art.honeycomb i { width: 26px; height: 30px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(#7fb0ff, #3a5a8a); opacity: 1; }
.layout-art.honeycomb i:nth-child(2) { background: linear-gradient(#2470ff, #2470ff); }
.layout-art.orbs { background: radial-gradient(circle at 30% 30%, #5a3a3a, #141110 70%); gap: 2px 5px; padding: 8px 40px; }
.layout-art.orbs i { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.55), rgba(140,120,130,.5) 45%, rgba(40,30,30,.8)); box-shadow: 0 0 0 1px rgba(255,255,255,.2); opacity: 1; }
.layout-art.orbs i:nth-child(1) { margin: 0 14px; } .layout-art.orbs i:nth-child(n+4) { margin-top: -4px; }
.layout-art.clean { background: #eef2f8; gap: 6px; }
.layout-art.clean i { width: 30px; height: 34px; border-radius: 6px; background: linear-gradient(#7fb0ff 0 62%, #fff 62%); box-shadow: 0 1px 3px rgba(0,0,0,.25); opacity: 1; }
.layout-art.clean i:nth-child(2) { box-shadow: 0 0 0 2px #2470ff; }
.layout-art.bubbles { background: radial-gradient(circle at 50% 50%, #fde7f1, #e9ebf3 70%); gap: 0; padding: 6px 30px; }
.layout-art.bubbles i { border-radius: 50%; width: 30px; height: 30px; margin: -2px; background: radial-gradient(circle at 32% 25%, #fff, #e3e6ef 75%); box-shadow: 0 4px 8px -4px rgba(90,100,140,.5); opacity: 1; }
.layout-art.bubbles i:nth-child(2) { width: 38px; height: 38px; box-shadow: 0 0 0 1.5px #e8327c; }
.layout-art.bubbles i:nth-child(4) { width: 24px; height: 24px; }
.layout-art.chips { background: radial-gradient(circle at 25% 40%, rgba(80,170,90,.5), transparent 60%), radial-gradient(circle at 85% 70%, rgba(150,60,220,.6), transparent 60%), #232325; gap: 4px; padding: 10px 20px; }
.layout-art.chips i { width: 40px; height: 14px; border-radius: 99px; background: rgba(255,255,255,.18); opacity: 1; transform: rotate(-6deg); }
.layout-art.chips i:nth-child(2) { background: #6aa66f; border-radius: 3px; transform: rotate(8deg); }
.layout-art.chips i:nth-child(3) { background: #b06bf7; width: 26px; height: 20px; border-radius: 7px; }
.layout-art.chips i:nth-child(5) { background: #f0479b; width: 22px; height: 22px; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }

/* ---------- Password generator / change-password card ---------- */
.field-with-action { display: flex; gap: .5rem; align-items: flex-start; }
.field-with-action .field { flex: 1; }
.field-with-action .btn { margin-top: .55rem; }
.login-card.inline-card { margin: 2rem auto; }
.me .icon-btn { width: 32px; height: 32px; }

/* ---------- Live dashboard ---------- */
.live-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    color: var(--ok); background: rgba(46, 230, 166, .08); border: 1px solid rgba(46, 230, 166, .3); }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(46, 230, 166, .6); animation: live-ping 1.8s ease-out infinite; }
.live-badge.off { color: var(--warn); background: rgba(255, 181, 71, .08); border-color: rgba(255, 181, 71, .3); }
.live-badge.off i { background: var(--warn); animation: none; }
@keyframes live-ping { 0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, .6); } 100% { box-shadow: 0 0 0 9px rgba(46, 230, 166, 0); } }
.no-reveal .reveal, .no-reveal .table tbody tr, .no-reveal .bar-fill, .no-reveal .hbar { animation: none; }
.kpi.bumped { animation: kpi-bump .9s var(--ease); }
@keyframes kpi-bump { 30% { border-color: rgba(0, 229, 255, .6); box-shadow: 0 0 40px -10px var(--a2); transform: translateY(-4px); } }
.table tbody tr.fresh td { animation: fresh-row 2.4s var(--ease); }
@keyframes fresh-row { 0%, 40% { background: rgba(46, 230, 166, .18); border-color: rgba(46, 230, 166, .45); } }

.segmented.narrow { max-width: 320px; }
.panel-head.layout-sub { margin-top: 1.4rem; }

/* ---------- Engagement chart pop-up ---------- */
.modal.wide { max-width: min(820px, calc(100vw - 2rem)); }
.modal.wide .modal-card { max-height: calc(100vh - 3rem); display: flex; flex-direction: column; }
.chart-legend { margin: -.4rem 0 1rem; flex-wrap: wrap; }
.lg.seenonly::before { background: rgba(255, 255, 255, .22); }
.lg.unseen::before { background: transparent; border: 1px dashed var(--muted); }
.engagement-chart { list-style: none; margin: 0; padding: 0 .3rem 0 0; display: grid; gap: .85rem; overflow-y: auto; }
.ec-label { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: .3rem; font-size: .88rem; }
.ec-track { position: relative; height: 14px; border-radius: 99px; background: rgba(255,255,255,.05); overflow: hidden; }
.ec-bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 99px; transform-origin: left; }
.modal[open] .ec-bar { animation: grow-x .9s var(--ease) both; }
.ec-bar.seen { background: rgba(255, 255, 255, .14); }
.ec-bar.views { background: rgba(0, 229, 255, .45); animation-delay: .1s; }
.ec-bar.fav { background: linear-gradient(90deg, var(--a1), var(--a3)); box-shadow: 0 0 14px -2px var(--a3); animation-delay: .2s; }
.ec-bar.drop { background: var(--warn); top: auto; height: 4px; animation-delay: .3s; }

/* ---------- Response details: order strip, display-order badges, story timeline ---------- */
.order-strip { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.os-item { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .3rem; border-radius: 99px; font-size: .8rem;
    border: 1px solid var(--border); background: rgba(255,255,255,.04); animation: rise .4s var(--ease) both; }
.os-pos { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 99px; font: 700 .7rem var(--display); background: rgba(255,255,255,.1); }
.os-fav { border-color: rgba(255, 61, 139, .55); background: rgba(255, 61, 139, .14); }
.os-fav .os-pos { background: linear-gradient(135deg, var(--a1), var(--a3)); color: #fff; }
.os-opened { border-color: rgba(0, 229, 255, .45); background: rgba(0, 229, 255, .08); }
.os-drop { border-color: rgba(255, 181, 71, .5); background: rgba(255, 181, 71, .1); }
.os-seen { color: var(--text); }
.os-unseen { opacity: .45; border-style: dashed; }
.pos-badge { display: inline-block; margin-right: .45rem; padding: .05rem .4rem; border-radius: 6px; font: 700 .72rem var(--display); color: var(--muted); background: rgba(255,255,255,.07); }
.journey-item.unseen { opacity: .55; }
.story { list-style: none; margin: 0; padding: 0; position: relative; max-height: 720px; overflow-y: auto; }
.story::before { content: ""; position: absolute; left: 71px; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(180deg, var(--a1), var(--a2), transparent); opacity: .45; }
.story-step { display: grid; grid-template-columns: 52px 38px 1fr; align-items: start; gap: .3rem; padding: .45rem 0; animation: rise .45s var(--ease) both; }
.story-time { padding-top: .5rem; font-size: .76rem; color: var(--muted); text-align: right; }
.story-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--border-2); color: var(--muted); }
.story-dot .i { width: 15px; height: 15px; }
.story-body { padding-top: .35rem; font-size: .9rem; }
.story-body b { font-weight: 600; }
.tone-ok .story-dot { color: var(--a3); border-color: rgba(255, 61, 139, .5); box-shadow: 0 0 14px -2px var(--a3); }
.tone-ok .story-dot .i { fill: currentColor; }
.tone-info .story-dot { color: var(--a2); border-color: rgba(0, 229, 255, .45); }
.tone-warn .story-dot { color: var(--warn); border-color: rgba(255, 181, 71, .5); }
.raw-events { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.raw-events summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.raw-events .timeline { margin-top: .8rem; max-height: 420px; }

/* ---------- Survey QR code ---------- */
.qr-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.qr-panel { display: flex; gap: 1.3rem; align-items: center; flex-wrap: wrap; }
.qr-frame { flex: none; padding: 12px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px var(--border-2), 0 18px 40px -16px rgba(0, 229, 255, .45); }
.qr-frame img { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.qr-info { flex: 1; min-width: 220px; display: grid; gap: .5rem; }
.qr-info code { word-break: break-all; color: #c8f8ff; }
@media (max-width: 1100px) { .qr-split { grid-template-columns: 1fr; } }

/* ---------- Column info tooltips ---------- */
.th-info { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.info-tip { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; cursor: help; flex: none;
    font: 700 .62rem/1 var(--display); font-style: italic; letter-spacing: 0; text-transform: none; color: var(--a2);
    border: 1px solid rgba(0, 229, 255, .5); background: rgba(0, 229, 255, .08); transition: background .2s, transform .2s var(--spring); }
.info-tip:hover, .info-tip:focus-visible, .info-tip.on { background: rgba(0, 229, 255, .25); transform: scale(1.12); outline: none; }
.tip-pop { position: fixed; z-index: 2000; max-width: min(360px, calc(100vw - 24px)); padding: .8rem .95rem; border-radius: 12px;
    font: 400 .82rem/1.5 var(--font); letter-spacing: 0; text-transform: none; color: var(--text); white-space: pre-line;
    background: rgba(18, 17, 36, .97); border: 1px solid var(--border-2); box-shadow: var(--shadow), 0 0 40px -16px var(--a2);
    pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.tip-pop.show { opacity: 1; transform: none; }
.tip-pop b { color: var(--a2); }
.table-note { margin: .7rem .2rem 0; }

/* ---------- Answer levels (3 This is me · 2 Passionate · 1 Hobby · 0 Not for me) ---------- */
.rx-identity { --rx: #a78bff; --rx2: #00c8ff; }
.rx-care { --rx: #ff3d8b; --rx2: #ff7aa8; }
.rx-fun { --rx: #ffb547; --rx2: #ff7a3d; }
.rx-not_for_me { --rx: #94a3b8; --rx2: #64748b; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Respondents / Card insights tabs */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: -.6rem 0 1.4rem; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; border-radius: 10px; font-weight: 600; font-size: .88rem; color: var(--muted); white-space: nowrap; transition: color .2s, background .25s; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab.on { color: #fff; background: var(--grad); box-shadow: var(--glow); }

/* Answer counts per respondent (clickable) */
.react-sum { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; border: 1px solid var(--border); background: rgba(255, 255, 255, .03); color: var(--text); cursor: pointer; font: inherit;
    transition: border-color .2s, background .2s, transform .25s var(--ease); }
.react-sum:hover, .react-sum:focus-visible { border-color: var(--a1); background: rgba(124, 92, 255, .1); transform: translateY(-1px); outline: none; }
.react-sum.static { cursor: default; } .react-sum.static:hover { transform: none; border-color: var(--border); background: rgba(255, 255, 255, .03); }
.rs { display: inline-flex; align-items: center; gap: 3px; min-width: 34px; padding: .18rem .42rem; border-radius: 8px; font: 700 .78rem var(--display);
    color: var(--rx, #ff7aac); background: color-mix(in srgb, var(--rx, #ff3d8b) 14%, transparent); }
.rs .i { width: 13px; height: 13px; vertical-align: 0; }
.rs.zero { opacity: .35; }
.rs.legacy { --rx: #ff3d8b; }
.rx-cell { min-width: 230px; }
.rx-nums { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.rx-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.rx-bar span { width: var(--w); background: linear-gradient(90deg, var(--rx), var(--rx2)); animation: grow-x .9s var(--ease) both; transform-origin: left; }
.rx-bar span + span { box-shadow: -1px 0 0 rgba(0, 0, 0, .4); }
.legend .lg.rx-identity::before, .legend .lg.rx-care::before, .legend .lg.rx-fun::before, .legend .lg.rx-not_for_me::before { background: linear-gradient(135deg, var(--rx), var(--rx2)); }
.rx-pill { color: var(--rx); background: color-mix(in srgb, var(--rx) 14%, transparent); border-color: color-mix(in srgb, var(--rx) 40%, transparent); }
.rx-pill .i { width: 13px; height: 13px; }
.os-rx { border-color: color-mix(in srgb, var(--rx) 55%, transparent); background: color-mix(in srgb, var(--rx) 14%, transparent); }
.os-rx .os-pos { background: linear-gradient(135deg, var(--rx), var(--rx2)); color: #fff; }

/* Row moderation */
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions form { display: contents; }
.icon-btn.warn:hover { color: var(--warn); background: rgba(255, 181, 71, .12); }
.icon-btn.has-note { color: var(--a2); background: rgba(0, 229, 255, .1); border-color: rgba(0, 229, 255, .3); }
.table .row-invalid td { opacity: .5; }
.table .row-invalid td:first-child, .table .row-invalid td.actions-col { opacity: 1; }
.table .row-invalid .who { text-decoration: line-through; text-decoration-color: rgba(255, 181, 71, .6); }

/* Answers pop-up */
.rm-body { overflow-y: auto; display: grid; gap: .9rem; padding-right: 2px; }
.rm-body > .alert { margin: 0; }
.rm-group { padding: .85rem 1rem; border-radius: 16px; background: color-mix(in srgb, var(--rx, #ff3d8b) 7%, rgba(255, 255, 255, .02)); border: 1px solid color-mix(in srgb, var(--rx, #ff3d8b) 30%, transparent); }
.rm-group header { display: flex; align-items: center; gap: .6rem; }
.rm-group header em { margin-left: auto; font: 700 1.1rem var(--display); font-style: normal; color: var(--rx, #ff7aac); }
.rx-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--rx, #ff3d8b), var(--rx2, #7c5cff)); box-shadow: 0 6px 16px -6px var(--rx, #ff3d8b); }
.rx-dot .i { width: 16px; height: 16px; }
.rm-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.rm-chips span { padding: .28rem .7rem; border-radius: 99px; font-size: .84rem; background: rgba(255, 255, 255, .06); border: 1px solid var(--border); }
.rm-chips span.top { color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--rx), var(--rx2)); border-color: transparent; }
.rm-chips .chg { font-style: normal; color: var(--warn); margin-left: .2rem; }
.rm-unanswered summary { cursor: pointer; color: var(--muted); font-size: .88rem; }
.rm-box { padding: .85rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--border); }
.rm-box.note { border-color: rgba(0, 229, 255, .3); background: rgba(0, 229, 255, .05); }
.rm-box .eyebrow { margin: 0 0 .3rem; }
.quote { font-style: italic; color: var(--text); margin: 0; }
.note-text { white-space: pre-line; margin: 0 0 .3rem; }
.note-panel { display: flex; gap: .9rem; align-items: flex-start; border-color: rgba(0, 229, 255, .3); }
.note-panel > .i { color: var(--a2); width: 22px; height: 22px; margin-top: .2rem; }
.note-panel .eyebrow { margin: 0 0 .3rem; }
.modal .field textarea { min-height: 120px; }

/* Engagement line chart */
.line-chart { position: relative; min-height: 380px; }
.lc-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 .8rem; }
.lc-key { display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .7rem; border-radius: 99px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--text); font: 600 .78rem var(--font); cursor: pointer; transition: opacity .2s, border-color .2s, background .2s; }
.lc-key i { width: 18px; height: 3px; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px var(--c); }
.lc-key[aria-pressed="true"] { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.lc-key[aria-pressed="false"] { opacity: .45; }
.lc-key[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1px var(--c); }
.lc-scroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 12px; background: rgba(255, 255, 255, .02); }
.lc-scroll svg { display: block; touch-action: pan-x pan-y; }
.lc-grid { stroke: rgba(255, 255, 255, .07); }
.lc-y { fill: var(--muted); font: 500 11px var(--font); text-anchor: end; }
.lc-x { fill: var(--muted); font: 500 11px var(--font); text-anchor: end; }
.lc-cursor { stroke: rgba(255, 255, 255, .35); stroke-dasharray: 3 4; }
.lc-line { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 60%, transparent)); }
.lc-line.draw { animation: lc-draw 1.1s var(--ease) forwards; }
@keyframes lc-draw { to { stroke-dashoffset: 0; } }
.lc-pt { fill: #0e0d1e; stroke: var(--c); stroke-width: 2; }
.lc-tip { position: absolute; z-index: 3; min-width: 190px; padding: .65rem .8rem; border-radius: 12px; pointer-events: none; display: grid; gap: .25rem;
    background: rgba(14, 13, 30, .96); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: .8rem; }
.lc-tip[hidden] { display: none; }
.lc-tip b { font-size: .86rem; margin-bottom: .15rem; }
.lc-tip span { display: flex; align-items: center; gap: .45rem; color: var(--muted); }
.lc-tip span i { width: 10px; height: 3px; border-radius: 3px; background: var(--c); }
.lc-tip em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--text); }
/* Phones: keep the row actions in reach while the table scrolls sideways */
@media (max-width: 900px) {
    .table.respondents td.actions-col, .table.respondents th.actions-col { position: sticky; right: 0; z-index: 1; background: linear-gradient(90deg, transparent, rgba(16, 15, 34, .96) 22%); padding-left: 1.2rem; }
}

/* ---------- Insights filter bar (survey, search, submitted from/to) ---------- */
.page-head .tabs { margin: 0; }
.filter-bar { display: grid; gap: .75rem; padding: 1rem 1.1rem; margin-bottom: 1.4rem; }
.fb-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.fb-row .search { flex: 1 1 240px; }
.fb-row .select { flex: 0 1 280px; }
.fb-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-right: .2rem; }
.dt { display: inline-flex; align-items: center; gap: .45rem; padding: 0 .3rem 0 .75rem; border-radius: 12px; border: 1px solid var(--border-2); background: var(--bg); }
.dt span { font-size: .78rem; color: var(--muted); }
.dt input { border: 0; background: transparent; color: var(--text); font: 500 .86rem var(--font); padding: .55rem .3rem; color-scheme: dark; outline: none; min-width: 0; }
.dt:focus-within { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, .15); }
.presets { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-btn { padding: .42rem .75rem; border-radius: 99px; border: 1px solid var(--border); background: rgba(255, 255, 255, .04); color: var(--muted); font: 600 .78rem var(--font); cursor: pointer; transition: color .2s, background .2s, border-color .2s; }
.chip-btn:hover { color: var(--text); border-color: var(--border-2); }
.chip-btn.on { color: #fff; border-color: transparent; background: var(--grad); }
.fb-apply { margin-left: auto; }
.fb-active { margin: 0; font-size: .84rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.fb-active .link { margin-left: .4rem; }
@media (max-width: 700px) {
    .fb-row .select, .fb-row .search { flex: 1 1 100%; }
    .dt { flex: 1 1 100%; justify-content: space-between; }
    .dt input { flex: 1; }
    .fb-apply { width: 100%; justify-content: center; margin-left: 0; }
    .page-head .tabs { width: 100%; }
}

/* ---------- Per-card answer history (response details) ---------- */
.answer-history { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: .55rem 0 0; padding: 0; }
.answer-history li { display: inline-flex; align-items: center; gap: .3rem; }
.answer-history li + li::before { content: "→"; color: var(--warn); margin: 0 .2rem 0 .1rem; }
.answer-history .pill.tiny { margin-left: 0; }
.story-dot.rx-identity, .story-dot.rx-care, .story-dot.rx-fun, .story-dot.rx-not_for_me { color: #fff; background: linear-gradient(135deg, var(--rx), var(--rx2)); border-color: transparent; }

/* ---------- Engagement chart (v2) ---------- */
.lc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .3rem 0 .7rem; }
.seg-mini { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: rgba(255, 255, 255, .05); border: 1px solid var(--border); }
.seg-mini button { border: 0; background: none; color: var(--muted); font: 600 .78rem var(--font); padding: .38rem .7rem; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: color .2s, background .2s; }
.seg-mini button:hover:not(:disabled) { color: var(--text); }
.seg-mini button.on { color: #fff; background: var(--grad); }
.seg-mini button:disabled { opacity: .35; cursor: not-allowed; }
.lc-sort { display: inline-flex; align-items: center; gap: .45rem; margin-left: auto; font-size: .78rem; color: var(--muted); }
.select.sm { padding: .4rem 2rem .4rem .7rem; font-size: .8rem; }
.lc-key em { font-style: normal; font-weight: 700; color: var(--text); opacity: .75; margin-left: .15rem; }
.lc-col { fill: rgba(255, 255, 255, .025); }
.lc-band { fill: rgba(124, 92, 255, .12); }
.lc-grid.base { stroke: rgba(255, 255, 255, .22); }
.lc-axis { fill: var(--muted); font: 600 11px var(--font); text-anchor: middle; letter-spacing: .04em; }
.lc-x { fill: var(--text); opacity: .82; font: 500 11.5px var(--font); text-anchor: middle; }
.lc-line { stroke-width: 2.8; transition: opacity .2s; }
.lc-line.dim, .lc-pt.dim { opacity: .12; }
.lc-pt { transition: opacity .2s; }
.lc-area { pointer-events: none; }
.lc-val { fill: var(--c); font: 700 11px var(--display); text-anchor: middle; paint-order: stroke; stroke: #0e0d1e; stroke-width: 3px; }
.lc-tip small { color: var(--muted); font-size: .74rem; margin: -.1rem 0 .2rem; }
@media (max-width: 600px) { .lc-sort { margin-left: 0; width: 100%; } .lc-sort .select { flex: 1; } }

.rm-meaning { margin: .3rem 0 0 2.4rem; font-size: .8rem; font-style: italic; color: var(--muted); }
.legend .info-tip { align-self: center; }

/* ---------- Survey list (v2): stat tile, link row with square Edit / Duplicate buttons ---------- */
.survey-row { display: grid; gap: .8rem; align-items: stretch; }
.survey-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.survey-head { min-width: 0; display: grid; gap: .35rem; }
.survey-head h2 { font-size: 1.25rem; }
.survey-head p { margin: 0; max-width: 72ch; }
.stat-tile { position: relative; flex: none; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center;
    min-width: 168px; padding: .75rem 1rem .7rem .8rem; border-radius: 16px; color: var(--text); isolation: isolate;
    background: linear-gradient(140deg, rgba(124, 92, 255, .16), rgba(0, 229, 255, .06)); border: 1px solid rgba(124, 92, 255, .35);
    box-shadow: 0 10px 30px -18px var(--a1); transition: transform .3s var(--spring), border-color .25s, box-shadow .3s; }
.stat-tile:hover { transform: translateY(-2px); border-color: var(--a2); box-shadow: 0 14px 34px -14px var(--a2); }
.st-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: var(--grad); box-shadow: var(--glow); }
.st-text { display: flex; align-items: baseline; gap: .4rem; }
.st-text b { font: 700 1.7rem/1 var(--display); }
.st-text small { color: var(--muted); font-size: .8rem; }
.st-go { display: inline-flex; align-items: center; gap: .2rem; font-size: .74rem; font-weight: 600; color: var(--a2); }
.st-go .i { width: 13px; height: 13px; transition: transform .25s var(--ease); }
.stat-tile:hover .st-go .i { transform: translateX(3px); }
.link-row { display: flex; align-items: stretch; gap: .5rem; }
.link-row .link-box { flex: 1; min-width: 0; }
.sq-btn { flex: none; display: grid; place-items: center; width: 46px; min-height: 46px; border-radius: 12px; cursor: pointer; color: var(--muted);
    background: rgba(255, 255, 255, .04); border: 1px solid var(--border-2); transition: color .2s, background .2s, border-color .2s, transform .25s var(--spring); }
.sq-btn:hover { color: #fff; background: rgba(124, 92, 255, .2); border-color: var(--a1); transform: translateY(-1px); }
.sq-btn:focus-visible { outline: 2px solid var(--a2); outline-offset: 2px; }
.sq-btn .i { width: 19px; height: 19px; }
@media (max-width: 700px) {
    .survey-top { flex-direction: column; }
    .stat-tile { width: 100%; }
}
.survey-row { grid-template-columns: minmax(0, 1fr); justify-content: stretch; }

/* ---------- Survey links panel + "most you" threshold ---------- */
.links-panel { margin-bottom: 1.4rem; }
.links-panel .panel-head { flex-wrap: wrap; align-items: baseline; }
.links-panel .panel-head .muted { max-width: 70ch; }
.links-table td { vertical-align: middle; }
.link-box.sm { padding: .2rem .2rem .2rem .7rem; min-width: 260px; }
.link-box.sm code { font-size: .8rem; }
.row-unlisted td { opacity: .75; }
.add-link { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: .7rem; align-items: start; margin-top: 1rem; }
.add-link .field { margin: 0; }
.add-link .btn { height: 52px; }
@media (max-width: 760px) { .add-link { grid-template-columns: 1fr; } .add-link .btn { width: 100%; justify-content: center; } }
.number-tile { position: relative; display: grid; gap: .15rem; padding: 1rem 1rem 1rem 3.2rem; border-radius: 16px; border: 1px solid var(--border-2);
    background: linear-gradient(140deg, rgba(167, 139, 255, .14), rgba(0, 200, 255, .05)); }
.number-tile > .i { position: absolute; left: 1rem; top: 1.05rem; color: #a78bff; }
.number-tile small { color: var(--muted); font-size: .78rem; line-height: 1.9; }
.num-in { width: 64px; padding: .25rem .45rem; margin: 0 .2rem; border-radius: 8px; border: 1px solid var(--a1); background: var(--bg); color: var(--text);
    font: 700 .95rem var(--display); text-align: center; }
.num-in:focus { outline: none; box-shadow: 0 0 0 3px rgba(124, 92, 255, .3); }
.link-select { max-width: 280px; }
/* URLs shrink with an ellipsis so the QR / remove buttons always stay visible */
.links-table { width: 100%; }
.links-table td:nth-child(2) { width: 100%; max-width: 0; }
.links-table .link-box.sm { min-width: 220px; }
.links-table td:first-child { min-width: 150px; }
@media (max-width: 900px) {
    .links-table td.actions-col, .links-table th.actions-col { position: sticky; right: 0; z-index: 1; background: linear-gradient(90deg, transparent, rgba(16, 15, 34, .96) 22%); padding-left: 1.2rem; }
}

/* Motion: the console does not follow the OS "reduce motion" setting (Windows turns it on whenever "Show animations"
   is off), so its animations always run. */
