:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eaf0f8;
  --surface-3: #f8fafc;
  --ink: #10233f;
  --muted: #52657d;
  --line: #d9e2ec;
  --blue: #2357d5;
  --blue-2: rgba(35, 87, 213, 0.1);
  --green: #20b486;
  --green-2: rgba(32, 180, 134, 0.12);
  --amber: #f3a712;
  --amber-2: rgba(243, 167, 18, 0.14);
  --orange: #fb923c;
  --orange-2: rgba(251, 146, 60, 0.15);
  --red: #f87171;
  --red-2: rgba(248, 113, 113, 0.15);
  --shadow: 0 20px 55px rgba(16, 35, 63, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(10, 15, 25, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-direction: column;
}

.brand-logo {
  display: block;
  width: 206px;
  height: auto;
}

.brand-copy {
  display: block;
}
.sidebar .brand-copy strong { color: #10233f; }
.sidebar .brand-copy span { color: #42566f; }
#public-filter-vertical[multiple], #web-sector[multiple] { height: auto; min-height: 160px; color: #10233f; background: #fff; }
#public-vertical-help { display: block; color: #42566f; line-height: 1.5; margin-top: 6px; }
.public-vertical-control, #public-vertical-picker { min-width: 0; }
.public-vertical-control summary { display: flex; align-items: center; cursor: pointer; list-style: none; }
.public-vertical-control summary::-webkit-details-marker { display: none; }
.public-vertical-control summary::after { content: ""; flex: 0 0 6px; width: 6px; height: 6px; margin: -3px 2px 0 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.public-vertical-control details[open] > summary::after { margin-top: 3px; transform: rotate(225deg); }
#public-vertical-selection { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#public-vertical-choices { position: static; width: 100%; min-width: 0; min-inline-size: 0; max-width: 100%; max-height: 280px; overflow-y: auto; overflow-x: hidden; margin: 7px 0 0; padding: 10px; border: 1px solid #ced9e5; border-radius: 11px; background: #fff; }
#public-vertical-choices label { display: flex; align-items: flex-start; gap: 8px; white-space: normal; line-height: 1.5; padding: 8px 0; color: #10233f; }
#public-vertical-choices label > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
#public-vertical-choices input { flex: 0 0 18px; width: 18px; height: 18px; min-height: 18px; margin-top: 2px; }
.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; }

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #60a5fa, #22d3ee);
  color: #06101e;
  font-weight: 800;
}

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

.brand span,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(110, 168, 254, 0.35);
  background: var(--blue-2);
  color: #f8fbff;
}

.icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--blue);
}

.project-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(17, 23, 34, 0.94), rgba(13, 18, 28, 0.94));
}

.project-card h2 {
  margin: 8px 0;
  font-size: 20px;
}

.project-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-meta span,
.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #d7e2f2;
  font-size: 12px;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 4px 0 0;
  font-size: 30px;
  font-weight: 780;
  line-height: 1.12;
}

h2 {
  margin: 4px 0 0;
  font-size: 19px;
  font-weight: 740;
  line-height: 1.2;
}

p {
  line-height: 1.55;
}

.topbar-actions,
.panel-heading,
.panel-actions,
.score-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.text-button {
  min-height: 40px;
  border-radius: 8px;
  font-weight: 720;
}

.primary-button {
  border: 1px solid rgba(110, 168, 254, 0.48);
  background: linear-gradient(135deg, #2f7df4, #1bbdd1);
  color: #06101e;
  padding: 10px 14px;
}

.primary-button.cta-highlight {
  border-color: rgba(72, 211, 133, 0.9);
  box-shadow: 0 0 0 4px rgba(72, 211, 133, 0.14), 0 0 24px rgba(27, 189, 209, 0.28);
  animation: ctaBreath 1.8s ease-in-out infinite;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(17, 23, 34, 0.78);
  color: #d7e2f2;
  padding: 10px 14px;
}

.saved-card .ghost-button.active {
  border-color: #f0bcc8;
  background: #fff1f3;
  color: #bd2949;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.visibility-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.visibility-toggle:hover {
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.08);
  color: var(--ink);
}

.library-nav-item {
  margin-top: 10px;
  border-color: rgba(72, 211, 133, 0.28);
  background: rgba(72, 211, 133, 0.08);
}

.library-nav-item .icon {
  color: #48d385;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.78);
  color: #d7e2f2;
  padding: 10px 14px;
  font-weight: 720;
  text-decoration: none;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 8px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.dashboard-grid,
.matching-layout,
.detail-layout,
.recommendations-layout,
.users-layout {
  display: grid;
  gap: 18px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.matching-layout,
.detail-layout,
.users-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.web-radar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.decision-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.decision-header p {
  max-width: 760px;
}

.project-context {
  margin-top: 12px;
  white-space: pre-line;
  color: var(--muted);
  line-height: 1.5;
}

.scoring-details {
  margin-top: 14px;
}

.scoring-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 850;
}

.weight-controls {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.weight-controls label {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 760;
}

.weight-controls input {
  accent-color: var(--blue);
}

.weight-controls output {
  color: var(--muted);
  font-weight: 850;
  text-align: right;
}

.panel,
.readiness-panel,
.detail-summary,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.92);
  box-shadow: var(--shadow);
}

.panel,
.detail-summary {
  padding: 20px;
}

.readiness-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 24px;
}

.readiness-panel p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

.metric-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-row div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.metric-row strong {
  display: block;
  font-size: 28px;
}

.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

.score-ring {
  --angle: calc(var(--score) * 3.6deg);
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) var(--angle), #27364b 0deg);
  position: relative;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--surface);
}

.score-ring span,
.score-ring small {
  position: relative;
}

.score-ring span {
  align-self: end;
  font-size: 31px;
  font-weight: 850;
}

.score-ring small {
  align-self: start;
  color: var(--muted);
  font-weight: 700;
}

.score-ring.large {
  width: 144px;
  height: 144px;
  flex: 0 0 auto;
}

.deadline-list,
.opportunity-stack,
.gap-list,
.action-list,
.bar-list,
.why-list,
.checklist {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.deadline-item,
.opportunity-card,
.gap-item,
.action-item,
.requirement,
.why-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.deadline-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.deadline-item strong,
.deadline-item span {
  display: block;
}

.deadline-item span,
.opportunity-card p,
.action-item span,
.requirement span,
.why-item span {
  color: var(--muted);
  font-size: 13px;
}

.opportunity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.opportunity-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.opportunity-card p {
  margin: 0;
}

.match-badge {
  display: grid;
  min-width: 64px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  color: #06101e;
  font-weight: 850;
}

.match-badge.strong {
  background: var(--green);
}

.match-badge.viable {
  background: var(--amber);
}

.match-badge.weak {
  background: var(--orange);
}

.gap-item {
  width: 100%;
  text-align: left;
}

.gap-item strong,
.gap-item span {
  display: block;
}

.gap-item.high {
  border-color: rgba(251, 146, 60, 0.34);
  background: var(--orange-2);
}

.gap-item.medium {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--amber-2);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.toolbar input,
.toolbar select {
  min-height: 42px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 9px 11px;
  text-transform: none;
}

.table-card {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td {
  vertical-align: middle;
}

tr:hover td {
  background: rgba(110, 168, 254, 0.06);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.green {
  background: var(--green-2);
  color: var(--green);
}

.status-pill.amber {
  background: var(--amber-2);
  color: var(--amber);
}

.status-pill.orange {
  background: var(--orange-2);
  color: var(--orange);
}

.bar-item {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  color: #d7e2f2;
  font-weight: 750;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #27364b;
  overflow: hidden;
}

.bar-fill {
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

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

.requirement strong,
.requirement span {
  display: block;
}

.requirement.pass {
  border-color: rgba(74, 222, 128, 0.34);
  background: var(--green-2);
}

.requirement.warn {
  border-color: rgba(251, 191, 36, 0.34);
  background: var(--amber-2);
}

.detail-summary {
  background: linear-gradient(135deg, #10233f, #101825);
  color: var(--ink);
}

.detail-summary .eyebrow,
.detail-summary p {
  color: #bfd0e6;
}

.detail-stats div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.detail-stats strong,
.detail-stats span,
.checklist label {
  display: block;
}

.detail-stats span {
  color: #bfd0e6;
  font-size: 13px;
}

.checklist label {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist input {
  margin-right: 8px;
}

.full-span {
  grid-column: 1 / -1;
}

.impact-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.matrix-item {
  display: grid;
  gap: 8px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 14px;
  text-align: left;
  font-weight: 800;
}

.matrix-item span {
  color: var(--muted);
  font-size: 13px;
}

.high-impact {
  border-color: rgba(74, 222, 128, 0.34);
  background: var(--green-2);
}

.medium-impact {
  border-color: rgba(110, 168, 254, 0.34);
  background: var(--blue-2);
}

.decision-copy {
  max-width: 840px;
  color: var(--muted);
}

.muted-copy {
  color: var(--muted);
}

.diagnostic-form {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.diagnostic-form label,
.profile-form label,
.auth-grid label {
  display: grid;
  gap: 7px;
  color: #d7e2f2;
  font-size: 13px;
  font-weight: 800;
}

.diagnostic-form .full-field {
  grid-column: 1 / -1;
}

.diagnostic-form input,
.diagnostic-form select,
.diagnostic-form textarea,
.profile-form input,
.profile-form select,
.profile-form textarea,
.auth-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 9px 11px;
}

.diagnostic-form textarea,
.profile-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

.profile-form,
.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.auth-panel {
  border-color: rgba(72, 211, 133, 0.24);
}

.profile-form .full-field {
  grid-column: 1 / -1;
}

.auth-grid .full-field {
  grid-column: 1 / -1;
}

.profile-actions {
  margin-top: 16px;
}

.document-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.document-form label {
  display: grid;
  gap: 7px;
  color: #d7e2f2;
  font-size: 13px;
  font-weight: 800;
}

.document-form .full-field {
  grid-column: 1 / -1;
}

.document-form input,
.document-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 9px 11px;
}

.document-form textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}


.trl-field {
  grid-column: 1 / -1;
}

.trl-helper {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(110, 168, 254, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 125, 244, 0.12), rgba(27, 189, 209, 0.07));
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.trl-helper.pulse {
  animation: trlPulse 420ms ease-out;
}

.trl-helper-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trl-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(110, 168, 254, 0.14);
  color: #bfdbfe;
  font-weight: 850;
}

#trl-family {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.trl-helper p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.trl-helper small {
  color: var(--muted);
  line-height: 1.45;
}

@keyframes trlPulse {
  0% { transform: scale(0.995); border-color: rgba(110, 168, 254, 0.28); }
  50% { transform: scale(1.003); border-color: rgba(72, 211, 133, 0.55); }
  100% { transform: scale(1); border-color: rgba(110, 168, 254, 0.28); }
}
.form-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 8px;
}

.query-list,
.radar-flow {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.saved-opportunities,
.match-results,
.usage-history,
.document-list,
.insight-results,
.premium-results,
.source-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.source-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.saved-summary {
  margin-top: 10px;
  color: var(--muted);
}

.saved-card,
.match-card,
.document-card,
.role-card,
.insight-card,
.source-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.saved-card header,
.match-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.saved-card h3,
.match-card h3,
.role-card h2 {
  margin: 0;
  font-size: 17px;
}

.saved-card p,
.match-card p,
.document-card p,
.role-card p {
  margin: 0;
  color: var(--muted);
}

.saved-card a {
  color: var(--blue);
  font-weight: 750;
}

.source-card strong,
.source-card span,
.source-card a {
  min-width: 0;
}

.source-card strong {
  color: var(--text);
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
}

.source-card a {
  color: var(--blue);
  overflow-wrap: anywhere;
}

.saved-card-badges {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.locked-teaser {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(13, 18, 28, 0.72);
  filter: blur(0.2px);
  opacity: 0.72;
  padding: 16px;
}

.locked-teaser strong,
.locked-teaser span {
  display: block;
}

.locked-teaser span {
  margin-top: 6px;
  color: var(--muted);
}

.match-card {
  padding: 20px;
}

.match-card-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.match-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.source-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(110, 168, 254, 0.55);
  border-radius: 8px;
  background: var(--blue-2);
  color: var(--blue);
  padding: 9px 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.source-button:hover {
  border-color: var(--blue);
  background: rgba(110, 168, 254, 0.2);
}

.inline-source {
  width: fit-content;
  min-height: 34px;
  margin-top: 4px;
  padding: 7px 10px;
}

.premium-panel {
  border-color: rgba(77, 223, 133, 0.28);
}


.plan-document-upload {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(110, 168, 254, 0.22);
  border-radius: 8px;
  background: rgba(110, 168, 254, 0.06);
}

.plan-document-upload label {
  display: grid;
  gap: 7px;
  color: #d7e2f2;
  font-size: 13px;
  font-weight: 800;
}

.plan-document-upload input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 9px 11px;
}

.plan-document-upload .muted-copy {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
}
.premium-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.plan-selection-summary {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(110, 168, 254, 0.32);
  border-radius: 8px;
  background: rgba(110, 168, 254, 0.08);
  color: var(--ink);
}

.plan-opportunity-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.plan-opportunity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.plan-opportunity-card:hover,
.plan-opportunity-card.active {
  border-color: rgba(77, 223, 133, 0.42);
  background: rgba(77, 223, 133, 0.08);
}

.plan-opportunity-card strong,
.plan-opportunity-card span,
.plan-opportunity-card small {
  display: block;
}

.plan-opportunity-card span,
.plan-opportunity-card small {
  color: var(--muted);
}

.plan-opportunity-card small {
  margin-top: 6px;
  line-height: 1.45;
}

.match-card-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.premium-output,
.action-pill {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 16px;
}

.premium-output h3,
.action-pill h4 {
  margin: 0;
}

.loss-warning {
  margin: 0;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  color: #684600;
  padding: 12px 14px;
  font-weight: 780;
}

.pill-list,
.template-stack {
  display: grid;
  gap: 12px;
}

.action-pill header,
.pill-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.action-pill header strong {
  color: #08785c;
  white-space: nowrap;
}

.pill-footer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.artifact-details {
  border: 1px solid #c8d6e5;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.artifact-details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.artifact-details summary span {
  min-width: 0;
}

.copy-button {
  border: 1px solid #94b5ff;
  border-radius: 7px;
  background: #e8efff;
  color: #1747bd;
  padding: 6px 10px;
  font-weight: 820;
  cursor: pointer;
  flex: 0 0 auto;
}

.copy-button:hover {
  border-color: #2357d5;
  background: #dbe7ff;
  color: #102f82;
}

.artifact-details pre {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0 0;
  white-space: pre-wrap;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f7f9fc;
  color: #203957;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

.artifact-activity-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.artifact-activity-state {
  color: #52657d;
  font-size: 12px;
  font-weight: 700;
}

.artifact-complete-button {
  border: 1px solid #73d5b5;
  border-radius: 8px;
  background: #e7f8f2;
  color: #08785c;
  padding: 7px 11px;
  font-weight: 820;
  cursor: pointer;
  flex: 0 0 auto;
}

.artifact-complete-button:hover:not(:disabled) {
  border-color: #20b486;
  background: #d4f3e8;
}

.artifact-complete-button.is-complete {
  background: rgba(32, 180, 134, 0.18);
  cursor: default;
  opacity: 1;
}

@media (max-width: 640px) {
  .artifact-activity-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.system-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.system-grid div,
.premium-table-row {
  border: 1px solid #cfdbe8;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.system-grid strong,
.system-grid span {
  display: block;
}

.system-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.premium-table-section {
  display: grid;
  gap: 10px;
}

.premium-table-section h4 {
  margin: 0;
}

.premium-table {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.premium-table-row {
  display: grid;
  grid-template-columns: var(--premium-cols, repeat(auto-fit, minmax(140px, 1fr)));
  gap: 12px;
  min-width: max(var(--premium-min-width, 860px), 100%);
  align-items: start;
}

.premium-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #183b78;
  border-color: #183b78;
  padding-block: 8px;
}

.premium-table-head span {
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 850;
}

.premium-table-row span,
.premium-table-row [role="cell"] {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.premium-table-row .compact-cell {
  color: #1747bd;
  font-weight: 820;
}

.premium-table-row .wide-cell {
  max-width: 68ch;
}

.structured-list { margin: 0; padding-left: 18px; }
.structured-list li + li { margin-top: 6px; }
.structured-fields { display: grid; gap: 7px; margin: 0; min-width: 0; }
.structured-fields > div { min-width: 0; }
.structured-fields dt { font-weight: 700; font-size: 12px; color: var(--muted); }
.structured-fields dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.match-section-list > div,
.readiness-axis { overflow-wrap: anywhere; }
.premium-table [role="cell"] { min-width: 0; white-space: pre-wrap; }
.premium-table .source-button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.premium-table:focus-visible { outline: 2px solid #1747bd; outline-offset: 3px; }
.import-preview { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.import-preview form { display: grid; gap: 14px; }
.preview-field-group { display: grid; gap: 10px; padding: 12px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; }
.preview-field-group legend { padding: 0 5px; font-weight: 700; }
.preview-checkbox { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.preview-checkbox input { width: auto; }
.import-preview .artifact-details > .document-form { padding: 12px; }
.import-preview .form-actions { flex-wrap: wrap; }

.match-card-header h3 {
  font-size: 20px;
}

.match-sections {
  display: grid;
  gap: 18px;
}

.match-section {
  display: grid;
  gap: 10px;
}

.match-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-section-list {
  display: grid;
  gap: 8px;
}

.match-section-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 14px;
}

.match-section-list span {
  display: block;
  color: var(--ink);
  line-height: 1.45;
}

.score-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.score-breakdown-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 12px;
}

.score-breakdown-grid strong,
.score-breakdown-grid span {
  display: block;
}

.score-breakdown-grid strong {
  font-size: 22px;
}

.score-breakdown-grid span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.evidence-item {
  border-color: rgba(104, 158, 255, 0.45) !important;
}

.risk-item {
  border-color: rgba(245, 158, 11, 0.55) !important;
  background: rgba(245, 158, 11, 0.12) !important;
}

.action-item {
  border-color: rgba(78, 221, 133, 0.35) !important;
}

.empty-state {
  text-align: left;
}

.mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-card {
  background: rgba(17, 23, 34, 0.92);
}

.role-card.active {
  border-color: rgba(110, 168, 254, 0.5);
  box-shadow: 0 0 0 1px rgba(110, 168, 254, 0.2);
}

.role-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.match-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.match-map div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.match-map strong,
.match-map span {
  display: block;
}

.match-map span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.insight-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.usage-grid div,
.usage-entry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.usage-grid strong,
.usage-grid span,
.usage-entry strong,
.usage-entry span {
  display: block;
}

.usage-grid strong {
  font-size: 24px;
}

.usage-grid span,
.usage-entry span,
.usage-note {
  color: var(--muted);
  font-size: 13px;
}

.usage-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.query-card,
.radar-flow div {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.query-card strong,
.query-card span,
.radar-flow strong,
.radar-flow span {
  display: block;
}

.query-card span,
.radar-flow span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.query-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.query-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(110, 168, 254, 0.32);
  border-radius: 8px;
  background: var(--blue-2);
  color: var(--blue);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.web-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.web-filter-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  padding: 14px;
}

.web-filter-grid strong,
.web-filter-grid span {
  display: block;
}

.web-filter-grid span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.timeline div {
  min-height: 94px;
  padding: 14px;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--surface-3);
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  margin-top: 8px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e6f0ff;
  color: #07111f;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.onboarding-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(3, 7, 18, 0.52);
  pointer-events: none;
}

.onboarding-card {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(420px, calc(100vw - 32px));
  gap: 16px;
  border: 1px solid rgba(110, 168, 254, 0.32);
  border-radius: 8px;
  background: #101827;
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  padding: 18px;
}

.onboarding-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.onboarding-progress {
  display: flex;
  gap: 6px;
}

.onboarding-dot {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: #334155;
}

.onboarding-dot.active {
  background: var(--blue);
}

.onboarding-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.onboarding-highlight {
  position: relative;
  z-index: 25;
  outline: 2px solid rgba(110, 168, 254, 0.8);
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(110, 168, 254, 0.12);
}

.hidden {
  display: none;
}

@media (max-width: 1020px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    font-size: 13px;
  }

  .project-card {
    margin-top: 0;
  }

  .dashboard-grid,
  .matching-layout,
  .detail-layout,
  .recommendations-layout,
  .web-radar-layout,
  .users-layout,
  .match-map {
    grid-template-columns: 1fr;
  }

  .full-span {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .score-hero,
  .decision-header,
  .match-card-header,
  .match-card-actions,
  .match-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .source-button {
    white-space: normal;
  }

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

  .readiness-panel,
  .metric-row,
  .requirement-grid,
  .detail-stats,
  .impact-matrix,
  .timeline,
  .web-filter-grid,
  .usage-grid,
  .document-form,
  .insight-grid,
  .profile-form,
  .auth-grid,
  .weight-controls label,
  .score-breakdown-grid,
  .plan-opportunity-card {
    grid-template-columns: 1fr;
  }

  .weight-controls output {
    text-align: left;
  }

  .score-ring {
    justify-self: start;
  }

  h1 {
    font-size: 25px;
  }
}

/* UX simplification */
.process-nav {
  position: relative;
}

.process-nav .nav-item .icon {
  font-weight: 900;
}

.secondary-nav-item {
  opacity: 0.72;
}

.secondary-nav-item::before {
  content: "Apoyo";
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.next-step-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: rgba(77, 223, 133, 0.34);
  background: linear-gradient(135deg, rgba(47, 125, 244, 0.13), rgba(27, 189, 209, 0.08)), var(--surface-2);
}

.next-step-panel h2 {
  margin: 6px 0 8px;
}

.next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.process-nav .nav-item.completed .icon {
  background: rgba(87, 217, 126, 0.18);
  color: var(--green);
}

.process-nav .nav-item.completed .icon::after {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(87, 217, 126, 0.22);
  color: var(--green);
  font-size: 10px;
  line-height: 1;
}

@media (max-width: 1020px) {
  .next-step-panel {
    align-items: stretch;
    flex-direction: column;
  }
}
/* MVP testing mode */
.confidentiality-panel {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.decision-banner {
  display: grid;
  gap: 4px;
  width: fit-content;
  max-width: 720px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.decision-banner strong {
  font-size: 13px;
  letter-spacing: 0.05em;
}

.decision-banner span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.decision-banner.go {
  border-color: rgba(77, 223, 133, 0.48);
  background: rgba(77, 223, 133, 0.1);
}

.decision-banner.observe {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.decision-banner.no-go {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.11);
}

.readiness-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.readiness-axis,
.red-flag-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px 12px;
}

.readiness-axis span,
.readiness-axis small,
.red-flag-item span {
  color: var(--muted);
  line-height: 1.35;
}

.readiness-axis.ok {
  border-color: rgba(77, 223, 133, 0.32);
}

.readiness-axis.review {
  border-color: rgba(245, 158, 11, 0.35);
}

.readiness-axis.blocked,
.red-flag-item {
  border-color: rgba(248, 113, 113, 0.4);
}

.red-flag-list {
  display: grid;
  gap: 8px;
}

@media (max-width: 720px) {
  .readiness-index {
    grid-template-columns: 1fr;
  }
}
.project-portfolio-panel {
  display: grid;
  gap: 18px;
}

.project-portfolio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.project-picker {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  gap: 10px;
}

.project-picker select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 9px 11px;
}

.danger-button {
  color: #a12032;
}

@media (max-width: 760px) {
  .project-portfolio-header {
    flex-direction: column;
  }

  .project-picker {
    grid-template-columns: 1fr 1fr;
  }

  .project-picker select {
    grid-column: 1 / -1;
  }
}

/* Proyecto y radar */
.project-radar-layout {
  grid-template-columns: 1fr;
}

.project-radar-layout .diagnostic-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-radar-layout .diagnostic-panel textarea {
  min-height: 170px;
}

.radar-ready-panel {
  border-color: rgba(77, 223, 133, 0.32);
  background: rgba(77, 223, 133, 0.08);
}

.radar-history-panel {
  background: rgba(17, 23, 34, 0.74);
}

.radar-history-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.radar-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.radar-history-card:hover {
  border-color: rgba(110, 168, 254, 0.55);
  background: rgba(110, 168, 254, 0.08);
}

.radar-history-card strong,
.radar-history-card p,
.radar-history-card small {
  display: block;
}

.radar-history-card p {
  margin: 7px 0 0;
  color: var(--muted);
}

.radar-history-card small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 720px) {
  .project-radar-layout .diagnostic-form,
  .radar-history-card {
    grid-template-columns: 1fr;
  }
}

/* Processing states and opportunity selection */
.primary-button.is-processing,
.ghost-button.is-processing {
  position: relative;
  overflow: hidden;
  opacity: 0.9;
  animation: buttonPulse 1.15s ease-in-out infinite;
}

.primary-button.is-processing::after,
.ghost-button.is-processing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transform: translateX(-100%);
  animation: buttonSweep 1.25s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.16); }
}

@keyframes buttonSweep {
  100% { transform: translateX(100%); }
}

@keyframes ctaBreath {
  0%, 100% {
    transform: translateY(0);
    filter: brightness(1);
  }
  50% {
    transform: translateY(-1px);
    filter: brightness(1.12);
  }
}

.saved-card.selected {
  border-color: rgba(74, 222, 128, 0.42);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), rgba(13, 18, 28, 0.96));
}

.match-select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(110, 168, 254, 0.28);
  border-radius: 8px;
  background: rgba(110, 168, 254, 0.08);
  color: #d7e2f2;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.match-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.selection-summary {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 8px;
  background: rgba(74, 222, 128, 0.08);
  padding: 12px 14px;
}

.selection-summary span {
  color: var(--muted);
  font-size: 13px;
}

/* Public opportunity library */
.is-hidden,
.hidden {
  display: none !important;
}

.public-site {
  min-height: 100vh;
  background: #f4f7fb;
  color: #10233f;
}

.public-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 14px clamp(22px, 5vw, 76px);
  border-bottom: 1px solid rgba(217, 226, 236, 0.84);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.public-brand,
.public-nav-link {
  border: 0;
  background: transparent;
}

.public-brand img {
  display: block;
  width: 174px;
  height: auto;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.public-nav-link {
  padding: 10px 12px;
  color: #334760;
  font-weight: 720;
}

.public-nav-link:hover {
  color: #2357d5;
}

.public-login-button,
.mobile-filter-button,
.clear-public-filters {
  min-height: 42px;
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 780;
}

.public-login-button {
  border: 1px solid #2357d5;
  background: #2357d5;
  color: #fff;
}

.public-activity-button {
  display: inline-flex;
  min-width: 48px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #c8d6e5;
  border-radius: 999px;
  background: #fff;
  color: #2357d5;
  font-size: 20px;
}
.public-activity-button strong { min-width: 14px; color: #10233f; font-size: 12px; }
.public-activity-button:hover { border-color: #2357d5; background: #f2f6ff; }

.public-main {
  overflow: hidden;
}

.library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: center;
  gap: clamp(34px, 6vw, 88px);
  max-width: 1440px;
  min-height: 610px;
  margin: 0 auto;
  padding: 64px clamp(22px, 5vw, 76px) 72px;
  background:
    radial-gradient(circle at 9% 10%, rgba(14, 165, 168, 0.12), transparent 30rem),
    radial-gradient(circle at 90% 72%, rgba(35, 87, 213, 0.1), transparent 28rem);
}

.public-eyebrow {
  color: #076b6d;
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 14px 0 22px;
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 820;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-copy > p {
  max-width: 680px;
  margin: 0 0 30px;
  color: #52657d;
  font-size: clamp(17px, 1.5vw, 21px);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 720px);
  padding: 8px 9px 8px 20px;
  border: 1px solid #c8d6e5;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(16, 35, 63, 0.12);
}

.hero-search span {
  color: #2357d5;
  font-size: 26px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #10233f;
  font-size: 16px;
}

.hero-search:focus-within {
  border-color: rgba(35, 87, 213, 0.62);
  box-shadow: 0 20px 50px rgba(35, 87, 213, 0.16), 0 0 0 4px rgba(35, 87, 213, 0.08);
}

.hero-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 18px;
  width: min(100%, 720px);
  margin-top: 12px;
  color: #52657d;
  font-size: 12px;
  line-height: 1.45;
}

.hero-search-meta strong {
  color: #2357d5;
  font-size: 13px;
}

.hero-search-meta span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #0ea5a8;
  vertical-align: 1px;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 16px;
  color: #52657d;
  font-size: 13px;
  font-weight: 680;
}

.hero-proof span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #20b486;
}

.hero-visual {
  position: relative;
}

.hero-visual > img {
  display: block;
  width: 100%;
  border-radius: 30px;
  box-shadow: 0 28px 70px rgba(16, 35, 63, 0.22);
  transform: rotate(1.5deg);
}

.hero-floating-card {
  position: absolute;
  display: grid;
  gap: 3px;
  min-width: 152px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 38px rgba(16, 35, 63, 0.18);
}

.hero-floating-card span { color: #52657d; font-size: 12px; }
.hero-floating-card-a { top: 8%; left: -8%; }
.hero-floating-card-b { right: -5%; bottom: 8%; }

.library-metrics-section {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(520px, 1.2fr);
  align-items: center;
  gap: clamp(36px, 6vw, 96px);
  max-width: 1440px;
  margin: 0 auto;
  padding: 54px clamp(22px, 5vw, 76px);
  border-top: 1px solid rgba(35, 87, 213, 0.1);
  border-bottom: 1px solid rgba(35, 87, 213, 0.1);
  background: #fff;
}

.library-metrics-intro {
  max-width: 500px;
}

.library-metrics-intro h2 {
  margin: 10px 0 12px;
  color: #10233f;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.library-metrics-intro p {
  margin: 0;
  color: #52657d;
  font-size: 16px;
  line-height: 1.65;
}

.library-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.library-metric-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  min-height: 218px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(35, 87, 213, 0.14);
  border-radius: 26px;
  background: linear-gradient(145deg, #f7faff 0%, #edf4ff 100%);
  box-shadow: 0 18px 44px rgba(16, 35, 63, 0.08);
}

.library-metric-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -62px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(14, 165, 168, 0.09);
}

.library-metric-card .metric-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #2357d5;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.library-metric-card .metric-icon.secondary {
  background: #0ea5a8;
}

.library-metric-card .metric-icon.registered { background: #10233f; }

.library-metric-card > strong {
  align-self: center;
  justify-self: end;
  color: #10233f;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.public-counter {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.library-metric-card > div {
  grid-column: 1 / -1;
  align-self: end;
  position: relative;
  z-index: 1;
}

.library-metric-card h3 {
  margin: 0 0 6px;
  color: #10233f;
  font-size: 18px;
}

.library-metric-card p {
  margin: 0;
  color: #52657d;
  font-size: 14px;
  line-height: 1.5;
}

.public-library-section,
.how-section {
  padding: 76px clamp(22px, 5vw, 76px);
}

.public-library-section {
  background: #fff;
}

.library-heading-row,
.library-results-meta,
.filter-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.library-heading-row {
  max-width: 1440px;
  margin: 0 auto 30px;
}

.library-heading-row h2,
.how-section > h2 {
  margin-top: 8px;
  font-size: clamp(30px, 3.2vw, 46px);
  letter-spacing: -0.035em;
}

.mobile-filter-button {
  display: none;
  border: 1px solid #2357d5;
  background: #fff;
  color: #2357d5;
}

.mobile-filter-button span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 50%;
  background: #2357d5;
  color: #fff;
  font-size: 11px;
}

.public-library-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
}

.public-filter-panel {
  position: sticky;
  top: 102px;
  align-self: start;
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #d9e2ec;
  border-radius: 20px;
  background: #f8fafc;
  max-height: calc(100vh - 118px);
  max-height: calc(100dvh - 118px);
  overflow-y: auto;
}

.filter-panel-heading h3 { margin: 5px 0 0; font-size: 22px; }
.filter-close { display: none; border: 0; background: transparent; color: #10233f; font-size: 30px; }

.public-filter-panel label,
.public-filter-panel .public-vertical-control,
.access-modal label {
  display: grid;
  gap: 7px;
  color: #42566f;
  font-size: 13px;
  font-weight: 760;
}

.public-filter-panel select,
.public-vertical-control summary {
  font: inherit;
  line-height: 1.4;
}

.public-filter-panel select,
.public-vertical-control summary,
.access-modal input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #ced9e5;
  border-radius: 11px;
  background: #fff;
  color: #10233f;
  padding: 9px 11px;
}

.clear-public-filters {
  border: 1px solid #ced9e5;
  background: #fff;
  color: #2357d5;
}

.library-results { min-width: 0; }
.library-results-meta { margin: 0 0 18px; color: #52657d; font-size: 13px; }
.library-results-meta strong { color: #10233f; font-size: 16px; }

.active-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(35, 87, 213, 0.22);
  border-radius: 999px;
  background: rgba(35, 87, 213, 0.07);
  color: #2357d5;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 760;
}

.active-filter-chip button { border: 0; background: transparent; color: inherit; font-weight: 900; }

.public-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.public-opportunity-card {
  overflow: hidden;
  display: flex;
  min-width: 0;
  min-height: 510px;
  flex-direction: column;
  border: 1px solid #dce4ed;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(16, 35, 63, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  cursor: pointer;
}

.public-opportunity-card:hover,
.public-opportunity-card:focus-visible {
  border-color: rgba(35, 87, 213, 0.42);
  box-shadow: 0 20px 45px rgba(16, 35, 63, 0.14);
  transform: translateY(-4px);
  outline: none;
}

.opportunity-image-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(145deg, #eaf1fa, #dfe9f5);
}

.opportunity-image-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; }
.opportunity-image-label { position: absolute; left: 16px; bottom: 14px; max-width: calc(100% - 32px); color: #fff; font-size: 13px; font-weight: 820; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.opportunity-image-wrap img[data-public-image-fallback="true"] ~ .opportunity-image-label { display: none; }
.card-favorite-button {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #2357d5;
  box-shadow: 0 7px 20px rgba(16,35,63,.18);
  font-size: 23px;
}
.card-favorite-button.active { background: #fff1f3; color: #d13f5d; }
.card-share-button {
  position: absolute;
  top: 13px;
  right: 64px;
  z-index: 3;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #2357d5;
  box-shadow: 0 7px 20px rgba(16,35,63,.18);
}
.card-share-button:hover,
.card-share-button:focus-visible { background: #edf3ff; color: #173fa5; outline: 2px solid rgba(35,87,213,.32); outline-offset: 2px; }
.card-share-button svg { width: 20px; height: 20px; fill: currentColor; }

.open-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  color: #08785c;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 840;
}

.open-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #20b486; }
.opportunity-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px; }
.opportunity-org { color: #2357d5; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.public-opportunity-card h3 { margin: 9px 0 10px; color: #10233f; font-size: 21px; line-height: 1.18; }
.public-opportunity-card p { margin: 0 0 16px; color: #52657d; font-size: 14px; line-height: 1.5; }
.card-tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 17px; }
.card-tag { border-radius: 999px; background: #eaf0f8; color: #42566f; padding: 5px 8px; font-size: 11px; font-weight: 720; }
.card-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: auto; padding-top: 15px; border-top: 1px solid #e4eaf1; }
.card-facts span { display: grid; gap: 3px; color: #52657d; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.card-facts strong { color: #10233f; font-size: 12px; text-transform: none; letter-spacing: 0; }

.library-empty {
  grid-column: 1 / -1;
  padding: 70px 24px;
  border: 1px dashed #c8d6e5;
  border-radius: 20px;
  background: #f8fafc;
  text-align: center;
}

.how-section { max-width: 1440px; margin: 0 auto; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.how-grid article { padding: 26px; border: 1px solid #d9e2ec; border-radius: 20px; background: #fff; box-shadow: 0 12px 30px rgba(16,35,63,.06); }
.how-grid article > span { color: #076b6d; font-weight: 850; }
.how-grid h3 { margin: 14px 0 5px; font-size: 22px; }
.how-grid p { margin: 0; color: #52657d; }

.public-backdrop,
.access-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  background: rgba(16, 35, 63, 0.48);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.public-backdrop.open,
.access-modal-wrap.open { visibility: visible; opacity: 1; }

.opportunity-drawer {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  width: min(820px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 26px;
  background: #fff;
  color: #10233f;
  box-shadow: 0 30px 90px rgba(16,35,63,.3);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%) scale(0.97);
  transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease;
}

.opportunity-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.drawer-close { position: absolute; top: 16px; right: 16px; z-index: 2; display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #d9e2ec; border-radius: 50%; background: #fff; color: #10233f; font-size: 26px; }
.drawer-close-on-image { z-index: 4; border-color: rgba(255,255,255,.72); background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(16,35,63,.22); backdrop-filter: blur(8px); }
.drawer-hero { position: relative; display: grid; place-items: center; overflow: hidden; margin: -24px -24px 26px; aspect-ratio: 16/9; background: linear-gradient(145deg, #eaf1fa, #dfe9f5); }
.drawer-hero img { display: block; width: 100%; height: 100%; object-fit: contain; }
.drawer-content h2 { margin: 10px 0 8px; font-size: 32px; letter-spacing: -.03em; }
.drawer-lead { color: #52657d; font-size: 16px; }
.drawer-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; }
.drawer-facts div { padding: 14px; border-radius: 13px; background: #f4f7fb; }
.drawer-facts span { display: block; color: #52657d; font-size: 11px; text-transform: uppercase; }
.drawer-facts strong { display: block; margin-top: 4px; font-size: 14px; }
.drawer-beneficiaries { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 24px; }
.drawer-utility-actions { display: flex; gap: 9px; margin: -8px 0 16px; }
.drawer-icon-action { display: inline-flex; min-height: 38px; align-items: center; gap: 7px; border: 1px solid #d9e2ec; border-radius: 999px; background: #fff; color: #334760; padding: 7px 13px; font-weight: 760; }
.drawer-icon-action:hover { border-color: #2357d5; color: #2357d5; }
.drawer-icon-action.active { border-color: #f2c9d2; background: #fff1f3; color: #c73656; }
.drawer-actions { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(190px, .65fr); gap: 12px; margin-top: 4px; }
.drawer-cta { width: 100%; min-height: 50px; border: 0; border-radius: 12px; background: #2357d5; color: #fff; padding: 12px 16px; font-weight: 800; }
.drawer-source-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 1px solid rgba(35,87,213,.28); border-radius: 12px; background: #fff; color: #2357d5; padding: 12px 16px; font-weight: 800; text-align: center; text-decoration: none; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; }
.drawer-source-link:hover { border-color: #2357d5; background: #f2f6ff; transform: translateY(-1px); }
.drawer-source-link:focus-visible { outline: 3px solid rgba(35,87,213,.24); outline-offset: 2px; }
.drawer-source { display: block; margin-top: 14px; color: #52657d; font-size: 12px; text-align: center; }

.public-activity-panel {
  position: fixed;
  z-index: 95;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(470px, 94vw);
  overflow-y: auto;
  padding: 28px;
  border-left: 1px solid #d9e2ec;
  background: #fff;
  color: #10233f;
  box-shadow: -24px 0 70px rgba(16,35,63,.22);
  visibility: hidden;
  transform: translateX(105%);
  transition: transform 220ms ease, visibility 0s linear 220ms;
}
.public-activity-panel.open { visibility: visible; transform: translateX(0); transition-delay: 0s; }
@media (prefers-reduced-motion: reduce) {
  .public-activity-panel { transition: none; }
}
.activity-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.activity-panel-heading h2 { margin: 5px 54px 0 0; font-size: 30px; }
.activity-close { position: absolute; top: 24px; right: 24px; }
.activity-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 25px 0 18px; padding: 5px; border-radius: 14px; background: #eef3f8; }
.activity-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: #52657d; font-weight: 800; }
.activity-tabs button.active { background: #fff; color: #2357d5; box-shadow: 0 4px 14px rgba(16,35,63,.08); }
.activity-tabs span { margin-left: 5px; }
.activity-list { display: grid; gap: 11px; }
.activity-opportunity { position: relative; display: grid; grid-template-columns: 92px minmax(0,1fr) 36px; gap: 13px; align-items: center; min-width: 0; border: 1px solid #dce4ed; border-radius: 15px; background: #fff; padding: 9px; cursor: pointer; }
.activity-opportunity:hover, .activity-opportunity:focus-visible { border-color: rgba(35,87,213,.45); outline: none; }
.activity-opportunity img { width: 92px; height: 66px; object-fit: contain; border-radius: 9px; background: #eef3f8; }
.activity-opportunity div { display: grid; min-width: 0; gap: 3px; }
.activity-opportunity span { overflow: hidden; color: #2357d5; font-size: 10px; font-weight: 800; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.activity-opportunity strong { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.activity-opportunity small { color: #52657d; font-size: 11px; }
.activity-favorite { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #d9e2ec; border-radius: 50%; background: #fff; color: #2357d5; font-size: 18px; }
.activity-favorite.active { border-color: #f2c9d2; background: #fff1f3; color: #c73656; }
.activity-empty { display: grid; justify-items: center; gap: 8px; padding: 58px 24px; border: 1px dashed #c8d6e5; border-radius: 18px; background: #f8fafc; text-align: center; }
.activity-empty > span { color: #2357d5; font-size: 36px; }
.activity-empty p { margin: 0; color: #52657d; line-height: 1.5; }

.access-modal-wrap { display: grid; place-items: center; padding: 20px; z-index: 110; }
.access-modal { position: relative; display: grid; gap: 15px; width: min(470px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 34px; border-radius: 24px; background: #fff; box-shadow: 0 30px 90px rgba(16,35,63,.3); }
.access-modal h2 { margin: 2px 40px 0 0; color: #10233f; font-size: 30px; }
.access-modal p { margin: 0; color: #52657d; }
.access-auth-form { display: grid; gap: 15px; }
.access-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.access-modal .primary-button { background: #2357d5; color: #fff; }
.access-modal .ghost-button { background: #fff; color: #2357d5; border-color: #c8d6e5; }
.full-width { width: 100%; }
.access-divider { position: relative; text-align: center; color: #7b899c; font-size: 11px; }
.access-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid #d9e2ec; }
.access-divider span { position: relative; background: #fff; padding: 0 10px; }
.access-error { min-height: 20px; color: #c13e3e !important; font-size: 13px; }

/* Light workspace refresh */
.app-shell { background: #f4f7fb; color: #10233f; }
.sidebar { border-color: #d9e2ec; background: rgba(255,255,255,.96); }
.nav-item { color: #42566f; }
.nav-item:hover, .nav-item.active { color: #10233f; }
.project-card, .panel, .saved-card, .source-card, .document-card { border-color: #d9e2ec; background: #fff; color: #10233f; box-shadow: 0 10px 28px rgba(16,35,63,.06); }
.project-card p, .saved-card p, .muted-copy { color: #52657d; }
.ghost-button, .ghost-link { border-color: #ced9e5; background: #fff; color: #334760; }
.primary-button { border-color: #2357d5; background: #2357d5; color: #fff; }
.tag, .project-meta span { background: #eaf0f8; color: #42566f; }
.match-select-control { border-color: rgba(35,87,213,.24); background: rgba(35,87,213,.06); color: #334760; }
.saved-card.selected { border-color: rgba(32,180,134,.46); background: linear-gradient(180deg, rgba(32,180,134,.08), #fff); }
.workspace-saved-notice { border-color: rgba(32,180,134,.4); background: linear-gradient(135deg, rgba(32,180,134,.1), #fff); }
.process-nav .library-nav-item { display: none; }

@media (max-width: 1180px) {
  .public-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-hero { grid-template-columns: 1fr 0.85fr; }
  .library-metrics-section { grid-template-columns: 1fr; gap: 28px; }
  .library-metrics-intro { max-width: 760px; }
}

@media (max-width: 840px) {
  .public-header { min-height: 68px; padding: 12px 18px; }
  .public-brand img { width: 145px; }
  .public-nav-link { display: none; }
  .library-hero { grid-template-columns: 1fr; min-height: auto; padding-top: 48px; }
  .hero-visual { max-width: 600px; }
  .hero-floating-card-a { left: 3%; }
  .hero-floating-card-b { right: 2%; }
  .library-metrics-section { padding: 44px 18px; }
  .public-library-section, .how-section { padding: 56px 18px; }
  .mobile-filter-button { display: inline-flex; align-items: center; }
  .public-library-layout { grid-template-columns: 1fr; }
  .public-filter-panel { position: fixed; z-index: 105; top: 0; left: 0; bottom: 0; width: min(360px, 92vw); max-height: 100vh; max-height: 100dvh; overflow-y: auto; border-radius: 0 22px 22px 0; box-shadow: 24px 0 60px rgba(16,35,63,.22); transform: translateX(-105%); transition: transform 220ms ease; }
  .public-filter-panel.open { transform: translateX(0); }
  .filter-close { display: block; }
  .how-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .public-card-grid { grid-template-columns: 1fr; }
  .public-opportunity-card { min-height: 490px; }
  .hero-copy h1 { font-size: 43px; }
  .hero-proof { display: grid; }
  .hero-floating-card { display: none; }
  .library-metrics-grid { grid-template-columns: 1fr; }
  .library-metric-card { min-height: 190px; }
  .library-heading-row { align-items: flex-end; }
  .library-results-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .drawer-facts { grid-template-columns: 1fr; }
  .opportunity-drawer { width: calc(100% - 20px); max-height: calc(100vh - 20px); padding: 20px; border-radius: 20px; }
  .drawer-hero { margin: -20px -20px 22px; aspect-ratio: 16/7; }
  .drawer-actions { grid-template-columns: 1fr; }
  .access-actions { grid-template-columns: 1fr; }
  .access-modal { padding: 28px 22px; }
  .public-activity-panel { width: 100%; padding: 22px 16px; }
}

/* Progressive disclosure and workspace profile */
.workspace-profile-menu { position: relative; flex: 0 0 auto; }
.workspace-profile-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(35,87,213,.24);
  border-radius: 50%;
  background: #2357d5;
  color: #fff;
  font-size: 17px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(35,87,213,.2);
}
.workspace-profile-button:hover,
.workspace-profile-button[aria-expanded="true"] { background: #1747bd; transform: translateY(-1px); }
.account-popover {
  position: absolute;
  z-index: 70;
  top: calc(100% + 12px);
  right: 0;
  width: min(430px, calc(100vw - 40px));
  padding: 20px;
  border: 1px solid #d9e2ec;
  border-radius: 18px;
  background: #fff;
  color: #10233f;
  box-shadow: 0 24px 70px rgba(16,35,63,.2);
}
.account-popover[aria-hidden="true"] { display: none; }
.account-popover .auth-grid label { color: #42566f; }
.account-popover .auth-grid input { border-color: #d9e2ec; background: #f7f9fc; color: #10233f; }
.account-popover-heading { align-items: flex-start; }
.account-identity { margin: 10px 0 0; color: #52657d; font-size: 13px; }

.workspace-disclosure { padding: 0; overflow: hidden; }
.workspace-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  color: #10233f;
  cursor: pointer;
  list-style: none;
}
.workspace-disclosure > summary::-webkit-details-marker { display: none; }
.workspace-disclosure > summary::after { content: "+"; color: #2357d5; font-size: 24px; font-weight: 700; }
.workspace-disclosure[open] > summary::after { content: "−"; }
.workspace-disclosure > summary > span:first-child { display: grid; gap: 4px; }
.workspace-disclosure > summary small { color: #0b8f91; font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.workspace-disclosure > summary > span:last-of-type { margin-left: auto; color: #52657d; font-size: 13px; font-weight: 750; }
.workspace-disclosure-content { padding: 0 20px 20px; border-top: 1px solid #e5ebf2; }
.workspace-disclosure-actions { display: flex; justify-content: flex-end; padding: 0 20px 20px; }

.selection-evaluate-bar,
.matching-run-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f4f7fb;
}
.selection-evaluate-bar span { color: #52657d; font-weight: 700; }
.primary-button:disabled { cursor: not-allowed; opacity: .48; }

.project-advanced-toggle { grid-column: 1 / -1; justify-self: start; }

.match-analysis-details { margin-top: 14px; border-top: 1px solid #e2e8f0; }
.match-analysis-details > summary {
  padding: 14px 0 2px;
  color: #2357d5;
  cursor: pointer;
  font-weight: 820;
}
.match-analysis-details .match-sections { margin-top: 14px; }
.match-section-disclosure {
  border: 1px solid #dfe7f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 0;
}
.match-section-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #17365f;
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
}
.match-section-disclosure > summary span {
  min-width: 28px;
  border-radius: 999px;
  background: #e8eefb;
  color: #2357d5;
  padding: 4px 8px;
  text-align: center;
  font-size: 12px;
}
.match-section-disclosure .match-section-list { padding: 0 16px 16px; }
.report-actions { display: flex; justify-content: flex-end; }

.cohort-launch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px auto 0;
  padding: 10px 16px;
  max-width: 1180px;
  border: 1px solid rgba(32, 180, 134, .34);
  border-radius: 16px;
  background: linear-gradient(120deg, rgba(32, 180, 134, .12), rgba(35, 87, 213, .07));
}
.cohort-launch-banner > div { display: grid; gap: 2px; }
.cohort-launch-banner p { margin: 0; color: #334760; font-size: 13px; line-height: 1.35; }
.cohort-launch-banner strong { font-size: 14px; }
.cohort-launch-kicker { color: #08785c; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.cohort-launch-action {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: #10233f;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
.cohort-workspace-badge { border-radius: 999px; padding: 7px 11px; background: #e2f8f0; color: #08785c; font-size: 12px; font-weight: 850; }
.nav-label { display: grid; gap: 2px; text-align: left; }
.nav-label small { color: #6f8097; font-size: 10px; font-weight: 750; }
.sidebar-link.active .nav-label small { color: rgba(255, 255, 255, .72); }

@media print {
  body.print-action-report { background: #fff !important; }
  body.print-action-report * { visibility: hidden !important; }
  body.print-action-report #premium-action-results,
  body.print-action-report #premium-action-results * { visibility: visible !important; }
  body.print-action-report #premium-action-results {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
  }
  body.print-action-report .report-actions,
  body.print-action-report .copy-button,
  body.print-action-report .artifact-complete-button { display: none !important; }
  body.print-action-report .premium-output,
  body.print-action-report .action-pill,
  body.print-action-report .artifact-details,
  body.print-action-report .premium-table-section { break-inside: avoid; color: #10233f; background: #fff; }
  body.print-action-report .artifact-details { display: block; }
  body.print-action-report .artifact-details > summary { display: block; }
  body.print-action-report .artifact-details > pre { display: block; white-space: pre-wrap; }
}

.plan-document-guidance { display: grid; grid-column: 1 / -1; gap: 6px; color: #334760; }
.plan-document-guidance span { color: #52657d; font-size: 13px; line-height: 1.5; }
.plan-document-guidance .source-button { width: fit-content; margin-top: 4px; }

.radar-current-results { border-color: rgba(32,180,134,.38); background: linear-gradient(145deg, rgba(32,180,134,.08), #fff 38%); }
.radar-current-results-list { display: grid; gap: 10px; margin-top: 14px; }
.radar-current-result-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #fff;
  color: #10233f;
  text-align: left;
}
.radar-current-result-card:hover { border-color: rgba(35,87,213,.42); background: #f6f9ff; }
.radar-current-result-card > span:first-child { display: grid; gap: 5px; min-width: 0; }
.radar-current-result-card strong { line-height: 1.35; }
.radar-current-result-card small { color: #52657d; }
.radar-result-count {
  display: grid;
  min-width: 116px;
  place-items: center;
  gap: 2px;
  border-radius: 14px;
  padding: 10px 12px;
  background: #eaf0f8;
  color: #10233f;
  text-align: center;
}
.radar-result-count.strong { background: rgba(32,180,134,.16); color: #08785c; }
.radar-result-count.viable { background: rgba(243,167,18,.18); color: #8b5c00; }
.radar-result-count strong { font-size: 22px; line-height: 1; }
.radar-result-count small { color: inherit; font-size: 11px; font-weight: 800; }

.preliminary-results-disclosure {
  border: 1px solid rgba(243, 167, 18, .38);
  border-radius: 18px;
  background: #fffaf0;
  overflow: hidden;
}

.preliminary-results-disclosure > summary,
.preliminary-opportunity-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
}

.preliminary-results-disclosure > summary::-webkit-details-marker,
.preliminary-opportunity-card > summary::-webkit-details-marker { display: none; }
.preliminary-results-disclosure > summary > span:first-child,
.preliminary-opportunity-card > summary > span:first-child { display: grid; gap: 5px; }
.preliminary-results-disclosure > summary small,
.preliminary-opportunity-card > summary small { color: var(--muted); }
.preliminary-results-disclosure > summary > span:last-child { color: #8b5c00; font-weight: 800; white-space: nowrap; }

.preliminary-results-list {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.preliminary-opportunity-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.preliminary-opportunity-card[open] > summary { border-bottom: 1px solid var(--line); }
.preliminary-opportunity-content { display: grid; gap: 14px; padding: 18px 22px 22px; }
.preliminary-opportunity-content p { margin: 0; }
.preliminary-reason { padding: 12px 14px; border-radius: 10px; background: #fff6df; color: #684600; }
.preliminary-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.compact-button { min-height: 42px; padding: 9px 15px; }
.legacy-preliminary-note { margin: 0; padding: 14px; border-radius: 10px; background: #f4f7fb; color: var(--muted); }

@media (max-width: 720px) {
  .cohort-launch-banner { align-items: stretch; flex-direction: column; margin-inline: 14px; }
  .cohort-launch-action { width: 100%; }
  .topbar-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .workspace-profile-menu { margin-left: auto; }
  .account-popover { position: fixed; top: 74px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 90px); overflow-y: auto; }
  .selection-evaluate-bar,
  .matching-run-panel { align-items: stretch; flex-direction: column; }
  .selection-evaluate-bar .primary-button,
  .matching-run-panel .primary-button { width: 100%; }
  .workspace-disclosure > summary { align-items: flex-start; }
  .workspace-disclosure > summary > span:last-of-type { display: none; }
  .radar-current-result-card { align-items: flex-start; flex-direction: column; }
  .preliminary-results-disclosure > summary,
  .preliminary-opportunity-card > summary { align-items: flex-start; flex-direction: column; }
  .preliminary-actions { align-items: stretch; flex-direction: column; }
  .preliminary-actions > * { width: 100%; text-align: center; }
}

/* Compact density: less scrolling without reducing legibility */
.main { padding: 20px; }
.topbar { gap: 14px; margin-bottom: 16px; }
.sidebar { gap: 16px; padding: 18px; }
.nav-list { gap: 5px; }
.nav-item { min-height: 38px; padding: 8px 10px; }
.project-card { padding: 14px; }
.project-card h2 { margin: 6px 0; }
.project-card p { margin-bottom: 10px; line-height: 1.4; }

.dashboard-grid,
.matching-layout,
.detail-layout,
.recommendations-layout,
.users-layout,
.web-radar-layout,
.section-stack { gap: 12px; }

.panel,
.detail-summary { padding: 15px 16px; }
.readiness-panel { gap: 12px; padding: 16px; }
.decision-header { gap: 12px; }
.decision-header p,
.panel > .muted-copy { margin: 6px 0 0; line-height: 1.42; }
.panel-heading,
.panel-actions,
.score-hero { gap: 10px; }
.project-context { margin-top: 8px; }

.diagnostic-form,
.profile-form,
.auth-grid { gap: 10px; margin-top: 12px; }
.diagnostic-form label,
.profile-form label,
.auth-grid label,
.document-form label { gap: 5px; }
.diagnostic-form input,
.diagnostic-form select,
.profile-form input,
.profile-form select,
.auth-grid input,
.document-form input,
.project-picker select,
.plan-document-upload input { min-height: 40px; padding: 7px 10px; }
.diagnostic-form textarea,
.profile-form textarea { min-height: 96px; padding: 8px 10px; }
.project-radar-layout .diagnostic-panel textarea { min-height: 118px; }
.document-form { gap: 10px; margin-top: 12px; }
.document-form textarea { min-height: 100px; padding: 8px 10px; }
.form-actions { gap: 8px; padding-top: 4px; }
.profile-actions { margin-top: 10px; }
.trl-helper { gap: 6px; padding: 9px 11px; }

.query-list,
.radar-flow,
.saved-opportunities,
.match-results,
.usage-history,
.document-list,
.insight-results,
.premium-results,
.source-grid { gap: 8px; margin-top: 10px; }
.saved-summary { margin-top: 7px; }
.saved-card,
.document-card,
.role-card,
.insight-card,
.source-card { gap: 7px; padding: 11px 12px; }
.saved-card header,
.match-card header { gap: 10px; }
.saved-card-badges,
.mini-meta { gap: 6px; }
.selection-summary { padding: 9px 11px; }
.selection-evaluate-bar,
.matching-run-panel { gap: 12px; margin-top: 12px; padding: 11px 12px; }

.match-card { gap: 8px; padding: 14px 16px; }
.match-card-header { padding-bottom: 10px; }
.match-card-actions { gap: 8px; }
.match-card-footer { margin-top: 9px; }
.match-sections { gap: 10px; }
.match-section { gap: 7px; }
.match-section-list { gap: 6px; }
.match-section-list div { padding: 9px 11px; }
.match-analysis-details { margin-top: 9px; }
.match-analysis-details > summary { padding: 10px 0 1px; }
.match-analysis-details .match-sections { margin-top: 9px; }
.match-section-disclosure > summary { padding: 10px 13px; }
.match-section-disclosure .match-section-list { padding: 0 12px 12px; }
.score-breakdown-grid { gap: 7px; }
.score-breakdown-grid div { padding: 9px 10px; }

.workspace-disclosure > summary { gap: 12px; padding: 12px 16px; }
.workspace-disclosure-content { padding: 0 16px 14px; }
.workspace-disclosure-actions { padding: 0 16px 14px; }
.preliminary-results-disclosure > summary,
.preliminary-opportunity-card > summary { gap: 12px; padding: 13px 16px; }
.preliminary-results-list { gap: 8px; padding: 0 12px 12px; }
.preliminary-opportunity-content { gap: 9px; padding: 12px 16px 15px; }
.preliminary-reason { padding: 9px 11px; }
.radar-current-results-list { gap: 7px; margin-top: 9px; }
.radar-current-result-card { gap: 12px; padding: 10px 12px; }

.plan-document-upload { margin-top: 10px; padding: 10px; }
.premium-actions,
.plan-selection-summary { margin-top: 10px; }
.plan-opportunity-list { gap: 8px; margin-top: 10px; }
.plan-opportunity-card { gap: 10px; padding: 10px 12px; }
.premium-output,
.action-pill { gap: 10px; padding: 12px; }
.pill-list,
.template-stack { gap: 8px; }
.artifact-details { padding: 8px 10px; }
.artifact-details pre { margin-top: 8px; padding: 10px; }
.artifact-activity-actions { margin-top: 8px; padding-top: 8px; }
.premium-table-section { gap: 7px; }
.premium-table { gap: 6px; }
.premium-table-row { gap: 8px; padding: 8px 9px; }

.public-header { min-height: 68px; padding-block: 10px; }
.library-hero { gap: clamp(26px, 4vw, 58px); min-height: 520px; padding-top: 44px; padding-bottom: 50px; }
.hero-copy h1 { margin: 10px 0 16px; }
.hero-copy > p { margin-bottom: 20px; line-height: 1.45; }
.hero-search input { min-height: 42px; }
.hero-proof { gap: 7px 16px; margin-top: 12px; }
.library-metrics-section { gap: clamp(24px, 4vw, 56px); padding-top: 40px; padding-bottom: 40px; }
.library-metrics-grid { gap: 12px; }
.library-metric-card { gap: 8px 14px; min-height: 168px; padding: 19px; }
.public-library-section,
.how-section { padding-top: 52px; padding-bottom: 52px; }
.library-heading-row { margin-bottom: 20px; }
.public-library-layout { gap: 22px; }
.public-filter-panel { gap: 11px; padding: 16px; }
.public-filter-panel select,
.public-vertical-control summary,
.access-modal input { min-height: 40px; padding: 7px 10px; }
.library-results-meta { margin-bottom: 12px; }
.public-card-grid { gap: 16px; }
.public-opportunity-card { min-height: 440px; }
.opportunity-card-body { padding: 15px 16px; }
.public-opportunity-card h3 { margin: 7px 0 8px; font-size: 19px; }
.public-opportunity-card p { margin-bottom: 11px; line-height: 1.42; }
.card-tag-row { gap: 5px; margin-bottom: 11px; }
.card-facts { gap: 8px; padding-top: 10px; }
.how-grid { gap: 16px; margin-top: 20px; }
.how-grid article { padding: 19px; }
.how-grid h3 { margin-top: 10px; }
.opportunity-drawer { padding: 18px; }
.drawer-hero { margin: -18px -18px 18px; }
.drawer-content h2 { margin: 7px 0 6px; font-size: 28px; }
.drawer-lead { margin: 8px 0; line-height: 1.45; }
.drawer-facts { gap: 8px; margin: 14px 0; }
.drawer-facts div { padding: 10px 11px; }
.drawer-beneficiaries { margin: 8px 0 16px; }
.public-activity-panel { padding: 20px; }
.activity-tabs { margin: 17px 0 12px; }
.access-modal { gap: 11px; padding: 24px; }

@media (max-width: 840px) {
  .main { padding: 14px; }
  .sidebar { padding: 14px; }
  .library-hero { padding-top: 36px; padding-bottom: 40px; }
  .library-metrics-section { padding-top: 34px; padding-bottom: 34px; }
  .public-library-section,
  .how-section { padding-top: 42px; padding-bottom: 42px; }
}

@media (max-width: 580px) {
  .panel,
  .detail-summary,
  .match-card { padding: 12px; }
  .public-opportunity-card { min-height: 410px; }
  .library-metric-card { min-height: 150px; }
  .opportunity-drawer { padding: 15px; }
  .drawer-hero { margin: -15px -15px 16px; }
  .access-modal { padding: 20px 16px; }
}

/* Launch QA: readable light surfaces and keyboard navigation. */
.diagnostic-form label, .profile-form label, .auth-grid label, .document-form label,
.plan-document-upload label, .bar-meta { color: #334760; }
.trl-badge { color: #1747bd; }
.status-pill.green { color: #087052; }
.status-pill.amber { color: #765000; }
.status-pill.orange { color: #944500; }
.public-eyebrow, .workspace-disclosure > summary small { color: #076b6d; }
.nav-label small { color: #52657d; }
.access-divider { color: #52657d; }
.opportunity-image-label { background: rgba(16,35,63,.92); border-radius: 6px; padding: 5px 8px; text-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible { outline: 3px solid #2357d5; outline-offset: 3px; }
@media (max-width: 840px) {
  .public-filter-panel:not(.open) { visibility: hidden; pointer-events: none; }
  .public-filter-panel.open { visibility: visible; pointer-events: auto; }
}
@media (max-width: 580px) {
  .public-header { gap: 8px; padding-inline: 12px; }
  .public-brand { min-width: 0; flex: 0 1 125px; }
  .public-brand img { width: 125px; max-width: 100%; }
  .public-nav { flex: 0 0 auto; gap: 8px; }
  .public-login-button { min-width: 0; padding-inline: 12px; font-size: 13px; }
  .public-activity-button { min-width: 42px; padding-inline: 8px; }
  .hero-copy h1 { font-size: clamp(32px, 10vw, 43px); overflow-wrap: normal; }
  .drawer-content h2, .panel h2, .panel h3, .plan-opportunity-card strong { overflow-wrap: anywhere; }
  .public-filter-panel { max-height: 100dvh; }
  .plan-opportunity-card, .radar-history-card, .action-pill header { flex-wrap: wrap; }
  .plan-opportunity-card > div, .radar-history-card > div, .premium-output { min-width: 0; }
}

.detail-summary { background: #ffffff; color: #10233f; }
.detail-summary .eyebrow, .detail-summary p, .detail-stats span { color: #52657d; }

@media (max-width: 580px) {
 .main, .view, .panel, .workspace-disclosure, .recommendations-layout > *, .premium-panel > *, .premium-results > * { min-width: 0; max-width: 100%; }
 .recommendations-layout, .plan-document-upload { grid-template-columns: minmax(0,1fr); }
 .plan-document-upload input, .plan-document-upload button { width: 100%; min-width: 0; max-width: 100%; }
 .panel-heading, .workspace-disclosure > summary { flex-wrap: wrap; }
 .source-button { white-space: normal; overflow-wrap: anywhere; text-align: center; }
 .premium-table { max-width: 100%; overflow-x: auto; }
 .system-grid { grid-template-columns: minmax(0,1fr); }
}

.premium-table-head { background: #eaf0f8; border-color: #c8d6e5; }
.premium-table-head, .premium-table-head > * { color: #10233f; }
