.research-workbench {
  --research-red: #b4422f;
  --research-amber: #a86616;
  width: min(100%, 1600px);
  margin-inline: auto;
  padding: 20px max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left));
  box-sizing: border-box;
  min-width: 0;
  overflow: clip;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.research-radar-group {
  min-width: 0;
  border-top: 1px solid var(--line);
}

.research-radar-group:first-child { border-top: 0; }

.research-radar-group > header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f7f7f5;
}

.research-radar-group > header > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.research-radar-group > header > div:first-child {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.research-radar-group > header strong { font-size: 13px; }
.research-radar-group > header span,
.research-radar-group > header small,
.research-group-empty { color: var(--muted); font-size: 11px; }
.research-group-empty { padding: 14px; }

.research-reference-action {
  min-width: 82px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 5px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}

.research-reference-action:hover,
.research-reference-action.active {
  border-color: var(--accent);
  background: #edf8f4;
  color: var(--accent-dark);
}

.research-reference-item.active {
  border-color: rgba(16, 163, 127, .45);
  box-shadow: inset 3px 0 0 var(--accent);
}

.research-reference-item-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.research-reference-item > a { color: var(--accent-dark); font-size: 11px; white-space: nowrap; }

.research-current-reference {
  position: relative;
  min-width: 0;
  border-top: 1px solid var(--line);
  background: #fff;
}

.research-current-reference-head,
.research-reference-confirm,
.research-media-upgrade {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.research-current-reference-head { border-bottom: 1px solid var(--line); }
.research-current-reference-head > div:first-child { min-width: 0; }
.research-current-reference-head span,
.research-current-reference-head p { margin: 0; color: var(--muted); font-size: 11px; }
.research-current-reference-head h2 { margin: 3px 0 5px; font-size: 20px; line-height: 1.25; letter-spacing: 0; }

.research-current-reference-actions,
.research-field-actions,
.research-evidence-links {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.research-current-reference-actions a,
.research-evidence-links a { color: var(--accent-dark); font-size: 11px; }

.research-reference-progress,
.research-reference-error,
.research-brief-stale {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 18px;
  border: 1px solid rgba(168, 102, 22, .28);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff8ec;
  color: #765019;
  font-size: 12px;
}

.research-reference-progress i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--research-amber);
  animation: research-pulse 1s ease-in-out infinite;
}

.research-reference-error { border-color: rgba(180, 66, 47, .3); background: #fff4f1; color: var(--research-red); }

.research-evidence-list { min-width: 0; }

.research-evidence-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(140px, .7fr) minmax(260px, 2fr) minmax(180px, 1fr);
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.research-evidence-label,
.research-evidence-editor,
.research-evidence-meta {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.research-evidence-label strong { font-size: 13px; }
.research-evidence-label small,
.research-evidence-meta > span,
.research-evidence-meta > small { color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }

.research-evidence-state {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  background: #f5f5f3;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.research-evidence-state.evidenced { border-color: rgba(16, 163, 127, .3); background: #edf8f4; color: var(--accent-dark); }
.research-evidence-state.manual_accepted { border-color: rgba(64, 93, 142, .3); background: #f0f4fa; color: #365a8c; }
.research-evidence-state.suggested,
.research-evidence-state.partial { border-color: rgba(168, 102, 22, .3); background: #fff8ec; color: #765019; }
.research-evidence-state.unusable { border-color: rgba(180, 66, 47, .3); background: #fff4f1; color: var(--research-red); }

.research-evidence-editor textarea,
.research-media-upgrade textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
}

.research-evidence-guidance {
  display: grid;
  gap: 3px;
  width: 100%;
  border-left: 2px solid #c5923b;
  padding: 6px 8px;
  background: #fff8ec;
  color: #765019;
  font-size: 11px;
  line-height: 1.5;
}

.research-evidence-guidance strong { font-size: 10px; }

.research-auto-diff,
.research-field-conflict {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-left: 3px solid var(--research-amber);
  padding: 8px 10px;
  background: #fff8ec;
  font-size: 11px;
}

.research-auto-diff strong,
.research-field-conflict strong,
.research-auto-diff span,
.research-field-conflict span { display: block; overflow-wrap: anywhere; }
.research-auto-diff span,
.research-field-conflict span { margin-top: 4px; color: var(--muted); }

.research-field-actions { margin-top: 8px; }
.research-field-actions button,
.research-evidence-meta button { min-height: 36px; white-space: normal; }

.research-creative-suggestion {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(168, 102, 22, .32);
  border-left: 3px solid #c5923b;
  padding: 10px;
  background: #fffaf1;
  color: #60400f;
}

.research-creative-suggestion header,
.research-creative-suggestion footer,
.research-creative-suggestion-actions,
.research-media-upgrade-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.research-creative-suggestion header strong { font-size: 11px; }
.research-creative-suggestion header span { border: 1px solid rgba(168, 102, 22, .42); border-radius: 3px; padding: 2px 5px; color: #765019; font-size: 9px; font-weight: 700; }
.research-creative-suggestion p { margin: 8px 0 5px; color: var(--ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.research-creative-suggestion > small,
.research-creative-suggestion footer > span,
.research-creative-suggestion footer > em { color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.research-creative-suggestion footer { align-items: flex-end; margin-top: 9px; }
.research-creative-suggestion footer > span { flex: 1 1 auto; }
.research-creative-suggestion footer > em { color: #765019; font-style: normal; }
.research-creative-suggestion-actions { flex: 0 0 auto; justify-content: flex-end; flex-wrap: wrap; }
.research-creative-suggestion-actions button,
.research-media-upgrade-actions button { min-height: 32px; white-space: normal; font-size: 10px; }

.research-media-upgrade {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.research-media-upgrade > div,
.research-media-upgrade label { min-width: 0; display: flex; flex: 1 1 0; flex-direction: column; gap: 5px; }
.research-media-upgrade-actions { flex: 0 1 220px; flex-direction: row !important; justify-content: flex-end; flex-wrap: wrap; }
.research-media-upgrade span,
.research-media-upgrade small,
.research-media-upgrade label { color: var(--muted); font-size: 11px; }

.research-reference-confirm > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.research-reference-confirm span { color: var(--muted); font-size: 11px; }

.research-reference-history {
  position: absolute;
  z-index: 20;
  inset: 0 0 auto auto;
  width: min(420px, 100%);
  max-height: 70vh;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 28, 35, .14);
}

.research-reference-history header,
.research-reference-history > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.research-reference-history > div { border-top: 1px solid var(--line); padding: 10px 0; }
.research-reference-history span { min-width: 0; display: flex; flex-direction: column; }
.research-reference-history small,
.research-reference-history em { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }

.research-brief-stale { justify-content: space-between; margin-block: 12px; }
.research-brief-stale span { flex: 1 1 auto; }

.research-snapshot-history {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(20, 28, 35, .2);
}

.research-snapshot-history > header,
.research-snapshot-history-list article,
.research-ocr-confirm > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.research-snapshot-history h2 { margin: 0; font-size: 20px; letter-spacing: 0; }
.research-snapshot-history p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.research-snapshot-history-list article { border-top: 1px solid var(--line); padding: 12px 0; }
.research-snapshot-history-list article > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.research-snapshot-history-list span { color: var(--muted); font-size: 11px; }
.research-snapshot-history-list a { color: var(--accent-dark); font-size: 11px; }
.research-ocr-confirm { margin: 14px 0; border: 1px solid rgba(168, 102, 22, .3); border-radius: 6px; padding: 12px; background: #fff8ec; }
.research-ocr-confirm > span { display: block; margin-top: 6px; overflow-wrap: anywhere; color: #765019; font-size: 11px; }

@media (max-width: 640px) {
  .research-workbench {
    width: 100%;
    padding: 12px max(12px, env(safe-area-inset-right)) max(88px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .research-evidence-row { grid-template-columns: minmax(0, 1fr); padding-inline: 12px; }
  .research-reference-list { overflow-x: auto; scroll-padding-inline: 12px; }
  .research-reference-item { min-width: 270px; }
  .research-current-reference-head,
  .research-reference-confirm,
  .research-media-upgrade,
  .research-brief-stale { align-items: stretch; flex-direction: column; }
  .research-current-reference-head,
  .research-reference-confirm,
  .research-media-upgrade { padding-inline: 12px; }
  .research-creative-suggestion footer { align-items: stretch; flex-direction: column; }
  .research-creative-suggestion-actions,
  .research-media-upgrade-actions { width: 100%; justify-content: stretch; }
  .research-creative-suggestion-actions button,
  .research-media-upgrade-actions button { flex: 1 1 0; }
  .research-current-reference-actions > * { flex: 1 1 auto; }
  .research-radar-group > header { align-items: flex-start; }
  .research-radar-group > header > div:last-child { align-items: flex-end; flex-direction: column; }
  .research-snapshot-history-list article { align-items: flex-start; flex-direction: column; }
}

.research-status-bar,
.research-section-head,
.research-control-band,
.research-analysis-toolbar,
.research-report-head,
.research-brief-head,
.research-handoff-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.research-status-bar {
  min-height: 43px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.research-status-copy,
.research-status-actions,
.research-segments,
.research-filters,
.research-subtabs,
.research-report-actions,
.research-brief-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.research-status-copy {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.research-status-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.research-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.research-status-dot.running {
  animation: research-pulse 1s ease-in-out infinite;
}

.research-status-dot.partial,
.research-status-dot.fixture { background: var(--research-amber); }
.research-status-dot.cached { background: #637587; }
.research-status-dot.error { background: var(--research-red); }

.research-status-progress {
  color: var(--accent-dark);
  font-weight: 720;
}

.research-source-count {
  min-width: 32px;
  color: var(--accent-dark);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  text-align: center;
}

.research-sample-flag {
  border-left: 1px solid var(--line-strong);
  padding-left: 8px;
  color: var(--amber);
  font-weight: 700;
}

.research-icon-button.research-manual-refresh {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  margin-left: 1px;
  border-radius: 5px;
}

.research-manual-refresh.running svg {
  animation: research-refresh-spin .85s linear infinite;
}

.research-manual-refresh:disabled {
  cursor: progress;
  opacity: .58;
}

@keyframes research-pulse {
  50% { opacity: .35; transform: scale(.82); }
}

@keyframes research-refresh-spin {
  to { transform: rotate(360deg); }
}

.research-icon-button,
.research-row-icon {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
  background: #fff;
  color: var(--muted);
}

.research-icon-button:hover,
.research-row-icon:hover,
.research-row-icon.active {
  border-color: rgba(16, 163, 127, .38);
  background: #edf8f4;
  color: var(--accent-dark);
}

.research-icon-button svg,
.research-row-icon svg {
  width: 15px;
  height: 15px;
}

.research-primary-tabs {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  scrollbar-width: none;
}

.research-primary-tabs::-webkit-scrollbar { display: none; }

.research-primary-tab,
.research-subtab {
  min-height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 2px 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.research-primary-tab:hover,
.research-primary-tab.active,
.research-subtab:hover,
.research-subtab.active {
  border-bottom-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

.research-inline-notice {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(16, 163, 127, .2);
  padding: 7px 14px;
  background: #eef8f4;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 650;
}

.research-inline-notice button {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
}

.research-inline-notice > span {
  white-space: pre-line;
}

.research-page-body { min-width: 0; }

.research-control-band {
  padding: 11px 18px;
}

.research-segments,
.research-filters { flex-wrap: wrap; }

.research-segment,
.research-content-tab,
.research-filter {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.research-segment:hover,
.research-segment.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.research-filter.locked {
  border-color: rgba(16, 163, 127, .26);
  background: #edf8f4;
  color: var(--accent-dark);
}

.research-filters label,
.research-analysis-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.research-filters select,
.research-analysis-toolbar select {
  width: auto;
  min-height: 32px;
  border-radius: 5px;
  padding: 5px 28px 5px 9px;
  font-size: 12px;
}

.research-content-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 0 18px 10px;
  scrollbar-width: none;
}

.research-content-tabs::-webkit-scrollbar { display: none; }

.research-content-tab {
  border-color: transparent;
  background: #f2f2ef;
}

.research-content-tab:hover,
.research-content-tab.active {
  border-color: rgba(16, 163, 127, .2);
  background: #eaf7f3;
  color: var(--accent-dark);
}

.research-reference-tray { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 18px; background: #fbfcfb; }
.research-reference-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.research-reference-head > div { display: grid; gap: 3px; min-width: 0; }
.research-reference-head > .research-reference-head-actions { display: flex; align-items: center; gap: 6px; }
.research-reference-head .research-reference-head-actions .ghost { border-color: var(--line); background: #fff; color: var(--muted); }
.research-reference-head strong { font-size: 12px; }
.research-reference-head span, .research-reference-empty { color: var(--muted); font-size: 10px; line-height: 1.5; }
.research-reference-head button { min-height: 29px; border: 1px solid var(--accent); border-radius: 5px; padding: 4px 9px; background: #edf8f4; color: var(--accent-dark); font-size: 10px; font-weight: 750; white-space: nowrap; }
.research-reference-head button:disabled { border-color: var(--line); background: #f4f4f2; color: var(--soft); cursor: not-allowed; }
.research-reference-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 7px; margin-top: 9px; }
.research-reference-item { position: relative; min-width: 0; display: grid; gap: 6px; border: 1px solid var(--line); padding: 8px 33px 8px 9px; background: #fff; }
.research-reference-item-main { display: grid; gap: 2px; min-width: 0; }
.research-reference-item-main strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.research-reference-item-main span { overflow: hidden; color: var(--soft); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.research-reference-signals { display: grid; gap: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.research-reference-signals span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-reference-signals b { margin-right: 5px; color: var(--ink); font-weight: 750; }
.research-reference-item > button { position: absolute; top: 7px; right: 7px; width: 20px; min-height: 20px; border: 1px solid var(--line); border-radius: 4px; padding: 0; background: #fff; color: var(--soft); font-size: 14px; line-height: 1; }
.research-reference-item > button:hover { border-color: var(--research-red); color: var(--research-red); }
.research-reference-empty { margin-top: 8px; border-left: 2px solid var(--line-strong); padding: 6px 8px; background: #fff; }
.research-reference-stale { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; border-left: 2px solid var(--research-amber); padding: 6px 8px; background: #fff8ef; color: var(--research-amber); font-size: 10px; line-height: 1.45; }
.research-reference-stale button { min-height: 25px; border: 1px solid currentColor; border-radius: 4px; padding: 3px 7px; background: #fff; color: inherit; font-size: 9px; font-weight: 750; white-space: nowrap; }

.research-work-area {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 280px);
  border-top: 1px solid var(--line);
}

.research-table-wrap {
  min-width: 0;
  overflow-x: auto;
  overflow-y: clip;
  overscroll-behavior-inline: contain;
}

.research-table-head,
.research-table-row {
  box-sizing: border-box;
  min-width: 760px;
  display: grid;
  grid-template-columns: 45px minmax(210px, 1fr) minmax(120px, .55fr) minmax(110px, .5fr) 58px minmax(152px, 160px);
  align-items: center;
}

.research-table-head {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px 0 16px;
  background: #fbfbfa;
  color: var(--soft);
  font-size: 11px;
  font-weight: 650;
}

.research-table-row {
  min-height: 66px;
  border-bottom: 1px solid #ecece8;
  padding: 8px 12px 8px 16px;
}

.research-table-wrap.learning .research-table-head,
.research-table-row-learning {
  grid-template-columns: 45px minmax(220px, 1fr) minmax(118px, .5fr) minmax(150px, .68fr) minmax(90px, .38fr) 68px;
}

.research-table-wrap.market .research-table-head,
.research-table-row-market {
  grid-template-columns: 45px minmax(225px, 1fr) minmax(125px, .5fr) minmax(125px, .5fr) minmax(185px, .78fr) 68px;
}

.research-table-row-learning,
.research-table-row-market { min-height: 88px; }

.research-table-row:last-child { border-bottom: 0; }
.research-table-row:hover { background: #fafbf9; }
.research-table-row > div { min-width: 0; padding-right: 8px; }

.research-rank {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

.research-title-cell,
.research-platform {
  display: grid;
  gap: 2px;
}

.research-title-cell strong,
.research-platform strong {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-title-cell strong { font-size: 13px; }
.research-platform strong { font-size: 12px; }

.research-title-cell small,
.research-platform small,
.research-title-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-title-cell span { color: var(--soft); }
.research-title-cell a {
  width: fit-content;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.research-title-cell a:hover { text-decoration: underline; }

.research-title-cell strong a {
  color: inherit;
  text-decoration: none;
}

.research-openable { cursor: pointer; }
.research-openable:focus-visible {
  border-radius: 4px;
  outline: 2px solid rgba(16, 163, 127, .42);
  outline-offset: 3px;
}

.research-read-original { margin-top: 1px; }

.research-learning-takeaway,
.research-market-opportunity {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.research-market-opportunity strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.research-market-opportunity small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--soft);
  font-size: 9px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.research-stage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  color: var(--soft);
  font-size: 10px;
}

.research-stage-list span {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 5px;
  background: #f7f7f5;
  color: var(--muted);
}

.research-market-metrics {
  display: grid;
  gap: 5px;
}

.research-market-metrics span { display: grid; gap: 1px; }
.research-market-metrics strong {
  overflow: hidden;
  color: var(--research-red);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.research-market-metrics small { color: var(--soft); font-size: 9px; }

.research-direction-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.research-direction-tags span {
  border: 1px solid rgba(16, 163, 127, .2);
  border-radius: 4px;
  padding: 1px 5px;
  background: #eef8f4;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 720;
  line-height: 1.4;
}

.research-signal { color: var(--muted); font-size: 11px; }

.research-trend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.research-trend.up { color: var(--research-red); }
.research-trend.new { color: var(--accent-dark); }

.research-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  padding-right: 0 !important;
}

.research-table-row:not(.research-table-row-learning):not(.research-table-row-market) .research-row-actions {
  min-width: 152px;
}

.research-external-action { text-decoration: none; }

.research-row-icon {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
}

.research-insight-panel {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #fafaf9;
  padding: 14px;
}

.research-insight-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.research-insight-title strong { font-size: 14px; }
.research-insight-title span { color: var(--soft); font-size: 10px; }

.research-insight-panel section {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.research-insight-panel section > b {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
}

.research-signal-line {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--muted);
  font-size: 11px;
}

.research-signal-line em {
  color: var(--research-red);
  font-style: normal;
  font-weight: 720;
}

.research-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.research-tag-list span {
  border-radius: 3px;
  padding: 3px 5px;
  background: #efefec;
  color: var(--muted);
  font-size: 10px;
}

.research-opportunity {
  border-left: 3px solid #d49538;
  padding: 8px;
  background: #fff7e8;
  color: #6e552d;
  font-size: 11px;
  line-height: 1.55;
}

.research-source-foot {
  padding-top: 10px;
  color: var(--soft);
  font-size: 10px;
  line-height: 1.55;
}

.research-panel-empty { color: var(--soft); font-size: 10px; }

.research-source-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 25, 24, .38);
}

.research-source-modal {
  width: min(1120px, 100%);
  height: min(760px, calc(100dvh - 48px));
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(27, 33, 31, .22);
}

.research-source-modal:focus { outline: 2px solid rgba(16, 163, 127, .55); outline-offset: 3px; }
.research-source-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding: 18px 20px 14px; }
.research-source-modal-head h2 { margin: 3px 0 4px; font-size: 18px; line-height: 1.2; }
.research-source-modal-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.research-source-kicker { color: var(--accent-dark); font-size: 10px; font-weight: 760; letter-spacing: .02em; }
.research-source-tabs { display: flex; flex: 0 0 auto; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.research-source-tabs .research-subtab { min-height: 38px; }
.research-source-toolbar { display: flex; flex: 0 0 auto; align-items: flex-end; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid var(--line); padding: 10px 20px; }
.research-source-toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.research-source-toolbar select { min-height: 30px; min-width: 130px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.research-source-toolbar button { min-height: 30px; padding: 5px 9px; font-size: 10px; }
.research-source-toolbar button[data-source-new] { margin-left: auto; }
.research-source-layout { min-width: 0; min-height: 0; flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr); }
.research-source-list { min-width: 0; overflow: auto; border-right: 1px solid var(--line); background: #fbfbfa; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; }
.research-source-row { width: 100%; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 11px 14px 11px 18px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.research-source-row:hover, .research-source-row.active { background: #f1f7f4; }
.research-source-row-main { min-width: 0; display: grid; gap: 4px; }
.research-source-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.research-source-row-main small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.research-source-row-side { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
.research-source-row-side button { min-height: 27px; padding: 4px 8px; font-size: 10px; }
.research-source-list > .research-source-row + [data-source-add],
.research-source-list > .research-source-row + [data-source-detail].primary,
.research-source-list > .research-source-row + [data-source-detail].ghost { align-self: center; min-height: 27px; margin: 0 12px 0 0; padding: 4px 8px; font-size: 10px; }
.research-source-list > .research-source-row + [data-source-add] { grid-column: 2; }
.research-source-list > .research-source-row + [data-source-detail] { grid-column: 2; }
.research-source-status { display: inline-flex; align-items: center; min-height: 21px; border: 1px solid currentColor; border-radius: 3px; padding: 2px 6px; font-size: 9px; font-weight: 750; white-space: nowrap; }
.research-source-status.enabled { color: var(--accent-dark); background: #edf8f4; }
.research-source-status.pending { color: #9b691c; background: #fff7e8; }
.research-source-status.paused { color: var(--muted); background: #f0f0ed; }
.research-source-status.failed { color: var(--research-red); background: #fff1ef; }
.research-source-status.recommended { color: #426d8d; background: #eef6fb; }
.research-source-status.unknown { color: var(--soft); background: #f5f5f2; }
.research-source-detail { min-width: 0; min-height: 0; overflow: auto; padding: 18px 20px 20px; background: #fff; }
.research-source-detail-empty { display: grid; place-content: center; min-height: 300px; gap: 5px; color: var(--muted); text-align: center; font-size: 11px; }
.research-source-detail-empty strong { color: var(--ink); font-size: 13px; }
.research-source-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.research-source-detail-head h3 { margin: 4px 0 3px; font-size: 15px; line-height: 1.3; }
.research-source-detail-head p { max-width: 340px; margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.research-source-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 12px 0 14px; border: 1px solid var(--line); background: var(--line); }
.research-source-meta div { display: grid; gap: 3px; padding: 8px 9px; background: #fbfbfa; }
.research-source-meta dt { color: var(--soft); font-size: 9px; }
.research-source-meta dd { margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.research-source-boundary { display: grid; gap: 4px; margin: 0 0 14px; border-left: 2px solid var(--accent); padding: 8px 10px; background: #f5faf8; color: var(--muted); font-size: 10px; line-height: 1.55; }
.research-source-boundary strong { color: var(--ink); font-size: 10px; }
.research-source-verified-summary { color: var(--accent-dark); font-size: 10px; font-weight: 720; white-space: nowrap; }
.research-source-field { display: grid; gap: 5px; margin-top: 10px; color: var(--ink); font-size: 10px; font-weight: 700; }
.research-source-field input, .research-source-field select { width: 100%; min-height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; font-weight: 400; }
.research-source-usage { display: flex; flex-wrap: wrap; gap: 5px; }
.research-source-check { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.research-source-check:has(input:checked) { border-color: rgba(16, 163, 127, .45); background: #edf8f4; color: var(--accent-dark); }
.research-source-check input { width: 13px; min-height: 13px; margin: 0; }
.research-source-rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.research-source-parser-note { margin-top: 12px; border-left: 3px solid var(--accent); padding: 8px 9px; background: #edf8f4; color: var(--accent-dark); font-size: 10px; line-height: 1.55; }
.research-source-detail-actions, .research-source-wizard-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.research-source-detail-actions { position: sticky; bottom: -1px; z-index: 2; border-top: 1px solid var(--line); padding: 10px 0 1px; background: #fff; }
.research-source-detail-actions button, .research-source-wizard-actions button { min-height: 31px; padding: 5px 10px; font-size: 10px; }
.research-source-loading { display: grid; place-content: center; min-height: 220px; padding: 16px; color: var(--muted); font-size: 11px; text-align: center; }
.research-source-wizard { min-height: 0; flex: 1 1 auto; overflow: auto; padding: 18px 20px 22px; }
.research-source-wizard-head { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.research-source-wizard-head h3 { margin: 4px 0; font-size: 15px; }
.research-source-wizard-head p { margin: 0; color: var(--muted); font-size: 10px; }
.research-source-form-grid, .research-source-selector-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.research-source-field-wide { grid-column: 1 / -1; }
.research-source-error { margin-top: 11px; border-left: 3px solid var(--research-red); padding: 8px 9px; background: #fff1ef; color: var(--research-red); font-size: 10px; line-height: 1.5; }
.research-source-preview { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; }
.research-source-preview-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 11px; }
.research-source-preview-head span { color: var(--muted); font-size: 10px; }
.research-source-preview-scroll { overflow-x: auto; border: 1px solid var(--line); }
.research-source-preview table { width: 100%; min-width: 570px; border-collapse: collapse; font-size: 10px; }
.research-source-preview th, .research-source-preview td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.research-source-preview th { background: #fafaf9; color: var(--muted); font-weight: 750; }
.research-source-preview tr:last-child td { border-bottom: 0; }
.research-source-preview a { color: var(--accent-dark); }
.research-source-warning { margin: 7px 0; color: #9b691c; font-size: 10px; }

.research-empty {
  min-height: 150px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.research-empty.large { min-height: 340px; }
.research-empty strong { color: var(--ink); }
.research-empty button { margin-top: 8px; }

.research-analysis-page,
.research-competitor-page,
.research-report-page,
.research-brief-page {
  min-width: 0;
  padding: 0 18px 18px;
}

.research-section-head {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
}

.research-section-head > span {
  color: var(--soft);
  font-size: 11px;
}

.research-subtabs { overflow-x: auto; scrollbar-width: none; }
.research-subtabs::-webkit-scrollbar { display: none; }
.research-subtab { min-height: 38px; font-size: 12px; }

.research-analysis-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 12px 0;
}

.research-analysis-toolbar .research-segments { display: inline-flex; }
.research-analysis-toolbar label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.research-analysis-toolbar select { min-height: 32px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.research-analysis-toolbar > label:last-child { margin-left: auto; }

.research-metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.research-metric-row section {
  display: grid;
  gap: 3px;
  border-right: 1px solid var(--line);
  padding: 12px;
}

.research-metric-row section:last-child { border-right: 0; }
.research-metric-row span { color: var(--muted); font-size: 11px; }
.research-metric-row strong { font-size: 24px; line-height: 1.1; }
.research-metric-row em { color: var(--research-red); font-size: 10px; font-style: normal; }

.research-analysis-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  gap: 14px;
  margin-top: 14px;
}

.research-trend-board,
.research-opportunity-matrix,
.research-market-notes {
  min-width: 0;
  border: 1px solid var(--line);
}

.research-board-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
}

.research-board-title span { color: var(--soft); font-size: 10px; }

.research-bar-row {
  display: grid;
  grid-template-columns: 100px minmax(100px, 1fr) 45px;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid #ecece8;
  font-size: 11px;
}

.research-bar-row:last-child { border-bottom: 0; }
.research-bar-row > div { height: 8px; overflow: hidden; background: #efefec; }
.research-bar-row i { width: var(--research-bar); height: 100%; display: block; background: var(--accent); }
.research-bar-row i.emotion { background: #d49538; }
.research-bar-row b { color: var(--research-red); text-align: right; }

.research-subtype-detail { margin-top: 12px; border: 1px solid var(--line); }
.research-subtype-row { display: grid; grid-template-columns: 120px 90px minmax(0, 1fr); gap: 10px; align-items: center; border-bottom: 1px solid #ecece8; padding: 9px 12px; font-size: 11px; }
.research-subtype-row:last-child { border-bottom: 0; }
.research-subtype-row strong { color: var(--ink); }
.research-subtype-row span { color: var(--research-red); text-align: right; }
.research-subtype-row small { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.research-opportunity-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.research-opportunity-matrix section {
  min-height: 105px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 13px;
  background: #f8f8f6;
}

.research-opportunity-matrix section.focus { background: #fff7e8; }
.research-opportunity-matrix section.risk { background: #fff1ef; }
.research-opportunity-matrix b { font-size: 12px; }
.research-opportunity-matrix span { color: var(--muted); font-size: 11px; }

.research-market-notes { padding: 13px; background: #fafaf9; }
.research-market-notes > strong { font-size: 13px; }
.research-market-notes dl { margin: 10px 0; }
.research-market-notes dl div { border-top: 1px solid var(--line); padding: 9px 0; }
.research-market-notes dt { color: var(--accent-dark); font-size: 10px; font-weight: 750; }
.research-market-notes dd { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.research-market-notes p { font-size: 10px; line-height: 1.6; }

.research-compare-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  color: var(--muted);
  font-size: 11px;
}

.research-custom-competitor { margin: 12px 0 14px; border: 1px solid var(--line); padding: 13px; background: #fbfbfa; }
.research-custom-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.research-custom-head > div { display: grid; gap: 3px; }
.research-custom-head strong { font-size: 13px; }
.research-custom-head span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.research-custom-count { color: var(--accent-dark) !important; white-space: nowrap; }
.research-import-zone {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--line-strong);
  padding: 10px 11px;
  background: #fff;
  transition: border-color .16s ease, background-color .16s ease;
}
.research-import-zone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.research-import-zone.dragover { border-color: var(--accent); background: #f2faf7; }
.research-import-zone-icon { width: 34px; height: 34px; display: grid; place-items: center; background: #edf8f4; color: var(--accent-dark); }
.research-import-zone-icon svg { width: 18px; height: 18px; }
.research-import-zone > div { min-width: 0; display: grid; gap: 3px; }
.research-import-zone > div strong { font-size: 11px; }
.research-import-zone > div small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.research-import-formats { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin: 7px 0 11px; color: var(--muted); font-size: 9px; }
.research-import-formats > span { border: 1px solid var(--line); border-radius: 3px; padding: 2px 5px; background: #fff; }
.research-import-formats > small { margin-left: auto; color: var(--soft); font-size: 9px; }
.research-import-queue { margin: 0 0 12px; border-top: 1px solid var(--line); }
.research-import-queue-head { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 6px 2px; }
.research-import-queue-head strong { font-size: 10px; }
.research-import-queue-head span { color: var(--muted); font-size: 9px; }
.research-import-row { min-height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 2px; }
.research-import-row.active { background: #f2faf7; box-shadow: inset 2px 0 var(--accent); }
.research-import-row.error { background: #fff8f7; }
.research-import-main { min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 0; padding: 3px 5px; background: transparent; color: var(--ink); text-align: left; }
.research-workbench .research-import-main:hover,
.research-workbench .research-import-main:focus,
.research-workbench .research-import-main:active { background: transparent; color: var(--ink); }
.research-import-main:disabled { opacity: 1; cursor: default; }
.research-import-main > i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--line-strong); }
.research-import-row.parsing .research-import-main > i { background: var(--accent); animation: research-import-pulse 1s ease-in-out infinite; }
.research-import-row.ready .research-import-main > i,
.research-import-row.added .research-import-main > i { background: #2f8a67; }
.research-import-row.partial .research-import-main > i { background: #b67521; }
.research-import-row.error .research-import-main > i { background: var(--research-red); }
.research-import-main > span { min-width: 0; display: grid; gap: 2px; }
.research-import-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.research-import-main small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.research-import-status { color: var(--muted); font-size: 9px; white-space: nowrap; }
.research-import-status.ready,
.research-import-status.added { color: #217455; }
.research-import-status.partial { color: #9b631e; }
.research-import-status.error { color: var(--research-red); }
.research-import-actions { display: flex; gap: 2px; }
.research-import-actions button { width: 26px; min-width: 26px; min-height: 26px; display: grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--soft); }
.research-import-actions button:hover { background: #fff; color: var(--ink); }
.research-import-actions svg { width: 14px; height: 14px; }
.research-import-row > p { grid-column: 1 / -1; margin: -1px 6px 3px 20px; color: var(--research-red); font-size: 9px; line-height: 1.45; }
@keyframes research-import-pulse { 50% { opacity: .35; transform: scale(.72); } }
.research-custom-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) 150px minmax(0, 1fr); gap: 9px; }
.research-custom-competitor label { display: grid; gap: 5px; color: var(--ink); font-size: 10px; font-weight: 700; }
.research-custom-competitor input,
.research-custom-competitor select,
.research-custom-competitor textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 5px; padding: 7px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; font-weight: 400; }
.research-custom-competitor textarea { min-height: 142px; resize: vertical; line-height: 1.6; }
.research-custom-text-label { margin-top: 10px; }
.research-custom-text-label > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.research-custom-text-label em { color: var(--soft); font-size: 9px; font-style: normal; font-weight: 400; }
.research-import-preview-meta { display: grid; gap: 7px; margin-top: 10px; border-left: 3px solid var(--accent); padding: 8px 10px; background: #f4f9f7; }
.research-import-preview-meta > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.research-import-preview-meta > div:first-child strong { color: var(--muted); font-size: 9px; font-weight: 500; }
.research-import-preview-meta > div:first-child em { color: var(--accent-dark); font-size: 9px; font-style: normal; }
.research-quality { font-size: 9px; font-weight: 750; }
.research-quality.high { color: #217455; }
.research-quality.medium { color: #9b631e; }
.research-quality.low { color: var(--research-red); }
.research-import-locations { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.research-import-locations > span { margin-right: 3px; color: var(--muted); font-size: 9px; }
.research-import-locations button { min-height: 22px; border: 1px solid var(--line); border-radius: 3px; padding: 2px 6px; background: #fff; color: var(--ink); font-size: 9px; }
.research-import-locations small { color: var(--soft); font-size: 9px; }
.research-import-warnings { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; border-top: 1px solid #d8e8e1; padding-top: 6px; color: #7d531b; font-size: 9px; line-height: 1.45; }
.research-custom-upload { display: flex; align-items: center; gap: 9px; margin-top: 9px; }
.research-file-input { position: relative; display: inline-flex !important; min-height: 30px; align-items: center; border: 1px solid var(--line-strong); padding: 5px 9px; background: #fff; cursor: pointer; }
.research-file-input input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.research-custom-upload > span { min-width: 0; flex: 1; overflow: hidden; color: var(--soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.research-custom-upload button { min-height: 30px; padding: 5px 10px; font-size: 10px; }
.research-custom-list { display: grid; gap: 5px; margin-top: 11px; border-top: 1px solid var(--line); padding-top: 9px; }
.research-custom-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; background: #fff; }
.research-custom-list > div > span { min-width: 0; display: grid; gap: 2px; }
.research-custom-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.research-custom-list small { color: var(--muted); font-size: 10px; }
.research-custom-list button { min-height: 25px; border: 0; padding: 3px 6px; background: transparent; color: var(--research-red); font-size: 10px; }

.research-compare-summary strong { color: var(--accent-dark); }
.research-deconstruction-panel { margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0; }
.research-deconstruction-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.research-deconstruction-head > div { display: grid; gap: 3px; }
.research-deconstruction-head strong { font-size: 12px; }
.research-deconstruction-head span, .research-deconstruction-head small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.research-deconstruction-head small { white-space: nowrap; }
.research-deconstruction-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin-top: 10px; }
.research-deconstruction-card { min-width: 0; border: 1px solid var(--line); padding: 9px; background: #fff; }
.research-deconstruction-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.research-deconstruction-card header > div { display: grid; min-width: 0; gap: 2px; }
.research-deconstruction-card header strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.research-deconstruction-card header span { color: var(--soft); font-size: 9px; }
.research-deconstruction-card header em { border: 1px solid rgba(16,163,127,.22); padding: 2px 5px; background: #edf8f4; color: var(--accent-dark); font-size: 9px; font-style: normal; white-space: nowrap; }
.research-enrichment-proof { display: grid; gap: 6px; margin-top: 8px; border-left: 2px solid var(--accent); padding: 7px 8px; background: #f5faf8; }
.research-enrichment-proof > div:first-child { display: grid; gap: 2px; }
.research-enrichment-proof strong { color: var(--accent-dark); font-size: 9px; }
.research-enrichment-proof span { color: var(--muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.research-enrichment-sources { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.research-enrichment-sources a { max-width: 100%; overflow: hidden; color: var(--accent-dark); font-size: 9px; text-decoration: underline; text-overflow: ellipsis; white-space: nowrap; }
.research-enrichment-empty { color: var(--research-red) !important; }
.research-deconstruction-card dl { display: grid; gap: 5px; margin: 9px 0 0; }
.research-deconstruction-card dl div { display: grid; grid-template-columns: 57px minmax(0, 1fr); gap: 7px; }
.research-deconstruction-card dt { color: var(--soft); font-size: 9px; }
.research-deconstruction-card dd { min-width: 0; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.research-deconstruction-card p { margin: 8px 0 0; border-top: 1px solid var(--line); padding-top: 7px; color: var(--research-amber); font-size: 9px; line-height: 1.45; }
.research-deep-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; border-top: 1px solid var(--line); padding-top: 8px; }
.research-deep-action button { min-height: 26px; border: 1px solid var(--accent); border-radius: 4px; padding: 3px 7px; background: #edf8f4; color: var(--accent-dark); font-size: 9px; font-weight: 750; white-space: nowrap; }
.research-deep-action small { color: var(--soft); font-size: 9px; line-height: 1.35; text-align: right; }
.research-deep-result { display: grid; gap: 7px; margin-top: 9px; border-top: 1px solid var(--line); padding-top: 9px; }
.research-deep-result > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.research-deep-result > header strong { color: var(--ink); font-size: 10px; }
.research-deep-result > header span { color: var(--soft); font-size: 9px; }
.research-deep-beats { display: grid; gap: 4px; }
.research-deep-beats > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px; }
.research-deep-beats b { color: var(--accent-dark); font-size: 9px; }
.research-deep-beats span, .research-deep-evidence span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.research-deep-evidence { display: grid; gap: 3px; border-left: 2px solid var(--line-strong); padding-left: 7px; }
.research-deep-evidence strong { color: var(--ink); font-size: 9px; }
.research-deep-questions { display: grid; gap: 3px; background: #fafaf8; padding: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.research-compare-scroll { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-top: 0; }
.research-compare-table { min-width: max(100%, calc(140px + var(--research-compare-count) * 170px)); }
.research-compare-row { display: grid; grid-template-columns: 140px repeat(var(--research-compare-count), minmax(170px, 1fr)); }
.research-compare-row > div { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; color: var(--muted); font-size: 11px; }
.research-compare-row > div:last-child { border-right: 0; }
.research-compare-row:last-child > div { border-bottom: 0; }
.research-compare-row > div:first-child { color: var(--ink); font-weight: 700; }
.research-compare-row.head { background: #fafaf9; }
.research-compare-row.head > div { color: var(--ink); }
.research-compare-row.head > div:not(:first-child) { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.research-compare-row.head button { width: 24px; min-width: 24px; min-height: 24px; border: 0; padding: 0; background: transparent; color: var(--soft); font-size: 17px; }

.research-evidence-note {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  border-left: 3px solid var(--accent);
  padding: 9px 11px;
  background: #edf8f4;
  color: var(--accent-dark);
  font-size: 11px;
}

.research-report-head {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.research-report-head > div:first-child { min-width: 0; display: grid; gap: 3px; }
.research-report-head input { width: min(430px, 100%); min-height: 30px; border: 0; border-radius: 0; padding: 0; background: transparent; font-size: 15px; font-weight: 700; }
.research-report-head input:focus { outline-offset: 3px; }
.research-report-head span { color: var(--soft); font-size: 10px; }
.research-report-page > .research-subtabs { border-bottom: 1px solid var(--line); }

.research-report-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.research-report-layout > aside {
  position: sticky;
  top: 12px;
  align-self: start;
  max-height: calc(100dvh - 24px);
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 13px 12px 13px 0;
}

.research-report-outline-head { position: sticky; top: 0; z-index: 2; display: grid; gap: 7px; margin-bottom: 5px; padding-bottom: 5px; background: #fff; }
.research-report-outline-head strong { font-size: 11px; }
.research-report-outline-tools { display: grid; grid-template-columns: repeat(6, 24px); gap: 4px; }
.research-report-outline-tools button { width: 24px; min-width: 24px; min-height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; padding: 0; background: #fff; color: var(--muted); cursor: pointer; }
.research-report-outline-tools button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.research-report-outline-tools button:disabled { opacity: .35; cursor: default; }
.research-report-outline-tools svg { width: 13px; height: 13px; }
.research-report-outline-item { width: 100%; display: flex; align-items: center; gap: 3px; border: 0; border-radius: 4px; padding: 5px 7px 5px 3px; background: transparent; color: var(--muted); text-align: left; font: inherit; font-size: 10px; cursor: grab; }
.research-report-outline-item:hover { background: #f5f7f5; color: var(--ink); }
.research-report-outline-item.active { background: #edf8f4; color: var(--accent-dark); font-weight: 700; }
.research-report-outline-item.dragging { opacity: .45; }
.research-report-outline-item.drag-before { box-shadow: inset 0 2px 0 var(--accent); }
.research-report-outline-item.drag-after { box-shadow: inset 0 -2px 0 var(--accent); }
.research-report-outline-grip { width: 14px; flex: 0 0 14px; display: grid; place-items: center; color: var(--soft); cursor: grab; touch-action: none; }
.research-report-outline-grip svg { width: 12px; height: 12px; }
.research-report-outline-number { flex: 0 0 auto; }
.research-report-outline-edit { display: flex; align-items: center; gap: 3px; padding: 2px 0; }
.research-report-outline-edit input { width: 100%; min-width: 0; min-height: 27px; border: 1px solid rgba(16, 163, 127, .55); border-radius: 4px; padding: 4px 6px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.research-report-outline-edit input:focus { outline: 2px solid rgba(16, 163, 127, .2); outline-offset: 1px; }
.research-report-delete-confirm { display: grid; gap: 7px; margin: 2px 0 6px; border-left: 3px solid var(--research-red); padding: 7px 8px; background: #fff5f3; color: var(--ink); font-size: 10px; line-height: 1.4; }
.research-report-delete-confirm > div { display: flex; justify-content: flex-end; gap: 5px; }
.research-report-delete-confirm button { min-height: 26px; border-radius: 4px; padding: 4px 8px; font-size: 10px; }
.research-report-delete-confirm button.danger { border: 1px solid var(--research-red); background: var(--research-red); color: #fff; }
.research-report-content { min-width: 0; padding: 13px 0 13px 16px; }

.research-report-editor { display: grid; gap: 12px; }
.research-report-editor section { display: grid; gap: 6px; scroll-margin-top: 16px; }
.research-report-editor label { color: var(--ink); font-size: 11px; font-weight: 700; }
.research-report-field { min-height: 68px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--muted); font-size: 11px; line-height: 1.7; }
.research-report-field:focus { outline: 2px solid rgba(16, 163, 127, .25); outline-offset: 2px; }

.research-citation-list { border: 1px solid var(--line); }
.research-citation-list > div { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(150px, 1fr); gap: 10px; border-bottom: 1px solid var(--line); padding: 11px; }
.research-citation-list > div:last-child { border-bottom: 0; }
.research-citation-list span { color: var(--muted); font-size: 11px; }
.research-citation-list small { color: var(--soft); font-size: 10px; }

.research-version-workspace { min-width: 0; min-height: 520px; display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.55fr); border: 1px solid var(--line); background: #fff; }
.research-version-sidebar { min-width: 0; border-right: 1px solid var(--line); background: #fafaf9; }
.research-version-save { display: grid; gap: 8px; border-bottom: 1px solid var(--line); padding: 12px; }
.research-version-save label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.research-version-save input { width: 100%; min-height: 31px; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; }
.research-version-save > button { min-height: 31px; font-size: 10px; }
.research-version-current { display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding: 11px 12px; background: #f2f7f4; }
.research-version-current strong { font-size: 11px; }
.research-version-current span { color: var(--accent-dark); font-size: 10px; }
.research-version-current small { color: var(--soft); font-size: 9px; }
.research-version-list { display: grid; align-content: start; }
.research-version-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 30px; border-bottom: 1px solid var(--line); }
.research-version-row.active { background: #edf8f4; }
.research-version-row > button:first-child { min-width: 0; display: grid; gap: 4px; border: 0; border-radius: 0; padding: 10px 8px 10px 12px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.research-version-row > button:first-child > span { display: flex; align-items: center; gap: 6px; }
.research-version-row > button:first-child strong { font-size: 11px; }
.research-version-row > button:first-child em { border: 1px solid #9b691c; border-radius: 3px; padding: 1px 4px; color: #9b691c; font-size: 8px; font-style: normal; }
.research-version-row > button:first-child b { overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.research-version-row > button:first-child small { color: var(--soft); font-size: 9px; }
.research-version-pin { width: 28px; min-width: 28px; min-height: 28px; align-self: center; display: grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--soft); }
.research-version-pin.active { color: #a36a00; }
.research-version-pin svg { width: 14px; height: 14px; }
.research-version-compare { min-width: 0; padding: 14px 16px 18px; }
.research-version-compare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.research-version-compare-head h3 { margin: 4px 0 3px; font-size: 14px; }
.research-version-compare-head p { margin: 0; color: var(--muted); font-size: 10px; }
.research-version-compare-head > button { flex: 0 0 auto; min-height: 31px; font-size: 10px; }
.research-version-source-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; border-bottom: 1px solid var(--line); padding: 9px 0; color: var(--muted); font-size: 9px; }
.research-version-diff-summary { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 0; }
.research-version-diff-summary span { border: 1px solid var(--line); border-radius: 3px; padding: 3px 6px; background: #fafaf9; color: var(--muted); font-size: 9px; }
.research-version-change-list { border-top: 1px solid var(--line); }
.research-version-change { border-bottom: 1px solid var(--line); padding: 11px 0; }
.research-version-change > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.research-version-change > header > div { min-width: 0; display: grid; gap: 5px; }
.research-version-change > header strong { font-size: 11px; }
.research-version-change > header span { display: flex; flex-wrap: wrap; gap: 4px; }
.research-version-change > header em { border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 5px; color: var(--muted); font-size: 8px; font-style: normal; }
.research-version-change > header button { flex: 0 0 auto; min-height: 27px; padding: 4px 8px; font-size: 9px; }
.research-version-change-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--line); gap: 1px; }
.research-version-change-columns > div { min-width: 0; padding: 8px 9px; background: #fff; }
.research-version-change-columns small { color: var(--soft); font-size: 8px; }
.research-version-change-columns p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.research-version-restore-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; border-left: 3px solid #9b691c; padding: 8px 10px; background: #fff8eb; }
.research-version-restore-confirm > div:first-child { display: grid; gap: 3px; }
.research-version-restore-confirm strong { font-size: 10px; }
.research-version-restore-confirm span { color: var(--muted); font-size: 9px; }
.research-version-restore-confirm > div:last-child { display: flex; flex: 0 0 auto; gap: 6px; }
.research-version-restore-confirm button { min-height: 28px; padding: 4px 9px; font-size: 9px; }
.research-version-empty { min-height: 320px; display: grid; place-content: center; gap: 5px; color: var(--muted); text-align: center; font-size: 10px; }
.research-version-empty strong { color: var(--ink); font-size: 12px; }
.research-version-empty.compact { min-height: 140px; padding: 16px; }

.research-handoff-row {
  margin-top: 12px;
  border: 1px dashed var(--line-strong);
  padding: 10px 12px;
  background: #fafaf9;
}

.research-handoff-row > div { display: grid; gap: 2px; }
.research-handoff-row strong { font-size: 12px; }
.research-handoff-row span { color: var(--muted); font-size: 10px; }
.research-handoff-row button { min-height: 30px; padding: 5px 10px; font-size: 11px; }

.research-loop { margin: 12px 18px 4px; border-block: 1px solid var(--line); padding: 10px 0 11px; }
.research-loop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.research-loop-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.research-loop-head strong { font-size: 12px; }
.research-loop-head span, .research-loop-head small { color: var(--muted); font-size: 10px; }
.research-loop-stages { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.research-loop-stage { position: relative; display: flex; min-height: 54px; align-items: center; gap: 7px; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 7px 8px; background: transparent; color: var(--muted); text-align: left; }
.research-loop-stage:last-child { border-right: 0; }
.research-loop-stage:hover:not(:disabled), .research-loop-stage.active { background: #f4faf7; color: var(--ink); }
.research-loop-stage.done { color: var(--accent-dark); }
.research-loop-stage i { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-style: normal; font-size: 9px; font-weight: 750; }
.research-loop-stage span { display: grid; min-width: 0; gap: 2px; }
.research-loop-stage strong { font-size: 10px; white-space: nowrap; }
.research-loop-stage small { color: inherit; font-size: 9px; line-height: 1.3; overflow-wrap: anywhere; }
.research-loop-stage:disabled { opacity: .45; cursor: not-allowed; }
.research-loop-action { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-top: 8px; padding: 6px 8px; background: #f6f8f7; color: var(--muted); font-size: 10px; }
.research-loop-action span { color: var(--accent-dark); font-weight: 750; white-space: nowrap; }
.research-loop-action strong { min-width: 0; flex: 1 1 auto; color: var(--ink); font-size: 10px; font-weight: 650; }
.research-loop-action button, .research-decision-confirm button { min-height: 27px; border: 1px solid var(--accent); border-radius: 5px; padding: 4px 8px; background: #edf8f4; color: var(--accent-dark); font-size: 10px; font-weight: 750; white-space: nowrap; }
.research-loop-action.done { background: #edf8f4; }

.research-decision-confirm { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.research-brief-head {
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.research-brief-head > div:first-child { min-width: 0; display: grid; gap: 3px; }
.research-brief-head input { width: min(520px, 100%); min-height: 32px; border: 0; border-radius: 0; padding: 0; background: transparent; font-size: 15px; font-weight: 750; }
.research-brief-head input:focus { outline-offset: 3px; }
.research-brief-head span { color: var(--soft); font-size: 10px; }

.research-brief-action,
.research-brief-import {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
}

.research-brief-action { min-height: 34px; padding: 6px 10px; }
.research-brief-action svg,
.research-brief-import svg { width: 15px; height: 15px; flex: 0 0 auto; }

.research-brief-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}

.research-brief-editor {
  min-width: 0;
  display: grid;
  align-content: start;
  padding: 14px 18px 18px 0;
}

.research-brief-editor section {
  min-width: 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.research-brief-editor section:first-child { padding-top: 2px; }
.research-brief-editor section:last-child { border-bottom: 0; }
.research-brief-editor label { padding-top: 8px; color: var(--ink); font-size: 11px; font-weight: 750; }
.research-brief-field { min-width: 0; min-height: 58px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.research-brief-field:focus { outline: 2px solid rgba(16, 163, 127, .25); outline-offset: 2px; }

.research-brief-handoff {
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 16px 0 18px 18px;
  background: #fbfbfa;
}

.research-brief-handoff-head { display: grid; gap: 4px; }
.research-brief-handoff-head > span { color: var(--accent-dark); font-size: 10px; font-weight: 750; }
.research-brief-handoff-head h3 { margin: 0; font-size: 15px; line-height: 1.25; }
.research-brief-handoff-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }

.research-brief-project { display: grid; gap: 6px; margin-top: 16px; }
.research-brief-project > span,
.research-brief-mode legend { color: var(--ink); font-size: 10px; font-weight: 750; }
.research-brief-project select { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; background: #fff; color: var(--ink); font: inherit; font-size: 11px; }

.research-brief-mode { min-width: 0; margin: 14px 0 0; border: 0; padding: 0; }
.research-brief-mode legend { margin-bottom: 6px; }
.research-brief-mode > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.research-brief-mode button { min-height: 32px; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 5px 8px; background: #fff; color: var(--muted); font-size: 10px; }
.research-brief-mode button:last-child { border-right: 0; }
.research-brief-mode button.active { background: #edf8f4; color: var(--accent-dark); font-weight: 750; }

.research-brief-target-summary { display: grid; gap: 3px; margin-top: 14px; border-block: 1px solid var(--line); padding: 11px 0; }
.research-brief-target-summary span { color: var(--soft); font-size: 9px; }
.research-brief-target-summary strong { font-size: 12px; overflow-wrap: anywhere; }
.research-brief-target-summary small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.research-brief-handoff-status { margin: 10px 0 0; border-left: 3px solid var(--accent); padding: 7px 9px; background: #edf8f4; color: var(--accent-dark); font-size: 10px; line-height: 1.5; }
.research-brief-handoff-status.error { border-left-color: var(--research-red); background: #fff1ef; color: var(--research-red); }
.research-brief-import { width: 100%; min-height: 38px; margin-top: 14px; padding: 7px 10px; }
.research-brief-feedback { display: grid; gap: 4px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px; }
.research-brief-feedback strong { font-size: 11px; }
.research-brief-feedback span { color: var(--muted); font-size: 10px; line-height: 1.55; }
.research-brief-feedback label { display: grid; gap: 4px; color: var(--ink); font-size: 10px; font-weight: 750; }
.research-brief-feedback select, .research-brief-feedback textarea { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; background: #fff; color: var(--ink); font: inherit; font-size: 10px; font-weight: 400; }
.research-brief-feedback textarea { min-height: 72px; resize: vertical; line-height: 1.55; }
.research-brief-feedback button { justify-self: start; min-height: 29px; border: 1px solid var(--accent); border-radius: 5px; padding: 4px 8px; background: #edf8f4; color: var(--accent-dark); font-size: 10px; font-weight: 750; }

.research-workbench .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .research-work-area,
  .research-analysis-grid { grid-template-columns: 1fr; }
  .research-insight-panel { border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 760px) {
  .research-source-modal-backdrop { place-items: end center; padding: 0; }
  .research-source-modal { width: 100%; max-height: calc(100dvh - 18px); border-radius: 8px 8px 0 0; }
  .research-source-modal-head { padding: 14px 13px 11px; }
  .research-source-modal-head h2 { font-size: 16px; }
  .research-source-tabs { padding-inline: 13px; overflow-x: auto; }
  .research-source-toolbar { align-items: stretch; padding: 9px 13px; }
  .research-source-toolbar label { flex: 1 1 120px; }
  .research-source-toolbar select { width: 100%; }
  .research-source-toolbar button[data-source-new] { margin-left: 0; }
  .research-source-layout { grid-template-columns: 1fr; max-height: calc(100dvh - 190px); }
  .research-source-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; }
  .research-source-detail { max-height: 390px; padding: 14px 13px 18px; }
  .research-source-row { min-height: 68px; padding-inline: 12px; }
  .research-source-row-side { gap: 5px; }
  .research-source-row-side .research-source-status { display: none; }
  .research-source-wizard { max-height: calc(100dvh - 130px); padding: 14px 13px 18px; }
  .research-source-form-grid, .research-source-selector-grid { grid-template-columns: 1fr; gap: 8px; }
  .research-source-field-wide { grid-column: auto; }
  .research-status-bar,
  .research-control-band,
  .research-analysis-toolbar,
  .research-report-head,
  .research-brief-head,
  .research-handoff-row { align-items: flex-start; flex-direction: column; }
  .research-status-actions { align-self: flex-end; margin-top: -38px; }
  .research-status-copy { padding-right: 68px; }
  .research-loop { margin-inline: 13px; }
  .research-loop-head { align-items: flex-start; flex-direction: column; gap: 3px; }
  .research-loop-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .research-loop-stage:nth-child(4) { border-right: 0; }
  .research-loop-stage:nth-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .research-loop-action, .research-decision-confirm { align-items: flex-start; flex-direction: column; }
  .research-loop-action button, .research-decision-confirm button { align-self: flex-start; }
  .research-primary-tabs { gap: 17px; padding-inline: 13px; }
  .research-primary-tab { min-height: 40px; }
  .research-control-band { padding: 10px 13px; }
  .research-filters { width: 100%; }
  .research-filters label { flex: 1 1 120px; }
  .research-filters select { width: 100%; }
  .research-content-tabs { padding-inline: 13px; }
  .research-reference-tray { padding-inline: 13px; }
  .research-reference-head { align-items: flex-start; flex-direction: column; }
  .research-reference-head button { align-self: flex-start; }
  .research-reference-list { grid-template-columns: 1fr; }
  .research-reference-stale { align-items: flex-start; flex-direction: column; }
  .research-deconstruction-head { align-items: flex-start; flex-direction: column; }
  .research-deconstruction-list { grid-template-columns: 1fr; }
  .research-deep-action { align-items: flex-start; flex-direction: column; }
  .research-deep-action small { text-align: left; }
  .research-table-head,
  .research-table-row {
    min-width: 486px;
    grid-template-columns: 36px minmax(180px, 1fr) 42px 154px;
  }
  .research-table-wrap.learning .research-table-head,
  .research-table-row-learning,
  .research-table-wrap.market .research-table-head,
  .research-table-row-market { grid-template-columns: 36px minmax(0, 1fr) minmax(72px, 90px) 64px; }
  .research-table-head { padding-left: 12px; }
  .research-table-row { min-height: 76px; padding: 9px 8px 9px 12px; }
  .research-table-head > div:nth-child(3),
  .research-table-head > div:nth-child(4),
  .research-table-row > .research-platform,
  .research-table-row > .research-signal,
  .research-table-row > .research-learning-takeaway,
  .research-table-row > .research-market-metrics { display: none; }
  .research-title-cell small,
  .research-title-cell span { white-space: normal; line-height: 1.35; }
  .research-row-actions { gap: 3px; }
  .research-row-icon { width: 26px; min-width: 26px; min-height: 26px; }
  .research-table-row-learning .research-row-actions,
  .research-table-row-market .research-row-actions { justify-content: flex-end; }
  .research-market-opportunity strong { -webkit-line-clamp: 3; }
  .research-market-opportunity small { display: none; }
  .research-analysis-page,
  .research-competitor-page,
  .research-report-page,
  .research-brief-page { padding-inline: 13px; }
  .research-section-head { align-items: flex-start; flex-direction: column; padding-top: 6px; }
  .research-section-head > span { padding-bottom: 7px; }
  .research-metric-row { grid-template-columns: 1fr; }
  .research-metric-row section { border-right: 0; border-bottom: 1px solid var(--line); }
  .research-metric-row section:last-child { border-bottom: 0; }
  .research-opportunity-matrix { grid-template-columns: 1fr; }
  .research-analysis-toolbar > label:last-child { margin-left: 0; }
  .research-analysis-toolbar label { flex: 1 1 135px; }
  .research-analysis-toolbar select { width: 100%; }
  .research-subtype-row { grid-template-columns: 100px 68px minmax(0, 1fr); }
  .research-import-zone { grid-template-columns: 30px minmax(0, 1fr); }
  .research-import-zone-icon { width: 30px; height: 30px; }
  .research-import-zone > .research-file-input { grid-column: 1 / -1; justify-content: center; }
  .research-import-formats > small { width: 100%; margin-left: 0; }
  .research-import-row { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
  .research-import-status { grid-row: 2; margin-left: 20px; }
  .research-import-actions { grid-column: 2; grid-row: 1 / span 2; }
  .research-import-row > p { grid-column: 1 / -1; }
  .research-custom-fields { grid-template-columns: 1fr; }
  .research-custom-upload { align-items: stretch; flex-wrap: wrap; }
  .research-custom-upload > span { flex-basis: 100%; order: 3; }
  .research-custom-upload button { margin-left: auto; }
  .research-report-layout { grid-template-columns: 1fr; }
  .research-report-layout > aside { position: static; max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }
  .research-report-outline-head,
  .research-report-delete-confirm { grid-column: 1 / -1; }
  .research-report-outline-head { position: static; padding-bottom: 0; }
  .research-report-content { padding-left: 0; }
  .research-citation-list > div { grid-template-columns: 1fr; gap: 3px; }
  .research-version-workspace { grid-template-columns: 1fr; }
  .research-version-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .research-version-list { max-height: 300px; overflow: auto; }
  .research-version-compare { padding: 13px; }
  .research-version-compare-head { align-items: stretch; flex-direction: column; }
  .research-version-compare-head > button { align-self: flex-end; }
  .research-version-change > header { align-items: stretch; flex-direction: column; }
  .research-version-change > header button { align-self: flex-end; }
  .research-version-change-columns { grid-template-columns: 1fr; }
  .research-version-restore-confirm { align-items: stretch; flex-direction: column; }
  .research-version-restore-confirm > div:last-child { align-self: flex-end; }
  .research-handoff-row button { width: 100%; }
  .research-brief-actions { width: 100%; }
  .research-brief-action { flex: 1 1 0; }
  .research-brief-layout { grid-template-columns: 1fr; }
  .research-brief-editor { padding-right: 0; }
  .research-brief-editor section { grid-template-columns: 1fr; gap: 6px; }
  .research-brief-editor label { padding-top: 0; }
  .research-brief-handoff { border-top: 1px solid var(--line); border-left: 0; padding: 16px 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .research-status-dot.running { animation: none; }
  .research-manual-refresh.running svg { animation: none; }
  .research-source-modal-backdrop { scroll-behavior: auto; }
}
