:root {
    --primary-color: #17008B;
    --secondary-color: hsl(210 40% 96.1%);
    --accent-color: hsl(180 47% 39%);
    
    --wa-font-family-body: Roboto;
    --wa-font-family-heading: Montserrat;
    --wa-font-size-m: calc(1rem * var(--wa-font-size-scale));

    --text-primary: #111827;
    --text-secondary: #5B6475;

    --bg-sidebar: #0A1033;
    --bg-topbar: #F8FAFD;
    --bg-content: #EEF2F7;
}

/* Login has no sidebar content; hide wa-page's empty nav chrome. */
wa-page.login-page {
  --menu-width: 0px;
}
wa-page.login-page::part(navigation),
wa-page.login-page::part(navigation-toggle) {
  display: none;
}

@font-face {
    font-family: Montserrat;
    src: url(/static/fonts/Montserrat.woff2) format(woff2);
}

@font-face {
    font-family: Roboto;
    src: url(/static/fonts/Roboto.woff2) format(woff2);
}


html,
body {
  min-height: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  background-color: var(--bg-content);
  font-size: var(--wa-font-size-s);

}

/* Fix WebAwesome page background consistency */
wa-page {
  --menu-width: 14.5rem;
  margin: 0;
  padding: 0;
}

wa-page[view='mobile'] {
  --menu-width: auto;
}

wa-page::part(main) {
  background-color: var(--bg-content);
  margin: 0;
  padding: 0;
  padding-bottom: 0;
}

wa-page::part(main-header) {
  display: none;
}

wa-page::part(main-footer) {
  background-color: var(--primary-color);
  position: sticky;
  bottom: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  border-top: 1px solid #d1d5db;
  font-size: 0.75rem;
  color: var(--secondary-color);
  margin: 0;
  gap: 0;
  font-family: var(--wa-font-family-body);
}

/* Ensure footer sits flush */
.footer {
  margin: 0;
  padding: 0;
  gap: 0;
}


wa-avatar {
    --size: 2rem;
}

.wa-hidden {
    display: none !important;
}

/* Team Members card: content fills card, scrolls when overflowing */
#team-members-card { display: flex; flex-direction: column; min-height: 0; }
#team-members-card::part(body) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.team-card-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.team-member-row {
    border: 1px solid transparent;
    border-radius: var(--wa-border-radius-m, 0.375rem);
    margin-inline: -0.25rem;
    padding: 0.25rem;
}
.team-member-row-current {
    background: var(--wa-color-brand-fill-quiet, #eef4ff);
    border-color: var(--wa-color-brand-border-quiet, #bfdbfe);
}
.team-member-you-label {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    color: var(--wa-color-brand-text, #1d4ed8);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}
.opportunity-row-current-team {
    background: var(--wa-color-brand-fill-quiet, #eef4ff);
    box-shadow: inset 3px 0 0 var(--wa-color-brand-border-normal, #2563eb);
}

/* Dashboard My Opportunities: wa-scroller caps height; sticky thead in scroll viewport */
#my-opportunities-card { display: flex; flex-direction: column; min-height: 0; }
#my-opportunities-card::part(body) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
#my-opportunities-card wa-scroller.my-opportunities-scroller {
    min-width: 0;
}
#my-opportunities-card wa-scroller.my-opportunities-scroller thead th {
    position: sticky;
    top: 0;
    background: var(--wa-color-neutral-0, #fff);
    box-shadow: 0 1px 0 var(--wa-color-neutral-300, #d1d5db);
    z-index: 1;
}
.my-opportunities-skeleton-table td {
    vertical-align: middle;
    padding-block: 0.65rem;
}
.my-opportunities-skeleton-title {
    display: block;
    width: 88%;
    height: 1rem;
}
.my-opportunities-skeleton-roles {
    display: block;
    width: 4.5rem;
    height: 1.25rem;
    border-radius: var(--wa-border-radius-pill, 9999px);
}
.my-opportunities-skeleton-date {
    display: block;
    width: 55%;
    height: 1rem;
}

/* Opportunities list: keep filter tabs on one row */
.opportunities-filter-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

/* Agencies list: keep the chart visible without creating a blank first viewport */
.agency-directory-card::part(body) {
    overflow: hidden;
}

.agency-chart-toolbar {
    align-items: flex-start;
}

.agency-chart-copy p {
    margin: 0;
}

.agency-chart-controls {
    flex-shrink: 0;
}

.agency-chart-container {
    position: relative;
    height: min(58vh, 520px);
    min-height: 340px;
    border: 1px solid var(--wa-color-neutral-border-normal, #d1d5db);
    border-radius: 8px;
    background: var(--wa-color-neutral-fill-quiet, #fff);
    overflow: hidden;
}

.agency-chart-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--wa-color-neutral-fill-quiet, #fff);
    z-index: 1;
}

.agency-chart-state p {
    max-width: 30rem;
    margin: 0;
}

.agency-chart-state--error {
    background: var(--wa-color-danger-fill-quiet, #fff5f5);
}

.agency-chart-node {
    height: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    border: 1px solid var(--wa-color-neutral-border-normal, #d1d5db);
    border-radius: 8px;
    background: var(--wa-color-neutral-fill-quiet, #fff);
    color: var(--text-primary);
    box-shadow: 0 1px 2px rgb(17 24 39 / 8%);
    cursor: pointer;
}

.agency-chart-node__title {
    font-weight: 600;
    line-height: 1.25;
}

.agency-chart-node__meta {
    margin-top: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 700px) {
    .agency-chart-container {
        height: 420px;
        min-height: 300px;
    }
}

.agency-tree {
    --indent-guide-width: 1px;
    --indent-guide-color: var(--wa-color-neutral-border-normal, #d1d5db);
    max-width: 100%;
}

.agency-tree wa-tree-item::part(label) {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    width: 100%;
}

.agency-tree__name {
    font-weight: 500;
}

.agency-tree__meta {
    font-size: 0.85rem;
}

.agency-tree__count {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wa-color-neutral-text-loud, #374151);
}

nav {
  background-color: var(--bg-sidebar);
  font-family: Montserrat;
  color: #fff;}

ul {
    list-style-type: none;
    padding-left: 0;
}

footer {
    margin: 0;
    padding: 0;
    gap: 0;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    text-align: center;
}

h1 {
    font-family: var(--wa-font-family-heading);
    font-weight: var(--wa-font-weight-bold);
    line-height: var(--wa-line-height-condensed);
    font-size: var(--wa-font-size-l);
}

h2 {
    font-family: var(--wa-font-family-heading);
    font-weight: var(--wa-font-weight-semibold);
    color: var(--accent-color);
    margin: 5px 0 0 0;
    line-height: var(--wa-line-height-condensed);
    font-size: var(--wa-font-size-m);
}

h3 {
    font-family: var(--wa-font-family-heading);
    font-weight: var(--wa-font-weight-bold);
    margin: 5px 0 0 0;
    line-height: var(--wa-line-height-condensed);
    font-size: var(--wa-font-size-m);
}

h4 {
    font-family: var(--wa-font-family-heading);
    font-weight: var(--wa-font-weight-semibold);
    margin: 5px 0 0 0;
    line-height: var(--wa-line-height-condensed);
    font-size: var(--wa-font-size-s);
}

[slot='navigation'] {
    a {
      --wa-color-text-link: var(--secondary-color);
      --wa-link-decoration-default: none;
      --wa-link-decoration-hover: none;
      --flank-size: 2rem;
      font-weight: var(--wa-font-weight-action);
      gap: 0.5rem;
      cursor: pointer;
    }

    background: linear-gradient(
  180deg,
  var(--bg-sidebar) 0%,
  #0D1B4D 55%,
  #14006E 100%
);
}

.nav-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.nav-sidebar-links {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.nav-sidebar-links .wa-caption-s {
  color: var(--secondary-color);
  opacity: 0.85;
}

.nav-sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-sidebar-logout {
  --wa-color-text-link: var(--secondary-color);
  padding: 0.35rem 0;
}

[slot='navigation-header'] {
  background-color: var(--bg-sidebar);
}

.nav-sidebar-header {
  padding-inline: 0.75rem;
  padding-bottom: 0.75rem;
}

.nav-sidebar-search-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.nav-sidebar-search {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.nav-sidebar-search::part(form-control),
.nav-sidebar-search::part(form-control-input),
.nav-sidebar-search::part(combobox) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.nav-sidebar-search::part(combobox-input) {
  min-width: 0;
}

.nav-sidebar-search::part(listbox) {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.nav-sidebar-search > wa-option {
  contain: inline-size;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  box-sizing: border-box;
}

.nav-sidebar-search > wa-option span,
.nav-sidebar-search > wa-option small {
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link {
  color: #0066cc;
  text-decoration: none;
  cursor: pointer;
}

.htmx-indicator{
  opacity:0;
  transition: opacity 500ms ease-in;
}
.htmx-request .htmx-indicator{
  opacity:1;
}
.htmx-request.htmx-indicator{
  opacity:1;
}

/* Scout search indicator: zero footprint when idle, no gap in layout.
   Indicator lives inside #results so it doesn't create a layout gap when hidden. */
#scout-search-indicator:not(.htmx-request) {
  display: none;
  height: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
}
#scout-search-indicator.htmx-request {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
}

/* NAICS match indicator (Scout + opportunity detail) */
.scout-naics-match,
.opp-naics-match {
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.5), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Intelligence list: card gallery that doesn't stretch a lone card full-bleed */
.intelligence-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: var(--wa-space-l, 1rem);
  align-items: stretch;
}

/* Intelligence list empty state */
.intelligence-empty-state__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.intelligence-empty-state__header h3 {
  margin: 0;
}

.intelligence-empty-state__header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--text-secondary);
  line-height: 1;
}

.intelligence-empty-state {
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  padding: 2rem;
}

.intelligence-confidence-field {
  align-items: flex-start;
}

#confidence-level {
  display: inline-flex;
  width: max-content;
  max-width: max-content;
  align-self: flex-start;
  flex: 0 0 auto;
  line-height: 1;
}

#confidence-label {
  min-height: 1.25rem;
}

/* ================================
   Activity Type Colors
   ================================ */

:root {
  --activity-color-meeting: #2196F3;
  --activity-color-proposal-due: #F44336;
  --activity-color-color-review: #9C27B0;
  --activity-color-qa-deadline: #FF9800;
  --activity-color-follow-up: #4CAF50;
  --activity-color-other: #607D8B;
}

/* Activity type tag styles */
.activity-type-tag {
  font-weight: 500;
}

.activity-type-meeting {
  --wa-tag-background: var(--activity-color-meeting);
  --wa-tag-text: white;
  color: white;
}

.activity-type-proposal-due {
  --wa-tag-background: var(--activity-color-proposal-due);
  --wa-tag-text: white;
  color: white;
}

.activity-type-color-review {
  --wa-tag-background: var(--activity-color-color-review);
  --wa-tag-text: white;
  color: white;
}

.activity-type-qa-deadline {
  --wa-tag-background: var(--activity-color-qa-deadline);
  --wa-tag-text: white;
  color: white;
}

.activity-type-follow-up {
  --wa-tag-background: var(--activity-color-follow-up);
  --wa-tag-text: white;
  color: white;
}

.activity-type-other {
  --wa-tag-background: var(--activity-color-other);
  --wa-tag-text: white;
  color: white;
}

/* Activity event card styling */
.activity-event-card {
  padding: 0.75rem;
  border: 1px solid var(--wa-color-border);
  border-radius: 6px;
  background: var(--wa-color-surface);
  transition: box-shadow 0.2s ease;
}

.activity-event-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Opportunity widget: denser activity rows (scoped so <tr.activity-event-card> on list page is unchanged) */
.opportunity-activities-list .activity-event-card--compact {
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
}

.opportunity-activities-list .activity-event-card__compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.opportunity-activities-list .activity-event-card__compact-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.opportunity-activities-list .activity-event-card__compact-meta {
  flex-wrap: wrap;
  line-height: 1.2;
}

.opportunity-activities-list .activity-event-card__compact-status {
  flex-shrink: 0;
  align-self: flex-start;
}

.opportunity-activities-list .activity-event-card__compact-desc {
  margin: 0;
  margin-top: 0.1rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.25;
}

/* Activity legend items */
.activity-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--wa-font-size-xs);
}

.activity-legend-item.activity-type-meeting wa-icon {
  color: var(--activity-color-meeting);
}

.activity-legend-item.activity-type-proposal-due wa-icon {
  color: var(--activity-color-proposal-due);
}

.activity-legend-item.activity-type-color-review wa-icon {
  color: var(--activity-color-color-review);
}

.activity-legend-item.activity-type-qa-deadline wa-icon {
  color: var(--activity-color-qa-deadline);
}

.activity-legend-item.activity-type-follow-up wa-icon {
  color: var(--activity-color-follow-up);
}

.activity-legend-item.activity-type-other wa-icon {
  color: var(--activity-color-other);
}

/* Table header cell styling */
.wa-table-header-cell {
  text-align: center;
  vertical-align: middle;
  font-size: var(--wa-font-size-m);
}

/* Agreements table: center status column */
#agreements-tbody td:nth-child(7) {
  text-align: center;
}

/* Linked entity tag styling */
.wa-tag-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.wa-tag-link:hover {
  opacity: 0.8;
}

/* Calendar card styling */
.activity-calendar-card {
  position: sticky;
  top: 1rem;
}

#calendar-container {
  width: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

#activity-calendar {
  width: 100%;
  min-height: 0;
  display: block;
  flex: 1;
}

/* Responsive layout for activities page */
.activities-top-row {
  /* Tall enough for wa-date-picker month grid + card header/padding */
  --activities-top-row-height: 32rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(22rem, 1fr);
  gap: 1rem;
  align-items: stretch;
  grid-auto-rows: var(--activities-top-row-height);
}

.activities-calendar-card,
.activities-upcoming-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: var(--activities-top-row-height);
  overflow: hidden;
}

.activities-calendar-card::part(body),
.activities-upcoming-card::part(body) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-card-content {
  display: grid;
  grid-template-columns: minmax(17rem, 0.85fr) minmax(16rem, 1fr);
  gap: 1rem;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.calendar-card-content > wa-date-picker {
  min-height: 0;
  height: 100%;
}

#selected-day-activities {
  min-height: 0;
}

.activities-panel-scroller {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.activities-upcoming-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.activities-upcoming-item {
  align-items: start;
}

.activities-upcoming-title,
.activities-upcoming-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.activities-panel-scroller::part(base) {
  min-height: 0;
}

.activities-empty-panel {
  flex: 1;
  justify-content: center;
  min-height: 0;
  padding: 1rem;
}

/* Activity detail page */
.activity-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.activity-detail-related-stack {
  min-width: 0;
}

.activity-detail-notes-card {
  grid-column: 1 / -1;
  min-height: 22rem;
}

.activity-detail-notes-card > wa-card {
  min-height: 22rem;
}

@media (max-width: 768px) {
  .activities-top-row {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
  
  .calendar-card-content {
    grid-template-columns: 1fr;
  }

  .activity-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Opportunity resources */
.opp-resource-row { align-items: flex-start; padding-block: .5rem; border-bottom: 1px solid var(--wa-color-border-quiet); }
.opp-resource-row:last-child { border-bottom: 0; }
.opp-resource-main { flex: 1; min-width: 0; }
.opp-resource-main p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Pipeline stepper (opportunity detail) */
.pipeline-stepper {
  align-items: center;
  row-gap: 0.35rem;
}

.pipeline-stepper--track {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.5rem;
  scrollbar-width: thin;
}

.pipeline-stepper .pipeline-step {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: var(--wa-font-size-xs, 0.8125rem);
  padding: 0.35rem 0.65rem;
  border-radius: var(--wa-radius-pill, 999px);
  border: 1px solid var(--wa-color-border, #cbd5e1);
  background: var(--wa-color-surface-lowered, #f8fafc);
  color: var(--text-primary, #111827);
  white-space: nowrap;
  flex-shrink: 0;
}

.pipeline-step-main {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pipeline-step-label {
  line-height: 1.2;
}

.pipeline-step-duration {
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.1;
  color: var(--text-secondary, #5b6475);
}

.pipeline-stepper .pipeline-step-active .pipeline-step-duration {
  font-weight: 600;
  color: inherit;
}

.pipeline-step-icon {
  font-weight: 800;
  line-height: 1;
}

.pipeline-stepper .pipeline-step-done {
  border-style: solid;
  border-width: 1px;
  font-weight: 500;
}

.pipeline-stepper .pipeline-step-active {
  border: 3px solid var(--text-primary, #111827);
  color: var(--text-primary, #111827);
  font-weight: 700;
  background: #fff;
  box-shadow: inset 0 0 0 1px #fff;
  outline: 2px dashed var(--text-primary, #111827);
  outline-offset: 2px;
}

.pipeline-stepper .pipeline-step-upcoming {
  border-style: dashed;
  border-width: 1.5px;
  color: var(--text-secondary, #5b6475);
  background: transparent;
  opacity: 1;
}

/* Opportunity detail page */
#main {
  padding: 1.25rem 1.5rem 2rem;
}

.opp-detail-hero::part(body) {
  padding: 1.25rem 1.5rem;
}

.opp-detail-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--wa-color-border, #e2e8f0);
}

.opp-detail-hero-headline {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
}

.opp-detail-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
  text-align: left;
}

.opp-detail-meta {
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
}

.opp-detail-external-link,
.opp-detail-added-by {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.opp-detail-added-by a.wa-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.opp-detail-edit-btn {
  flex-shrink: 0;
}

.opp-detail-pipeline-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.opp-detail-pipeline-controls {
  flex-shrink: 0;
  margin-left: auto;
}

.opp-detail-inline-form {
  display: inline-flex;
  margin: 0;
}

.opp-detail-work-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.opp-detail-overview,
.opp-detail-action-rail {
  min-width: 0;
}

.opp-detail-people-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

/* Tight line spacing within a contact; gap between contacts stays on the outer stack */
.opp-gov-contact {
  line-height: 1.25;
}

.opp-gov-contact .wa-heading-s,
.opp-gov-contact .wa-body-s,
.opp-gov-contact .wa-body-xs {
  line-height: 1.25;
}

.opp-detail-scroll-card {
  display: flex;
  flex-direction: column;
}

.opp-detail-scroll-card::part(body) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.opp-detail-card-scroller {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.opp-detail-card-scroller::part(base) {
  min-height: 0;
}

.opp-detail-card-scroller .team-card-scroll {
  flex: initial;
  overflow: visible;
}

.opp-detail-card-empty {
  flex: 1;
  justify-content: center;
  min-height: 0;
  padding: 2rem;
}

#team-members-widget {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#team-members-widget > #team-members-card {
  flex: 1;
  min-height: 0;
}

.opp-detail-section-title {
  margin: 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--wa-color-border, #e2e8f0);
  font-size: var(--wa-font-size-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dashboard-pipeline-chart {
  display: block;
  min-height: 280px;
  width: 100%;
}

.dashboard-resume-banner {
  background-color: var(--wa-color-fill-quiet);
  max-width: min(40rem, 100%);
  min-width: 0;
  flex-shrink: 1;
}

.dashboard-resume-banner__text {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: var(--wa-space-s, 0.5rem);
  min-width: 0;
}

.dashboard-resume-banner__label {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-resume-banner__text > a {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-tile::part(body) {
  padding: var(--wa-space-m) var(--wa-space-l);
}

.dashboard-kpi-tile__value {
  line-height: 1;
}

/* Pgo / Pwin share one KPI tile — equal halves across the cell */
.opp-detail-kpi-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  width: 100%;
  gap: var(--wa-space-m, 1rem);
}

.opp-detail-kpi-split > * {
  min-width: 0;
}

/* Opportunity Matches: ~5 rows visible, scroll the rest */
#saved-search-matches-card wa-scroller.matches-card-scroller {
  min-width: 0;
  display: block;
}

.entity-picker {
  display: grid;
  gap: var(--wa-space-xs, 0.375rem);
  min-width: 0;
}

.entity-picker-combobox {
  display: block;
  width: 100%;
}

.entity-picker-combobox::part(combobox),
.entity-picker-combobox::part(combobox-input),
.entity-picker-combobox::part(listbox) {
  box-sizing: border-box;
  max-width: 100%;
}

.entity-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wa-space-2xs, 0.25rem);
  min-height: 0.25rem;
}

.entity-picker-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem 0.2rem 0.5rem;
  border: 1px solid var(--wa-color-border);
  border-radius: var(--wa-radius-s, 0.25rem);
  background: var(--wa-color-fill-quiet);
  color: var(--wa-color-text-normal);
  line-height: 1.25;
}

.entity-picker-chip-label,
.entity-picker-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-picker-chip small {
  color: var(--wa-color-text-quiet);
}

.entity-picker-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--wa-radius-s, 0.25rem);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.entity-picker-chip-remove:hover,
.entity-picker-chip-remove:focus-visible {
  background: var(--wa-color-fill-normal);
  outline: none;
}

@media (max-width: 1100px) {
  .opp-detail-work-row,
  .opp-detail-people-row {
    grid-template-columns: 1fr;
  }

  .opp-detail-hero-top {
    flex-direction: column;
  }

  .opp-detail-hero-headline {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .opp-detail-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  #main {
    padding: 1rem;
  }
}

#toast-container {
  position: fixed;
  bottom: 4.5rem;
  right: 1.5rem;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  pointer-events: none;
  max-width: min(28rem, calc(100vw - 2rem));
}

#toast-container wa-callout.toast,
.toast {
  display: block;
  width: max-content;
  min-width: 18rem;
  max-width: min(28rem, calc(100vw - 2rem));
  box-sizing: border-box;
  font-size: var(--wa-font-size-m, 0.9375rem);
  line-height: 1.45;
  box-shadow: var(--wa-shadow-l, 0 8px 24px rgba(0, 0, 0, 0.18));
  pointer-events: auto;
}

.toast-dismiss {
  animation: toast-dismiss 3.25s forwards;
}

@keyframes toast-dismiss {
  0% { opacity: 0; transform: translateY(0.5rem); }
  5% { opacity: 1; transform: translateY(0); }
  95% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(0); }
}
