/* Shared evidence-list pattern: border-led, no stacked cards or ornamental shadows. */
.research-shell {
  --r-bg: #fff;
  --r-surface: #f7f8fc;
  --r-border: #e2e5ed;
  --r-text: #202938;
  --r-muted: #647084;
  --r-accent: #5140e8;
  max-width: 1200px;
  margin: auto;
  padding: 0 24px 72px;
  color: var(--r-text);
}
.dark .research-shell {
  --r-bg: #101625;
  --r-surface: #0b1020;
  --r-border: #283247;
  --r-text: #e8ecf4;
  --r-muted: #a2aec2;
  --r-accent: #a99cff;
}
.research-shell [hidden] {
  display: none !important;
}
.research-subnav {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--r-border);
  padding: 20px 0;
  flex-wrap: wrap;
}
.research-subnav a {
  color: var(--r-muted);
  font-weight: 600;
}
.research-subnav [aria-current] {
  color: var(--r-accent);
}
.research-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 36px 0 20px;
}
.research-heading h1 {
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin: 10px 0 12px;
}
.research-heading p:not(.research-eyebrow) {
  color: var(--r-muted);
  font-size: 15px;
  line-height: 1.7;
}
.research-eyebrow {
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--r-accent);
  font-weight: 750;
  margin: 0 0 7px;
}
.research-badge {
  border: 1px solid var(--r-border);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  padding: 5px 9px;
  color: var(--r-muted);
  display: inline-block;
  flex-shrink: 0;
}
#research-status {
  padding: 0 0 20px;
  color: var(--r-muted);
  min-height: 40px;
  line-height: 1.6;
}
#research-status[data-error="true"] {
  color: #be123c;
}
.dark #research-status[data-error="true"] {
  color: #fda4af;
}
.research-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.research-main {
  min-width: 0;
}
.research-panel {
  border: 1px solid var(--r-border);
  border-radius: 12px;
  padding: 22px;
  background: var(--r-bg);
  margin-bottom: 20px;
  min-width: 0;
}
.research-sidebar {
  padding: 18px;
}
.research-panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.research-panel h2,
.research-empty h2,
.research-dialog h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.research-caption {
  font-size: 12px;
  color: var(--r-muted);
  line-height: 1.65;
}
.research-caption span {
  display: inline-block;
}
.research-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--r-border);
  background: var(--r-bg);
  color: var(--r-text);
  font-weight: 650;
  font-size: 12px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.45;
}
.research-button.primary {
  background: #5140e8;
  border-color: #5140e8;
  color: #fff;
}
.research-button.small {
  padding: 7px 10px;
  min-height: 36px;
  font-size: 11px;
}
.research-button.danger {
  color: #be123c;
}
.dark .research-button.danger {
  color: #fda4af;
}
.research-button:disabled {
  opacity: 0.5;
  cursor: default;
}
.research-button:hover:not(:disabled) {
  filter: brightness(0.96);
}
.research-shell :focus-visible,
.research-dialog :focus-visible {
  outline: 2px solid var(--r-accent, #7562ff);
  outline-offset: 3px;
}
.research-case-list {
  margin: 18px -18px;
}
.research-case-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  border-top: 1px solid var(--r-border);
  padding: 15px;
  background: transparent;
  color: var(--r-text);
  cursor: pointer;
}
.research-case-item:last-child {
  border-bottom: 1px solid var(--r-border);
}
.research-case-item[aria-current="true"] {
  background: var(--r-surface);
  border-left-color: var(--r-accent);
}
.research-case-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.research-case-item small {
  display: block;
  margin-top: 6px;
  color: var(--r-muted);
  font-size: 11px;
}
.research-empty {
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--r-border);
  border-radius: 12px;
  background: var(--r-surface);
}
.research-empty p {
  color: var(--r-muted);
  line-height: 1.8;
  max-width: 500px;
  margin: 14px auto 22px;
}
.research-fields {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}
.research-fields label,
.research-dialog label {
  display: grid;
  gap: 8px;
  font-size: 12px;
  font-weight: 650;
}
.research-fields input,
.research-fields textarea,
.research-search input,
.research-dialog input {
  width: 100%;
  border: 1px solid var(--r-border, #d8dce6);
  background: var(--r-bg, #fff);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--r-text, inherit);
  font: inherit;
  box-shadow: none;
  min-width: 0;
}
.research-fields textarea {
  resize: vertical;
}
.research-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.research-search {
  display: flex;
  gap: 10px;
  margin: 8px 0 12px;
}
.research-search input {
  flex: 1;
}
.research-entities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.research-entities button[aria-pressed="true"] {
  border-color: var(--r-accent);
  color: var(--r-accent);
}
.research-list-head,
.research-evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 105px 65px;
  gap: 14px;
}
.research-list-head {
  margin-top: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--r-border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--r-muted);
}
.research-evidence-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--r-border);
  align-items: start;
}
.research-evidence-row strong {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.research-evidence-row p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--r-muted);
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.research-evidence-row small {
  font-size: 11px;
  color: var(--r-muted);
  display: block;
  line-height: 1.6;
}
.research-evidence-row a {
  color: var(--r-accent);
  font-size: 11px;
  text-decoration: underline;
}
.research-evidence-row time {
  font-size: 11px;
  line-height: 1.7;
  color: var(--r-muted);
}
.research-interpretation {
  padding: 18px 0 4px;
  color: var(--r-muted);
  font-size: 12px;
  line-height: 1.7;
}
.research-interpretation summary {
  font-weight: 600;
  cursor: pointer;
}
.research-interpretation p {
  margin-top: 12px;
}
.research-capture {
  border-top: 1px solid var(--r-border);
  padding: 14px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.research-capture strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.research-capture p {
  margin-top: 5px;
  font-size: 12px;
  color: var(--r-muted);
  overflow-wrap: anywhere;
}
.research-dialog {
  width: min(480px, calc(100% - 32px));
  border-radius: 14px;
  border: 1px solid #d8dce6;
  padding: 28px;
  color: #202938;
  background: #fff;
}
.research-dialog::backdrop {
  background: rgb(8 13 26 / 0.65);
}
.research-dialog p {
  margin: 14px 0 22px;
  line-height: 1.7;
  font-size: 13px;
}
.dark .research-dialog {
  background: #101625;
  color: #e8ecf4;
  border-color: #283247;
}
.dark .research-dialog input {
  background: #0b1020;
  color: #e8ecf4;
  border-color: #283247;
}
@media (max-width: 1000px) {
  .research-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }
  .research-panel {
    padding: 18px;
  }
  .research-sidebar {
    padding: 14px;
  }
  .research-case-list {
    margin: 16px -14px;
  }
  .research-list-head {
    display: none;
  }
  .research-evidence-row {
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 10px;
  }
  .research-evidence-row .research-evidence-summary {
    grid-column: 1/-1;
  }
  .research-evidence-row time {
    grid-column: 1;
    grid-row: 3;
  }
  .research-evidence-row > button {
    grid-column: 2;
    grid-row: 2/4;
  }
}
@media (max-width: 700px) {
  .research-shell {
    padding: 0 16px 48px;
  }
  .research-heading {
    display: block;
    padding-top: 26px;
  }
  .research-heading > .research-badge {
    margin-top: 16px;
  }
  .research-layout {
    display: block;
  }
  .research-case-list {
    max-height: 240px;
    overflow-y: auto;
  }
  .research-heading h1 {
    max-width: 340px;
  }
  .research-panel-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .research-search {
    flex-wrap: wrap;
  }
  .research-search input {
    flex-basis: 100%;
  }
  .research-search button {
    width: 100%;
  }
  .research-empty {
    padding: 40px 20px;
  }
  .research-subnav {
    gap: 18px;
    font-size: 12px;
  }
  .research-actions .research-button {
    flex: 1;
  }
  .research-capture > div {
    min-width: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .research-shell * {
    scroll-behavior: auto !important;
  }
}

#capture-list > section + section {
  border-top: 1px solid var(--r-border);
  margin-top: 20px;
  padding-top: 20px;
}
#capture-list h3 {
  font-size: 13px;
  font-weight: 700;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
/* Dialogs live outside the main shell and need the same local design tokens. */
.research-dialog {
  --r-bg: #fff;
  --r-border: #e2e5ed;
  --r-text: #202938;
  --r-accent: #5140e8;
}
.dark .research-dialog {
  --r-bg: #101625;
  --r-border: #283247;
  --r-text: #e8ecf4;
  --r-accent: #a99cff;
}
.research-case-list {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 700px) {
  .research-case-list {
    max-height: 240px;
  }
}

.research-connections {
  border-top: 1px solid var(--r-border);
  margin-top: 24px;
  padding-top: 24px;
}
.research-connections h3 {
  font-size: 15px;
  font-weight: 700;
}
.research-connection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--r-border);
}
.research-connection-row strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.research-connection-row details {
  font-size: 11px;
  color: var(--r-muted);
  margin-top: 10px;
  cursor: pointer;
}
.research-connection-row a {
  color: var(--r-accent);
  font-size: 11px;
  text-decoration: underline;
}
@media (max-width: 700px) {
  .research-connection-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}
