/* =========================================================================
   CAV Partner Space
   ========================================================================= */

:root {
  --bg: #f5f4fb;
  --surface: #ffffff;
  --surface-2: #f8f7fc;
  --surface-3: #efedf8;
  --text: #1d1a33;
  --muted: #6c6884;
  --border: #e7e4f2;
  --border-strong: #d6d2e8;
  --shadow-sm: 0 1px 2px rgba(30, 20, 70, .06);
  --shadow: 0 1px 2px rgba(30, 20, 70, .05), 0 8px 24px -8px rgba(30, 20, 70, .12);
  --shadow-lg: 0 24px 64px -16px rgba(30, 20, 70, .28);
  --radius: 16px;
  --radius-sm: 10px;
  --c1: #7c3aed;
  --c2: #ec4899;
  --accent: var(--c1);
  --open: #f59e0b;
  --open-bg: #fef3c7;
  --discussing: #3b82f6;
  --discussing-bg: #dbeafe;
  --resolved: #10b981;
  --resolved-bg: #d1fae5;
  --danger: #e11d48;
  --hero-bg: linear-gradient(135deg, #2e1065, #6d28d9 45%, #db2777);
  --blob1: #a78bfa;
  --blob2: #f472b6;
  --blob3: #60a5fa;
  --font-head: var(--font);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0d1a;
    --surface: #181528;
    --surface-2: #1e1a31;
    --surface-3: #27223e;
    --text: #ece9f8;
    --muted: #9c97b6;
    --border: #2c2745;
    --border-strong: #3b3559;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, .7);
    --open-bg: rgba(245, 158, 11, .16);
    --discussing-bg: rgba(59, 130, 246, .18);
    --resolved-bg: rgba(16, 185, 129, .16);
    color-scheme: dark;
  }
}

.c-violet { --c1: #7c3aed; --c2: #ec4899; }
.c-blue   { --c1: #2563eb; --c2: #06b6d4; }
.c-teal   { --c1: #0d9488; --c2: #22c55e; }
.c-green  { --c1: #15803d; --c2: #a3e635; }
.c-amber  { --c1: #ea580c; --c2: #facc15; }
.c-rose   { --c1: #e11d48; --c2: #fb923c; }
.c-slate  { --c1: #1e293b; --c2: #6366f1; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; font-family: var(--font-head); }
p { margin: 0; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs-text { font-size: 11.5px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.spacer { flex: 1; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon.xs { width: 14px; height: 14px; }
.icon.xxs { width: 10px; height: 10px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  cursor: pointer; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--c1) 70%, transparent);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--c1) 80%, transparent); }
.btn.soft { background: var(--surface-3); color: var(--text); }
.btn.soft:hover { background: var(--border); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.lg { height: 48px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0; width: 40px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 999px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.xs { width: 24px; height: 24px; }
.icon-btn.on-dark { color: rgba(255, 255, 255, .9); }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.link-btn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }

.lang-toggle {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: var(--surface-3); border: 0; cursor: pointer; font-size: 12px; font-weight: 700;
}
.lang-toggle span { padding: 4px 9px; border-radius: 999px; color: var(--muted); transition: all .2s; }
.lang-toggle span.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Avatars ------------------------------------------------------------ */
.avatar {
  --h: 260;
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 70% 58%), hsl(calc(var(--h) + 40) 75% 52%));
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }

/* ---- Spinner / loading ------------------------------------------------- */
.center-screen {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center; padding: 24px; overflow: hidden;
}
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--c1);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Decorative blurred blobs */
.blobs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: float 18s ease-in-out infinite; }
.blobs i:nth-child(1) { width: 420px; height: 420px; background: var(--blob1); top: -120px; left: -80px; }
.blobs i:nth-child(2) { width: 360px; height: 360px; background: var(--blob2); bottom: -120px; right: -60px; animation-delay: -6s; }
.blobs i:nth-child(3) { width: 280px; height: 280px; background: var(--blob3); top: 40%; left: 55%; animation-delay: -12s; opacity: .35; }
.blobs.tinted i:nth-child(1) { background: var(--c1); opacity: .35; }
.blobs.tinted i:nth-child(2) { background: var(--c2); opacity: .35; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.06); }
  66% { transform: translate(-20px, 20px) scale(.95); }
}

/* ---- Auth / unlock cards ----------------------------------------------- */
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; padding: 36px 32px 32px;
  text-align: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  animation: rise .5s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.auth-top { position: absolute; top: 16px; right: 16px; }
.auth-logo { width: 64px; height: 64px; margin-bottom: 14px; filter: drop-shadow(0 10px 20px rgba(124, 58, 237, .35)); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card h2 { font-size: 17px; margin-bottom: 4px; }
.auth-divider { height: 1px; background: var(--border); margin: 24px 0; }
.google-btn { display: flex; justify-content: center; margin-top: 18px; min-height: 44px; }
.lock-badge {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 14px 30px -10px var(--c1);
}
.lock-badge .icon { width: 28px; height: 28px; }
.auth-card .field { margin-top: 16px; }
.auth-card .btn.block { margin-top: 22px; }
.big-emoji { font-size: 44px; margin-bottom: 8px; }
.form-error { margin-top: 14px; color: var(--danger); font-weight: 500; font-size: 14px; }

/* ---- Forms -------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; text-align: left; }
.field.left { text-align: left; }
.field label { font-weight: 600; font-size: 13px; }
.field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select, .search input, .composer textarea, .issue textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea, .issue textarea { resize: vertical; min-height: 44px; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .issue textarea:focus, .search:focus-within {
  border-color: var(--c1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 16%, transparent);
}
.hint { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.hint.warn { color: #b45309; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--c1); }

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch i {
  display: block; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2px transparent;
  transition: box-shadow .15s, transform .15s;
}
.swatch i:hover { transform: scale(1.08); }
.swatch input:checked + i { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2px var(--c1); }
.swatch input:focus-visible + i { outline: 2px solid var(--c1); outline-offset: 3px; }

.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-tile {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 10px; cursor: pointer;
  border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.theme-tile:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.theme-tile input { position: absolute; opacity: 0; pointer-events: none; }
.theme-tile:has(input:checked) { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 20%, transparent); }
.theme-tile:has(input:focus-visible) { outline: 2px solid var(--c1); outline-offset: 2px; }
.theme-tile strong { font-family: var(--font-head); font-size: 13.5px; margin-top: 6px; }
.theme-tile small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.tt-preview { position: relative; display: block; height: 62px; border-radius: 9px; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.tt-hero { position: absolute; inset: 0 0 auto; height: 24px; background: linear-gradient(120deg, var(--c1), var(--c2)); }
.tt-line { position: absolute; left: 8px; top: 32px; width: 60%; height: 6px; border-radius: 3px; background: var(--border-strong); }
.tt-line.short { top: 43px; width: 38%; }
.tt-btn { position: absolute; right: 8px; bottom: 8px; width: 26px; height: 12px; border-radius: 6px; background: var(--c1); }

.icon-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.icon-picker input { position: absolute; opacity: 0; pointer-events: none; }
.icon-picker span {
  display: grid; place-items: center; aspect-ratio: 1; font-size: 20px; border-radius: 12px; cursor: pointer;
  background: var(--surface-2); border: 2px solid transparent; transition: all .15s;
}
.icon-picker span:hover { background: var(--surface-3); }
.icon-picker input:checked + span { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, var(--surface)); }

/* ---- Top bar ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: 62px; padding: 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--text); text-decoration: none !important; }
.brand img { width: 30px; height: 30px; }
.me-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 13px; font-weight: 600; max-width: 220px;
}
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.me-chip { cursor: pointer; }
button.me-chip:hover { border-color: var(--border-strong); }

.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--resolved); }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2s infinite; }
.live-dot.off { color: var(--muted); }
.live-dot.off i { animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---- Page --------------------------------------------------------------- */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }

/* ---- Dashboard ---------------------------------------------------------- */
.dash-hero {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: 36px;
  background: var(--hero-bg);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.dash-hero .blobs i { opacity: .45; }
.dash-hero-inner { position: relative; z-index: 1; }
.dash-hero h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
.dash-hero p { opacity: .85; margin-top: 6px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 26px; }
.stat {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(8px);
}
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .18); }
.stat strong { display: block; font-size: 22px; line-height: 1.1; }
.stat span { font-size: 12.5px; opacity: .85; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 16px; }
.section-head h2 { font-size: 20px; }

.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.partner-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.partner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pc-band {
  height: 84px; padding: 12px; display: flex; justify-content: flex-end; align-items: flex-start;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  position: relative;
}
.pc-band::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 120%, rgba(255, 255, 255, .35), transparent 50%);
}
.pc-band .icon-btn { position: relative; z-index: 1; }
.pc-avatar {
  position: absolute; left: 20px; bottom: -26px; z-index: 1;
  width: 56px; height: 56px; border-radius: 18px;
  display: grid; place-items: center; font-weight: 800; font-size: 19px; color: var(--c1);
  background: var(--surface); box-shadow: var(--shadow);
}
.pc-body { display: block; padding: 36px 20px 6px; color: inherit; text-decoration: none !important; }
.pc-body h3 { font-size: 17px; }
.pc-stats { display: flex; gap: 14px; flex-wrap: wrap; margin: 14px 0 12px; font-size: 13px; color: var(--muted); }
.pc-stats span { display: inline-flex; gap: 5px; align-items: center; }
.pc-stats .icon { width: 15px; height: 15px; }
.progress { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width .6s ease; }
.pc-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pc-actions { display: flex; gap: 8px; padding: 12px 20px 18px; margin-top: auto; }
.pc-actions .btn { flex: 1; }

.add-card {
  align-items: center; justify-content: center; gap: 6px; min-height: 290px;
  border: 2px dashed var(--border-strong); background: transparent; box-shadow: none; cursor: pointer;
  color: var(--text);
}
.add-card:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 5%, transparent); }
.add-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; margin-bottom: 6px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 12px 24px -10px var(--c1);
}
.add-icon .icon { width: 26px; height: 26px; }
.empty-note { text-align: center; color: var(--muted); margin-top: 24px; }

/* ---- Settings ----------------------------------------------------------- */
.settings-page { max-width: 980px; }
.settings-head { margin: 8px 0 22px; }
.settings-head h1 { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 800; }
.settings-head h1 .icon { width: 26px; height: 26px; color: var(--c1); }
.settings-card {
  padding: 22px; margin-bottom: 18px; border-radius: 22px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.sc-head { margin-bottom: 16px; }
.sc-head h2 { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
.brand-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.color-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-field {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface);
}
.color-field input[type=color] { flex: none; width: 40px !important; height: 40px; padding: 0 !important; border: 0 !important; box-shadow: none !important; border-radius: 10px; background: none; cursor: pointer; }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .1); border-radius: 10px; }
.color-field span { display: flex; flex-direction: column; font-size: 13px; }
.color-field code { font-size: 12px; color: var(--muted); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { outline: 2px solid var(--c1); }
.brand-preview-wrap .sidebar-title { padding: 0 0 8px; }
.brand-preview {
  border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 13px; box-shadow: var(--shadow);
}
.bp-hero { display: flex; align-items: center; gap: 12px; padding: 18px 16px 30px; color: #fff; background: linear-gradient(120deg, var(--c1), var(--c2)); }
.bp-hero strong { display: block; font-family: var(--font-head); font-size: 17px; }
.bp-hero small { opacity: .85; }
.bp-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; font-weight: 800; font-size: 12px; background: rgba(255, 255, 255, .2); }
.bp-body { padding: 0 12px 14px; margin-top: -18px; }
.bp-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.bp-tabs span { padding: 6px 10px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.bp-tabs span.on { color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.bp-card { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.bp-card h4 { font-family: var(--font-head); font-size: 14px; margin: 8px 0; }
.bp-answer { padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c1) 20%, var(--border)); background: color-mix(in srgb, var(--c1) 7%, var(--surface)); }
.bp-answer b { color: var(--c1); font-size: 12px; }
.bp-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.settings-savebar {
  position: sticky; bottom: 16px; z-index: 10; display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding: 12px 14px 12px 20px; margin: 4px 0 26px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
#settings-dirty { margin-right: auto; color: var(--c1); font-weight: 600; }
.apply-row { display: flex; gap: 10px; flex-wrap: wrap; }
.apply-row select {
  flex: 1; min-width: 220px; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.apply-row input[type=email] {
  flex: 1; min-width: 220px; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.admin-list { list-style: none; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 6px 8px 6px 14px; }
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-email { font-weight: 600; overflow-wrap: anywhere; }
.admin-badge { flex: none; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, var(--surface)); }
@media (max-width: 900px) { .brand-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .color-fields { grid-template-columns: 1fr; } .settings-card { padding: 18px 16px; } }

/* ---- Space hero ---------------------------------------------------------- */
.space-hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(120deg, var(--c1), var(--c2));
}
.space-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% -20%, rgba(255, 255, 255, .35), transparent 45%),
    radial-gradient(circle at 0% 120%, rgba(0, 0, 0, .25), transparent 50%);
}
.space-hero .blobs i { opacity: .3; mix-blend-mode: screen; }
.space-hero-inner {
  position: relative; z-index: 1; max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 22px; padding: 34px 20px 64px;
}
.hero-avatar {
  flex-shrink: 0; width: 76px; height: 76px; border-radius: 24px;
  display: grid; place-items: center; font-size: 26px; font-weight: 800;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(6px);
}
.hero-text { flex: 1; min-width: 0; }
.hero-text h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
.hero-company { opacity: .9; font-weight: 500; margin-top: 2px; }
.hero-desc { opacity: .85; margin-top: 8px; max-width: 640px; font-size: 14px; }
.hero-desc a { color: #fff; text-decoration: underline; }
.hero-progress {
  display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 12px; border-radius: 20px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(8px);
}
.hero-progress strong { display: block; font-size: 13px; }
.hero-progress span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; opacity: .9; }
.ring {
  --p: 0;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0);
}
.ring span {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  font-size: 13px; font-weight: 800; background: color-mix(in srgb, var(--c1) 70%, var(--c2));
}

/* ---- Tabs bar ----------------------------------------------------------- */
.tabs-bar {
  position: sticky; top: 62px; z-index: 20;
  max-width: 1200px; margin: -34px auto 0; padding: 0 20px;
}
.tabs-scroll {
  display: flex; gap: 6px; padding: 7px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
}
.tabs-scroll::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 44px; padding: 0 16px; border-radius: 14px; border: 0; background: transparent;
  font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; text-decoration: none !important;
  transition: background .15s, color .15s;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px -8px var(--c1); }
.tab-icon { font-size: 17px; }
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text);
}
.tab.active .tab-count { background: rgba(255, 255, 255, .25); color: #fff; }
.tab.add { color: var(--c1); border: 1.5px dashed color-mix(in srgb, var(--c1) 40%, transparent); }
.tab.add:hover { background: color-mix(in srgb, var(--c1) 8%, transparent); color: var(--c1); }

/* ---- Space layout ------------------------------------------------------- */
.space-page { padding-top: 28px; }
.tab-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.tab-head h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; }
.tab-head-icon { font-size: 26px; }
.tab-head p { margin-top: 4px; max-width: 760px; }

/* Owner-editable wording: small pencils next to labels and titles */
.lbl-edit {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 5px;
  border-radius: 6px; vertical-align: middle; cursor: pointer; color: inherit;
  opacity: .35; transition: opacity .15s, background .15s;
}
.lbl-edit .icon { width: 11px; height: 11px; }
h1 .lbl-edit, h2 .lbl-edit, h3 .lbl-edit, h4 .lbl-edit { width: 24px; height: 24px; }
h1 .lbl-edit .icon, h2 .lbl-edit .icon { width: 14px; height: 14px; }
:hover > .lbl-edit, .lbl-edit:focus-visible { opacity: .9; }
.lbl-edit:hover { opacity: 1; background: color-mix(in srgb, currentColor 14%, transparent); }
.chip .lbl-edit, .btn .lbl-edit, .topic-item .lbl-edit { margin-left: 2px; width: 16px; height: 16px; }
.label-editor { display: flex; flex-direction: column; gap: 8px; width: 270px; padding: 8px; }
.label-editor label { font-weight: 600; font-size: 13px; }
.label-editor input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); outline: none;
}
.label-editor input:focus { border-color: var(--c1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c1) 16%, transparent); }
.label-editor .row-end { margin-top: 0; }
.labels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .labels-grid { grid-template-columns: 1fr; } }

/* Story & mindset — the owner's opening note at the top of a tab */
.story-card {
  position: relative; overflow: hidden;
  margin: -6px 0 26px; padding: 22px 26px 16px 30px; border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--c2) 14%, transparent), transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--c1) 9%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--c1) 22%, var(--border));
  box-shadow: var(--shadow);
}
.story-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--c1), var(--c2));
}
.story-card::after {
  content: '\201C'; position: absolute; right: 18px; top: -18px;
  font: 700 140px/1 Georgia, serif; color: var(--c1); opacity: .08; pointer-events: none;
}
.story-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.story-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
}
.story-hint { font-size: 12.5px; color: var(--muted); font-style: italic; margin-right: auto; }
.story-body { position: relative; font-family: var(--font-head); font-size: 16px; line-height: 1.7; max-width: 820px; }
.story-body.clamped { max-height: 13.6em; overflow: hidden; }
.story-body.clamped::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4em;
  background: linear-gradient(transparent, color-mix(in srgb, var(--c1) 3%, var(--surface)));
}
.story-foot { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 13px; font-weight: 600; }
.story-card.editing .story-eyebrow { margin-bottom: 10px; }
.story-card .story-input { width: 100%; min-height: 120px; font-size: 15px; line-height: 1.6; }
.story-card .row-end { align-items: center; }
.story-empty {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: -6px 0 26px; padding: 18px 20px;
  text-align: left; cursor: pointer; border-radius: 20px; color: var(--text);
  border: 2px dashed color-mix(in srgb, var(--c1) 35%, var(--border-strong)); background: transparent;
  transition: background .15s, border-color .15s;
}
.story-empty:hover { background: color-mix(in srgb, var(--c1) 5%, transparent); border-color: var(--c1); }
.story-empty-icon {
  display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 14px;
  color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
}
.story-empty strong { display: block; color: var(--c1); }
.story-empty small { display: block; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .story-card { padding: 18px 16px 14px 20px; }
  .story-body { font-size: 15px; }
}

.space-layout { display: grid; grid-template-columns: 250px 1fr; gap: 26px; align-items: start; }
.topic-sidebar {
  position: sticky; top: 140px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.sidebar-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 6px 10px 8px; }
.topic-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--text); font-size: 14px; font-weight: 500; border: 0; background: transparent; cursor: pointer;
  text-align: left; text-decoration: none !important; transition: background .15s;
}
.topic-item:hover { background: var(--surface-2); }
.topic-item.active { background: color-mix(in srgb, var(--c1) 11%, var(--surface)); color: var(--c1); font-weight: 600; }
.topic-item.add { color: var(--c1); font-weight: 600; margin-top: 4px; }
.topic-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.topic-dot { display: grid; place-items: center; width: 16px; }
.mini-ring {
  --p: 0; flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--resolved) calc(var(--p) * 1%), var(--surface-3) 0);
  -webkit-mask: radial-gradient(circle, transparent 4px, #000 4.5px);
          mask: radial-gradient(circle, transparent 4px, #000 4.5px);
}

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.chip b { font-weight: 700; color: var(--text); opacity: .7; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip.active b { color: var(--surface); }
.chip .dot, .status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.s-open .dot { background: var(--open); }
.chip.s-discussing .dot { background: var(--discussing); }
.chip.s-resolved .dot { background: var(--resolved); }
.search {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; width: 240px; max-width: 100%;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--muted);
}
.search input { border: 0 !important; box-shadow: none !important; padding: 0 !important; background: transparent !important; height: 100%; }

.topic-section { margin-bottom: 34px; }
.topic-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.topic-head h3 { font-size: 18px; font-weight: 700; }
.topic-head h3 a { color: inherit; }
.topic-head p { margin-top: 2px; }
.topic-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.empty-inline {
  padding: 22px; text-align: center; color: var(--muted); font-size: 14px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-state {
  text-align: center; padding: 56px 24px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--border);
}
.empty-state h3 { font-size: 18px; margin-bottom: 6px; }
.empty-state .btn { margin-top: 18px; }

/* ---- Issue card --------------------------------------------------------- */
.issue {
  position: relative;
  padding: 20px 22px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.issue::before {
  content: ''; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--open);
}
.issue.s-discussing::before { background: var(--discussing); }
.issue.s-resolved::before { background: var(--resolved); }
.issue.pinned { border-color: color-mix(in srgb, var(--c1) 35%, var(--border)); }
.issue.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 35%, transparent); } }
.issue-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  border: 0; font-size: 12px; font-weight: 700;
}
button.status-pill { cursor: pointer; }
.status-pill.s-open { background: var(--open-bg); color: #b45309; }
.status-pill.s-discussing { background: var(--discussing-bg); color: #1d4ed8; }
.status-pill.s-resolved { background: var(--resolved-bg); color: #047857; }
@media (prefers-color-scheme: dark) {
  .status-pill.s-open { color: #fbbf24; }
  .status-pill.s-discussing { color: #93c5fd; }
  .status-pill.s-resolved { color: #6ee7b7; }
}
.pin-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); }
.raised-by {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 3px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c2) 12%, var(--surface)); color: var(--text);
}
.issue.by-partner { background: linear-gradient(180deg, color-mix(in srgb, var(--c2) 4%, var(--surface)), var(--surface) 120px); }
.empty-inline .link-btn { display: block; margin: 6px auto 0; }
.issue-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.issue-content { color: var(--text); opacity: .88; font-size: 14.5px; }
.rich { word-wrap: break-word; overflow-wrap: anywhere; }
.rich a { text-decoration: underline; }

.answer {
  margin-top: 14px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 8%, var(--surface)), color-mix(in srgb, var(--c2) 6%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--c1) 18%, var(--border));
}
.answer.empty { background: var(--surface-2); border-style: dashed; border-color: var(--border-strong); }
.answer-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.answer-head strong { color: var(--c1); }
.answer .rich { font-size: 14.5px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* Reactions */
.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.reactions.small { margin-top: 6px; gap: 4px; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 14px;
  transition: transform .12s, background .15s, border-color .15s;
}
.reaction b { font-size: 12px; font-weight: 700; color: var(--muted); }
.reaction:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.reaction.mine { background: color-mix(in srgb, var(--c1) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c1) 45%, transparent); }
.reaction.mine b { color: var(--c1); }
.reaction.add { color: var(--muted); gap: 1px; padding: 0 9px; }
.reactions.small .reaction { height: 24px; padding: 0 7px; font-size: 12.5px; }

.emoji-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 4px; }
.emoji-picker button {
  width: 42px; height: 42px; border: 0; border-radius: 12px; background: transparent; font-size: 22px; cursor: pointer;
  transition: transform .12s, background .12s;
}
.emoji-picker button:hover { background: var(--surface-3); transform: scale(1.18); }

/* Comments */
.thread { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.thread-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.comment { display: flex; gap: 10px; padding: 8px 8px; margin: 0 -8px; border-radius: 12px; transition: background .3s; }
.comment.is-new { background: color-mix(in srgb, var(--c1) 6%, transparent); }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
.comment-head .icon-btn { opacity: 0; transition: opacity .15s; }
.comment:hover .comment-head .icon-btn, .comment-head .icon-btn:focus { opacity: 1; }
@media (hover: none) { .comment-head .icon-btn { opacity: 1; } }
.comment-body { font-size: 14.5px; margin-top: 1px; }
.role-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.role-badge.owner { background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); }
.role-badge.partner { background: var(--surface-3); color: var(--muted); }
.new-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--c2); color: #fff; }

.composer { display: flex; gap: 10px; margin-top: 10px; align-items: flex-start; }
.composer-box {
  flex: 1; min-width: 0; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.composer-box:focus-within { border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 14%, transparent); }
.composer textarea { border: 0 !important; box-shadow: none !important; resize: none; background: transparent; min-height: 42px; padding: 10px 14px 4px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px 6px 14px; }
.composer-foot .muted { opacity: 0; transition: opacity .15s; }
.composer-box:focus-within .composer-foot .muted { opacity: 1; }

/* ---- Modal -------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 10, 35, .45); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .18s;
}
.modal-backdrop.show { opacity: 1; }
.modal {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98); transition: transform .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal.wide { max-width: 640px; }
.modal-backdrop.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 6px; }
.modal-head h3 { font-size: 18px; }
.modal-body { padding: 12px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.confirm-text { font-size: 15px; }
.invite-box {
  margin-top: 6px; padding: 14px 16px; border-radius: 14px; font-size: 13.5px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}

/* ---- Popover menu ------------------------------------------------------- */
.popover {
  position: absolute; z-index: 200; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px); transition: opacity .12s, transform .12s;
}
.popover.show { opacity: 1; transform: none; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px;
  background: transparent; text-align: left; font-size: 14px; cursor: pointer; min-height: 38px;
}
.menu-item .icon { width: 16px; height: 16px; color: var(--muted); }
.menu-item:hover { background: var(--surface-3); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }

/* ---- Toasts ------------------------------------------------------------- */
#toasts {
  position: fixed; z-index: 300; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
  width: min(92vw, 440px);
}
.toast {
  padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; max-width: 100%;
  background: #1d1a33; color: #fff; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px) scale(.96); transition: all .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.show { opacity: 1; transform: none; }
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error { background: linear-gradient(135deg, #be123c, #e11d48); }
.toast.info { background: linear-gradient(135deg, var(--c1), var(--c2)); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .space-layout { grid-template-columns: 1fr; gap: 16px; }
  .topic-sidebar {
    position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none;
    padding: 6px; gap: 4px;
  }
  .topic-sidebar::-webkit-scrollbar { display: none; }
  .sidebar-title { display: none; }
  .topic-item { flex-shrink: 0; white-space: nowrap; }
  .topic-name { overflow: visible; }
  .hero-progress { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .brand span, .hide-sm { display: none; }
  .me-chip span { max-width: 90px; }
  .live-dot span { display: none; }
  .page { padding: 18px 14px 64px; }
  .dash-hero { padding: 24px 20px; border-radius: 22px; }
  .stat { padding: 10px 12px; }
  .stat-icon { width: 34px; height: 34px; }
  .space-hero-inner { padding: 24px 16px 58px; gap: 14px; }
  .hero-avatar { width: 56px; height: 56px; border-radius: 18px; font-size: 20px; }
  .tabs-bar { padding: 0 14px; }
  .tab { height: 40px; padding: 0 13px; }
  .issue { padding: 16px 16px 12px; border-radius: 18px; }
  .search { width: 100%; }
  .grid-2 { grid-template-columns: 1fr; }
  .icon-picker { grid-template-columns: repeat(6, 1fr); }
  .theme-picker { grid-template-columns: repeat(2, 1fr); }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { max-width: none !important; border-radius: 24px 24px 0 0; max-height: 92dvh; }
  .auth-card { padding: 30px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
