:root {
  --navy: #1B3A6B;
  --navy-2: #254a82;
  --orange: #EFA201;
  --orange-pale: #fff4dc;
  --teal: #1a7f8e;
  --teal-pale: #e7f5f7;
  --cream: #fdf8f0;
  --ink: #253242;
  --gray: #617080;
  --border: #dce3e9;
  --white: #ffffff;
  --danger: #a4433c;
  --shadow: 0 10px 26px rgba(25, 58, 107, .10);
  --display: Georgia, 'Times New Roman', serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--body); line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(27,58,107,.10); background: rgba(255,255,255,.97); backdrop-filter: blur(12px); }
.header-inner { width: min(1180px, calc(100% - 40px)); min-height: 74px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--navy); text-decoration: none; min-width: max-content; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--navy); color: var(--orange); font-weight: 900; font-size: 1.05rem; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { font: 800 .93rem/1.05 var(--display); }
.brand-copy span { margin-top: 3px; color: var(--gray); font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { color: var(--navy); font-size: .84rem; font-weight: 700; text-decoration: none; }
.main-nav a:hover { color: var(--teal); }
.workspace-link { padding: 9px 13px; border-radius: 7px; color: var(--navy) !important; background: var(--orange); }
.nav-toggle { display: none; color: var(--navy); border: 1px solid var(--border); border-radius: 7px; background: var(--white); padding: 7px 10px; }

.hero { position: relative; overflow: hidden; color: var(--white); background: var(--navy); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .7; background: linear-gradient(125deg, transparent 0 49%, rgba(239,162,1,.85) 49.3% 50.3%, transparent 50.7% 100%), linear-gradient(155deg, transparent 0 70%, rgba(45,116,143,.60) 70.3% 71.3%, transparent 71.7%); }
.hero::after { content: ''; position: absolute; width: 430px; height: 430px; top: -300px; right: -115px; border-radius: 50%; background: var(--orange); opacity: .92; }
.hero-inner { position: relative; z-index: 1; width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(52px, 7vw, 86px) 0 50px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 50px; align-items: end; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--orange); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: currentColor; }
.hero h1 { max-width: 720px; margin: 0; font: 800 clamp(2.55rem, 5.5vw, 4.75rem)/.99 var(--display); letter-spacing: -.045em; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero p { max-width: 680px; margin: 20px 0 0; color: rgba(255,255,255,.82); font-size: 1.05rem; }
.hero-card { padding: 25px; color: var(--navy); background: rgba(255,255,255,.95); border-radius: 16px; box-shadow: 0 18px 38px rgba(4,20,51,.24); }
.hero-card h2 { margin: 0 0 10px; font: 800 1.35rem/1.13 var(--display); }
.hero-card p { margin: 0; color: var(--gray); font-size: .9rem; }
.hero-card .mini-list { margin: 15px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.mini-list li { display: flex; gap: 9px; align-items: flex-start; font-size: .82rem; font-weight: 650; }
.mini-list b { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--navy); background: var(--orange); font-size: .7rem; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 76px; }
.intro { max-width: 810px; margin-bottom: 30px; }
.intro h2, .panel-title { color: var(--navy); font: 800 clamp(1.7rem, 3vw, 2.5rem)/1.1 var(--display); letter-spacing: -.025em; }
.intro h2 { margin: 0 0 12px; }
.intro p { max-width: 760px; margin: 0; color: var(--gray); }

.notice { display: flex; gap: 13px; align-items: flex-start; padding: 16px 18px; margin: 0 0 28px; border: 1px solid rgba(239,162,1,.35); border-radius: 12px; background: var(--orange-pale); }
.notice .notice-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--navy); background: var(--orange); font-size: .8rem; font-weight: 900; }
.notice strong { color: var(--navy); }
.notice p { margin: 1px 0 0; color: var(--ink); font-size: .88rem; }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
.step { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); color: var(--gray); }
.step-num { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #eaf0f6; color: var(--navy); font-size: .78rem; font-weight: 850; }
.step b { font-size: .78rem; line-height: 1.15; }
.step.active { border-color: var(--orange); color: var(--navy); box-shadow: 0 4px 12px rgba(239,162,1,.14); }
.step.active .step-num { background: var(--orange); }

.settings-bar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 15px; align-items: end; padding: 20px; margin: 0 0 22px; border: 1px solid var(--border); border-radius: 14px; background: var(--white); box-shadow: var(--shadow); }
.field-label { display: block; margin-bottom: 7px; color: var(--navy); font-size: .76rem; font-weight: 800; letter-spacing: .03em; }
.field-help { display: block; margin-top: 5px; color: var(--gray); font-size: .74rem; }
.control { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #bbc8d5; border-radius: 7px; color: var(--ink); background: var(--white); }
.control:focus { outline: 3px solid rgba(26,127,142,.18); border-color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 14px; border: 0; border-radius: 7px; font-size: .82rem; font-weight: 800; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-navy { color: var(--white); background: var(--navy); box-shadow: 0 6px 14px rgba(27,58,107,.18); }
.btn-orange { color: var(--navy); background: var(--orange); box-shadow: 0 6px 14px rgba(239,162,1,.22); }
.btn-outline { border: 1px solid var(--navy); color: var(--navy); background: transparent; }
.btn-quiet { color: var(--navy); background: #edf3f7; }
.btn-danger { color: var(--danger); border: 1px solid rgba(164,67,60,.35); background: #fff9f8; }
.action-bar { display: flex; flex-wrap: wrap; gap: 10px; margin: 25px 0 0; }

.empty-state { padding: 38px 28px; border: 1px dashed #bac9d7; border-radius: 14px; color: var(--gray); background: var(--white); text-align: center; }
.empty-state h3 { margin: 0 0 8px; color: var(--navy); font: 800 1.35rem var(--display); }
.empty-state p { max-width: 510px; margin: 0 auto 17px; font-size: .9rem; }

.opportunity-list { display: grid; gap: 18px; }
.opportunity-card { overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: var(--white); box-shadow: var(--shadow); }
.opportunity-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 18px 21px; color: var(--white); background: var(--navy); }
.opportunity-name { margin: 0; color: var(--white); font: 800 1.4rem/1.15 var(--display); }
.opportunity-subtitle { margin: 4px 0 0; color: rgba(255,255,255,.72); font-size: .79rem; }
.net-pill { min-width: 140px; padding: 9px 12px; border-radius: 8px; color: var(--navy); background: var(--orange); text-align: right; }
.net-pill span { display: block; font-size: .64rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.net-pill strong { display: block; margin-top: 2px; font-size: 1.2rem; }
.opportunity-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.form-grid .wide { grid-column: span 2; }
.assumption { grid-column: 1 / -1; padding: 11px 13px; border-left: 3px solid var(--teal); border-radius: 0 7px 7px 0; color: #415363; background: var(--teal-pale); font-size: .79rem; }
.rating-heading { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; margin: 25px 0 12px; }
.rating-heading h4 { margin: 0; color: var(--navy); font: 800 1.22rem var(--display); }
.rating-heading p { margin: 0; color: var(--gray); font-size: .77rem; }
.rating-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rating-cell { padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: #fcfdff; }
.rating-cell label { display: block; min-height: 36px; color: var(--navy); font-size: .78rem; font-weight: 850; line-height: 1.2; }
.rating-cell small { display: block; min-height: 42px; margin: 5px 0 9px; color: var(--gray); font-size: .7rem; line-height: 1.25; }
.rating-cell select { width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid #b9c7d4; border-radius: 6px; background: var(--white); color: var(--ink); font-weight: 750; }
.rating-cell .suggestion { display: block; margin-top: 6px; color: var(--teal); font-size: .68rem; font-weight: 750; }
.card-actions { display: flex; justify-content: flex-end; margin-top: 18px; }

.results { margin-top: 30px; padding: clamp(22px,4vw,38px); border-radius: 16px; color: var(--white); background: linear-gradient(135deg, var(--navy), #214c78 65%, var(--teal)); box-shadow: var(--shadow); }
.results-top { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 20px; }
.results h2 { margin: 0; font: 800 clamp(1.7rem, 3vw, 2.5rem)/1.1 var(--display); }
.results p { max-width: 650px; margin: 8px 0 0; color: rgba(255,255,255,.78); font-size: .86rem; }
.result-table-wrap { overflow-x: auto; border-radius: 10px; background: var(--white); }
.result-table { width: 100%; min-width: 700px; border-collapse: collapse; color: var(--ink); font-size: .82rem; }
.result-table th { padding: 12px 13px; color: var(--navy); background: #edf3f7; font-size: .69rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.result-table td { padding: 13px; border-top: 1px solid var(--border); vertical-align: middle; }
.result-table tr:first-child td { background: #fff8e8; }
.result-rank { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--navy); background: var(--orange); font-size: .76rem; font-weight: 900; }
.score-badge { display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 8px; border-radius: 6px; color: var(--navy); background: var(--orange-pale); font-weight: 850; }
.score-badge small { color: var(--gray); font-size: .66rem; font-weight: 700; }
.ranking-note { margin: 14px 0 0; color: rgba(255,255,255,.78); font-size: .76rem; }

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 42px; }
.help-card { padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--white); }
.help-card h3 { margin: 0 0 8px; color: var(--navy); font: 800 1.08rem var(--display); }
.help-card p { margin: 0; color: var(--gray); font-size: .81rem; }

.source-note { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--gray); font-size: .76rem; }
.source-note strong { color: var(--navy); }
.site-footer { padding: 24px 20px; color: rgba(255,255,255,.72); background: #102a4c; text-align: center; font-size: .78rem; }
.site-footer a { color: var(--orange); }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-card { max-width: 620px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rating-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .header-inner { min-height: 66px; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 66px; right: 20px; left: 20px; align-items: stretch; flex-direction: column; gap: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); box-shadow: var(--shadow); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px; }
  .workspace-link { text-align: center; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .settings-bar { grid-template-columns: 1fr; }
  .settings-bar .btn { width: 100%; }
  .help-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .header-inner, .hero-inner, .page-shell { width: min(100% - 28px, 1180px); }
  .brand-copy span { display: none; }
  .hero h1 { font-size: 2.55rem; }
  .hero-card { padding: 20px; }
  .stepper { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .rating-grid { grid-template-columns: 1fr; }
  .opportunity-header, .results-top { align-items: flex-start; flex-direction: column; }
  .net-pill { text-align: left; }
}

@media print {
  .site-header, .hero, .action-bar, .card-actions, .btn, .source-note .no-print { display: none !important; }
  body { background: var(--white); font-size: 10pt; }
  .page-shell { width: 100%; padding: 0; }
  .settings-bar { box-shadow: none; }
  .opportunity-card, .results { break-inside: avoid; box-shadow: none; }
  .results { color: var(--ink); background: var(--white); border: 1px solid var(--border); }
  .results p, .ranking-note { color: var(--gray); }
  .result-table-wrap { border: 1px solid var(--border); }
}

/* Criterion weighting controls */
.weighting-panel { margin: 0 0 26px; padding: clamp(20px, 3vw, 30px); border: 1px solid rgba(26, 127, 142, .30); border-radius: 15px; background: linear-gradient(135deg, #eef8f8 0%, #f9fcfc 58%, #fff7e7 100%); box-shadow: var(--shadow); }
.weighting-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.weighting-heading .eyebrow { margin-bottom: 10px; color: var(--teal); }
.weighting-heading h3 { max-width: 680px; margin: 0; color: var(--navy); font: 800 clamp(1.38rem, 2.5vw, 2rem)/1.1 var(--display); letter-spacing: -.02em; }
.weighting-heading p { max-width: 710px; margin: 10px 0 0; color: var(--gray); font-size: .84rem; }
.weighting-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.weight-total { min-width: 90px; padding: 8px 10px; border: 1px solid rgba(27,58,107,.16); border-radius: 8px; color: var(--navy); background: rgba(255,255,255,.78); text-align: center; }
.weight-total span { display: block; font-size: .59rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.weight-total strong { display: block; margin-top: 1px; font-size: 1.24rem; line-height: 1.1; }
.weight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.weight-card { padding: 14px 14px 12px; border: 1px solid rgba(26, 127, 142, .22); border-radius: 10px; background: rgba(255,255,255,.88); }
.weight-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.weight-card label { display: block; color: var(--navy); font-size: .81rem; font-weight: 850; line-height: 1.2; }
.weight-value { min-width: 34px; padding: 2px 6px; border-radius: 999px; color: var(--navy); background: var(--orange); font-size: .76rem; font-weight: 900; text-align: center; }
.weight-card input[type="range"] { width: 100%; height: 22px; margin: 10px 0 2px; accent-color: var(--teal); cursor: pointer; }
.weight-scale { display: flex; justify-content: space-between; color: var(--gray); font-size: .64rem; font-weight: 700; }
.weight-card small { display: block; min-height: 30px; margin-top: 8px; color: var(--gray); font-size: .69rem; line-height: 1.22; }
.weighting-note { margin: 17px 0 0; color: var(--navy); font-size: .78rem; font-weight: 700; }
.weighting-note.warning { color: var(--danger); }
.weighted-badge { display: inline-flex; align-items: baseline; gap: 4px; padding: 5px 8px; border-radius: 6px; color: var(--white); background: var(--teal); font-weight: 850; }
.weighted-badge small { color: rgba(255,255,255,.82); font-size: .66rem; font-weight: 700; }
.result-table { min-width: 860px; }

@media (max-width: 980px) {
  .weight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .weighting-heading { align-items: flex-start; flex-direction: column; }
  .weighting-actions { width: 100%; justify-content: space-between; }
}
@media (max-width: 580px) {
  .weight-grid { grid-template-columns: 1fr; }
  .weighting-actions { align-items: stretch; flex-direction: column; }
  .weight-total, .weighting-actions .btn { width: 100%; }
}
@media print {
  .weighting-panel { box-shadow: none; background: var(--white); border-color: var(--border); }
  .weight-card input[type="range"] { display: none; }
  .weight-grid { grid-template-columns: repeat(3, 1fr); }
}

.result-table th small { display: block; margin-top: 2px; color: var(--teal); font-size: .58rem; font-weight: 850; letter-spacing: .03em; text-transform: none; }
