:root {
  --navy: var(--ur-navy, #001e5f);
  --navy-2: var(--ur-meliora-blue, #021bc3);
  --blue: var(--ur-arpeggio-azure, #0066fd);
  --blue-dark: var(--ur-meliora-blue, #021bc3);
  --blue-soft: rgb(183 211 255 / 34%);
  --gold: var(--ur-dandelion-yellow, #ffd82b);
  --ink: var(--ur-navy, #001e5f);
  --muted: var(--ur-charcoal, #707070);
  --line: var(--ur-silver, #e8e8e8);
  --line-strong: var(--ur-groundboi-gray, #bebebe);
  --surface: #ffffff;
  --surface-alt: #f7f8fb;
  --page: #f3f6fb;
  --success: #16845b;
  --warning: #9a5a00;
  --warning-bg: #fff7e6;
  --danger: #aa2e3b;
  --danger-bg: #fff1f2;
  --shadow: 0 14px 35px rgba(0, 30, 95, .09);
  --radius: 14px;
  color-scheme: light;
  font-family: InterVariable, Inter, Aptos, "Segoe UI", sans-serif;
  font-feature-settings: "liga" 1, "calt" 1;
  font-optical-sizing: auto;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

html.instant-scroll {
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

a {
  color: var(--blue-dark);
}

.hidden {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 64px);
  color: white;
  background: rgba(18, 38, 63, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: white;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 900;
  background: var(--gold);
  border-radius: 10px 4px 10px 4px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.02rem;
  letter-spacing: .01em;
}

.brand small {
  margin-top: 1px;
  color: #c9d6e5;
  font-size: .72rem;
}

.catalog-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: #dce8f5;
  font-size: .79rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
}

.catalog-pill-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  line-height: 1.15;
}

.catalog-pill-copy strong,
.catalog-pill-copy small {
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.catalog-pill-copy small::before {
  content: "· ";
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #73d6ac;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(115, 214, 172, .13);
  flex: none;
}

.catalog-pill.stale .status-dot {
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 216, 43, .14);
}

main {
  min-height: calc(100vh - 170px);
}

.hero {
  position: relative;
  padding: 58px clamp(18px, 6vw, 98px) 46px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 80% 10%, rgba(0, 102, 253, .45), transparent 30%),
    linear-gradient(135deg, #001e5f 0%, #012a85 62%, #021bc3 100%);
}

.hero::after {
  position: absolute;
  right: -80px;
  bottom: -150px;
  width: 430px;
  height: 430px;
  content: "";
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(255, 255, 255, .025),
    0 0 0 90px rgba(255, 255, 255, .02);
}

.hero-copy,
.discovery-grid {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin-right: auto;
  margin-left: auto;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--ur-wondrous-sky, #b7d3ff);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 13px;
  font-size: clamp(2.15rem, 5vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.lede {
  max-width: 760px;
  margin-bottom: 28px;
  color: #d9e5f1;
  font-size: clamp(1rem, 2vw, 1.23rem);
}

.discovery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
  gap: 18px;
  align-items: stretch;
}

.discovery-card {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
}

.search-discovery {
  background: rgba(8, 28, 52, .4);
  box-shadow: 0 18px 48px rgba(5, 18, 36, .18);
}

.ai-discovery {
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(5, 18, 36, .22);
}

.discovery-heading {
  margin-bottom: 15px;
}

.discovery-heading h2,
.ai-discovery h2 {
  margin-bottom: 4px;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.discovery-heading p:last-child {
  margin-bottom: 0;
  color: #d5e2ef;
  font-size: .84rem;
}

.ai-discovery .eyebrow {
  color: var(--blue);
}

.ai-discovery .panel-copy {
  color: #53647a;
}

.search-form {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  padding: 7px;
  background: white;
  border: 2px solid transparent;
  border-radius: 15px;
  box-shadow: 0 20px 55px rgba(5, 18, 36, .3);
}

.search-form:focus-within {
  border-color: #72a8f4;
  box-shadow: 0 0 0 4px rgba(114, 168, 244, .18), 0 20px 55px rgba(5, 18, 36, .3);
}

.search-form svg {
  width: 21px;
  margin-left: 8px;
  fill: none;
  stroke: #6b7b91;
  stroke-linecap: round;
  stroke-width: 2;
}

.search-form input {
  width: 100%;
  min-height: 49px;
  padding: 8px 12px;
  color: var(--ink);
  caret-color: var(--ink);
  font-size: 1.05rem;
  background: transparent;
  border: 0;
  outline: 0;
}

.search-form input::placeholder {
  color: #6b778a;
  opacity: 1;
}

.button {
  min-height: 42px;
  padding: 9px 15px;
  font-weight: 800;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.button.primary {
  color: white;
  background: var(--blue);
}

.button.primary:hover:not(:disabled) {
  background: var(--blue-dark);
}

.button.secondary {
  color: var(--navy);
  background: white;
  border-color: var(--line-strong);
}

.button.secondary:hover:not(:disabled) {
  border-color: #8ca0b9;
}

.team-ready-filter[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--blue-dark);
  color: white;
  box-shadow: inset 0 0 0 2px white, 0 0 0 2px var(--blue-dark);
  font-weight: 800;
}

.search-button {
  min-height: 49px;
  padding-inline: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 270px) minmax(480px, 1fr) minmax(285px, 345px);
  grid-template-areas: "filters results assistant";
  gap: 18px;
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 22px clamp(12px, 2vw, 30px) 56px;
  align-items: start;
}

.filter-panel,
.results-column,
.ai-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-panel,
.ai-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

.filter-panel {
  grid-area: filters;
  padding-bottom: 10px;
}

.panel-heading,
.results-toolbar,
.ai-heading,
.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  padding: 18px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2,
.ai-heading h2 {
  margin: 0;
  color: var(--navy);
  line-height: 1.15;
}

.panel-heading h2 {
  font-size: 1.25rem;
}

.text-button {
  padding: 3px;
  color: var(--blue-dark);
  font-size: .82rem;
  font-weight: 800;
  background: transparent;
  border: 0;
}

.text-button:hover {
  text-decoration: underline;
}

.status-filter {
  margin: 0;
  /* Match the 14px vertical rhythm and 18px inset of the .facet summary headers
     below, so the header row lines up as you scan down the panel. */
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.status-filter legend {
  /* padding:0 removes the legend's default left offset so the text sits on the
     same 18px edge as the facet headers; font-size matches .facet summary. */
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: 10px;
  color: var(--navy);
  font-size: .82rem;
  font-weight: 850;
}

.status-filter label,
.facet-option,
.switch-list label {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 5px 0;
  color: #3c4b61;
  font-size: .82rem;
}

.status-filter input,
.facet-option input,
.switch-list input {
  width: 15px;
  height: 15px;
  margin: 3px 0 0;
  accent-color: var(--blue);
}

.status-filter strong,
.facet-option strong {
  color: #8a97a8;
  font-size: .72rem;
}

.facet {
  border-bottom: 1px solid var(--line);
}

.facet:last-child {
  border-bottom: 0;
}

.facet summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  color: var(--navy);
  font-size: .82rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}

.facet summary::-webkit-details-marker {
  display: none;
}

.facet summary::after {
  color: #7b899b;
  content: "＋";
  font-size: 1rem;
}

.facet[open] summary::after {
  content: "−";
}

.selection-count {
  min-width: 20px;
  margin-left: auto;
  color: var(--blue);
  font-size: .72rem;
  text-align: right;
}

.facet-list {
  max-height: 255px;
  padding: 0 18px 13px;
  overflow-y: auto;
}

.facet-option {
  cursor: pointer;
}

.facet-option:hover span {
  color: var(--blue-dark);
}

.facet-search {
  display: block;
  padding: 0 18px 10px;
}

.facet-search input,
.range-grid input,
.number-field input,
.stacked-field textarea,
.profile-fields input,
.profile-fields select,
.provider-fields input,
.provider-fields select,
.toolbar-controls select,
.chat-form textarea {
  width: 100%;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
}

.facet-search input {
  padding: 7px 9px;
  font-size: .79rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 3px rgba(31, 100, 213, .12);
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 0 18px 10px;
}

.range-grid label,
.number-field {
  color: #546278;
  font-size: .75rem;
  font-weight: 750;
}

.range-grid input,
.number-field input {
  display: block;
  margin-top: 4px;
  padding: 7px 8px;
  font-size: .78rem;
}

.number-field {
  position: relative;
  display: block;
  padding: 0 18px 15px;
}

.number-field input {
  padding-left: 23px;
}

.input-prefix {
  position: absolute;
  bottom: 22px;
  left: 26px;
  color: #738196;
  font-weight: 500;
}

.switch-list {
  padding: 0 18px 14px;
}

.switch-list label {
  grid-template-columns: 17px minmax(0, 1fr);
}

.results-column {
  grid-area: results;
  min-width: 0;
  padding: 22px;
}

.results-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: flex-end;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.toolbar-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

.toolbar-actions .button {
  width: 100%;
  min-height: 44px;
}

.results-chat-launch {
  white-space: nowrap;
}

.toolbar-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.toolbar-controls label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
}

.toolbar-controls label span {
  display: block;
  margin-bottom: 3px;
}

.toolbar-controls select {
  min-width: 155px;
  min-height: 42px;
  padding: 8px 28px 8px 10px;
  font-size: .8rem;
  font-weight: 700;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 14px 0 5px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  color: var(--navy);
  font-size: .74rem;
  font-weight: 750;
  background: var(--blue-soft);
  border: 1px solid #c9dcfb;
  border-radius: 999px;
}

.filter-chip span {
  color: var(--blue-dark);
  font-size: .95rem;
  line-height: 1;
}

.filter-chip.profile-chip {
  color: #0d6545;
  background: #e4f6ee;
  border-color: #b8e3d1;
}

.notice {
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 9px;
}

.notice.warning {
  margin-top: 12px;
  color: var(--warning);
  background: var(--warning-bg);
  border-color: #f2d59d;
  font-size: .82rem;
}

.notice.error {
  width: min(1200px, calc(100% - 36px));
  margin: 18px auto;
  color: var(--danger);
  background: var(--danger-bg);
  border-color: #efbcc2;
}

#catalog-error:not(.hidden) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

#catalog-error .button {
  flex: 0 0 auto;
}

.potential-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #cbd9e8;
  border-radius: 9px;
  color: var(--ink-muted);
  background: #f5f8fb;
  font-size: .86rem;
  line-height: 1.45;
}

.potential-status.is-warning {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: #f2d59d;
}

.potential-status .text-button {
  flex: 0 0 auto;
}

.result-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-top: 20px;
}

.result-tier {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.result-tier + .result-tier {
  margin-top: 10px;
  padding-top: 28px;
  border-top: 2px solid #d8e1eb;
}

.result-tier-heading {
  padding: 14px 16px;
  background: #f3f7fb;
  border: 1px solid #cfdae6;
  border-radius: 12px;
}

.result-tier-potential .result-tier-heading {
  background: #fbf8ef;
  border-color: #e4d8b8;
}

.result-tier-heading h3,
.result-tier-heading p {
  margin: 0;
}

.result-tier-heading h3 {
  color: var(--navy);
  font-size: 1.03rem;
}

.result-tier-heading h3 span {
  display: inline-flex;
  min-width: 1.6rem;
  justify-content: center;
  margin-left: 5px;
  padding: 1px 6px;
  color: #48617d;
  background: white;
  border: 1px solid #cfdae6;
  border-radius: 999px;
  font-size: .72rem;
}

.result-tier-heading p {
  margin-top: 5px;
  color: #526177;
  font-size: .78rem;
  line-height: 1.5;
}

.result-tier-empty {
  padding: 14px 16px;
  color: #526177;
  background: #f7f9fc;
  border: 1px solid #d8e1eb;
  border-radius: 12px;
}

.result-tier-empty h3,
.result-tier-empty p {
  margin: 0;
}

.result-tier-empty h3 {
  color: var(--navy);
  font-size: 1rem;
}

.result-tier-empty p {
  margin-top: 4px;
  font-size: .78rem;
}

.result-card {
  position: relative;
  min-width: 0;
  padding: 18px 20px 20px;
  background: white;
  border: 1px solid #bdcad9;
  border-top: 4px solid #54779e;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(18, 38, 63, .08);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.result-card:nth-child(even) {
  background: #fbfcfe;
}

.result-card:hover {
  border-color: #809ab7;
  box-shadow: 0 10px 26px rgba(18, 38, 63, .12);
}

.result-card.ai-match {
  border-left: 4px solid var(--blue);
}

.result-card.potential-match {
  border-top-color: #b18a35;
}

.card-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.result-position {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  color: #264b72;
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
  background: #e5edf6;
  border: 1px solid #c4d3e3;
  border-radius: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  color: #31506f;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: #edf2f7;
  border-radius: 999px;
}

.badge.open {
  color: #0d6545;
  background: #e4f6ee;
}

.badge.forecasted {
  color: #7a4c00;
  background: #fff2d7;
}

.badge.archived {
  color: #5d477e;
  background: #f1eafb;
}

.opportunity-team-trigger {
  border-color: #1f5a47;
  color: #174738;
  font-weight: 750;
}

.opportunity-team-panel {
  margin-top: 18px;
  padding: clamp(16px, 2.5vw, 24px);
  border: 2px solid #2d6a56;
  border-radius: 14px;
  background: #f5fbf8;
  box-shadow: 0 12px 28px rgba(12, 53, 42, .12);
}

.opportunity-team-heading,
.opportunity-team-member-title,
.opportunity-team-status,
.opportunity-team-next {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.opportunity-team-heading h4,
.opportunity-team-member h5,
.opportunity-team-roles h5,
.opportunity-team-gaps h5,
.opportunity-team-scope {
  margin: 0;
}

.opportunity-team-close,
.opportunity-team-remove {
  border: 1px solid #7d9a90;
  border-radius: 8px;
  background: #fff;
  color: #173b31;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  padding: 7px 10px;
}

.opportunity-team-body > * + * {
  margin-top: 14px;
}

.opportunity-team-status {
  align-items: center;
  color: #405b53;
  font-size: .86rem;
}

.opportunity-team-why {
  border-left: 4px solid #2d6a56;
  padding: 10px 13px;
  background: #e8f4ee;
}

.opportunity-team-why p {
  margin: 5px 0 0;
}

.opportunity-team-members {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.opportunity-team-member {
  padding: 14px;
  border: 1px solid #bad2c9;
  border-radius: 11px;
  background: #fff;
}

.opportunity-team-member p {
  margin: 7px 0 0;
  font-size: .88rem;
}

.opportunity-team-member-title > div > p {
  color: #526a62;
  margin-top: 3px;
}

.opportunity-team-source {
  color: #526a62;
  font-size: .78rem !important;
}

.opportunity-team-roles ul,
.opportunity-team-gaps ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.opportunity-team-role {
  padding: 11px 0;
  border-top: 1px solid #c9ddd5;
}

.opportunity-team-role > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.opportunity-team-role p {
  margin: 5px 0;
  font-size: .86rem;
}

.opportunity-team-role-state {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  background: #dcefe6;
  color: #174738;
  font-size: .72rem;
  font-weight: 800;
}

.opportunity-team-role.missing .opportunity-team-role-state {
  background: #fff0d4;
  color: #764b00;
}

.opportunity-team-gaps {
  padding: 13px;
  border: 1px solid #dfbd74;
  border-radius: 10px;
  background: #fff9eb;
}

.opportunity-team-gaps li {
  margin-top: 6px;
  padding-left: 18px;
  position: relative;
}

.opportunity-team-gaps li::before {
  content: "!";
  position: absolute;
  left: 0;
  color: #8b5b00;
  font-weight: 900;
}

.opportunity-team-replacement {
  padding: 13px;
  border-radius: 10px;
  background: #edf4fb;
}

.opportunity-team-replacement label {
  display: block;
  margin-bottom: 7px;
  font-weight: 750;
}

.opportunity-team-replacement > div {
  display: flex;
  gap: 8px;
}

.opportunity-team-replacement select {
  min-width: 0;
  flex: 1 1 auto;
  padding: 8px;
}

.opportunity-team-replacement button,
.opportunity-team-scope-options button {
  border: 1px solid #315f84;
  border-radius: 8px;
  background: #fff;
  color: #16476d;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 8px 11px;
}

.opportunity-team-scope-options {
  display: grid;
  gap: 8px;
}

.opportunity-team-scope-options button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.opportunity-team-scope-options span {
  margin-top: 3px;
  color: #536b78;
  font-size: .78rem;
  text-transform: capitalize;
}

.opportunity-team-scope-options button[aria-pressed="true"] {
  border-color: var(--ur-meliora-blue, #021bc3);
  box-shadow: inset 0 0 0 1px var(--ur-meliora-blue, #021bc3);
  background: #edf3ff;
}

.opportunity-team-next {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.opportunity-team-caveat,
.opportunity-team-no-replacement {
  color: #516860;
  font-size: .82rem;
}

@media (max-width: 700px) {
  .opportunity-team-members {
    grid-template-columns: 1fr;
  }

  .opportunity-team-heading,
  .opportunity-team-status,
  .opportunity-team-role > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .opportunity-team-replacement > div {
    flex-direction: column;
  }

  .opportunity-team-replacement button,
  .opportunity-team-next a {
    width: 100%;
    text-align: center;
  }
}

.badge.warning {
  color: #8b4d00;
  background: #fff0df;
}

.badge.broad {
  color: #76510d;
  background: #fff6d9;
  border: 1px solid #ead7a4;
}

.badge.potential {
  color: #76510d;
  background: #fff6d9;
  border: 1px solid #ead7a4;
}

.badge.ai {
  color: #021bc3;
  background: #e5efff;
}

.badge.candidate {
  color: #5d477e;
  background: #f1eafb;
}

.opportunity-number {
  color: #586a82;
  font-size: .72rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.listed-date {
  color: #315b8d;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
}

.result-card h3 {
  margin-bottom: 6px;
  color: var(--navy);
  font-size: clamp(1.05rem, 2vw, 1.24rem);
  line-height: 1.28;
}

.result-card h3 a {
  color: inherit;
  text-decoration: none;
}

.result-card h3 a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

.agency {
  padding-bottom: 10px;
  margin-bottom: 10px;
  color: #516178;
  font-size: .84rem;
  font-weight: 700;
  border-bottom: 1px solid #dfe6ee;
}

.card-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.amendment-notice {
  display: grid;
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
  gap: 10px 16px;
  align-items: start;
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #664216;
  background: #fff8e8;
  border: 1px solid #e8cb8f;
  border-left: 4px solid #c78418;
  border-radius: 8px;
}

.amendment-heading {
  display: grid;
  gap: 2px;
}

.amendment-heading span {
  color: #8b4d00;
  font-size: .69rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.amendment-heading time {
  color: #5e4829;
  font-size: .74rem;
  font-weight: 800;
}

.amendment-notice p {
  margin: 0;
  font-size: .75rem;
  line-height: 1.42;
}

.key-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 9px;
}

.key-fact {
  padding: 9px 10px;
  background: var(--surface-alt);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.key-fact span,
.detail-grid dt {
  display: block;
  margin-bottom: 2px;
  color: #586a82;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.key-fact strong {
  display: block;
  color: #29384e;
  font-size: .79rem;
  line-height: 1.3;
}

.key-fact a {
  color: var(--blue-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.key-fact small {
  display: block;
  margin-top: 4px;
  color: #586a82;
  font-size: .68rem;
  line-height: 1.3;
}

.document-evidence {
  margin-bottom: 16px;
  padding: 14px;
  background: #f3faf7;
  border: 1px solid #c6e1d4;
  border-radius: 10px;
}

.document-evidence-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-evidence-heading h4 {
  margin: 1px 0 0;
  color: #183f32;
  font-size: 1rem;
}

.document-evidence-heading > span {
  color: #5c756b;
  font-size: .67rem;
  white-space: nowrap;
}

.evidence-method,
.empty-evidence p {
  margin: 8px 0 11px;
  color: #526d63;
  font-size: .72rem;
}

.empty-evidence h4 {
  margin: 0;
  color: var(--navy);
}

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

.evidence-list li {
  padding: 10px;
  background: white;
  border: 1px solid #d7e8e0;
  border-radius: 8px;
}

.evidence-fact-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.evidence-fact-heading strong {
  color: #213f35;
  font-size: .75rem;
}

.evidence-fact-heading span {
  color: #365e50;
  font-size: .7rem;
  font-weight: 800;
  text-align: right;
}

.evidence-list blockquote {
  margin: 6px 0;
  color: #53695f;
  font-size: .69rem;
  font-style: normal;
}

.evidence-citation {
  display: inline-flex;
  margin-top: 2px;
  color: #176247;
  font-size: .68rem;
  font-weight: 850;
}

.inline-citation {
  display: block;
}

.deadline-note {
  display: block;
  margin-top: 4px;
  color: #667588;
  line-height: 1.4;
}

.page-field-provenance {
  margin-top: 14px;
  padding: 11px 12px;
  color: #445d55;
  background: #f3faf7;
  border: 1px solid #c6e1d4;
  border-radius: 9px;
}

.page-field-provenance summary {
  color: #183f32;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}

.page-field-provenance > p {
  margin: 8px 0;
  font-size: .7rem;
}

.page-field-provenance ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.page-field-provenance li {
  min-width: 0;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid #d7e8e0;
  border-radius: 8px;
}

.page-field-provenance li > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
}

.page-field-provenance strong,
.page-field-provenance span,
.page-field-provenance a {
  overflow-wrap: anywhere;
  font-size: .68rem;
}

.page-field-provenance span {
  color: #5c756b;
}

.page-field-provenance blockquote {
  margin: 6px 0;
  color: #53695f;
  font-size: .69rem;
}

.page-field-provenance a {
  color: #176247;
  font-weight: 800;
}

.review-queue {
  margin-top: 10px;
  padding: 9px 10px;
  color: #704a12;
  font-size: .7rem;
  background: var(--warning-bg);
  border-radius: 8px;
}

.review-queue ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.ai-rationale {
  margin: 12px 0;
  padding: 12px 13px;
  color: #29415f;
  font-size: .84rem;
  background: var(--blue-soft);
  border-radius: 9px;
}

.ai-rationale strong {
  color: var(--blue-dark);
}

.ai-concern {
  display: block;
  margin-top: 5px;
  color: #76501a;
}

.description {
  margin-bottom: 11px;
  color: #4e5d72;
  font-size: .84rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 11px;
}

.tag {
  padding: 3px 7px;
  color: #4d5e73;
  font-size: .68rem;
  font-weight: 700;
  background: #f1f4f7;
  border: 1px solid #e3e8ee;
  border-radius: 5px;
}

.record-details {
  margin-top: 12px;
  padding: 13px 15px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.record-details summary {
  display: block;
  width: auto;
  list-style: none;
  cursor: pointer;
}

.record-details summary::-webkit-details-marker {
  display: none;
}

.record-details .description-preview {
  display: block;
  margin-bottom: 8px;
  color: #4e5d72;
  font-size: .84rem;
  font-weight: 400;
}

.record-details .details-cue {
  display: inline-block;
  color: var(--blue-dark);
  font-size: .79rem;
  font-weight: 800;
}

.record-details .details-cue::before {
  content: "▾ ";
}

.record-details[open] .details-cue::before {
  content: "▴ ";
}

.record-details[open] .description-preview {
  display: none;
}

.record-details .cue-less {
  display: none;
}

.record-details[open] .cue-more {
  display: none;
}

.record-details[open] .cue-less {
  display: inline;
}

.evaluation-tools .sa-close {
  display: none;
}

.evaluation-tools[open] .sa-open {
  display: none;
}

.evaluation-tools[open] .sa-close {
  display: inline;
}

.details-body {
  padding-top: 14px;
}

.scope-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #65501e;
  font-size: .8rem;
  line-height: 1.45;
  background: #fffaf0;
  border-left: 3px solid #d3a83f;
  border-radius: 6px;
}

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

.detail-grid dd {
  margin: 0;
  color: #3e4d62;
  font-size: .8rem;
}

.full-description {
  margin-bottom: 14px;
  color: #445368;
  font-size: .8rem;
  line-height: 1.58;
}

.full-description p {
  margin: 0 0 13px;
}

.full-description ul {
  margin: 0 0 15px;
  padding-left: 22px;
}

.full-description li {
  padding-left: 3px;
}

.full-description li + li {
  margin-top: 7px;
}

.full-description > :last-child {
  margin-bottom: 0;
}

.source-action {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  color: var(--blue-dark);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
  text-align: center;
  white-space: normal;
  background: white;
  border: 1px solid #b9c9dc;
  border-radius: 7px;
}

.source-action:hover {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.source-action.selected {
  color: #0d6545;
  background: #e4f6ee;
  border-color: #8ac7ae;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.source-action.primary {
  color: white;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.source-action.primary:hover {
  color: white;
  background: #123f83;
}

.source-action-note {
  margin: 0 0 13px;
  padding: 9px 10px;
  color: #68778b;
  font-size: .7rem;
  line-height: 1.35;
  background: var(--surface-alt);
  border-radius: 7px;
}

.result-feedback-toggle {
  margin-top: 8px;
}

.matched-topics {
  margin: 10px 0;
  padding: 10px 12px;
  background: #f4f8fd;
  border: 1px solid #d5e2f0;
  border-radius: 9px;
}

.matched-topics .eyebrow {
  margin: 0 0 5px;
}

.matched-topics ul,
.match-explanation ul {
  margin: 0;
  padding-left: 18px;
}

.matched-topics li {
  margin: 3px 0;
  color: #344d69;
  font-size: .76rem;
}

.matched-topics li span {
  margin-left: 7px;
  color: var(--muted);
  font-size: .68rem;
}

.matched-topics details {
  margin-top: 5px;
}

.matched-topics summary,
.match-explanation > summary {
  width: max-content;
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

.match-explanation-v2 > summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
}

.match-explanation-tier {
  padding: 2px 6px;
  border: 1px solid #c9d9ea;
  border-radius: 999px;
  background: #f4f8fd;
  color: #526177;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.2;
}

.match-explanation {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.match-explanation ul {
  margin-top: 7px;
  color: #526177;
  font-size: .74rem;
}

.result-feedback-toggle > summary {
  width: max-content;
  color: #637287;
  font-size: .72rem;
  font-weight: 750;
  cursor: pointer;
}

.result-feedback-toggle[open] > summary {
  color: var(--blue-dark);
}

.result-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto);
  gap: 8px 12px;
  align-items: center;
  margin-top: 8px;
  padding: 11px 12px;
  color: #526177;
  font-size: .72rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.result-feedback > span {
  color: var(--navy);
  font-weight: 800;
}

.feedback-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-button {
  min-height: 32px;
  padding: 5px 9px;
  color: #42546b;
  font-size: .7rem;
  font-weight: 750;
  background: white;
  border: 1px solid #c9d3df;
  border-radius: 7px;
}

.feedback-button:hover,
.feedback-button.selected {
  color: white;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.result-feedback select {
  width: 100%;
  min-height: 32px;
  padding: 5px 24px 5px 8px;
  color: var(--ink);
  font-size: .7rem;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.result-feedback select:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.source-review {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: end;
  margin-top: 12px;
  padding: 11px 12px;
  background: #f3faf7;
  border: 1px solid #c6e1d4;
  border-radius: 9px;
}

.source-review-heading {
  grid-column: 1 / -1;
}

.source-review-heading strong,
.source-review-heading span {
  display: block;
}

.source-review-heading strong {
  color: #214b3c;
  font-size: .74rem;
}

.source-review-heading span {
  color: #667c73;
  font-size: .65rem;
}

.source-review label {
  min-width: 0;
  color: #50675d;
  font-size: .65rem;
  font-weight: 800;
}

.source-review select,
.source-review input {
  display: block;
  width: 100%;
  min-height: 34px;
  margin-top: 4px;
  padding: 6px 8px;
  color: var(--ink);
  font-size: .7rem;
  background: white;
  border: 1px solid #bcd2c8;
  border-radius: 7px;
}

.source-review select:disabled,
.source-review input:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.source-review-note {
  grid-column: 1 / -1;
}

.empty-state {
  padding: 54px 24px;
  text-align: center;
  background: var(--surface-alt);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.empty-state h3 {
  margin-bottom: 7px;
  color: var(--navy);
}

.empty-state p {
  max-width: 520px;
  margin: 0 auto 16px;
  color: var(--muted);
}

.pagination {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: max-content;
  max-width: 100%;
  padding: 15px 16px;
  margin: 28px auto 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: 0 5px 16px rgba(18, 38, 63, .07);
}

.pagination-main {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
}

.pagination .page-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  text-align: center;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.page-number {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  padding: 6px;
  place-items: center;
  color: var(--blue-dark);
  font-size: .78rem;
  font-weight: 850;
  background: var(--surface);
  border: 1px solid #b8c8da;
  border-radius: 8px;
}

.page-number:hover {
  color: var(--blue-dark);
  background: var(--blue-soft);
  border-color: var(--blue);
}

.page-number[aria-current="page"] {
  color: white;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: 0 3px 9px rgba(23, 76, 164, .22);
}

.pagination-ellipsis {
  min-width: 18px;
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.page-step {
  white-space: nowrap;
}

.ai-panel {
  grid-area: assistant;
  padding: 20px;
}

.ai-heading {
  justify-content: flex-start;
}

.ai-heading h2 {
  font-size: 1.2rem;
}

.spark {
  display: grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #133f87;
  background: linear-gradient(145deg, #e5efff, #c7dcff);
  border-radius: 10px;
}

.panel-copy {
  margin: 13px 0 15px;
  color: var(--muted);
  font-size: .82rem;
}

.stacked-field {
  display: block;
  color: #3d4d62;
  font-size: .78rem;
  font-weight: 800;
}

.stacked-field textarea {
  display: block;
  min-height: 140px;
  margin-top: 6px;
  padding: 11px;
  resize: vertical;
  font-size: .83rem;
  font-weight: 450;
  line-height: 1.45;
}

.profile-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .9fr);
  gap: 9px;
  margin-top: 11px;
}

.profile-fields label {
  min-width: 0;
  color: #3d4d62;
  font-size: .72rem;
  font-weight: 800;
}

.profile-fields input,
.profile-fields select {
  display: block;
  min-height: 39px;
  margin-top: 5px;
  padding: 8px 9px;
  font-size: .75rem;
  font-weight: 500;
}

.orcid-importer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .9fr);
  gap: 7px 12px;
  align-items: center;
  margin-top: 11px;
  padding: 12px;
  background: #f2fbf7;
  border: 1px solid #bfe1d2;
  border-radius: 9px;
}

.orcid-importer strong,
.orcid-importer span {
  display: block;
}

.orcid-importer strong {
  color: var(--navy);
  font-size: .78rem;
}

.orcid-importer span,
.orcid-status {
  color: #62796f;
  font-size: .68rem;
}

.orcid-input-row {
  display: flex;
  gap: 7px;
  align-items: stretch;
}

.orcid-input-row input {
  min-width: 0;
  width: 100%;
  padding: 8px 9px;
  color: var(--ink);
  font: inherit;
  font-size: .75rem;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
}

.orcid-input-row .button {
  min-height: 39px;
  padding: 7px 10px;
  font-size: .72rem;
  white-space: nowrap;
}

.orcid-status,
.orcid-importer > .text-button {
  grid-column: 1 / -1;
}

.orcid-status.error {
  color: var(--danger);
}

.orcid-importer > .text-button {
  width: max-content;
}

.cv-uploader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  align-items: center;
  margin-top: 11px;
  padding: 11px;
  background: var(--surface-alt);
  border: 1px dashed #aebfd2;
  border-radius: 9px;
}

.cv-uploader strong,
.cv-uploader span {
  display: block;
}

.cv-uploader strong {
  color: var(--navy);
  font-size: .78rem;
}

.cv-uploader span,
.cv-status {
  color: #6b798d;
  font-size: .68rem;
}

.cv-input {
  width: min(100%, 210px);
  min-height: 36px;
  padding: 4px;
  color: #4f5f74;
  font-size: .7rem;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.cv-input::file-selector-button {
  min-height: 28px;
  margin-right: 7px;
  padding: 4px 8px;
  color: var(--navy);
  font-weight: 800;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
}

.cv-status,
.cv-uploader .text-button {
  grid-column: 1 / -1;
}

.cv-uploader .text-button {
  width: max-content;
}

.profile-options {
  display: grid;
  gap: 6px;
  margin-top: 11px;
}

.profile-options label {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #526177;
  font-size: .7rem;
}

.profile-options input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--blue);
}

.profile-storage-note {
  margin: 7px 0 0;
  color: #758296;
  font-size: .66rem;
  line-height: 1.4;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 11px;
}

.profile-actions .button {
  min-height: 38px;
  font-size: .75rem;
}

.profile-status,
.evaluation-status {
  min-height: 18px;
  margin-top: 7px;
  color: #4d6d5e;
  font-size: .69rem;
  line-height: 1.4;
}

.profile-status.error {
  color: var(--danger);
}

.provider-setup {
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.provider-setup summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}

.provider-setup summary span:last-child {
  color: var(--muted);
  font-size: .7rem;
}

.provider-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 0 11px 5px;
}

.provider-fields label {
  color: #536176;
  font-size: .72rem;
  font-weight: 750;
}

.provider-fields input,
.provider-fields select {
  display: block;
  margin-top: 4px;
  padding: 8px 9px;
  font-size: .78rem;
}

.provider-fields .text-button {
  width: max-content;
}

.privacy-note {
  color: #586a82;
  font-size: .69rem;
  line-height: 1.45;
}

.privacy-note {
  margin: 7px 11px 12px;
}

.save-button {
  margin-left: auto;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue-dark);
  background: var(--blue-soft, #eef4ff);
  border: 1px solid #bcd8ff;
  border-radius: 999px;
  cursor: pointer;
}

.save-button.saved {
  color: #8a5a00;
  background: #fff6e0;
  border-color: #f0d38a;
}

.saved-storage-status {
  margin: 0.65rem 0 0;
  font-weight: 700;
}

.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef1f5;
}

.saved-item small {
  display: block;
  color: #5c6773;
  font-weight: 400;
}

.saved-content { flex: 1; min-width: 0; }
.saved-item-actions { align-self: flex-start; }

.profile-search-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 12px 0 0;
  padding: 16px 18px;
  color: var(--ink);
  border: 1px solid #c9d9ee;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f9ff, #fffdf3);
}

.profile-search-alert .eyebrow {
  margin-bottom: 3px;
}

.profile-search-alert h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-search-alert p:not(.eyebrow) {
  max-width: 850px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.profile-search-alert .profile-search-alert-privacy {
  color: #314f72;
}

.profile-search-alert-actions {
  display: grid;
  gap: 7px;
  min-width: min(100%, 260px);
  justify-items: stretch;
}

.profile-search-alert-actions .button {
  white-space: normal;
}

.profile-search-alert-actions .text-button {
  justify-self: center;
}

.profile-search-alert-actions #profile-search-alert-status {
  margin: 0;
  font-size: .7rem;
  text-align: center;
}

@media (max-width: 560px) {
  .saved-item { align-items: stretch; flex-direction: column; }
  .profile-search-alert { grid-template-columns: minmax(0, 1fr); }
  .profile-search-alert-actions { width: 100%; }
}

.ai-button {
  width: 100%;
  margin-top: 13px;
  color: white;
  background: linear-gradient(135deg, #021bc3, #2673df);
}

.ai-status {
  margin-top: 12px;
  padding: 10px;
  color: #24486f;
  font-size: .77rem;
  background: var(--blue-soft);
  border-radius: 8px;
}

.ai-status.error {
  color: var(--danger);
  background: var(--danger-bg);
}

.evaluation-panel {
  margin-top: 15px;
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.evaluation-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.evaluation-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: .96rem;
}

.evaluation-heading > strong {
  color: var(--blue-dark);
  font-size: .69rem;
  white-space: nowrap;
}

.evaluation-panel > p {
  margin: 8px 0;
  color: #657388;
  font-size: .7rem;
}

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

.evaluation-metrics div {
  padding: 7px 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.evaluation-metrics strong,
.evaluation-metrics span {
  display: block;
}

.evaluation-metrics strong {
  color: var(--navy);
  font-size: .86rem;
}

.evaluation-metrics span {
  color: #728096;
  font-size: .62rem;
}

.evaluation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  align-items: center;
  margin-top: 9px;
}

.evaluation-actions .button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: .69rem;
}

.deployment-review-panel {
  background: #f3faf7;
  border-color: #c6e1d4;
}

.review-field {
  display: block;
  margin-top: 9px;
  color: #425b51;
  font-size: .68rem;
  font-weight: 800;
}

.review-field > span {
  color: #73857e;
  font-weight: 600;
}

.review-field input,
.review-field textarea,
.deployment-checks select {
  display: block;
  width: 100%;
  min-height: 35px;
  margin-top: 4px;
  padding: 7px 8px;
  color: var(--ink);
  font-size: .7rem;
  font-weight: 500;
  background: white;
  border: 1px solid #bcd2c8;
  border-radius: 7px;
}

.review-field textarea {
  resize: vertical;
}

.deployment-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.deployment-checks label {
  min-width: 0;
  color: #52675f;
  font-size: .64rem;
  font-weight: 800;
}

.review-privacy {
  margin-top: 9px !important;
  color: #667b73 !important;
  font-size: .64rem !important;
}

.chat {
  margin-top: 12px;
}

.chat-header h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.02rem;
}

.chat-summary {
  margin: 10px 0;
  color: #526177;
  font-size: .78rem;
}

.nofo-chat-context {
  margin: 10px 18px 12px;
  padding: 13px 14px;
  color: #344a64;
  background: #f4f8fd;
  border: 1px solid #cad9eb;
  border-radius: 10px;
}

.nofo-context-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.nofo-context-heading > div:first-child {
  min-width: 0;
}

.nofo-context-heading strong {
  overflow-wrap: anywhere;
}

.nofo-context-tools {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 10px;
}

.nofo-context-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .7rem;
}

.nofo-match-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: center;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #d8e3f0;
}

.nofo-match-record span,
.nofo-match-record small {
  display: block;
  color: var(--muted);
  font-size: .68rem;
}

.nofo-match-record strong {
  display: block;
  margin: 2px 0;
  color: var(--navy);
  font-size: .82rem;
}

.nofo-match-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 10px;
}

.nofo-match-actions > * {
  flex: none;
  white-space: nowrap;
}

.nofo-match-actions a {
  display: inline-flex;
  align-items: center;
  gap: .22em;
}

.nofo-match-actions a span {
  display: inline;
}

.nofo-reject-match {
  color: #8b3f37;
}



.suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.suggestion-list button {
  padding: 5px 7px;
  color: #315783;
  font-size: .68rem;
  font-weight: 700;
  text-align: left;
  background: #edf4ff;
  border: 1px solid #ccdcf4;
  border-radius: 6px;
}

.messages {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 330px;
  margin-bottom: 10px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}

.message {
  align-self: start;
  max-width: 92%;
  padding: 8px 10px;
  font-size: .76rem;
  overflow-wrap: anywhere;
  border-radius: 9px;
}

.message.user {
  justify-self: end;
  color: white;
  background: var(--blue);
  border-bottom-right-radius: 3px;
}

.message.assistant {
  justify-self: start;
  color: #32435a;
  background: var(--surface-alt);
  border-bottom-left-radius: 3px;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

.chat-copy-answer {
  padding: 3px 5px;
  font-size: .68rem;
}

.message-note {
  display: block;
  margin-top: 5px;
  color: #597493;
  font-size: .68rem;
  font-weight: 750;
}

.message-citations {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}

.message-citations a {
  color: #174f9b;
  font-size: .66rem;
  font-weight: 800;
}

.chat-form textarea {
  display: block;
  min-height: 72px;
  padding: 9px;
  resize: vertical;
  font-size: .78rem;
}

.chat-form .button {
  width: 100%;
  margin-top: 7px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 8px;
}

.chat-privacy {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

#reset-narrowing {
  margin-top: 0;
}

footer {
  padding: 24px clamp(18px, 6vw, 98px) 42px;
  color: #586a82;
  font-size: .76rem;
  text-align: center;
}

footer p {
  margin-bottom: 5px;
}

.legal-notice {
  max-width: 940px;
  margin: 18px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.legal-notice p {
  margin: 0 auto 7px;
  line-height: 1.55;
}

.copyright-notice {
  font-weight: 650;
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    grid-template-areas:
      "assistant assistant"
      "filters results";
  }

  .ai-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 960px) {
  .discovery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
  }

  .catalog-pill {
    max-width: 48%;
    font-size: .68rem;
  }

  .hero {
    padding-top: 42px;
  }

  .search-form {
    grid-template-columns: 25px minmax(0, 1fr);
  }

  .search-button {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 5px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "assistant"
      "filters"
      "results";
  }

  .filter-panel,
  .ai-panel {
    position: static;
    max-height: none;
  }

  .results-column {
    padding: 16px;
  }

  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    align-items: stretch;
  }

  .toolbar-controls label {
    flex: 1;
  }

  .toolbar-controls select {
    min-width: 0;
  }

  .profile-fields,
  .result-feedback,
  .source-review {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-feedback label {
    width: 100%;
  }

  .source-review-heading,
  .source-review-note {
    grid-column: 1;
  }

}

@media (max-width: 540px) {
  .site-header {
    padding-inline: 14px;
  }

  .brand small {
    display: none;
  }

  .catalog-pill {
    padding: 5px 8px;
  }

  .hero {
    padding: 34px 16px 32px;
  }

  .discovery-card {
    padding: 16px;
  }

  .detail-grid,
  .deployment-checks {
    grid-template-columns: 1fr;
  }

  .amendment-notice {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

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

  .key-fact:first-child {
    grid-column: 1 / -1;
  }

  .document-evidence-heading,
  .evidence-fact-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .evidence-fact-heading span {
    text-align: left;
  }

  .toolbar-actions {
    flex-direction: column;
  }

  .toolbar-actions .button {
    width: 100%;
  }

  .card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-actions .source-action.primary {
    grid-column: 1 / -1;
  }

  .source-action {
    width: 100%;
  }

  .pagination {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    gap: 12px;
    padding: 14px;
  }

  .pagination-main {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .page-step {
    grid-row: 2;
    width: 100%;
  }

  .page-number {
    min-width: 36px;
    min-height: 36px;
  }

  .cv-uploader {
    grid-template-columns: minmax(0, 1fr);
  }

  .orcid-importer {
    grid-template-columns: minmax(0, 1fr);
  }

  .orcid-input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .cv-input,
  .profile-actions .button {
    width: 100%;
  }

  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* Unified search workflow */
.hero-copy,
.workflow-map,
.search-workflow {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  margin-right: auto;
  margin-left: auto;
}

.workflow-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  margin-top: 28px;
  margin-bottom: 16px;
  list-style: none;
}

.workflow-map li {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 11px 13px;
  color: #dce9f7;
  background: rgba(7, 26, 49, .38);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
}

.workflow-map li > strong,
.step-number,
.empty-step-number {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--navy);
  font-size: .78rem;
  background: var(--gold);
  border-radius: 50%;
}

.workflow-map span,
.workflow-map b,
.workflow-map small {
  display: block;
  min-width: 0;
}

.workflow-map b {
  color: white;
  font-size: .83rem;
}

.workflow-map small {
  margin-top: 1px;
  color: #bcd0e5;
  font-size: .68rem;
}

.search-workflow {
  overflow: hidden;
  color: var(--ink);
  background: #f7f9fc;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 20px;
  box-shadow: 0 25px 65px rgba(5, 18, 36, .28);
}

.workflow-step {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.search-workflow .eyebrow {
  color: var(--blue-dark);
}

.workflow-step:last-child {
  border-bottom: 0;
}

.primary-step {
  background: white;
}

.context-step {
  background: #f7f9fc;
}

.launch-step {
  background: #eef5ff;
}

.step-heading {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.step-heading h2 {
  margin-bottom: 4px;
  color: var(--navy);
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}

.step-heading p:last-child {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: .83rem;
}

.optional-label {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  color: #315879;
  font-size: .6rem;
  letter-spacing: .04em;
  background: #deebf7;
  border-radius: 999px;
  vertical-align: 1px;
}

.search-workflow .search-form {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 4px 7px;
  border-color: var(--line-strong);
  box-shadow: none;
}

.search-workflow .search-form > * {
  min-width: 0;
  max-width: 100%;
}

.search-workflow .search-form:focus-within {
  box-shadow: 0 0 0 4px rgba(31, 100, 213, .12);
}

.nofo-drop-zone {
  position: relative;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.nofo-drop-zone.is-dragging {
  background: #edf5ff;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 100, 213, .16);
}

.nofo-drop-zone.is-dragging #query {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.nofo-upload-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 12px;
  color: var(--blue-dark);
  font-size: .72rem;
  line-height: 1.2;
  background: var(--blue-soft);
  border: 1px dashed #9ebce3;
  border-radius: 8px;
  cursor: pointer;
}

.nofo-upload-button > span:first-child {
  font-size: 1.25rem;
  line-height: 1;
}

.nofo-upload-button strong,
.nofo-upload-button small {
  display: block;
}

.nofo-upload-button small {
  margin-top: 2px;
  color: #586a82;
  font-size: .62rem;
  font-weight: 600;
}

.nofo-upload-button:hover {
  background: #dceaff;
  border-color: var(--blue);
}

.nofo-upload-status {
  margin-top: 7px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.4;
}

.nofo-upload-status:empty {
  display: none;
}

.nofo-upload-status.error {
  color: var(--danger);
}

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

.context-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 7px 20px rgba(18, 38, 63, .05);
}

.context-card > summary,
.evaluation-tools > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}

.context-card > summary::-webkit-details-marker,
.evaluation-tools > summary::-webkit-details-marker {
  display: none;
}

.context-card > summary span:first-child,
.context-card > summary strong,
.context-card > summary small,
.evaluation-tools > summary span:first-child,
.evaluation-tools > summary strong,
.evaluation-tools > summary small {
  display: block;
}

.context-card > summary strong,
.evaluation-tools > summary strong {
  font-size: .9rem;
}

.context-card > summary small,
.evaluation-tools > summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 500;
}

.summary-action {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--blue-dark);
  font-size: .68rem;
  font-weight: 800;
  background: var(--blue-soft);
  border-radius: 999px;
}

.context-card[open] > summary,
.evaluation-tools[open] > summary {
  border-bottom: 1px solid var(--line);
}

.context-card-body {
  padding: 16px;
}

.filter-panel {
  grid-area: auto;
  position: static;
  max-height: none;
  padding: 0;
  overflow: hidden;
  background: white;
  box-shadow: 0 7px 20px rgba(18, 38, 63, .05);
}

.filter-body {
  max-height: none;
  padding: 0;
  overflow: visible;
}

.filter-body .facet-list {
  max-height: none;
  overflow: visible;
}

.filter-body .panel-heading h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.05rem;
}

.launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  align-items: center;
}

.find-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 210px;
  min-height: 52px;
  padding-inline: 28px;
  font-size: 1rem;
}

.find-button-spinner {
  width: 17px;
  height: 17px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: find-button-spin .8s linear infinite;
}

@keyframes find-button-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .find-button-spinner {
    animation: none;
    border-color: rgba(255, 255, 255, .7);
  }
}

.launch-actions > span {
  color: var(--muted);
  font-size: .76rem;
}

.ai-refine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 12px;
}

.ai-refine-actions .ai-button {
  width: auto;
  margin-top: 0;
}

.ai-refine-actions #restore-ai-refinement {
  flex: none;
}

.ai-refine-requirement {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.search-status,
.credential-status {
  min-height: 20px;
  margin-top: 9px;
  color: #315879;
  font-size: .76rem;
  font-weight: 650;
}

.result-tier-counts {
  font-size: .9rem;
}

.search-status:empty {
  display: none;
}

.provider-setup {
  margin-top: 18px;
  background: white;
  border-color: #bfd0e5;
}

.provider-setup summary {
  align-items: center;
  padding: 14px 15px;
}

.provider-setup summary span:first-child strong,
.provider-setup summary span:first-child small {
  display: block;
}

.provider-setup summary span:first-child small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 500;
}

.provider-setup-body {
  padding: 0 15px 11px;
  border-top: 1px solid var(--line);
}

.key-help {
  margin: 10px 0;
  padding: 10px 12px;
  color: #425873;
  font-size: .74rem;
  background: var(--blue-soft);
  border: 1px solid #cbdcf5;
  border-radius: 8px;
}

.provider-fields {
  grid-template-columns: minmax(160px, .35fr) minmax(0, 1fr);
  padding: 0;
}

.credential-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 11px;
}

.provider-setup .privacy-note {
  margin: 7px 0 0;
}

.workspace {
  display: block;
  width: min(1240px, 100%);
  padding: 24px clamp(14px, 3vw, 30px) 34px;
}

.results-column {
  width: 100%;
}

.results-toolbar.search-not-started {
  display: none;
}

.initial-empty-state {
  min-height: 280px;
}

.initial-empty-state .empty-step-number {
  margin: 0 auto 12px;
}

.browse-all-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  text-align: center;
}

.results-toolbar.search-not-started ~ .result-list { padding-top: 0; }

.evaluation-tools {
  width: min(1240px, calc(100% - 28px));
  margin: 0 auto 38px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.evaluation-tools[hidden] {
  display: none;
}

.app-version {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
}

.evaluation-tools-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.evaluation-intro {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  color: #526177;
  font-size: .78rem;
  background: var(--surface-alt);
  border-radius: 9px;
}

.evaluation-tools .evaluation-panel {
  margin-top: 0;
}

.pilot-feedback-control {
  display: none;
}

.evaluation-mode .pilot-feedback-control {
  display: grid;
}

@media (max-width: 900px) {
  .workflow-map,
  .context-grid,
  .evaluation-tools-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .evaluation-intro {
    grid-column: 1;
  }

  .profile-fields,
  .provider-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .filter-body {
    max-height: none;
  }

  .toolbar-controls {
    justify-content: space-between;
  }
}

@media (max-width: 820px) {
  .search-workflow .search-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .nofo-upload-button {
    order: 1;
    justify-content: center;
    width: 100%;
  }

  .find-button {
    order: 2;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .hero {
    padding-right: 14px;
    padding-left: 14px;
  }

  .workflow-map {
    gap: 7px;
  }

  .workflow-map li {
    padding: 9px 10px;
  }

  .workflow-step {
    padding: 17px 14px;
  }

  .step-heading {
    gap: 10px;
  }

  .toolbar-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-controls select {
    width: 100%;
    max-width: none;
  }

  .credential-actions .button {
    width: 100%;
  }

  .ai-refine-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ai-refine-actions .ai-button {
    width: 100%;
  }

  .ai-refine-actions #restore-ai-refinement {
    width: 100%;
  }

  .launch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .context-card > summary,
  .evaluation-tools > summary {
    align-items: flex-start;
  }

  .evaluation-tools {
    width: calc(100% - 28px);
  }
}

/* Result-aware chat workspace */
.result-assistant .ai-heading {
  align-items: center;
}

.chat-size-toggle {
  width: auto;
  min-width: max-content;
  margin-left: auto;
  padding: 8px 11px;
  font-size: .72rem;
}

.messages {
  max-height: 440px;
  padding: 2px;
}

.message {
  width: fit-content;
  max-width: min(96%, 760px);
  padding: 11px 13px;
  font-size: .84rem;
  line-height: 1.55;
}

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

.message-content > :last-child {
  margin-bottom: 0;
}

.message-content p,
.message-content ul,
.message-content ol,
.message-content blockquote {
  margin: 0 0 10px;
}

.message-content ul,
.message-content ol {
  padding-left: 21px;
}

.message-content li + li {
  margin-top: 5px;
}

.message-content h3,
.message-content h4,
.message-content h5 {
  margin: 12px 0 6px;
  color: var(--navy);
  font-size: .94rem;
}

.message-content code {
  padding: 1px 4px;
  color: #28384f;
  background: #e5eaf1;
  border-radius: 4px;
}

.message-content blockquote {
  padding-left: 10px;
  color: #4d617a;
  border-left: 3px solid #b9cae2;
}

.message-content {
  min-width: 0;
}

.chat-table-wrap {
  max-width: 100%;
  margin: 2px 0 10px;
  overflow-x: auto;
  background: white;
  border: 1px solid #c8d5e5;
  border-radius: 8px;
  overscroll-behavior-x: contain;
}

.chat-table {
  width: 100%;
  min-width: 360px;
  font-size: .78rem;
  line-height: 1.4;
  border-collapse: collapse;
}

.chat-table th,
.chat-table td {
  padding: 8px 10px;
  overflow-wrap: anywhere;
  vertical-align: top;
  border-right: 1px solid #d8e2ee;
  border-bottom: 1px solid #d8e2ee;
}

.chat-table th:last-child,
.chat-table td:last-child {
  border-right: 0;
}

.chat-table tbody tr:last-child td {
  border-bottom: 0;
}

.chat-table th {
  color: var(--navy);
  font-weight: 800;
  background: #eaf1fa;
}

.chat-table-align-left {
  text-align: left;
}

.chat-table-align-center {
  text-align: center;
}

.chat-table-align-right {
  text-align: right;
}

.chat-thinking {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 0 10px 2px;
  padding: 9px 11px;
  color: #425a77;
  font-size: .76rem;
  font-weight: 700;
  background: #edf3fb;
  border: 1px solid #d3dfef;
  border-radius: 9px;
}

.thinking-mark {
  display: inline-flex;
  gap: 3px;
}

.thinking-mark i {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  animation: chat-thinking 1.1s infinite ease-in-out;
}

.thinking-mark i:nth-child(2) {
  animation-delay: .14s;
}

.thinking-mark i:nth-child(3) {
  animation-delay: .28s;
}

@keyframes chat-thinking {
  0%,
  65%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }
  32% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.chat-keyboard-hint {
  margin: 5px 2px 0;
  color: var(--muted);
  font-size: .68rem;
  text-align: center;
}

.chat-result-references {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #cad7e7;
}

.chat-result-references > p {
  margin: 0;
  color: #50647c;
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.chat-result-reference {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 9px 10px;
  background: white;
  border: 1px solid #cfdae8;
  border-radius: 8px;
}

.chat-result-reference div:first-child {
  display: grid;
  min-width: 0;
}

.chat-result-reference span,
.chat-result-reference small {
  color: #60728a;
  font-size: .66rem;
}

.chat-result-reference strong {
  margin: 2px 0;
  color: var(--navy);
  font-size: .76rem;
}

.chat-result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.chat-result-actions a {
  font-size: .68rem;
  font-weight: 800;
}

.chat-focus-action {
  width: auto;
  margin-top: 10px;
  padding: 7px 9px;
  font-size: .7rem;
}

.result-card.chat-target {
  outline: 4px solid rgba(31, 100, 213, .3);
  outline-offset: 3px;
  animation: chat-target-pulse 1s ease-in-out 2;
}

@keyframes chat-target-pulse {
  50% {
    outline-color: rgba(31, 100, 213, .8);
  }
}

/* Funding Finder keeps one search form and one copy of its refine controls. */
.funding-search { padding: 36px clamp(14px, 3vw, 30px) 28px; scroll-margin-top: 80px; }
.funding-search h1 { max-width: none; font-size: clamp(1.75rem, 3.5vw, 2.8rem); line-height: 1.15; }
.funding-search .search-introduction { max-width: 760px; margin-bottom: 20px; color: #e0eaff; }
.funding-search .search-workflow { padding: 16px; border-radius: 14px; box-shadow: none; }
.funding-search .search-form { margin: 0; }
.funding-search .find-button { min-width: 145px; padding-inline: 18px; }
.funding-search .search-guidance { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
.search-summary-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.search-summary-row p { margin: 0; color: var(--muted); font-size: .8rem; }
.search-summary-row p:empty, .funding-search .search-status:empty, .funding-search .nofo-upload-status:empty { display: none; }
.search-refine-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.search-refine-actions > button { min-height: 44px; }
.funding-search [hidden] { display: none !important; }
.results-toolbar.results-empty .toolbar-controls { display: none; }
.results-toolbar [hidden] { display: none !important; }
.initial-empty-state { min-height: 0; padding: 0; border: 0; background: transparent; }
.search-ai-status { width: min(1180px, calc(100% - 28px)); margin: 12px auto; }
.site-drawer.refine-search-drawer { width: min(660px, 100vw); overflow-wrap: anywhere; }
.refine-search-drawer #refine-search-description { margin: 0; padding: 16px 20px; color: var(--muted); font-size: .86rem; }
.refine-search-body { padding: 0 20px; }
.refine-search-body > * + * { margin-top: 16px; }
.refine-search-drawer .profile-fields, .refine-search-drawer .provider-fields { grid-template-columns: minmax(0, 1fr); }
.refine-search-drawer :is(.orcid-importer, .cv-uploader) { grid-template-columns: minmax(0, 1fr); }
.refine-search-drawer .profile-builder { margin: 0; }
.refine-search-drawer :is(input, select, textarea) { max-width: 100%; }
.refine-search-drawer .context-card > summary, .refine-search-drawer .provider-setup summary { flex-wrap: wrap; }
.refine-search-drawer .refine-ai { padding: 16px; background: #eef5ff; border: 1px solid var(--line); border-radius: 12px; }
.refine-search-drawer .refine-ai h3 { margin: 0 0 12px; font-size: 1rem; }
.refine-search-drawer .search-ai-status { width: auto; margin: 12px 0 0; }
.refine-search-footer { padding: 20px; }
.refine-search-footer p { color: var(--muted); font-size: .8rem; }
.refine-search-drawer > .search-status { margin: 0; padding: 0 20px 20px; }
@media (max-width: 820px) {
  .funding-search .search-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 8px; }
  .funding-search #query { grid-column: 1 / -1; }
  .funding-search .find-button { min-width: 0; padding-inline: 8px; }
  .funding-search .nofo-upload-button { min-width: 0; padding-inline: 8px; }
}
@media (max-width: 700px) {
  .site-drawer.refine-search-drawer { width: 100vw; }
  .refine-search-body { padding: 0 14px; }
  .refine-search-drawer .orcid-input-row { flex-wrap: wrap; }
  .refine-search-drawer .orcid-input-row > :is(input, button) { min-width: 0; width: 100%; }
  .refine-search-drawer .range-grid { grid-template-columns: minmax(0, 1fr); }
  .refine-search-drawer .panel-heading { flex-wrap: wrap; }
  .refine-search-footer .button { width: 100%; }
  .funding-search .search-workflow { padding: 10px; }
}
@media (forced-colors: active) {
  .funding-search.has-results, .refine-search-drawer .refine-ai { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
}

/* Contextual tools share the site's native drawer lifecycle and geometry. */
.result-assistant.site-drawer {
  padding: 22px;
  border-radius: 0;
  overflow-wrap: anywhere;
}
.result-assistant .ai-heading { padding-top: 0; flex-wrap: wrap; gap: 12px; }
.result-assistant .ai-heading h2 { font-size: 1.35rem; }
.result-assistant .chat-size-toggle { min-height: 44px; }
.result-assistant > .panel-copy { margin-top: 14px; }
.result-assistant #chat-provider-slot { margin: 14px 0; }
.result-assistant .provider-setup { margin: 0; }
.result-assistant .provider-setup summary { flex-wrap: wrap; }
.result-assistant .provider-setup-body { padding: 14px; }
.result-assistant .chat { min-width: 0; margin: 16px 0; }
.result-assistant .messages { min-height: 160px; max-height: 50dvh; padding: 8px 4px 14px; }
.result-assistant .message { padding: 14px 16px; font-size: .92rem; }
.result-assistant .chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px 10px; }
.result-assistant .chat-form textarea { grid-row: 1 / 3; min-height: 90px; }
.result-assistant .chat-form .button { align-self: stretch; margin-top: 0; }
.result-assistant .chat-keyboard-hint { align-self: end; margin-bottom: 3px; }
.result-assistant .chat-privacy { margin-top: 10px; padding-top: 9px; }
.result-assistant.document-chat[open] {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px 20px;
  align-content: start;
}
.document-chat .ai-heading, .document-chat > .panel-copy, .document-chat #chat-provider-slot { grid-column: 1 / -1; }
.document-chat > .nofo-chat-context { grid-column: 1; grid-row: 4 / 6; align-self: start; margin: 0; }
.document-chat .chat { grid-column: 2; grid-row: 4; margin: 0; }
.document-chat > .chat-privacy { grid-column: 2; grid-row: 5; }
.document-chat .nofo-match-record { grid-template-columns: minmax(0, 1fr); }
.document-chat .nofo-context-heading { flex-direction: column; }
.document-chat .nofo-context-tools, .document-chat .nofo-match-actions { justify-content: flex-start; }
.team-builder-drawer .opportunity-team-panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; min-width: 0; overflow-wrap: anywhere; }
.team-builder-drawer :is(.opportunity-team-heading, .opportunity-team-member-title, .opportunity-team-role > div) > * { min-width: 0; max-width: 100%; }
.team-builder-drawer :is(.badge, .opportunity-team-role-state) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.team-builder-drawer .opportunity-team-heading h4:focus-visible { outline-offset: 2px; }
.team-builder-drawer .opportunity-team-body { min-width: 0; overflow-wrap: anywhere; }
.team-builder-drawer .opportunity-team-remove { flex-shrink: 0; }
.team-builder-drawer .opportunity-team-replacement select { max-width: 100%; }
@media (max-width: 900px) {
  .result-assistant.document-chat[open] { display: block; }
  .document-chat > .nofo-chat-context { margin: 14px 0; }
}
@media (max-width: 700px) {
  .result-assistant.site-drawer { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .result-assistant .ai-heading h2 { font-size: 1.15rem; }
  .result-assistant .spark { display: none; }
  .result-assistant .message { max-width: 100%; padding: 12px; font-size: .88rem; }
  .result-assistant .chat-form { display: block; }
  .result-assistant .chat-form .button { min-height: 46px; margin-top: 8px; }
  .result-assistant .chat-result-reference, .result-assistant .provider-fields { grid-template-columns: minmax(0, 1fr); }
  .result-assistant .chat-result-actions { justify-content: flex-start; }
  .result-assistant .nofo-context-heading { flex-direction: column; }
  .team-builder-drawer .opportunity-team-status { flex-wrap: wrap; }
  .team-builder-drawer .opportunity-team-member-title { flex-wrap: wrap; }
}


/* Funding Finder intentionally keeps one consistent light theme, including when
   the browser or operating system requests dark mode. */

@media (forced-colors: active) {
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .site-header,
  .search-workflow,
  .workflow-map li,
  .context-card,
  .result-card,
  .result-assistant,
  .evaluation-tools,
  .message,
  .chat-result-reference,
  .notice,
  input,
  select,
  textarea,
  button {
    border: 1px solid CanvasText;
  }

  .result-card.ai-match {
    border-left: 4px solid Highlight;
  }

  .result-card.chat-target {
    outline: 4px solid Highlight;
  }

  .step-number,
  .empty-step-number,
  .brand-mark,
  .thinking-mark i {
    color: Canvas;
    background: CanvasText;
    border: 1px solid CanvasText;
  }

  a,
  button,
  input,
  select,
  textarea,
  summary {
    forced-color-adjust: auto;
  }
}

.audience-filter-field .audience-select-label {
  display: block;
  width: 100%;
}

.audience-filter-field select {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink, #223049);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #d6dde6);
  border-radius: 8px;
  cursor: pointer;
}

/* Stage 1 results controls keep their existing state owners. */
.results-toolbar { scroll-margin-top: 100px; gap: 10px; }
.results-toolbar .toolbar-actions { display: flex; flex-direction: row; flex-wrap: wrap; align-items: end; gap: 8px; }
.results-toolbar .toolbar-actions > .button { width: auto; }
.results-toolbar .toolbar-controls { margin-right: auto; }
.team-ready-filter[hidden] { display: none; }
.team-ready-filter[aria-pressed="true"] { color: #001e5f; background: #ffd82b; border-color: #b39713; }
.card-actions { align-items: center; }
@media (max-width: 540px) {
  .results-toolbar .toolbar-controls { flex: 1 1 100%; }
  .results-toolbar .toolbar-controls label, .results-toolbar .toolbar-controls select { width: 100%; }
  .card-actions { display: flex; flex-wrap: wrap; }
  .card-actions > .source-action { width: auto; }
}

/* Keep the composer visible; the conversation owns its own scrolling. */
.result-assistant.site-drawer[open] { display: flex; flex-direction: column; overflow: hidden; container: result-chat / size; }
.result-assistant > .ai-heading { flex: none; }
.result-assistant .chat { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin: 8px 0; }
.result-assistant .messages { flex: 1 1 auto; min-height: 60px; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.result-assistant .chat-form, .result-assistant .chat-thinking { flex: none; }
.result-assistant .chat-summary { margin: 0 0 8px; }
.result-assistant .suggestion-list { flex: none; max-height: 90px; overflow-y: auto; margin-bottom: 8px; }
.result-assistant .chat-form { padding-top: 8px; border-top: 1px solid var(--line); background: #fff; }
.result-assistant .chat-thinking { margin: 4px 0; }
.result-assistant .chat-actions:has(> .hidden):not(:has(> :not(.hidden))) { display: none; }
.result-assistant.document-chat > .nofo-chat-context { max-height: 25dvh; overflow-y: auto; flex: none; }
.result-assistant #chat-provider-slot:has(.provider-setup[open]) { max-height: 35dvh; overflow-y: auto; flex: none; }
@media (max-width: 700px) {
  .result-assistant.site-drawer { padding: 12px; }
  .result-assistant > .panel-copy { display: none; }
  .result-assistant > .chat-privacy { font-size: .65rem; flex: none; }
  .result-assistant .ai-heading h2 { font-size: 1.1rem; }
  .result-assistant #chat-provider-slot { margin: 6px 0; }
  .result-assistant .chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .result-assistant .chat-form textarea { grid-row: auto; min-height: 64px; max-height: 110px; }
  .result-assistant .chat-keyboard-hint { display: none; }
  .result-assistant .suggestion-list { display: none; }
  .result-assistant .chat-summary { font-size: .74rem; }
  .result-assistant .chat-form .button { width: auto; min-width: 70px; }
}

/* The drawer follows the visual viewport, including a phone's open keyboard. */
@container result-chat (max-width: 700px) and (max-height: 500px) {
  .result-assistant > .ai-heading { flex-wrap: nowrap; gap: 8px; }
  .result-assistant .ai-heading .eyebrow { display: none; }
  .result-assistant .ai-heading h2 { font-size: 1rem; }
  .result-assistant .provider-setup summary { padding: 8px; gap: 4px; }
  .result-assistant .provider-setup summary span:first-child small { display: none; }
  .result-assistant .chat-summary { flex: none; max-height: 3em; overflow-y: auto; }
  .result-assistant .messages { min-height: 0; }
  .result-assistant .chat-form textarea { min-height: 56px; height: 56px; }
  .result-assistant .chat-form .button { margin-top: 0; }
  .result-assistant > .chat-privacy { margin-top: 4px; padding-top: 4px; }
}

.chat-scope-hint { flex-basis: 100%; margin: 0; max-width: 420px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
