:root {
  --ink: #1d2433;
  --muted: #667085;
  --line: #d9dee7;
  --panel: #f4f7fb;
  --paper: #ffffff;
  --accent: #0f766e;
  --accent-dark: #0b4f4a;
  --gold: #b7791f;
  --rose: #b42318;
  --blue: #2563eb;
  --shadow: 0 20px 60px rgba(24, 31, 46, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #e9edf3;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  min-height: 40px;
  padding: 8px 12px;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  min-height: 100vh;
}

.workspace-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  height: 100vh;
  overflow: auto;
  padding: 24px;
}

.brand-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: flex;
  font-weight: 800;
  height: 48px;
  justify-content: center;
  width: 48px;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

.brand-row h1 {
  font-size: 22px;
  line-height: 1.15;
}

.brand-row p,
.status,
.empty-state p,
.report-meta,
.caption {
  color: var(--muted);
}

.brand-row p {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.panel-section {
  border-top: 1px solid var(--line);
  padding: 20px 0;
}

.panel-section h2 {
  font-size: 13px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

label {
  color: #344054;
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 7px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

.inline-check {
  align-items: center;
  display: flex;
  font-weight: 550;
  gap: 9px;
}

.inline-check input {
  min-height: 0;
  width: auto;
}

.model-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 92px;
}

.file-source-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 132px;
}

.file-source-row button {
  margin-bottom: 14px;
}

.transcript-row {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px 1fr;
}

.transcript-row button {
  margin-bottom: 14px;
}

.transcript-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin: -2px 0 14px;
}

.actions,
.report-toolbar {
  display: flex;
  gap: 10px;
}

.actions button {
  flex: 1;
}

.status {
  min-height: 20px;
  font-size: 13px;
  margin: 12px 0 0;
}

.status-download-link {
  color: var(--blue);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.report-stage {
  height: 100vh;
  overflow: auto;
  padding: 26px;
}

.report-toolbar {
  justify-content: flex-end;
  margin: 0 auto 14px;
  max-width: 980px;
}

.report-paper {
  background: var(--paper);
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 980px;
  min-height: calc(100vh - 92px);
  padding: 54px;
}

.empty-state {
  align-items: center;
  display: grid;
  min-height: 62vh;
  place-items: center;
  text-align: center;
}

.empty-state h2 {
  font-size: 30px;
  margin-top: 18px;
}

.empty-state p {
  line-height: 1.55;
  max-width: 620px;
}

.empty-visual {
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 30px);
  height: 120px;
  padding: 18px;
}

.empty-visual span {
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  display: block;
}

.empty-visual span:nth-child(1) { height: 34px; background: var(--blue); }
.empty-visual span:nth-child(2) { height: 72px; background: var(--accent); }
.empty-visual span:nth-child(3) { height: 48px; background: var(--gold); }
.empty-visual span:nth-child(4) { height: 86px; background: var(--rose); }

.report-cover {
  border-bottom: 4px solid var(--ink);
  display: grid;
  gap: 18px;
  margin-bottom: 34px;
  padding-bottom: 26px;
}

.kicker {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-cover h2 {
  font-size: 42px;
  line-height: 1.04;
  max-width: 800px;
}

.report-cover p {
  color: #475467;
  font-size: 18px;
  line-height: 1.45;
  margin: 0;
}

.report-section {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}

.report-section h3 {
  font-size: 22px;
  margin-bottom: 14px;
}

.report-section p,
.report-section li {
  font-size: 15px;
  line-height: 1.65;
}

.idea {
  break-inside: avoid;
  border-left: 4px solid var(--accent);
  margin: 18px 0;
  padding: 2px 0 2px 18px;
}

.idea h4 {
  font-size: 18px;
  margin: 0 0 8px;
}

.idea-visuals {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.95fr) minmax(280px, 1.35fr);
  margin: 18px 0;
}

.idea-visuals .chart-card {
  padding: 12px;
}

.idea-visuals .svg-composition {
  grid-column: 1 / -1;
}

.inline-credit-image {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  break-inside: avoid;
  margin: 0;
  overflow: hidden;
}

.inline-credit-image img {
  aspect-ratio: 16 / 10;
  background: #edf1f7;
  display: block;
  object-fit: cover;
  width: 100%;
}

.inline-credit-image figcaption {
  color: #475467;
  font-size: 11px;
  line-height: 1.45;
  padding: 9px;
}

.inline-credit-image a {
  color: var(--blue);
  margin-left: 4px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background: #eef6f5;
  border: 1px solid #c9e4e0;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  padding: 5px 9px;
}

.chart-grid,
.application-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.chart-card,
.application-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  break-inside: avoid;
  padding: 16px;
}

.chart-card h4,
.application-card h4 {
  font-size: 16px;
  margin: 0 0 10px;
}

.bar-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 86px 1fr 34px;
  margin: 8px 0;
}

.bar-track {
  background: #edf1f7;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  background: var(--blue);
  height: 100%;
}

.report-svg {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 12px 0;
  max-width: 100%;
  width: 100%;
}

.svg-title {
  fill: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.svg-label,
.svg-value {
  fill: #344054;
  font-size: 15px;
}

.svg-value {
  font-weight: 800;
  text-anchor: end;
}

.svg-track {
  fill: #e8edf5;
}

.svg-bar {
  fill: var(--blue);
}

.svg-node-a {
  fill: #dbeafe;
  stroke: #93c5fd;
}

.svg-node-b {
  fill: #d1fae5;
  stroke: #6ee7b7;
}

.svg-node-c {
  fill: #fef3c7;
  stroke: #fbbf24;
}

.svg-node-text {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.svg-arrow {
  fill: none;
  stroke: #667085;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.image-group {
  break-inside: avoid;
  margin: 18px 0;
}

.image-group h4 {
  margin: 0 0 4px;
}

.image-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.credit-image {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  overflow: hidden;
}

.credit-image img {
  aspect-ratio: 16 / 10;
  background: #edf1f7;
  display: block;
  object-fit: cover;
  width: 100%;
}

.credit-image figcaption {
  color: #475467;
  font-size: 11px;
  line-height: 1.45;
  padding: 10px;
}

.credit-image a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.prompt-box {
  background: #111827;
  border-radius: 6px;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  margin-top: 12px;
  max-height: 190px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.copy-prompt {
  margin-top: 10px;
  min-height: 34px;
}

.transcript-print-area {
  display: none;
}

.transcript-print-paper h1 {
  border-bottom: 3px solid var(--ink);
  font-size: 28px;
  margin: 0 0 18px;
  padding-bottom: 14px;
}

.transcript-print-paper pre {
  font-family: Arial, sans-serif;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace-panel,
  .report-stage {
    height: auto;
    overflow: visible;
  }

  .report-paper {
    min-height: 70vh;
    padding: 30px 22px;
  }

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

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

  .file-source-row button {
    margin-bottom: 0;
  }

  .transcript-row button {
    margin-bottom: 0;
  }

  .transcript-actions {
    grid-template-columns: 1fr;
  }

  .report-cover h2 {
    font-size: 32px;
  }

  .idea-visuals {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .app-shell,
  .report-stage {
    display: block;
    height: auto;
    overflow: visible;
    padding: 0;
  }

  .report-paper {
    box-shadow: none;
    max-width: none;
    min-height: 0;
    padding: 0;
  }

  .report-section {
    break-inside: avoid;
  }

  .visual-index {
    display: none;
  }

  body.printing-transcript .app-shell {
    display: none;
  }

  body.printing-transcript .transcript-print-area {
    display: block;
  }

  body.printing-transcript .transcript-print-paper {
    color: var(--ink);
    font-family: Arial, sans-serif;
  }
}
