/* Dock: floating full-height panel over the canvas. */

.dock {
  position: absolute;
  top: var(--dock-gap);
  right: var(--dock-gap);
  bottom: var(--dock-gap);
  width: var(--dock-w);
  max-width: calc(100% - 2 * var(--dock-gap));
  background: var(--c-surface);
  border: var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--z-dock);
  transform: translateX(16px);
  opacity: 0;
  pointer-events: none;
  /* Premium glide: opacity + slide + width all settle together via the
   * ease-out-quint curve so the dock glides into place instead of snapping
   * its width and popping. will-change keeps the motion crisp. */
  transition: opacity var(--t-reveal), transform var(--t-reveal), width var(--t-reveal);
  will-change: opacity, transform, width;
}
.app-stage.has-assistant-open.has-dock-open .dock {
  width: var(--assistant-w);
}
.app-stage.has-assistant-open.has-dock-open .dock.is-expanded {
  left: calc(var(--assistant-gap) + var(--assistant-w) + var(--dock-gap));
  width: auto;
}
.app-stage.has-dock-open:not(.has-assistant-open) .dock {
  width: var(--assistant-w);
}
.app-stage.has-dock-open:not(.has-assistant-open) .dock.is-expanded {
  left: calc(var(--assistant-fab-inset) + var(--assistant-fab-size) + var(--dock-gap));
  width: auto;
}
.dock.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.dock__header {
  display: flex;
  height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border);
}
.dock__title {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: var(--fw-semibold);
  min-width: 0;
}
.dock__title-input {
  min-width: 0;
  width: 100%;
  border: var(--bw) solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--c-ink);
  font: inherit;
  font-weight: var(--fw-semibold);
  padding: 1px var(--sp-1);
}
.dock__title-input:hover {
  border-color: var(--c-line);
  background: var(--c-surface-2);
}
.dock__title-input:focus {
  outline: none;
  border-color: var(--c-line-strong);
  background: var(--c-surface);
}
.dock__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: var(--sp-5);
}

.dock-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) 0;
  border-bottom: var(--border);
}
.dock-row__label {
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  font-weight: var(--fw-medium);
}
.dock-row__value {
  font-size: var(--fs-normal);
}

/* ---------------------------------------------------------------- Intake editor (Phase 5) */

.intake-host {
  height: 100%;
}
.table-node-host {
  height: 100%;
}
.intake-editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  height: 100%;
}

.intake-tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: var(--border);
}
.intake-tab {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-normal);
  color: var(--c-ink-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.intake-tab:hover {
  color: var(--c-ink);
}
.intake-tab.is-active {
  color: var(--c-ink);
  border-bottom-color: var(--c-accent);
  font-weight: var(--fw-medium);
}
.intake-tab:disabled,
.intake-tab.is-disabled {
  color: var(--c-ink-3, var(--c-text-3, #999));
  cursor: not-allowed;
  opacity: 0.6;
}
.intake-tab:disabled:hover,
.intake-tab.is-disabled:hover {
  color: var(--c-ink-3, var(--c-text-3, #999));
}

.intake-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.field-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  font-weight: var(--fw-medium);
  margin: var(--sp-3) 0 var(--sp-1);
}
.intake-textarea {
  height: auto;
  min-height: 150px;
  padding: var(--sp-2) var(--sp-3);
  width: 100%;
  border-radius: var(--r-lg);
  resize: vertical;
}
.fields-pane .input, .web-config .input, .publish-pane .input, .schedule-editor .input {
  width: 100%;
}

.fields-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  margin-top: var(--sp-3);
}
.field-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  background-color: var(--c-line);
  padding: 0.5rem;
  border-radius: var(--r-xl);
}
.field-row__main {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.field-row__label {
  flex: 1 1 auto;
}
.field-row__type {
  flex: 0 0 130px;
}
.field-row__help {
  width: 100%;
  font-size: var(--fs-xs);
}
.field-row__req {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}

/* ---- Options editor (select / multi_select / radio / checkbox_group) ---- */
.field-row__options {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md, 8px);
  padding: var(--sp-2);
  background: var(--c-surface-2, #fafafc);
  margin-top: var(--sp-1);
}
.field-row__options-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  cursor: pointer;
  text-align: left;
}
.field-row__options-head:hover {
  color: var(--c-ink-1);
}
.field-row__options-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-top: var(--sp-1);
}
.field-options__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.field-option {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}
.field-option__label {
  flex: 1 1 auto;
  min-width: 0;
}
.field-option__value {
  flex: 1 1 auto;
  min-width: 0;
}
.field-option__default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  cursor: pointer;
}
.field-options__empty {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}
.field-options__add {
  align-self: flex-start;
}
.fields-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
  flex-wrap: wrap;
}
.intake-foot {
  margin-top: var(--sp-2);
}

/* ---- Setup chooser (new form nodes) ---- */
.setup-chooser {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
}
.setup-chooser__lead {
  font-size: var(--fs-normal);
  color: var(--c-ink-2);
}
.setup-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.setup-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md, 10px);
  background: var(--c-surface, #fff);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.setup-card:hover,
.setup-card.is-active {
  border-color: var(--c-accent, #4f46e5);
  background: var(--c-surface-2, #f7f7fb);
}
.setup-card__title {
  font-weight: 600;
  font-size: var(--fs-normal);
}
.setup-card__desc {
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}
.setup-import {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  position: relative;
  overflow: hidden;
  padding: var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-lg, 16px);
}
.setup-import::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.78) 38%,
    rgba(10, 10, 10, 0.06) 50%,
    rgba(255, 255, 255, 0.78) 62%,
    transparent 100%
  );
  background-size: 220% 100%;
}
.setup-import.is-analyzing {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
}
.setup-import.is-analyzing::after {
  opacity: 1;
  animation: setup-import-sweep 1.25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.setup-import > * {
  position: relative;
  z-index: 2;
}
.setup-import .input[type="file"] {
  width: 100%;
  height: auto;
  padding: var(--sp-1) var(--sp-2);
  color: var(--c-ink-2);
}
.setup-import .input[type="file"]::file-selector-button {
  margin-right: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-surface-2, #f7f7fb);
  color: var(--c-ink);
  font: inherit;
  font-weight: var(--fw-medium);
  cursor: pointer;
}
.setup-import .input[type="file"]::file-selector-button:hover {
  border-color: var(--c-accent, #4f46e5);
  background: var(--c-surface, #fff);
}
.setup-import .input[type="file"]:disabled::file-selector-button {
  cursor: not-allowed;
  opacity: 0.65;
}
@keyframes setup-import-sweep {
  0% {
    background-position: 145% 0;
    opacity: 0;
  }
  16% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    background-position: -125% 0;
    opacity: 0;
  }
}

/* ---- Sections builder ---- */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.section-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: 25px;
  background: var(--c-surface-2, #f7f7fb);
}
.section-card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.section-card__title {
  flex: 1 1 auto;
  font-weight: 600;
}
.section-card__desc {
  font-size: var(--fs-xs);
}
.section-card__add {
  align-self: flex-start;
}

.records-pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-x: auto;
}
.records-count {
  font-size: var(--fs-xs);
}
.records-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}
.records-toolbar .input {
  height: 32px;
}
.records-toolbar__search {
  flex: 1 1 220px;
  min-width: 180px;
}
.records-toolbar__limit {
  flex: 0 0 96px;
  width: 96px;
}
.records-toolbar__field {
  flex: 0 1 180px;
  min-width: 140px;
}
.records-toolbar__filter {
  flex: 1 1 180px;
  min-width: 160px;
}
.records-view-settings {
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  background: var(--c-surface);
}
.records-view-settings-summary {
  cursor: pointer;
  color: var(--c-ink-2);
  font-size: var(--fs-normal);
  font-weight: var(--fw-medium);
}
.records-view-settings-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(180px, 0.8fr);
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.records-view-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.records-view-section h4 {
  margin: 0;
  color: var(--c-ink);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.records-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: var(--fs-normal);
}
.records-table th, .records-table td {
  text-align: left;
  padding: var(--sp-2);
  border-inline: var(--border);
  border-bottom: var(--border-thick);
  vertical-align: top;
}
.records-table th {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  font-weight: var(--fw-medium);
  border-top: var(--border-thick);
}
.records-table__actions {
  width: 72px;
  white-space: nowrap;
}
.record-cell-view {
  display: block;
  width: 100%;
  min-width: 120px;
  max-width: 280px;
  padding: 2px 4px;
  border: 0;
  border-radius: var(--r-xs);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}
.record-cell-view:hover {
  background: var(--c-surface-2);
}
.record-cell-input {
  width: 180px;
  padding: 4px 6px;
  border: var(--border);
  border-radius: var(--r-xs);
  background: var(--c-surface);
  color: var(--c-ink);
  font: inherit;
}
.record-cell-textarea {
  min-height: 72px;
  resize: vertical;
  white-space: pre-wrap;
}
.record-cell-multiselect {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  max-width: 260px;
}
.record-cell-choice, .record-cell-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
}

.publish-pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.publish-status {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.publish-url {
  display: flex;
  gap: var(--sp-2);
}
.publish-io {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.field-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-normal);
}

.intake-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  border: var(--border);
  border-radius: var(--r-sm);
  color: var(--c-ink-2);
  background: var(--c-surface-2);
}
.intake-badge.is-live {
  color: var(--c-ink-inv);
  background: var(--c-splash-green);
  border-color: transparent;
}

/* ---- Form pane (merged builder + publishing + I/O) ---- */
.form-pane,
.web-config,
.analyzer-editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 800px;
  width: 100%;
  margin-inline: auto;
}
.form-pane .input,
.web-config .input,
.analyzer-editor .input {
  width: 100%;
}
.form-pane__section,
.web-config .form-pane__section,
.analyzer-editor__section {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg, 16px);
  background: var(--c-surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  overflow: hidden;
}
.form-pane__section-head,
.web-config .form-pane__section-head,
.analyzer-editor__section-head {
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-surface-2), var(--c-surface));
}
.form-pane__section-title,
.web-config .form-pane__section-title,
.analyzer-editor__section-title {
  margin: 0;
  font-size: var(--fs-normal);
  font-weight: 700;
  color: var(--c-ink);
}
.form-pane__section-desc,
.web-config .form-pane__section-desc,
.analyzer-editor__section-desc {
  margin: var(--sp-1) 0 0;
  max-width: 58ch;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--c-ink-2);
}
.form-pane__section-body,
.web-config .form-pane__section-body,
.analyzer-editor__section-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
}
.form-pane__section-body > .field-label:first-child,
.web-config .form-pane__section-body > .field-label:first-child,
.analyzer-editor__section-body > .field-label:first-child {
  margin-top: 0;
}
.form-pane__section-body > .collapsible,
.form-pane__section-body > .layout-toggle,
.form-pane__section-body > .sections-list,
.web-config .form-pane__section-body > .schedule-editor,
.analyzer-editor__section-body > .schedule-editor,
.analyzer-editor__section-body > .analyzer-cutoff,
.analyzer-editor__section-body > .analyzer-actions,
.analyzer-editor__section-body > .run-log {
  margin-top: 0;
}
.form-pane__section-body > .intake-foot:last-child {
  margin-bottom: 0;
}

/* ---- Collapsible section (publishing) ---- */
.collapsible {
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  margin: var(--sp-1) 0;
}
.collapsible__head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--c-ink);
}
.collapsible__head svg {
  transition: transform 0.15s ease;
  transform: rotate(-90deg);
}
.collapsible.is-open .collapsible__head svg {
  transform: rotate(0deg);
}
.collapsible__title {
  flex: 1 1 auto;
  font-weight: var(--fw-medium);
}
.collapsible__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 0 var(--sp-3) var(--sp-3);
}

/* ---- Layout (display mode) toggle ---- */
.layout-toggle {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: var(--sp-2) 0;
}
.seg-toggle {
  display: inline-flex;
  border: var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
  width: fit-content;
}
.seg-toggle .seg {
  padding: var(--sp-2) var(--sp-3);
  background: var(--c-surface);
  border: none;
  border-right: var(--border);
  cursor: pointer;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}
.seg-toggle .seg:last-child {
  border-right: none;
}
.seg-toggle .seg.is-active {
  background: var(--c-accent, var(--c-splash-green));
  color: var(--c-ink-inv);
}

.web-save {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.web-run {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.schedule-editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  border: var(--border);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
}
.schedule-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
}
.schedule-row--stack {
  align-items: stretch;
  flex-direction: column;
}
.schedule-field {
  flex: 1 1 0;
  min-width: 0;
}
.schedule-field--small {
  flex: 0 0 118px;
}
.schedule-days {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
.schedule-day {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  cursor: pointer;
  user-select: none;
}
.schedule-day input {
  margin: 0;
}
.schedule-day.is-selected {
  border-color: var(--c-accent);
  color: var(--c-ink);
  background: var(--c-surface-hover);
}
.schedule-summary {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink-2);
}

.preview-pane {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.io-widget {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border: var(--border);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
}
.io-widget__title {
  font-weight: var(--fw-medium);
  font-size: var(--fs-normal);
}
.io-widget__prompt {
  min-height: 56px;
  resize: vertical;
  width: 100%;
}
.io-widget__btn {
  align-self: flex-start;
}
.io-widget__status {
  font-size: var(--fs-xs);
  min-height: 1em;
}
.io-alts {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}
.io-alts__label {
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
}
.io-field-error {
  color: var(--c-danger, #d23);
  font-size: var(--fs-xs);
  margin-top: 2px;
}
.rendered-field.has-error .rf-input,
.rendered-field.has-error .rf-textarea,
.rendered-field.has-error .rf-select {
  border-color: var(--c-danger, #d23);
}
/* ---- Analyzer editor (transform node) ---- */
.analyzer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.analyzer-prompt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.analyzer-record-mode-row {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.analyzer-prompt-reset {
  background: none;
  border: none;
  color: var(--c-splash-violet, var(--c-text-3));
  font-size: var(--fs-sm);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  white-space: nowrap;
}
.analyzer-prompt-reset:hover {
  color: var(--c-text-1);
}
.analyzer-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.analyzer-actions .btn-ghost {
  margin-left: auto;
}

.analyzer-cutoff {
  margin-top: var(--sp-3);
}
.cutoff-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
}
.cutoff-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.cutoff-row .cutoff-amount {
  width: 72px;
}
.cutoff-row .cutoff-unit {
  width: auto;
}

.node-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow-y: auto;
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
}
.node-picker__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-normal);
  padding: 2px var(--sp-1);
  cursor: pointer;
}
.node-picker__item:hover {
  background: var(--c-surface-hover);
  border-radius: var(--r-sm);
}
.node-picker__type {
  margin-left: auto;
  font-size: var(--fs-xs);
}

.run-log {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--c-bg-sunken);
  border: var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
}
.run-log__line {
  padding: 1px 0;
  white-space: pre-wrap;
}

/* ---- Board editor (output node) ---- */

.board-host {
  height: 100%;
}
.board-editor {
  height: 100%;
  min-height: 0;
}
.board-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  height: 100%;
  min-height: 0;
  transition: grid-template-columns var(--t-base);
}
.board-workspace.viewer-open {
  grid-template-columns: minmax(220px, 45%) minmax(280px, 55%);
}
.board-workspace.viewer-open.viewer-expanded {
  grid-template-columns: 0 minmax(0, 1fr);
}
.board-workspace.viewer-open.viewer-expanded .board-pane {
  overflow: hidden;
  visibility: hidden;
}
.board-workspace.viewer-open.viewer-expanded .board-viewer {
  border-left: none;
  margin-left: 0;
  padding-left: 0;
}
.board-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
  border-bottom: var(--border);
  padding-bottom: 0.5rem;
}
.board-toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.board-retention {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--c-ink-2);
  font-size: var(--fs-2xs);
}
.board-retention input {
  width: 70px;
  height: 28px;
  border-radius: var(--r-pill);
  padding: 2px var(--sp-2);
  font-size: var(--fs-2xs);
}
.board-retention select {
  width: 90px;
  height: 28px;
  border-radius: var(--r-pill);
  padding: 2px var(--sp-2);
  font-size: var(--fs-2xs);
}
.board-add {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}
.board-group {
  display: inline-flex;
  border: var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.board-group-btn {
  background: var(--c-surface);
  border: none;
  padding: 2px var(--sp-2);
  font-size: var(--fs-2xs);
  cursor: pointer;
  color: var(--c-ink-2);
}
.board-group-btn + .board-group-btn {
  border-left: var(--border);
}
.board-group-btn:hover {
  background: var(--c-surface-hover);
}
.board-group-btn.is-on {
  background: var(--c-accent);
  color: var(--c-ink-inv);
}
.board-tb-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px var(--sp-1);
  background: var(--c-line);
}
.board-tb-group {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  border: var(--border);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  height: 40px;
}
.board-tb-group-label {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: var(--sp-1);
  padding-right: var(--sp-2);
  border-right: var(--border);
}

/* Note draft rendered in the board viewer (board toolbar "Note" button) */
.board-note-draft__grid {
  border: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
      padding: 1rem;
    border-radius: var(--r-2xl);
}
.board-note-draft__grid .bp-grid { grid-template-columns: repeat(4, 1fr); }

/* Date-grouped sections */
.board-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.board-section + .board-section {
  margin-top: var(--sp-3);
}
.board-section-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-1) 0;
  background: none;
  border: none;
  color: var(--c-ink-2);
  border-bottom: var(--border);
}
.board-section-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}
.board-section-delete {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 0 0 auto;
  padding: 2px var(--sp-2);
  border: var(--border);
  border-radius: var(--r-pill);
  background: var(--c-surface-1);
  color: var(--c-danger, #b42318);
  font-size: var(--fs-2xs);
  cursor: pointer;
}
.board-section-delete:hover {
  background: var(--c-danger-soft, rgba(180, 35, 24, 0.08));
}
.board-section-chevron {
  display: inline-flex;
  transition: transform var(--t-fast);
  color: var(--c-ink-3);
}
.board-section.is-collapsed .board-section-chevron {
  transform: rotate(-90deg);
}
.board-section-title {
  flex: 1 1 auto;
  text-align: left;
  font-size: var(--fs-normal);
  font-weight: var(--fw-medium);
}
.board-section-count {
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
  background: var(--c-surface-2);
  border-radius: var(--r-pill);
  padding: 0 var(--sp-2);
}
.board-section-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  display: inline-block;
}

/* Card group badge + manage-groups dialog */
.board-card-group-badge {
  display: none;
  flex: 0 0 auto;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 0 var(--sp-2);
  line-height: 1.6;
}
.board-viewer-group {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 0 0 auto;
}
.board-viewer-group-select {
  flex: 0 0 auto;
  max-width: 160px;
}
.board-groups-manager {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 320px;
}
.board-group-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.board-group-row .board-group-name {
  flex: 1 1 auto;
}
.board-group-color {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: var(--border);
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
}
.board-group-add {
  align-self: flex-start;
  margin-top: var(--sp-2);
}

/* Share dialog */
.board-share {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 320px;
}
.board-share-toggle {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-normal);
  font-weight: var(--fw-medium);
}
.board-share-toggle span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.board-share-link {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.board-share-link .input {
  flex: 1 1 auto;
  font-size: var(--fs-xs);
}
.board-share-link .btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.btn-sm {
  padding: 2px var(--sp-2);
  font-size: var(--fs-xs);
  height: 28px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-4);
  align-items: start;
}
.board-card {
  border: var(--border);
  border-radius: var(--r-lg, var(--r-md));
  background: var(--c-surface);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.board-card:hover {
  border-color: var(--c-line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.board-card--hidden {
  opacity: 0.55;
}
.board-card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 22px;
}
.board-card-type-icon {
  color: var(--c-ink-3);
  display: inline-flex;
  flex: 0 0 auto;
}
.board-card-title {
  flex: 1 1 auto;
  font-size: var(--fs-normal);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.board-card:hover .board-card-actions {
  opacity: 1;
}
.board-card-btn {
  background: none;
  border: none;
  color: var(--c-ink-3);
  cursor: pointer;
  padding: 2px;
  border-radius: var(--r-sm);
  display: inline-flex;
}
.board-card-btn:hover {
  background: var(--c-surface-hover);
  color: var(--c-ink);
}
.board-card-prov {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
}
.board-card-prov-source {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-card-prov-time {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--c-ink-3);
  font-size: var(--fs-2xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.board-card-desc {
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  margin: 0;
  line-height: var(--lh-base);
}
.board-card-body {
  position: relative;
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  overflow: hidden;
  max-height: 240px;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}
.board-card-body:has(.board-card-placeholder) {
  -webkit-mask-image: none;
  mask-image: none;
}
.board-card-placeholder {
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  font-style: italic;
}
.board-card-meta {
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
  margin-bottom: var(--sp-1);
}

.board-view-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-2xs);
}
.board-view-table th, .board-view-table td {
  text-align: left;
  padding: 3px var(--sp-1);
  border-bottom: var(--border);
  vertical-align: top;
}
.board-view-table th {
  color: var(--c-ink-3);
  font-weight: var(--fw-medium);
}

.board-showcase-title {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-normal);
  margin-bottom: var(--sp-1);
}
.board-showcase {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.board-showcase-row {
  display: flex;
  gap: var(--sp-2);
  flex-direction: column;
}
.board-showcase-row dt {
  color: var(--c-ink-3);
  font-size: var(--fs-2xs);
}
.board-showcase-row dd {
  flex: 1 1 auto;
  margin: 0;
}
.board-showcase-row dd .sc-line {
  padding: 1px 2px;
  border-radius: 3px;
  scroll-margin: 80px;
}
.board-showcase-row dd .sc-line--target {
  background: var(--c-accent-soft, rgba(255, 213, 74, 0.3));
}

/* Assistant record-edit proposal diff (board viewer) */
.board-record-edit-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-2) 0;
}
.board-record-edit-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.board-record-edit-label {
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
}
.board-record-edit-diff {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-small);
}
.board-record-edit-value {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  border-radius: var(--r-xs);
  padding: 3px var(--sp-2);
  line-height: var(--lh-tight);
}
.board-record-edit-sign {
  flex: 0 0 auto;
  font-weight: var(--fw-semibold);
}
.board-record-edit-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.board-record-edit-before {
  color: var(--c-splash-red, #e5484d);
  background: color-mix(in srgb, var(--c-splash-red, #e5484d) 12%, transparent);
}
.board-record-edit-before .board-record-edit-text {
  text-decoration: line-through;
}
.board-record-edit-after {
  color: var(--c-splash-green);
  background: color-mix(in srgb, var(--c-splash-green) 14%, transparent);
  font-weight: var(--fw-medium);
}
.board-record-edit-cell-id {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
  background: var(--c-surface-2);
  border-radius: var(--r-xs);
  padding: 0 4px;
  margin-left: 4px;
}
.board-record-edit-line {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
  margin-left: 2px;
}
/* Line-diff blocks inside board record-edit rows */
.board-record-edit-row .card-diff { margin-top: 2px; }

/* Showcase source-record search results */
.board-sc-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  margin-top: var(--sp-1);
}
.board-sc-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--sp-1) var(--sp-2);
  border: var(--border);
  border-radius: var(--r-xs);
  background: var(--c-surface);
  color: var(--c-ink);
  font-size: var(--fs-small);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-sc-result:hover {
  background: var(--c-surface-2);
}
.board-sc-result.is-selected {
  border-color: var(--c-line-strong);
  background: var(--c-accent-soft);
  font-weight: var(--fw-medium);
}

/* Editable showcase fields */
.board-showcase--editable .board-showcase-row dd {
  display: flex;
}
.board-showcase--editable .sc-edit-input {
  width: 100%;
  font-size: var(--fs-small);
}
.board-showcase--editable .sc-edit-textarea {
  min-height: 56px;
  resize: vertical;
}
.board-showcase--editable .sc-edit-multi {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
}
.board-showcase--editable .sc-edit-choice,
.board-showcase--editable .sc-edit-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-small);
  cursor: pointer;
}

a.source-url-link {
  color: var(--c-accent, #2563eb);
  text-decoration: underline;
  word-break: break-all;
}
a.source-url-link:hover {
  text-decoration: none;
}

/* Localizer target: temporary scroll-to highlight + exact quote mark.
 * The flash fades IN then fades OUT (rather than popping in and fading out)
 * so the eye is led to the target without a jarring appearance. Per-keyframe
 * timing functions: ease-in for the entrance, ease-out for the exit. */
.sc-highlight {
  animation: sc-flash 3s ease-in-out;
  border-radius: 4px;
}
.sc-mark {
  background: var(--c-warn, #ffd54a);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
@keyframes sc-flash {
  0% {
    background: transparent;
    animation-timing-function: ease-in;
  }
  18% {
    background: var(--c-accent-soft, rgba(255, 213, 74, 0.55));
    animation-timing-function: ease-in-out;
  }
  55% {
    background: var(--c-accent-soft, rgba(255, 213, 74, 0.55));
    animation-timing-function: ease-out;
  }
  100% {
    background: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sc-highlight { animation-duration: 0.01ms; }
}

/* Inline record embed (showcase chip) inside text/sheet card content. */
.rec-embed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 5px;
  margin: 0 1px;
  vertical-align: baseline;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-accent-soft, rgba(255, 213, 74, 0.18));
  color: var(--c-ink-1);
  font-size: 0.92em;
  line-height: 1.5;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
}
.rec-embed:hover {
  background: var(--c-accent-soft, rgba(255, 213, 74, 0.34));
  border-color: var(--c-accent, #e7b008);
}
.rec-embed svg {
  flex: 0 0 auto;
  opacity: 0.7;
}
.rec-embed span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Record modal (opened from an embed chip). */
.rec-modal-fields {
  max-height: 60vh;
  overflow: auto;
}

.board-chart-toggle {
  display: inline-flex;
  gap: 0;
  margin-bottom: var(--sp-1);
  border: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.board-chart-toggle button {
  background: var(--c-surface);
  border: none;
  padding: 1px var(--sp-2);
  font-size: var(--fs-2xs);
  cursor: pointer;
  color: var(--c-ink-2);
}
.board-chart-toggle button.active {
  background: var(--c-accent);
  color: var(--c-ink-inv);
}
.board-chart-wrap {
  position: relative;
  height: 180px;
}
.board-chart-preview {
  height: 160px;
  margin-top: var(--sp-2);
}

.board-viewer {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: var(--border);
  margin-left: var(--sp-4);
  padding-left: var(--sp-4);
  display: flex;
  flex-direction: column;
}
.board-viewer[hidden] {
  display: none;
}
.board-viewer-head {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}
.board-viewer-title {
  flex: 1 1 auto;
}
.board-viewer-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  overflow: auto;
  min-height: 0;
}
.board-md-toolbar {
  display: flex;
  gap: 2px;
  margin-bottom: var(--sp-2);
}
.board-md-btn {
  width: 26px;
  height: 26px;
  border: var(--border);
  background: var(--c-surface);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--c-ink-2);
}
.board-md-btn:hover {
  background: var(--c-surface-hover);
}
.board-text-editor {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
}
.board-text-preview {
  padding: var(--sp-3);
  border: var(--border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}
.board-text-editing .EasyMDEContainer {
  margin-top: var(--sp-2);
}
.board-text-editing .EasyMDEContainer .editor-toolbar {
  border-color: var(--c-line);
  background: var(--c-surface);
}
.board-text-editing .EasyMDEContainer .editor-toolbar a {
  color: var(--c-ink-2);
}
.board-text-editing .EasyMDEContainer .editor-toolbar a:hover,
.board-text-editing .EasyMDEContainer .editor-toolbar a.active {
  background: var(--c-surface-hover);
  border-color: var(--c-line);
}
.board-text-editing .EasyMDEContainer .CodeMirror {
  border-color: var(--c-line);
  background: var(--c-surface);
  color: var(--c-ink-1);
}
.board-text-editing .EasyMDEContainer .editor-preview {
  background: var(--c-surface);
}

/* The view-card editor reuses the shared .form-pane layout (see dock.css form
   pane rules above). Only the section-head row variant — a title block paired
   with the Chart/Table toggle — is view-specific. */
.form-pane__section-head--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-2);
}
/* The showcase viewer still uses the legacy collapsible settings shell. */
.board-view-settings {
  border: var(--border);
  border-radius: var(--r-2xl);
  padding: var(--sp-3);
  background: var(--c-surface);
}
.board-view-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: var(--sp-3);
}
.board-view-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}
.board-view-field--wide {
  grid-column: 1 / -1;
}
.board-view-field--limit {
  max-width: 140px;
}
.board-view-settings-summary {
  cursor: pointer;
  font-size: var(--fs-normal);
  color: var(--c-ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.board-view-settings-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.board-view-settings-body .input, .board-chart-settings .input {
  width: 100%;
}
.board-col-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 190px;
  overflow-y: auto;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
  padding: var(--sp-1);
}
.board-col-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 5px 6px;
  border-radius: var(--r-sm);
  font-size: var(--fs-normal);
}
.board-col-row:hover {
  background: var(--c-surface-hover);
}
.board-chart-settings {
  border: var(--border);
  border-radius: var(--r-lg, var(--r-md));
  padding: var(--sp-2);
  background: var(--c-surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.board-chart-settings-head {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: none;
  border: none;
  padding: var(--sp-1) var(--sp-2);
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: var(--c-ink-2);
  font-size: var(--fs-normal);
  border-radius: var(--r-sm);
}
.board-chart-settings-head:hover {
  background: var(--c-surface-hover);
  color: var(--c-ink);
}
.board-chart-settings-chevron {
  display: inline-flex;
  align-items: center;
  transition: transform var(--t-fast);
}
.board-chart-settings.is-open .board-chart-settings-chevron {
  transform: rotate(180deg);
}
.board-chart-settings-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.board-chart-settings-body[hidden] {
  display: none !important;
}

/* Chart / Table tab toggle in the view-card viewer body. */
.board-viewer-panes {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-height: 0;
}
.board-viewer-panes [data-viewer-pane][hidden] {
  display: none !important;
}
.board-chart-viewer-preview {
  position: relative;
  height: 280px;
  width: 100%;
  background: var(--c-surface);
  border-radius: var(--r-sm);
  padding: 0.5rem;
}
.board-chart-viewer-preview canvas {
  width: 100% !important;
  height: 100% !important;
}
.board-view-preview-panel .board-chart-toggle {
  flex: 0 0 auto;
}
.board-view-preview-panel {
  max-height: 500px;
}
.board-view-results {
  flex: 1 1 auto;
  min-height: 220px;
}
.board-view-preview-scroll {
  height: 100%;
  max-height: min(420px, 45vh);
  overflow: auto;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}
.board-view-preview-scroll .board-card-meta {
  position: sticky;
  left: 0;
  padding: var(--sp-2) var(--sp-2) var(--sp-1);
  margin: 0;
  background: var(--c-bg);
  z-index: 2;
}
.board-view-preview-scroll .board-view-table {
  min-width: max(100%, 620px);
}
.board-view-preview-scroll .board-view-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface);
  box-shadow: inset 0 -1px 0 var(--c-line);
}
.board-filter-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.board-filter-empty {
  margin: 0;
  padding: var(--sp-3);
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  border: 1px dashed var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}
.board-filter-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(130px, 0.9fr) minmax(150px, 1fr) 30px;
  gap: var(--sp-2);
  align-items: end;
  padding: var(--sp-2);
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-bg);
}
.board-filter-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.board-filter-row label > span {
  color: var(--c-ink-3);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.board-filter-value .board-filter-novalue {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-2);
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
}
.board-filter-remove {
  width: 30px;
  height: 30px;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-ink-3);
  cursor: pointer;
}
.board-filter-remove:hover {
  color: var(--c-danger, #b42318);
  background: var(--c-surface-hover);
}
.board-filter-add {
  align-self: flex-start;
}
.board-filter-combinator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 3px;
  border: var(--border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
}
.board-filter-combinator > span {
  padding: 0 var(--sp-2);
}
.board-filter-comb-btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 9px;
  background: transparent;
  color: var(--c-ink-3);
  cursor: pointer;
  font-size: var(--fs-xs);
}
.board-filter-comb-btn.active {
  background: var(--c-ink);
  color: var(--c-bg);
}

.board-sheet-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}
.board-sheet-tb-sep {
  width: 1px;
  align-self: stretch;
  margin: 2px var(--sp-1);
  background: var(--c-line);
}
.board-sheet-fmt {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: var(--fs-normal);
  cursor: pointer;
  line-height: 1;
}
.board-sheet-fmt:hover {
  background: var(--c-surface-hover);
}
.board-sheet-fmt.is-on {
  background: var(--c-accent);
  color: var(--c-ink-inv);
}
.board-sheet-fmt:disabled {
  opacity: 0.4;
  cursor: default;
}
.board-sheet-color {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 26px;
  padding: 0 4px;
  border: var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-normal);
  cursor: pointer;
}
.board-sheet-color input[type="color"] {
  width: 16px;
  height: 16px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.board-sheet-numfmt {
  height: 26px;
  border: var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  background: var(--c-surface);
}
.board-sheet-wrap {
  overflow: auto;
  max-height: 420px;
  border: var(--border);
  border-radius: var(--r-sm);
  outline: none;
}
.board-sheet-editor {
  border-collapse: collapse;
  table-layout: fixed;
}
.board-sheet-editor td, .board-sheet-editor th {
  border: var(--bw) solid var(--c-line);
  padding: 0;
}
.board-sheet-corner, .board-sheet-colhead, .board-sheet-rowhead {
  position: relative;
  background: var(--c-surface-2);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
  font-weight: var(--fw-medium);
  user-select: none;
}
.board-sheet-colhead {
  padding: 2px 4px;
  white-space: nowrap;
}
.board-sheet-colhead.is-filtered {
  background: var(--c-accent-soft);
}
.board-sheet-colname {
  cursor: pointer;
}
.board-sheet-colname:hover {
  text-decoration: underline;
}
.board-sheet-rowhead {
  width: 34px;
  text-align: center;
}
.board-sheet-colfilter {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 9px;
  padding: 0 2px;
  color: var(--c-ink-3);
}
.board-sheet-editor.has-frozen .board-sheet-frozen td,
.board-sheet-editor.has-frozen .board-sheet-frozen th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--c-surface-2);
  font-weight: var(--fw-semibold);
}
.board-sheet-td {
  position: relative;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-normal);
  min-width: 80px;
  height: 26px;
  white-space: nowrap;
  overflow: hidden;
  cursor: cell;
}
.board-sheet-td.is-selected {
  background: rgba(47, 109, 246, 0.12);
}
.board-sheet-td.is-active {
  outline: 2px solid var(--c-splash-blue);
  outline-offset: -2px;
}
.board-sheet-cell-input {
  width: 100%;
  border: none;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-normal);
  background: var(--c-surface);
  outline: 2px solid var(--c-splash-blue);
  outline-offset: -2px;
}
.board-sheet-fill {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  background: var(--c-splash-blue);
  border: var(--bw) solid var(--c-surface);
  cursor: crosshair;
  z-index: 2;
}
.board-sheet-resize-col {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}
.board-sheet-resize-row {
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 6px;
  cursor: row-resize;
  z-index: 2;
}
.board-sheet-del {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--c-ink-3);
  font-size: var(--fs-xs);
  padding: 0 2px;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.board-sheet-colhead:hover .board-sheet-del, .board-sheet-rowhead:hover .board-sheet-del {
  opacity: 1;
}
.board-sheet-fbar {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-2);
}
.board-sheet-fbar-ref {
  min-width: 48px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--c-ink-3);
}
.board-sheet-fbar-fx {
  height: 26px;
  min-width: 30px;
  border: var(--border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-style: italic;
  cursor: pointer;
}
.board-sheet-fbar-fx:hover {
  background: var(--c-surface-hover);
}
.board-sheet-fbar-input {
  flex: 1;
  height: 26px;
  padding: 0 var(--sp-2);
  border: var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-normal);
  font-family: var(--font-mono);
}
.board-sheet-fbar-input:focus {
  outline: 2px solid var(--c-splash-blue);
  outline-offset: -1px;
}
.board-sheet-td.is-ref {
  transition: box-shadow var(--t-fast);
}
.board-sheet-fxmenu, .board-sheet-autocomplete {
  position: fixed;
  z-index: var(--z-menu);
  background: var(--c-surface);
  border: var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  padding: var(--sp-1);
  max-height: 280px;
  overflow-y: auto;
  min-width: 220px;
}
.board-sheet-fxitem, .board-sheet-acitem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: var(--sp-1) var(--sp-2);
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.board-sheet-fxitem:hover, .board-sheet-acitem:hover, .board-sheet-acitem.is-on {
  background: var(--c-surface-hover);
}
.board-sheet-fxsig {
  font-family: var(--font-mono);
  font-size: var(--fs-normal);
  font-weight: var(--fw-semibold);
}
.board-sheet-fxdesc {
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}
.board-sheet-acitem {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-2);
}
.board-sheet-acsig {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--c-ink-3);
}

/* ---- Sheet preview tables (card bodies + proposals) ---- */
.board-sheet-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-2xs);
}
.board-sheet-preview td, .board-sheet-preview th {
  text-align: left;
  padding: 3px var(--sp-1);
  border: var(--bw) solid var(--c-line);
  vertical-align: top;
}
.board-sheet-preview th {
  color: var(--c-ink-3);
  font-weight: var(--fw-medium);
  background: var(--c-surface-2);
}

/* ---- Proposal viewer (assistant card proposals shown in the board pane) ---- */
.board-viewer-type-icon {
  color: var(--c-ink-3);
  display: inline-flex;
  flex: 0 0 auto;
}
.board-viewer-title-static {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: var(--fw-medium);
  font-size: var(--fs-normal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-proposal-viewer {
  gap: var(--sp-3);
}
.board-proposal-desc {
  font-size: var(--fs-normal);
  color: var(--c-ink);
  margin: 0;
}
.board-proposal-summary {
  font-size: var(--fs-xs);
  color: var(--c-ink-2);
  margin: 0;
}
.board-proposal-type-tag {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-ink-3);
  border: var(--border);
  border-radius: var(--r-pill);
  padding: 1px var(--sp-2);
}
.board-proposal-body {
  overflow: auto;
  min-height: 0;
}
.board-proposal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}
.board-proposal-applied {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--c-splash-green);
  margin-top: var(--sp-2);
}

/* Text line-by-line diff */
.card-diff {
  border: var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.card-diff-line {
  display: flex;
  gap: var(--sp-2);
  padding: 1px var(--sp-2);
  white-space: pre-wrap;
}
.card-diff-gutter {
  flex: 0 0 12px;
  text-align: center;
  color: var(--c-ink-3);
  user-select: none;
}
.card-diff-text {
  flex: 1 1 auto;
  word-break: break-word;
}
.card-diff-add {
  background: color-mix(in srgb, var(--c-splash-green) 14%, transparent);
}
.card-diff-add .card-diff-gutter {
  color: var(--c-splash-green);
}
.card-diff-del {
  background: color-mix(in srgb, var(--c-splash-red, #e5484d) 12%, transparent);
}
.card-diff-del .card-diff-gutter {
  color: var(--c-splash-red, #e5484d);
}

/* Sheet cell-by-cell diff (before/after) */
.card-diff-sheets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.card-diff-sheet-col {
  min-width: 0;
  overflow: auto;
}
.card-diff-sheet-label {
  font-size: var(--fs-2xs);
  color: var(--c-ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
}
.card-diff-sheet {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-2xs);
}
.card-diff-sheet td {
  border: var(--bw) solid var(--c-line);
  padding: 2px var(--sp-1);
  vertical-align: top;
}
.card-diff-cell-add {
  background: color-mix(in srgb, var(--c-splash-green) 22%, transparent);
}
.card-diff-cell-del {
  background: color-mix(in srgb, var(--c-splash-red, #e5484d) 18%, transparent);
}

/* ── GFM markdown styles ─────────────────────────────────────────────── */

.rendered-markdown {
  line-height: var(--lh-base);
  overflow-wrap: break-word;
}
.rendered-markdown > :first-child {
  margin-top: 0;
}
.rendered-markdown > :last-child {
  margin-bottom: 0;
}

.rendered-markdown h1 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  margin: 1.5em 0 0.5em;
}
.rendered-markdown h2 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin: 1.25em 0 0.4em;
}
.rendered-markdown h3 {
  font-size: 1rem;
  font-weight: var(--fw-semibold);
  margin: 1em 0 0.3em;
}
.rendered-markdown h4 {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin: 0.8em 0 0.2em;
}
.rendered-markdown h5,
.rendered-markdown h6 {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  margin: 0.6em 0 0.2em;
}

.rendered-markdown p {
  margin: 0.6em 0;
}
.rendered-markdown strong {
  font-weight: var(--fw-bold);
}
.rendered-markdown em {
  font-style: italic;
}
.rendered-markdown del {
  text-decoration: line-through;
}
.rendered-markdown hr {
  border: none;
  border-top: var(--border);
  margin: 1.2em 0;
}

.rendered-markdown code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--c-surface-3);
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
}
.rendered-markdown pre {
  background: var(--c-surface-3);
  border: var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  overflow-x: auto;
  margin: 0.8em 0;
}
.rendered-markdown pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: var(--fs-xs);
}

.rendered-markdown blockquote {
  margin: 0.8em 0;
  padding: var(--sp-1) var(--sp-3);
  border-left: 3px solid var(--c-line-2);
  color: var(--c-ink-2);
}
.rendered-markdown blockquote p {
  margin: 0.2em 0;
}

.rendered-markdown ul,
.rendered-markdown ol {
  margin: 0.6em 0;
  padding-left: 1.8em;
}
.rendered-markdown li {
  margin: 0.2em 0;
}
.rendered-markdown li > p {
  margin: 0.2em 0;
}

.rendered-markdown ul.contains-task-list {
  list-style: none;
  padding-left: 0;
}
.rendered-markdown ul.contains-task-list li {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.rendered-markdown ul.contains-task-list li input[type="checkbox"] {
  margin: 0;
  accent-color: var(--c-accent);
  flex-shrink: 0;
}

.rendered-markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8em 0;
  font-size: var(--fs-xs);
}
.rendered-markdown th,
.rendered-markdown td {
  border: var(--border);
  padding: var(--sp-1) var(--sp-2);
  text-align: left;
  vertical-align: top;
}
.rendered-markdown th {
  background: var(--c-surface-3);
  font-weight: var(--fw-semibold);
}
.rendered-markdown tbody tr:nth-child(even) {
  background: var(--c-surface-2);
}

.rendered-markdown a {
  color: var(--c-accent);
  text-decoration: underline;
}
.rendered-markdown a:hover {
  opacity: 0.8;
}

.rendered-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 0.8em 0;
}

@media (max-width: 760px) {
  .records-view-settings-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .board-workspace.viewer-open {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 45%) minmax(220px, 55%);
  }
  .board-workspace.viewer-open.viewer-expanded {
    grid-template-rows: 0 minmax(0, 1fr);
  }
  .board-workspace.viewer-open.viewer-expanded .board-viewer {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }
  .board-viewer {
    border-left: none;
    border-top: var(--border);
    margin-left: 0;
    margin-top: var(--sp-3);
    padding-left: 0;
    padding-top: var(--sp-3);
  }
  .card-diff-sheets {
    grid-template-columns: 1fr;
  }
  .board-view-grid,
  .board-filter-row {
    grid-template-columns: 1fr;
  }
  .board-view-field--wide,
  .board-view-field--limit {
    grid-column: auto;
    max-width: none;
  }
  .board-filter-remove {
    width: 100%;
  }
  .board-view-preview-scroll {
    max-height: 340px;
  }
}

/* ---- Integration (source) wizard ---- */
.integration-editor {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.integration-pane {
  display: flex;
  flex-direction: column;
}
/* Numbered stepper */
.integration-stepper {
  width: 100%;
}
.integration-step {
  position: relative;
}
.integration-step__head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.integration-step__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2, #f0f0f0);
  color: var(--text-muted, #888);
  border: 2px solid var(--border, #e3e3e3);
}
.integration-step.is-active > .integration-step__head .integration-step__num,
.integration-step.is-active .integration-step__num {
  border-color: var(--accent, #4f7cff);
  color: var(--accent, #4f7cff);
}
.integration-step.is-complete .integration-step__num {
  /* background: var(--accent, #4f7cff); */
  border-color: var(--accent, #4f7cff);
  color: #fff;
}
.integration-step__title {
  color: var(--text, #222);
}
.integration-step.is-locked .integration-step__title {
  color: var(--text-muted, #999);
}
.integration-step__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
/* Scope step */
.integration-scope,
.integration-scope-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.integration-scope__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.integration-scope__filter {
  margin: 2px 0;
}
.integration-scope-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border, #e3e3e3);
  border-radius: 8px;
  padding: 4px;
}
.integration-scope-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.integration-scope-option:hover {
  background: var(--surface-2, #f6f6f6);
}
.integration-scope-option__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.integration-source-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.integration-source-group {
  border: 1px solid var(--c-line);
  border-radius: 15px;
  background: var(--surface, #fff);
  overflow: hidden;
}
.integration-source-group.is-active {
  border-color: var(--accent, #4f7cff);
}
.integration-source-group__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
}
.integration-source-group__meta {
  margin-left: auto;
  margin-right: 10px;
}
.integration-source-group__summary::-webkit-details-marker {
  display: none;
}
.integration-source-group__summary::after {
  content: ">";
  color: var(--muted, #777);
  font-size: 12px;
  transition: transform 0.15s ease;
}
.integration-source-group[open] .integration-source-group__summary::after {
  transform: rotate(90deg);
}
.integration-source-group:not([open]) .integration-source-group__summary::after {
  transform: rotate(0deg);
}
.integration-source-group .integration-shape-grid {
  padding: 0 10px 10px;
}
.integration-shape-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.integration-shape {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
}
.integration-shape.is-active {
  outline: 2px solid var(--accent, #4f7cff);
}
.integration-cred-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.integration-cred {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border, #e3e3e3);
  border-radius: 8px;
}
.integration-cred.is-active {
  border-color: var(--accent, #4f7cff);
}
.integration-cred__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.integration-cred__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.integration-cred-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px dashed var(--border, #d0d0d0);
  border-radius: 8px;
}
.integration-cred-form__actions,
.integration-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.integration-created {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.integration-field-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}
.integration-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2, #f6f6f6);
}
.integration-field__label {
  flex: 1;
  font-size: 13px;
}
.integration-diff-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.integration-diff-group h4 {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted, #888);
}
.integration-diff-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.integration-automation {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.integration-schedule {
  margin-top: 0;
}

/* ---- Shared per-card comment thread (components/comments.js) ---- */
.card-comments {
  margin-top: var(--sp-5, 16px);
  border-top: 1px solid var(--c-border, #e5e7eb);
  padding-top: var(--sp-4, 12px);
}
.cc-head {
  font-weight: var(--fw-semibold, 600);
  font-size: 13px;
  margin-bottom: var(--sp-3, 8px);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cc-count {
  font-size: 11px;
  color: var(--c-ink-3, #9ca3af);
  background: var(--c-surface-2, #f3f4f6);
  border-radius: 999px;
  padding: 1px 8px;
}
.cc-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3, 8px);
}
.cc-empty, .cc-loading, .cc-readonly, .cc-error {
  font-size: 12px;
  color: var(--c-ink-3, #9ca3af);
  padding: 4px 0;
}
.cc-error {
  color: var(--c-danger, #dc2626);
}
.cc-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cc-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-2, #f3f4f6);
  font-size: 10px;
  font-weight: 600;
  color: var(--c-ink-2, #6b7280);
}
.cc-item__main {
  flex: 1 1 auto;
  min-width: 0;
}
.cc-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.cc-item__author {
  font-weight: 600;
  color: var(--c-ink, #111827);
}
.cc-item__time {
  color: var(--c-ink-3, #9ca3af);
}
.cc-del {
  margin-left: auto;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--c-ink-3, #9ca3af);
  font-size: 14px;
  line-height: 1;
  padding: 0 4px;
}
.cc-del:hover {
  color: var(--c-danger, #dc2626);
}
.cc-item__body {
  font-size: 13px;
  color: var(--c-ink, #111827);
  white-space: pre-wrap;
  word-break: break-word;
}
.cc-composer {
  margin-top: var(--sp-3, 8px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.cc-input {
  width: 100%;
  resize: vertical;
  min-height: 38px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--c-border, #e5e7eb);
  border-radius: var(--radius-2, 8px);
  background: var(--c-surface, #fff);
  color: var(--c-ink, #111827);
}

/* Respect reduced-motion: collapse the premium glide transitions to near-instant
 * so the reveal/dock open still function without movement. */
@media (prefers-reduced-motion: reduce) {
  .dock,
  .blueprint-stage .blueprint-base {
    transition-duration: 0.01ms !important;
  }
}

/* Web intake Basics — Blueprint row + prompt reset (mirrors analyzer-prompt-reset). */
.web-blueprint-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.web-blueprint-name {
  flex: 1;
  font-weight: 600;
}
.web-blueprint-name.muted {
  font-weight: 400;
}
.web-blueprint-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.web-prompt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.web-prompt-reset {
  font-size: 12px;
  color: var(--c-accent, #2563eb);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
}
.web-prompt-reset:hover {
  color: var(--c-accent-strong, #1d4ed8);
}
@media (prefers-reduced-motion: reduce) {
  .web-blueprint-row,
  .web-prompt-row {
    transition: none;
  }
}
