:root {
  --ink: #222;
  --muted: #667085;
  --line: #d9dde7;
  --paper: #fffdf8;
  --rail: #003b4e;
  --rail-soft: #075871;
  --accent: #0099cc;
  --accent-soft: #e5f7fc;
  --chat: #f4f1ec;
  --danger: #8f2d1f;
  --shadow: 0 22px 70px rgba(18, 28, 42, 0.16);
  --topbar-height: 76px;
  --chat-width: min(440px, 50vw);
  --file-rail-width: 260px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #dfe5ec;
  color: var(--ink);
  font-family: Optima, "Segoe UI", Candara, Calibri, Arial, sans-serif;
}

body {
  user-select: text;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 76px 1fr;
}

.topbar {
  align-items: center;
  background: #fff;
  border-bottom: 2px dotted #366;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-lockup {
  align-items: center;
  display: grid;
  gap: 4px 16px;
  grid-template-columns: auto 1fr;
}

.brand-lockup a {
  grid-row: span 2;
}

.brand-lockup img {
  display: block;
  height: 28px;
  width: auto;
}

.system-version {
  color: #667085;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-left: 6px;
  text-transform: none;
  white-space: nowrap;
}

.eyeline,
.topbar h1,
.timer span,
.reader-toolbar p,
.chat-header p,
.survey p,
.pretest-card p {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyeline {
  color: #888;
  font-size: 11px;
  margin: 0 0 4px;
}

.topbar h1 {
  font-size: 13px;
  margin: 0;
}

.timer {
  align-items: baseline;
  color: #003b4e;
  display: flex;
  gap: 12px;
}

.timer[hidden] {
  display: none !important;
}

/* Persistent assigned-side reminder: topbar in conditions 1-2, board toolbar
   in 3-4 (it moves with the timer). */
.role-chip {
  align-items: baseline;
  color: #003b4e;
  display: flex;
  gap: 8px;
}

.role-chip[hidden] {
  display: none !important;
}

.role-chip span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.role-chip strong {
  font-size: 14px;
}

.board-toolbar .role-chip {
  border-bottom: 1px solid #dde5ea;
  margin: 0 0 4px;
  padding-bottom: 8px;
}

.prolific-complete {
  background: #f3faf5;
  border: 1px solid #bfe3cc;
  border-left: 4px solid #2f7f69;
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 12px 16px;
}

.prolific-complete strong {
  color: #1d5c4b;
  font-size: 14px;
}

.prolific-complete p {
  color: #2f3a42;
  font-size: 13px;
  margin: 0;
}

.prolific-complete code {
  background: #e3f2e9;
  font-size: 13px;
  font-weight: 900;
  padding: 1px 6px;
}

.task-intro-carryover {
  background: #f4fbfd;
  border-left: 4px solid var(--accent);
  color: #2f3a42;
  font-size: 13px;
  margin: 10px 0 0;
  padding: 8px 12px;
}

/* One timer format everywhere: same label and digits in the topbar (conditions
   1-2) and the board toolbar (conditions 3-4). */
.timer span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.timer strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.condition-tabs {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.condition-tabs a {
  border: 1px solid #c6dbe2;
  color: #0099cc;
  padding: 9px 12px;
  text-decoration: none;
}

.condition-tabs a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: var(--file-rail-width) minmax(0, 1fr);
  /* The columns scroll independently (file rail, document, aside) instead of
     the page: the workspace pins to the viewport and each column owns its
     overflow. Board mode overrides this with its own scrolling canvas. */
  height: calc(100vh - var(--topbar-height));
  min-height: 0;
  overflow: hidden;
}

.workspace.chat-floating {
  padding-right: var(--chat-width);
}

.workspace.files-collapsed {
  --file-rail-width: 0px;
}

.workspace.board-mode {
  background:
    linear-gradient(rgba(0, 59, 78, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 59, 78, 0.045) 1px, transparent 1px),
    #f7faf8;
  background-size: 28px 28px;
  display: block;
  height: calc(100vh - var(--topbar-height));
  min-height: calc(100vh - var(--topbar-height));
  overflow: auto;
}

body.board-task .workspace.board-mode {
  height: 100vh;
}

/* Hide the condition-1/2 panels in board mode. Direct-child selectors only:
   the board's "Case files" card also carries a .reader class deeper in the
   tree and must stay visible. */
.workspace.board-mode > .file-rail,
.workspace.board-mode > .reader,
.workspace.board-mode > .chat-panel {
  display: none;
}

.file-rail {
  background: linear-gradient(160deg, var(--rail), #0f1823);
  color: #eef4fb;
  min-width: 0;
  overflow: hidden auto;
  padding: 24px 0;
}

.rail-heading {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  padding: 0 22px 18px;
}

.file-rail-toggle,
.file-rail-open {
  align-items: center;
  background: transparent;
  border: 1px solid #7fa7b5;
  cursor: pointer;
  display: inline-grid;
  gap: 3px;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

.file-rail-toggle span,
.file-rail-open span {
  background: currentColor;
  display: block;
  height: 2px;
  width: 16px;
}

.file-rail-toggle {
  color: #eef4fb;
}

.file-rail-toggle:hover,
.file-rail-toggle:focus-visible {
  border-color: #eef4fb;
  outline: none;
}

.file-rail-open {
  color: #003b4e;
  flex: 0 0 auto;
}

.file-rail-open:hover,
.file-rail-open:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.workspace.files-collapsed .file-rail {
  padding: 0;
}

.rail-heading span {
  font-size: 11px;
  text-transform: uppercase;
}

.rail-heading strong {
  color: #aebdcb;
  font-size: 11px;
  font-weight: 500;
}

.file-evidence-legend {
  align-items: center;
  border-bottom: 1px solid rgba(174, 189, 203, 0.22);
  color: #c8d7e4;
  display: flex;
  flex-wrap: wrap;
  font-size: 10px;
  gap: 7px 12px;
  line-height: 1.2;
  margin: 0;
  padding: 0 16px 11px;
}

.file-evidence-legend[hidden] {
  display: none;
}

.file-legend-item {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  white-space: nowrap;
}

.file-legend-swatch {
  background: rgba(229, 247, 252, 0.08);
  border-left: 4px solid;
  display: inline-block;
  height: 13px;
  width: 17px;
}

.file-legend-swatch-top {
  background: rgba(242, 193, 78, 0.2);
  border-left-color: #f2c14e;
}

.file-legend-swatch-strong {
  background: rgba(84, 196, 178, 0.14);
  border-left-color: #54c4b2;
}

.file-legend-count {
  background: rgba(229, 247, 252, 0.14);
  border: 1px solid rgba(229, 247, 252, 0.34);
  border-radius: 999px;
  color: #dff8ff;
  font-size: 9px;
  font-weight: 800;
  min-width: 19px;
  padding: 2px 5px;
  text-align: center;
}

.file-list {
  display: grid;
}

.file-button {
  align-items: start;
  background: transparent;
  border: 0;
  border-left: 5px solid transparent;
  color: #d9e4ef;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 10px 16px;
  text-align: left;
}

.file-button:hover,
.file-button.active {
  background: var(--rail-soft);
  border-left-color: var(--accent);
}

.file-button.file-priority-top:not(.active) {
  background: rgba(242, 193, 78, 0.2);
  border-left-color: #f2c14e;
}

.file-button.file-priority-strong:not(.active) {
  background: rgba(84, 196, 178, 0.14);
  border-left-color: #54c4b2;
}

.file-button.file-priority-top:not(.active) strong {
  color: #ffe298;
}

.file-button.file-priority-strong:not(.active) strong {
  color: #baf2e8;
}

.file-button span {
  color: #92a8bc;
  font-size: 11px;
}

.file-button strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.18;
}

.file-button .file-evidence-count {
  align-self: center;
  background: rgba(229, 247, 252, 0.14);
  border: 1px solid rgba(229, 247, 252, 0.34);
  border-radius: 999px;
  color: #dff8ff;
  font-family: Optima, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 800;
  min-width: 20px;
  padding: 2px 6px;
  text-align: center;
}

.file-button .file-evidence-count.priority-top {
  background: #f2c14e;
  border-color: #ffe298;
  color: #253342;
}

.file-button .file-evidence-count.priority-strong {
  background: #54c4b2;
  border-color: #9ae3d8;
  color: #102f32;
}

.file-button .file-evidence-count.priority-relevant {
  background: rgba(180, 204, 224, 0.18);
  border-color: rgba(204, 222, 237, 0.42);
  color: #e1edf6;
}

.file-button .file-evidence-count.complete {
  background: rgba(84, 196, 178, 0.1);
  border-color: rgba(154, 227, 216, 0.42);
  color: #9ae3d8;
}

.reader {
  background:
    radial-gradient(circle at 35% 0%, rgba(0, 153, 204, 0.12), transparent 28%),
    var(--paper);
  min-width: 0;
  padding: 0;
}

/* Reading layout: toolbar / scrolling document / docked chat. Scoped to the
   workspace's own reader column — the board's "Case files" card reuses the
   .reader class deeper in the tree. */
.workspace > .reader {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.workspace > .reader .document-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* The column itself scrolls, so the 760px measure comes from symmetric
     padding rather than max-width — keeps the scrollbar on the column edge. */
  max-width: none;
  padding: 24px calc(max(34px, (100% - 760px) / 2)) 64px;
  width: 100%;
}

.reader-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 62px;
  padding: 12px 34px;
}

.reader-toolbar > div {
  min-width: 0;
}

.reader-toolbar p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 5px;
}

.reader-toolbar h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  margin: 0;
}

/* Floating selection toolbar: positioned by handleSelection next to the
   highlighted text, like an inline highlight menu. */
.selection-actions {
  display: flex;
  gap: 6px;
  position: fixed;
  z-index: 24;
}

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

.copy-ai {
  background: #003b4e;
  border: 0;
  box-shadow: 0 10px 26px rgba(18, 28, 42, 0.18);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 13px;
  /* The toolbar is measured for placement before it settles at the
     selection; wrapped labels would freeze it at a stale narrow size. */
  white-space: nowrap;
}

#copyToSheet {
  background: #22606f;
}

.document-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5pt;
  line-height: 1.48;
  margin: 0 auto;
  max-width: 760px;
  outline: none;
  padding: 24px 34px 64px;
  white-space: pre-wrap;
}

.document-text::selection {
  background: var(--accent-soft);
}

/* Shared C3/C5/C6/C7 evidence lens: a mark stays part of the document, while
   the compact control adds the quote without creating another review tray. */
.evidence-mark {
  background: #dff3f4;
  border-bottom: 1px solid #57a5aa;
  border-radius: 3px;
  color: inherit;
  padding: 1px 0;
}

.evidence-mark.evidence-selected {
  background: #bee8eb;
  border-bottom-color: #087b84;
  box-shadow: inset 0 -2px 0 #087b84;
}

.evidence-mark.evidence-covered {
  background: #eceeea;
  border-bottom-color: #c4c9c2;
  color: #6f756f;
}

.evidence-add {
  background: #007d88;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  font-family: Optima, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  margin: 0 2px;
  min-height: 20px;
  min-width: 20px;
  padding: 4px 6px;
  vertical-align: 1px;
}

.evidence-add:focus-visible {
  outline: 3px solid rgba(0, 153, 204, 0.28);
  outline-offset: 2px;
}

.evidence-add:disabled {
  background: transparent;
  color: #536b6d;
  cursor: default;
  font-size: 9px;
  min-width: 0;
  padding-inline: 4px;
}

.chat-panel {
  background: linear-gradient(180deg, #fbfaf7, var(--chat));
  border-left: 1px solid var(--line);
  bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: fixed;
  right: 0;
  top: var(--topbar-height);
  width: var(--chat-width);
  z-index: 20;
}

.chat-resize-handle {
  background: transparent;
  bottom: 0;
  cursor: col-resize;
  left: -7px;
  position: absolute;
  top: 0;
  width: 14px;
  z-index: 2;
}

.chat-resize-handle::after {
  background: #c8d6dd;
  bottom: 0;
  content: "";
  left: 6px;
  position: absolute;
  top: 0;
  width: 2px;
}

.chat-resize-handle:hover::after,
.chat-resize-handle:focus-visible::after,
.chat-panel.resizing .chat-resize-handle::after {
  background: var(--accent);
}

body.resizing-chat {
  cursor: col-resize;
  user-select: none;
}

.note-panel {
  border-bottom: 1px solid var(--line);
  display: grid;
  flex: 0 0 220px;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 160px;
}

.chat-panel.no-chat .note-panel {
  border-bottom: 0;
  flex: 1 1 auto;
}

.note-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 16px 18px 10px;
}

.note-header strong {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.note-header span {
  color: var(--muted);
  font-size: 12px;
}

.note-panel textarea {
  background: #fff;
  border: 1px solid #cbd5df;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  margin: 0 18px 18px;
  min-height: 0;
  padding: 12px;
  resize: none;
}

.chat-panel.no-chat .note-panel textarea {
  resize: vertical;
}

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

.chat-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
}

.chat-header p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin: 0 0 6px;
}

.chat-header strong {
  font-size: 16px;
}

.chat-header span {
  color: var(--muted);
  font-size: 12px;
}

.chat-note {
  border-bottom: 1px solid var(--line);
  color: #465467;
  font-size: 13px;
  line-height: 1.38;
  margin: 0;
  padding: 14px 22px;
}

.chat-messages {
  background: linear-gradient(180deg, #fbfaf7, var(--chat));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.message {
  border-radius: 8px;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.45;
  min-height: 42px;
  max-width: 92%;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 13px 14px;
  white-space: normal;
  word-break: break-word;
}

.message p {
  margin: 0 0 10px;
}

.message h1,
.message h2,
.message h3,
.message h4,
.message h5,
.message h6 {
  font-family: inherit;
  font-size: 1em;
  line-height: 1.35;
  margin: 14px 0 8px;
}

.message > :first-child {
  margin-top: 0;
}

.message p:last-child,
.message ul:last-child,
.message ol:last-child,
.message h1:last-child,
.message h2:last-child,
.message h3:last-child,
.message h4:last-child,
.message h5:last-child,
.message h6:last-child {
  margin-bottom: 0;
}

.message ul,
.message ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.message code {
  background: #eef2f6;
  border-radius: 3px;
  color: #203149;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  padding: 1px 4px;
}

.message a {
  color: #007aa3;
  font-weight: 800;
}

.message.user {
  align-self: flex-end;
  background: #203149;
  color: #fff;
  max-width: 92%;
  white-space: pre-wrap;
}

.message.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(18, 28, 42, 0.08);
  max-width: 92%;
}

.message.assistant.pending {
  align-items: center;
  display: inline-flex;
  gap: 9px;
  width: max-content;
}

.message-loading-spinner {
  animation: message-loading-spin 0.8s linear infinite;
  border: 2px solid #c7dce2;
  border-radius: 50%;
  border-top-color: #0099cc;
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.message-loading-label {
  color: #52666f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

@keyframes message-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .message-loading-spinner {
    animation: none;
  }
}

.chat-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 18px;
}

.chat-form textarea {
  background: #fff;
  border: 1px solid #bdc5cf;
  color: var(--ink);
  min-height: 94px;
  padding: 13px;
  resize: vertical;
}

.chat-form button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  justify-self: end;
  padding: 8px 18px;
}

.board-workspace {
  min-height: calc(100vh - var(--topbar-height));
  min-width: 1720px;
  overscroll-behavior: none;
  overflow: hidden;
  padding: 18px 22px 70px 0;
  position: relative;
}

.board-workspace.fullscreen-active::before {
  background: rgba(15, 23, 42, 0.52);
  content: "";
  inset: var(--topbar-height) 0 0;
  pointer-events: auto;
  position: fixed;
  z-index: 25;
}

.board-toolbar {
  align-content: start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d6e8ee;
  box-shadow: 0 10px 28px rgba(0, 59, 78, 0.08);
  display: grid;
  gap: 8px;
  left: 22px;
  max-height: calc(100vh - var(--topbar-height) - 40px);
  overflow-y: auto;
  padding: 14px;
  position: fixed;
  top: calc(var(--topbar-height) + 18px);
  width: 200px;
  z-index: 24;
}

.board-toolbar p {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 3px;
}

.board-tool,
.board-secondary,
.board-card-head button,
.board-refine button,
.board-chat-form button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 9px 11px;
}

.board-tool {
  background: #fff;
  border: 1px solid #b9d5df;
  color: #003b4e;
  display: grid;
  gap: 3px;
  line-height: 1.15;
  text-align: left;
}

.board-tool span {
  font-weight: 900;
}

.board-tool small {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.board-tool:hover,
.board-tool:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.board-tool:hover small,
.board-tool:focus-visible small {
  color: #007aa3;
}

.board-secondary {
  background: #203149;
}

.board-card-head button:disabled,
.board-refine button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.board-toolbar > span {
  color: #465467;
  font-size: 13px;
  line-height: 1.35;
}


.board-zoom {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d6e8ee;
  bottom: 22px;
  box-shadow: 0 12px 32px rgba(0, 59, 78, 0.16);
  display: grid;
  gap: 8px;
  grid-template-columns: auto 32px minmax(110px, 160px) 32px auto auto;
  left: 240px;
  padding: 10px 12px;
  position: fixed;
  z-index: 24;
}

.board-zoom #boardResetView {
  background: #203149;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  height: 32px;
  padding: 0 10px;
  white-space: nowrap;
  /* .board-zoom button sets width: 32px for the +/- squares; this button
     must size to its label. */
  width: auto;
}

.board-zoom .zoom-hint {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  grid-column: 1 / -1;
  text-align: center;
}

.board-zoom p,
.board-zoom span {
  color: #003b4e;
  font-size: 12px;
  font-weight: 900;
  margin: 0;
  text-align: center;
}

.board-zoom button {
  align-items: center;
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  display: grid;
  font-size: 20px;
  font-weight: 900;
  height: 32px;
  line-height: 1;
  place-items: center;
  width: 32px;
}

.board-zoom input {
  accent-color: var(--accent);
  cursor: grab;
  width: 100%;
}

.board-zoom input:active {
  cursor: grabbing;
}

.board-chat-float {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d6e8ee;
  box-shadow: 0 14px 38px rgba(0, 59, 78, 0.16);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - var(--topbar-height) - 36px);
  max-width: min(760px, calc(100vw - 44px));
  min-height: 300px;
  min-width: 300px;
  overflow: hidden;
  position: fixed;
  right: 22px;
  top: calc(var(--topbar-height) + 18px);
  width: 360px;
  z-index: 30;
}

.board-chat-float.embedded {
  border: 0;
  box-shadow: none;
  height: 100%;
  max-height: none;
  max-width: none;
  min-height: 0;
  min-width: 280px;
  position: relative;
  right: auto;
  top: auto;
  width: 100%;
  z-index: 1;
}

@media (max-width: 760px) {
  .board-chat-float {
    left: 12px;
    right: 12px;
    top: calc(var(--topbar-height) + 12px);
    width: auto;
  }

  .board-chat-float.collapsed {
    width: auto;
  }

  .board-zoom {
    /* Left-anchored with a flexible slider; the chat panel owns the
       bottom-right corner. */
    grid-template-columns: auto 32px minmax(60px, 1fr) 32px auto auto;
    left: 12px;
    max-width: calc(100vw - 24px);
    right: auto;
  }
}

.board-chat-float.collapsed {
  grid-template-rows: auto;
  min-height: 0;
  width: 220px;
}

.board-chat-float.collapsed .board-chat-log,
.board-chat-float.collapsed .board-chat-form {
  display: none;
}

.board-chat-float.embedded.collapsed {
  width: 100%;
}

.board-chat-float.embedded .board-chat-float-head button {
  display: none;
}

.board-chat-float-head {
  align-items: start;
  border-bottom: 1px solid #d6e8ee;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.board-chat-float-head p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.board-chat-float-head strong {
  color: #003b4e;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
}

.board-chat-float-head button {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  color: #003b4e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 10px;
}

.board-chat-resize {
  background: transparent;
  border: 0;
  bottom: 0;
  cursor: nesw-resize;
  height: 28px;
  left: 0;
  padding: 0;
  position: absolute;
  width: 28px;
}

.board-chat-resize::after {
  border-bottom: 2px solid #6f8792;
  border-left: 2px solid #6f8792;
  bottom: 7px;
  content: "";
  height: 10px;
  left: 7px;
  opacity: 0.75;
  position: absolute;
  width: 10px;
}

.board-chat-resize:hover::after,
.board-chat-resize:focus-visible::after,
body.board-chat-resizing .board-chat-resize::after {
  border-color: var(--accent);
  opacity: 1;
}

.board-chat-float.collapsed .board-chat-resize {
  display: none;
}

.board-canvas {
  cursor: grab;
  margin-left: 220px;
  min-height: 2600px;
  min-width: 3600px;
  position: relative;
  transform: scale(var(--board-scale, 1));
  transform-origin: top left;
  z-index: 20;
}

.board-canvas.fullscreen-active {
  transform: none;
  z-index: 26;
}

.board-canvas.fullscreen-active .board-card:not(.fullscreen) {
  display: none;
  pointer-events: none;
}

.board-canvas.fullscreen-active .board-sticky {
  display: none;
}

.board-card {
  background: #fff;
  border: 1px solid #d4e4eb;
  box-shadow: 0 16px 40px rgba(18, 28, 42, 0.12);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  position: absolute;
  z-index: 1;
}

/* Regenerating over existing content: dim the stale body under an overlay.
   First-time generation uses the in-body .board-loading block instead. */
.board-card.generating:not(.generating-fresh)::after {
  background: rgba(0, 59, 78, 0.92);
  color: #fff;
  content: "Generating... usually 10-30 s";
  font-size: 12px;
  font-weight: 900;
  left: 50%;
  padding: 9px 14px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 3;
}

.board-loading {
  align-items: center;
  display: grid;
  gap: 6px;
  height: 100%;
  justify-items: center;
  place-content: center;
  text-align: center;
}

.board-loading p {
  animation: board-loading-pulse 1.6s ease-in-out infinite;
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.board-loading span {
  color: #667085;
  font-size: 12px;
}

@keyframes board-loading-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.board-note-drag .board-remove {
  background: transparent;
  border: 0;
  color: rgba(47, 42, 16, 0.74);
  cursor: pointer;
  float: right;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 0 2px;
}

.board-toolbar .board-undo {
  background: #203149;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  margin-left: 6px;
  padding: 4px 8px;
}

.influence-legend {
  align-items: center;
  color: #344054;
  display: flex;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  gap: 12px;
  margin-top: 8px;
}

.influence-legend .route-swatch {
  background: #2f7f69;
  display: inline-block;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  width: 18px;
}

.influence-legend .route-swatch.route-1 {
  background: #007aa3;
}

.influence-legend .route-swatch.route-2 {
  background: #a9642f;
}

.influence-legend .route-swatch.route-3 {
  background: #6f7890;
}

.influence-axes-hint {
  color: #667085;
  font-size: 11px;
  line-height: 1.4;
  margin: 4px 0 0;
}

/* Keep the card itself opaque (translucency let underlying cards bleed
   through); only the stale body dims while regenerating. */
.board-card.generating:not(.generating-fresh) .board-card-body {
  opacity: 0.5;
}

.board-card.highlighted {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(0, 153, 204, 0.16), 0 18px 42px rgba(18, 28, 42, 0.16);
}

.board-sticky.highlighted {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.board-card.generating::after {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  color: #003b4e;
  content: "Generating...";
  display: grid;
  font-size: 12px;
  font-weight: 900;
  inset: 0;
  letter-spacing: 0.08em;
  place-items: center;
  pointer-events: none;
  position: absolute;
  text-transform: uppercase;
  z-index: 5;
}

.board-card.fullscreen {
  height: auto !important;
  inset: calc(var(--topbar-height) + 14px) 18px 18px 218px !important;
  max-height: none;
  position: fixed;
  width: auto !important;
  z-index: 40;
}

.board-card.fullscreen.with-embedded-chat {
  --embedded-chat-width: 360px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, var(--embedded-chat-width));
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.board-card.fullscreen.with-embedded-chat .board-card-head {
  grid-column: 1 / -1;
}

.board-card.fullscreen.with-embedded-chat .board-card-body {
  grid-column: 1;
  grid-row: 2;
}

.board-card.fullscreen.with-embedded-chat .board-refine {
  grid-column: 1;
  grid-row: 3;
}

.board-card-chat-slot {
  border-left: 1px solid #d6e8ee;
  display: grid;
  grid-column: 2;
  grid-row: 2 / 4;
  min-height: 0;
  min-width: 0;
}

.board-card.minimized {
  grid-template-rows: auto;
  min-height: 0;
}

.board-card.file,
.board-card.reader {
  background: #fffdf8;
}

.board-card.chatbot {
  max-height: none;
}

.board-card.note {
  background: #fff3a6;
  border: 1px solid #e5c84f;
  box-shadow: 0 12px 24px rgba(96, 72, 0, 0.16);
  grid-template-rows: auto minmax(0, 1fr);
}

.board-card-head {
  align-items: start;
  background: #f8fbfc;
  border-bottom: 1px solid #d6e8ee;
  cursor: grab;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
  user-select: none;
}

.board-card-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.board-card-head .board-minimize {
  background: #fff;
  border: 1px solid #b9d5df;
  color: #003b4e;
}

.board-card-head .board-fullscreen {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  color: #003b4e;
}

.board-card-head p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.board-card-head strong {
  color: #003b4e;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.1;
}

.board-version-dots,
.reference-version-dots {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.board-version-dots::before,
.reference-version-dots::before {
  color: #667085;
  content: "Versions";
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.board-version-dots button,
.reference-version-dots button {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  border-radius: 3px;
  color: #003b4e;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  height: auto;
  padding: 2px 5px;
  width: auto;
}

.board-version-dots button.active,
.reference-version-dots button.active {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.14);
}

.board-card-body {
  color: #2b2f36;
  font-size: 13px;
  line-height: 1.42;
  min-height: 0;
  overflow: auto;
  /* Reaching the end of a card's scroll must not chain into panning the
     whole board behind it. */
  overscroll-behavior: contain;
  padding: 14px;
}

.board-card.file .board-card-body,
.board-card.reader .board-card-body {
  font-size: 11px;
  line-height: 1.45;
}

.board-card-body.note-body {
  padding: 0;
}

.board-note-drag {
  background: rgba(229, 200, 79, 0.58);
  border: 0;
  border-bottom: 1px solid rgba(96, 72, 0, 0.18);
  color: rgba(47, 42, 16, 0.74);
  cursor: grab;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  text-transform: uppercase;
}

.board-note-textarea {
  background: transparent;
  border: 0;
  color: #2f2a10;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  height: 100%;
  line-height: 1.35;
  min-height: 100%;
  outline: none;
  padding: 16px;
  resize: none;
  width: 100%;
}

.board-note-textarea::placeholder {
  color: rgba(47, 42, 16, 0.55);
}

.board-resize {
  background: transparent;
  border: 0;
  bottom: 3px;
  cursor: nwse-resize;
  height: 22px;
  padding: 0;
  position: absolute;
  right: 3px;
  width: 22px;
}

.board-resize::after {
  border-bottom: 3px solid #789a88;
  border-right: 3px solid #789a88;
  bottom: 4px;
  content: "";
  height: 10px;
  position: absolute;
  right: 4px;
  width: 10px;
}

.board-file-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12pt;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Pending-highlight count on the file tabs: shows the scan found passages
   in every file, not just the open one. */
.board-reader-tab {
  position: relative;
}

.board-reader-tab .tab-badge {
  background: #c4533d;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  min-width: 14px;
  padding: 2px 3px;
  position: absolute;
  right: -5px;
  text-align: center;
  top: -6px;
}

.board-reader-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.board-reader-tab {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  border-radius: 3px;
  color: #003b4e;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
}

.board-reader-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.board-reader-title {
  color: #667085;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 10px;
}

.board-diff-banner {
  align-items: center;
  background: #f0faf3;
  border: 1px solid #bfe3c8;
  border-left: 4px solid #2f7f69;
  color: #1d4f41;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 8px 10px;
}

.board-diff-banner button {
  background: #2f7f69;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
  white-space: nowrap;
}

.board-version-dots .board-diff-toggle {
  background: #fff;
  border: 1px dashed #b9d5df;
  border-radius: 3px;
  color: #003b4e;
  cursor: pointer;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
}

.board-version-dots .board-diff-toggle.active {
  background: #f0faf3;
  border-color: #2f7f69;
  border-style: solid;
  color: #1d4f41;
}

.diff-leaf.diff-added {
  background: #e8f7ec;
  box-shadow: 0 0 0 2px #e8f7ec;
}

.diff-leaf.diff-removed {
  background: #fbeeee;
  box-shadow: 0 0 0 2px #fbeeee;
  color: #8a3030;
  text-decoration: line-through;
}

.diff-badge {
  background: #fdf3e0;
  border: 1px solid #e3c489;
  border-radius: 3px;
  color: #7a5413;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-left: 6px;
  padding: 1px 5px;
  text-transform: uppercase;
  vertical-align: middle;
}

.diff-previous {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  text-decoration: line-through;
}

.influence-diff .influence-diff-route {
  border: 1px solid #e2e8ec;
  border-left: 4px solid #cbd5db;
  border-radius: 4px;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.influence-diff .influence-diff-route.diff-added {
  background: #e8f7ec;
  border-left-color: #2f7f69;
}

.influence-diff .influence-diff-route.diff-removed {
  background: #fbeeee;
  border-left-color: #b54343;
}

.influence-diff .influence-diff-route.diff-removed .influence-diff-line {
  color: #8a3030;
  text-decoration: line-through;
}

.influence-diff .influence-diff-route.diff-changed {
  background: #fffaf0;
  border-left-color: #e3c489;
}

.influence-diff-head {
  align-items: center;
  display: flex;
  gap: 8px;
}

.influence-diff-line {
  margin: 4px 0 0;
}

.influence-diff-line strong {
  font-weight: 800;
}

.influence-diff-was {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0;
  padding-left: 1.2em;
  text-decoration: line-through;
}

.board-card-error {
  background: #fbeeee;
  border: 1px solid #e4b8b8;
  border-left: 4px solid #b54343;
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px;
}

.board-card-error-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.board-card-error strong {
  color: #8a3030;
  font-size: 13px;
}

.board-card-error small {
  color: #6b4a4a;
  font-size: 11px;
  line-height: 1.35;
}

.board-card-error button {
  background: #b54343;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 12px;
}

.board-action-chip {
  align-items: center;
  align-self: flex-start;
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  border-left: 4px solid var(--accent);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -4px;
  max-width: min(92%, 430px);
  padding: 8px 10px;
}

.board-action-chip span {
  color: #003b4e;
  font-size: 12px;
  font-weight: 800;
}

.board-action-chip button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
}

.board-action-chip .board-action-ignore {
  background: #fff;
  border: 1px solid #b9d5df;
  color: #003b4e;
}

.board-selection-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(0, 59, 78, 0.18);
  box-shadow: 0 6px 18px rgba(0, 35, 48, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: min(430px, calc(100vw - 32px));
  padding: 3px;
  position: absolute;
  z-index: 45;
}

.board-selection-pill .pill-ask,
.board-selection-pill .pill-pin,
.board-selection-pill .pill-add-menu {
  background: #003b4e;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.board-selection-pill .pill-pin {
  background: #fff8c5;
  border: 1px solid #d0b43d;
  color: #3e3510;
}

.board-selection-pill .pill-ask:hover,
.board-selection-pill .pill-ask:focus-visible,
.board-selection-pill .pill-pin:hover,
.board-selection-pill .pill-pin:focus-visible,
.board-selection-pill .pill-add-menu:hover,
.board-selection-pill .pill-add-menu:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
}

.board-selection-pill .pill-add-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #d7e2e7;
  display: flex;
  flex-basis: 100%;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 3px;
}

.board-selection-pill .pill-add-row span {
  color: #56616d;
  font-size: 11px;
  font-weight: 900;
}

.board-selection-pill .pill-cell-select {
  border: 1px solid #b9cbd3;
  color: #003b4e;
  font-size: 11px;
  max-width: 100%;
  min-width: 210px;
  padding: 4px 6px;
}

.board-selection-pill .pill-add {
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.board-selection-pill .pill-add-cell {
  background: #003b4e;
  color: #fff;
  justify-self: end;
}

.board-selection-pill .pill-add.added {
  border-color: currentColor;
  cursor: default;
  opacity: 0.75;
}

/* Condition-4 framework colors: marks, legend chips, pill add buttons.
   The --hl-* variables are the underline accents used by multi-label marks. */
:root {
  --hl-redline: #c4533d;
  --hl-influence: #3f6bb5;
  --hl-ioa: #2f8a57;
  --hl-parties: #b98a1d;
}

.hl-redline {
  background: #f8d7d3;
  color: #7a2418;
}

.hl-influence {
  background: #d8e3f6;
  color: #23457c;
}

.hl-ioa {
  background: #cfe8d8;
  color: #1d5c38;
}

.hl-parties {
  background: #f3e6c4;
  color: #6e5410;
}

.highlight-mark {
  border-bottom: 2px solid currentColor;
  cursor: pointer;
  padding: 1px 0;
}

/* During the task the topbar disappears entirely; the timer docks into the
   reader toolbar (or the board toolbar in condition 4) and the assigned-side
   chip tops the right panel. */
body.task-active .topbar,
body.board-task .topbar {
  display: none;
}

.board-toolbar .timer {
  border-bottom: 1px solid #dde5ea;
  margin: 0 0 4px;
  padding-bottom: 8px;
}

/* Dismissible floating preparation guide, shared across all conditions. */
.task-guide {
  background: #f4fbfd;
  border: 1px solid #cfe6ef;
  box-shadow: 0 14px 38px rgba(0, 59, 78, 0.18);
  color: #344054;
  font-size: 12px;
  left: 50%;
  max-width: 360px;
  padding: 12px 14px;
  position: fixed;
  top: calc(var(--topbar-height, 56px) + 12px);
  transform: translateX(-50%);
  width: max-content;
  z-index: 60;
}

.task-guide-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.task-guide-head strong {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}

.task-guide-head button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 10px;
}

.task-guide ul {
  display: grid;
  gap: 6px;
  line-height: 1.4;
  margin: 0;
  padding-left: 18px;
}

.task-guide-open {
  background: #f4fbfd;
  border: 1px solid #cfe6ef;
  box-shadow: 0 8px 22px rgba(0, 59, 78, 0.14);
  color: #003b4e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  left: 50%;
  padding: 6px 12px;
  position: fixed;
  top: calc(var(--topbar-height, 56px) + 12px);
  transform: translateX(-50%);
  z-index: 60;
}

/* While a board card is fullscreen, the page behind must not scroll —
   wheel events at the card's edge were scrolling the whole board away. */
/* Whole-experiment device/window gate: opaque, above everything. */
.viewport-gate {
  align-items: center;
  background: #dfe5ec;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 200;
}

.viewport-gate[hidden] {
  display: none;
}

.viewport-gate-card {
  background: #fff;
  border: 1px solid #c8d4d9;
  box-shadow: 0 18px 42px rgba(18, 28, 42, 0.16);
  max-width: 460px;
  padding: 28px 32px;
  text-align: center;
}

.viewport-gate-card h2 {
  color: #003b4e;
  margin: 0 0 10px;
}

.viewport-gate-card p {
  color: #344054;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
}

html.board-fullscreen-lock {
  overflow: hidden;
}

html:has(body.board-task),
body.board-task,
body.board-task .workspace.board-mode {
  overscroll-behavior: none;
}

html.tutorial-scroll-lock,
body.tutorial-scroll-lock {
  overscroll-behavior: none;
  overflow: hidden;
}

.driver-active .viewport-gate:not([hidden]) {
  pointer-events: auto !important;
  z-index: 1000000002;
}

.driver-active .viewport-gate:not([hidden]) * {
  pointer-events: auto !important;
}

/* A passage carrying labels from several frameworks: neutral tint, one
   stacked underline per framework (set inline via box-shadow). */
.highlight-mark.hl-multi {
  background: #e9edf2;
  border-bottom: 0;
  color: inherit;
}

/* Supporting-importance highlights stay visible but recede, so core evidence
   carries the visual weight. */
.highlight-mark.hl-supporting {
  opacity: 0.55;
}

.highlight-mark.hl-related {
  opacity: 0.38;
}

/* Accepted: the fill drains away and only a dotted underline remains —
   visually distinct from supporting (faint fill, solid underline). */
.highlight-mark.hl-accepted {
  background: transparent;
  border-bottom-style: dotted;
  cursor: default;
  opacity: 1;
}

.highlight-mark.hl-active-cell {
  outline: 2px solid rgba(0, 96, 126, 0.45);
  outline-offset: 1px;
}

.highlight-mark.hl-multi.hl-accepted {
  cursor: pointer;
}

.curation-focus-guide {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  box-shadow: 0 8px 18px rgba(0, 59, 78, 0.08);
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 9px 10px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.curation-focus-guide strong {
  color: #003b4e;
  font-size: 13px;
}

.curation-focus-guide span {
  color: #56616d;
  font-size: 12px;
  line-height: 1.35;
}

.curation-focus-guide div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.curation-focus-guide button {
  background: #eef6f9;
  border: 1px solid #b9d5df;
  color: #00607e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
}

.curation-focus-guide button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.board-reader-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.board-reader-legend .legend-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.45;
  padding: 4px 10px;
}

.board-reader-legend .legend-chip.on {
  opacity: 1;
}

.board-reader-legend span {
  color: #667085;
  font-size: 11px;
}

.highlight-popover {
  background: #fff;
  border: 1px solid #9cc3d2;
  box-shadow: 0 14px 38px rgba(0, 59, 78, 0.22);
  display: grid;
  gap: 10px;
  max-width: 280px;
  padding: 12px;
  position: absolute;
  z-index: 46;
}

.hp-target {
  background: #f4fafc;
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 2px;
  padding: 8px 10px;
}

.hp-target span {
  color: #667085;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.highlight-popover strong,
.hp-target strong {
  color: #003b4e;
  font-size: 13px;
}

.highlight-popover p {
  color: #56616d;
  font-size: 11px;
  line-height: 1.35;
  margin: 0;
}

.hp-related {
  background: #f7f3e4;
  border: 1px solid #e6d999;
  display: grid;
  gap: 5px;
  padding: 8px 10px;
}

.hp-related strong {
  color: #6b5410;
  font-size: 11px;
}

.hp-related p {
  color: #6b5410;
  font-size: 10px;
}

.highlight-popover-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
}

/* --- Evidence stickies (condition 4) --------------------------------------- */

.board-sticky {
  background: #fff8c5;
  border: 1px solid #e5c84f;
  border-left-width: 4px;
  box-shadow: 0 6px 16px rgba(18, 28, 42, 0.12);
  cursor: grab;
  display: grid;
  gap: 3px;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  position: absolute;
  touch-action: none;
  user-select: none;
  z-index: 0;
}

.board-sticky.st-redline {
  border-left-color: var(--hl-redline);
}

.board-sticky.st-influence {
  border-left-color: var(--hl-influence);
}

.board-sticky.st-ioa {
  border-left-color: var(--hl-ioa);
}

.board-sticky.st-parties {
  border-left-color: var(--hl-parties);
}

.board-sticky.sticky-blank,
.board-sticky.sticky-quote {
  background: #fff8c5;
  border-left-color: #d0b43d;
}

.board-sticky.sticky-quote {
  background: #f8fbf7;
  border-color: #c8d4d9;
  border-left-color: #2f6f4e;
}

.board-sticky.supporting {
  border-left-style: dashed;
  opacity: 0.82;
}

.board-sticky.filtered {
  display: none;
}

.board-sticky.expanded {
  height: auto !important;
  max-width: 250px;
  min-height: 92px;
  width: auto !important;
  z-index: 0;
}

.sticky-tag {
  color: #7a6510;
  display: block;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.sticky-quote {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #2f3a42;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.32;
  margin: 0;
  overflow: hidden;
}

.board-sticky.expanded .sticky-quote {
  -webkit-line-clamp: unset;
  display: block;
}

.sticky-slot {
  color: #7a6510;
  font-size: 9px;
  font-weight: 700;
  margin: 0;
}

.sticky-source {
  color: #667085;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-note {
  border: 1px solid #e0cf86;
  font-size: 10px;
  padding: 3px 5px;
}

.sticky-textarea {
  background: transparent;
  border: 0;
  color: #2f3a42;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  min-height: 74px;
  outline: none;
  padding: 0;
  resize: none;
  width: 100%;
}

.sticky-remove {
  background: none;
  border: 0;
  color: #9a8420;
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  padding: 2px;
  position: absolute;
  right: 2px;
  top: 2px;
}

.board-sticky:hover .sticky-remove {
  opacity: 1;
}

.evidence-counts {
  color: #003b4e;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.evidence-guidance {
  color: #56616d;
  font-size: 12px;
  margin: 0;
}

/* During the tutorial, driver.js sets pointer-events:none on everything except
   the highlighted element. Floating interaction surfaces (highlight/citation
   popovers, the selection pill, stickies, labels, Copy to AI) live OUTSIDE the
   highlighted element's subtree, so interactive steps would dead-end without
   this whitelist. */
.driver-active .highlight-popover,
.driver-active .highlight-popover *,
.driver-active .board-file-text,
.driver-active .board-file-text *,
.driver-active .highlight-mark,
.driver-active .board-refine,
.driver-active .board-refine *,
.driver-active .board-selection-pill,
.driver-active .board-selection-pill *,
.driver-active .board-sticky,
.driver-active .board-sticky *,
.driver-active .citation-chip,
.driver-active .copy-ai {
  pointer-events: auto !important;
}

.driver-active .copy-ai {
  z-index: 1000000001;
}

/* --- Citations ------------------------------------------------------------ */

.citation-status {
  background: #eef6f9;
  border: 1px solid #b9d5df;
  border-radius: 6px;
  color: #305263;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
  padding: 8px 10px;
}

.citation-status.failed {
  background: #fff4ed;
  border-color: #e4b191;
  color: #7a3d1a;
}

.citation-chips {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
  vertical-align: super;
  line-height: 1;
}

.citation-chip {
  background: #eef6f9;
  border: 1px solid #b9d5df;
  border-radius: 999px;
  color: #00607e;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  line-height: 15px;
  padding: 0 6px;
}

.citation-chip:hover:not(:disabled) {
  background: #d9edf4;
}

.citation-chip:disabled {
  cursor: default;
  opacity: 0.8;
}

mark.citation-flash {
  animation: citation-flash-fade 2.5s ease-out forwards;
  border-radius: 2px;
}

mark.citation-flash.attack-clue-flash {
  animation: attack-clue-flash-fade 6s ease-out forwards;
  box-shadow: inset 0 -2px 0 #b7791f;
}

@keyframes citation-flash-fade {
  0% {
    background-color: #ffc933;
  }
  100% {
    background-color: #fff3bf;
  }
}

@keyframes attack-clue-flash-fade {
  0%, 70% {
    background-color: #ffd66b;
  }
  100% {
    background-color: #fff0bf;
  }
}

.highlight-popover-actions button,
.highlight-popover-row button {
  border: 0;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.highlight-popover-row button {
  padding: 5px 8px;
}

.highlight-popover .hp-accept {
  background: var(--accent);
  color: #fff;
}

.highlight-popover .hp-pin {
  background: #203149;
  color: #fff;
}

.highlight-popover .hp-reject {
  background: #eef2f5;
  color: #56616d;
}

.highlight-popover-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.highlight-popover-row.hp-related-row {
  opacity: 0.62;
}

.highlight-popover-row .hp-row-label {
  border-radius: 4px;
  flex: 1;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
}

.highlight-popover-row em {
  color: #56616d;
  font-size: 11px;
}

.evidence-note {
  color: #1d5c38;
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.evidence-scanning {
  color: #56616d;
  font-size: 12px;
  font-style: italic;
  margin: 0;
}

.evidence-pin-top {
  align-self: flex-start;
  background: #203149;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
}

.evidence-choice-list {
  border-top: 1px solid #d7e2e7;
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.evidence-choice-row {
  align-items: center;
  background: #f8fbf7;
  border: 1px solid #d7e2e7;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px 8px;
}

.evidence-choice-title,
.evidence-choice-quote {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-choice-title {
  color: #003b4e;
  font-size: 11px;
}

.evidence-choice-quote {
  color: #4a5563;
  font-size: 12px;
}

.evidence-choice-row button {
  background: #fff;
  border: 1px solid #9ab3bd;
  color: #003b4e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
}

.evidence-choice-state,
.evidence-choice-more {
  color: #1d5c38;
  font-size: 11px;
  font-weight: 900;
}

.evidence-choice-more {
  margin: 0;
}

.party-iceberg {
  display: grid;
  gap: 3px;
  margin: 6px 0;
}

.party-iceberg p {
  color: #475467;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
}

.party-iceberg strong {
  color: #003b4e;
}

.diff-hidden-note {
  color: #667085;
  font-size: 11px;
  font-style: italic;
  margin: 8px 0 0;
}

.evidence-howto {
  color: #344054;
  display: grid;
  font-size: 12px;
  gap: 6px;
  line-height: 1.45;
  margin: 0;
  padding-left: 18px;
}

.evidence-howto-figure {
  border: 1px solid #dde5ea;
  border-radius: 6px;
  width: 100%;
}

.evidence-scan-failed {
  color: #7a2418;
  font-size: 12px;
  margin: 0;
}

.evidence-scan-failed button {
  background: #203149;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
}

.evidence-tray {
  display: grid;
  gap: 10px;
  padding: 4px 2px;
}

.evidence-intro {
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

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

.evidence-cell {
  background: #f8fbfc;
  border: 1px solid #dbe7ec;
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 9px 10px;
}

.evidence-cell:hover,
.evidence-cell:focus-visible,
.evidence-cell.active {
  border-color: #00607e;
  box-shadow: 0 0 0 2px rgba(0, 96, 126, 0.14);
  outline: 0;
}

.evidence-cell.filled {
  background: #f4fbf6;
  border-color: #a8d5b8;
}

.evidence-cell.filled.active {
  border-color: #00607e;
}

.evidence-cell strong {
  color: #003b4e;
  font-size: 12px;
}

.evidence-cell span {
  color: #667085;
  font-size: 11px;
  line-height: 1.25;
}

.evidence-cell em {
  align-self: end;
  color: #2f6f4e;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.evidence-cell-quotes {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.evidence-cell-quotes p {
  color: #344054;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.evidence-cell-quotes small {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.evidence-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.evidence-list li {
  background: #f7fafb;
  border: 1px solid #dbe7ec;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr auto;
  padding: 8px 10px;
}

.evidence-list li strong {
  color: #003b4e;
  font-size: 11px;
  grid-column: 1;
}

.evidence-list li span {
  color: #475467;
  font-size: 12px;
  font-style: italic;
  grid-column: 1;
  line-height: 1.35;
}

.evidence-list .evidence-remove {
  align-self: start;
  background: transparent;
  border: 0;
  color: #98a2b3;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.evidence-generate {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  padding: 12px 14px;
}

.evidence-generate:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.evidence-hint {
  color: #667085;
  font-size: 11px;
  margin: 0;
}

.evidence-back {
  background: #eef2f5;
  border: 0;
  color: #344054;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  justify-self: start;
  padding: 7px 10px;
}

.cell-evidence-control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.cell-evidence-toggle,
.cell-focus-toggle {
  align-self: start;
  background: #eef6f9;
  border: 1px solid #b9d5df;
  color: #00607e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  justify-self: start;
  padding: 5px 8px;
}

.cell-focus-toggle.active {
  background: #00607e;
  color: #fff;
}

.cell-evidence-drawer {
  background: #fbfdfe;
  border: 1px solid #dbe7ec;
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 9px;
}

.cell-evidence-drawer > strong {
  color: #003b4e;
  font-size: 12px;
}

.cell-evidence-row {
  border-top: 1px solid #e6eef2;
  display: grid;
  gap: 7px;
  padding-top: 8px;
}

.cell-evidence-row blockquote {
  color: #344054;
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
  margin: 0;
}

.cell-evidence-actions,
.evidence-move {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cell-evidence-actions button,
.evidence-move select {
  border: 1px solid #c8d4d9;
  color: #344054;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 7px;
}

.cell-evidence-actions button {
  background: #eef2f5;
  cursor: pointer;
}

.board-evidence-toggle.active {
  background: #203149;
}

/* Curation nudge: same floating language as the preparation guide, in the
   warning palette. Inherits .task-guide positioning. */
.curation-nudge-popup {
  background: #fdf3d7;
  border-color: #e8d49a;
}

.curation-nudge-popup .task-guide-head strong {
  color: #6e5410;
}

.curation-nudge-popup .task-guide-head button {
  background: #6e5410;
}

.curation-nudge-popup p {
  color: #6e5410;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  max-width: 320px;
}

.board-chat-float .board-chat-form textarea {
  overflow-y: auto;
  resize: vertical;
}

.board-fields {
  display: grid;
  gap: 11px;
}

.board-fields section {
  border-left: 3px solid #d6e8ee;
  padding-left: 10px;
}

.board-fields h4 {
  color: #003b4e;
  font-size: 12px;
  margin: 0 0 5px;
  text-transform: capitalize;
}

.board-fields p,
.board-list {
  margin: 0;
}

.board-list {
  display: grid;
  gap: 5px;
  padding-left: 18px;
}

.board-empty {
  color: var(--muted);
  margin: 0;
}

.board-visual {
  display: grid;
  gap: 12px;
}

.visual-summary {
  border-left: 4px solid var(--accent);
  color: #344054;
  line-height: 1.45;
  margin: 0;
  padding: 10px;
}

.party-cards {
  display: grid;
  gap: 14px;
}

.party-group {
  display: grid;
  gap: 10px;
}

.party-group h3 {
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.party-group-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: -2px 0 0;
}

.party-card {
  border-left: 4px solid #98a2b3;
  display: grid;
  gap: 5px;
  padding: 1px 0 1px 10px;
}

.party-card.primary {
  border-left-color: var(--accent);
}

.party-card h4,
.route-list h4,
.ioa-cell h4,
.redline-panel h4 {
  color: #003b4e;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.party-card p,
.route-list p {
  margin: 0;
}

.party-card span,
.route-list span {
  color: var(--muted);
  font-size: 12px;
}

.influence-map {
  aspect-ratio: 1.25;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 154, 206, 0.08), transparent 34%),
    linear-gradient(90deg, transparent calc(50% - 1px), #bdd4dc calc(50% - 1px), #bdd4dc calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), #bdd4dc calc(50% - 1px), #bdd4dc calc(50% + 1px), transparent calc(50% + 1px)),
    #f8fbfc;
  border: 1px solid #bfdbe4;
  min-height: 220px;
  position: relative;
}

.influence-routes {
  height: 100%;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.route-line {
  fill: none;
  opacity: 0.72;
  stroke: #2f7f69;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.route-line.route-1 {
  stroke: #007aa3;
}

.route-line.route-2 {
  stroke: #a9642f;
}

.route-line.route-3 {
  stroke: #6f7890;
}

.axis-label {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  position: absolute;
  text-transform: uppercase;
}

.axis-label.top {
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
}

.axis-label.bottom {
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
}

.axis-label.left {
  left: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
}

.axis-label.right {
  right: 8px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  transform-origin: center;
}

.influence-point {
  background: #fff;
  border: 2px solid #789a88;
  box-shadow: 0 6px 18px rgba(18, 28, 42, 0.12);
  color: #203149;
  font-size: 11px;
  font-weight: 800;
  max-width: 118px;
  padding: 5px 7px;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.influence-point.target {
  background: #003b4e;
  border-color: #003b4e;
  color: #fff;
}

.route-list {
  display: grid;
  gap: 12px;
}

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

.influence-actors section {
  border-left: 4px solid #789a88;
  display: grid;
  gap: 5px;
  padding: 9px;
}

.influence-actors h4 {
  color: #003b4e;
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
}

.influence-actors p {
  margin: 0;
}

.influence-actors strong {
  color: #003b4e;
}

.influence-actors span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.route-list section {
  border-left: 3px solid #789a88;
  padding-left: 9px;
}

.route-list strong {
  color: #003b4e;
  display: block;
  font-size: 12px;
}

.route-list .route-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.route-list .route-detail strong {
  display: inline;
}

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

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

.iceberg-side {
  border-top: 4px solid var(--accent);
  display: grid;
  gap: 6px;
  padding-top: 9px;
}

.iceberg-side:nth-child(2) {
  border-top-color: #a9642f;
}

.iceberg-side h4 {
  color: #003b4e;
  font-size: 14px;
  margin: 0 0 2px;
}

.iceberg-side > strong,
.iceberg-layer > strong,
.ioa-subhead {
  color: #667085;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.iceberg-side p {
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0 0 5px;
}

.iceberg-layer {
  display: grid;
  gap: 3px;
  padding: 4px;
}

.iceberg-actors {
  border-top: 1px dashed #d6e8ee;
  padding-top: 8px;
}

.iceberg-actors summary {
  color: #52646c;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 800;
}

.iceberg-actors ul {
  color: #52646c;
  font-size: 12px;
  line-height: 1.4;
  margin: 8px 0 0;
  padding-left: 18px;
}

.ioa-cell,
.redline-panel {
  border-left: 4px solid #d6e8ee;
  display: grid;
  gap: 7px;
  padding: 1px 0 1px 10px;
}

.ioa-cell .board-list {
  margin: 0 0 5px;
}

.ioa-cell.agree {
  border-left-color: #2f7f69;
}

.ioa-cell.disagree,
.redline-panel.risk {
  border-left-color: #a9642f;
}

.redline-visual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.redline-visual .visual-summary {
  grid-column: 1 / -1;
}

.redline-panel.goal {
  border-left-color: #2f7f69;
}

.redline-panel.trade {
  border-left-color: var(--accent);
}

@media (max-width: 980px) {
  .ioa-grid,
  .iceberg-grid,
  .influence-actors,
  .redline-visual {
    grid-template-columns: 1fr;
  }

  .redline-visual .visual-summary {
    grid-column: auto;
  }
}

.board-refine,
.board-chat-form {
  border-top: 1px solid #d6e8ee;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.board-refine textarea,
.board-chat-form textarea {
  border: 1px solid #a9b6c4;
  color: var(--ink);
  font-size: 13px;
  min-height: 58px;
  padding: 9px;
  resize: none;
}

.board-chat-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
}

.board-chat-log .message {
  font-size: 13px;
  max-width: min(92%, 430px);
  min-height: 0;
}

body.board-dragging {
  cursor: grabbing;
  user-select: none;
}

body.board-resizing {
  cursor: nwse-resize;
  user-select: none;
}

body.board-chat-resizing {
  cursor: nesw-resize;
  user-select: none;
}

body.board-panning {
  cursor: grabbing;
  user-select: none;
}

.pretest {
  background:
    linear-gradient(180deg, #f7fbfd 0%, #ffffff 52%, #eef7fa 100%);
  color: var(--ink);
  display: grid;
  min-height: calc(100vh - 76px);
  padding: 22px 28px 56px;
  place-items: start center;
}

.pretest-card {
  background: #fff;
  border: 1px solid #d6e8ee;
  box-shadow: 0 12px 35px rgba(0, 59, 78, 0.09);
  display: grid;
  gap: 14px;
  max-width: 980px;
  padding: 28px 32px;
  width: min(980px, 100%);
}

.study-intro-card {
  background: #fff;
  border: 1px solid #d6e8ee;
  box-shadow: 0 12px 35px rgba(0, 59, 78, 0.09);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  max-width: 1080px;
  overflow: hidden;
  width: min(1080px, 100%);
}

.study-intro-card img {
  height: 100%;
  min-height: 380px;
  object-fit: cover;
  width: 100%;
}

.study-intro-card div {
  align-content: center;
  display: grid;
  gap: 18px;
  padding: 38px;
}

.study-intro-card p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.study-intro-card h2 {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1.04;
  margin: 0;
}

.study-intro-card span {
  color: #344054;
  font-size: 18px;
  line-height: 1.5;
}

.study-intro-card button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  justify-self: start;
  padding: 12px 17px;
}

.pretest-card p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  margin: 0;
}

.consent-card {
  gap: 14px 28px;
  max-width: 1280px;
  width: min(1280px, calc(100vw - 72px));
}

.consent-card section {
  display: grid;
  gap: 7px;
}

.consent-card h3 {
  color: #003b4e;
  font-size: 14px;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.consent-card p,
.consent-card li {
  color: #344054;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.42;
  margin: 0;
  text-transform: none;
}

.consent-card ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 22px;
}

.pretest-card h2 {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1.08;
  margin: 0;
}

.pretest-card > span,
.scale-help {
  color: #667085;
  font-size: 15px;
  line-height: 1.45;
}

.pretest-card button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  justify-self: start;
  padding: 12px 17px;
}

.pretest-card button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.consent-check {
  align-items: start;
  color: #344054;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  line-height: 1.4;
}

@media (min-width: 1000px) {
  .consent-card {
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .consent-card > p,
  .consent-card > h2,
  .consent-card > .consent-check,
  .consent-card > button {
    grid-column: 1 / -1;
  }
}

.demographics-form label,
.common-demographics,
.nfc-scale {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.demographics-form label span,
.common-demographics legend,
.nfc-scale legend {
  color: #003b4e;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.demographics-form .required-label::after {
  color: #c4533d;
  content: " *";
  font-weight: 900;
}

.common-demographics {
  gap: 14px;
}

.demographics-form input,
.demographics-form select {
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid #98a2b3;
  border-radius: 2px;
  color: var(--ink);
  font-size: 16px;
  height: 44px;
  line-height: 1.25;
  min-height: 44px;
  padding: 11px 12px;
  width: 100%;
}

.demographics-form select {
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 12px) 19px;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  padding-right: 34px;
}

.demographics-form input:focus,
.demographics-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.16);
  outline: none;
}

.nfc-scale {
  gap: 12px;
}

.likert-row {
  background: #f7fbfd;
  border: 1px solid #d6e8ee;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
}

.likert-row > span {
  color: #003b4e;
  font-weight: 700;
}

.likert-scale {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.likert-scale em {
  color: #344054;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  white-space: nowrap;
}

.likert-options {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.likert-options label {
  align-items: center;
  background: transparent;
  color: #003b4e;
  cursor: pointer;
  display: flex;
  height: 24px;
  justify-content: center;
  position: relative;
  width: 24px;
  padding: 0;
}

.likert-options input {
  appearance: none;
  -webkit-appearance: none;
  height: 1px;
  inline-size: 20px;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.likert-options label span {
  border: 2px solid #98a2b3;
  border-radius: 50%;
  display: block;
  flex: 0 0 20px;
  height: 20px;
  overflow: hidden;
  text-indent: -999px;
  width: 20px;
}

.likert-options input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px #fff;
}

.likert-options input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.18);
}

.binary-options {
  justify-content: flex-start;
}

.binary-options label {
  height: auto;
  min-width: 84px;
  width: auto;
}

.binary-options label span {
  align-items: center;
  border-radius: 4px;
  display: flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
  height: auto;
  justify-content: center;
  min-height: 42px;
  min-width: 84px;
  overflow: visible;
  padding: 8px 18px;
  text-indent: 0;
  text-transform: none;
  width: auto;
}

.binary-options input:checked + span {
  color: #fff;
  box-shadow: none;
}

@media (max-width: 760px) {
  .study-intro-card {
    grid-template-columns: 1fr;
  }

  .study-intro-card img {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .study-intro-card div {
    padding: 26px;
  }

  .study-intro-card h2 {
    font-size: 34px;
  }
}

.survey {
  background:
    linear-gradient(180deg, #f7fbfd 0%, #ffffff 52%, #eef7fa 100%);
  color: var(--ink);
  display: grid;
  min-height: calc(100vh - 76px);
  padding: 28px 22px 60px;
  place-items: start center;
}

.survey-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
  justify-content: center;
  width: min(1320px, 100%);
}

.survey-layout.reference-hidden {
  grid-template-columns: minmax(0, 1fr);
  width: min(900px, 100%);
}

.survey-layout.reference-hidden .survey-form {
  justify-self: center;
  max-width: 860px;
}

.survey-form {
  background: #fff;
  border: 1px solid #d6e8ee;
  box-shadow: 0 12px 35px rgba(0, 59, 78, 0.09);
  display: grid;
  gap: 16px;
  justify-self: end;
  max-width: 720px;
  padding: 28px 32px 32px;
  width: 100%;
}

.survey-heading {
  display: grid;
  gap: 6px;
}

.survey-reference {
  display: grid;
  gap: 14px;
  /* The board snapshot (last row) must never be starved by tall notes/chat:
     a min floor keeps it from collapsing to 0, and the aside scrolls instead
     of clipping when all three sections together exceed the viewport. */
  grid-template-rows: auto auto minmax(220px, 1fr);
  max-height: calc(100vh - var(--topbar-height) - 36px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
}

.survey-reference > section {
  background: #fff;
  border: 1px solid #d6e8ee;
  box-shadow: 0 12px 35px rgba(0, 59, 78, 0.08);
  display: grid;
  gap: 10px;
  min-height: 0;
  padding: 16px;
}

.survey-reference > section > p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.reference-text,
.reference-chat {
  color: #344054;
  font-size: 13px;
  line-height: 1.45;
  max-height: 20vh;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reference-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(360px, 34vh);
  overflow-y: auto;
  white-space: normal;
}

.reference-board {
  display: grid;
  gap: 12px;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.reference-board-card {
  border: 1px solid #d6e8ee;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.reference-board-card.fullscreen {
  background: #fff;
  inset: calc(var(--topbar-height) + 18px) 28px 28px;
  max-height: none;
  overflow: auto;
  position: fixed;
  z-index: 50;
}

.reference-board-card.fullscreen .reference-board-body {
  max-height: none;
}

.reference-board-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.reference-board-head > div {
  min-width: 0;
}

.reference-board-head button {
  background: #f4fbfd;
  border: 1px solid #b9d5df;
  color: #003b4e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  padding: 6px 8px;
}

.reference-board-card h3 {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  margin: 0;
}

.reference-board-body {
  color: #344054;
  font-size: 12px;
  line-height: 1.42;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
}

.reference-board-body .message {
  box-shadow: none;
  font-size: 12px;
  max-width: 100%;
  text-transform: none;
}

.reference-chat .message {
  box-shadow: none;
  flex: 0 0 auto;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.45;
  max-width: 92%;
  min-height: 0;
  text-transform: none;
}

.reference-chat .message *,
.reference-board-body .message * {
  letter-spacing: 0;
  text-transform: none;
}

.reference-chat .message.assistant,
.reference-board-body .message.assistant {
  color: #2b2f36;
  font-weight: 400;
}

.reference-empty {
  color: var(--muted);
  font-size: 13px;
}

.survey-heading p {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.survey-heading h2 {
  color: #003b4e;
  font-family: inherit;
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.survey-heading span,
.survey-heading small {
  color: #667085;
  font-size: 15px;
  line-height: 1.4;
}

.survey-heading small {
  color: #344054;
  display: block;
  font-size: 13px;
}

.survey-form label,
.survey-form fieldset {
  border: 0;
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
}

.survey-form label span,
.survey-form legend {
  color: #003b4e;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.35;
}

.survey-form label span b,
.survey-form legend b {
  color: #007aa3;
  display: inline-flex;
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-right: 9px;
  text-transform: uppercase;
  vertical-align: 1px;
}

.prep-ratings-form {
  display: grid;
  gap: 18px;
}

.prep-ratings-form .quick-ratings {
  border: 0;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.prep-ratings-form .quick-ratings legend {
  color: #003b4e;
  font-size: 15px;
  font-weight: 900;
}

.survey-form .quick-ratings {
  background: #f8fbfc;
  border: 1px solid #d7e2e7;
  gap: 12px;
  padding: 12px;
}

.survey-form .written-survey {
  gap: 20px;
}

.writing-answer-format {
  background: #eef8f4;
  border-left: 4px solid #2f7f69;
  color: #164f43;
  display: block;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
  text-align: left;
}

.written-answer-hint {
  color: #52666f;
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: -3px;
}

.writing-portion-info {
  background: #f8fbfc;
  border: 1px solid #d6e8ee;
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.writing-portion-info p,
.writing-portion-info h3,
.writing-portion-info span {
  margin: 0;
}

.writing-portion-info p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.writing-portion-info h3 {
  color: #003b4e;
  font-family: inherit;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
}

.writing-portion-info span {
  color: #475467;
  font-size: 13px;
  line-height: 1.4;
}

.survey-form .post-survey {
  background: #f8fbfc;
  border: 1px solid #d7e2e7;
  gap: 12px;
  margin-top: 6px;
  padding: 14px;
}

.survey-form .post-survey legend {
  block-size: 1px;
  clip-path: inset(50%);
  font-size: 16px;
  inline-size: 1px;
  margin-bottom: 4px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.survey-form .post-survey .likert-row > span {
  font-size: 14px;
}

.survey-form .quick-ratings legend {
  font-size: 13px;
}

.survey-form .quick-ratings .likert-row {
  display: grid;
  gap: 7px;
}

.survey-form .quick-ratings .likert-row > span {
  font-size: 14px;
}

.survey-form .quick-ratings .likert-options input {
  inline-size: 20px;
  padding: 0;
  width: 1px;
}

.survey-form textarea,
.survey-form input:not([type="radio"]) {
  background: #fff;
  border: 1px solid #98a2b3;
  border-radius: 2px;
  color: var(--ink);
  line-height: 1.45;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.survey-form textarea:focus,
.survey-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.14);
  outline: none;
}

.survey-form textarea {
  min-height: 140px;
  resize: vertical;
}

.survey-form button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  justify-self: start;
  padding: 11px 16px;
}

.survey-status {
  color: #9de8ff;
  font-size: 14px;
}

.stage-break {
  align-items: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 251, 253, 0.96)),
    #fff;
  display: grid;
  min-height: calc(100vh - var(--topbar-height));
  padding: 64px 28px;
}

.stage-break-card {
  border: 1px solid #d6e8ee;
  justify-self: center;
  max-width: 760px;
  padding: 34px 42px;
  width: min(760px, 100%);
}

.task-intro-card {
  max-width: 860px;
  width: min(860px, 100%);
}

.task-intro-goals {
  background: #f4fbfd;
  border: 1px solid #cfe6ef;
  color: #2a3744;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
  padding: 14px 18px;
  text-align: left;
}

.task-intro-goals strong {
  color: #003b4e;
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  margin-bottom: 6px;
}

.stage-break-card .task-intro-goals .task-intro-role {
  font-size: 15px;
}

.stage-break-card .task-intro-goals .task-intro-role strong {
  color: #003b4e;
  display: inline;
  font-family: inherit;
  font-size: inherit;
}

.stage-break-card .task-intro-goals p {
  color: #2a3744;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  margin: 0 0 8px;
  text-transform: none;
}

.task-intro-goals ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
}

.task-intro-points {
  color: #2a3744;
  display: grid;
  font-size: 15px;
  gap: 10px;
  line-height: 1.5;
  margin: 0 0 18px;
  padding-left: 22px;
}

.task-intro-figure {
  border: 1px solid #d6e8ee;
  margin: 0 0 18px;
  position: relative;
}

.task-intro-figure img {
  display: block;
  width: 100%;
}

.stage-break-card p {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.stage-break-card h2 {
  color: #003b4e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1;
  margin: 0 0 16px;
}

.stage-break-card > span {
  color: #465467;
  display: block;
  font-size: 20px;
  line-height: 1.45;
  max-width: 620px;
}

.stage-break-card button {
  background: var(--accent);
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  margin-top: 24px;
  padding: 12px 18px;
}

.policy-overlay {
  align-items: center;
  background: rgba(0, 24, 32, 0.92);
  color: #fff;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 28px;
  position: fixed;
  text-align: center;
  z-index: 1000000001;
}

.policy-overlay[hidden] {
  display: none;
}

.policy-overlay > div {
  border: 2px solid rgba(157, 232, 255, 0.78);
  max-width: 560px;
  padding: 34px 38px;
}

.policy-overlay strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  margin-bottom: 16px;
}

.policy-overlay span {
  color: #d8f5ff;
  display: block;
  font-size: 20px;
  line-height: 1.4;
}

.admin-screenshot-toast {
  background: #003b4e;
  border: 2px solid rgba(157, 232, 255, 0.82);
  bottom: 18px;
  box-shadow: 0 14px 30px rgba(0, 24, 32, 0.28);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  position: fixed;
  right: 18px;
  text-transform: uppercase;
  z-index: 1000000002;
}

.admin-screenshot-toast[hidden] {
  display: none;
}

.policy-exit-card h2 {
  max-width: 620px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.chat-floating {
    padding-right: var(--chat-width);
  }

  .file-rail {
    max-height: 250px;
    overflow: auto;
  }

  .chat-panel {
    bottom: 0;
    min-height: 0;
    right: 0;
    top: var(--topbar-height);
    width: var(--chat-width);
  }

  .copy-ai {
    right: 16px;
    top: calc(var(--topbar-height) + 12px);
  }

  .document-text {
    font-size: 11pt;
    padding: 28px 22px 60px;
  }

  .survey-form {
    justify-self: stretch;
    max-width: none;
    padding: 22px;
  }

  .survey-layout {
    grid-template-columns: 1fr;
  }

  .survey-reference {
    order: -1;
    position: static;
  }

  .pretest-card {
    padding: 24px;
  }

  .likert-options {
    grid-template-columns: repeat(5, 24px);
  }

  .likert-options {
    justify-content: start;
  }

  .survey-heading h2 {
    font-size: 28px;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .condition-tabs {
    justify-content: flex-start;
  }
}

/* Survey v2 items (TLX sliders, WTA, disappointment) */
.tlx-scale {
  display: grid;
  grid-template-columns: minmax(72px, 110px) 1fr minmax(120px, 180px) 44px;
  align-items: center;
  gap: 12px;
}
.tlx-scale em {
  font-size: 12px;
  color: #5b6770;
  font-style: normal;
  line-height: 1.3;
}
.tlx-scale em:nth-of-type(2) { text-align: left; }
.tlx-scale input[type="range"] { width: 100%; }
.tlx-value { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.wta-options label,
.disappointment-options label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}
.wta-options,
.disappointment-options { display: block; }
.wta-note { display: block; font-size: 12px; color: #5b6770; font-style: italic; margin-top: 4px; }

/* WTA / disappointment options render as normal labeled radios, not likert circles */
.wta-options label span,
.disappointment-options label span {
  border: none;
  border-radius: 0;
  width: auto;
  height: auto;
  flex: 0 1 auto;
  overflow: visible;
  text-indent: 0;
  display: inline;
  font-size: 14px;
  color: #003b4e;
}
.wta-options label,
.disappointment-options label {
  height: auto;
  justify-content: flex-start;
}
