/* =============================================================
   CLIPSEDIT AI OS — DESIGN SYSTEM v2
   ============================================================= */

:root {
  --bg: #0a0a0b;
  --bg-raised: #131316;
  --bg-elevated: #1b1b1e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f6f4ef;
  --text-dim: rgba(246, 244, 239, 0.68);
  --text-faint: rgba(246, 244, 239, 0.40);

  /* "gold" tokens act as the generic ACCENT tokens — every theme below
     just redefines these same variable names with its own hue so the
     rest of the stylesheet never has to change. Refined to a deeper,
     richer antique-gold for a more premium/professional contrast. */
  --gold: #c9a24e;
  --gold-bright: #e8c785;
  --gold-dim: rgba(201, 162, 78, 0.5);
  --gold-glow: rgba(201, 162, 78, 0.25);
  --gold-glow-soft: rgba(201, 162, 78, 0.08);
  --gold-rgb: 201, 162, 78;

  /* Unified modern sans-serif system — Inter for both headings and body
     for a cleaner, more professional look (serif accent removed). */
  --font-sans: "Inter", "Noto Sans Bengali", "Noto Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Inter", "Noto Sans Bengali", "Noto Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-w: 292px;
  --sidebar-w-compact: 84px;
  --right-sidebar-w: 320px;
}

/* ============================= THEMES (6 curated themes) ============================= */
/* "dark-professional" is the :root default above (deep charcoal + antique gold). */

[data-theme="neon-blue"] {
  --gold: #4fa8ff; --gold-bright: #8ec7ff; --gold-dim: rgba(79,168,255,0.5);
  --gold-glow: rgba(79,168,255,0.25); --gold-glow-soft: rgba(79,168,255,0.08); --gold-rgb: 79,168,255;
}
[data-theme="midnight-purple"] {
  --bg: #0d0a14; --bg-raised: #16111f; --bg-elevated: #1e1829;
  --gold: #a389f4; --gold-bright: #c8b8fa; --gold-dim: rgba(163,137,244,0.5);
  --gold-glow: rgba(163,137,244,0.25); --gold-glow-soft: rgba(163,137,244,0.08); --gold-rgb: 163,137,244;
}
[data-theme="light-minimal"] {
  --bg: #f6f5f1; --bg-raised: #ffffff; --bg-elevated: #ffffff;
  --line: rgba(10,10,10,0.09); --line-strong: rgba(10,10,10,0.16);
  --text: #17181c; --text-dim: rgba(23,24,28,0.65); --text-faint: rgba(23,24,28,0.42);
  --gold: #3a86d9; --gold-bright: #1f5fae; --gold-dim: rgba(58,134,217,0.45);
  --gold-glow: rgba(58,134,217,0.18); --gold-glow-soft: rgba(58,134,217,0.07); --gold-rgb: 58,134,217;
}
[data-theme="black-gold-luxury"] {
  --bg: #020203; --bg-raised: #0c0c0d; --bg-elevated: #151516;
  --gold: #c9a24e; --gold-bright: #f0d9a3; --gold-dim: rgba(201,162,78,0.55);
  --gold-glow: rgba(201,162,78,0.3); --gold-glow-soft: rgba(201,162,78,0.1); --gold-rgb: 201,162,78;
}
[data-theme="glass-frost"] {
  --bg: #eef2f6; --bg-raised: rgba(255,255,255,0.65); --bg-elevated: rgba(255,255,255,0.85);
  --line: rgba(20,40,60,0.10); --line-strong: rgba(20,40,60,0.18);
  --text: #10202e; --text-dim: rgba(16,32,46,0.65); --text-faint: rgba(16,32,46,0.42);
  --gold: #4a90c4; --gold-bright: #2f6fa3; --gold-dim: rgba(74,144,196,0.45);
  --gold-glow: rgba(74,144,196,0.2); --gold-glow-soft: rgba(74,144,196,0.08); --gold-rgb: 74,144,196;
}

/* ============================= APPEARANCE MODES ============================= */

[data-mode="light"] {
  --bg: #f6f5f1;
  --bg-raised: #ffffff;
  --bg-elevated: #ffffff;
  --line: rgba(10, 10, 10, 0.09);
  --line-strong: rgba(10, 10, 10, 0.16);
  --text: #171512;
  --text-dim: rgba(23, 21, 18, 0.66);
  --text-faint: rgba(23, 21, 18, 0.42);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

html { transition: background-color 0.4s var(--ease); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img, svg { display: block; max-width: 100%; }
button { font-family: inherit; color: inherit; }
textarea { font-family: inherit; }

::selection { background: var(--gold-glow); color: var(--text); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #050505;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 999;
  font-weight: 700;
}
.skip-link:focus { left: 16px; top: 16px; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================= BOOT LOADER ============================= */

.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}
.boot-loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark {
  font-size: 34px;
  color: var(--gold);
  animation: boot-pulse 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 18px var(--gold-glow));
}
@keyframes boot-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* ============================= CURSOR GLOW ============================= */

.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin-left: -210px; margin-top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow-soft), transparent 70%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  will-change: transform;
}
.cursor-glow.is-visible { opacity: 1; }
@media (hover: none), (max-width: 980px), (prefers-reduced-motion: reduce) {
  .cursor-glow { display: none; }
}

/* ============================= BACKGROUND ATMOSPHERE ============================= */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, var(--gold-glow-soft), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(var(--gold-rgb),0.06), transparent 55%),
    radial-gradient(ellipse 900px 700px at 50% 120%, rgba(var(--gold-rgb),0.05), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#particleField {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  display: none;
}
[data-bg="particles"] #particleField,
[data-bg="space"] #particleField,
[data-bg="matrix"] #particleField,
[data-bg="starfield3d"] #particleField { display: block; }

.bg-layer { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-layer > div { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s var(--ease); }

.bg-aurora span {
  position: absolute;
  width: 60vw; height: 60vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  animation: aurora-float 18s ease-in-out infinite;
}
.bg-aurora span:nth-child(1) { background: var(--gold); top: -20%; left: -10%; }
.bg-aurora span:nth-child(2) { background: #6ea8ff; top: 10%; right: -20%; animation-duration: 22s; animation-delay: -4s; }
.bg-aurora span:nth-child(3) { background: #b98bff; bottom: -25%; left: 20%; animation-duration: 26s; animation-delay: -9s; }
@keyframes aurora-float {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(6%, 8%) scale(1.15); }
}
[data-bg="aurora"] .bg-aurora { opacity: 1; }

.bg-waves span {
  position: absolute;
  left: -10%; width: 120%; height: 240px;
  border-radius: 50%;
  border-top: 1px solid var(--gold-dim);
  opacity: 0.18;
  animation: wave-drift 14s linear infinite;
}
.bg-waves span:nth-child(1) { top: 20%; animation-duration: 16s; }
.bg-waves span:nth-child(2) { top: 50%; animation-duration: 22s; animation-direction: reverse; }
.bg-waves span:nth-child(3) { top: 78%; animation-duration: 19s; }
@keyframes wave-drift {
  0% { transform: translateX(-4%) scaleY(1); }
  50% { transform: translateX(4%) scaleY(1.3); }
  100% { transform: translateX(-4%) scaleY(1); }
}
[data-bg="waves"] .bg-waves { opacity: 1; }

.bg-blur span {
  position: absolute;
  width: 45vw; height: 45vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  animation: blur-pulse 12s ease-in-out infinite;
}
.bg-blur span:nth-child(1) { background: var(--gold); top: -10%; left: 10%; }
.bg-blur span:nth-child(2) { background: var(--gold); bottom: -15%; right: 5%; animation-delay: -6s; }
@keyframes blur-pulse {
  0%, 100% { opacity: 0.18; transform: scale(1); }
  50% { opacity: 0.32; transform: scale(1.1); }
}
[data-bg="blur"] .bg-blur { opacity: 1; }

[data-bg="minimal"] body::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  .bg-aurora span, .bg-waves span, .bg-blur span { animation: none; }
}

/* ============================= APP SHELL ============================= */

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-sidebar-w);
  height: 100vh;
  width: 100%;
  transition: grid-template-columns 0.3s var(--ease);
}
[data-sidebar="compact"] .app-shell { grid-template-columns: var(--sidebar-w-compact) 1fr var(--right-sidebar-w); }

/* ============================= SIDEBAR ============================= */

.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.3s var(--ease), background 0.3s var(--ease), margin 0.3s var(--ease), border-radius 0.3s var(--ease);
}

.sidebar.is-floating {
  margin: 14px;
  height: calc(100vh - 28px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.sidebar.is-transparent { background: rgba(10,10,10,0.25); backdrop-filter: blur(28px); }
[data-mode="light"] .sidebar.is-transparent { background: rgba(255,255,255,0.35); }

[data-sidebar="compact"] .sidebar .brand-text,
[data-sidebar="compact"] .sidebar .new-chat-btn span:not(.plus),
[data-sidebar="compact"] .sidebar .new-chat-btn kbd,
[data-sidebar="compact"] .sidebar .nav-item span:not(.live-dot),
[data-sidebar="compact"] .sidebar .trial-card strong,
[data-sidebar="compact"] .sidebar .trial-card p,
[data-sidebar="compact"] .sidebar .trial-card button span {
  display: none;
}
[data-sidebar="compact"] .sidebar .nav-item,
[data-sidebar="compact"] .sidebar .new-chat-btn { justify-content: center; }
[data-sidebar="compact"] .sidebar .trial-card { display: flex; justify-content: center; padding: 12px; }

.sidebar-collapse-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text-faint);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  display: none;
}
@media (min-width: 981px) { .sidebar-collapse-btn { display: block; } }
.sidebar-collapse-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; margin: 0 auto; }

.sidebar-footer-logo {
  margin-top: auto;
  padding: 18px 8px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.sidebar-footer-logo img {
  max-width: 70%;
  max-height: 46px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.25));
}
[data-sidebar="compact"] .sidebar-footer-logo { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
  perspective: 700px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.14);
  color: #100c04;
  font-size: 16.5px;
  font-weight: 800;
  box-shadow: 0 0 22px var(--gold-glow), inset 0 1px 1px rgba(255,255,255,0.12), inset 0 -1px 2px rgba(0,0,0,0.5);
  flex-shrink: 0;
  letter-spacing: -0.02em;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  animation: logo-3d-idle 7s ease-in-out infinite;
  transition: transform 0.15s ease-out;
  will-change: transform;
  overflow: hidden;
}
.brand-mark-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -60% -60%;
  background: linear-gradient(75deg, transparent 40%, rgba(255,255,255,0.55) 48%, transparent 56%);
  transform: translateX(-120%) rotate(8deg);
  animation: logo-3d-shine 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes logo-3d-idle {
  0%, 100% { transform: rotateX(0deg) rotateY(0deg) translateZ(0); }
  25% { transform: rotateX(10deg) rotateY(-14deg) translateZ(4px); }
  50% { transform: rotateX(-6deg) rotateY(10deg) translateZ(2px); }
  75% { transform: rotateX(6deg) rotateY(16deg) translateZ(4px); }
}
@keyframes logo-3d-shine {
  0%, 15% { transform: translateX(-130%) rotate(8deg); }
  45%, 100% { transform: translateX(130%) rotate(8deg); }
}
.brand-mark.is-tilting { animation-play-state: paused; transition: transform 0.08s linear; }
@media (prefers-reduced-motion: reduce) {
  .brand-mark { animation: none; }
  .brand-mark::after { animation: none; display: none; }
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name {
  font-weight: 800;
  font-size: 15.5px;
  letter-spacing: -0.015em;
  background: linear-gradient(90deg, #f4c369, #dd4f7a 55%, #6a5cff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-name em { color: inherit; font-style: normal; font-weight: 800; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; text-transform: uppercase; }

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-dim);
  background: linear-gradient(160deg, rgba(var(--gold-rgb),0.16), rgba(var(--gold-rgb),0.04));
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.new-chat-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--gold-glow-soft); background: linear-gradient(160deg, rgba(var(--gold-rgb),0.24), rgba(var(--gold-rgb),0.06)); }
.new-chat-btn .plus { font-size: 16px; }
.new-chat-btn kbd {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: var(--font-sans);
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-item:hover { background: rgba(var(--gold-rgb),0.06); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(var(--gold-rgb),0.14), rgba(var(--gold-rgb),0.02));
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.live-dot {
  margin-left: auto;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #55d67a;
  box-shadow: 0 0 8px #55d67a;
}

.recent-conversations {
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 0 4px;
}
.recent-header-actions { display: flex; gap: 6px; }
.recent-header button {
  background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 11px;
}
.recent-header button:hover { color: var(--gold); }

.recent-search { padding: 0 2px; }
.recent-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
}
.recent-search input:focus { border-color: var(--gold-dim); }

.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.recent-list li {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.18s var(--ease);
  display: flex;
  align-items: center;
  gap: 8px;
}
.recent-list li:hover { background: rgba(255,255,255,0.04); }
.recent-list .r-info { flex: 1; min-width: 0; }
.recent-list .r-title { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-list .r-time { font-size: 10.5px; color: var(--text-faint); }
.recent-list .pin-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 13px; flex-shrink: 0; }
.recent-list .pin-btn.is-pinned { color: var(--gold); }
.recent-list .rename-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px; flex-shrink: 0; opacity: 0.7; }
.recent-list .rename-btn:hover { color: var(--gold-bright); opacity: 1; }
.recent-list .delete-btn { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 12px; flex-shrink: 0; opacity: 0.7; }
.recent-list .delete-btn:hover { color: #e2596b; opacity: 1; }

.view-all-btn {
  margin-top: 4px;
  background: none;
  border: 1px solid var(--line);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.view-all-btn:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

.sidebar-bottom { display: flex; flex-direction: column; gap: 10px; }

.trial-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.trial-spark { color: var(--gold); opacity: 0.8; font-size: 15px; flex-shrink: 0; }
.trial-card strong { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.trial-card button {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #050505;
  font-weight: 700;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.2s var(--ease), transform 0.2s var(--ease);
}
.trial-card button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.status-card strong { font-size: 12.5px; display: block; }
.status-card p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-faint); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #55d67a; box-shadow: 0 0 10px #55d67a; margin-top: 4px; flex-shrink: 0; animation: pulse-dot 2.4s infinite; }
.status-dot.small { width: 7px; height: 7px; margin-top: 0; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.sidebar-scrim { display: none; }

/* ============================= RIGHT SIDEBAR ============================= */

.right-sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 16px 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border-left: 1px solid var(--line);
  backdrop-filter: blur(20px);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.rs-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.rs-section:last-child { border-bottom: none; padding-bottom: 0; }
.rs-section h4 {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-weight: 700;
}

.rs-team-status-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}
.rs-team-status-row strong { font-size: 12.5px; display: block; }
.rs-team-status-row p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-faint); }
.rs-team-status-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 0 2px;
}
.rs-team-status-stat strong { font-size: 16px; color: var(--gold-bright); }

.rs-qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rs-qa-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.rs-qa-btn:hover { border-color: var(--gold-dim); color: var(--gold-bright); background: rgba(var(--gold-rgb),0.06); }

.rs-projects-list { display: flex; flex-direction: column; gap: 8px; }
.rs-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.18s var(--ease);
}
.rs-project-item:hover { background: rgba(255,255,255,0.04); }
.rs-project-item .rs-project-thumb {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(var(--gold-rgb),0.35), rgba(var(--gold-rgb),0.08));
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.rs-project-item .rs-project-info { flex: 1; min-width: 0; }
.rs-project-item .rs-project-title { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-project-item .rs-project-sub { font-size: 10.5px; color: var(--text-faint); }
.rs-empty-note { font-size: 12px; color: var(--text-faint); padding: 4px 2px; }

.rs-notifications-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rs-notification-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rs-notification-item:last-child { border-bottom: none; }
.rs-notification-item .rs-notif-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-top: 5px; flex-shrink: 0; }
.rs-notification-item .rs-notif-time { font-size: 10.5px; color: var(--text-faint); display: block; }

.theme-grid-compact { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.theme-grid-compact .theme-swatch { width: 22px; height: 22px; }

.right-sidebar-scrim { display: none; }

/* ============================= WORKSPACE ============================= */

.workspace {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}
.workspace-header-left { display: flex; align-items: center; gap: 12px; perspective: 700px; }
.header-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--gold);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  animation: logo-3d-idle 7s ease-in-out infinite;
  animation-delay: -2.5s;
  transition: transform 0.15s ease-out;
  will-change: transform;
}
.header-mark-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.header-mark::after {
  content: "";
  position: absolute;
  inset: -60% -60%;
  background: linear-gradient(75deg, transparent 40%, rgba(255,255,255,0.4) 48%, transparent 56%);
  transform: translateX(-130%) rotate(8deg);
  animation: logo-3d-shine 6s ease-in-out infinite;
  animation-delay: -2.5s;
  pointer-events: none;
}
.header-mark.is-tilting { animation-play-state: paused; transition: transform 0.08s linear; }
@media (prefers-reduced-motion: reduce) {
  .header-mark { animation: none; }
  .header-mark::after { animation: none; display: none; }
}
.workspace-title { font-weight: 800; font-size: 15px; }
.workspace-status { font-size: 11.5px; color: var(--text-faint); display: flex; align-items: center; gap: 6px; margin-top: 1px; }

.header-right { display: flex; align-items: center; gap: 10px; }

.experts-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-dim);
  background: rgba(var(--gold-rgb),0.08);
  color: var(--gold-bright);
  white-space: nowrap;
}

.header-icon-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.header-icon-btn:hover { border-color: var(--gold-dim); background: rgba(var(--gold-rgb),0.06); }
.header-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--text-dim); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.header-icon-btn:hover svg { stroke: var(--gold-bright); }

/* ============================= VIEW PANELS ============================= */

.view-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: view-fade 0.45s var(--ease);
}
.view-panel.hidden { display: none; }
.hidden { display: none !important; }

@keyframes view-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 36px 40px 60px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

/* generic content components used by site.js-rendered views */
.view-heading { margin-bottom: 28px; }
.view-heading h2 { font-family: var(--font-serif); font-size: 30px; font-weight: 500; margin: 0 0 8px; letter-spacing: -0.01em; }
.view-heading p { color: var(--text-dim); margin: 0; font-size: 14.5px; max-width: 60ch; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in-view { opacity: 1; transform: translateY(0); }

.glass-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.08) 48%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
}
.glass-card:hover::before { transform: translateX(120%); }
.glass-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 0 1px var(--gold-glow-soft); }
.glass-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.glass-card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.glass-card .card-icon { font-size: 20px; margin-bottom: 10px; display: block; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pricing-card {
  padding: 26px 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255,255,255,0.035), rgba(255,255,255,0.005));
  position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.pricing-card:hover { transform: translateY(-4px); }
.pricing-card.featured { border-color: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold-glow-soft), 0 20px 50px rgba(var(--gold-rgb),0.08); }
.pricing-card .plan-name { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; }
.pricing-card .plan-price { font-family: var(--font-serif); font-size: 30px; margin: 10px 0 6px; }
.pricing-card .plan-best { font-size: 12.5px; color: var(--text-dim); margin-bottom: 16px; }
.pricing-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.pricing-card li { font-size: 13px; color: var(--text-dim); display: flex; gap: 8px; align-items: flex-start; }
.pricing-card li::before { content: "✓"; color: var(--gold); font-weight: 700; }

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: none;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-q .chev { transition: transform 0.25s var(--ease); color: var(--gold); flex-shrink: 0; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s var(--ease);
  padding: 0 18px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}
.faq-item.open .faq-a { padding-bottom: 16px; }

.quote-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  position: relative;
}
.quote-card::before { content: "“"; font-family: var(--font-serif); font-size: 46px; color: var(--gold-dim); position: absolute; top: 6px; left: 16px; line-height: 1; }
.quote-card p { margin: 18px 0 12px; font-size: 14px; line-height: 1.6; color: var(--text); font-style: italic; }
.quote-card span { font-size: 12px; color: var(--text-faint); font-weight: 600; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.contact-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--gold-dim); }
.contact-card .card-icon { font-size: 22px; }

/* ============================= STATS FOOTER ============================= */

.stats-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto 14px;
  padding: 10px 6px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}
.stat {
  padding: 6px 16px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.stat:last-child { border-right: none; }
.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat span { font-size: 10.5px; color: var(--text-faint); white-space: nowrap; }

/* ============================= MOBILE MENU TOGGLE ============================= */

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(10,10,10,0.7);
  backdrop-filter: blur(10px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
[data-mode="light"] .mobile-menu-toggle { background: rgba(255,255,255,0.7); }
.mobile-menu-toggle span { width: 18px; height: 2px; background: var(--gold-bright); border-radius: 2px; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============================= RIPPLE EFFECT ============================= */

.rippleable { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: ripple-anim 0.6s var(--ease);
  pointer-events: none;
}
[data-mode="light"] .ripple { background: rgba(0,0,0,0.12); }
@keyframes ripple-anim {
  to { transform: scale(2.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ripple { display: none; }
}

/* ============================= SETTINGS PANEL ============================= */

.settings-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.settings-scrim.is-open { opacity: 1; pointer-events: auto; }

.settings-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: min(360px, 88vw);
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
  z-index: 41;
  transform: translateX(105%);
  transition: transform 0.35s var(--ease);
  display: flex;
  flex-direction: column;
  box-shadow: -30px 0 80px rgba(0,0,0,0.4);
}
.settings-panel.is-open { transform: translateX(0); }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.settings-header strong { font-size: 15px; }
.settings-header button { background: none; border: none; color: var(--text-dim); font-size: 15px; cursor: pointer; }

.settings-body { flex: 1; overflow-y: auto; padding: 20px 22px 40px; display: flex; flex-direction: column; gap: 26px; }
.settings-section h4 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); }

.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.segmented button {
  flex: 1; padding: 9px 10px; background: none; border: none; color: var(--text-dim);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
  border-right: 1px solid var(--line);
}
.segmented button:last-child { border-right: none; }
.segmented button.is-active { background: rgba(var(--gold-rgb),0.14); color: var(--gold-bright); }

.theme-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.theme-swatch {
  width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--sw);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.theme-swatch:hover { transform: scale(1.08); }
.theme-swatch.is-active { border-color: var(--text); box-shadow: 0 0 0 3px var(--gold-glow-soft); }

.bg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bg-grid button {
  padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: rgba(255,255,255,0.02); color: var(--text-dim); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.bg-grid button.is-active, .bg-grid button:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-dim); padding: 6px 0;
}
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--line-strong); border-radius: 999px; transition: background 0.2s var(--ease);
}
.switch-track::before {
  content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: var(--text); border-radius: 50%; transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--gold); }
.switch input:checked + .switch-track::before { transform: translateX(18px); background: #050505; }

.danger-zone { border-top: 1px solid var(--line); padding-top: 20px; }
.danger-btn {
  width: 100%; padding: 11px; border-radius: var(--radius-sm);
  border: 1px solid rgba(226,89,107,0.4); background: rgba(226,89,107,0.08);
  color: #f0a1ac; font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background 0.2s var(--ease);
}
.danger-btn:hover { background: rgba(226,89,107,0.16); }

/* ============================= RESPONSIVE ============================= */

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .mobile-menu-toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: min(300px, 82vw);
    transform: translateX(-105%);
    transition: transform 0.32s var(--ease);
    box-shadow: 20px 0 60px rgba(0,0,0,0.5);
  }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 4;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  .app-shell.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }

  .right-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: min(320px, 86vw);
    transform: translateX(105%);
    transition: transform 0.32s var(--ease);
    box-shadow: -20px 0 60px rgba(0,0,0,0.5);
    z-index: 6;
  }
  .app-shell.right-sidebar-open .right-sidebar { transform: translateX(0); }
  .right-sidebar-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  .app-shell.right-sidebar-open .right-sidebar-scrim { opacity: 1; pointer-events: auto; }

  .workspace-header { padding: 16px 18px 16px 68px; }
  .content-scroll { padding: 24px 18px 40px; }
  .stats-footer { gap: 0 2px; padding: 8px 4px; max-width: calc(100% - 16px); }
  .stat { padding: 5px 10px; }
  .stat strong { font-size: 15px; }
  .stat span { font-size: 9.5px; }
  .header-right { gap: 6px; }
  .experts-pill { display: none; }
  .mobile-only { display: flex; }
}
@media (min-width: 981px) {
  .mobile-only { display: none; }
}

@media (max-width: 560px) {
  .welcome-block h1 { font-size: 26px !important; }
  .quick-actions { grid-template-columns: 1fr 1fr !important; }
  .suggested-grid { grid-template-columns: 1fr !important; }
  .settings-panel { width: 100vw; }
}

/* ============================= RTL SUPPORT ============================= */

[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--line); }
[dir="rtl"] .right-sidebar { border-left: none; border-right: 1px solid var(--line); }
[dir="rtl"] .app-shell { grid-template-columns: var(--right-sidebar-w) 1fr var(--sidebar-w); }
[dir="rtl"][data-sidebar="compact"] .app-shell { grid-template-columns: var(--right-sidebar-w) 1fr var(--sidebar-w-compact); }
[dir="rtl"] .sidebar { order: 3; }
[dir="rtl"] .workspace { order: 2; }
[dir="rtl"] .right-sidebar { order: 1; }
[dir="rtl"] .new-chat-btn kbd { margin-left: 0; margin-right: auto; }
[dir="rtl"] .nav-item .live-dot { margin-left: 0; margin-right: auto; }
[dir="rtl"] .settings-panel { right: auto; left: 0; border-left: none; border-right: 1px solid var(--line); }
[dir="rtl"] .settings-panel { transform: translateX(-105%); }
[dir="rtl"] .settings-panel.is-open { transform: translateX(0); }
[dir="rtl"] .mobile-menu-toggle { left: auto; right: 16px; }
@media (max-width: 980px) {
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(105%); }
  [dir="rtl"] .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  [dir="rtl"] .workspace-header { padding: 16px 68px 16px 18px; }
}

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

/* =============================================================
   V3 ADDITIONS — Command Palette, Floating Orb, Drag & Drop,
   Business Widgets, PWA Install, Print/PDF export, extra bg modes
   ============================================================= */

/* ---------- Command palette ---------- */

.cmdk-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
.cmdk-scrim.is-open { opacity: 1; pointer-events: auto; }

.cmdk-panel {
  position: fixed;
  top: 14vh; left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.98);
  width: min(560px, 90vw);
  max-height: 60vh;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 40px 100px rgba(0,0,0,0.5), 0 0 0 1px var(--gold-glow-soft);
  z-index: 61;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  overflow: hidden;
}
.cmdk-panel.is-open { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0) scale(1); }

.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input-row svg { width: 18px; height: 18px; flex-shrink: 0; stroke: var(--text-faint); fill: none; stroke-width: 1.8; }
#cmdkInput {
  flex: 1; border: none; background: none; outline: none;
  color: var(--text); font-size: 15px; font-family: var(--font-sans);
}
#cmdkInput::placeholder { color: var(--text-faint); }
.cmdk-esc { font-size: 11px; color: var(--text-faint); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }

.cmdk-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.cmdk-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-dim);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.cmdk-list li .cmdk-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.cmdk-list li .cmdk-hint { margin-left: auto; font-size: 10.5px; color: var(--text-faint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.cmdk-list li.is-selected, .cmdk-list li:hover { background: rgba(var(--gold-rgb),0.12); color: var(--text); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- Floating AI orb ---------- */

/* ---------- Floating action dock ---------- */

.fab-dock {
  position: fixed;
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(20,20,22,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 1px rgba(255,255,255,0.12);
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.fab-btn:hover, .fab-btn:focus-visible {
  transform: scale(1.12);
  background: rgba(var(--gold-rgb), 0.22);
  box-shadow: 0 10px 30px var(--gold-glow), inset 0 1px 1px rgba(255,255,255,0.2);
}
.fab-btn:active { transform: scale(0.96); }
.fab-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.fab-btn:hover[data-tooltip]::after, .fab-btn:focus-visible[data-tooltip]::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
@media (max-width: 980px) {
  .fab-dock {
    top: auto;
    bottom: 90px;
    right: 16px;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fab-btn { transition: none; }
}

/* ---------- Drag & drop overlay ---------- */

.dropzone-overlay {
  position: fixed; inset: 0;
  z-index: 55;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(var(--gold-rgb), 0.08);
  backdrop-filter: blur(6px);
  border: 3px dashed var(--gold-dim);
  margin: 14px;
  border-radius: var(--radius-xl);
}
.dropzone-overlay.is-active { display: flex; }
.dropzone-message {
  padding: 26px 36px;
  border-radius: var(--radius-xl);
  background: var(--bg-raised);
  border: 1px solid var(--gold-dim);
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

/* ---------- Image preview thumbnail (composer) ---------- */

.pending-attachment.has-image { padding: 6px; gap: 10px; }
.pending-attachment .attach-thumb {
  width: 32px; height: 32px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}

/* ---------- Suggested follow-up chips (after AI reply) ---------- */

.followups {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 4px 40px;
}
.followups button {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.followups button:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

/* ---------- Install App button ---------- */

.install-app-btn {
  display: none;
  align-items: center; gap: 8px;
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-dim);
  background: rgba(var(--gold-rgb),0.08);
  color: var(--gold-bright);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.install-app-btn.is-available { display: flex; }

/* ---------- Export menu (txt / pdf) ---------- */

.export-menu {
  position: absolute;
  top: 46px; right: 32px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
  z-index: 30;
  display: none;
  flex-direction: column;
  min-width: 180px;
  overflow: hidden;
}
.export-menu.is-open { display: flex; }
.export-menu button {
  padding: 11px 14px;
  background: none; border: none; text-align: left;
  color: var(--text-dim); font-size: 13px; cursor: pointer;
}
.export-menu button:hover { background: rgba(var(--gold-rgb),0.1); color: var(--text); }

/* ---------- Business widgets: quote calculator ---------- */

.calc-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.025);
  margin-bottom: 20px;
}
.calc-card h3 { margin: 0 0 4px; font-size: 15px; }
.calc-card p.calc-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--text-faint); }
.calc-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.calc-row label { font-size: 12.5px; color: var(--text-dim); font-weight: 600; }
.calc-row select, .calc-row input[type="number"], .calc-row input[type="range"] {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}
.calc-row select:focus, .calc-row input:focus { border-color: var(--gold-dim); }
.calc-result {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(var(--gold-rgb),0.08);
  border: 1px solid var(--gold-dim);
  margin-top: 6px;
}
.calc-result .calc-label { font-size: 12.5px; color: var(--text-dim); }
.calc-result .calc-value { font-size: 22px; font-weight: 800; color: var(--gold-bright); }
.calc-cta {
  margin-top: 14px; width: 100%; padding: 11px;
  border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #100c04; font-weight: 700; font-size: 13px; cursor: pointer;
}

/* ---------- Comparison table ---------- */

.compare-table-wrap { overflow-x: auto; margin-bottom: 24px; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.compare-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.compare-table th, .compare-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table th { color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; background: rgba(255,255,255,0.02); }
.compare-table td.compare-check { color: var(--gold-bright); text-align: center; font-weight: 700; }
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { color: var(--text-dim); font-weight: 600; }

/* ---------- Before / After slider ---------- */

.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 22px;
  user-select: none;
}
.ba-slider .ba-layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.ba-slider .ba-before { background: linear-gradient(135deg, #2a2a2d, #17171a); }
.ba-slider .ba-after {
  background: linear-gradient(135deg, rgba(var(--gold-rgb),0.35), #17171a);
  position: absolute; inset: 0;
  clip-path: inset(0 50% 0 0);
}
.ba-slider .ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 3px; background: var(--gold-bright);
  cursor: ew-resize;
  transform: translateX(-50%);
}
.ba-slider .ba-handle::after {
  content: "⇔";
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #100c04;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.ba-slider .ba-tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,0.5); color: #fff; }
.ba-slider .ba-tag.before-tag { left: 10px; }
.ba-slider .ba-tag.after-tag { right: 10px; }

/* ---------- Page transition on view switch ---------- */

.view-panel { animation: view-slide-in 0.4s var(--ease); }
@keyframes view-slide-in {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Matrix rain / starfield canvases share #particleField ---------- */
/* (rendered via canvas 2D context in site.js — no extra DOM needed) */

/* ---------- Print stylesheet (Export chat as PDF via window.print) ---------- */

#printArea { display: none; }

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    position: absolute; top: 0; left: 0; width: 100%;
    background: #fff; color: #111; padding: 24px;
  }
  #printArea .print-msg { margin-bottom: 14px; page-break-inside: avoid; }
  #printArea .print-role { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #a9803f; margin-bottom: 4px; }
  #printArea .print-text { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
}

@media (max-width: 980px) {
  .cmdk-panel { width: 92vw; top: 8vh; }
}

/* ---------- FAQ smart search ---------- */

.faq-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.faq-search-input {
  flex: 1;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.faq-search-input:focus { border-color: var(--gold-dim); }
.faq-search-input::placeholder { color: var(--text-faint); }
.faq-search-count { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.faq-empty { text-align: center; color: var(--text-faint); font-size: 13px; padding: 20px 0; }

/* ---------- Loading skeletons (shown briefly before content-view data renders) ---------- */

.skeleton-block { padding: 8px 2px; }
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s infinite;
  margin-bottom: 10px;
}
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-70 { width: 70%; }
.skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.skeleton-grid span {
  display: block;
  height: 90px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.6s infinite;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
[data-mode="light"] .skeleton-line,
[data-mode="light"] .skeleton-grid span {
  background: linear-gradient(90deg, rgba(0,0,0,0.04), rgba(0,0,0,0.08), rgba(0,0,0,0.04));
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-line, .skeleton-grid span { animation: none; }
}

/* ---------- Recent list empty state ---------- */

.recent-list-empty { font-size: 12px; color: var(--text-faint); padding: 10px 4px; text-align: center; }
