/* ==========================================================================
   Serca — Unified Design System (Graphite Mode)
   Vuxion-inspired editorial design language
   Single source of truth for all tokens, typography, components, animations
   ========================================================================== */

/* ---------- Font Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght,wdth@0,100..900,62.5..125;1,100..900,62.5..125&display=swap');

/* ==========================================================================
   DESIGN TOKENS — Graphite (Dark) Mode
   ========================================================================== */

:root {
  /* ==========================================================
     COLOR — Core palette
     ========================================================== */

  /* Carbon family — primary ink */
  --vx-ink-900: #181818;
  --vx-ink-800: #23252B;
  --vx-ink-700: #3B434D;

  /* Slate family — signet */
  --vx-gold-600: #2A2F37;
  --vx-gold-500: #3B434D;
  --vx-gold-400: #4A535F;
  --vx-gold-300: #5C6470;

  /* Neutrals — blush paper */
  --vx-parchment: #F0E8E5;
  --vx-bone:      #F6F0EE;
  --vx-linen:     #E5DDDA;
  --vx-stone-600: #7A7E84;
  --vx-stone-500: #A4A7AC;
  --vx-stone-300: rgba(24, 24, 24, 0.10);

  /* ==========================================================
     SEMANTIC TOKENS — Graphite Mode
     ========================================================== */

  --bg-page:    #111113;
  --bg-surface: #1F2025;
  --bg-sunken:  #1e1e21;
  --bg-card:    #23252B;
  --bg-ink:     #2A2C32;
  --bg-ink-soft:#33363D;

  /* Carbon override — top nav, project editor toolbar */
  --bg-carbon:        #141416;
  --bg-carbon-border: #2A2C32;

  --fg-1: #F0E8E5;
  --fg-2: rgba(240, 232, 229, 0.62);
  --fg-3: rgba(240, 232, 229, 0.42);
  --fg-4: rgba(240, 232, 229, 0.28);
  --fg-on-ink-1: #F0E8E5;
  --fg-on-ink-2: rgba(240, 232, 229, 0.62);
  --fg-on-ink-3: rgba(240, 232, 229, 0.42);

  --accent:        #F0E8E5;
  --accent-strong: #FFFFFF;
  --accent-soft:   rgba(240, 232, 229, 0.10);
  --accent-1:      #F0E8E5;
  --accent-1-fg:   #181818;
  --accent-3:      #C68A78;
  --accent-4:      #8C97A8;
  --accent-5:      #B89888;

  --border-hairline: rgba(255,255,255,0.07);
  --border-strong:   rgba(255,255,255,0.18);
  --border-medium:   rgba(255,255,255,0.11);
  --border-gold:     rgba(240, 232, 229, 0.30);
  --border-on-ink:   rgba(240, 232, 229, 0.22);

  --hover-darken: rgba(240, 232, 229, 0.05);
  --press-darken: rgba(240, 232, 229, 0.09);
  --focus-ring:   0 0 0 2px var(--bg-page), 0 0 0 4px var(--accent);

  --ok:    #8FB59A;
  --warn:  #C68A78;
  --error: #D87E76;

  --shadow-1: 0 1px 0 rgba(240, 232, 229, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 0 rgba(240, 232, 229, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 1px 0 rgba(240, 232, 229, 0.04) inset, 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-gold-glow: 0 0 0 1px var(--border-gold), 0 8px 28px rgba(240, 232, 229, 0.10);

  /* ==========================================================
     CHIP SEMANTIC COLORS — used by inline highlight chips
     in the manuscript editor (Project Editor — Linear)
     ========================================================== */
  --pv-chip-specificity-bg:   rgba(240, 232, 229, 0.18);
  --pv-chip-specificity-fg:   var(--accent);
  --pv-chip-emotional-bg:     rgba(186, 138, 218, 0.18);
  --pv-chip-emotional-fg:     #C7A1E8;
  --pv-chip-object-bg:        rgba(108, 187, 210, 0.16);
  --pv-chip-object-fg:        #8EC8E0;
  --pv-chip-narrative-bg:     rgba(126, 198, 153, 0.16);
  --pv-chip-narrative-fg:     #9FD7B8;
  --pv-chip-mission-bg:       rgba(240, 232, 229, 0.14);
  --pv-chip-mission-fg:       var(--accent-strong);
  --pv-chip-stakes-bg:        rgba(226, 109, 92, 0.14);
  --pv-chip-stakes-fg:        #ECA294;

  /* ==========================================================
     TYPOGRAPHY
     ========================================================== */
  --font-sans:   "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:   ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --wdth-condensed: 85;
  --wdth-normal:    100;
  --wdth-expanded:  112;

  --display-wdth:   110;
  --display-wght:   300;
  --display-track:  -0.025em;

  --body-wght:      400;
  --body-track:     -0.005em;

  --eyebrow-wdth:   88;
  --eyebrow-wght:   500;
  --eyebrow-track:  0.22em;

  --fs-display-xl: clamp(64px, 8vw, 128px);
  --fs-display-l:  clamp(48px, 6vw, 88px);
  --fs-display-m:  clamp(40px, 4.5vw, 64px);
  --fs-h1:         44px;
  --fs-h2:         32px;
  --fs-h3:         24px;
  --fs-h4:         20px;
  --fs-body-l:     18px;
  --fs-body:       16px;
  --fs-body-s:     14px;
  --fs-meta:       13px;
  --fs-eyebrow:    12px;

  --lh-display: 1.02;
  --lh-heading: 1.15;
  --lh-body:    1.55;
  --lh-tight:   1.25;

  /* ==========================================================
     SPACING & RADII
     ========================================================== */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;
  --space-10: 128px;

  --r-0: 0px;
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-pill: 999px;

  /* ==========================================================
     MOTION
     Three durations + one curve do almost everything.
     --dur-fast (~150ms): hovers, color/border swaps
     --dur-base (~220ms): tooltips, focus
     --dur-slow (~400ms): view swaps, sliding pills
     --ease-soft:  smooth ease-out for micro-interactions
     --ease-edge:  sharp-in / soft-out for big motion
     ========================================================== */
  --ease-soft:  cubic-bezier(.2, .6, .2, 1);
  --ease-edge:  cubic-bezier(.6, .05, .2, 1);
  --dur-fast:   150ms;
  --dur-base:   220ms;
  --dur-med:    260ms; /* legacy alias kept for back-compat */
  --dur-slow:   400ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-base: 1ms;
    --dur-med:  1ms;
    --dur-slow: 1ms;
  }
}

/* ==========================================================================
   BASE RESET & BODY
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-variation-settings: "wdth" var(--wdth-normal), "wght" var(--body-wght);
  letter-spacing: var(--body-track);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

::selection {
  background: rgba(240, 232, 229, 0.28);
  color: #181818;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-2);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hairline); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-medium); }

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */

@keyframes serca-pulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  80% { transform: scale(2); opacity: 0; }
  100% { transform: scale(2); opacity: 0; }
}

@keyframes sercaPageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sercaCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sercaShimmer {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes sercaGlowPulse {
  0%, 100% { box-shadow: var(--shadow-1); }
  50% { box-shadow: var(--shadow-gold-glow); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   TYPOGRAPHY CLASSES
   ========================================================================== */

.vx-display-xl,
.vx-display-l,
.vx-display-m {
  font-family: var(--font-sans);
  font-variation-settings: "wdth" var(--display-wdth), "wght" var(--display-wght);
  letter-spacing: var(--display-track);
  line-height: var(--lh-display);
  text-wrap: balance;
}
.vx-display-xl { font-size: var(--fs-display-xl); }
.vx-display-l  { font-size: var(--fs-display-l); }
.vx-display-m  { font-size: var(--fs-display-m); }

h1, .vx-h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  font-variation-settings: "wdth" 102, "wght" 500;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h2, .vx-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-heading);
  font-variation-settings: "wdth" 100, "wght" 500;
  letter-spacing: -0.01em;
}
h3, .vx-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  font-variation-settings: "wdth" 100, "wght" 600;
  letter-spacing: -0.005em;
}
h4, .vx-h4 {
  font-size: var(--fs-h4);
  line-height: var(--lh-tight);
  font-variation-settings: "wdth" 100, "wght" 600;
}

p, .vx-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.vx-body-l  { font-size: var(--fs-body-l); line-height: 1.5; }
.vx-body-s  { font-size: var(--fs-body-s); line-height: 1.55; color: var(--fg-2); }
.vx-meta    { font-size: var(--fs-meta);  color: var(--fg-3); }

.vx-eyebrow {
  font-size: var(--fs-eyebrow);
  font-variation-settings: "wdth" var(--eyebrow-wdth), "wght" var(--eyebrow-wght);
  letter-spacing: var(--eyebrow-track);
  text-transform: uppercase;
  color: var(--fg-3);
}

.vx-rule { border: 0; height: 1px; background: var(--border-hairline); }
.vx-rule--gold { background: var(--border-gold); }

/* ==========================================================================
   LOGO
   ========================================================================== */

.logo-wordmark,
.logo h1 {
  font-family: var(--font-sans);
  font-size: 20px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.serca-btn {
  appearance: none;
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--fg-1);
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-2);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-variation-settings: "wdth" 100, "wght" 500;
  letter-spacing: -0.002em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.serca-btn:hover { background: var(--hover-darken); }

.serca-btn--ghost {
  border-color: transparent;
  color: var(--fg-2);
}
.serca-btn--ghost:hover { color: var(--fg-1); background: var(--hover-darken); }

.serca-btn--accent {
  border-color: var(--border-gold);
  color: var(--vx-ink-900);
  background: var(--accent);
}
.serca-btn--accent:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.serca-btn--ink {
  background: var(--accent);
  color: var(--accent-1-fg);
  border-color: var(--accent);
}
.serca-btn--ink:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.serca-iconbtn {
  appearance: none;
  width: 30px; height: 30px;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.serca-iconbtn:hover {
  background: var(--hover-darken);
  color: var(--fg-1);
}
.serca-iconbtn[data-active="true"] {
  background: var(--bg-ink-soft);
  color: var(--fg-1);
}

/* ==========================================================================
   RAIL NAVIGATION (56px icon-only sidebar)
   ========================================================================== */

.serca-rail {
  width: 56px;
  border-right: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 4px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.serca-rail-mark {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in oklab, var(--accent) 20%, transparent);
  color: var(--accent);
  margin-bottom: 8px;
}
.serca-rail-mark svg { width: 16px; height: 16px; }

.serca-rail-divider {
  width: 24px; height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 0;
}

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

.serca-rail-btn {
  position: relative;
  appearance: none;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-3);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
  text-decoration: none;
}
.serca-rail-btn:hover { background: rgba(255,255,255,0.05); color: var(--fg-1); }
.serca-rail-btn[data-active="true"] {
  background: rgba(255,255,255,0.06);
  color: var(--fg-1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.serca-rail-btn[data-active="true"]::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  height: 8px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}
.serca-rail-btn svg { width: 18px; height: 18px; }

.serca-rail-count {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  font-size: 9px;
  font-variation-settings: "wdth" 88, "wght" 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 25%, #1f1f22);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.serca-rail-spacer { flex: 1; }

.serca-rail-avatar {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  margin-top: 4px;
}

.serca-rail-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #0E0E10;
  color: var(--fg-1);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-variation-settings: "wdth" 100, "wght" 480;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms var(--ease-soft), transform 120ms var(--ease-soft);
  z-index: 50;
}
.serca-rail-btn:hover .serca-rail-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ==========================================================================
   USER CHIP / AVATAR
   ========================================================================== */

.serca-avatar {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--bg-ink-soft);
  color: var(--fg-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  flex-shrink: 0;
}

.serca-user-chip {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 7px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease-soft);
}
.serca-user-chip:hover { background: rgba(255,255,255,0.035); }

.serca-user-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}
.serca-user-chip-name {
  font-size: 12px;
  font-variation-settings: "wdth" 100, "wght" 540;
  color: var(--fg-1);
  letter-spacing: -0.005em;
}
.serca-user-chip-status {
  font-size: 10.5px;
  color: var(--fg-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.serca-status-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: #5BC48A;
  box-shadow: 0 0 0 2px rgba(91,196,138,0.18);
  display: inline-block;
}

/* User dropdown (for user menu in rail) */
.user-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  z-index: 200;
}
.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-hairline);
}
.user-dropdown-header .ud-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-1);
}
.user-dropdown-header .ud-email {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 2px;
}
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--fg-1);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft);
}
.user-dropdown-item:hover { background: var(--hover-darken); }
.user-dropdown-item svg { opacity: 0.7; flex-shrink: 0; }
.user-dropdown-item.danger { color: var(--error); }

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

.serca-app {
  display: grid;
  grid-template-columns: 56px 1fr;
  height: 100vh;
  background: var(--bg-page);
  color: var(--fg-1);
  font-family: var(--font-sans);
}

.serca-main {
  margin-left: 56px;
  flex: 1;
  padding: 36px 48px;
  min-height: 100vh;
  overflow-y: auto;
  animation: sercaPageIn var(--dur-slow) var(--ease-edge);
}

.serca-main-inner {
  max-width: 1240px;
  margin: 0 auto;
}

/* ==========================================================================
   PAGE HEADERS
   ========================================================================== */

.serca-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.serca-page-head h1 {
  font-size: 44px;
  margin: 0;
  font-variation-settings: "wdth" 110, "wght" 320;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg-1);
}

.serca-page-eyebrow {
  font-size: 10.5px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 8px;
}

.serca-page-sub {
  font-size: 14px;
  color: var(--fg-2);
  margin-top: 12px;
  line-height: 1.55;
  max-width: 560px;
}

/* ==========================================================================
   KPI / STATS ROW
   ========================================================================== */

.serca-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 32px;
}

.serca-kpi {
  padding: 22px 24px;
  border-right: 1px solid var(--border-hairline);
}
.serca-kpi:last-child { border-right: 0; }

.serca-kpi-label {
  font-size: 10px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 10px;
}

.serca-kpi-num {
  font-size: 40px;
  font-variation-settings: "wdth" 110, "wght" 300;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--fg-1);
}

.serca-kpi-foot {
  font-size: 11px;
  color: var(--fg-3);
  margin-top: 6px;
}
.serca-kpi-foot .up { color: var(--ok); }

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */

.serca-search-bar {
  position: relative;
  margin-bottom: 24px;
}

.serca-search-bar input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: var(--r-2);
  padding: 0 16px 0 42px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--fg-1);
  outline: none;
  letter-spacing: -0.005em;
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.serca-search-bar input::placeholder { color: var(--fg-4); }
.serca-search-bar input:focus { border-color: var(--border-strong); }

.serca-search-bar-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
}

/* ==========================================================================
   PLATFORM TABS / FILTERS
   ========================================================================== */

.serca-platform-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 3px;
  background: var(--bg-surface);
}

.serca-platform-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-variation-settings: "wdth" 100, "wght" 500;
  letter-spacing: -0.002em;
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft);
}
.serca-platform-tab[data-active="true"] {
  background: var(--bg-ink);
  color: var(--fg-1);
}
.serca-platform-tab:hover:not([data-active="true"]) { color: var(--fg-1); }

/* ==========================================================================
   PROJECT CARDS (My Projects)
   ========================================================================== */

.serca-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(264px, 1fr));
  gap: 20px;
}

.serca-project {
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: var(--r-3);
  padding: 0;
  cursor: pointer;
  transition: border-color var(--dur-med) var(--ease-soft),
              transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: sercaCardIn 520ms var(--ease-edge) both;
}
.serca-project:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.serca-project-cover {
  height: 110px;
  background: linear-gradient(135deg, #1a1a1d 0%, #0B0B0D 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
.serca-project-cover-platform {
  position: absolute;
  top: 12px; left: 14px;
  font-size: 9.5px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.serca-project-body { padding: 16px 18px 18px; }

.serca-project-title {
  font-size: 14px;
  font-variation-settings: "wdth" 102, "wght" 500;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  margin: 0 0 10px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.serca-project-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.serca-meta-pill {
  font-size: 9.5px;
  font-variation-settings: "wdth" 88, "wght" 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  color: var(--fg-2);
}
.serca-meta-pill--gold {
  border-color: var(--border-gold);
  color: var(--accent);
}

.serca-project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  font-size: 11px;
  color: var(--fg-3);
}

/* New project tile */
.serca-project--new {
  border: 1px dashed var(--border-strong);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  min-height: 248px;
  color: var(--fg-3);
  text-align: center;
  padding: 24px;
}
.serca-project--new:hover {
  border-color: var(--accent);
  border-style: solid;
  color: var(--fg-1);
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}
.serca-project--new strong {
  display: block;
  font-size: 14px;
  font-variation-settings: "wdth" 102, "wght" 500;
  color: var(--fg-1);
  letter-spacing: -0.005em;
}
.serca-project--new span {
  font-size: 12px;
  color: var(--fg-3);
  max-width: 200px;
  line-height: 1.5;
}

/* ==========================================================================
   VAULT CLIPS (Inspiration Vault content cards)
   ========================================================================== */

.serca-vault-clips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.serca-vclip {
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: var(--r-3);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--dur-med) var(--ease-soft),
              transform var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft);
  display: flex;
  flex-direction: column;
  animation: sercaCardIn 520ms var(--ease-edge) both;
}
.serca-vclip:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.serca-vclip-thumb {
  height: 138px;
  background: linear-gradient(135deg, #1a1a1d 0%, #0B0B0D 100%);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}
.serca-vclip-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.serca-vclip-platform {
  position: absolute;
  top: 10px; left: 12px;
  font-size: 9px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  color: var(--accent);
}

.serca-vclip-time {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 10px;
  color: rgba(245,241,232,0.85);
  background: rgba(1,15,39,0.7);
  padding: 2px 6px;
  border-radius: 2px;
}

.serca-vclip-status {
  position: absolute;
  top: 10px; right: 12px;
  font-size: 9px;
  font-variation-settings: "wdth" 88, "wght" 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,241,232,0.85);
  background: rgba(1,15,39,0.6);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  padding: 3px 7px;
  border-radius: 999px;
}

.serca-vclip-body { padding: 14px 16px 16px; }

.serca-vclip-title {
  font-size: 13.5px;
  font-variation-settings: "wdth" 102, "wght" 500;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.serca-vclip-author {
  font-size: 11.5px;
  color: var(--fg-3);
  margin-bottom: 10px;
}

.serca-vclip-stats {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--fg-2);
  margin-bottom: 12px;
}
.serca-vclip-stats strong {
  font-variation-settings: "wdth" 100, "wght" 500;
  color: var(--fg-1);
  margin-right: 3px;
}

.serca-vclip-actions {
  display: flex;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

/* ==========================================================================
   FOLDERS
   ========================================================================== */

.serca-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.serca-folder {
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  border-radius: var(--r-3);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease-soft);
  animation: sercaCardIn 520ms var(--ease-edge) both;
}
.serca-folder:hover {
  border-color: var(--border-gold);
  transform: translateY(-1px);
}

.serca-folder-cover {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  height: 110px;
  margin-bottom: 12px;
  border-radius: 2px;
  overflow: hidden;
}

.serca-folder-tile {
  background: #15151A;
  position: relative;
  overflow: hidden;
}
.serca-folder-tile:first-child { grid-row: span 2; }
.serca-folder-tile img {
  width: 100%; height: 100%; object-fit: cover;
}

.serca-folder-eyebrow {
  font-size: 9px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.serca-folder-title {
  font-size: 13.5px;
  font-variation-settings: "wdth" 102, "wght" 500;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  margin-bottom: 4px;
}

.serca-folder-meta {
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.04em;
}

.serca-folder--new {
  border: 1px dashed var(--border-strong);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 184px;
  color: var(--fg-3);
}
.serca-folder--new:hover {
  border-color: var(--accent);
  border-style: solid;
}

/* ==========================================================================
   MEMORY PAGE
   ========================================================================== */

.serca-memory-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.serca-memory-intro {
  padding: 24px 28px;
  border: 1px solid var(--border-gold);
  background: var(--bg-surface);
  border-radius: var(--r-3);
  margin-bottom: 32px;
  position: relative;
}
.serca-memory-intro::before {
  content: "";
  position: absolute;
  left: -1px; top: 16px; bottom: 16px;
  width: 2px;
  background: var(--accent);
}
.serca-memory-intro-eyebrow {
  font-size: 10px;
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.serca-memory-intro-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-2);
  letter-spacing: -0.003em;
}
.serca-memory-intro-body strong {
  color: var(--fg-1);
  font-variation-settings: "wdth" 100, "wght" 600;
}

.serca-memory-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-hairline);
}

.serca-memory-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  padding: 22px 4px;
  border-bottom: 1px solid var(--border-hairline);
  align-items: start;
  transition: background var(--dur-fast) var(--ease-soft);
}
.serca-memory-item:hover {
  background: color-mix(in oklab, var(--accent) 4%, transparent);
}

.serca-memory-item-mark {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 9px;
}

.serca-memory-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-1);
  letter-spacing: -0.005em;
  font-variation-settings: "wdth" 102, "wght" 400;
}

.serca-memory-meta {
  font-size: 10.5px;
  color: var(--fg-3);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-variation-settings: "wdth" 88, "wght" 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.serca-memory-meta-tag {
  border: 1px solid var(--border-hairline);
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0.04em;
  font-variation-settings: "wdth" 100, "wght" 500;
  color: var(--fg-2);
  font-size: 10.5px;
}

.serca-memory-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-soft);
}
.serca-memory-item:hover .serca-memory-actions { opacity: 1; }

/* Confidence dots */
.serca-conf {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
}
.serca-conf-dot {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: var(--border-strong);
}
.serca-conf-dot[data-on="true"] { background: var(--accent); }

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.show { display: flex; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-3);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-3);
  animation: sercaCardIn var(--dur-med) var(--ease-edge);
}

.modal h3 {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--fg-1);
}

.modal textarea,
.modal input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-2);
  color: var(--fg-1);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.modal textarea:focus,
.modal input:focus {
  border-color: var(--border-strong);
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-3);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--fg-1);
  z-index: 200;
  box-shadow: var(--shadow-2);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.3s var(--ease-soft), opacity 0.3s var(--ease-soft);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   AUTH CARD STYLES
   ========================================================================== */

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: var(--bg-page);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-3);
  padding: 40px;
  position: relative;
  z-index: 10;
  animation: fadeIn 0.4s var(--ease-soft);
}

.subtitle {
  text-align: center;
  color: var(--fg-3);
  font-size: 0.88rem;
  margin-bottom: 32px;
}

/* Auth tabs */
.tabs {
  display: flex;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-2);
  padding: 4px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--fg-3);
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: var(--r-2);
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.tab.active {
  background: var(--bg-surface);
  color: var(--fg-1);
}
.tab:hover:not(.active) { color: var(--fg-2); }

/* Auth form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--fg-3);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-2);
  color: var(--fg-1);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-soft);
  outline: none;
}
.form-group input::placeholder {
  color: var(--fg-4);
}
.form-group input:focus {
  border-color: var(--border-strong);
}

/* Auth buttons */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  color: var(--accent-1-fg);
  font-size: 0.84rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:active { opacity: 0.85; }

.btn-primary.loading span { opacity: 0; }

.btn-primary .spinner {
  display: none;
  width: 20px; height: 20px;
  border: 2px solid rgba(24, 24, 24, 0.3);
  border-top-color: var(--accent-1-fg);
  border-radius: 50%;
  position: absolute;
}
.btn-primary.loading .spinner {
  display: block;
  animation: spin 0.6s linear infinite;
}

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-hairline);
}
.divider span {
  font-size: 0.68rem;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.social-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.btn-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  background: transparent;
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-2);
  color: var(--fg-1);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.btn-social span {
  font-size: 0.68rem;
  color: var(--fg-3);
}
.btn-social:hover {
  border-color: var(--border-strong);
  background: var(--hover-darken);
}

.forgot-password {
  text-align: center;
  margin-top: 24px;
  font-size: 0.82rem;
}
.forgot-password a {
  color: var(--fg-3);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-soft);
}
.forgot-password a:hover { color: var(--fg-1); }

.message {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--r-2);
  font-size: 0.84rem;
  display: none;
  animation: fadeIn 0.3s var(--ease-soft);
}
.message.show { display: block; }
.message.success {
  background: rgba(143,181,154,0.1);
  border: 1px solid rgba(143,181,154,0.2);
  color: var(--ok);
}
.message.error {
  background: rgba(216,126,118,0.1);
  border: 1px solid rgba(216,126,118,0.2);
  color: var(--error);
}

/* ==========================================================================
   TAGS
   ========================================================================== */

.serca-tag {
  font-size: 9.5px;
  font-variation-settings: "wdth" 88, "wght" 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  color: var(--fg-3);
  background: transparent;
  white-space: nowrap;
}
.serca-tag--gold {
  border-color: var(--border-gold);
  color: var(--accent);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.serca-empty {
  text-align: center;
  padding: 60px 24px;
}
.serca-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.serca-empty h3 {
  font-size: 15px;
  color: var(--fg-1);
  margin-bottom: 6px;
  font-weight: 500;
}
.serca-empty p {
  font-size: 13px;
  color: var(--fg-3);
  line-height: 1.6;
  max-width: 380px;
  margin: 0 auto;
}

/* ==========================================================================
   PRICING PAGE
   ========================================================================== */

.pricing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}
.pricing-header h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 600;
  color: var(--fg-1);
  margin-bottom: 8px;
}
.pricing-header p {
  color: var(--fg-3);
  font-size: 15px;
  max-width: 500px;
}

.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-3);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.pricing-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  opacity: 0.7;
}

.plan-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-1);
  margin-bottom: 4px;
}
.plan-tagline {
  color: var(--fg-3);
  font-size: 13px;
  margin-bottom: 20px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 24px;
}
.plan-price .currency {
  font-size: 20px;
  color: var(--fg-3);
  font-weight: 500;
}
.plan-price .amount {
  font-size: 48px;
  font-weight: 700;
  color: var(--fg-1);
  line-height: 1;
}
.plan-price .period {
  font-size: 14px;
  color: var(--fg-3);
}

.plan-features {
  list-style: none;
  margin-bottom: 28px;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13.5px;
  color: var(--fg-3);
  border-bottom: 1px solid var(--border-hairline);
}
.plan-features li:last-child { border-bottom: 0; }
.plan-features .check {
  color: var(--ok);
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.btn-subscribe {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--accent-1-fg);
  border: none;
  border-radius: var(--r-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  font-family: var(--font-sans);
}
.btn-subscribe:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Trial banner */
.trial-banner {
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border: 1px solid var(--border-gold);
  border-radius: var(--r-3);
  padding: 16px 24px;
  margin-bottom: 32px;
  text-align: center;
  max-width: 480px;
  width: 100%;
}

/* ==========================================================================
   SETTINGS PAGE COMPONENTS
   ========================================================================== */

.settings-section {
  margin-bottom: 40px;
}
.section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
}

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

@media (max-width: 768px) {
  .serca-main { padding: 24px 16px; }
  .serca-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .serca-projects { grid-template-columns: 1fr; }
  .serca-vault-clips { grid-template-columns: 1fr; }
  .serca-folders { grid-template-columns: 1fr; }
  .social-buttons { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 24px; }
}

@media (max-width: 480px) {
  .serca-page-head h1 { font-size: 32px; }
  .serca-kpi-row { grid-template-columns: 1fr; }
  .serca-kpi { border-right: 0; border-bottom: 1px solid var(--border-hairline); }
  .serca-kpi:last-child { border-bottom: 0; }
}

/* ==========================================================================
   MOTION POLISH — Transitions & Animations
   Applied globally to all pages for consistent feel
   ========================================================================== */

/* Card entrance animation */
.content-card,
.script-card,
.folder-card,
.composition-card,
.serca-project,
.serca-vclip,
.serca-folder {
  animation: sercaCardIn 520ms var(--ease-edge) both;
}

/* Staggered entrance for card grids */
.serca-projects > :nth-child(1),
.serca-vault-clips > :nth-child(1),
.serca-folders > :nth-child(1) { animation-delay: 0ms; }
.serca-projects > :nth-child(2),
.serca-vault-clips > :nth-child(2),
.serca-folders > :nth-child(2) { animation-delay: 40ms; }
.serca-projects > :nth-child(3),
.serca-vault-clips > :nth-child(3),
.serca-folders > :nth-child(3) { animation-delay: 80ms; }
.serca-projects > :nth-child(4),
.serca-vault-clips > :nth-child(4),
.serca-folders > :nth-child(4) { animation-delay: 120ms; }
.serca-projects > :nth-child(5),
.serca-vault-clips > :nth-child(5),
.serca-folders > :nth-child(5) { animation-delay: 160ms; }
.serca-projects > :nth-child(6),
.serca-vault-clips > :nth-child(6),
.serca-folders > :nth-child(6) { animation-delay: 200ms; }

/* Nav items */
.serca-rail-btn {
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease-soft);
}

/* Buttons lift */
.serca-btn,
.serca-btn--ink,
.serca-btn--accent,
.serca-btn--ghost,
.btn,
.btn-primary,
.btn-secondary {
  transition: transform var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft),
              opacity var(--dur-fast) var(--ease-soft);
}

/* Card thumbnail zoom on hover */
.serca-vclip-thumb img,
.serca-folder-tile img,
.serca-project-cover img {
  transition: transform 700ms var(--ease-edge), filter 700ms var(--ease-edge);
}
.serca-vclip:hover .serca-vclip-thumb img,
.serca-folder:hover .serca-folder-tile img,
.serca-project:hover .serca-project-cover img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.04);
}

/* Input focus transitions */
input, textarea, select {
  transition: background var(--dur-med) var(--ease-soft),
              border-color var(--dur-med) var(--ease-soft),
              box-shadow var(--dur-med) var(--ease-soft);
}
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Modal entrance */
.modal {
  animation: sercaCardIn var(--dur-med) var(--ease-edge);
}

/* Processing card glow */
.processing {
  animation: sercaGlowPulse 2.2s var(--ease-soft) infinite;
}

/* ==========================================================================
   SCRIPT EDITOR POLISH — Refinements for the editor page
   ========================================================================== */

/* Editor left sidebar glass effect */
.content-sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%), var(--bg-surface);
  border-right-color: rgba(255,255,255,0.07);
}

/* Editor header with gradient */
.editor-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
  backdrop-filter: blur(20px);
  border-bottom-color: rgba(255,255,255,0.07);
}

/* Mode toggle (Linear/Canvas) pill refinement */
.mode-toggle {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px;
}

.mode-btn.active {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
  border-radius: 999px;
}

/* Right sidebar glass effect */
.right-sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), transparent 30%), var(--bg-surface);
  border-left-color: rgba(255,255,255,0.07);
}

/* AI suggestion card refinement */
.ai-suggestion {
  border-color: var(--border-gold);
  background: color-mix(in oklab, var(--accent) 4%, transparent);
  position: relative;
}
.ai-suggestion::before {
  content: "";
  position: absolute;
  left: -1px; top: 14px; bottom: 14px;
  width: 2px;
  background: var(--accent);
}

/* Diff view refinements */
.diff-row--del {
  background: rgba(226, 109, 92, 0.08);
  border-left: 2px solid rgba(226, 109, 92, 0.5);
}
.diff-row--add {
  background: rgba(111, 207, 151, 0.06);
  border-left: 2px solid rgba(111, 207, 151, 0.5);
}

/* Chat message bubbles */
.chat-message.user .message-content {
  border-radius: 14px 14px 4px 14px;
}

/* Canvas dot background */
.canvas-container {
  background:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-page);
}

/* Canvas card refinements */
.canvas-card {
  border-radius: var(--r-3);
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 1px 3px rgba(0,0,0,0.3),
    0 4px 16px rgba(0,0,0,0.2);
}
.canvas-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-2);
}

/* Editor block sections */
.script-section {
  border-bottom-color: color-mix(in oklab, var(--accent) 12%, transparent);
}

/* Section number eyebrow */
.section-number {
  font-variation-settings: "wdth" 88, "wght" 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Pulse indicator for AI status */
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  animation: serca-pulse 2.4s ease-out infinite;
  opacity: 0;
}

/* Save indicator */
.save-indicator .saved-dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--ok);
}

/* Toolbar dividers */
.toolbar-divider {
  width: 1px; height: 16px;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
}

/* Word count ribbon */
.word-count-bar {
  border-top-color: color-mix(in oklab, var(--accent) 16%, transparent);
  background: var(--bg-ink-soft);
}

/* Sidebar content clips */
.sidebar-content-item {
  transition: background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.sidebar-content-item:hover {
  background: rgba(245, 241, 232, 0.05);
}
.sidebar-content-item.active {
  background: color-mix(in oklab, var(--accent) 8%, transparent);
  border-color: color-mix(in oklab, var(--accent) 40%, transparent);
}

/* Mode pill buttons (chat mode selector) */
.mode-pill {
  border-radius: 999px;
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.mode-pill.active {
  color: var(--vx-ink-900);
  background: var(--accent);
  border-color: var(--accent);
}

/* Inline highlight marks */
mark[data-highlight] {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  border-bottom: 1px solid var(--border-gold);
  padding: 0 2px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft);
}
mark[data-highlight]:hover {
  background: color-mix(in oklab, var(--accent) 32%, transparent);
}

/* Send button in chat */
.send-btn {
  background: var(--accent);
  color: var(--vx-ink-900);
  border-color: var(--accent);
  border-radius: var(--r-2);
  transition: background var(--dur-fast) var(--ease-soft);
}
.send-btn:hover {
  background: var(--accent-strong);
}

/* View transition between linear/board */
.view-transition {
  transition:
    opacity 320ms cubic-bezier(.6,.05,.2,1),
    transform 420ms cubic-bezier(.6,.05,.2,1),
    filter 320ms cubic-bezier(.6,.05,.2,1);
  will-change: opacity, transform, filter;
}

/* ==========================================================================
   VIDEO BREAKDOWN POLISH
   ========================================================================== */

.vb-body {
  background:
    radial-gradient(900px 480px at 12% -10%, color-mix(in oklab, var(--accent) 6%, transparent), transparent 70%),
    radial-gradient(700px 380px at 105% 8%, color-mix(in oklab, var(--accent-3) 5%, transparent), transparent 70%),
    var(--bg-page);
}

.vb-verdict::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  opacity: 0.7;
}

/* Carbon override on the video-breakdown topbar — matches workspace shell */
.vb-topbar {
  background: var(--bg-carbon) !important;
  border-bottom-color: var(--bg-carbon-border) !important;
}

/* Beat marker palette — the only place --accent-3/4/5 (terracotta /
   blue-grey / taupe) get visible duty in graphite */
.vb-beat[data-beat-tone="1"] { --beat-color: var(--accent-3); }
.vb-beat[data-beat-tone="2"] { --beat-color: var(--accent-4); }
.vb-beat[data-beat-tone="3"] { --beat-color: var(--accent-5); }
.vb-beat[data-beat-tone="0"] { --beat-color: var(--accent); }

/* Beat marker hover — 150ms scale on the dot + tooltip-style fade */
.vb-beat {
  transition: background var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft);
}

/* Transcript line — playhead sync animation
   Active line gets an --accent left rule + soft 150ms background crossfade */
.vb-doc-beat[data-active="true"] {
  background: color-mix(in oklab, var(--accent) 5%, transparent);
  box-shadow: inset 2px 0 0 0 var(--accent);
}
.vb-line-time { font-feature-settings: "tnum"; }

/* Memory-update toast — accent 14% bubble with --accent text */
.vb-mem-toast,
.vb-memory-toast {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
  font: 600 11px/1 var(--font-sans);
  letter-spacing: 0.04em;
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
}

/* ==========================================================================
   WORKSPACE SHELL — Top Nav (.serca-topnav)
   Carbon override #141416 with hairline #2A2C32 underline.
   Used on dashboard / scripts / memories where a horizontal nav exists.
   ========================================================================== */

.serca-topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 52px;
  padding: 0 20px;
  background: var(--bg-carbon);
  border-bottom: 1px solid var(--bg-carbon-border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.serca-topnav-mark {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}
.serca-topnav-mark svg { width: 14px; height: 14px; }

.serca-topnav-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.serca-topnav-tab {
  appearance: none;
  position: relative;
  background: transparent;
  border: 0;
  color: var(--fg-3);
  padding: 8px 14px;
  border-radius: 8px;
  font: 500 12.5px/1 var(--font-sans);
  font-variation-settings: "wdth" 100, "wght" 500;
  letter-spacing: -0.002em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.serca-topnav-tab:hover { color: var(--fg-1); }
.serca-topnav-tab[data-active="true"] {
  color: var(--fg-1);
  background: rgba(255,255,255,0.045);
}
.serca-topnav-tab[data-active="true"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: -8px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.serca-topnav-tab-badge {
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
  font: 600 9.5px/1 var(--font-sans);
  letter-spacing: 0.04em;
}

.serca-topnav-search {
  margin-left: auto;
  position: relative;
}
.serca-topnav-search input {
  height: 32px;
  width: 240px;
  padding: 0 12px 0 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  color: var(--fg-1);
  font: 500 12.5px/1 var(--font-sans);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft);
}
.serca-topnav-search input::placeholder { color: var(--fg-3); }
.serca-topnav-search input:focus {
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.06);
}
.serca-topnav-search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
}

.serca-topnav-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 22%, #1a1a1d);
  color: var(--vx-ink-900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 11px/1 var(--font-sans);
  letter-spacing: 0.06em;
  cursor: pointer;
  border: 0;
  flex-shrink: 0;
}

/* ==========================================================================
   PROJECT EDITOR — pv-* classes (Linear / Board view)
   ========================================================================== */

/* Toolbar — carbon override matching workspace top-nav */
.pv-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  padding: 0 20px;
  background: var(--bg-carbon);
  border-bottom: 1px solid var(--bg-carbon-border);
}
.pv-toolbar-back {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--fg-2);
  font: 500 12.5px/1 var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft),
              color var(--dur-fast) var(--ease-soft);
}
.pv-toolbar-back:hover {
  background: var(--hover-darken);
  color: var(--fg-1);
}
.pv-toolbar-title {
  font: 500 13.5px/1 var(--font-sans);
  color: var(--fg-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pv-toolbar-title em {
  font-style: normal;
  color: var(--fg-3);
  font-weight: 400;
}

/* Linear/Board segmented control (the sliding pill) */
.pv-mode-seg {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 3px;
  margin-left: auto;
}
.pv-mode-seg-bg {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transform: translateX(0);
  transition: transform var(--dur-slow) var(--ease-edge),
              background-color var(--dur-fast) var(--ease-soft);
  z-index: 0;
  pointer-events: none;
}
.pv-mode-seg[data-mode="board"] .pv-mode-seg-bg {
  transform: translateX(100%);
}
.pv-mode-seg-btn {
  appearance: none;
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
  padding: 6px 18px;
  border-radius: 999px;
  font: 500 12px/1 var(--font-sans);
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft);
}
.pv-mode-seg-btn[data-active="true"] { color: var(--fg-1); }

/* Left panel — Library */
.pv-lib {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%),
    var(--bg-surface);
  border-right: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pv-lib-eyebrow {
  font: 600 10px/1 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 16px 16px 10px;
}
.pv-lib-tabs {
  display: flex;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.pv-lib-tab {
  position: relative;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  font: 500 12px/1 var(--font-sans);
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft);
}
.pv-lib-tab:hover { color: var(--fg-2); }
.pv-lib-tab[data-active="true"] { color: var(--fg-1); }
.pv-lib-tab[data-active="true"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.pv-lib-search {
  position: relative;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.pv-lib-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 7px;
  color: var(--fg-1);
  font: 500 12px/1 var(--font-sans);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.pv-lib-search input::placeholder { color: var(--fg-4); }
.pv-lib-search input:focus { border-color: var(--border-strong); }

/* Library clip cards — long shorthand transition for 'lift' feel */
.pv-clip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              transform var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft);
}
.pv-clip:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-2);
}
.pv-clip-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: #0B0B0D;
}
.pv-clip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pv-clip-overlay {
  position: absolute;
  bottom: 6px; left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: var(--accent);
  font: 600 9.5px/1 var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pv-clip-overlay--time {
  left: auto;
  right: 6px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-feature-settings: "tnum";
}

/* Center panel — Manuscript meta pills */
.pv-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  font: 500 11px/1 var(--font-sans);
  color: var(--fg-2);
}
.pv-meta-pill em { font-style: normal; color: var(--fg-3); }
.pv-meta-pill strong { font-weight: 600; color: var(--fg-2); }

/* Inline highlight chips — semantic palette
   Use as: <span class="pv-chip pv-chip--specificity">…</span> */
.pv-chip {
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--pv-chip-specificity-bg);
  color: var(--pv-chip-specificity-fg);
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease-soft);
  cursor: pointer;
}
.pv-chip:hover {
  background: color-mix(in oklab, var(--accent) 28%, transparent);
}
.pv-chip--specificity { background: var(--pv-chip-specificity-bg); color: var(--pv-chip-specificity-fg); }
.pv-chip--emotional   { background: var(--pv-chip-emotional-bg);   color: var(--pv-chip-emotional-fg); }
.pv-chip--object      { background: var(--pv-chip-object-bg);      color: var(--pv-chip-object-fg); }
.pv-chip--narrative   { background: var(--pv-chip-narrative-bg);   color: var(--pv-chip-narrative-fg); }
.pv-chip--mission     { background: var(--pv-chip-mission-bg);     color: var(--pv-chip-mission-fg); }
.pv-chip--stakes      { background: var(--pv-chip-stakes-bg);      color: var(--pv-chip-stakes-fg); }

/* Suggested-changes diff card */
.pv-sugg {
  position: relative;
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  background: color-mix(in oklab, var(--accent) 4%, var(--bg-card));
  padding: 16px;
  overflow: hidden;
}
.pv-sugg::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: linear-gradient(180deg,
              color-mix(in oklab, var(--accent) 6%, transparent),
              transparent);
  pointer-events: none;
}
.pv-sugg-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pv-sugg-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.pv-sugg-eyebrow {
  font: 600 9.5px/1 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.pv-sugg-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.pv-sugg-btn {
  appearance: none;
  height: 30px;
  padding: 0 14px;
  border-radius: 7px;
  font: 500 12px/1 var(--font-sans);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.pv-sugg-btn--accept {
  background: var(--accent);
  color: var(--bg-page);
  border: 1px solid var(--accent);
}
.pv-sugg-btn--accept:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.pv-sugg-btn--reject {
  background: transparent;
  color: var(--fg-2);
  border: 1px solid var(--border-hairline);
}
.pv-sugg-btn--reject:hover {
  color: var(--fg-1);
  border-color: var(--border-strong);
  background: var(--hover-darken);
}

/* Right panel — Sidekick AI */
.pv-sidekick {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 30%),
    var(--bg-surface);
  border-left: 1px solid rgba(255,255,255,0.07);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pv-msg {
  padding: 12px 14px;
  border-radius: 10px;
  font: 500 13px/1.5 var(--font-sans);
  margin-bottom: 10px;
}
.pv-msg--ai {
  background: transparent;
  color: var(--fg-1);
}
.pv-msg--ai .pv-msg-eyebrow {
  font: 600 9.5px/1 var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.pv-msg--user {
  background: color-mix(in oklab, var(--accent) 6%, transparent);
  border: 1px solid var(--border-hairline);
  color: var(--fg-1);
  margin-left: 32px;
  border-radius: 14px 14px 4px 14px;
}
.pv-input {
  position: relative;
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  background: var(--bg-page);
  padding: 10px 12px;
  transition: border-color var(--dur-fast) var(--ease-soft);
}
.pv-input:focus-within { border-color: var(--border-strong); }
.pv-input textarea {
  width: 100%;
  min-height: 28px;
  resize: none;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--fg-1);
  font: 500 13px/1.4 var(--font-sans);
}
.pv-send {
  appearance: none;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg-page);
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-soft);
}
.pv-send:hover { background: var(--accent-strong); }

/* ==========================================================================
   PROJECT EDITOR — Linear ↔ Board view crossfade (the big one)
   Both panes mounted, stacked absolutely.
   data-active="true" / "false" toggles trigger the transition.
   ========================================================================== */

.pv-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.pv-view {
  position: absolute;
  inset: 0;
  transition: opacity 320ms var(--ease-edge),
              transform 420ms var(--ease-edge),
              filter 320ms var(--ease-edge);
  will-change: opacity, transform, filter;
}
.pv-view[data-active="true"] {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
  z-index: 2;
  pointer-events: auto;
}
/* Linear exits by receding (slight shrink + drop + 6px blur) */
.pv-view--linear[data-active="false"] {
  opacity: 0;
  transform: scale(.985) translateY(8px);
  filter: blur(6px);
  z-index: 1;
  pointer-events: none;
}
/* Board exits by zooming past you (1.04 scale + 10px blur) */
.pv-view--board[data-active="false"] {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(10px);
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   PROJECT EDITOR — Board view stage
   Dot-grid background painted on --bg-page (graphite override).
   Light mode would use rgba(0,0,0,0.05).
   ========================================================================== */

.pv-board {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-page);
  overflow: auto;
}

/* Board cards — dual-shadow base, gold border on hover (no translate) */
.pv-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 4px 16px rgba(0,0,0,0.2);
  transition: border-color var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft);
}
.pv-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-2);
}
.pv-card--note {
  background: linear-gradient(180deg,
              color-mix(in oklab, var(--accent) 10%, transparent),
              color-mix(in oklab, var(--accent) 4%, transparent)),
              var(--bg-surface);
  border-color: var(--border-gold);
}
.pv-card--ai {
  position: relative;
  border-color: var(--border-gold);
}
.pv-card--ai::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 1px;
  background: var(--accent);
}

.pv-board-connectors {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Top tools / dock */
.pv-board-tools {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  box-shadow: var(--shadow-1);
  z-index: 5;
}
.pv-board-tool {
  appearance: none;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-soft),
              background-color var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft);
}
.pv-board-tool:hover { color: var(--fg-1); background: var(--hover-darken); }
.pv-board-tool[data-active="true"] {
  background: var(--bg-ink);
  border-color: var(--border-strong);
  color: var(--fg-1);
}

/* ==========================================================================
   GLOBAL BUTTON LOCKSTEP — long shorthand transition
   Every button-style component reacts identically, in sync.
   ========================================================================== */

.serca-btn,
.serca-btn--ink,
.serca-btn--accent,
.serca-btn--ghost,
.btn,
.btn-primary,
.btn-secondary,
.serca-iconbtn,
.serca-platform-tab,
.mode-pill,
.pv-toolbar-back,
.pv-mode-seg-btn,
.pv-lib-tab,
.pv-sugg-btn,
.pv-board-tool,
.pv-send {
  transition:
    color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft),
    border-color var(--dur-fast) var(--ease-soft),
    transform var(--dur-fast) var(--ease-soft),
    box-shadow var(--dur-fast) var(--ease-soft);
}

/* Color swatches scale 1 → 1.15 on hover */
.color-swatch,
.serca-color-swatch {
  transition: transform var(--dur-fast) var(--ease-soft);
}
.color-swatch:hover,
.serca-color-swatch:hover {
  transform: scale(1.15);
}
