:host {
  display: block;
  min-height: 100vh;
  color: #17201c;
  background: #f3f0e8;
}

* { box-sizing: border-box; }

.opportunity-page {
  --ink: #17201c;
  --muted: #667068;
  --paper: #fbfaf5;
  --line: #d7d7cb;
  --green: #0b7458;
  --green-dark: #064c3b;
  --lime: #b9da45;
  --amber: #b96715;
  --red: #a53a34;
  max-width: 1540px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.1rem clamp(1rem, 3vw, 3rem) 3rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.topbar, .brand, .hero, .identity-line, .candidate-summary,
.ai-review-header, .page-footer { display: flex; align-items: center; }

.topbar { justify-content: space-between; padding: 0.5rem 0 2.5rem; }
.brand { gap: 0.65rem; color: var(--ink); font-size: 0.78rem; letter-spacing: 0.16em; text-decoration: none; }
.brand-mark { display: grid; width: 2rem; height: 2rem; border-radius: 50%; place-items: center; color: #fff; background: var(--green); font-weight: 900; }
.brand strong { color: var(--green); }
.mode-chip, .ai-source { padding: 0.45rem 0.8rem; border: 1px solid var(--line); border-radius: 2rem; color: var(--muted); background: rgb(255 255 255 / 45%); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; }

.hero { align-items: flex-end; justify-content: space-between; gap: 3rem; padding: clamp(1rem, 4vw, 4rem) 0 3rem; border-top: 1px solid var(--line); }
.hero-copy { max-width: 58rem; }
.eyebrow { margin: 0 0 0.85rem; color: var(--green); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.18em; }
.hero h1 { margin: 0; max-width: 55rem; font-family: Georgia, serif; font-size: clamp(2.7rem, 6vw, 6rem); font-weight: 500; line-height: 0.96; letter-spacing: -0.055em; }
.hero h1 span { color: var(--green); }
.hero-intro { max-width: 46rem; margin: 1.5rem 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.scan-stats { display: grid; grid-template-columns: repeat(2, 8rem); gap: 0.7rem; margin: 0; }
.scan-stats div { padding: 1rem; border: 1px solid var(--line); border-radius: 0.9rem; background: var(--paper); }
.scan-stats dt { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; }
.scan-stats dd { margin: 0.25rem 0 0; font-size: 1.35rem; font-weight: 850; }

.safety-banner { display: flex; gap: 1rem; margin-bottom: 1rem; padding: 1.25rem 1.4rem; border: 1px solid #d1bd7c; border-radius: 1rem; background: #fff8dc; }
.safety-icon { display: grid; flex: 0 0 2rem; height: 2rem; border-radius: 50%; place-items: center; color: #fff; background: var(--amber); font-weight: 900; }
.safety-banner p { margin: 0.35rem 0 0; color: #675b36; line-height: 1.5; }
.method-strip { display: flex; flex-wrap: wrap; gap: 0.55rem; padding: 1rem 0 3rem; }
.method-strip span { padding: 0.5rem 0.75rem; border-radius: 0.6rem; color: #405148; background: #e2e8db; font-size: 0.8rem; font-weight: 750; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.3rem; }
.section-heading h2, .methodology-card h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 500; }
.candidate-list { display: grid; gap: 0.85rem; }
.candidate-card { overflow: hidden; border: 1px solid var(--line); border-radius: 1.1rem; background: var(--paper); box-shadow: 0 0.6rem 2rem rgb(42 56 47 / 4%); }
.candidate-card.open { border-color: #91ae9c; box-shadow: 0 1rem 3rem rgb(13 93 69 / 10%); }
.candidate-summary { display: grid; grid-template-columns: 3.5rem minmax(16rem, 1.5fr) 6.5rem minmax(10rem, 0.65fr) auto; gap: 1.1rem; padding: 1.2rem 1.3rem; }
.rank { color: #8a918b; font-size: 1.1rem; font-weight: 900; }
.identity-line { flex-wrap: wrap; gap: 0.4rem; }
.identity h3 { margin: 0.4rem 0 0.25rem; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 600; }
.identity p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.symbol, .sector, .category { padding: 0.25rem 0.5rem; border-radius: 0.35rem; font-size: 0.65rem; font-weight: 850; letter-spacing: 0.06em; }
.symbol { color: #fff; background: var(--green); }
.sector, .category { color: #526058; background: #e9ece5; }
.score { --score: 0; display: grid; width: 5.3rem; height: 5.3rem; border-radius: 50%; place-content: center; text-align: center; background: radial-gradient(circle at center, var(--paper) 57%, transparent 58%), conic-gradient(var(--green) calc(var(--score) * 1%), #dfe4dd 0); }
.score strong { font-size: 1.25rem; line-height: 1; }
.score span { color: var(--muted); font-size: 0.65rem; }
.priority { display: grid; align-content: center; gap: 0.45rem; }
.priority small { color: var(--muted); line-height: 1.35; }
.label { display: inline-flex; width: fit-content; padding: 0.38rem 0.7rem; border-radius: 2rem; color: #fff; background: var(--green); font-size: 0.72rem; font-weight: 850; }
.label.watch { background: var(--amber); }
.label.avoid { background: var(--red); }
.label.insufficient-evidence { background: #69716b; }
.details-button { align-self: center; padding: 0.65rem 0.85rem; border: 1px solid var(--green); border-radius: 0.65rem; color: var(--green-dark); background: transparent; cursor: pointer; font-weight: 800; }
.details-button:hover { color: #fff; background: var(--green); }
.quick-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); background: #f0f2eb; }
.quick-metrics div { display: grid; gap: 0.25rem; padding: 0.85rem 1.1rem; border-right: 1px solid var(--line); }
.quick-metrics div:last-child { border-right: 0; }
.quick-metrics span { color: var(--muted); font-size: 0.67rem; text-transform: uppercase; }

.candidate-detail { padding: clamp(1.1rem, 3vw, 2rem); border-top: 1px solid var(--line); }
.factor-panel { padding: 1.2rem; border-radius: 0.8rem; background: #eef1ea; }
.factor-panel h4, .evidence-column h4, .ai-review h4 { margin: 0 0 0.85rem; }
.factor-row { display: grid; grid-template-columns: 10rem 1fr 3rem; gap: 0.8rem; align-items: center; margin-top: 0.65rem; color: var(--muted); font-size: 0.83rem; }
.factor-row strong { color: var(--ink); text-align: right; }
.bar { height: 0.45rem; overflow: hidden; border-radius: 1rem; background: #d6ddd5; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.evidence-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.evidence-column { padding: 1.2rem; border: 1px solid var(--line); border-radius: 0.8rem; }
.evidence-column.positive { border-color: #b9d2c1; background: #edf6ef; }
.evidence-column.danger { border-color: #dfc2b9; background: #fbf0eb; }
.evidence-column ul, .three-lists ul { margin: 0; padding-left: 1.1rem; }
.evidence-column li, .three-lists li { margin-top: 0.45rem; color: #526058; line-height: 1.45; }
.ai-review { margin-top: 0.8rem; padding: 1.3rem; border-radius: 0.8rem; color: #eaf2ed; background: var(--green-dark); }
.ai-review-header { justify-content: space-between; }
.ai-review .eyebrow { color: var(--lime); }
.ai-copy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.ai-copy-grid article, .three-lists > div { padding: 1rem; border: 1px solid rgb(255 255 255 / 12%); border-radius: 0.7rem; background: rgb(255 255 255 / 5%); }
.ai-copy-grid p { margin: 0; color: #c7d7ce; line-height: 1.55; }
.three-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.three-lists li { color: #d0ded6; }
.evidence-footer { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-top: 0.8rem; color: var(--muted); }
.evidence-footer small { padding: 0.35rem 0.5rem; border-radius: 0.4rem; background: #ecefe9; }
.evidence-footer .missing { color: #8b2d28; background: #f7e5df; }

.methodology-card { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; margin-top: 3rem; padding: clamp(1.5rem, 4vw, 3.5rem); border-radius: 1.2rem; color: #f0f5f2; background: #17201c; }
.methodology-card .eyebrow { color: var(--lime); }
.methodology-card ol { margin: 0; padding-left: 1.2rem; }
.methodology-card li { margin-top: 0.7rem; color: #c8d0cb; line-height: 1.5; }
.page-footer { align-items: flex-start; justify-content: space-between; gap: 2rem; margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }
.page-footer strong { color: var(--green); letter-spacing: 0.14em; white-space: nowrap; }
.page-footer p { max-width: 60rem; margin: 0; line-height: 1.5; text-align: right; }

.state-card { display: grid; min-height: 70vh; place-items: center; align-content: center; text-align: center; }
.state-card h1 { margin-bottom: 0; font-family: Georgia, serif; font-size: 2.5rem; }
.state-card p { color: var(--muted); }
.spinner { width: 2.6rem; height: 2.6rem; border: 0.25rem solid #ccd4ce; border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
.state-icon { display: grid; width: 3rem; height: 3rem; border-radius: 50%; place-items: center; color: #fff; background: var(--red); font-weight: 900; }
.state-card code { padding: 0.7rem 1rem; border-radius: 0.5rem; background: #e5e6df; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .hero { align-items: flex-start; flex-direction: column; }
  .candidate-summary { grid-template-columns: 3rem 1fr 5.5rem; }
  .priority { grid-column: 2; }
  .details-button { grid-column: 3; grid-row: 2; }
  .quick-metrics { grid-template-columns: repeat(3, 1fr); }
  .quick-metrics div:nth-child(3) { border-right: 0; }
  .ai-copy-grid, .three-lists { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { align-items: flex-start; gap: 1rem; }
  .mode-chip { display: none; }
  .hero { padding-top: 1rem; }
  .hero h1 { font-size: 3rem; }
  .scan-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .candidate-summary { grid-template-columns: 2.5rem 1fr; }
  .score { grid-column: 1; grid-row: 2; width: 3.8rem; height: 3.8rem; }
  .priority { grid-column: 2; }
  .details-button { grid-column: 2; grid-row: 3; justify-self: start; }
  .quick-metrics { grid-template-columns: repeat(2, 1fr); }
  .quick-metrics div:nth-child(odd) { border-right: 1px solid var(--line); }
  .quick-metrics div:nth-child(even) { border-right: 0; }
  .factor-row { grid-template-columns: 7rem 1fr 2.5rem; }
  .evidence-panel, .methodology-card { grid-template-columns: 1fr; }
  .methodology-card { gap: 1.5rem; }
  .page-footer { flex-direction: column; }
  .page-footer p { text-align: left; }
}
