/* Uninterrupted Infinite Feed + Business Map + Full Diagram Views + Pure Bottom Prompt
   Preserves the original #f7f7f5 canvas surface with #e3e2dc radial dots from template-shell.css & business-workspace.css */
:root {
  --bitcoin-orange: #f97316;
  --jet: #000000;
  --ink-plum: #2c232e;
  --steel: #374151;
  --graphite: #4b5563;
  --slate: #6b7280;
  --fog: #d1d5db;
  --mist: #e2e8f0;
  --off-white: #f9fafb;
  --pure-white: #ffffff;
}

.thread {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: #d6d5cf transparent !important;
}
.thread::-webkit-scrollbar {
  display: block !important;
  width: 6px !important;
  height: 6px !important;
}
.thread::-webkit-scrollbar-thumb {
  background: #d6d5cf !important;
  border-radius: 99px !important;
}

/* 1. No top bar chrome — maximize the left sidebar and let the middle feed run full height */
.topbar {
  display: none !important;
}
.floating-corner-controls {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--mist);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}
.floating-corner-controls .icon-button {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--steel);
}
.floating-corner-controls .icon-button.active {
  background: #f1f5f9;
  color: var(--ink-plum);
}

/* 2. Clean Left-Hand Sidebar — Business Map + Diagram views */
.sidebar {
  width: 214px;
  padding: 12px 10px;
  background: var(--off-white);
  border-right: 1px solid var(--mist);
}
.sidebar-brand {
  margin-bottom: 6px;
  padding: 2px 6px;
}
.sidebar-business-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  margin-bottom: 10px;
  border: 1px solid var(--mist);
  border-radius: 10px;
  background: var(--pure-white);
  text-align: left;
  cursor: pointer;
}
.sidebar-business-switch:hover {
  border-color: var(--fog);
}
.sidebar-business-switch > div {
  flex: 1;
  min-width: 0;
}
.sidebar-business-switch strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-plum);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-business-switch small {
  display: block;
  font-size: 10.5px;
  color: var(--slate);
}
.sidebar-flat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-divider {
  height: 1px;
  background: var(--mist);
  margin: 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  font-size: 13px;
  gap: 10px;
  border-radius: 8px;
  color: var(--steel);
  text-decoration: none;
}
.nav-item.active-nav {
  background: #f1f5f9;
  color: var(--ink-plum);
  font-weight: 600;
}

/* 3. Uninterrupted Infinite Middle Feed — Business Map, Diagrams & Gemini-Style Conversation */
.main-workspace .user-message {
  padding: 16px 32px 6px;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  justify-content: flex-end;
}
.main-workspace .user-message > div {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 14px;
  background: #f1f5f9;
  color: var(--ink-plum);
  border: 1px solid var(--mist);
}
.main-workspace .user-message p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}
.main-workspace .assistant-message {
  padding: 0;
  margin: 0;
}
.main-workspace .assistant-message.chat-reply {
  padding: 8px 32px 16px;
  max-width: 780px;
  margin: 0 auto;
}
.chat-reply-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--pure-white);
  border: 1px solid var(--mist);
  color: var(--ink-plum);
}
.chat-reply-bubble p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-plum);
}
.diagram-card.inline-model {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.thread-content {
  min-height: calc(100dvh + 240px) !important;
  padding-bottom: 220px !important;
}
.canvas-surface {
  margin: 0;
  min-height: 500px;
}
.canvas-surface > .graph-viewport {
  background-color: transparent !important;
  background-image: none !important;
}
.view-guides,
.view-layout-note,
.inline-model-heading,
.canvas-footer,
.relationship-legend,
.assistant-copy,
.assistant-heading,
.response-actions {
  display: none !important;
}

/* 4. Diagla Engine Diagrams (Inputs -> Flywheel -> Outputs, Layers, Pipeline, Money Map, Bottlenecks, Growth) Inside the Infinite Feed */
.feed-engine-card {
  padding: 46px 24px 28px !important;
}
.feed-engine-diagram .dg {
  background: transparent !important;
  padding: 8px 0;
}
@media (min-width: 760px) {
  .feed-engine-diagram .dg .wide-wrap {
    display: block !important;
  }
  .feed-engine-diagram .dg .stack {
    display: none !important;
  }
}

/* Revenue Diagrams (Money Map, Bottlenecks, Growth) inside the feed */
.feed-revenue-diagram.rd {
  padding: 20px 16px;
  color: var(--ink, #222013);
  background: transparent;
  font-family: 'Inter', 'Hanken Grotesk', sans-serif;
  border-radius: 18px;
  container-type: inline-size;
  min-width: 0;
}
.rd-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 20px;
}
.rd-heading h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.2;
}
.rd-heading p {
  max-width: 70ch;
  margin: 6px 0 0;
  color: #5b6068;
  font-size: 13.5px;
  line-height: 1.45;
}
.rd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.rd-brand svg {
  width: 28px;
  height: 28px;
  fill: var(--s2, #5a6778);
}
.rd-brand b {
  display: block;
  font-size: 17px;
  font-weight: 750;
}
.rd-brand span {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-top: 3px;
}
.rd-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: 'Inter', 'Hanken Grotesk', sans-serif;
}
.rd-edge {
  fill: none;
  stroke: var(--s2, #5a6778);
  stroke-width: 1.8;
}
.rd-dashed {
  stroke-dasharray: 6 5;
}
.rd-node .rd-surface {
  fill: var(--t50, #fff);
  stroke: var(--t200, #dcdad3);
  stroke-width: 1;
}
.rd-node.rd-strong .rd-surface {
  fill: var(--f2, #e9eef4);
  stroke: none;
}
.rd-node.rd-leak .rd-surface {
  fill: var(--f1, #f5f7f9);
  stroke: var(--s2, #5a6778);
  stroke-dasharray: 6 5;
}
.rd-disc {
  fill: var(--d2, #3d4b5c);
}
.rd-section-disc {
  fill: var(--ink, #1f2328);
}
.rd-disc-text {
  fill: #fff;
  font-size: 12.5px;
  font-weight: 700;
  text-anchor: middle;
}
.rd-node[data-insight] {
  cursor: pointer;
}
.rd-node[data-insight]:hover > .rd-surface,
.rd-node[data-linked] > .rd-surface,
.rd-node[aria-expanded="true"] > .rd-surface {
  stroke: var(--s2, #6548c4);
  stroke-width: 2.2;
}
.rd-title {
  fill: var(--ink, #1e293b);
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.018em;
}
.rd-sub {
  fill: var(--body, #475569);
  font-size: 13.5px;
  font-weight: 400;
}
.rd-tag {
  fill: var(--d2, #47309a);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.rd-column {
  fill: var(--ink, #1e293b);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.rd-hub-ring {
  fill: var(--f2, #d8cbff);
  fill-opacity: 0.45;
}
.rd-hub {
  fill: #fff;
  stroke: var(--line, #e6e2d6);
  stroke-width: 2;
}
.rd-hub-tag,
.rd-hub-sub {
  text-anchor: middle;
  fill: var(--body, #475569);
  font-size: 13px;
}
.rd-hub-tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--d2, #47309a);
}
.rd-hub-title {
  text-anchor: middle;
  fill: var(--ink, #1e293b);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.rd-mobile {
  display: none;
}
.rd-detail {
  position: relative;
  margin-top: 16px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--t200, #dcd0ff);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}
.rd-detail > .xbtn {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 18px;
  color: var(--body, #475569);
  cursor: pointer;
}
.rd-detail > .label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--d2, #47309a);
}
.rd-detail h4 {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink, #1e293b);
}
.rd-detail dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px 18px;
}
.rd-detail dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--body, #475569);
}
.rd-detail dd {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--ink, #1e293b);
}
.go-controls,
.rd-growth-link {
  display: none !important;
}
.growth-overview {
  display: grid;
  gap: 0;
}
.go-stage {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(300px, 1.55fr) minmax(210px, 1fr);
  gap: 20px;
  align-items: start;
  padding-block: 8px 22px;
}
.go-stage .go-band {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0;
  border-top: 0;
}
.go-stage .go-cells {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.go-cycle {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--line, #e6e2d6);
}
.go-cycle > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
}
.go-cycle > header > .go-disc {
  grid-row: span 2;
}
.go-cycle > header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink, #1e293b);
}
.go-cycle > header p {
  margin: 0;
  font-size: 12.5px;
  color: var(--body, #475569);
}
.go-wheel {
  width: min(100%, 440px);
  margin-inline: auto;
}
.go-wheel svg {
  display: block;
  width: 100%;
  height: auto;
}
.go-wheel path[data-insight] {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.go-wheel path[data-insight]:hover,
.go-wheel path[data-linked] {
  stroke: var(--d2, #47309a);
  stroke-width: 8px;
}
.go-band {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(0, 3fr);
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line, #e6e2d6);
  align-items: start;
}
.go-band > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: start;
}
.go-band > header > .go-disc {
  grid-row: span 2;
  margin-top: 1px;
}
.go-band > header h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink, #1e293b);
}
.go-band > header p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--body, #475569);
}
.go-cells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}
.go-disc {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--ink, #1e293b);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.go-entry {
  min-width: 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line, #e6e2d6);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.go-entry.go-strong {
  background: var(--t50, #f4f1ff);
  border-color: var(--t200, #dcd0ff);
}
.go-entry.go-leak {
  background: #fcfbfa;
  border-style: dashed;
}
.go-entry[data-insight] {
  cursor: pointer;
}
.go-entry[data-insight]:hover,
.go-entry[data-linked],
.go-entry[aria-expanded="true"] {
  border-color: var(--s2, #6548c4);
  box-shadow: 0 2px 10px rgba(101, 72, 196, 0.1);
}
.go-entry-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.go-entry-head > span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--d2, #47309a);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}
.go-entry h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.3;
  color: var(--ink, #1e293b);
}
.go-entry p {
  margin: 6px 0 0;
  color: var(--body, #475569);
  font-size: 12.5px;
  line-height: 1.45;
}
.go-entry dl {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line, #e6e2d6);
  display: grid;
  gap: 4px;
  font-size: 11.5px;
}
.go-entry dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.go-entry dt {
  color: var(--body, #475569);
  font-weight: 500;
}
.go-entry dd {
  margin: 0;
  color: var(--ink, #1e293b);
  font-weight: 600;
  text-align: right;
}
.go-total {
  margin: 0 0 10px !important;
  font-size: 13px !important;
  color: var(--ink, #1e293b) !important;
}
.rd-growth-connections {
  margin-top: 14px;
  border-top: 1px solid var(--line, #e6e2d6);
  padding-top: 12px;
}
.rd-growth-connections > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--d2, #47309a);
  user-select: none;
}
@media (max-width: 1180px) {
  .go-stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .go-band {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

/* 5. Pure Floating Prompt Window at the Bottom — Nothing Extra Above It */
.composer-wrap {
  padding: 6px 20px 12px;
}
.composer {
  max-width: 740px;
  border-radius: 14px;
  border: 1px solid var(--mist);
  box-shadow: 0 4px 18px rgba(44, 35, 46, 0.06);
  background: var(--pure-white);
}
.send-button {
  background: var(--ink-plum) !important;
  color: var(--pure-white) !important;
}
.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 0;
}
.attachment-tray[hidden] {
  display: none !important;
}
.attachment-tray > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 8px;
  background: #f3f2ee;
  font-size: 12px;
  color: #2c3137;
}
.attachment-tray > span button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #686e77;
  font-size: 14px;
  line-height: 1;
}
.prompt-main {
  padding: 10px 14px 2px;
}
.prompt-main textarea {
  font-size: 14px;
  min-height: 36px;
  line-height: 1.5;
}
.composer-bottom {
  padding: 2px 10px 8px;
  gap: 6px;
}
.composer-tools > .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 7px;
}
.send-tools .mic-button,
.send-button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.canvas-rail .icon-button {
  width: 32px;
  height: 32px;
}
.canvas-dock .icon-button {
  width: 28px;
  height: 28px;
}

/* 6. Workstation Auto-Layout Modes (Flow / Tree / Swimlanes), Markmap Branch Folding & Excalidraw Whiteboard Layer */
.layout-mode-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #f1f5f9;
  border-radius: 8px;
  margin-right: 4px;
}
.layout-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.layout-mode-btn:hover {
  color: #0f172a;
}
.layout-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.drawing-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
}
.graph-viewport[data-active-tool="eraser"] .drawing-layer {
  pointer-events: auto;
}
.graph-viewport[data-active-tool="eraser"] .wb-drawing,
.graph-viewport[data-active-tool="eraser"] .wb-callout {
  pointer-events: auto;
  cursor: pointer;
}
.graph-viewport[data-active-tool="eraser"] .wb-drawing:hover,
.graph-viewport[data-active-tool="eraser"] .wb-callout:hover {
  opacity: 0.45;
}
.graph-viewport.drawing-mode {
  cursor: crosshair !important;
}
.graph-viewport.drawing-mode .canvas-node {
  pointer-events: none;
}
.callout-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.wb-callout {
  pointer-events: auto;
}
.wb-callout:focus,
.wb-callout .inline-editing {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  cursor: text;
}
.swimlane-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.ink-palette {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
}
.ink-swatch {
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--swatch, #0f172a);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ink-swatch:hover {
  transform: scale(1.12);
}
.ink-swatch.selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px var(--swatch, #0f172a);
}
.branch-fold-btn {
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 99px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}
.branch-fold-btn:hover {
  border-color: #0f172a;
  background: #f8fafc;
}
.branch-fold-btn.is-folded {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
.workspace-canvas-tools .drawing-tools,
.canvas-dock.drawing-tools {
  flex-wrap: wrap;
  max-width: calc(100vw - 32px);
}
