@import url('/tokens.css');

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--eds-space-section); }
body {
  margin: 0;
  color: var(--eds-color-text-primary);
  background: var(--eds-color-surface-page);
  font-family: var(--eds-font-body);
  font-size: var(--eds-type-body);
  font-weight: var(--eds-weight-body);
  line-height: var(--eds-line-height-body);
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: var(--eds-space-1); text-decoration-thickness: var(--eds-border-subtle); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: var(--eds-border-emphasis) solid var(--eds-color-action-focus);
  outline-offset: var(--eds-space-1);
}
[hidden] { display: none !important; }

.wrap { width: min(var(--eds-layout-content), calc(100% - var(--eds-space-7) * 2)); margin-inline: auto; }
.skip {
  position: fixed;
  inset: var(--eds-space-2) auto auto var(--eds-space-2);
  z-index: 2;
  padding: var(--eds-space-3);
  color: var(--eds-color-text-primary);
  background: var(--eds-color-surface-page);
  border: var(--eds-border-subtle) solid var(--eds-color-border-strong);
  transform: translateY(-200%);
}
.skip:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eds-space-group);
  min-height: 5.5rem;
  border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle);
}
.wordmark { display: inline-flex; align-items: center; gap: var(--eds-space-3); color: var(--eds-color-text-primary); font-size: var(--eds-type-label); font-weight: var(--eds-weight-label); letter-spacing: 0.12em; line-height: 1.35; text-decoration: none; }
.monogram { padding-inline-end: var(--eds-space-3); color: var(--eds-color-text-accent); border-inline-end: var(--eds-border-subtle) solid var(--eds-color-border-subtle); font-family: var(--eds-font-display); font-size: var(--eds-type-heading); line-height: 1; }
.header-link { color: var(--eds-color-text-primary); font-size: var(--eds-type-small); text-decoration: none; }
.header-link:hover { color: var(--eds-color-text-accent); }

.page-lead { padding-block: clamp(1.25rem, 3vw, 2.5rem) var(--eds-space-4); }
.page-lead p, .page-lead h1 { margin-block: 0; }
.eyebrow, .block-label {
  color: var(--eds-color-text-accent);
  font-size: var(--eds-type-label);
  font-weight: var(--eds-weight-label);
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}
.eyebrow { margin-bottom: var(--eds-space-3) !important; }
h1, h2, h3 { color: var(--eds-color-text-primary); font-family: var(--eds-font-display); font-weight: var(--eds-weight-body); }
h1 { max-width: 21ch; font-size: clamp(2.3rem, 4vw, 3.75rem); line-height: 1.04; letter-spacing: -0.035em; }
h2 { margin: 0; font-size: var(--eds-type-heading); line-height: var(--eds-line-height-heading); letter-spacing: -0.025em; }
h3 { margin: 0; font-size: clamp(1.45rem, 2.5vw, 2rem); line-height: var(--eds-line-height-heading); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.gold { color: var(--eds-color-text-accent); }
.standfirst { margin-top: var(--eds-space-3) !important; max-width: 44rem; color: var(--eds-color-text-quiet); font-size: clamp(1rem, 1.5vw, 1.125rem); line-height: 1.45; }
.intro, .section-intro, .quiet, .detail-text { color: var(--eds-color-text-quiet); }
.intro { max-width: var(--eds-layout-measure); margin-top: var(--eds-space-3) !important; }

.opportunities-section { padding-block: var(--eds-space-4) var(--eds-space-section); background: var(--eds-color-surface-quiet); }
.filter-disclosure { border: 0; }
.filter-disclosure > summary { display: none; }
.opportunity-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--eds-space-3); padding-block: var(--eds-space-4); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.field { display: grid; gap: var(--eds-space-1); min-width: 0; color: var(--eds-color-text-primary); font-size: var(--eds-type-label); font-weight: var(--eds-weight-label); letter-spacing: 0.07em; line-height: 1.35; text-transform: uppercase; }
.field select {
  width: 100%;
  min-height: 3rem;
  padding: var(--eds-space-2) var(--eds-space-3);
  color: var(--eds-color-text-primary);
  background: var(--eds-color-surface-page);
  border: var(--eds-border-subtle) solid var(--eds-color-border-strong);
  border-radius: var(--eds-shape-control);
  font-size: var(--eds-type-small);
  font-weight: var(--eds-weight-body);
  letter-spacing: normal;
  line-height: 1.35;
  text-transform: none;
}
.field select:hover { border-color: var(--eds-color-text-quiet); }
.field select:disabled { cursor: not-allowed; color: var(--eds-color-text-quiet); }
.filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: var(--eds-space-1); }

.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--eds-space-group); min-height: 3rem; border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.result-toolbar p { margin: 0; color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.clear-filters, .text-button {
  min-height: 3rem;
  padding: var(--eds-space-2) 0;
  color: var(--eds-color-text-primary);
  background: transparent;
  border: 0;
  font-size: var(--eds-type-small);
  text-decoration: underline;
  text-underline-offset: var(--eds-space-1);
}
.clear-filters:disabled { cursor: not-allowed; color: var(--eds-color-text-quiet); text-decoration: none; }

.opportunity-list { margin: 0; border-top: 0; }
.opportunity-card { position: relative; scroll-margin-top: var(--eds-space-3); padding-block: var(--eds-space-5); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.opportunity-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 0.55fr); gap: var(--eds-space-group); align-items: start; }
.opportunity-identity > * { margin: 0; }
.firm-name { margin-bottom: var(--eds-space-1) !important; color: var(--eds-color-text-accent); font-size: var(--eds-type-label); font-weight: var(--eds-weight-label); letter-spacing: 0.1em; line-height: 1.35; text-transform: uppercase; }
.opportunity-location { margin-top: var(--eds-space-1) !important; color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.status-line { display: grid; gap: var(--eds-space-1); margin: 0; font-size: var(--eds-type-small); font-weight: var(--eds-weight-emphasis); line-height: 1.35; }
.status-line span:first-child::before { display: inline-block; width: 0.5rem; height: 0.5rem; margin-inline-end: var(--eds-space-2); border-radius: 50%; background: currentColor; content: ''; }
.status-line time { color: var(--eds-color-text-quiet); font-size: var(--eds-type-label); font-weight: var(--eds-weight-body); }
.status-open, .status-open_no_deadline { color: var(--eds-color-status-success); }
.status-closing_soon, .status-verification_pending { color: var(--eds-color-status-warning); }
.status-expired, .status-closed { color: var(--eds-color-status-danger); }

.opportunity-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: var(--eds-space-5) 0 0; border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.opportunity-facts > div { min-width: 0; padding: var(--eds-space-3) var(--eds-space-4) var(--eds-space-3) 0; }
.opportunity-facts > div + div { padding-inline-start: var(--eds-space-4); border-inline-start: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.opportunity-facts dt { margin-bottom: var(--eds-space-1); color: var(--eds-color-text-quiet); font-size: var(--eds-type-label); font-weight: var(--eds-weight-label); letter-spacing: 0.07em; line-height: 1.35; text-transform: uppercase; }
.opportunity-facts dd { margin: 0; font-size: var(--eds-type-small); line-height: var(--eds-line-height-body); overflow-wrap: anywhere; }
.fact-unknown dd { color: var(--eds-color-text-quiet); font-style: italic; }
.verification-line { display: flex; justify-content: space-between; gap: var(--eds-space-group); margin: var(--eds-space-3) 0 0; color: var(--eds-color-text-quiet); font-size: var(--eds-type-label); line-height: 1.35; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  gap: var(--eds-space-2);
  padding: var(--eds-space-2) var(--eds-space-4);
  border: var(--eds-border-subtle) solid transparent;
  border-radius: var(--eds-shape-control);
  font-size: var(--eds-type-small);
  font-weight: var(--eds-weight-emphasis);
  line-height: 1.35;
  text-decoration: none;
  transition: background-color var(--eds-motion-feedback), border-color var(--eds-motion-feedback), color var(--eds-motion-feedback);
}
.button.primary { color: var(--eds-color-text-inverse); background: var(--eds-color-action-primary); border-color: var(--eds-color-action-primary); }
.button.primary:hover { background: var(--eds-color-action-primary-hover); border-color: var(--eds-color-action-primary-hover); }
.button.secondary { color: var(--eds-color-text-primary); background: transparent; border-color: var(--eds-color-border-strong); }
.button.secondary:hover { background: var(--eds-color-surface-quiet); }
.opportunity-actions {
  position: sticky;
  top: var(--eds-space-2);
  top: max(var(--eds-space-2), env(safe-area-inset-top));
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  margin: var(--eds-space-4) 0 0;
}
.action-link { min-width: min(100%, 15rem); }
.action-unavailable { margin: 0; color: var(--eds-color-status-warning); font-size: var(--eds-type-small); }

details { border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
summary { min-height: 3rem; padding-block: var(--eds-space-3); color: var(--eds-color-text-primary); cursor: pointer; font-size: var(--eds-type-small); font-weight: var(--eds-weight-emphasis); line-height: 1.35; }
.opportunity-preview { margin-top: var(--eds-space-4); }
.preview-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(15rem, 0.75fr); gap: var(--eds-space-group); padding-top: var(--eds-space-4); border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.details-block, .editorial-block { min-width: 0; }
.block-label { margin: 0 0 var(--eds-space-2); }
.details-intro { margin: 0 0 var(--eds-space-2); font-size: var(--eds-type-small); font-weight: var(--eds-weight-emphasis); line-height: 1.45; }
.details-block > p:not(.block-label):not(.details-intro), .editorial-block > p:not(.block-label) { margin: 0; color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.details-block h4 { margin: var(--eds-space-4) 0 var(--eds-space-1); font-size: var(--eds-type-small); }
.detail-list { margin: 0; padding-inline-start: var(--eds-space-5); color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.detail-list li + li { margin-top: var(--eds-space-1); }
.detail-unknown { margin: 0; color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); font-style: italic; }
.editorial-block { align-self: start; padding: var(--eds-space-4); background: var(--eds-color-surface-callout); border-inline-start: var(--eds-border-emphasis) solid var(--eds-color-text-accent); }
.preview-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--eds-space-group); }
.text-link { display: inline-flex; align-items: center; min-height: 3rem; color: var(--eds-color-text-primary); font-size: var(--eds-type-small); font-weight: var(--eds-weight-emphasis); }

.opportunity-state { margin-top: var(--eds-space-5); padding: var(--eds-space-group); background: var(--eds-color-surface-page); border-inline-start: var(--eds-border-emphasis) solid var(--eds-color-text-accent); }
.opportunity-state h3 { margin-bottom: var(--eds-space-2); }
.opportunity-state p { margin: 0 0 var(--eds-space-4); color: var(--eds-color-text-quiet); }
.opportunity-skeleton { height: 15rem; border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); background: linear-gradient(100deg, var(--eds-color-surface-page), var(--eds-color-surface-callout), var(--eds-color-surface-page)); background-size: 300% 100%; animation: opportunity-loading 1.4s ease infinite; }
@keyframes opportunity-loading { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.opportunity-watch { margin-top: var(--eds-space-5); padding-top: 0; border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.opportunity-watch > .detail-text { margin: 0 0 var(--eds-space-3); font-size: var(--eds-type-small); }
.opportunity-context { margin-top: var(--eds-space-5); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.opportunity-context p { max-width: var(--eds-layout-measure); margin: 0 0 var(--eds-space-4); color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.coverage-audit-list { display: grid; gap: var(--eds-space-4); margin-top: var(--eds-space-4); }
.coverage-audit-group { border-left: var(--eds-border-subtle) solid var(--eds-color-border-subtle); padding-left: var(--eds-space-4); }
.coverage-audit-group h3 { color: var(--eds-color-text-primary); font-size: var(--eds-font-size-body); margin: 0 0 var(--eds-space-2); }
.coverage-audit-group p { margin: 0; overflow-wrap: anywhere; }

.section { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--eds-space-section); padding-block: var(--eds-space-section); border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.section-head > * { margin: 0; }
.coverage-row { display: flex; gap: var(--eds-space-group); padding-bottom: var(--eds-space-group); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.coverage-row + .coverage-row { padding-top: var(--eds-space-group); }
.index { flex: 0 0 auto; color: var(--eds-color-text-accent); font-family: var(--eds-font-display); font-size: var(--eds-type-heading); line-height: 1; }
.coverage-row h3 { font-size: 1.35rem; }
.coverage-row p { margin: var(--eds-space-1) 0 0; color: var(--eds-color-text-quiet); }
.scope-note { margin: var(--eds-space-group) 0; color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.scope-note strong { color: var(--eds-color-text-primary); }
.detail-text { margin: var(--eds-space-3) 0 0; font-size: var(--eds-type-small); }

.setup-content > * { margin-top: 0; }
.setup-status { display: inline-block; margin: 0 0 var(--eds-space-3); padding: var(--eds-space-2) var(--eds-space-3); color: var(--eds-color-status-warning); background: var(--eds-color-surface-callout); font-size: var(--eds-type-small); }
.steps { display: grid; gap: var(--eds-space-group); margin: var(--eds-space-group) 0; padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; min-height: 2rem; padding-inline-start: var(--eds-space-7); counter-increment: steps; }
.steps li::before { position: absolute; inset-inline-start: 0; color: var(--eds-color-text-accent); content: counter(steps, decimal-leading-zero); font-size: var(--eds-type-label); font-weight: var(--eds-weight-label); letter-spacing: 0.07em; }
.steps strong { display: block; font-size: var(--eds-type-small); }
.steps span { display: block; margin-top: var(--eds-space-1); color: var(--eds-color-text-quiet); font-size: var(--eds-type-small); }
.setup .button { margin-inline-end: var(--eds-space-2); }
.setup details { margin-top: var(--eds-space-4); }
textarea { width: 100%; min-height: 14rem; margin-top: var(--eds-space-3); padding: var(--eds-space-4); color: var(--eds-color-text-primary); background: var(--eds-color-surface-quiet); border: var(--eds-border-subtle) solid var(--eds-color-border-strong); border-radius: var(--eds-shape-control); font-size: var(--eds-type-small); line-height: var(--eds-line-height-body); resize: vertical; }
#status, #share-status { min-height: 1.5em; margin: var(--eds-space-3) 0 0; color: var(--eds-color-status-warning); font-size: var(--eds-type-small); }

.share-section { display: flex; align-items: center; justify-content: space-between; gap: var(--eds-space-section); padding-block: var(--eds-space-6); border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
.share-section p, .share-section h2 { margin: 0; }
.share-section .eyebrow { margin-bottom: var(--eds-space-2) !important; }
.share-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--eds-space-2); }
.share-actions #share-status { flex-basis: 100%; text-align: end; }
#share-url { flex-basis: 100%; min-height: 3rem; padding: var(--eds-space-2) var(--eds-space-3); color: var(--eds-color-text-primary); background: var(--eds-color-surface-page); border: var(--eds-border-subtle) solid var(--eds-color-border-strong); font-size: var(--eds-type-small); }
.footer { display: flex; justify-content: space-between; gap: var(--eds-space-group); padding-block: var(--eds-space-5); color: var(--eds-color-text-quiet); font-size: var(--eds-type-label); }
.footer p { margin: 0; }
.footer > p:first-child { color: var(--eds-color-text-primary); font-weight: var(--eds-weight-label); letter-spacing: 0.1em; }

@media (max-width: 64rem) {
  .section { grid-template-columns: 1fr; }
  .section { gap: var(--eds-space-group); }
  .opportunity-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preview-body { grid-template-columns: 1fr; }
  .editorial-block { max-width: var(--eds-layout-measure); }
}

@media (max-width: 46rem) {
  .wrap { width: min(var(--eds-layout-content), calc(100% - var(--eds-space-5) * 2)); }
  .masthead { align-items: center; flex-direction: row; justify-content: space-between; padding-block: 0; }
  .header-link { display: none; }
  .page-lead { padding-block: var(--eds-space-4) var(--eds-space-3); }
  .page-lead h1 { max-width: none; }
  .opportunities-section { padding-block: var(--eds-space-5) var(--eds-space-6); }
  .filter-disclosure { border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); border-bottom: var(--eds-border-subtle) solid var(--eds-color-border-subtle); }
  .filter-disclosure > summary { display: block; }
  .filter-disclosure .opportunity-filters { padding-top: var(--eds-space-3); border-bottom: 0; }
  .filter-actions { justify-content: flex-start; }
  .opportunity-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-toolbar { align-items: flex-start; padding-block: var(--eds-space-3); }
  .opportunity-top { grid-template-columns: 1fr; gap: var(--eds-space-3); }
  .opportunity-facts { grid-template-columns: 1fr; }
  .opportunity-facts > div { padding-inline: 0; }
  .opportunity-facts > div + div { border-top: var(--eds-border-subtle) solid var(--eds-color-border-subtle); border-inline-start: 0; }
  .verification-line { flex-direction: column; gap: var(--eds-space-1); }
  .opportunity-actions { display: flex; }
  .opportunity-actions .button { width: 100%; }
  .preview-actions { display: grid; gap: var(--eds-space-1); }
  .text-link { min-height: 2.75rem; }
  .section { padding-block: var(--eds-space-6); }
  .share-section { align-items: stretch; flex-direction: column; gap: var(--eds-space-group); }
  .share-actions { justify-content: flex-start; }
  .share-actions #share-status { text-align: start; }
  .footer { flex-direction: column; }
}

@media (max-width: 30rem) {
  .opportunity-filters { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
  .opportunity-skeleton { animation: none; background: var(--eds-color-surface-page); }
}
