/* app styles — the few rules Pico does not cover */

:root {
  --pico-border-radius: 0.375rem;
  --app-header-height: 3.25rem;
}

/* htmx request indicator — htmx normally injects this as an inline <style>,
   which the Content-Security-Policy blocks; base.html turns that off
   (includeIndicatorStyles: false) and the rules live here instead. */
.htmx-indicator { opacity: 0; visibility: hidden; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease-in;
}

/* auth pages (templates/accounts/) */
.auth-card { max-width: 28rem; margin: 3rem auto; }
.form-errors p, .field-error { color: var(--pico-del-color, #b91c1c); }
.field-error { display: block; margin-top: -0.5rem; margin-bottom: 1rem; }

/* portal shell (templates/layouts/portal.html) */
.portal-header {
  border-bottom: 1px solid var(--pico-muted-border-color);
  background: var(--pico-background-color);
}
.portal-header__row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--app-header-height);
  padding-top: 0;
  padding-bottom: 0;
}
.portal-brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--pico-h1-color);
  white-space: nowrap;
}
.portal-brand:hover { text-decoration: none; }

/* nav (templates/partials/nav.html) */
.portal-nav { flex: 1; min-width: 0; }
.portal-nav ul {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
}
.portal-nav li { margin: 0; padding: 0; }
.portal-nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: var(--pico-border-radius);
  color: var(--pico-muted-color);
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease, background-color 120ms ease;
}
.portal-nav a:hover { color: var(--pico-color); background: var(--pico-secondary-background, rgba(0, 0, 0, 0.04)); }
.portal-nav a[aria-current="page"] { color: var(--pico-color); font-weight: 600; }

/* user menu */
.portal-user { margin-left: auto; }
.portal-user__menu { margin: 0; }
.portal-user__menu summary { margin: 0; padding: 0.35rem 0.6rem; border: 0; }
.portal-user__menu ul { text-align: left; min-width: 12rem; }
.portal-user__org { padding: 0.5rem 1rem; color: var(--pico-muted-color); }
.portal-user__logout {
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem;
  background: none;
  border: 0;
  color: var(--pico-color);
  text-align: left;
}
.portal-user__logout:hover { background: var(--pico-dropdown-hover-background-color); }

.portal-main { padding-top: 1.5rem; }

/* toasts (templates/partials/messages.html) */
.toasts {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--pico-muted-border-color);
  border-left-width: 3px;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 0.9rem;
}
.toast--success { border-left-color: var(--pico-ins-color); }
.toast--error { border-left-color: var(--pico-del-color); }
.toast--warning { border-left-color: #b45309; }
.toast--info { border-left-color: var(--pico-primary); }
.toast__close {
  margin: 0 0 0 auto;
  padding: 0;
  width: auto;
  background: none;
  border: 0;
  color: var(--pico-muted-color);
  line-height: 1;
}

/* status badges */
.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--pico-muted-color);
}
.badge--active, .badge--approved { color: var(--pico-ins-color); border-color: currentColor; }
.badge--pending { color: #b45309; border-color: currentColor; }
.badge--suspended, .badge--rejected { color: var(--pico-del-color); border-color: currentColor; }
.badge--archived { color: var(--pico-muted-color); }
.badge--published { color: var(--pico-ins-color); border-color: currentColor; }
.badge--in_review { color: #b45309; border-color: currentColor; }
.badge--paused { color: var(--pico-del-color); border-color: currentColor; }

/* tables scroll horizontally instead of breaking the layout on small screens */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll table { min-width: 40rem; }

/* portal dashboards (templates/<app>/dashboard.html) */
.page-header { margin-bottom: 1.5rem; }
.page-header p { color: var(--pico-muted-color); }
/* header with a primary action on the right (templates/adminportal/users.html) */
.page-header--actions { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.page-header--actions [role="button"] { width: auto; white-space: nowrap; }
.section-title { font-size: 1.125rem; margin: 1.5rem 0 0.75rem; }
.form-card { max-width: 36rem; }
.form-card .panel-actions [role="button"], .form-card .panel-actions button { width: auto; }
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.dashboard-grid article { margin: 0; }
.dashboard-grid article > header { font-weight: 600; }
.dashboard-grid article p { margin-bottom: 0; color: var(--pico-muted-color); }

/* stat tiles (templates/marketplace/partner_dashboard.html, templates/adminportal/dashboard.html) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  color: inherit;
  text-decoration: none;
  transition: border-color 120ms ease;
}
.stat:hover { border-color: var(--pico-primary); text-decoration: none; }
.stat--highlight { border-color: var(--pico-primary); }
.stat__value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 0.875rem; color: var(--pico-muted-color); }

/* partner profile (templates/marketplace/partner_profile.html) */
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.profile-aside article { margin: 0; }
.profile-aside article > header { font-weight: 600; }
.profile-form fieldset { margin-bottom: 1.5rem; }
.profile-form legend { font-weight: 600; margin-bottom: 0.5rem; }
.categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.25rem 1rem;
}
.categories__grid label { margin: 0; }
.logo-field__row { display: flex; gap: 1.25rem; align-items: flex-start; }
.logo-field__preview, .logo-field__placeholder {
  flex: 0 0 auto;
  width: 6rem;
  height: 6rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  object-fit: contain;
  background: var(--pico-card-background-color);
}
.logo-field__placeholder { display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; }
.logo-field__controls { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; }
.form-actions button, .form-actions a[role="button"] { width: auto; margin: 0; }

/* partner services (templates/marketplace/partner_services.html + partials/service_row.html) */
.service-form { max-width: 40rem; }
.service-row__actions { white-space: nowrap; }
.service-status { display: inline-block; margin: 0 0.25rem 0 0; }
.service-status button { width: auto; margin: 0; padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.service-row__error { margin: 0.25rem 0 0; }

/* partner requests pipeline (templates/marketplace/partner_requests.html + partials/request_board.html) */
.pipeline-filter { color: var(--pico-muted-color); }
.pipeline__error { margin: 0 0 1rem; }
.pipeline__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.pipeline__column {
  padding: 0.75rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-background-color);
}
.pipeline__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.75rem; }
.pipeline__header h2 { font-size: 1rem; margin: 0; }
.pipeline__count { font-size: 0.8rem; color: var(--pico-muted-color); font-variant-numeric: tabular-nums; }
.pipeline__empty { margin: 0; font-size: 0.875rem; }
.request-card { margin: 0 0 0.75rem; padding: 0.875rem 1rem; }
.request-card:last-child { margin-bottom: 0; }
.request-card__header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; }
.request-card__service { margin: 0 0 0.25rem; font-size: 0.9rem; }
.request-card__message { margin: 0 0 0.25rem; font-size: 0.85rem; color: var(--pico-muted-color); }
.request-card__meta { margin: 0; }
.request-card__error { margin: 0.5rem 0 0; }
.request-status { display: flex; gap: 0.5rem; align-items: center; margin: 0.75rem 0 0; }
.request-status select { margin: 0; padding: 0.25rem 2rem 0.25rem 0.5rem; font-size: 0.875rem; }
.request-status__submit { width: auto; margin: 0; padding: 0.25rem 0.75rem; font-size: 0.875rem; }

/* admin list filters (templates/adminportal/companies.html, investors.html, users.html) */
.filter-bar { display: flex; gap: 0.75rem; align-items: start; margin-bottom: 1rem; }
.filter-bar input, .filter-bar select { margin-bottom: 0; }
.filter-bar input[type="search"] { flex: 2; }
.filter-bar select { flex: 1; max-width: 16rem; }
.filter-bar button { width: auto; margin-bottom: 0; }

/* no-organization page (templates/core/no_organization.html) */
.empty-state { max-width: 36rem; margin: 3rem auto; }
.empty-state form { margin-top: 1.5rem; }
.empty-state button { width: auto; }

/* MCP token pages (templates/mcp/) */
.token-form { margin-top: 0; }
.token-form .grid a[role="button"] { text-align: center; }
.token-revoke { margin: 0; }
.token-revoke button { width: auto; margin: 0; padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.token-reveal { max-width: 40rem; }
.token-reveal__value { user-select: all; word-break: break-all; white-space: pre-wrap; }
.token-reveal footer a[role="button"] { text-align: center; }

/* WhatsApp linking page (templates/accounts/whatsapp_link.html) */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
}
.link-grid article { margin: 0; }
.link-grid article > header { font-weight: 600; }
.link-grid button { width: auto; }
.link-code { display: flex; align-items: baseline; gap: 0.75rem; }
.link-code code { font-size: 1.5rem; letter-spacing: 0.08em; }
.link-code small, .link-code--empty, .muted { color: var(--pico-muted-color); }

/* protected document viewer (templates/documents/viewer.html) */
.viewer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  margin-bottom: 1rem;
}
.viewer__meta div { margin: 0; }
.viewer__meta dt { font-size: 0.75rem; text-transform: uppercase; color: var(--pico-muted-color); }
.viewer__meta dd { margin: 0; }
.viewer__notice {
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--pico-primary);
  background: var(--pico-card-background-color);
}
.viewer__frame {
  display: block;
  width: 100%;
  height: 80vh;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
}
.viewer__frame--no-preview { height: auto; min-height: 0; border: 0; }
.viewer__hint { margin-top: 0.75rem; font-size: 0.875rem; }

/* Admin requirements matrix (templates/adminportal/requirements.html) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.journey-tabs ul { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.journey-tabs li { margin: 0; padding: 0; }
.journey-tabs a { display: block; padding: 0.4rem 0.8rem; border-radius: var(--pico-border-radius); color: var(--pico-muted-color); text-decoration: none; }
.journey-tabs a:hover { color: var(--pico-color); background: var(--pico-secondary-background, rgba(0, 0, 0, 0.04)); }
.journey-tabs a[aria-current="page"] { color: var(--pico-color); font-weight: 600; box-shadow: inset 0 -2px 0 var(--pico-primary); }
.requirements-matrix h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.requirements-matrix td { vertical-align: top; }
.requirements-matrix select, .requirements-matrix input.sort-order { margin-bottom: 0; }
.requirements-matrix input.sort-order { width: 6rem; }
.requirements-matrix button[type="submit"] { width: auto; }
.notice { padding: 0.6rem 0.9rem; border-left: 3px solid var(--pico-primary); background: var(--pico-card-background-color); }
.notice--success { border-left-color: var(--pico-ins-color); }

/* onboarding wizard (templates/companies/onboarding.html + partials/onboarding_*) */
[x-cloak] { display: none !important; }
.wizard { max-width: 52rem; }
.wizard__steps ol {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  counter-reset: none;
  overflow-x: auto;
}
.wizard__step { flex: 1; min-width: 9rem; margin: 0; padding: 0; }
.wizard__step a, .wizard__locked {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--pico-muted-border-color);
  color: var(--pico-muted-color);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.wizard__step a:hover { color: var(--pico-color); }
.wizard__step--current a { color: var(--pico-color); font-weight: 600; border-bottom-color: var(--pico-primary); }
.wizard__step--complete a { color: var(--pico-ins-color); }
.wizard__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  line-height: 1;
}
.wizard__step--complete .wizard__num { background: var(--pico-ins-color); border-color: var(--pico-ins-color); color: #fff; }
.wizard__panel { margin: 0; }
.wizard__panel > header small { display: block; margin-bottom: 0.25rem; }
.wizard__panel > header h2 { margin: 0; font-size: 1.25rem; }
.wizard__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.wizard__field--description, .wizard__field--use_of_funds, .wizard__field--name { grid-column: 1 / -1; }
.wizard__required { color: var(--pico-del-color); }
.wizard__actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 0.5rem; }
.wizard__actions button, .wizard__actions a[role="button"] { width: auto; margin: 0; }
.wizard__toggle { width: auto; margin: 0.5rem 0 0; padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.wizard__pending { margin: 1rem 0 0.25rem; }
.wizard__review-section { margin: 0 0 0.75rem; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); }
.wizard__review-section.has-missing { border-color: #b45309; }
.wizard__review-section > header { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0.75rem; }
.wizard__review-section > header a { margin-left: auto; font-size: 0.875rem; }
.wizard__review-section > div { padding: 0 0.75rem 0.5rem; border-top: 1px solid var(--pico-muted-border-color); }
.wizard__review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--pico-color);
  font-weight: 600;
  text-align: left;
}
.wizard__summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; margin: 0.75rem 0 0; }
.wizard__summary dt { font-size: 0.8rem; color: var(--pico-muted-color); }
.wizard__summary dd { margin: 0; white-space: pre-wrap; }

/* company profile (templates/companies/profile.html + partials/profile_*) */
.profile { max-width: 52rem; }
.profile__header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile__header h2 { margin: 0; font-size: 1.35rem; }
.profile__header p { margin: 0; }
.profile__edit { width: auto; margin: 0 0 0 auto; }
.profile__saved { margin: 0 0 1rem; padding: 0.5rem 0.75rem; border-radius: var(--pico-border-radius); background: var(--pico-ins-color); color: #fff; }
.profile__group { margin: 0 0 1rem; }
.profile__group > header { font-weight: 600; }
.profile__summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1rem; margin: 0; }
.profile__summary dt { font-size: 0.8rem; color: var(--pico-muted-color); }
.profile__summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile__row--description, .profile__row--use_of_funds { grid-column: 1 / -1; }

/* company documents (templates/companies/documents.html + partials/document_row.html) */
.documents__summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.documents__summary article { margin: 0; padding: 0.75rem 1rem; }
.documents__summary small { display: block; }
.documents__summary strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.documents__pending.has-pending strong { color: #b45309; }
.documents__section { margin: 0 0 1.25rem; }
.documents__section > header { font-weight: 600; }
.documents__table { min-width: 48rem; margin: 0; }
.documents__table td { vertical-align: top; }
.documents__table small { display: block; }
.document-row__actions { min-width: 16rem; }
.document-row__actions button { width: auto; margin: 0; }
.document-row__upload { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0; }
.document-row__upload input[type="file"] { flex: 1 1 10rem; margin: 0; }
.document-row__archive { margin-top: 0.5rem; }
.document-row__archive form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
.document-row__archive form small { flex-basis: 100%; }

/* company investors matrix (templates/companies/investors.html + partials/access_cell.html) */
.access-matrix__hint { margin-bottom: 0.75rem; }
.access-matrix__table { margin: 0; }
.access-matrix__table th, .access-matrix__table td { vertical-align: top; }
.access-matrix__table small { display: block; font-weight: 400; }
.access-matrix__investor { min-width: 12rem; }
.access-matrix__thesis { white-space: normal; }
.access-matrix__document { min-width: 14rem; }
.access-cell { text-align: center; }
.access-cell form { margin: 0; }
.access-cell__toggle { width: auto; margin: 0; padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.access-cell .field-error { display: block; margin-top: 0.25rem; }
.document-row__notice { color: var(--pico-ins-color); margin: 0 0 0.5rem; }
.document-row__actions .form-errors { margin: 0 0 0.5rem; }
.document-row__type strong { display: block; }
.document-row__filename { display: block; overflow-wrap: anywhere; }
.document-row__toggle { width: auto; margin: 0; padding: 0.3rem 0.65rem; font-size: 0.8rem; white-space: nowrap; }
.document-row__history > td { padding: 0.5rem 0.75rem 1rem; background: var(--pico-card-sectioning-background-color); }
.document-history { margin: 0; font-size: 0.875rem; }
.document-history tr.is-current td { font-weight: 600; }

/* company dashboard (templates/companies/dashboard.html) */
.dashboard__indicators {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dashboard__indicator { margin: 0; padding: 0.75rem 1rem; }
.dashboard__indicator-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.dashboard__indicator-head strong { font-size: 1.35rem; }
.dashboard__indicator progress { margin-bottom: 0.35rem; }
.dashboard__indicator small { display: block; }
.dashboard__indicator a { display: inline-block; margin-top: 0.35rem; font-size: 0.875rem; }
.dashboard__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dashboard__columns article { margin: 0; }
.dashboard__columns article > header { font-weight: 600; }
.dashboard__columns ul { margin-bottom: 0.5rem; }
.dashboard__columns ul ul { margin: 0.25rem 0 0; color: var(--pico-muted-color); font-size: 0.9rem; }
.dashboard__pending.has-pending > header { color: #b45309; }
.dashboard__uploaded > a { display: block; margin-top: 0.25rem; }
.dashboard__links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.dashboard__links a[role="button"] { width: auto; margin: 0; }

/* admin company detail (templates/adminportal/company_detail.html) */
.breadcrumb ul { display: flex; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 0.75rem; font-size: 0.875rem; color: var(--pico-muted-color); }
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.detail-grid article { margin: 0; }
.detail-panel > header { font-weight: 600; }
.detail-list { margin: 0; }
.detail-list dt { font-size: 0.8125rem; color: var(--pico-muted-color); }
.detail-list dd { margin: 0 0 0.75rem; }
.detail-list dd progress { margin-bottom: 0.25rem; }
.detail-list--columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1.5rem; }
.detail-list--columns dd { overflow-wrap: anywhere; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.panel-actions label { font-size: 0.8125rem; color: var(--pico-muted-color); }
.inline-form { margin: 0; }
.inline-form select, .inline-form button { margin-bottom: 0; width: auto; }
.cell-actions { text-align: right; white-space: nowrap; }
.cell-actions button { padding: 0.25rem 0.75rem; font-size: 0.875rem; }
.pending-list, .history-list, .member-list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; }
.badge--revoked { color: var(--pico-del-color); border-color: currentColor; }

/* admin marketplace (templates/adminportal/partners.html, services.html, service_requests.html) */
.section-tabs ul { display: flex; gap: 0.25rem; margin: 0 0 1rem; padding: 0 0 0.25rem; list-style: none; border-bottom: 1px solid var(--pico-muted-border-color); }
.section-tabs li { margin: 0; padding: 0; }
.section-tabs a { display: block; padding: 0.35rem 0.75rem; border-radius: var(--pico-border-radius); color: var(--pico-muted-color); text-decoration: none; }
.section-tabs a:hover { color: var(--pico-color); background: var(--pico-secondary-background, rgba(0, 0, 0, 0.04)); }
.section-tabs a[aria-current="page"] { color: var(--pico-color); font-weight: 600; }
.service-moderation__description { display: inline-block; max-width: 24rem; }
.service-request__details summary { font-size: 0.8125rem; color: var(--pico-muted-color); }
.badge--unpublished { color: var(--pico-del-color); border-color: currentColor; }

@media (max-width: 768px) {
  .documents__summary, .dashboard__columns { grid-template-columns: 1fr; }
  .wizard__fields, .wizard__summary, .profile__summary { grid-template-columns: 1fr; }
  .profile__header { flex-wrap: wrap; }
  .portal-header__row { flex-wrap: wrap; gap: 0.5rem 1rem; padding-top: 0.5rem; padding-bottom: 0.5rem; }
  .portal-nav { order: 3; flex-basis: 100%; }
  .toasts { left: 1rem; right: 1rem; max-width: none; }
  .profile-layout { grid-template-columns: 1fr; }
  .pipeline__columns { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar input[type="search"] { flex-basis: 100%; }
}

/* investor profile pages (templates/investors/profile*.html) */
.profile-card { max-width: 48rem; }
.profile-fields { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0; }
.profile-fields dt { color: var(--pico-muted-color); }
.profile-fields dd { margin: 0; }
.profile-form { max-width: 48rem; }
.profile-form .grid a[role="button"] { text-align: center; }
.choice-list > div { columns: 2; margin-bottom: 1rem; }
.choice-list label { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }

/* investor dashboard + discovery (templates/investors/dashboard.html, companies.html) */
.dashboard-grid .stat { margin: 0.25rem 0 0; font-size: 2rem; font-weight: 600; line-height: 1.2; color: var(--pico-h1-color); }
.dashboard-section { margin-top: 2rem; }
.dashboard-section__header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.dashboard-section__header h2 { margin: 0; font-size: 1.15rem; }
.company-filters { margin-bottom: 1.5rem; }
.company-filters__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0 1rem;
}
.company-filters__row label { font-size: 0.875rem; color: var(--pico-muted-color); }
.company-filters__actions { display: flex; gap: 0.5rem; }
.company-filters__actions button, .company-filters__actions a[role="button"] { width: auto; margin: 0; }
.results-summary, .results-empty { font-size: 0.875rem; }
.company-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 1rem; }
.company-card { margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.company-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.company-card__name { margin: 0; font-size: 1.05rem; }
.company-card__meta, .company-card__description { margin: 0; font-size: 0.875rem; color: var(--pico-muted-color); }
.company-card__footer { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-top: auto; padding-top: 0.5rem; font-size: 0.875rem; }
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; }
.pagination a[role="button"] { width: auto; margin: 0; padding: 0.35rem 0.9rem; font-size: 0.875rem; }

/* investment interests (SPEC §12, §15.5) */
.interest-panel__message { margin: 0.5rem 0; }
.interest-panel__edit summary { font-size: 0.875rem; color: var(--pico-muted-color); }
.interest-table__message { max-width: 24rem; }
.interest-table__status { margin: 0; padding-block: 0.25rem; width: auto; min-width: 10rem; }
.interest-table__assign { margin: 0; padding: 0.25rem 0.75rem; width: auto; font-size: 0.875rem; }
.interest-table__details p { margin: 0.25rem 0 0; font-size: 0.875rem; max-width: 24rem; }
.badge--new { color: var(--pico-primary); border-color: currentColor; }
.badge--reviewing, .badge--contacted, .badge--in_progress { color: #b45309; border-color: currentColor; }
.badge--closed { color: var(--pico-muted-color); }

/* notifications (SPEC §19): nav badge (templates/partials/notifications_badge.html) + list page */
.portal-user { display: flex; align-items: center; gap: 0.5rem; }
.notifications-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--pico-border-radius);
  color: var(--pico-muted-color);
  text-decoration: none;
  white-space: nowrap;
}
.notifications-badge:hover { color: var(--pico-color); text-decoration: none; }
.notifications-badge__count {
  min-width: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35rem;
  text-align: center;
}
.notification-list { display: flex; flex-direction: column; gap: 0.75rem; }
.notification { margin: 0; padding: 1rem 1.25rem; }
.notification--unread { border-left: 3px solid var(--pico-primary); }
.notification--read { opacity: 0.8; }
.notification__meta { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.5rem; padding: 0; background: none; font-size: 0.8rem; color: var(--pico-muted-color); }
.notification__dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--pico-primary); }
.notification__title { margin: 0 0 0.25rem; font-size: 1.05rem; }
.notification__body { margin: 0 0 0.5rem; font-size: 0.9rem; }
.notification__actions { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0; background: none; }
.notification__actions form { margin: 0; }
.notification__actions button { width: auto; margin: 0; padding: 0.3rem 0.8rem; font-size: 0.85rem; }
@media (max-width: 768px) {
  .notifications-badge__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* company marketplace (SPEC §13.3: templates/marketplace/browse.html, service_detail.html) */
.marketplace-filters { margin-bottom: 1.5rem; }
.marketplace-filters__row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr); gap: 0 1rem; }
.marketplace-filters__actions { display: flex; gap: 0.5rem; }
.marketplace-filters__actions button, .marketplace-filters__actions a[role="button"] { width: auto; margin: 0; }
.partner-group { margin-top: 1.5rem; }
.partner-group__header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.partner-group__name { margin: 0; font-size: 1.15rem; }
.partner-group__description { margin: 0.25rem 0 0.75rem; font-size: 0.875rem; color: var(--pico-muted-color); }
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.service-card { margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.service-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.service-card__name { margin: 0; font-size: 1.05rem; }
.service-card__description { margin: 0; font-size: 0.875rem; color: var(--pico-muted-color); }
.service-card__footer { margin-top: auto; padding-top: 0.5rem; font-size: 0.875rem; }
.service-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.5rem; align-items: start; }
.service-detail article { margin: 0; }
.service-detail article > header { font-weight: 600; }
.service-detail__partner { display: grid; gap: 1.5rem; }
.service-detail__partner-name { margin: 0 0 0.5rem; font-size: 1.15rem; }
.service-detail__actions [role="button"] { width: auto; }
.service-detail__others { margin: 0; padding-left: 1.25rem; }
/* solicitar contato + minhas solicitações (templates/marketplace/service_request.html, company_requests.html) */
.service-request { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1.5rem; align-items: start; }
.service-request__form textarea { margin-bottom: 0.25rem; }
.service-request__form .field-error { margin: 0 0 0.25rem; }
.service-request__form > .muted { display: block; margin-bottom: 1rem; }
.service-request__actions { display: flex; gap: 0.5rem; }
.service-request__actions button, .service-request__actions a[role="button"] { width: auto; margin: 0; }
.service-request__aside article { margin: 0; }
.service-request__aside article > header { font-weight: 600; }
.service-request__links { margin: 0; }
.company-requests__message { max-width: 24rem; font-size: 0.875rem; color: var(--pico-muted-color); }
.badge--accepted { color: #b45309; border-color: currentColor; }
.badge--won { color: var(--pico-ins-color); border-color: currentColor; }
.badge--lost { color: var(--pico-del-color); border-color: currentColor; }
/* admin audit trail (templates/adminportal/audit.html) */
.audit-filters { margin-bottom: 1rem; }
.audit-filters__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; align-items: end; }
.audit-filters__row label { margin-bottom: 0.5rem; font-size: 0.875rem; }
.audit-filters__row input, .audit-filters__row select { margin-bottom: 0; }
.audit-filters__actions { display: flex; gap: 0.5rem; align-items: center; grid-column: span 4; }
.audit-filters__actions button { width: auto; margin-bottom: 0; }
.audit-table td { vertical-align: top; }
.audit-metadata summary { cursor: pointer; }
.audit-metadata pre { max-width: 28rem; max-height: 12rem; overflow: auto; font-size: 0.75rem; margin: 0.25rem 0 0; }
@media (max-width: 768px) {
  .marketplace-filters__row, .service-detail, .service-request { grid-template-columns: 1fr; }
  .audit-filters__row { grid-template-columns: 1fr 1fr; }
  .audit-filters__actions { grid-column: span 2; }
}
