/* Local design review only: reading surfaces for the manager's current app.
   No generated content, behavior, data, or existing hidden states are changed. */

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) {
  --review-ink: #183447;
  --review-muted: #536875;
  --review-teal: #087c78;
  --review-ivory: #f6f2e9;
  --review-paper: #fffdf7;
  --review-line: #d7ded8;
  --line: var(--review-line);
  --card: var(--review-paper);
  color: var(--review-ink);
  color-scheme: light;
  scrollbar-color: #9dbab2 var(--review-ivory);
}

:is(.chat-section, .review-section, .saved-section, .stats-section) {
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid #d7ded8;
  border-radius: 20px;
  background: #f6f2e9;
  box-shadow: 0 14px 36px #071d3020;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) :is(h2, h3, h4, h5, strong, b) {
  color: var(--review-ink);
}

:is(.chat-section, .review-section, .saved-section, .stats-section) > h2 {
  margin: 10px 0 12px;
  font-size: clamp(23px, 2.4vw, 31px);
  line-height: 1.4;
  letter-spacing: -.8px;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) :is(.muted, .fine, .guide-description, label) {
  color: var(--review-muted);
}

:is(.chat-section, .review-section, .saved-section, .stats-section) > :is(.muted, .guide-description) {
  max-width: 960px;
  font-size: 14px;
  line-height: 1.85;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section) :is(.eyebrow, .step) {
  color: var(--review-teal);
  font-weight: 750;
  letter-spacing: .5px;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) a {
  color: #076b72;
  text-decoration-color: #7dada8;
  overflow-wrap: anywhere;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid #148a85;
  outline-offset: 3px;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  color: var(--review-ink);
  background: var(--review-paper);
  border: 1px solid #b9cbc5;
  border-radius: 10px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.55;
}

:is(.chat-section, .review-section, .saved-section, .stats-section) :is(input, textarea)::placeholder {
  color: #647681;
  opacity: 1;
}

:is(.chat-section, .review-section, .saved-section, .stats-section) :is(input[type="checkbox"], input[type="radio"], input[type="range"]) {
  accent-color: var(--review-teal);
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) button:not(.vs-bar):not(.conclusion-dot) {
  min-height: 40px;
  border: 1px solid #afc6bd;
  border-radius: 10px;
  padding: 9px 13px;
  background: var(--review-paper);
  color: #24545a;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

:is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) button:not(:disabled):not(.vs-bar):not(.conclusion-dot):hover {
  color: #075c60;
  background: #e8f3ed;
  border-color: #639f91;
  box-shadow: 0 2px 7px #19364a0c;
}

:is(.chat-section, .review-section, .saved-section, .stats-section, .capability-details) summary {
  min-height: 42px;
  padding-block: 10px;
  color: #285a61;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}

/* Selected school: all nine tabs remain legible in the side-by-side panel. */
.observation-section #summary { display: flex; flex-direction: column; min-width: 0; }
.observation-section #summary > .school-heading { order: 0; }
.observation-section #summary > .profile-scope { order: 1; }
.observation-section #summary > .domain-tablist { order: 2; }
.observation-section #summary > .domain-cards { order: 3; }
.observation-section #summary > .radar-section { order: 4; margin-top: 18px; }
.observation-section #summary > .conditions-section { order: 5; }
.observation-section #summary > .profile-sources { order: 6; }
.observation-section #summary > .profile-limits { order: 7; }
.observation-section .school-heading {
  gap: 7px;
  margin: 0 0 10px;
}

.observation-section .school-heading h2 {
  flex-basis: 100%;
  margin-bottom: 3px;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -.85px;
  overflow-wrap: anywhere;
}

.observation-section .badge {
  padding: 5px 10px;
  border: 1px solid #ccd9d2;
  background: #eaf0e9;
  color: #3c605d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.observation-section .profile-scope {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.75;
}

.observation-section .empty {
  padding: 32px 18px;
  border-color: #a8c0b5;
  background: linear-gradient(145deg, #fffdf7, #ebf1e8);
  color: #506a73;
}

.observation-section .empty-symbol {
  color: var(--review-teal);
  font-size: 48px;
  line-height: 1.4;
}

.observation-section .empty h2 {
  font-size: 19px;
  line-height: 1.6;
}

.observation-section .empty p {
  font-size: 13px;
  line-height: 1.9;
}

.observation-section .radar-section {
  margin: 0 0 15px;
  padding: 12px 10px 13px;
  border-color: #d2ded6;
  border-radius: 14px;
  background: #fffdf7;
}

.observation-section .radar-basis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.observation-section .radar-basis button {
  padding: 7px 6px;
  min-height: 40px;
  font-size: 12px;
  border-radius: 8px;
}

.observation-section .radar-basis button.on,
.observation-section .radar-basis button.on:hover {
  color: #fffdf7;
  border-color: var(--review-teal);
  background: var(--review-teal);
  box-shadow: 0 3px 9px #087c781e;
}

.observation-section .radar-holder {
  width: 100%;
  max-width: 270px;
  margin: 12px auto 9px;
}

.observation-section svg.radar {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  color: var(--review-ink);
}

.observation-section svg.radar .ring { stroke: #d3dfd6; }
.observation-section svg.radar .spoke { stroke: #bfcdc5; }
.observation-section svg.radar .spoke.broken { stroke: #91a2a4; }
.observation-section svg.radar .area { fill: #32a58b24; stroke: #087c78; stroke-width: 2; }
.observation-section svg.radar .area-line { stroke: #087c78; stroke-width: 2; }
.observation-section svg.radar .dot { fill: #087c78; stroke: #fffdf7; stroke-width: 1; }
.observation-section svg.radar .axis-name { fill: #274651; font-size: 10px; font-weight: 750; text-anchor: middle; }
.observation-section svg.radar .axis-sub { fill: #556b74; font-size: 9px; text-anchor: middle; }
.observation-section svg.radar .axis-sub:nth-of-type(12) { transform: translateY(14px); }
.observation-section svg.radar .radar-empty { fill: #536875; }

.observation-section .radar-note {
  margin: 10px 0 0;
  padding: 9px 10px;
  border-radius: 8px;
  color: #526875;
  background: #f0f2e9;
  font-size: 11px;
  line-height: 1.7;
}

.observation-section .domain-tablist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 14px;
}

.observation-section .domain-tablist button {
  min-width: 0;
  min-height: 64px;
  padding: 9px 7px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-color: #c8d7d0;
  text-align: center;
  background: #fffdf7;
  color: #34515d;
}

.observation-section .domain-tablist .domain-name {
  color: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  word-break: keep-all;
}

.observation-section .domain-tablist .domain-count {
  display: block;
  font-size: 10px;
  line-height: 1.5;
  color: #5b727a;
}

.observation-section .domain-tablist button[aria-selected="true"],
.observation-section .domain-tablist button[aria-selected="true"]:hover {
  border-color: #087c78;
  background: #087c78;
  color: #fffdf7;
  box-shadow: 0 3px 9px #087c7826;
}

.observation-section .domain-tablist button[aria-selected="true"] .domain-count {
  color: #fffdf7;
}

.observation-section .domain-card {
  padding: 12px 15px 8px;
  border-color: #d0ddd5;
  background: #fffdf7;
  border-radius: 14px;
}

.observation-section .domain-card > .text-button {
  width: 100%;
  margin-bottom: 6px;
  color: #096b69;
  background: #e8f3ed;
  border-color: #a9cec2;
}

.observation-section .indicator {
  padding: 15px 0;
  border-color: #e0e5dc;
}

.observation-section .indicator-label {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.6;
  color: #183447;
}

.observation-section .indicator-label small {
  margin-top: 3px;
  color: #566b77;
  font-size: 12px;
  line-height: 1.7;
}

.observation-section .indicator-dir {
  display: block;
  margin: 3px 0 7px;
  color: #5b6e76;
  font-size: 11px;
}

.observation-section :is(.indicator-spread, .indicator-gu, .indicator-why) {
  margin-top: 6px;
  color: #536875;
  font-size: 12px;
  line-height: 1.7;
}

.observation-section .indicator.text .indicator-value {
  color: #126965;
  font-size: 17px;
}

.observation-section .indicator.missing .indicator-value {
  padding: 3px 8px;
  margin-bottom: 7px;
  border-radius: 6px;
  color: #655d48;
  background: #efeadb;
  font-size: 12px;
}

.observation-section svg.pct-bar { color: #183447; }
.observation-section svg.pct-bar .track { fill: #e5eae1; }
.observation-section svg.pct-bar .fill { fill: #16877e; }
.observation-section svg.pct-bar .gu-mark { stroke: #b6682a; }
.observation-section svg.pct-bar .pct-value { fill: #183447; font-weight: 750; }
.observation-section svg.pct-bar .pct-meta { fill: #536875; }

.observation-section .conditions-section {
  margin: 15px 0;
  padding: 14px;
  border: 1px solid #dfd6ba;
  border-radius: 12px;
  background: #f8f1df;
}

.observation-section .conditions-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #735c2c;
}

.observation-section .condition {
  color: #566772;
  font-size: 12px;
  line-height: 1.8;
}

.observation-section #summary > details {
  padding: 0 12px;
  border: 1px solid #d4ded5;
  border-radius: 10px;
  background: #f9f8ef;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.observation-section #summary > details > summary {
  min-height: 42px;
  padding: 10px 0;
  color: #315d65;
  font-size: 12px;
  font-weight: 650;
}

/* Evidence workspaces use paper, not white text on a dark dashboard. */
.chat-section :is(.question-examples, .upload-box, .collection-assistant, .analysis-topics, .policy-studio, .visual-atlas) {
  padding: 10px 16px;
  border: 1px solid #cedbd3;
  border-radius: 13px;
  background: #fffdf7;
}

.chat-section .question-examples { margin: 20px 0; }
.chat-section .prompts { gap: 8px; margin: 8px 0 12px; }
.chat-section .prompts button { background: #f0f4eb; text-align: left; }

.chat-section .chat-scope-label {
  font-size: 13px;
  font-weight: 650;
  color: #304f5d;
}

.chat-section .chat-workspace { margin-top: 20px; gap: 20px; }
.chat-section #chat-form {
  gap: 10px;
  padding: 12px;
  border-color: #a7c6bc;
  background: #fffdf7;
  box-shadow: 0 3px 14px #163a4208;
}

.chat-section #question {
  border: 0;
  min-height: 84px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.chat-section #send,
.review-section #save-review,
.chat-section .chat-save-bar .chat-save,
.chat-section .hitl-plan .hitl-run,
.chat-section .policy-studio > .ps-run {
  min-height: 44px;
  padding: 11px 18px;
  border-color: #087c78;
  background: #087c78;
  color: #fffdf7;
  box-shadow: 0 4px 12px #087c781c;
}

.chat-section #send:not(:disabled):hover,
.review-section #save-review:not(:disabled):hover,
.chat-section .chat-save-bar .chat-save:not(:disabled):hover,
.chat-section .hitl-plan .hitl-run:not(:disabled):hover,
.chat-section .policy-studio > .ps-run:not(:disabled):hover {
  background: #086663;
  border-color: #086663;
  color: #fffdf7;
}

.chat-section #evidence-panel {
  border-color: #c7d8cf;
  border-radius: 15px;
  background: #fffdf7;
  box-shadow: 0 6px 20px #18344706;
}

.chat-section #evidence-panel h3 { font-size: 22px; line-height: 1.5; }
.chat-section .panel-question { color: #536875; border-color: #dce2d9; line-height: 1.8; }
.chat-section .message { padding: 21px; background: #fffdf7; border-color: #d0ddd4; line-height: 1.85; }
.chat-section .message h3 { color: #087c78; }
.chat-section .message pre { background: #f0f0e8; color: #344f5d; }
.chat-section :is(.chat-save-bar, .agent-weights, .agent-input) { background: #edf3ea; border-color: #b9d1c3; }
.chat-section .chat-save-status { color: #536875; }
.chat-section :is(.agent-caveats, .agent-meta, .source-proof-status, .source-proof small, .collection-need small) { color: #5a6c76; }
.chat-section .source-evidence { background: #f3f4ec; border-color: #d3ded2; }
.chat-section :is(.source-origin, .collection-need, .collection-card) { background: #fffdf7; border-color: #cedcd1; color: #37535c; }
.chat-section :is(.collection-assistant > summary span, .source-evidence h4 span) { color: #446b6b; }
.chat-section .upload-document-preview { background: #f0f0e8; padding: 12px; border-radius: 8px; color: #344f5d; }
.chat-section .export-actions { gap: 9px; }

/* Existing analytical controls retain all selected and stale states. */
.chat-section .hitl-plan fieldset { background: #fffdf7; border-color: #cbd9cf; border-radius: 12px; }
.chat-section .hitl-choice { background: #fffdf7; border-color: #c4d5ca; color: #294e57; }
.chat-section .hitl-choice.is-selected { background: #e7f2e8; border-color: #16877e; }
.chat-section :is(.hitl-choice small, .overlap-criteria small, .hitl-lever-labels, .conclusion-axis) { color: #536875; }
.chat-section :is(.hitl-priority, .hitl-count, .vs-facts > div) { background: #eaf2e9; color: #2b5158; }
.chat-section .hitl-selected output { color: #087c78; }
.chat-section .hitl-share-strip span { background: #d9ebe0; color: #31595b; }
.chat-section .question-conclusion { border-color: #619f8c; background: #fffdf7; }
.chat-section .conclusion-headline { color: #1b5758; }
.chat-section .hitl-plan .conclusion-dot { background: #087c78; color: #fffdf7; }
.chat-section .vs-facts strong { color: #183447; }
.chat-section .vs-facts small { color: #536875; }
.chat-section .vs-bar-track { background: #e3eade; }
.chat-section .vs-bar-track i { background: #16877e; }
.chat-section :is(.vs-outcome, .vs-page-status) { color: #365864; }
.chat-section .vs-history-warning { background: #f8efda; color: #6e592d; }

/* Review and saved conversations: quiet, readable document surfaces. */
.review-section #review-context {
  padding: 13px 16px;
  border: 1px solid #ccdcd2;
  border-left: 3px solid #16877e;
  border-radius: 9px;
  background: #fffdf7;
  color: #47616c;
  font-size: 13px;
  line-height: 1.8;
}

.review-section .review-grid { gap: 28px; margin-top: 24px; }
.review-section .review-grid label { color: #294957; font-size: 14px; font-weight: 650; margin-bottom: 21px; }
.review-section .review-grid :is(input, select, textarea) { font-weight: 400; margin-top: 9px; }
.review-section .review-help { padding: 24px; background: #eaf0e5; border: 1px solid #d0dbc9; color: #52656c; line-height: 1.9; }
.review-section .review-help h3 { color: #2b5758; font-size: 16px; }
.review-section .review-help li { margin: 12px 0; }
.review-section #save-review { min-width: 190px; }
.saved-section .saved-toolbar { padding: 14px 17px; border: 1px solid #d3ded3; border-radius: 12px; background: #fffdf7; }
.saved-section .saved-import { color: #315a61; font-weight: 650; }
.saved-section .saved-import input { margin-top: 6px; }
.saved-section .saved-list article { padding: 21px; border-color: #cfddd3; background: #fffdf7; }
.saved-section .saved-list h3 { font-size: 18px; }
.saved-section :is(.saved-meta, .saved-entry small, .saved-entry p) { color: #536875; line-height: 1.8; }
.saved-section .saved-list .saved-actions { gap: 8px; }
.saved-section .saved-list .saved-actions button.danger { border-color: #d7b8ae; background: #fff4ed; color: #9a443e; }
.saved-section .saved-empty { padding: 46px 22px; background: #fffdf7; border-color: #b8cdbc; color: #536875; line-height: 1.9; }

/* Distribution panels: titles first, charts with visible baselines, warm paper. */
.stats-section .stats-controls {
  gap: 16px;
  margin: 24px 0;
  padding: 17px 19px;
  border: 1px solid #cadacf;
  border-radius: 13px;
  background: #eaf1e7;
}

.stats-section .stats-controls label { min-width: 160px; font-size: 13px; font-weight: 650; color: #31515d; }
.stats-section .stats-controls select { display: block; margin-top: 7px; }
.stats-section #stats-status { margin: 0 0 9px; font-size: 13px; }
.stats-section #stats-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.stats-section #stats-body > .muted { grid-column: 1 / -1; }
.stats-section .stat-indicator { margin: 0; padding: 22px; border-color: #d0dbd2; border-radius: 15px; background: #fffdf7; min-width: 0; box-shadow: 0 4px 15px #18344705; }
.stats-section .stat-indicator h3 { margin-bottom: 13px; font-size: 17px; font-weight: 750; line-height: 1.7; }
.stats-section .stat-dir { display: block; margin-top: 3px; color: #5d707a; font-size: 11px; line-height: 1.6; }
.stats-section .stat-indicator h3 small { font-size: 12px; font-weight: 500; color: #536875; }
.stats-section .stat-summary { margin: 13px 0 10px; padding: 11px 13px; border-radius: 8px; background: #eef2e9; font-size: 13px; font-weight: 550; line-height: 1.9; }
.stats-section .stat-selected { padding: 10px 13px; border-left: 3px solid #b87435; background: #fbf0dd; color: #855523; font-size: 13px; line-height: 1.85; }
.stats-section :is(.stat-island, .stat-coverage, .stat-empty, .stat-missing) { color: #566b76; font-size: 12px; line-height: 1.8; }
.stats-section .stat-coverage { margin-top: 14px; padding-top: 11px; border-top: 1px solid #dfe5da; font-weight: 650; }
.stats-section .stat-missing li { margin: 5px 0; }
.stats-section .stat-gu { margin-top: 12px; border-top: 1px solid #dfe5da; }
.stats-section svg.histogram { display: block; height: 135px; padding: 7px 0 0; }
.stats-section svg.histogram .bar { fill: #a2bbb1; }
.stats-section svg.histogram .bar.selected { fill: #b87435; }
.stats-section svg.histogram .axis { stroke: #9db5ac; }
.stats-section svg.histogram .axis-label { fill: #536875; font-size: 10px; }

:is(.chat-section, .stats-section, .saved-section) table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #294652;
}

:is(.chat-section, .stats-section, .saved-section) :is(th, td) {
  padding: 11px 12px;
  border-bottom: 1px solid #dfe5dc;
  text-align: left;
  line-height: 1.7;
}

.chat-section #evidence-panel th,
.chat-section .vs-root table th,
:is(.chat-section, .stats-section, .saved-section) th {
  background: #e9f0e5;
  color: #244d53;
  font-weight: 750;
}

:is(.chat-section, .stats-section, .saved-section) tbody tr:nth-child(even) { background: #f6f7ef; }
:is(.chat-section, .stats-section, .saved-section) tbody tr:hover { background: #edf3e8; }

.capability-details {
  margin: 26px 0 38px;
  padding: 8px 24px 12px;
  border: 1px solid #cbd7ce;
  border-radius: 15px;
  background: #f6f2e9;
}

.capability-details > summary { color: #315e61; font-size: 14px; }
.capability-details .capability-grid { gap: 26px; }
.capability-details .capability-grid > div { padding: 8px 0; }
.capability-details .capability-grid h3 { font-size: 15px; }
.capability-details .capability-grid p { color: #536875; font-size: 12px; line-height: 2; }

@media (max-width: 960px) {
  .stats-section #stats-body { grid-template-columns: minmax(0, 1fr); }
  .review-section .review-grid { gap: 20px; }
}

@media (max-width: 720px) {
  :is(.chat-section, .review-section, .saved-section, .stats-section) { padding: 20px 16px; border-radius: 16px; }
  :is(.chat-section, .review-section, .saved-section, .stats-section) > h2 { font-size: 24px; }
  .chat-section .chat-workspace { grid-template-columns: minmax(0, 1fr); }
  .chat-section :is(.question-examples, .upload-box, .collection-assistant, .analysis-topics, .policy-studio, .visual-atlas) { padding: 8px 12px; }
  .chat-section .message { padding: 16px; }
  .chat-section #chat-form { flex-wrap: wrap; gap: 8px; }
  .chat-section #question { flex-basis: 100%; }
  .chat-section #send { margin-left: auto; min-width: 128px; }
  .chat-section .chat-scope-label { flex-wrap: wrap; }
  .chat-section .chat-scope-label select { flex: 1; min-width: 140px; max-width: none; }
  .review-section .review-grid { grid-template-columns: minmax(0, 1fr); }
  .review-section .review-help { padding: 18px; }
  .saved-section .saved-import { min-width: 0; width: 100%; }
  .saved-section .saved-import input { display: block; width: 100%; margin-left: 0; }
  .stats-section .stats-controls { padding: 14px; gap: 12px; }
  .stats-section .stats-controls label { flex: 1; min-width: 110px; }
  .stats-section #stats-status { flex-basis: 100%; margin: 0; }
  .stats-section .stat-indicator { padding: 17px 15px; }
  .capability-details { padding-inline: 16px; }
  .capability-details .capability-grid { grid-template-columns: minmax(0, 1fr); gap: 5px; }
}

/* Two reading spaces, with the original DOM and handlers intact:
   evidence on the left; composer, answers and conversation tools on the right. */
#workspace-ask .chat-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  align-items: start;
}

#workspace-ask .chat-section > * {
  grid-column: 1 / -1;
  min-width: 0;
  order: 20;
}

#workspace-ask .chat-section > .step { order: 0; margin: 0; }
#workspace-ask .chat-section > #chat-title { order: 1; margin: -5px 0 2px; }
#workspace-ask .chat-section > .chat-scope-label {
  order: 2;
  grid-column: auto;
  align-self: stretch;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #b4cec2;
  border-radius: 11px;
  background: #edf4e9;
  color: #254e56;
  font-size: 14px;
  font-weight: 750;
}

#workspace-ask .chat-scope-label select {
  flex: 1;
  width: auto;
  max-width: none;
  min-width: 115px;
  min-height: 44px;
  border-color: #8bb5a9;
}

#workspace-ask .chat-section > #chat-context {
  order: 3;
  margin: -3px 0 0;
  color: #325d63;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.75;
}

#workspace-ask .chat-workspace,
#workspace-ask .chat-workspace.question-flow {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  order: 4;
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  margin: 2px 0 6px;
}

#workspace-ask .conversation {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  grid-row: 1;
  gap: 16px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #a4c9bc;
  border-top: 4px solid #168b7e;
  border-radius: 17px;
  background: #fffdf7;
  box-shadow: 0 5px 18px #123d4209;
}

#workspace-ask .conversation > * { min-width: 0; flex-shrink: 0; order: 10; }

#workspace-ask #evidence-panel,
#workspace-ask .question-flow #evidence-panel {
  grid-column: 1;
  grid-row: 1;
  order: 0;
  position: sticky;
  top: 20px;
  min-height: 580px;
  max-height: max(580px, calc(100vh - 40px));
  margin: 0;
  padding: 24px;
  border: 1px solid #b9cabb;
  border-top: 4px solid #97aa89;
  border-radius: 17px;
  background: #f3f5ec;
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  box-shadow: 0 5px 18px #123d4207;
}

#workspace-ask #evidence-panel > .eyebrow { margin-top: 0; font-size: 13px; }
#workspace-ask #evidence-panel h3 { font-size: 21px; line-height: 1.6; }
#workspace-ask #evidence-panel :is(figure, .vs-root, .vs-chart-stage) { min-width: 0; max-width: 100%; }
#workspace-ask #evidence-panel .table-scroll { max-width: 100%; overflow-x: auto; }
#workspace-ask #evidence-panel:has(> .eyebrow:first-child + h3 + .muted:last-child) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(24px, 3vw, 44px);
  background: radial-gradient(ellipse at top left, #e4eee1, transparent 70%), #f3f5ec;
}
#workspace-ask #evidence-panel > .muted { font-size: 14px; line-height: 1.85; }

#workspace-ask #messages,
#workspace-ask .question-flow #messages {
  order: 1;
  margin: 0;
  min-width: 0;
  max-height: 680px;
  overflow: auto;
  scrollbar-width: thin;
}
#workspace-ask #messages:empty { min-height: 0; }
#workspace-ask #messages .message { padding: 17px; border-color: #d2ded4; background: #f6f6ed; }
#workspace-ask #messages .message:first-child { margin-top: 0; }
#workspace-ask #messages .message:last-child { margin-bottom: 0; }
#workspace-ask .question-flow #messages { max-height: none; overflow: visible; }

#workspace-ask .conversation .chat-save-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px;
}
#workspace-ask .conversation .chat-save-bar input { min-width: 0; flex: 1 1 170px; }
#workspace-ask .conversation .chat-save-status { flex-basis: 100%; }
#workspace-ask .conversation :is(.studio-fields, .upload-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#workspace-ask .conversation :is(.studio-fields, .upload-grid) > label { min-width: 0; }
#workspace-ask .conversation :is(.studio-fields, .upload-grid) :is(input, select) { max-width: 100%; }

#workspace-ask #chat-form {
  order: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 2px solid #168b7e;
  border-radius: 17px;
  background: #fffef8;
  box-shadow: 0 0 0 4px #dcecdf, 0 8px 22px #123d420f;
  scroll-margin-top: 28px;
}

#workspace-ask #chat-form:focus-within {
  border-color: #046d65;
  box-shadow: 0 0 0 5px #80cbb949, 0 9px 24px #123d421a;
}

#workspace-ask #question {
  flex: 1 1 100%;
  min-width: 0;
  min-height: 126px;
  max-height: 280px;
  padding: 12px;
  border: 0;
  border-radius: 9px;
  background: #fffef8;
  color: #183447;
  font-size: 16px;
  line-height: 1.85;
}

#workspace-ask #question::placeholder { color: #586f77; }
#workspace-ask #question:focus-visible { outline: 2px solid #9ecabb; outline-offset: 2px; }
#workspace-ask #send {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-left: auto;
  min-height: 54px;
  min-width: 154px;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 800;
}

#workspace-ask .question-examples {
  order: 5;
  grid-column: 1 / -1;
  margin: 0;
  border-color: #c2d5c9;
}

#workspace-ask #upload-details {
  order: 2;
  margin: 0;
  border-color: #c2d5c9;
}

#workspace-ask .chat-section > .guide-description {
  order: 6;
  max-width: none;
  margin: 0;
  padding: 13px 16px;
  border-left: 3px solid #b5cabb;
  border-radius: 8px;
  background: #efefe4;
  font-size: 13px;
  line-height: 1.85;
}

#workspace-ask .chat-section > .fine { order: 7; margin: 0; line-height: 1.8; }
#workspace-ask .chat-save-bar { order: 3; margin: 0; }
#workspace-ask .conversation > .visual-atlas { order: 4; margin: 0; }
#workspace-ask .conversation > .policy-studio { order: 5; margin: 0; }
#workspace-ask .chat-section > .fine:last-child { order: 14; padding-top: 4px; }

@media (max-width: 1100px) {
  #workspace-ask .chat-workspace,
  #workspace-ask .chat-workspace.question-flow { gap: 14px; }
  #workspace-ask .conversation { padding: 14px; }
  #workspace-ask #evidence-panel { padding: 18px; }
}

@media (max-width: 900px) {
  #workspace-ask .chat-workspace,
  #workspace-ask .chat-workspace.question-flow { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #workspace-ask .conversation { grid-column: 1; grid-row: 1; }
  #workspace-ask #evidence-panel,
  #workspace-ask .question-flow #evidence-panel {
    grid-column: 1;
    grid-row: 2;
    position: static;
    min-height: 280px;
    max-height: none;
    overflow: auto;
  }
}

@media (max-width: 720px) {
  #workspace-ask .chat-section { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #workspace-ask .chat-section > .chat-scope-label { grid-column: 1; padding: 10px 12px; font-size: 13px; }
  #workspace-ask #chat-form { flex-wrap: wrap; gap: 10px; padding: 12px; border-radius: 14px; }
  #workspace-ask #question { flex-basis: 100%; min-height: 135px; padding: 9px; font-size: 16px; }
  #workspace-ask #send { margin-left: auto; min-height: 50px; min-width: 148px; }
  #workspace-ask .conversation { padding: 12px; gap: 13px; }
  #workspace-ask #evidence-panel { padding: 18px; }
  #workspace-ask #evidence-panel h3 { font-size: 19px; }
  #workspace-ask #messages .message { padding: 14px; }
  #workspace-ask .conversation :is(.studio-fields, .upload-grid) { grid-template-columns: minmax(0, 1fr); }
  #workspace-ask .chat-section > .guide-description { padding: 12px; font-size: 12px; }
}

@media print {
  #workspace-ask .chat-workspace,
  #workspace-ask .chat-workspace.question-flow { display: block; }
  #workspace-ask .conversation { display: flex; margin-bottom: 20px; }
  #workspace-ask #evidence-panel,
  #workspace-ask #messages { position: static; min-height: 0; max-height: none; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.observation-section, .chat-section, .review-section, .saved-section, .stats-section, .capability-details) button { transition: none; }
}
