:root {
  color-scheme: light;
  --bg: #ebe8df;
  --panel: #fbfaf6;
  --panel-soft: #f2efe6;
  --ink: #191c20;
  --muted: #62645d;
  --line: #cfc8ba;
  --teal: #2f554b;
  --teal-soft: #e6ede9;
  --blue: #37495a;
  --amber: #7b5b36;
  --amber-soft: #efe5d4;
  --red: #8f3b31;
  --red-soft: #f5ded9;
  --green: #496f43;
  --shadow: 0 16px 34px rgba(43, 39, 31, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
}

button,
input {
  font: inherit;
}

button,
.source-row {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

h1,
h2,
h3,
p,
ol,
blockquote {
  margin: 0;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.topbar {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(230px, auto) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.brand h1 {
  font-size: 17px;
  line-height: 1.1;
}

.brand p,
.muted,
.source-row input + span,
.source-copy {
  color: var(--muted);
}

.brand p,
.muted {
  font-size: 12px;
}

.source-set-chip {
  justify-self: end;
  border: 1px solid #b9dfda;
  border-radius: 999px;
  background: var(--teal-soft);
  color: #075d57;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 850;
}

.top-waitlist-link {
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.top-waitlist-link:hover {
  background: #066d66;
}

.back-to-landing {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.back-to-landing:hover {
  border-color: #697369;
  background: #f2efe5;
}

.status-pill,
.review-badge {
  border-radius: 999px;
  background: var(--panel-soft);
  color: #34413d;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-pill.ready,
.review-badge.ready {
  background: var(--teal-soft);
  color: #075d57;
}

.notebook-layout {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(430px, 1.25fr) minmax(300px, 0.8fr);
  gap: 12px;
}

.notebook-layout.sources-hidden {
  grid-template-columns: 44px minmax(430px, 1.25fr) minmax(300px, 0.8fr);
}

.notebook-layout.sources-hidden .sources-panel {
  display: none;
}

.sources-panel,
.notebook-panel,
.outputs-panel {
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.sources-panel,
.outputs-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notebook-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.notebook-panel.chat-active {
  grid-template-rows: auto minmax(0, 1fr);
}

.notebook-panel.chat-active .summary-card {
  padding: 10px 16px;
}

.notebook-panel.chat-active .summary-top,
.notebook-panel.chat-active .summary-brief,
.notebook-panel.chat-active .summary-findings {
  display: none;
}

.panel-title,
.mini-head,
.summary-top,
.viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.panel-actions {
  display: flex;
  gap: 6px;
}

.show-sources-button {
  align-self: start;
  justify-self: stretch;
  min-width: 0;
  min-height: 128px;
  height: 128px;
  border: 1px solid #b9dfda;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 12px 0;
  font-weight: 850;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 0;
}

.show-sources-button[hidden] {
  display: none;
}

.panel-title h2,
.summary-card h2 {
  font-size: 17px;
  line-height: 1.2;
}

.mini-head h3,
.viewer-head h3 {
  font-size: 14px;
}

.kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tour-strip {
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #fff;
  padding: 10px 16px;
  display: grid;
  gap: 7px;
}

.tour-strip[hidden] {
  display: none;
}

.app-shell.tour-running .tour-strip {
  position: fixed;
  left: var(--tour-card-left, clamp(18px, 4vw, 56px));
  top: var(--tour-card-top, clamp(88px, 13vh, 128px));
  z-index: 24;
  width: min(var(--tour-card-width, 390px), calc(100vw - 32px));
  max-height: min(236px, calc(100vh - 32px));
  overflow: auto;
  transform: none;
  border: 2px solid var(--teal);
  background: rgba(255, 255, 255, 0.98);
  padding: 14px 16px;
  gap: 10px;
  text-align: left;
  box-shadow: 0 28px 80px rgba(8, 52, 48, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.86) inset;
}

.tour-scrim {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(16, 24, 21, 0.52);
  pointer-events: none;
}

.tour-scrim[hidden] {
  display: none;
}

.tour-next-button,
.tour-back-button,
.tour-continue-button {
  position: fixed;
  z-index: 25;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(8, 52, 48, 0.28);
}

.tour-back-button {
  background: #fff;
  color: var(--teal);
  border: 1px solid #b9dfda;
}

.tour-continue-button {
  left: 16px;
  bottom: 16px;
  z-index: 26;
}

.tour-next-button[hidden],
.tour-back-button[hidden],
.tour-continue-button[hidden] {
  display: none;
}

.tour-next-button:disabled,
.tour-back-button:disabled {
  opacity: 0.72;
}

.tour-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.app-shell.tour-running .tour-head {
  align-items: center;
  text-align: left;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.app-shell.tour-running .tour-strip.dragging .tour-head {
  cursor: grabbing;
}

.tour-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tour-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tour-head strong {
  font-size: 15px;
}

.app-shell.tour-running .tour-head strong {
  font-size: 18px;
  line-height: 1.14;
}

.tour-strip p {
  color: #34413d;
  font-size: 13px;
}

.app-shell.tour-running .tour-strip p {
  color: #263430;
  font-size: 14px;
  line-height: 1.38;
}

.tour-chat-line {
  min-width: 0;
  border: 1px solid #dce5e1;
  border-radius: 8px;
  background: #f7faf9;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tour-chat-line span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tour-chat-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.app-shell.tour-running .tour-chat-line {
  justify-content: flex-start;
  padding: 9px 10px;
}

.app-shell.tour-running .tour-chat-line strong {
  font-size: 13px;
  white-space: normal;
}

.tour-progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eeeb;
}

.tour-progress span {
  display: block;
  width: var(--tour-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 280ms ease;
}

.primary-action,
.ghost-action {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.primary-action {
  background: var(--teal);
  color: #fff;
}

.ghost-action {
  background: #fff;
  border-color: var(--line);
}

.tiny {
  padding: 6px 9px;
  font-size: 12px;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.source-list {
  display: grid;
  gap: 7px;
}

.source-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.source-row:hover,
.source-row.selected {
  border-color: var(--teal);
  background: #f4fbfa;
}

.source-row.tour-pending {
  opacity: 0.24;
  transform: translateY(4px);
}

.source-row.tour-added {
  border-color: var(--teal);
  background: #f4fbfa;
  box-shadow: 0 0 0 3px rgba(8, 124, 116, 0.09);
}

.tour-highlight {
  position: relative;
  z-index: 12;
  box-shadow: 0 0 0 4px rgba(8, 124, 116, 0.38), 0 18px 40px rgba(8, 52, 48, 0.24);
  transition: box-shadow 160ms ease, transform 160ms ease;
}

.tour-highlight:where(button, .source-row) {
  transform: translateY(-1px);
}

.source-row.excluded {
  opacity: 0.55;
}

.source-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.source-row input {
  accent-color: var(--teal);
}

.source-open {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: 999px;
}

.source-open:hover {
  background: var(--teal-soft);
}

.file-icon {
  width: 34px;
  height: 29px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.pdf { background: var(--red); }
.xls { background: var(--green); }
.doc { background: var(--blue); }
.map { background: #704c13; }
.img { background: #6c668d; }
.eml { background: #a85722; }
.note { background: #56635f; }

.output-viewer {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.output-empty-state {
  border: 1px dashed #cbd6d2;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 18px;
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 750;
}

.output-empty-state[hidden] {
  display: none;
}

.output-live-notes {
  border: 1px solid #dce5e1;
  border-radius: 8px;
  background: #f7faf9;
  color: #34413d;
  padding: 8px;
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.output-live-notes strong {
  color: var(--teal);
}

.output-live-notes[hidden] {
  display: none;
}

.source-impact-matrix {
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 7px;
  font-size: 12px;
}

.source-impact-matrix[hidden] {
  display: none;
}

.source-impact-matrix > strong {
  color: var(--ink);
}

.impact-rows {
  display: grid;
  gap: 5px;
}

.impact-rows p {
  margin: 0;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 7px;
  color: #34413d;
}

.impact-rows span {
  color: var(--teal);
  font-weight: 900;
}

.package-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.package-actions[hidden] {
  display: none;
}

.package-actions button {
  appearance: none;
  min-height: 32px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.package-actions button:hover {
  transform: translateY(-1px);
}

.package-action-primary {
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 124, 116, 0.16);
}

.package-action-primary:hover {
  background: #096f68;
}

.package-action-secondary {
  border: 1px solid #c9dbd6;
  background: #fff;
  color: #0b6761;
}

.package-action-secondary:hover {
  border-color: #8fb9b2;
  background: #f3faf8;
}

.viewer-head a {
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.output-viewer img,
.generated-sheet {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-card {
  border-bottom: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 12px;
  background: #fbfcfb;
}

.summary-card.empty .summary-brief,
.summary-card.empty .summary-findings {
  display: none;
}

.empty-note {
  border: 1px dashed #cbd6d2;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 16px;
  font-weight: 750;
}

.notebook-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.notebook-switcher button {
  border: 1px solid #dce5e1;
  border-radius: 999px;
  background: #fff;
  padding: 7px 10px;
  color: #263430;
  font-size: 12px;
  font-weight: 850;
}

.notebook-switcher button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075d57;
}

.summary-brief {
  border: 1px solid #dfe7e3;
  border-radius: 8px;
  background: #fff;
  padding: 13px;
  display: grid;
  gap: 8px;
}

.summary-brief p {
  color: #2d3936;
  font-size: 14px;
  line-height: 1.45;
}

.summary-brief strong {
  color: var(--teal);
}

.metric-strip article {
  min-width: 0;
  border: 1px solid #e2e9e5;
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 2px;
}

.metric-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.metric-strip strong {
  color: var(--teal);
  font-size: 18px;
}

.summary-findings,
.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.prompt-chips {
  display: grid;
  gap: 7px;
}

.summary-findings button,
.prompt-chips button,
.finding {
  border: 1px solid #dce5e1;
  border-radius: 999px;
  background: #fff;
  padding: 7px 9px;
  color: #263430;
  font-size: 12px;
  font-weight: 850;
}

.prompt-chips button {
  border-radius: 8px;
  padding: 9px 10px;
  text-align: left;
  line-height: 1.3;
}

.example-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.summary-findings button:hover,
.prompt-chips button:hover,
.finding:hover,
.finding.active {
  border-color: var(--teal);
  background: #f4fbfa;
}

.chat-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.chat-stream {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 760px;
  display: block;
}

.message[hidden] {
  display: none;
}

.message.user {
  align-self: end;
  max-width: 620px;
}

.avatar {
  display: none;
}

.message.user .avatar {
  display: none;
}

.bubble {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  display: grid;
  gap: 9px;
}

.message-cta-link {
  color: var(--teal);
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message.user .bubble {
  background: #eff8f6;
  border: 1px solid #c7e4df;
  border-radius: 8px;
  padding: 11px;
}

.message.planning .bubble {
  border: 0;
  background: transparent;
}

.thinking-line {
  color: var(--muted);
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 750;
}

.thinking-line::after {
  content: "";
  width: 26px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0 30%, #cfe2dd 30% 100%);
  animation: thinkingPulse 900ms ease-in-out infinite;
}

.plan-card {
  display: grid;
  gap: 10px;
  border: 1px solid #d8e3df;
  border-radius: 8px;
  background: #fff;
  padding: 11px;
}

.plan-card h4 {
  margin: 0;
  font-size: 14px;
}

.plan-card ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
  color: #2d3936;
}

.plan-card button {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
}

.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-card button.secondary-plan-action,
.plan-actions button[data-testid="save-plan-edits"] {
  border: 1px solid #dce5e1;
  background: #fff;
  color: #243430;
}

.plan-editor {
  min-height: 96px;
  border: 1px solid #cfd8d5;
  border-radius: 8px;
  padding: 9px;
  font: inherit;
  resize: vertical;
}

.plan-card button:disabled {
  background: #7c8c87;
}

@keyframes thinkingPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.chat-composer {
  border-top: 1px solid var(--line);
  background: #fbfcfb;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-composer input {
  min-width: 0;
  border: 1px solid #cfd8d5;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
}

.chat-composer button {
  border: 0;
  border-radius: 8px;
  background: #243430;
  color: #fff;
  padding: 0 14px;
  font-weight: 850;
}

.chat-context {
  display: none;
}

.outputs-panel.is-locked {
  opacity: 1;
}

.studio-section {
  display: grid;
  gap: 10px;
}

.studio-section[hidden] {
  display: none;
}

.section-heading {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.help-dot {
  width: 17px;
  height: 17px;
  border: 1px solid #b8c8c3;
  border-radius: 50%;
  background: #f7faf9;
  color: #687873;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-family: ui-serif, Georgia, serif;
  font-size: 11px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
}

.help-dot:hover,
.help-dot:focus-visible {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.collapse-button {
  width: 22px;
  height: 22px;
  border: 1px solid #d3dfdb;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  display: inline-grid;
  place-items: center;
  box-shadow: none;
}

.collapse-button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid #64736f;
  border-bottom: 2px solid #64736f;
  transform: translateY(-1px) rotate(45deg);
}

.studio-section.is-collapsed > :not(.mini-head) {
  display: none !important;
}

.studio-section.is-collapsed .collapse-button::before {
  transform: translateY(1px) rotate(-135deg);
}

.doc-viewer[hidden] {
  display: none;
}

.studio-context-card {
  border: 1px solid #cfe2dd;
  border-radius: 8px;
  background: #f4fbfa;
  padding: 10px;
  display: grid;
  gap: 7px;
}

.studio-context-card strong {
  font-size: 15px;
}

.studio-context-card p:not(.kicker) {
  color: #34413d;
  font-size: 13px;
}

.studio-context-card .studio-scope-note {
  border-top: 1px solid #dce8e4;
  padding-top: 7px;
  color: #50615c;
  font-size: 12px;
  font-weight: 800;
}

.studio-context-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.studio-context-tags span {
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dce5e1;
  color: #31403c;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 850;
}

.outputs-panel.is-locked .review-panel,
.outputs-panel.is-locked .evidence-panel {
  display: none;
}

.outputs-panel.is-locked .output-panel {
  opacity: 0.72;
}

.outputs-panel.empty-context .review-panel,
.outputs-panel.empty-context .evidence-panel {
  display: none;
}

.outputs-panel.empty-context .metric-strip,
.outputs-panel.empty-context .artifact-grid,
.outputs-panel.empty-context .formula-strip {
  display: none;
}

.outputs-panel.empty-context .output-panel {
  opacity: 0.58;
}

.results-panel,
.review-panel,
.output-panel,
.evidence-panel {
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evidence-panel {
  border-bottom: 0;
  padding-bottom: 0;
}

.assumption-book {
  display: grid;
  gap: 7px;
}

.assumption-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(72px, 0.55fr) minmax(118px, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid #e4eae7;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 7px;
}

.assumption-row span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.assumption-row span {
  font-weight: 850;
}

.assumption-row input {
  min-width: 0;
  width: 100%;
  border: 1px solid #cfd8d5;
  border-radius: 7px;
  padding: 7px;
}

.assumption-row.focused {
  border-color: var(--teal);
  background: #f4fbfa;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.metric-strip article {
  padding: 7px;
}

.metric-strip strong {
  font-size: 15px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.artifact-card {
  min-width: 0;
  border: 1px solid #e1e8e5;
  border-radius: 8px;
  background: #fbfcfb;
  padding: 8px;
  display: grid;
  gap: 2px;
  text-align: left;
  color: var(--ink);
}

.artifact-card:hover,
.artifact-card.active {
  border-color: var(--teal);
  background: #f4fbfa;
}

.artifact-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.artifact-card strong {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.formula-strip {
  display: none;
}

.risk-head {
  align-items: start;
}

.risk-head p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.finding-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.finding-list .finding {
  width: 100%;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  text-align: left;
}

.finding-list .finding .severity {
  grid-row: 1 / 3;
}

.finding-list .finding strong {
  min-width: 0;
  font-size: 12px;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.finding-list .finding small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.severity {
  width: 34px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
}

.p0 {
  background: var(--red-soft);
  color: var(--red);
}

.p1 {
  background: var(--amber-soft);
  color: var(--amber);
}

.p2 {
  background: #e6eef8;
  color: var(--blue);
}

.source-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  background: #eef4f3;
  color: #40504c;
  font-size: 12px;
  font-weight: 850;
}

blockquote {
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #f7faf9;
  color: #2d3936;
  padding: 10px;
  font-size: 13px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.review-box {
  color: var(--muted);
  font-size: 13px;
}

.document-modal,
.document-library-modal,
.waitlist-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 22, 19, 0.42);
}

.document-modal[hidden],
.document-library-modal[hidden],
.waitlist-modal[hidden] {
  display: none;
}

.modal-window,
.library-window,
.waitlist-window {
  width: min(1180px, 96vw);
  max-height: min(820px, 92vh);
  display: grid;
  gap: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(12, 20, 17, 0.28);
  padding: 14px;
}

.library-window {
  width: min(780px, 94vw);
}

.waitlist-window {
  width: min(560px, 94vw);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-head h2 {
  font-size: 17px;
}

.waitlist-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.waitlist-copy {
  color: #34413d;
  font-size: 14px;
}

.waitlist-form {
  display: grid;
  gap: 10px;
}

.waitlist-form label,
.waitlist-form fieldset {
  display: grid;
  gap: 6px;
}

.waitlist-form fieldset {
  margin: 2px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.waitlist-form legend,
.waitlist-form span {
  color: #34413d;
  font-size: 12px;
  font-weight: 850;
}

.waitlist-form input,
.waitlist-form select,
.waitlist-form textarea {
  width: 100%;
  border: 1px solid #cfd8d5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  resize: vertical;
}

.waitlist-turnstile {
  min-height: 65px;
}

.waitlist-turnstile[hidden] {
  display: none;
}

.waitlist-submit {
  justify-self: start;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
}

.waitlist-success {
  border: 1px solid #b9dfda;
  border-radius: 8px;
  background: var(--teal-soft);
  color: #075d57;
  padding: 10px;
  font-weight: 850;
}

.modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 12px;
}

.document-modal.workbook-mode .modal-window {
  width: min(1360px, 98vw);
}

.document-modal.workbook-mode .modal-body {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
}

.modal-reader,
.modal-editor {
  min-width: 0;
  min-height: 0;
}

.modal-reader {
  display: grid;
  gap: 10px;
}

.modal-window img {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.xlsx-preview {
  height: min(690px, calc(92vh - 124px));
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.xlsx-preview[hidden] {
  display: none;
}

.xlsx-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #f1f6f4;
}

.xlsx-workbook-name {
  min-width: 128px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.xlsx-name-box,
.xlsx-formula-bar {
  min-height: 30px;
  border: 1px solid #d6e2de;
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
  color: #263430;
  font-size: 12px;
}

.xlsx-name-box {
  width: 58px;
  text-align: center;
  font-weight: 900;
}

.xlsx-formula-bar {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.xlsx-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  background: #f1f6f4;
}

.xlsx-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #34413d;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.xlsx-tabs button.active {
  border-bottom-color: var(--teal);
  background: #e6f4f1;
  color: var(--teal);
}

.xlsx-viewport {
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.xlsx-loading {
  min-height: 320px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  padding: 20px;
}

.xlsx-grid {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  font-size: 12px;
  line-height: 1.3;
  table-layout: fixed;
}

.xlsx-grid th,
.xlsx-grid td {
  border-right: 1px solid #e6edeb;
  border-bottom: 1px solid #e6edeb;
  padding: 7px 9px;
  width: 132px;
  min-width: 132px;
  max-width: 240px;
  height: 30px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
}

.xlsx-grid thead th,
.xlsx-grid tbody th {
  position: sticky;
  z-index: 1;
  background: #f1f6f4;
  color: var(--muted);
  font-weight: 850;
}

.xlsx-grid thead th {
  top: 0;
  box-shadow: 0 1px 0 #dce5e1;
}

.xlsx-grid tbody th {
  left: 0;
  width: 52px;
  min-width: 52px;
  text-align: right;
  box-shadow: 1px 0 0 #dce5e1;
}

.xlsx-grid .corner-cell {
  left: 0;
  z-index: 3;
  width: 52px;
  min-width: 52px;
}

.xlsx-grid td.sheet-header-cell {
  background: #143b54;
  color: #fff;
  font-weight: 850;
}

.xlsx-grid td.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.xlsx-grid td.selected {
  position: relative;
  outline: 2px solid var(--teal);
  outline-offset: -2px;
  z-index: 1;
  background: #f4fbfa;
}

.document-modal.workbook-mode .modal-pages {
  justify-content: flex-start;
  padding-left: 2px;
}

.document-modal.workbook-mode .modal-pages button {
  display: none;
}

.modal-pages {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.modal-window a {
  color: var(--teal);
  font-weight: 850;
  text-decoration: none;
}

.modal-editor {
  align-self: stretch;
  max-height: 710px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.modal-editor.output-cta-only {
  align-content: start;
  background: transparent;
}

.modal-editor h3 {
  font-size: 15px;
}

.document-library-list {
  display: grid;
  gap: 8px;
}

.document-library-list h3 {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.library-doc {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  color: var(--ink);
}

.library-doc:hover {
  border-color: var(--teal);
  background: #f4fbfa;
}

.library-doc span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.output-cta-card {
  border: 1px solid #b9dfda;
  border-radius: 8px;
  background: #f4fbfa;
  padding: 12px;
  display: grid;
  gap: 9px;
}

.output-cta-card span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.output-cta-card strong {
  font-size: 18px;
  line-height: 1.2;
}

.output-cta-card p {
  color: #34413d;
  font-size: 13px;
  line-height: 1.35;
}

.output-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.output-cta-actions a {
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  padding: 9px 10px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.output-cta-actions a.secondary {
  border: 1px solid #cfe2dd;
  background: #fff;
  color: var(--teal);
}

.editor-tabs,
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.editor-tabs[hidden],
.editor-actions[hidden],
.modal-editor .kicker[hidden],
.modal-editor h3[hidden] {
  display: none;
}

.editor-tabs span,
.editor-actions span {
  border: 1px solid #dce5e1;
  border-radius: 999px;
  background: #fff;
  color: #31403c;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 850;
}

.editor-tabs span.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #075d57;
}

.editor-body {
  display: grid;
  gap: 8px;
}

.editor-workspace {
  border: 1px solid #dce5e1;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.editor-workspace[hidden] {
  display: none;
}

.workspace-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.editor-workspace strong {
  font-size: 13px;
  line-height: 1.3;
}

.workspace-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-rail span {
  border: 1px solid #dce5e1;
  border-radius: 7px;
  background: #f7faf9;
  color: #34413d;
  padding: 5px 7px;
  font-size: 11px;
  font-weight: 850;
}

.modal-editor[data-editor-kind="pdf-review"] .editor-workspace,
.modal-editor[data-editor-kind="lease-abstract-editor"] .editor-workspace,
.modal-editor[data-editor-kind="memo-editor"] .editor-workspace,
.modal-editor[data-editor-kind="deck-editor"] .editor-workspace {
  border-left-color: var(--red);
}

.modal-editor[data-editor-kind="spreadsheet-editor"] .editor-workspace,
.modal-editor[data-editor-kind="financial-model-editor"] .editor-workspace,
.modal-editor[data-editor-kind="assumption-workbook-editor"] .editor-workspace,
.modal-editor[data-editor-kind="underwriting-model-editor"] .editor-workspace,
.modal-editor[data-editor-kind="risk-register-editor"] .editor-workspace,
.modal-editor[data-editor-kind="checklist-editor"] .editor-workspace {
  border-left-color: var(--green);
}

.modal-editor[data-editor-kind="map-workspace"] .editor-workspace,
.modal-editor[data-editor-kind="photo-review-editor"] .editor-workspace,
.modal-editor[data-editor-kind="email-triage-editor"] .editor-workspace,
.modal-editor[data-editor-kind="buyer-note-editor"] .editor-workspace {
  border-left-color: var(--blue);
}

.editor-row,
.editor-note,
.editor-table {
  border: 1px solid #e1e8e5;
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.editor-row {
  display: grid;
  gap: 3px;
}

.editor-row span,
.editor-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.editor-row strong {
  font-size: 14px;
}

.editor-note {
  color: #2d3936;
  font-size: 13px;
}

.editor-control,
.editor-control-group input,
.editor-control-group textarea,
.editor-control-group select {
  width: 100%;
  border: 1px solid #cfd8d5;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px;
  font: inherit;
  resize: vertical;
}

.editor-control-group {
  border: 1px solid #e1e8e5;
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.editor-control-group label {
  display: grid;
  gap: 4px;
  color: #2d3936;
  font-size: 12px;
  font-weight: 850;
}

.editor-control-group .inline-control {
  display: flex;
  gap: 7px;
  align-items: center;
}

.editor-control-group .inline-control input {
  width: auto;
}

.editor-table {
  width: 100%;
  border-spacing: 0;
  table-layout: fixed;
}

.editor-table th,
.editor-table td {
  overflow: hidden;
  padding: 5px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1220px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar,
  .notebook-layout {
    grid-template-columns: 1fr;
  }

  .notebook-layout.sources-hidden {
    grid-template-columns: 1fr;
  }

  .notebook-layout {
    overflow: visible;
  }

  .notebook-panel {
    order: 1;
    min-height: 680px;
  }

  .show-sources-button {
    order: 0;
    height: auto;
    min-height: 42px;
    padding: 10px 12px;
    writing-mode: horizontal-tb;
    transform: none;
  }

  .sources-panel {
    order: 2;
    max-height: 540px;
  }

  .outputs-panel {
    order: 3;
    max-height: 680px;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }

  .modal-editor {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 9px;
  }

  .metric-strip,
  .artifact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .message,
  .message.user {
    grid-template-columns: 1fr;
  }

  .avatar,
  .message.user .avatar {
    display: none;
  }

  .assumption-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 13px;
  }

  .metric-strip,
  .artifact-grid {
    grid-template-columns: 1fr;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-composer button {
    min-height: 40px;
  }
}

.notebook-switcher .create-notebook-button {
  border-style: dashed;
  background: #fff;
  color: #50615c;
}

.notebook-switcher button.placeholder {
  border-color: #ccd8d4;
  background: #fff;
  color: #50615c;
}

.summary-findings {
  display: none;
}

.output-panel {
  gap: 8px;
}

.output-panel .mini-head {
  align-items: center;
}

.output-panel .mini-actions {
  gap: 8px;
}

.output-viewer {
  order: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
}

.output-viewer img {
  max-height: 170px;
  object-fit: contain;
}

.artifact-grid {
  order: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.artifact-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
}

.artifact-card:last-child {
  border-bottom: 0;
}

.artifact-card span {
  grid-column: 2;
  color: #5e6d68;
}

.artifact-card strong {
  grid-column: 1;
  grid-row: 1;
  font-size: 13px;
}

.artifact-card:hover,
.artifact-card.active {
  background: #f6fbfa;
  box-shadow: inset 3px 0 0 var(--teal);
}

.metric-strip {
  order: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.metric-strip article {
  border: 0;
  border-bottom: 1px solid #edf2ef;
  border-radius: 0;
  background: transparent;
  padding: 7px 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.metric-strip span {
  font-size: 11px;
  line-height: 1.2;
}

.metric-strip strong {
  font-size: 14px;
}

.artifact-grid {
  order: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 0 2px;
  scrollbar-width: thin;
}

.artifact-card {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #d8e3df;
  border-radius: 999px;
  background: #fff;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: none;
}

.artifact-card:last-child {
  border-bottom: 1px solid #d8e3df;
}

.artifact-card span {
  display: none;
}

.artifact-card[data-output-id="assumptions"] span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c5ded8;
  border-radius: 999px;
  background: #e4f4f1;
  color: #075d57;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.artifact-card strong {
  font-size: 12px;
  line-height: 1;
  overflow: visible;
  white-space: nowrap;
  text-overflow: clip;
}

.artifact-card:hover,
.artifact-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: none;
}

.output-viewer {
  order: 2;
}

/* Modern ledger skin: sharper, more serious surfaces over the legacy demo layout. */
:root {
  --accent: #2f554b;
  --accent-ink: #203f37;
  --accent-soft: #e6ede9;
  --copper: #7b5b36;
  --copper-soft: #efe5d4;
  --surface-1: #fbfaf6;
  --surface-2: #f5f2e9;
  --surface-3: #efebdf;
  --radius-panel: 3px;
  --radius-control: 2px;
  --radius-tight: 2px;
}

body {
  background:
    linear-gradient(90deg, rgba(51, 67, 155, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(154, 91, 32, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px, 32px 32px, auto;
}

.topbar,
.sources-panel,
.notebook-panel,
.outputs-panel,
.modal-window,
.library-window,
.waitlist-window {
  border-color: #c8c0b2;
  border-radius: var(--radius-panel);
  background: var(--surface-1);
  box-shadow: 0 14px 28px rgba(43, 39, 31, 0.08);
}

.topbar {
  box-shadow: inset 0 3px 0 var(--accent), 0 12px 28px rgba(43, 39, 31, 0.08);
}

.brand-mark {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand h1,
.panel-title h2,
.summary-card h2,
.mini-head h3,
.viewer-head h3 {
  letter-spacing: 0;
}

.source-set-chip,
.top-waitlist-link,
.back-to-landing,
.status-pill,
.review-badge,
.notebook-switcher button,
.summary-findings button,
.prompt-chips button,
.finding,
.primary-action,
.ghost-action,
.package-actions button,
.tour-next-button,
.tour-back-button,
.tour-continue-button,
.output-cta-actions a,
.waitlist-submit {
  border-radius: var(--radius-control);
}

.source-set-chip,
.status-pill,
.review-badge {
  border-color: #d0c7b7;
  background: var(--surface-2);
  color: #4b4a43;
}

.source-set-chip.ready,
.status-pill.ready,
.review-badge.ready {
  border-color: #c9cdec;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.top-waitlist-link,
.primary-action,
.tour-next-button,
.tour-continue-button,
.plan-card button,
.chat-composer button,
.package-action-primary,
.waitlist-submit,
.output-cta-actions a {
  background: var(--accent);
  color: #fff;
}

.top-waitlist-link:hover,
.primary-action:hover,
.package-action-primary:hover,
.output-cta-actions a:hover {
  background: #28357e;
}

.ghost-action,
.back-to-landing,
.tour-back-button,
.package-action-secondary,
.output-cta-actions a.secondary {
  border-color: #cfc8ba;
  background: #fffdf7;
  color: #34352f;
}

.ghost-action:hover,
.back-to-landing:hover,
.package-action-secondary:hover,
.output-cta-actions a.secondary:hover {
  border-color: var(--accent);
  background: #f6f5ff;
  color: var(--accent-ink);
}

.show-sources-button {
  border-radius: var(--radius-panel);
  border-color: #c9cdec;
  background: var(--accent);
}

.tour-strip,
.app-shell.tour-running .tour-strip {
  border-radius: var(--radius-panel);
  border-color: var(--accent);
  background: rgba(251, 250, 246, 0.98);
  box-shadow: 0 28px 70px rgba(30, 34, 62, 0.25);
}

.tour-chat-line,
.summary-brief,
.plan-card,
.studio-context-card,
.output-live-notes,
.source-impact-matrix,
.output-empty-state,
.empty-note,
.review-panel,
.output-viewer,
.source-preview,
.editor-workspace,
.editor-row,
.editor-note,
.editor-table,
.editor-control,
.editor-control-group,
.editor-control-group input,
.editor-control-group textarea,
.editor-control-group select,
.waitlist-form fieldset,
.waitlist-form input,
.waitlist-form select,
.waitlist-form textarea,
.xlsx-preview,
.xlsx-name-box,
.xlsx-formula-bar {
  border-radius: var(--radius-control);
}

.summary-card,
.chat-composer,
.xlsx-toolbar,
.xlsx-tabs {
  background: var(--surface-2);
}

.summary-brief,
.message.user .bubble,
.plan-card,
.output-viewer,
.studio-context-card,
.output-live-notes,
.source-impact-matrix,
.editor-workspace,
.editor-row,
.editor-note,
.editor-table,
.editor-control-group,
.review-panel,
.output-panel,
.results-panel,
.evidence-panel {
  background: #fffdf8;
  border-color: #d5cec1;
}

.source-row {
  border-radius: var(--radius-control);
  background: #fffdf8;
  border-color: #d5cec1;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  padding: 8px 9px;
}

.source-row:hover,
.source-row.selected,
.source-row.tour-added {
  border-color: var(--accent);
  background: #f7f6ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.source-open {
  border-radius: var(--radius-tight);
  color: var(--accent-ink);
}

.source-open:hover {
  background: var(--accent-soft);
}

.file-icon {
  width: 32px;
  height: 28px;
  border-radius: var(--radius-tight);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
}

.pdf { background: #9e342c; }
.xls { background: #426b3f; }
.doc { background: #315c82; }
.map { background: #7b561b; }
.img { background: #5a537a; }
.eml { background: #9a5b20; }
.note { background: #4e5551; }

.notebook-switcher {
  gap: 6px;
}

.notebook-switcher button {
  border-color: #cfc8ba;
  background: #fffdf8;
  color: #34352f;
  padding: 7px 10px;
}

.notebook-switcher button.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: inset 0 -3px 0 rgba(51, 67, 155, 0.24);
}

.notebook-switcher .create-notebook-button {
  border-style: solid;
  border-color: #cbb999;
  background: var(--copper-soft);
  color: #684015;
}

.prompt-chips button {
  border-left: 3px solid #cbb999;
  background: #fffdf8;
}

.prompt-chips button:hover {
  border-color: var(--accent);
  background: #f7f6ff;
}

.message.user .bubble {
  border-color: #c9cdec;
  background: #f4f5ff;
}

.thinking-line::after,
.tour-progress span,
.xlsx-tabs button.active {
  background: var(--accent);
}

.plan-card {
  border-left: 3px solid var(--accent);
}

.plan-card button.secondary-plan-action,
.plan-actions button[data-testid="save-plan-edits"] {
  border-color: #cfc8ba;
  background: #fffdf8;
  color: #34352f;
}

.chat-composer input,
.plan-editor,
.assumption-row input,
.editor-control,
.editor-control-group input,
.editor-control-group textarea,
.editor-control-group select {
  border-color: #c9c2b6;
  border-radius: var(--radius-control);
  background: #fffdf8;
}

.chat-composer input:focus,
.plan-editor:focus,
.assumption-row input:focus,
.editor-control:focus,
.editor-control-group input:focus,
.editor-control-group textarea:focus,
.editor-control-group select:focus,
.waitlist-form input:focus,
.waitlist-form select:focus,
.waitlist-form textarea:focus {
  outline: 2px solid rgba(51, 67, 155, 0.22);
  border-color: var(--accent);
}

.section-heading .help-dot,
.help-dot,
.collapse-button {
  border-radius: var(--radius-tight);
  background: #fffdf8;
}

.help-dot {
  color: var(--accent-ink);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-style: normal;
}

.collapse-button::before {
  border-color: var(--accent-ink);
}

.metric-strip {
  border-top-color: #d5cec1;
}

.metric-strip article {
  border-bottom-color: #e1dbd0;
}

.metric-strip strong,
.summary-brief strong,
.message-cta-link,
.output-live-notes strong,
.waitlist-kicker,
.output-cta-card span,
.viewer-head a,
.modal-window a {
  color: var(--accent-ink);
}

.assumption-row,
.artifact-card,
.finding-list .finding,
.library-doc {
  border-color: #d5cec1;
  border-radius: var(--radius-control);
  background: #fffdf8;
}

.assumption-row.focused,
.artifact-card:hover,
.artifact-card.active,
.finding:hover,
.finding.active,
.library-doc:hover {
  border-color: var(--accent);
  background: #f7f6ff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.artifact-grid {
  gap: 6px;
}

.artifact-card {
  border-radius: var(--radius-control);
}

.artifact-card[data-output-id="assumptions"] span {
  border-color: #d7c3a4;
  border-radius: var(--radius-tight);
  background: var(--copper-soft);
  color: #684015;
}

.review-badge.ready,
.status-pill.ready,
.source-set-chip {
  border-radius: var(--radius-control);
}

.p0,
.p1,
.p2,
.severity {
  border-radius: var(--radius-tight);
}

blockquote {
  border-left-color: var(--copper);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: #fff9ef;
}

.preview-toolbar {
  background: var(--surface-2);
}

.modal-window img,
.output-viewer img,
.generated-sheet {
  border-radius: var(--radius-control);
  border-color: #d5cec1;
}

.document-modal,
.document-library-modal,
.waitlist-modal {
  background: rgba(25, 28, 32, 0.48);
}

.output-cta-card {
  border-color: #d7c3a4;
  border-radius: var(--radius-panel);
  background: #fff8ea;
}

.editor-tabs span,
.editor-actions span,
.workspace-rail span,
.studio-context-tags span {
  border-radius: var(--radius-tight);
  border-color: #d5cec1;
  background: #fffdf8;
}

.editor-tabs span.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.metric-strip {
  order: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.metric-strip article {
  border: 1px solid #d8e3df;
  border-radius: 8px;
  background: #f6fbfa;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
  min-height: 80px;
}

.metric-strip span {
  min-width: 0;
  color: #60716c;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.metric-strip strong {
  color: var(--teal);
  font-size: 22px;
  line-height: 1;
}

.metric-strip article {
  position: relative;
  padding-right: 28px;
}

.metric-strip article .help-dot {
  position: absolute;
  top: 7px;
  right: 7px;
}

/* Institutional desk skin: restrained CRE review UI, less saturated and less rounded. */
:root {
  --bg: #ebe8df;
  --panel: #fbfaf4;
  --panel-soft: #f0ede4;
  --ink: #161a18;
  --muted: #62645e;
  --line: #bbb2a3;
  --teal: #2f554b;
  --teal-soft: #e6ede9;
  --accent: #2f554b;
  --accent-ink: #203f37;
  --accent-soft: #e6ede9;
  --blue: #37495a;
  --copper: #7b5b36;
  --copper-soft: #efe5d4;
  --amber: #7b5b36;
  --amber-soft: #efe5d4;
  --red: #8f3b31;
  --red-soft: #f0dfda;
  --green: #49664a;
  --shadow: 0 10px 22px rgba(32, 28, 22, 0.08);
  --radius-panel: 3px;
  --radius-control: 2px;
  --radius-tight: 2px;
}

body {
  background: #ebe8df;
}

.topbar,
.sources-panel,
.notebook-panel,
.outputs-panel,
.modal-window,
.library-window,
.waitlist-window {
  border-color: var(--line);
  border-radius: var(--radius-panel);
  background: #fbfaf4;
  box-shadow: 0 8px 18px rgba(32, 28, 22, 0.07);
}

.topbar {
  box-shadow: inset 0 2px 0 #30352f, 0 8px 18px rgba(32, 28, 22, 0.07);
}

.brand-mark {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.brand h1,
.panel-title h2,
.summary-card h2,
.chat-panel h2,
.studio-section h3,
.viewer-head h3,
.tour-head strong {
  font-weight: 760;
}

.source-set-chip,
.top-waitlist-link,
.back-to-landing,
.status-pill,
.review-badge,
.notebook-switcher button,
.prompt-chips button,
.primary-action,
.ghost-action,
.package-actions button,
.tour-next-button,
.tour-back-button,
.tour-continue-button,
.output-cta-actions a,
.waitlist-submit {
  border-radius: var(--radius-control);
  font-weight: 720;
}

.top-waitlist-link,
.primary-action,
.tour-next-button,
.tour-continue-button,
.plan-card button,
.chat-composer button,
.package-action-primary,
.waitlist-submit,
.output-cta-actions a {
  border: 1px solid #243d36;
  background: #263b35;
  color: #fff;
  box-shadow: none;
}

.top-waitlist-link:hover,
.primary-action:hover,
.tour-next-button:hover,
.tour-continue-button:hover,
.package-action-primary:hover,
.waitlist-submit:hover,
.output-cta-actions a:hover {
  background: #1e312c;
}

.ghost-action,
.back-to-landing,
.tour-back-button,
.package-action-secondary,
.output-cta-actions a.secondary,
.panel-actions button,
.mini-actions button {
  border-color: #b9b0a0;
  background: #fbfaf4;
  color: #2c302c;
  box-shadow: none;
}

.ghost-action:hover,
.back-to-landing:hover,
.tour-back-button:hover,
.package-action-secondary:hover,
.output-cta-actions a.secondary:hover,
.panel-actions button:hover,
.mini-actions button:hover {
  border-color: #697369;
  background: #f2efe5;
  color: #161a18;
}

.source-set-chip,
.status-pill,
.review-badge {
  border: 1px solid #c4bbac;
  background: #eeeae0;
  color: #4d4f49;
}

.source-set-chip.ready,
.status-pill.ready,
.review-badge.ready {
  border-color: #b6c2ba;
  background: #e4ebe6;
  color: #203f37;
}

.source-row {
  border-color: #c8c0b2;
  border-radius: 2px;
  background: #fffdf7;
  box-shadow: none;
}

.source-row strong,
.source-open,
.prompt-chips button,
.notebook-switcher button,
.artifact-card,
.assumption-row,
.finding {
  font-weight: 700;
}

.source-row:hover {
  border-color: #918878;
  background: #faf7ef;
  box-shadow: inset 2px 0 0 #918878;
}

.source-row.selected,
.source-row.tour-added {
  border-color: #b9b0a0;
  background: #fffdf7;
  box-shadow: inset 2px 0 0 rgba(47, 85, 75, 0.38);
}

.source-row.selected.tour-highlight,
.source-row.tour-highlight {
  border-color: #273e37;
  background: #fffefa;
  box-shadow: inset 3px 0 0 #273e37, 0 8px 22px rgba(24, 31, 27, 0.18);
}

.source-open {
  border-radius: 0;
  color: #263b35;
}

.source-open:hover {
  background: #ece7dc;
}

.source-row input {
  accent-color: #263b35;
}

.file-icon {
  width: 31px;
  height: 27px;
  border-radius: 2px;
  box-shadow: none;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.pdf { background: #7e342e; }
.xls { background: #3f5f40; }
.doc { background: #344a5f; }
.map { background: #654a24; }
.img { background: #504b65; }
.eml { background: #7c562d; }
.note { background: #454c48; }

.notebook-switcher button {
  border-color: #bdb4a5;
  background: #fbfaf4;
  color: #30332f;
  box-shadow: none;
}

.notebook-switcher button.active {
  border-color: #273e37;
  background: #e8ede8;
  color: #203f37;
  box-shadow: inset 0 -2px 0 #273e37;
}

.notebook-switcher .create-notebook-button {
  border-color: #bba982;
  background: #eee5d2;
  color: #563f23;
}

.summary-brief,
.message.user .bubble,
.plan-card,
.output-viewer,
.studio-context-card,
.output-live-notes,
.source-impact-matrix,
.editor-workspace,
.editor-row,
.editor-note,
.editor-table,
.editor-control-group,
.review-panel,
.output-panel,
.results-panel,
.evidence-panel,
.metric-strip article,
.assumption-row,
.artifact-card,
.finding-list .finding,
.library-doc,
.source-preview,
.output-empty-state {
  border-color: #c8c0b2;
  border-radius: 2px;
  background: #fffdf7;
}

.message.user .bubble {
  border-color: #b7c2ba;
  background: #eef2ee;
}

.prompt-chips button {
  border-color: #c8c0b2;
  border-left: 2px solid #7b5b36;
  background: #fffdf7;
}

.prompt-chips button:hover {
  border-color: #7a7163;
  background: #f7f3ea;
}

.tour-strip,
.app-shell.tour-running .tour-strip {
  border: 2px solid #273e37;
  border-radius: 3px;
  background: rgba(251, 250, 244, 0.98);
  box-shadow: 0 20px 48px rgba(20, 24, 21, 0.26);
}

.tour-scrim {
  background: rgba(17, 22, 19, 0.48);
}

.tour-chat-line {
  border-color: #c8c0b2;
  border-radius: 2px;
  background: #f7f3ea;
}

.tour-chat-line span,
.kicker,
.output-cta-card span,
.waitlist-kicker {
  color: #4f5e55;
}

.tour-progress {
  border-radius: 0;
  background: #d8d1c4;
}

.tour-progress span {
  border-radius: 0;
  background: #263b35;
}

.tour-highlight {
  box-shadow: 0 0 0 2px rgba(39, 62, 55, 0.8), 0 8px 24px rgba(24, 31, 27, 0.18);
}

.show-sources-button {
  border-color: #243d36;
  border-radius: 3px;
  background: #263b35;
  box-shadow: none;
}

.chat-composer input,
.plan-editor,
.assumption-row input,
.editor-control,
.editor-control-group input,
.editor-control-group textarea,
.editor-control-group select,
.waitlist-form input,
.waitlist-form select,
.waitlist-form textarea {
  border-color: #bbb2a3;
  border-radius: 2px;
  background: #fffdf7;
}

.chat-composer input:focus,
.plan-editor:focus,
.assumption-row input:focus,
.editor-control:focus,
.editor-control-group input:focus,
.editor-control-group textarea:focus,
.editor-control-group select:focus,
.waitlist-form input:focus,
.waitlist-form select:focus,
.waitlist-form textarea:focus {
  outline: 2px solid rgba(47, 85, 75, 0.22);
  border-color: #263b35;
}

.chat-composer button {
  background: #1f2d29;
}

.metric-strip strong,
.summary-brief strong,
.message-cta-link,
.output-live-notes strong,
.viewer-head a,
.modal-window a {
  color: #203f37;
}

.metric-strip article {
  background: #fbfaf4;
}

.assumption-row.focused,
.artifact-card:hover,
.artifact-card.active,
.finding:hover,
.finding.active,
.library-doc:hover {
  border-color: #273e37;
  background: #eef2ee;
  box-shadow: inset 2px 0 0 #273e37;
}

.help-dot,
.collapse-button {
  border-color: #aeb8b1;
  border-radius: 2px;
  background: #fbfaf4;
  color: #34463f;
}

.collapse-button::before {
  border-color: #34463f;
}

.review-badge.ready,
.status-pill.ready,
.source-set-chip {
  border-radius: 2px;
}

.p0,
.p1,
.p2,
.severity {
  border-radius: 2px;
}

blockquote {
  border-left-color: #7b5b36;
  border-radius: 0 2px 2px 0;
  background: #f7f1e5;
}

.output-cta-card {
  border-color: #baa77f;
  border-radius: 3px;
  background: #f7f1e5;
}

.editor-tabs span,
.editor-actions span,
.workspace-rail span,
.studio-context-tags span {
  border-radius: 2px;
  background: #fffdf7;
}

.editor-tabs span.active {
  border-color: #273e37;
  background: #e6ede9;
  color: #203f37;
}

.document-modal,
.document-library-modal,
.waitlist-modal {
  background: rgba(18, 23, 20, 0.52);
}

.output-cta-card {
  border: 1px solid #c6b99f;
  border-left: 3px solid #7b5b36;
  border-radius: 2px;
  background: #fbfaf4;
  padding: 14px 16px;
  gap: 8px;
  box-shadow: none;
}

.output-cta-card span {
  color: #6b655a;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.output-cta-card strong {
  max-width: 32ch;
  font-size: 17px;
  line-height: 1.22;
  font-weight: 760;
}

.output-cta-card p {
  max-width: 54ch;
  color: #343a35;
  font-size: 13px;
  line-height: 1.42;
}

.output-cta-actions {
  margin-top: 3px;
  gap: 8px;
}

.output-cta-card .output-cta-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #263b35;
  border-radius: 2px;
  background: #263b35;
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 740;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
}

.output-cta-card .output-cta-actions a:hover {
  background: #1e312c;
  color: #fff;
}

.output-cta-card .output-cta-actions a.secondary {
  border-color: #b9b0a0;
  background: #fbfaf4;
  color: #263b35;
}

.output-cta-card .output-cta-actions a.secondary:hover {
  border-color: #7d7466;
  background: #f0ede4;
  color: #161a18;
}

.custom-assumption-row {
  grid-template-columns: minmax(72px, 0.65fr) auto minmax(86px, 1fr);
}

.custom-assumption-row .help-dot {
  justify-self: start;
}

.custom-assumption-row strong {
  justify-self: end;
}

.studio-section.is-collapsed {
  padding-bottom: 8px;
}
