/* Base rules the original prototype host injected: honour [hidden], 14px base text. */
body { margin: 0; font-size: 16px; }
img { max-width: 100%; }
[hidden]:not([hidden=until-found i]) { display: none !important; }

/* OYO Energy colours (from oyoenergy.ca's stylesheet), laid out as a document:
   one reading column, flat bordered boxes, headings with a rule, the colour used sparingly. */
:root {
  --bg: #FBFAF6; --bg-alt: #F3F1EA; --panel: #FFFFFF;
  --navy: #16294B; --navy-dk: #0F1D36; --text: #17233B; --muted: #5C6B84;
  --border: #E3E1D9; --border-strong: #CFCCC2;
  --yellow: #FFCB3D; --pink: #F0498E; --purple: #8A45D6; --teal: #13B6AC;
  --red: #E2483D; --red-dk: #C22F26;
  --grad: linear-gradient(92deg, var(--yellow), var(--pink) 40%, var(--purple) 72%, var(--teal));

  --page: var(--bg); --ink: var(--text); --ink-soft: var(--muted); --line: var(--border); --bar: var(--panel);
}
html { color-scheme: light; }
html, body { background: var(--page); color: var(--ink); }
body { font-family: Manrope, system-ui, sans-serif; line-height: 1.55; }
.font-display, h1, h2, h3, h4 { font-family: Urbanist, Manrope, sans-serif; }
input, select, textarea { background-color: #fff; color: var(--ink); }
input:disabled, select:disabled { background-color: var(--bg-alt); color: var(--muted); }
input[type=file] { background: transparent; }
.drawer label > input:not([type=file]):not([type=checkbox]), .drawer label > select { width: 100%; min-width: 0; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bar); }
.gutter { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* One reading column, narrower than the original deck */
main.max-w-6xl { max-width: 58rem; }

/* ---- Retint the layout's colour classes ---- */
.text-zinc-950, .text-zinc-900, .text-zinc-800 { color: var(--navy); }
.text-zinc-700, .text-zinc-600, .text-zinc-500 { color: var(--muted); }
.text-zinc-400 { color: #9AA6BD; }
.border-zinc-100, .border-zinc-200, .border-zinc-300 { border-color: var(--border); }
.bg-zinc-50, .bg-zinc-100 { background-color: var(--bg-alt); }
.bg-zinc-900 { background-color: var(--navy); }
.hover\:bg-zinc-700:hover { background-color: var(--navy-dk); }
.hover\:bg-zinc-100:hover { background-color: var(--bg-alt); }
.hover\:border-zinc-400:hover { border-color: var(--navy); }
.text-yellow-500, .text-yellow-700, .text-yellow-800 { color: var(--purple); }
.bg-yellow-100 { background-color: rgba(138,69,214,.12); }
.border-yellow-300 { border-color: var(--border-strong); }
.bg-yellow-50 { background-color: var(--bg-alt); }
.text-\[color\:var\(--red\)\] { color: var(--red); }
.rounded-xl, .rounded-lg, .rounded-md { border-radius: 8px; }
.rounded-full { border-radius: 6px; }
.shadow-2xl { box-shadow: 0 0 0 1px var(--border); }

/* ---- Buttons: square-ish, spaced capitals. The brand gradient stays on the primary one. ---- */
.bg-yellow-400, .hover\:bg-yellow-300:hover, button.bg-zinc-900, a.bg-zinc-900, #print-btn {
  border-radius: 6px; border: 1px solid transparent;
  font-family: Manrope, sans-serif; font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  padding: 10px 14px; transition: background .15s, filter .15s;
}
.bg-yellow-400, .hover\:bg-yellow-300:hover { background: var(--grad); color: #12203a; }
.bg-yellow-400:hover { filter: brightness(1.05); }
button.bg-zinc-900, a.bg-zinc-900 { background: var(--navy); color: #fff; }
button.bg-zinc-900:hover, a.bg-zinc-900:hover { background: var(--navy-dk); }
#print-btn { background: transparent; color: var(--navy); border-color: var(--border-strong); }
#print-btn:hover { background: var(--bg-alt); }
header.sticky .bg-yellow-400 svg { display: none; }
.drawer .bg-zinc-900, .drawer .border-zinc-300.rounded-md { border-radius: 6px; }

/* ---- Boxes and numbers ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
.card .card, .card dl.card { background: var(--bg-alt); }
.label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.num { font-family: Urbanist, sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); }
.num.text-yellow-700 { color: var(--purple); }
.num.text-\[color\:var\(--red\)\] { color: var(--red); }
.card > p.num.text-4xl, .card > p.num.text-2xl { font-size: 24px; line-height: 1.2; }

/* ---- Section headings: small caps label, title, rule ---- */
.chapter { padding-top: 40px; padding-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--purple); }
.eyebrow-bar { width: 26px; height: 3px; border-radius: 3px; background: var(--grad); display: block; }
.eyebrow-num { display: none; }
.chapter > header h2 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin-top: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.chapter > header p.text-base { font-size: 17px; color: var(--muted); }
.card h3.font-display { font-size: 18px; }
h4 { font-size: 16px; font-weight: 700; color: var(--navy); }

/* Plain credentials line, status tags, partner strip */
.creds { font-size: 15.5px; color: var(--muted); }
.creds span + span::before { content: "·"; margin: 0 8px; color: var(--border-strong); }
.partners { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.partners img { height: 29px; width: auto; max-width: 168px; object-fit: contain; }

/* Header: white bar, a single thin brand line on top */
header.sticky { box-shadow: 0 1px 0 var(--border); }
header.sticky::before { content: ""; display: block; height: 3px; background: var(--grad); }
/* Phones: the header has little room, so its buttons and "Presenting to" keep the compact size. */
@media (max-width: 639px) {
  header.sticky #print-btn, header.sticky #open-setup { font-size: 12px; letter-spacing: .06em; padding: 8px 10px; }
  header.sticky .text-\[10px\] { font-size: 10px; letter-spacing: .12em; }
  header.sticky .min-w-0 > p { overflow: hidden; text-overflow: ellipsis; }
}

/* Dark cover variant, unused on this page but kept for the layout code */
.cinema-hero { position: relative; overflow: hidden; border-radius: 8px; color: #fafafa; background: var(--navy); }
.cinema-hero > * { position: relative; z-index: 1; }

:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
input[type=range] { accent-color: var(--purple); }
/* Ruled lists, as on monrole.ca's property panel */
ul.ruled { display: grid; }
ul.ruled li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
ul.ruled li:last-child { border-bottom: none; }
.drawer .note { font-size: 14px; line-height: 1.5; color: var(--muted); }
.drawer { transform: translateX(100%); transition: transform .2s ease; }
.drawer.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } .animate-ping { animation: none; } }
h1, h2, h3 { text-wrap: balance; }
p, li, dd, figcaption { text-wrap: pretty; }
.chart text { font-family: Manrope, system-ui, sans-serif; fill: #8A8676; font-size: 13.5px; }
@media (max-width: 640px) { .chart text { font-size: 29px; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.chapter { scroll-margin-top: 90px; }
/* A card heading that is also a link (Quality materials → oyoenergy.ca/equipment). */
.heading-link { text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; }
.heading-link:hover { text-decoration-color: currentColor; }
/* Spec sheet links: a 2×2 grid of tiles beside the warranties card; one column on very narrow phones. */
.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.spec-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-alt); color: var(--navy); transition: border-color .15s; }
.spec-tile:hover { border-color: var(--border-strong); }
.spec-tile:hover .font-semibold { text-decoration: underline; }
@media (max-width: 359px) { .spec-grid { grid-template-columns: 1fr; } }
/* Timeline: who handles each step, on the right of the card. */
.who-pill { flex-shrink: 0; white-space: nowrap; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.who-both { background: rgba(138, 69, 214, .12); color: #6B2FB3; }
.who-us { background: rgba(22, 41, 75, .08); color: var(--navy); }
.who-pill { display: inline-flex; align-items: center; gap: 6px; }
.who-logo { height: 18px; width: auto; display: block; }
/* Qualify / Sign docs: icon pinned left, words centred in the box. */
.sign-btn { position: relative; display: grid; place-items: center; min-height: 88px; padding: 20px 56px; text-align: center; }
.sign-btn-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); }

/* Print / Save as PDF: the proposal only, no controls */
.print-only { display: none; }
@media print {
  html, body { background: #fff !important; }
  /* Print colours and the irradiance gradient even when "Background graphics" is off in the print dialog. */
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.sticky { position: static; box-shadow: none; }
  header.sticky::before { display: none; }
  #open-setup, #print-btn, #drawer, #scrim, #sign-modal, #sign, input[type=range], #f-viz, label[for=f-year] + input { display: none !important; }
  .print-only { display: inline !important; }
  /* A letter page is narrower than the md breakpoint; keep the desktop two-column layouts on paper. */
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-\[1\.4fr_1fr\] { grid-template-columns: 1.4fr 1fr; }
  .card, .chapter > header, figure, svg { break-inside: avoid; }
  /* Keep each section heading on the same page as its content. */
  .chapter > header:not(:last-child) { break-after: avoid; }
  /* The 25-year savings panel is taller than a page: let it split, but only between whole blocks
     (the totals, each chart, the yearly increase row, the slider summary). A grid here overlaps when split. */
  #savings section.card:has(#sv-cost) { display: block; break-inside: auto; }
  #savings section.card:has(#sv-cost) > * + * { margin-top: 16px; }
  #savings section.card:has(#sv-cost) > :not(#sv-cost), #sv-cost > * { break-inside: avoid; }
  #sv-cost > * + * { margin-top: 16px; }
  .chapter { padding: 20px 0; }
  a { text-decoration: none; }
}

/* Old way vs modern way illustrations */
.ovn { display: block; width: 100%; max-width: 26rem; height: auto; overflow: visible; }
.ovn-label { font: 600 17px Manrope, system-ui, sans-serif; fill: var(--muted); }
.ovn-tag { font: 800 17px Manrope, system-ui, sans-serif; fill: #fff; }
.ovn-badge { font: 700 14px Manrope, system-ui, sans-serif; fill: #0E8880; }
.ovn-flow { stroke-dasharray: 3 9; stroke-linecap: round; animation: ovn-flow 1.2s linear infinite; }
.ovn-slow { animation-duration: 3.6s; }
@keyframes ovn-flow { to { stroke-dashoffset: -24; } }
.ovn-rays { transform-origin: 60px 56px; animation: ovn-spin 24s linear infinite; }
@keyframes ovn-spin { to { transform: rotate(360deg); } }
.ovn-smoke { animation: ovn-drift 4s ease-in-out infinite alternate; }
@keyframes ovn-drift { to { transform: translate(4px, -4px); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .ovn-flow, .ovn-rays, .ovn-smoke { animation: none; } }

/* Readability: every Tailwind text size is 2px larger than its default. */
.text-\[10px\] { font-size: 12px; }
.text-\[11px\] { font-size: 13px; }
.text-xs { font-size: 14px; }
.text-sm { font-size: 16px; }
.text-base { font-size: 18px; }
.text-lg { font-size: 20px; }
.text-xl { font-size: 22px; }
.text-2xl { font-size: 26px; }
.text-3xl { font-size: 32px; }
.text-4xl { font-size: 38px; }
@media (min-width: 640px) {
  .sm\:text-base { font-size: 18px; }
  .sm\:text-4xl { font-size: 38px; }
  .sm\:text-6xl { font-size: 62px; }
}

/* System design (with the irradiance scale) and the production chart, each in its own figure. */
.fig-design { display: flex; gap: 12px; padding: 0 16px 0 0; background: #fff; }
.fig-design-img { flex: 1; min-width: 0; display: flex; align-items: center; padding: 12px 0; }
.fig-design-img img { display: block; width: 100%; height: auto; border-radius: 4px; }
.fig-chart { padding: 16px; background: #fff; }
.fig-chart img { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }
.fig-empty { display: grid; place-items: center; width: 100%; min-height: 200px; padding: 24px; text-align: center; font-size: 16px; color: var(--muted); }

/* Deal setup: Delete design button, red so it reads as destructive. */
.design-delete { border-color: rgba(226, 72, 61, .45); color: var(--red-dk); background: #fff; }
.design-delete:hover:not(:disabled) { background: rgba(226, 72, 61, .08); }
.design-delete:disabled { opacity: .45; cursor: not-allowed; }
.design-delete.armed { background: var(--red); border-color: var(--red); color: #fff; }

/* Timeline: the all-in-house panel, styled to stand out from the step cards. */
.inhouse { position: relative; overflow: hidden; border-radius: 14px; padding: 28px 28px 24px; background: var(--navy); color: #fff; box-shadow: 0 10px 30px rgba(22, 41, 75, .18); }
.inhouse::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--grad); }
.inhouse-kicker { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, .1); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; }
.inhouse-logo { height: 16px; width: auto; display: block; }
.inhouse-title { margin-top: 14px; font-family: Urbanist, Manrope, sans-serif; font-size: 28px; line-height: 1.15; font-weight: 800; color: #fff; }
.inhouse-lead { margin-top: 10px; max-width: 46rem; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .82); }
.inhouse-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.inhouse-points li { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.inhouse-points strong { display: block; margin-bottom: 2px; font-size: 16px; color: #fff; }
.inhouse-check { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 800; }
@media (max-width: 639px) { .inhouse { padding: 24px 18px 18px; } .inhouse-title { font-size: 24px; } .inhouse-points { grid-template-columns: 1fr; } }
@media print { .inhouse { box-shadow: none; break-inside: avoid; } .inhouse-points { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Deal setup never scrolls sideways: one column that can't grow past the panel, and fields that shrink
   (fieldsets and selects otherwise size to their longest content, such as long financing names). */
.drawer > .overflow-y-auto { grid-template-columns: minmax(0, 1fr); overflow-x: hidden; }
.drawer fieldset { min-width: 0; }
.drawer select, .drawer input:not([type=checkbox]):not([type=radio]) { max-width: 100%; min-width: 0; }
.drawer select { text-overflow: ellipsis; }
.drawer fieldset, .drawer fieldset .grid, .drawer label.grid { grid-template-columns: minmax(0, 1fr); }
.drawer .flex > select { flex: 1 1 0; min-width: 0; }
@media (max-width: 479px) { .drawer .flex:has(> #f-design) { flex-wrap: wrap; } .drawer .flex > #f-design { flex-basis: 100%; } }

/* Mortgage / HELOC rate box inside the payment card (closer view). */
.rate-edit { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rate-edit input { width: 6rem; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; background: #fff; }
.rate-edit .rate-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
@media print { .rate-edit { display: none !important; } }
.design-delete.armed { white-space: nowrap; }

/* ---------- Deals list (Deal setup) ---------- */
.deal-list { display: grid; gap: 2px; max-height: 272px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; border: 1px solid #e4e4e7; border-radius: 8px; }
.deal-row { display: grid; gap: 2px; width: 100%; min-width: 0; padding: 8px 10px; border-radius: 6px; text-align: left; }
button.deal-row:hover { background: #f4f4f5; }
.deal-row.current { background: #fef9c3; box-shadow: inset 3px 0 0 #E8B820; }
.deal-name, .deal-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-name { font-weight: 600; color: #18181b; }
.deal-meta { font-size: 13px; color: var(--muted); }
.deal-list .note { padding: 8px 10px; }
.warn { color: var(--red-dk); font-weight: 600; }
.link-btn { font-weight: 600; text-decoration: underline; }

/* ---------- Team sign-in ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: var(--bar); }
.gate[hidden] { display: none; }
.gate-card { display: grid; gap: 12px; width: 100%; max-width: 360px; padding: 28px 24px; background: #fff; border: 1px solid #e4e4e7; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .08); }
.gate-logo { height: 40px; width: auto; justify-self: start; }
body.gated { overflow: hidden; }
@media print { .gate { display: none !important; } }
.default-mark { color: #3f3f46; font-weight: 600; }
