:root {
  --navy: #071d36;
  --navy-2: #0b2e52;
  --blue: #0b5794;
  --blue-2: #1477b8;
  --red: #d92332;
  --ink: #172b3d;
  --slate: #4d6172;
  --muted: #6c7e8c;
  --paper: #f3f6f8;
  --white: #fff;
  --line: #d6e0e6;
  --shadow: 0 18px 50px rgba(7,29,54,.10);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }

.demo-notice { color: white; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.12); }
.demo-notice .container { min-height: 34px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.site-header { background: white; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 25px; }
.logo { display: inline-flex; }
.logo img { width: 145px; height: 68px; object-fit: contain; }
.back-link { margin-left: auto; color: var(--blue); font-size: 13px; font-weight: 800; }
.header-badge { padding: 7px 10px; color: #4f6576; background: #edf3f6; border-radius: 6px; font-size: 11px; font-weight: 800; }

.tool-hero { position: relative; overflow: hidden; padding: 49px 0; color: white; background: var(--navy); }
.tool-hero::after { content: ""; position: absolute; top: -210px; right: -80px; width: 470px; height: 470px; border: 1px solid rgba(217,35,50,.2); border-radius: 50%; box-shadow: 0 0 0 58px rgba(11,87,148,.07); }
.tool-hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; gap: 50px; align-items: end; }
.eyebrow { margin: 0 0 9px; color: #ff98a0; font-size: 11px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.tool-hero h1 { margin: 0 0 11px; font-size: clamp(38px, 4.2vw, 53px); font-weight: 780; line-height: 1.06; letter-spacing: -.045em; }
.tool-hero p:last-child { max-width: 760px; margin: 0; color: #cedae3; font-size: 15px; line-height: 1.65; }
.tool-mark { width: 70px; height: 70px; display: grid; place-items: center; color: white; background: var(--blue); border: 1px solid rgba(255,255,255,.22); border-radius: 13px; font-size: 13px; font-weight: 900; letter-spacing: .05em; }

.tool-main { padding: 34px 0 54px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, .72fr); gap: 20px; align-items: start; }
.panel { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(7,29,54,.05); }
.panel-head { min-height: 67px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; color: var(--navy); font-size: 23px; font-weight: 780; letter-spacing: -.025em; }
.panel-head span { color: var(--blue); font-size: 11px; font-weight: 850; }
.form-body { padding: 25px; }
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 19px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.incentive-field { margin: 0; padding: 0; border: 0; }
.incentive-field legend { margin-bottom: 7px; padding: 0; color: var(--ink); font-size: 13px; font-weight: 800; }
.incentive-field legend small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.check-group { padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #f1f5f7; border: 1px solid #bdcbd5; border-radius: 10px; }
.check-option { min-height: 58px; margin: 0; padding: 10px 11px; display: flex; align-items: center; gap: 10px; background: white; border: 1px solid #d5e0e7; border-radius: 8px; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.check-option:hover { border-color: #8aabc2; }
.check-option:has(input:checked) { background: #edf6fc; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.check-option input { flex: 0 0 auto; width: 19px; height: 19px; accent-color: var(--blue); }
.check-option input:focus-visible { outline: 3px solid rgba(11,87,148,.2); outline-offset: 3px; }
.check-option span, .check-option strong, .check-option small { display: block; }
.check-option strong { color: var(--navy); font-size: 12px; }
.check-option small { margin-top: 2px; color: #657b8c; font-size: 10px; font-weight: 500; }
.field-note { margin: 7px 1px 0; color: #657b8c; font-size: 10px; }
label { display: block; margin-bottom: 8px; color: #344c5e; font-size: 13px; font-weight: 800; }
label small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
select, input[type="number"], input[type="search"], input[type="text"] { width: 100%; height: 49px; padding: 0 13px; color: var(--navy); background: #f8fafb; border: 1px solid #bdcbd5; border-radius: 8px; outline: none; }
select:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11,87,148,.12); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 13px; top: 50%; z-index: 1; color: #667a89; transform: translateY(-50%); }
.input-prefix input { padding-left: 29px; }
.check-field { min-height: 49px; padding: 0 13px; display: flex; align-items: center; gap: 10px; background: #f8fafb; border: 1px solid #bdcbd5; border-radius: 8px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--blue); }
.check-field span { color: var(--ink); font-size: 13px; font-weight: 700; }
.form-actions { margin-top: 24px; padding-top: 19px; display: flex; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); }
.form-actions p { display: none; }
.reset-button { padding: 8px 0; color: var(--blue); background: none; border: 0; cursor: pointer; font-size: 12px; font-weight: 800; }

.mode-switch { margin-bottom: 22px; padding: 5px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; background: #eaf0f4; border-radius: 10px; }
.mode-switch button { min-height: 42px; color: #4b6171; background: transparent; border: 0; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 800; }
.mode-switch button.active { color: white; background: var(--blue); box-shadow: 0 5px 13px rgba(11,87,148,.2); }
.target-field[hidden] { display: none; }

.results-panel { position: sticky; top: 18px; }
.results-head { padding: 23px 25px; color: white; background: linear-gradient(135deg, var(--blue), #0b6aa8); border-bottom: 4px solid var(--red); }
.results-head span { display: block; color: #d2e4ef; font-size: 11px; font-weight: 850; letter-spacing: .05em; }
.results-head strong { display: block; margin: 4px 0; font-size: 43px; font-weight: 760; line-height: 1.15; letter-spacing: -.035em; }
.results-head small { color: #e0ebf2; font-size: 12px; }
.result-body { padding: 23px; }
.result-list { display: grid; }
.result-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e1e7eb; }
.result-row span { color: #536979; font-size: 13px; }
.result-row strong { color: var(--navy); font-size: 14px; }
.result-row.total { margin-top: 11px; padding: 0 13px; background: #eaf1f5; border-left: 4px solid var(--red); border-bottom: 0; border-radius: 0 8px 8px 0; }
.result-row.total span { color: var(--navy); font-weight: 800; }
.result-row.total strong { color: var(--blue); font-size: 17px; }
.meter-wrap { margin-top: 23px; }
.meter-label { display: flex; justify-content: space-between; color: #607482; font-size: 11px; }
.meter { height: 9px; margin-top: 8px; overflow: hidden; background: #dfe7eb; border-radius: 10px; }
.meter i { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, var(--blue), var(--blue-2)); border-radius: inherit; transition: width .25s ease; }
.result-callout { margin-top: 21px; padding: 16px; color: #506575; background: #eef3f6; border-radius: 9px; font-size: 12px; line-height: 1.6; }
.result-callout strong { color: var(--navy); }
.results-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 18px; }
.results-actions a { min-height: 43px; padding: 0 10px; display: grid; place-items: center; color: var(--blue); background: white; border: 1px solid #b9cad5; border-radius: 8px; font-size: 11px; font-weight: 850; text-align: center; }
.results-actions a:hover { color: white; background: var(--blue); border-color: var(--blue); }

.assumptions { margin-top: 20px; overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 12px; }
.assumptions summary { padding: 18px 22px; display: flex; justify-content: space-between; cursor: pointer; color: var(--navy); font-size: 14px; font-weight: 800; list-style: none; }
.assumptions summary::-webkit-details-marker { display: none; }
.assumptions summary span { color: var(--red); font-size: 19px; }
.assumptions-content { padding: 0 22px 20px; color: #526777; font-size: 12px; }
.assumptions-content p { margin: 0 0 9px; }
.assumptions-content ul { margin: 0; padding-left: 18px; }
.disclaimer { margin-top: 17px; padding: 15px 18px; display: flex; gap: 11px; color: #526777; background: #e8eef1; border-left: 3px solid var(--red); border-radius: 0 9px 9px 0; font-size: 11px; line-height: 1.6; }
.disclaimer span { width: 20px; height: 20px; flex: 0 0 auto; display: grid; place-items: center; color: var(--blue); border: 1px solid #9cabb5; border-radius: 50%; font-weight: 900; }
.disclaimer p { margin: 0; }
.disclaimer strong { color: var(--navy); }

/* Searchable CBA */
.search-shell { display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: 20px; align-items: start; }
.search-panel { padding: 25px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(7,29,54,.05); }
.search-panel h2 { margin: 0 0 7px; color: var(--navy); font-size: 23px; }
.search-panel > p { margin-bottom: 20px; color: var(--slate); font-size: 13px; }
.search-input { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.search-input input { height: 51px; }
.search-input button { padding: 0 19px; color: white; background: var(--blue); border: 0; border-radius: 8px; cursor: pointer; font-weight: 800; }
.topic-label { margin: 21px 0 9px; color: var(--navy); font-size: 12px; font-weight: 800; }
.topic-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.topic-chips button { padding: 8px 10px; color: #41596a; background: #edf3f6; border: 1px solid #d3dee4; border-radius: 20px; cursor: pointer; font-size: 11px; font-weight: 750; }
.topic-chips button:hover, .topic-chips button.active { color: white; background: var(--blue); border-color: var(--blue); }
.agreement-meta { margin-top: 22px; padding: 15px; background: #f1f5f7; border-radius: 9px; }
.agreement-meta small { color: var(--muted); font-size: 10px; font-weight: 800; }
.agreement-meta strong { display: block; margin-top: 2px; color: var(--navy); font-size: 13px; }
.agreement-meta span { display: block; margin-top: 3px; color: var(--slate); font-size: 11px; }
.search-results { min-height: 520px; padding: 25px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 30px rgba(7,29,54,.05); }
.results-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.results-title h2 { margin: 0; color: var(--navy); font-size: 23px; }
.results-title span { color: var(--blue); font-size: 12px; font-weight: 800; }
.cba-result-list { display: grid; gap: 10px; }
.cba-result { padding: 17px; border: 1px solid var(--line); border-radius: 10px; transition: border-color .2s, box-shadow .2s; }
.cba-result:hover { border-color: #abc2d2; box-shadow: 0 8px 22px rgba(7,29,54,.07); }
.cba-result-top { display: flex; justify-content: space-between; gap: 15px; }
.cba-result small { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.cba-result .page { color: var(--muted); white-space: nowrap; }
.cba-result h3 { margin: 5px 0 6px; color: var(--navy); font-size: 16px; }
.cba-result p { margin: 0; color: #506575; font-size: 12px; line-height: 1.65; }
.cba-result mark { color: var(--navy); background: #fff1a8; }
.cba-result button { margin-top: 11px; padding: 0; color: var(--blue); background: none; border: 0; cursor: pointer; font-size: 11px; font-weight: 850; }
.source-view { margin-top: 12px; padding: 13px 14px; color: #3f5565; background: #edf3f6; border-left: 3px solid var(--red); font-size: 12px; line-height: 1.65; }
.source-view[hidden] { display: none; }
.empty-results { padding: 45px 20px; color: var(--slate); text-align: center; }
.empty-results strong { display: block; margin-bottom: 5px; color: var(--navy); }

.demo-footer { padding: 29px 0; color: #51647a; background: #fff; border-top: 1px solid #dbe3ea; }
.demo-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.demo-footer img { width: 112px; height: 54px; object-fit: contain; }
.demo-footer p { margin: 0; font-size: 11px; text-align: right; }

@media (max-width: 850px) {
  .workspace, .search-shell { grid-template-columns: 1fr; }
  .results-panel { position: static; }
  .tool-hero .container { grid-template-columns: 1fr; gap: 20px; }
  .tool-mark { display: none; }
}

@media (max-width: 580px) {
  .container { width: calc(100% - 26px); }
  .header-inner { min-height: 70px; gap: 12px; }
  .logo img { width: 118px; height: 58px; }
  .header-badge { display: none; }
  .back-link { font-size: 11px; }
  .tool-hero { padding: 38px 0; }
  .tool-hero h1 { font-size: 37px; }
  .tool-hero p:last-child { font-size: 14px; }
  .tool-main { padding-top: 21px; }
  .field-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .check-group { grid-template-columns: 1fr; }
  .form-body, .search-panel, .search-results { padding: 19px; }
  .panel-head { padding: 0 19px; }
  .panel-head span { display: none; }
  .results-actions { grid-template-columns: 1fr; }
  .search-input { grid-template-columns: 1fr; }
  .search-input button { min-height: 45px; }
  .demo-footer .container { align-items: flex-start; flex-direction: column; }
  .demo-footer p { text-align: left; }
}
