﻿/* ============================================================
   Showcraft in-app shell — shared across all 3 mode mocks.
   Token values + chrome (top bar, side rails, watermark).
   Extracted from dense frames of WebsiteShowcraftDemo.o.mp4.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,200;0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,300;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  /* Marketing palette (carries into the app shell) */
  --bg:        #000;
  --bg-soft:   #0a0a0a;
  --bg-card:   #141414;
  --ink:       #e8e8ec;    /* primary text — slightly tinted gray, not pure white */
  --ink-mute:  #d4d4d8;
  --ink-dim:   #a8a8ad;
  --ink-low:   #6a6a70;
  --rule:      #222;
  --rule-soft: #2a2a2a;

  /* App-shell additions (estimated from screenshots) */
  --app-bg:        #0e0e10;     /* canvas background */
  --app-bg-2:      #161618;     /* slightly lifted (mode-switcher fill) */
  --app-panel:     #18181a;     /* side rails fill */
  --app-panel-2:   #1d1d20;     /* node card / inspector card */
  --app-panel-3:   #232327;     /* hovered surface */
  --app-edge:      #4a4a52;     /* bezier stroke */
  --app-edge-pill: #0a0a0c;     /* edge label fill */
  --app-edge-glyph:#76767e;     /* edge pill leading glyph */

  /* Saturated accents (in-product only) */
  --app-blue:      #3b82f6;
  --app-blue-hi:   #60a5fa;
  --app-blue-bg:   rgba(59,130,246,0.14);
  --app-purple:    #a78bfa;     /* logo glyph */
  --app-violet:    #c4b5fd;     /* avatar 1 */
  --app-green:     #34d399;     /* avatar 2 */

  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ============================================================
   SCROLLBARS — dark, minimal, matched to app chrome
   ============================================================ */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}
/* In-app rails get an even subtler treatment to keep chrome quiet */
.left-rail::-webkit-scrollbar-thumb,
.inspector-panel::-webkit-scrollbar-thumb,
.editor-scenes::-webkit-scrollbar-thumb,
.script-list::-webkit-scrollbar-thumb,
.scene-grid::-webkit-scrollbar-thumb,
.story-data::-webkit-scrollbar-thumb,
.chat-panel::-webkit-scrollbar-thumb,
.editor-right::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.06);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.left-rail::-webkit-scrollbar-thumb:hover,
.inspector-panel::-webkit-scrollbar-thumb:hover,
.editor-scenes::-webkit-scrollbar-thumb:hover,
.script-list::-webkit-scrollbar-thumb:hover,
.scene-grid::-webkit-scrollbar-thumb:hover,
.story-data::-webkit-scrollbar-thumb:hover,
.chat-panel::-webkit-scrollbar-thumb:hover,
.editor-right::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.12);
  background-clip: padding-box;
}

/* ============================================================
   PAGE SHELL — wraps the app mock with caption metadata
   ============================================================ */
.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-header { margin-bottom: 24px; }
.page-eyebrow {
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 500;
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.page-eyebrow::before { content: ""; width: 32px; height: 1px; background: var(--ink); }
.page-title {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 300; line-height: 1.02;
  letter-spacing: -0.015em; text-transform: uppercase;
  margin-bottom: 12px;
}
.page-title em { font-style: italic; font-weight: 300; color: var(--ink-mute); text-transform: none; }
.page-sub { font-size: 16px; color: var(--ink-dim); max-width: 70ch; line-height: 1.6; font-weight: 300; }

.page-nav {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 18px;
  font-family: var(--mono); font-size: 11px;
}
.page-nav a {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--ink-low);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--bg-soft);
}
.page-nav a:hover, .page-nav a.active { color: var(--ink); border-color: var(--ink-dim); }
.page-nav a.active { background: var(--app-blue-bg); border-color: rgba(59,130,246,0.4); color: var(--app-blue-hi); }

.mock-frame {
  background: var(--app-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.mock-frame-caption {
  padding: 12px 18px;
  background: var(--bg-soft);
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-dim);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.mock-frame-caption strong { color: var(--ink); font-weight: 500; }
.mock-frame-caption code { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); background: var(--bg-card); border: 1px solid var(--rule); border-radius: 3px; padding: 2px 6px; }

/* ============================================================
   APP SHELL — the actual product chrome
   ============================================================ */
.app {
  position: relative;
  width: 100%;
  height: 820px;
  background: var(--app-bg);
  font-family: var(--sans);
  display: grid;
  grid-template-columns: 52px 288px 1fr 52px;
  grid-template-rows: 48px 1fr;
  overflow: hidden;
}

/* ============================================================
   OUTER NAV STRIP (far-left, 52px) — logo top + ACTIVE TABS centered
   ============================================================ */
.outer-nav {
  grid-column: 1; grid-row: 2;       /* now only spans content row — top-bar owns the top */
  background: var(--app-bg);
  border-right: 1px solid var(--rule);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center; justify-items: center;
  padding: 14px 0 14px;
  position: relative;
}
.outer-nav-top {
  grid-row: 1;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
/* Round '+' button under the logo */
.outer-nav-add {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--app-panel-2);
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  border-radius: 50%;
  flex-shrink: 0;
}
.outer-nav-add svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.outer-nav-tools {
  grid-row: 2;
  align-self: center;     /* CENTERED in remaining vertical space */
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.outer-nav-theme {
  grid-row: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.outer-nav-logo {
  width: 32px; height: 32px;
  background-image: url('raw/tmp_nura_synapse.jpg');
  background-size: 1920px 1080px;
  background-position: -8px -8px;
  background-repeat: no-repeat;
  border-radius: 7px;
  flex-shrink: 0;
}
.outer-nav-icon {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--ink-low);
  transition: none;
}
.outer-nav-icon:hover { color: var(--ink-mute); background: rgba(255,255,255,0.04); }
.outer-nav-icon.active { color: var(--ink); background: rgba(255,255,255,0.08); }
.outer-nav-icon.tool-active { color: var(--app-blue-hi); background: var(--app-blue-bg); }
.outer-nav-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.outer-nav-icon svg.filled { fill: currentColor; stroke: none; }
/* MODE-ACTIVE — sole emphasised icon in the outer-nav.
   Subtle blue tint, slightly larger square, brighter foreground. Matches demo. */
.outer-nav-icon.mode-active {
  width: 34px; height: 34px;
  background: var(--app-blue-bg);
  color: var(--app-blue-hi);
  border-radius: 7px;
}
.outer-nav-icon.mode-active svg { width: 18px; height: 18px; stroke-width: 1.6; }
/* Left-rail TYPE TABS — sits at top of the left rail (right of outer-nav).
   These are filter tabs for what shows in the tree. */
.rail-typetabs {
  display: flex; align-items: center; gap: 2px;
  padding: 14px 18px 14px;
  border-bottom: 1px solid var(--rule);
  height: 64px;          /* fixed row height — all children center inside it */
}
.rail-typetabs .add-btn {
  width: 32px; height: 32px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 8px;
  flex-shrink: 0;
}
.rail-typetabs .add-btn svg { width: 12px; height: 12px; }
.rail-typetabs .ttab {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--ink-low);
}
.rail-typetabs .ttab:hover { color: var(--ink-mute); background: rgba(255,255,255,0.04); }
.rail-typetabs .ttab.active { color: var(--ink); background: rgba(255,255,255,0.06); }
.rail-typetabs .ttab svg { width: 16px; height: 16px; fill: currentColor; }
.rail-typetabs .ttab svg.stroke { fill: none; stroke: currentColor; stroke-width: 1.6; }
.rail-typetabs .rail-bookmark {
  margin-left: auto;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-low);
  border-radius: 6px;
}
.rail-typetabs .rail-bookmark svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* TOP BAR — ~48px tall. Now spans the FULL width (over outer-nav too) so the brand sits top-left */
.top-bar {
  grid-column: 1 / -1; grid-row: 1;
  display: grid; grid-template-columns: auto auto 1fr auto;
  align-items: center;
  background: var(--app-bg);
  border-bottom: 1px solid var(--rule);
  padding: 0 18px 0 12px;
  font-size: 13px;
  gap: 18px;
}
.top-logo {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.top-logo-mark {
  width: 32px; height: 32px;
  background-image: url('raw/tmp_nura_synapse.jpg');
  background-size: 1920px 1080px;
  background-position: -8px -8px;
  background-repeat: no-repeat;
  border-radius: 7px;
  flex-shrink: 0;
}
.top-logo-menu {
  width: 12px; height: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-low); font-size: 10px;
}
.top-left { display: flex; align-items: center; gap: 18px; min-width: 0; }
/* legacy logo classes — kept hidden */
.app-logo { display: none; }
.outer-nav-logo { display: none; }
.crumb {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-low);
  white-space: nowrap; overflow: hidden;
  font-weight: 400;
}
.crumb .sep { color: #3a3a3a; font-size: 11px; }
.crumb .crumb-anchor { color: var(--ink); font-weight: 600; }
.crumb .crumb-cur { color: var(--ink-mute); font-weight: 400; }

.mode-switcher {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.mode-switcher::after { content: "▾"; font-size: 10px; opacity: 0.45; margin-left: 1px; color: var(--ink-low); }

.avatar-stack { display: inline-flex; align-items: center; }
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  border: 2px solid var(--app-bg);
  margin-left: -8px;
}
.avatar:first-child { margin-left: 0; }
/* Avatar tones — tuned to match demo (FE peach/orange, SP teal/cyan) */
.avatar.violet { background: linear-gradient(135deg, #fdba74, #f97316); color: #431407; }
.avatar.green  { background: linear-gradient(135deg, #5eead4, #14b8a6); color: #042f2e; }
.avatar-menu {
  margin-left: 4px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-low);
  font-size: 13px;
}

/* LEFT RAIL (column 2, 288px) — character/data tree */
.left-rail {
  grid-column: 2; grid-row: 2;
  background: var(--app-panel);
  border-right: 1px solid var(--rule);
  font-size: 14px;
  overflow-y: auto;
  padding: 0;
}
/* Rail-top: + button and 5-icon tab strip on the SAME horizontal row */
.rail-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px 14px;
  border-bottom: 1px solid var(--rule);
}
.rail-add-btn {
  width: 40px; height: 40px;
  background: var(--app-bg);
  border: 1px solid var(--rule);
  border-radius: 50%;
  margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-mute); font-size: 16px;
  flex-shrink: 0;
}
.rail-add-btn svg { width: 14px; height: 14px; }
.rail-tabs {
  flex: 1;
  display: flex; align-items: center; gap: 1px;
  padding: 0;
  border-bottom: 0;
  margin-bottom: 0;
}
.rail-tab {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--ink-low);
}
.rail-tab.active { background: var(--app-panel-2); color: var(--ink); }
.rail-tab svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.rail-tab svg.filled { fill: currentColor; stroke: none; }
.rail-bookmark { margin-left: auto; }

.rail-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 10px;
  font-family: var(--sans);
  color: var(--ink-mute);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 500;
}
.rail-add-mini {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  color: var(--ink-mute);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rule);
  flex-shrink: 0;
}
.rail-add-mini svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.rail-section .rail-add-mini { /* keep specificity but align to base */
  width: 22px; height: 22px;
}
.rail-folder {
  display: flex; align-items: center; padding: 14px 20px 7px 22px;
  color: var(--ink); font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-top: 1px solid var(--rule-soft);
  margin-top: 6px;
}
.rail-section + .rail-folder {
  border-top: 0; margin-top: 0;
  padding-top: 7px;
}
.rail-folder::before {
  content: "▾"; font-size: 8px; margin-right: 10px;
  color: var(--ink-low);
  width: 8px; display: inline-block;
}
.rail-folder.collapsed::before { content: "▸"; }
.rail-folder .rail-add-mini {
  margin-left: auto;
  /* size/style inherited from base .rail-add-mini — keep 1:1 with All Characters */
}

.rail-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 8px 42px;
  font-size: 13px; color: var(--ink-mute);
  font-weight: 400;
  position: relative;
}
.rail-item:hover { background: rgba(255,255,255,0.03); }
.rail-item.active {
  background: var(--app-blue-bg);
  color: var(--ink);
}
.rail-item.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--app-blue);
}
.rail-item-icons { display: inline-flex; gap: 6px; opacity: 0.5; font-size: 11px; }
.rail-item.active .rail-item-icons { opacity: 1; }

/* RIGHT DOCK — column 4, 3-part vertical: top (i) + middle stack + bottom (bell/help) */
.right-dock {
  grid-column: 4; grid-row: 2;
  background: var(--app-bg);
  border-left: 1px solid var(--rule);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center; justify-items: center;
  padding: 12px 0; gap: 0;
  position: relative;
}
.right-dock .dock-top {
  grid-row: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.right-dock .dock-middle {
  grid-row: 2;
  align-self: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.right-dock .dock-bottom {
  grid-row: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.dock-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--ink-low); font-size: 14px;
  position: relative;
}
.dock-icon:hover { color: var(--ink-mute); background: rgba(255,255,255,0.04); }
.dock-icon.active { color: var(--app-blue-hi); background: var(--app-blue-bg); }
.dock-icon.alert {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}
.dock-icon.alert::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: #ef4444; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--app-bg);
}
.dock-icon.bottom { margin-top: auto; }

/* CANVAS — column 3 now (was 2 before outer-nav) */
.canvas {
  grid-column: 3; grid-row: 2;
  background: var(--app-bg);
  position: relative;
  overflow: hidden;
}

/* WATERMARK — legacy, now hidden in favour of .app-footer */
.app-watermark { display: none; }

/* GLOBAL APP FOOTER — spans full width below the .app grid.
   SHOWCRAFT branding left, theme toggle right. */
.app-footer {
  display: flex; align-items: center; justify-content: space-between;
  height: 28px;
  padding: 0 16px;
  background: var(--app-bg);
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--ink-low);
}
.app-footer .footer-brand { display: inline-flex; align-items: center; gap: 4px; }
.app-footer .footer-brand strong { color: var(--ink-mute); font-weight: 500; letter-spacing: 0.02em; }
.app-footer .footer-theme {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--ink-low);
  cursor: pointer;
}
.app-footer .footer-theme:hover { color: var(--ink-mute); background: rgba(255,255,255,0.04); }
.app-footer .footer-theme svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
