:root {
  font-family: system-ui, -apple-system, sans-serif;
  color: #1b3129;
  background: #f6f8f7;
  font-synthesis: none;
  --ink: #1b3129;
  --ink-secondary: #3f5348;
  --ink-muted: #506357;
  --green: #244e3d;
  --green-hover: #173a2c;
  --border: #dbe3dd;
  --surface: #ffffff;
  --surface-tint: #f0f5ef;
  --ok-bg: #d9ebd2;
  --ok-ink: #274a29;
  --warn-bg: #f6e6c5;
  --warn-ink: #6e4810;
  --neutral-bg: #e3e8e1;
  --neutral-ink: #435045;
  --error-bg: #fcedea;
  --error-border: #e3b2a5;
  --error-ink: #8f2d19;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #f6f8f7; }

button, input, select, textarea { font: inherit; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

button { cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
button:disabled { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: wait; }

a { color: #244e3d; text-underline-offset: 2px; }
a:hover { color: var(--green-hover); }

[hidden] { display: none !important; }
[inert] { pointer-events: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--green);
  color: #fff;
  padding: 10px 16px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { left: 16px; }

/* Header */
header {
  min-height: 84px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 5.5%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand {
  text-decoration: none;
  color: #1f392f;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
}
.brandmark {
  display: inline-grid;
  place-items: center;
  background: #254d3c;
  color: #cdf9a6;
  width: 34px;
  height: 36px;
  border-radius: 9px;
  margin-right: 10px;
  font-size: 22px;
  flex-shrink: 0;
}
.branddot { color: #679450; }
.header-note { font-size: 14px; color: var(--ink-muted); text-align: center; }
.lock { margin-right: 6px; }
.header-actions { justify-self: end; }

.text-button {
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #26503c;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.text-button:hover { background: #edf3ec; color: var(--green-hover); }

/* Layout */
main { max-width: 1260px; margin: auto; padding: 36px 44px 0; }

.beta-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 26px;
  padding: 16px 20px;
  border: 1px solid #d2dcc1;
  border-radius: 11px;
  background: #f1f5e9;
  color: #35452b;
}
.beta-label {
  flex-shrink: 0;
  background: #d9e4c5;
  color: #2f4025;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .7px;
}
.beta-notice > div > strong { font-size: 15px; color: #24351d; }
.beta-notice p { font-size: 14px; line-height: 1.6; margin: 6px 0 0; color: #435339; }

/* Audience Tabs */
.audience-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: 0 0 32px;
  padding-bottom: 12px;
}
.audience-tabs button {
  border: 1px solid transparent;
  background: transparent;
  padding: 11px 16px;
  border-radius: 8px;
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 15px;
  transition: none;
}
.audience-tabs button:hover:not([aria-selected="true"]) {
  background: #eaf0eb;
  color: var(--ink);
}
.audience-tabs button[aria-selected="true"] {
  background: var(--green);
  color: #fff;
}

html[data-checker-mode="local"] .checker-public,
html[data-checker-mode="production"] .checker-local {
  display: none;
}

.public-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  margin: 0 0 1.25rem;
}

.public-navigation a {
  padding: .4rem 0;
  text-underline-offset: .2em;
}

.public-navigation [aria-current="page"] {
  font-weight: 700;
}
.audience-tabs span { font-size: 12px; font-weight: 400; margin-left: 8px; opacity: .9; }

.eyebrow { font-size: 12px; letter-spacing: 1.9px; font-weight: 700; color: #4a6653; margin-bottom: 12px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 30px; }
h1 { font-size: 42px; letter-spacing: -1.6px; line-height: 1.15; margin: 0 0 12px; font-weight: 750; color: var(--ink); }
.intro p { margin: 0; color: var(--ink-secondary); font-size: 16px; }
.country { font-size: 13px; color: var(--ink-muted); padding-bottom: 2px; white-space: nowrap; }

/* Consumer Workspace */
.workspace {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  border: 1px solid #d5ded7;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 6px 24px #1d362908;
}
.input-panel { padding: 30px; border-right: 1px solid var(--border); min-width: 0; }
.results-panel { padding: 30px; background: var(--surface-tint); display: flex; flex-direction: column; min-width: 0; }

.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.heading-action { margin-left: auto; }
.step {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #c6d4c9;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: #3f5b4a;
  flex-shrink: 0;
}
h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: -.2px; color: var(--ink); }
.small-tag {
  margin-left: auto;
  background: #e1eae2;
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 500;
  color: #3c5043;
}
.input-panel .small-tag { background: #eff3ef; }

.dropzone {
  border: 1.5px dashed #a8bca9;
  border-radius: 12px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 20px;
  background: #fbfdfb;
  transition: background-color .2s, border-color .2s;
}
.dropzone.drag { background: #e3f2dc; border-color: #285537; }
.upload-icon {
  width: 52px;
  height: 56px;
  border: 1px solid #d2e0cc;
  border-radius: 12px;
  background: #edf5e7;
  color: #395c34;
  font-size: 34px;
  margin-bottom: 16px;
  line-height: 1.45;
}
h3 { font-size: 18px; letter-spacing: -.35px; margin: 0 0 8px; color: var(--ink); }
.dropzone p { font-size: 13px; color: var(--ink-muted); margin: 0 0 20px; }

.primary {
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.primary:hover:not(:disabled) { background: var(--green-hover); }

.local-note { font-size: 12px; color: var(--ink-muted); margin-top: 16px; }
.alternatives { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 18px 0 0; }
.alternatives > span { font-size: 13px; color: var(--ink-muted); }
.alternatives button { font-size: 13px; }

.file-status {
  padding: 12px 15px;
  border-radius: 8px;
  background: #e9f2e4;
  border: 1px solid #cfe0c8;
  color: #25412b;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.file-status.is-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-ink);
}
.file-status > #cancelUpload { flex-shrink: 0; }

/* Empty Result Panel */
.result-hero { text-align: center; padding: 8px 0 24px; }
.check-emblem {
  width: 62px;
  height: 62px;
  background: #dcead4;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: #3d6d34;
  font-size: 30px;
  border: 7px solid #e7f0e2;
}
.result-hero h3 { font-size: 25px; line-height: 1.32; font-weight: 650; letter-spacing: -.6px; }
.result-hero p { color: var(--ink-secondary); font-size: 14px; line-height: 1.65; margin: 10px 0 0; }

.check-preview { border-top: 1px solid #d5e0d2; display: flex; align-items: center; padding: 16px 0; gap: 16px; }
.check-preview > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.check-preview h4 { font-size: 14px; font-weight: 600; margin: 0 0 4px; color: var(--ink); }
.check-preview p { font-size: 13px; color: var(--ink-secondary); margin: 0; line-height: 1.45; }
.mini-icon { margin-left: auto; color: #54724a; font-size: 19px; }

.result-footnote {
  border-top: 1px solid #d4dfd0;
  margin-top: auto;
  padding-top: 18px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-muted);
}

/* Bottom Bar & Explanations */
.bottom-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; padding: 30px 2px 28px; }
.bottom-bar > div { display: flex; gap: 12px; font-size: 13px; color: var(--ink-muted); line-height: 1.65; }
.bottom-bar strong { color: var(--ink); font-size: 14px; font-weight: 600; }
.bottom-icon { color: #466c3e; font-size: 24px; line-height: 1.3; flex-shrink: 0; }

.explanation { border-top: 1px solid var(--border); padding: 20px 0; color: var(--ink-secondary); font-size: 14px; line-height: 1.75; }
.explanation summary { cursor: pointer; color: #2b4a39; font-weight: 600; }

footer {
  max-width: 1260px;
  margin: 0 auto;
  padding: 24px 44px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--ink-muted);
  font-size: 13px;
}
footer span:first-child { font-weight: 700; color: var(--ink-secondary); }

/* Forms */
.form-heading, .line-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; gap: 12px; }
.hint { font-size: 13px; color: var(--ink-muted); line-height: 1.6; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-secondary); margin: 13px 0; }

input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #c9d4ca;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  margin-top: 7px;
  min-width: 0;
  font-size: 14px;
  transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #9cb09f; }
textarea { resize: vertical; line-height: 1.5; min-height: 75px; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.line { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 12px 0; background: #fbfcfa; min-width: 0; }
.row-legend { padding: 0 4px; font-size: 13px; font-weight: 600; }
.line-head { display: flex; gap: 10px; align-items: flex-start; }
.line-head input, .line-head .description { margin: 0; flex: 1; min-width: 0; }
.remove {
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-muted);
  padding: 6px 9px;
  min-width: 34px;
  min-height: 34px;
}
.remove:hover { background: var(--error-bg); color: var(--error-ink); }

.row-fields { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 10px; margin-top: 4px; }
.row-fields label { margin-bottom: 0; }

.line-calc {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #f0f5ef;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.line-calc.is-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-weight: 500;
}

.live-totals {
  margin: 16px 0 4px;
  padding: 13px 15px;
  border-radius: 9px;
  background: #f2f6f2;
  border: 1px solid #d2dfd5;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.live-totals > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-secondary); }
.live-totals strong { color: var(--ink); font-size: 14px; }
.live-totals .live-diff-ok strong { color: var(--ok-ink); }
.live-totals .live-diff-warn { padding-top: 6px; border-top: 1px solid #d5e0d7; }
.live-totals .live-diff-warn span, .live-totals .live-diff-warn strong { color: var(--warn-ink); font-weight: 600; }

.add-button {
  width: 100%;
  padding: 11px 14px;
  border: 1px dashed #99b09a;
  background: #f6faf4;
  border-radius: 8px;
  color: #2f5233;
  font-size: 14px;
  font-weight: 500;
}
.add-button:hover { background: #ebf4e7; border-color: #6b8e6d; }

.check-button { width: 100%; margin-top: 17px; justify-content: space-between; }

.error {
  color: var(--error-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}
.error:not(:empty) {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 7px;
  padding: 10px 13px;
  margin-top: 12px;
}

/* Report & Findings */
.report-summary { padding: 8px 0 20px; }
.report-summary h3 { font-size: 26px; line-height: 1.28; margin-top: 14px; }
.report-summary p { font-size: 14px; line-height: 1.65; color: var(--ink-secondary); margin: 8px 0 0; }
.report-document { overflow-wrap: anywhere; }
.report-document:empty { display: none; }

.finding { border-top: 1px solid #d4dfd0; padding: 18px 0; }
.finding h4 { font-size: 15px; margin: 0 0 9px; white-space: pre-line; line-height: 1.55; color: var(--ink); }
.finding, .research-row, .offer-matches { overflow-wrap: anywhere; }
.finding p { font-size: 14px; line-height: 1.65; margin: 8px 0; color: var(--ink-secondary); }
.finding a { font-size: 13px; font-weight: 500; }

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--ok-bg);
  color: var(--ok-ink);
}
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }

.price-comparison {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 14px 0 10px;
  font-size: 14px;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}
.price-comparison strong { font-size: 20px; color: var(--ink); }

/* Factual Price Comparison Bar */
.range-viz { margin: 12px 0 14px; }
.range-track {
  position: relative;
  height: 8px;
  border-radius: 99px;
  background: #dce5d8;
}
.range-band {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: #7aa772;
}
.range-marker {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px #00000028;
  transform: translate(-50%, -50%);
}
.range-marker.is-high { background: #a76118; }
.range-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.finding-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.finding-actions button,
.assumption button {
  padding: 8px 12px;
  border: 1px solid #a9bea2;
  background: #fafdf8;
  border-radius: 6px;
  color: #27482d;
  font-size: 13px;
  font-weight: 500;
}
.finding-actions button:hover,
.assumption button:hover { background: #e8f2e4; border-color: #799c74; }

.assumption {
  padding: 12px 14px;
  background: #fbf4de;
  border: 1px solid #e1d29e;
  border-radius: 8px;
  margin: 10px 0;
}
.assumption p { color: #634d17; margin: 0 0 10px; font-size: 13px; }

.report-actions {
  padding: 18px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.report-actions button {
  border: 1px solid #aec2a8;
  background: var(--surface);
  padding: 11px 13px;
  color: #244a32;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
}
.report-actions button:hover { background: #e8f1e5; border-color: #7c9e79; }
.report-actions #copyQuestions,
.report-actions #reportActionStatus { grid-column: 1 / -1; margin: 0; }

pre { white-space: pre-wrap; font-size: 12px; max-height: 180px; overflow: auto; background: #f6f8f6; padding: 10px; border-radius: 6px; border: 1px solid var(--border); }
details { font-size: 13px; line-height: 1.6; }
summary { cursor: pointer; }

.stale {
  background: var(--warn-bg);
  border: 1px solid #dfca96;
  color: var(--warn-ink);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

/* 5-Stage Workflow Tracker */
.check-workflow {
  margin: 0 0 22px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid #c6d6c9;
  background: var(--surface);
}
.check-workflow h3 { font-size: 16px; margin-bottom: 4px; }
.check-workflow > p { margin: 0 0 12px; }
.workflow-stages { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.workflow-stage {
  padding: 12px 13px;
  border: 1px solid #d9e2db;
  border-left: 4px solid #bccac0;
  border-radius: 8px;
  background: #fcfdfc;
}
.workflow-stage-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.workflow-number {
  display: inline-grid;
  place-items: center;
  border: 1px solid #b8c9bc;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}
.workflow-stage p { margin: 7px 0 0; font-size: 13.5px; color: var(--ink-secondary); line-height: 1.55; }
.workflow-state {
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}
.workflow-stage[data-state="done"] { border-left-color: #2f7245; }
.workflow-stage[data-state="done"] .workflow-state { background: var(--ok-bg); color: var(--ok-ink); }
.workflow-stage[data-state="attention"] { border-left-color: #a96d1e; }
.workflow-stage[data-state="attention"] .workflow-state { background: var(--warn-bg); color: var(--warn-ink); }
.workflow-stage[data-state="running"] { border-left-color: #2b6f84; }
.workflow-stage[data-state="running"] .workflow-state { background: #dceff4; color: #1d5161; }

.workflow-review { margin-top: 12px; }
.workflow-review summary { cursor: pointer; font-weight: 600; color: var(--ink); line-height: 1.6; }
.workflow-review li { margin: 7px 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-secondary); }
.workflow-review ul { padding-left: 20px; margin: 8px 0 0; }

/* History & Price Memory */
.history-upload { padding: 18px; margin: 18px 0; background: #f2f6f3; border: 1px solid #d1dfd5; border-radius: 12px; }
.history-upload h3 { margin: 0 0 8px; font-size: 16px; }
.memory-consent { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; cursor: pointer; }
.memory-consent input { width: 18px; min-width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }

.ql-history { margin-top: 12px; padding: 12px; background: #f2f6f3; border-radius: 9px; line-height: 1.6; }
.ql-history button { display: block; margin-top: 10px; }
.history-entry { padding: 12px 0; border-bottom: 1px solid #d1dfd5; }
.history-entry p { margin: 4px 0 10px; color: var(--ink-secondary); }
.history-entry summary { cursor: pointer; padding: 6px 0; }
.history-entry li { overflow-wrap: anywhere; margin: 8px 0; }
.history-record-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#clearCheckerMemory { margin-top: 14px; }
.history-clear { margin-top: 14px; }
.history-picker { margin: 14px 0; }
.history-picker select { max-width: 100%; }
.history-picker button { margin-top: 8px; }

.ql-description { flex: 1; min-width: 0; resize: vertical; line-height: 1.5; margin: 0; }
.ql-history button,
.history-picker button,
.history-entry button,
.history-clear button {
  border: 1px solid #aec2b4;
  border-radius: 6px;
  background: var(--surface);
  color: var(--green);
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 500;
}
.ql-history button:hover,
.history-picker button:hover:not(:disabled),
.history-entry button:hover { background: #e8f1eb; border-color: #7c9e87; }
.history-clear button:hover { background: var(--error-bg); border-color: var(--error-border); color: var(--error-ink); }

/* Business Quote Workspace */
.quote-workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.quote-form { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; min-width: 0; }
.quote-preview-panel { position: sticky; top: 20px; min-width: 0; }
.quote-preview-panel .section-heading { margin-bottom: 14px; }
.work-description { margin: 22px 0; background: #f1f6ed; padding: 16px; border-radius: 10px; border: 1px solid #d8e4d1; }
.work-description label { margin-top: 0; }
.quote-line { background: #fafcf8; border: 1px solid var(--border); border-radius: 9px; padding: 14px; margin-bottom: 12px; min-width: 0; }
.quote-row-fields { display: grid; grid-template-columns: .7fr 1fr 1fr .9fr; gap: 8px; }
.quote-row-fields input, .quote-row-fields select { padding: 10px 8px; }
.quote-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.quote-tools p { margin: 0; max-width: 280px; }
.quote-tools button { white-space: nowrap; font-size: 13px; padding: 11px 16px; }

.quote-paper {
  background: var(--surface);
  padding: 32px 26px;
  border: 1px solid #d4ded0;
  border-radius: 8px;
  box-shadow: 0 10px 25px #1e35210a;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  min-height: 560px;
}
.quote-document-top { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 20px; border-bottom: 2px solid #2b5438; }
.quote-document-top strong { font-size: 19px; color: var(--ink); }
.quote-document-top p { font-size: 12.5px; margin: 5px 0; color: var(--ink-secondary); }
.quote-title { font-size: 21px; letter-spacing: 2px; font-weight: 700; text-align: right; color: var(--ink); }
.quote-title small { display: block; font-size: 10.5px; letter-spacing: 1.2px; color: var(--ink-muted); margin-top: 2px; }
.quote-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.quote-meta > div > span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 1.4px; color: var(--ink-muted); margin-bottom: 4px; }
.quote-meta strong { font-size: 14px; color: var(--ink); }
.quote-meta p { font-size: 12.5px; margin: 4px 0; color: var(--ink-secondary); }
.quote-meta dl { font-size: 12px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; align-content: start; }
.quote-meta dt { color: var(--ink-muted); }
.quote-meta dd { margin: 0; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.quote-paper h2 { font-size: 19px; margin: 20px 0 8px; }
.quote-paper > p { font-size: 13px; color: var(--ink-secondary); margin: 0; }

.quote-table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin-top: 18px; font-variant-numeric: tabular-nums; }
.quote-table th { background: #edf3e8; color: #314b34; font-size: 11px; font-weight: 600; text-align: left; padding: 9px 7px; }
.quote-table td { border-bottom: 1px solid #e3e9de; padding: 11px 7px; vertical-align: top; }
.quote-table .num { text-align: right; white-space: nowrap; }
.quote-table th.num { white-space: normal; }
.quote-summary { margin-top: 18px; margin-left: auto; max-width: 340px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.quote-summary > div { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; color: var(--ink-secondary); }
.quote-summary strong { color: var(--ink); }
.quote-summary .quote-grand-total { border-top: 1.5px solid #c9d8c1; margin-top: 8px; padding: 11px 0 4px; font-size: 15.5px; color: var(--ink); }
.quote-paper section { border-top: 1px solid #e2eadc; margin-top: 20px; padding-top: 16px; }
.quote-paper h3 { font-size: 14px; margin-bottom: 6px; }
.quote-paper section p { font-size: 12.5px; color: var(--ink-secondary); margin: 0; }
.preserve-lines { white-space: pre-wrap; }
.quote-signoff { font-size: 12px; color: var(--ink-muted); margin-top: 26px; }
.quote-form #qError { margin: 12px 0; }
.quote-form #qStatus { margin-bottom: 0; }

/* Marketplace */
.market-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.offer-card { padding: 20px; background: var(--surface); border: 1px solid #d4dfd0; border-radius: 10px; margin: 14px 0; }
.offer-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.offer-badges .small-tag { margin-left: 0; font-size: 11.5px; }
.offer-card h3 { margin-top: 14px; }
.offer-card h4 { font-size: 15px; margin: 6px 0 10px; color: var(--ink-secondary); font-weight: 500; }
.offer-card p { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.offer-card .offer-rate { font-size: 24px; font-weight: 650; margin: 10px 0; font-variant-numeric: tabular-nums; }
.offer-rate small { font-size: 13px; font-weight: 400; color: var(--ink-muted); }
.offer-card > a { font-size: 14px; font-weight: 500; }
.market-empty { padding: 28px; border: 1px dashed #b2c3aa; border-radius: 10px; background: #f2f6ee; line-height: 1.65; color: var(--ink-secondary); }
.offer-matches { border-top: 2px solid #cfdcca; margin-top: 24px; padding-top: 22px; }
.offer-matches > .section-heading { margin-bottom: 12px; }
.offer-matches p { font-size: 14px; line-height: 1.65; }
.offer-matches .offer-card { padding: 16px; }
.offer-matches .price-comparison strong { font-size: 17px; }
.alternative-group > h4 { font-size: 15px; margin-top: 22px; }

/* Account Gate & Bar */
.account-gate {
  max-width: 640px;
  margin: 16px auto 48px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 6px 22px #1d362906;
}
.account-gate .gate-title {
  font-size: 29px;
  letter-spacing: -.7px;
  line-height: 1.2;
  margin: 16px 0 10px;
  font-weight: 750;
  color: var(--ink);
}
.account-gate p { line-height: 1.65; color: var(--ink-secondary); }
.account-local { padding: 14px 16px; background: #f2f6f3; border: 1px solid #d6e2d9; border-radius: 8px; font-size: 13px; color: var(--ink-secondary); }
.account-switch { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.account-switch button {
  border: 1px solid #aec2b4;
  border-radius: 7px;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--green);
  font-weight: 600;
  transition: none;
}
.account-switch button:hover:not([aria-pressed="true"]) { background: #edf4ef; }
.account-switch button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

.password-field { display: flex; gap: 8px; align-items: stretch; margin-top: 7px; }
.password-group > label { margin-bottom: 0; }
.password-field input { margin-top: 0; flex: 1; }
.toggle-password {
  flex-shrink: 0;
  border: 1px solid #c9d4ca;
  border-radius: 7px;
  background: #f6f9f6;
  color: var(--ink-secondary);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
}
.toggle-password:hover { background: #e8f0e9; color: var(--ink); }

.account-bar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-secondary);
  overflow-wrap: anywhere;
}

/* Email & Research */
.report-email { border-top: 1px solid #cfdcca; margin-top: 22px; padding-top: 20px; }
.report-email > button {
  padding: 10px 14px;
  border: 1px solid #aec2b4;
  border-radius: 7px;
  background: var(--surface);
  color: var(--green);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.report-email > button:hover { background: #e9f2eb; border-color: #7c9e87; }
.report-email .hint { line-height: 1.6; }

.research-results { border-top: 2px solid #cfdcca; margin-top: 24px; padding-top: 22px; }
.research-results p { font-size: 14px; line-height: 1.65; }
.research-row { border: 1px solid #cfdcca; padding: 16px; border-radius: 10px; margin: 14px 0; background: var(--surface); }
.research-row h4 { margin: 0 0 8px; font-size: 15px; }
.research-select { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.research-select input { width: 17px; height: 17px; margin: 0; accent-color: var(--green); }
.research-sharing { background: #f2f6f3; border: 1px solid #aec2b4; border-radius: 8px; padding: 14px; }
.research-sharing h4 { margin: 0; font-size: 15px; }
.research-sharing ol { padding-left: 20px; }
.research-sharing li { overflow-wrap: anywhere; margin: 8px 0; }
.research-row label[hidden], .research-sharing[hidden] { display: none; }
.research-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.research-results button {
  border: 1px solid #aec2b4;
  border-radius: 7px;
  padding: 10px 15px;
  background: var(--surface);
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
}
.research-results button:hover:not(:disabled) { background: #e8f1eb; border-color: #7c9e87; }
.research-answer { font-size: 13.5px; color: var(--ink-secondary); }
.research-answer a { font-weight: 600; text-decoration: underline; }

/* Responsive */
@media (min-width: 1100px) {
  .workspace { min-height: 560px; }
}

@media (max-width: 1050px) {
  .quote-workspace { grid-template-columns: 1fr; }
  .quote-preview-panel { position: static; }
  .quote-paper { padding: 28px; max-width: 720px; margin: auto; }
}

@media (max-width: 900px) {
  .market-layout { grid-template-columns: 1fr; }
}

@media (max-width: 850px) {
  header { grid-template-columns: 1fr auto; padding: 12px 22px; min-height: 72px; }
  .header-note { display: none; }
  main { padding: 24px 20px 0; }
  footer { padding: 22px 20px 30px; }
  .workspace { grid-template-columns: 1fr; }
  .input-panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .bottom-bar { grid-template-columns: 1fr; gap: 16px; }
  .result-hero { padding: 6px 0 18px; }
  .country { display: none; }
  .results-panel { min-height: 400px; }
  h1 { font-size: 34px; }
  footer span:last-child { display: none; }
}

@media (max-width: 580px) {
  .beta-notice { flex-direction: column; gap: 8px; padding: 14px 15px; margin-bottom: 20px; }
  .audience-tabs { gap: 4px; margin-bottom: 24px; }
  .audience-tabs button { padding: 9px 11px; font-size: 13.5px; }
  .audience-tabs span { display: none; }
  .quote-form { padding: 18px; }
  .quote-row-fields { grid-template-columns: 1fr 1fr; }
  .quote-paper { padding: 18px 14px; }
  .quote-tools { align-items: start; flex-wrap: wrap; }
  .quote-tools button { white-space: normal; }
  .quote-meta { grid-template-columns: 1fr; }
  .quote-meta dl { max-width: 260px; }
  .quote-summary { margin-left: 0; max-width: none; }
  .quote-table th, .quote-table td { padding: 7px 4px; font-size: 11.5px; }
  .quote-table .num { white-space: normal; }
  .quote-document-top strong { font-size: 16px; }
  .account-gate { padding: 20px; }
  .account-gate .gate-title { font-size: 24px; }
  .account-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .report-actions { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand { font-size: 19px; }
  .brandmark { width: 28px; height: 30px; font-size: 18px; margin-right: 8px; }
  header { padding: 10px 14px; }
  .input-panel, .results-panel { padding: 20px 16px; }
  main { padding: 20px 14px 0; }
  .intro p { font-size: 14.5px; line-height: 1.55; }
  .alternatives { gap: 8px; flex-wrap: wrap; }
  .row-fields { grid-template-columns: 1fr 1fr; }
  .row-fields label:last-child { grid-column: 1 / -1; }
  .two-col { grid-template-columns: 1fr; }
  .small-tag { font-size: 11px; }
  .section-heading { gap: 7px; }
  .check-workflow { padding: 13px; }
  .workflow-state { margin-left: 33px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* Print Styles — scoped cleanly to whichever panel is active */
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; color: #162417; }
  header,
  footer,
  .skip-link,
  .beta-notice,
  .audience-tabs,
  .account-gate,
  .account-bar,
  .bottom-bar,
  .explanation { display: none !important; }
  main { max-width: none; margin: 0; padding: 0; }

  /* Business quote print */
  #businessPanel:not([hidden]) .eyebrow,
  #businessPanel:not([hidden]) .intro,
  #businessPanel:not([hidden]) .quote-form,
  #businessPanel:not([hidden]) .quote-preview-panel > .section-heading,
  #businessPanel:not([hidden]) .quote-tools,
  #businessPanel:not([hidden]) .quote-preview-panel > .hint { display: none !important; }
  #businessPanel:not([hidden]) .quote-workspace { display: block; }
  #businessPanel:not([hidden]) .quote-preview-panel { position: static; }
  .quote-paper { border: 0; box-shadow: none; max-width: none; min-height: 0; padding: 0; color: #162417; font-size: 10.5pt; }
  .quote-table th { background: #edf3e8 !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .quote-table tr, .quote-summary, .quote-paper section, .quote-signoff { break-inside: avoid; }
  .quote-table thead { display: table-header-group; }
  .quote-document-top, .quote-meta { break-inside: avoid; }
  .quote-title small { color: #555; }
  .quote-paper p, .quote-paper section p { color: #3a473b; }

  /* Consumer check report print */
  #checkPanel:not([hidden]) .eyebrow,
  #checkPanel:not([hidden]) .intro,
  #checkPanel:not([hidden]) .input-panel,
  #checkPanel:not([hidden]) .report-actions,
  #checkPanel:not([hidden]) .report-email,
  #checkPanel:not([hidden]) .research-controls,
  #checkPanel:not([hidden]) .research-sharing,
  #checkPanel:not([hidden]) .research-instructions,
  #checkPanel:not([hidden]) .research-row label,
  #checkPanel:not([hidden]) .finding-actions,
  #checkPanel:not([hidden]) .assumption button,
  #checkPanel:not([hidden]) #matchRegionLabel,
  #checkPanel:not([hidden]) #manageOffers { display: none !important; }
  #checkPanel:not([hidden]) .workspace { display: block; border: 0; box-shadow: none; overflow: visible; }
  #checkPanel:not([hidden]) .results-panel { background: #fff; padding: 0; }
  #checkPanel:not([hidden]) .finding,
  #checkPanel:not([hidden]) .workflow-stage,
  #checkPanel:not([hidden]) .offer-card { break-inside: avoid; }
  .pill, .range-band, .range-marker { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* Market tab print */
  #marketPanel:not([hidden]) #offerForm { display: none !important; }
  #marketPanel:not([hidden]) .market-layout { display: block; }
}
