
:root {
  --teal: #1F6B83;
  --red: #EE3333;
  --red-dark: #c41f1f;
  --ink: #1a1a1a;
  --paper: #f7f5f2;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Open Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
a { color: var(--red); }
.top {
  background: #fff;
  border-bottom: 4px solid var(--teal);
}
.top-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top img { height: 48px; width: auto; display: block; }
.nav a {
  color: var(--teal);
  font-family: Dosis, "Segoe UI", sans-serif;
  font-weight: 700;
  text-decoration: none;
  margin-left: 18px;
  font-size: 18px;
}
.hero {
  color: #fff;
  background:
    linear-gradient(0deg, rgba(31,107,131,0.72), rgba(0,0,0,0.45)),
    url("images/background.jpg") center / cover no-repeat;
  padding: 64px 16px 56px;
}
.hero-inner { max-width: 960px; margin: 0 auto; }
.hero h1 {
  font-family: Dosis, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 46px;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
}
.hero p { max-width: 36em; font-size: 18px; margin: 0 0 22px; }
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-family: Dosis, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 18px;
  padding: 12px 18px;
  border-radius: 4px;
  border: 0;
}
.btn:hover { background: var(--red-dark); }
.wrap { max-width: 960px; margin: 0 auto; padding: 28px 16px 48px; }
.card {
  background: var(--card);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.card h2, h1.page, h2 {
  font-family: Dosis, "Segoe UI", sans-serif;
  color: var(--teal);
  margin-top: 0;
}
.note { color: #444; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards .card { display: flex; flex-direction: column; align-items: flex-start; }
.cards .card .btn { margin-top: auto; }
footer {
  border-top: 4px solid var(--teal);
  padding: 16px;
  text-align: center;
  color: #555;
  font-size: 14px;
}
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select {
  font: inherit;
  width: 100%;
  max-width: 280px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.checks { font-size: 14px; color: #333; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e4e4e4; }
th { color: var(--teal); font-family: Dosis, sans-serif; }
.warn { color: var(--red-dark); font-weight: 700; }
.results { margin-top: 18px; }
#grid td input { min-width: 64px; }
.stat { font-size: 20px; margin: 4px 0; }
@media (max-width: 640px) {
  .hero h1 { font-size: 34px; }
  .top img { height: 36px; }
  .top-inner { flex-wrap: wrap; }
  .nav a { margin-left: 0; margin-right: 12px; font-size: 16px; }
  input, select { max-width: none; }
}
.print-only { display: none; }
button.btn { cursor: pointer; }
@media print {
  @page { size: letter; margin: 0.5in; }
  html, body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  * { box-shadow: none !important; }
  .top, .nav, .hero, footer, .no-print, .entry, .howto, #size-err[hidden] { display: none !important; }
  .print-only { display: block; }
  .wrap { max-width: none; padding: 0; }
  .card { padding: 0; border-radius: 0; background: #fff; }
  h1.page { display: none; }
  .note, #method-note, #free { color: #000; font-size: 9.5pt; margin: 4px 0; }
  .print-brand { font-family: Dosis, "Segoe UI", sans-serif; font-weight: 700; font-size: 18pt; margin: 0 0 4px; color: #000; }
  #print-summary { margin: 0 0 6px; font-size: 10pt; }
  .print-lines { margin: 0 0 10px; font-size: 10pt; line-height: 2; }
  .card h2, h2, th { color: #000; }
  h2 { font-size: 12pt; margin: 8px 0 2px; break-after: avoid; }
  table { font-size: 10pt; page-break-inside: auto; }
  tr { break-inside: avoid; }
  #grid > table { break-inside: avoid; }
  th, td { padding: 3px 4px; border: 1px solid #000; }
  td input { display: none !important; }
  .print-box { display: block; min-width: 0.45in; min-height: 0.26in; line-height: 0.26in; }
  .results { margin-top: 10px; }
  .stat { font-size: 13pt; font-weight: 700; margin: 2px 0; }
  #grid div { overflow: visible !important; }
  .warn { color: #000; }
  a { color: #000; }
}
/* OA / RVA pages */
.seg { display: flex; flex-wrap: wrap; margin: 6px 0 4px; }
.seg button {
  font-family: Dosis, "Segoe UI", sans-serif; font-weight: 700; font-size: 17px;
  padding: 10px 16px; border: 2px solid var(--teal); background: #fff; color: var(--teal); cursor: pointer;
}
.seg button + button { border-left: 0; }
.seg button:first-child { border-radius: 4px 0 0 4px; }
.seg button:last-child { border-radius: 0 4px 4px 0; }
.seg button[aria-pressed="true"] { background: var(--teal); color: #fff; }
.btn.alt { background: var(--teal); font-size: 15px; padding: 8px 12px; }
.formula { font-size: 14px; color: #444; }
.tablewrap { overflow-x: auto; }
.gtable td input { width: 68px; min-width: 0; max-width: none; padding: 6px; }
.gtable th, .gtable td { padding: 6px 3px; }
.gtable input[readonly] { background: #f0f0f0; }
.gtable td.out { white-space: nowrap; font-weight: 600; }
.sheet-table th { width: 55%; }
@media print {
  .print-sheet h2 { margin-top: 10px; }
  .print-sheet table { margin-bottom: 6px; }
}
.row[hidden] { display: none; }
/* Grille balancing page */
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 14px 0 4px; }
.check input { width: auto; max-width: none; margin: 0; }
.gb td input { width: 70px; min-width: 0; max-width: none; padding: 6px; }
.gb td input.room { width: 96px; }
.gb th, .gb td { padding: 6px 3px; vertical-align: middle; }
.gb td.out { white-space: nowrap; font-weight: 600; }
.gb td.msg { font-size: 12px; color: #666; font-weight: 400; white-space: normal; min-width: 60px; }
.gb td.bad { color: var(--red-dark); }
.gb .key { display: inline-block; font-size: 11px; background: var(--teal); color: #fff; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.gb.hide-area .c-area, .gb.mode-hood .c-rva, .gb.mode-rva .c-hood, .gb.no-strat .c-strat { display: none; }
@media print {
  .gb-print th, .gb-print td { font-size: 9.5pt; }
  .gb-print .key { color: #000; background: none; border: 1px solid #000; }
}
/* Grille balancing: method per grille */
.gb tr.row-hood .r-rva, .gb tr.row-rva .r-hood { display: none; }
.gb.no-rva .c-rva { display: none; }
.gb td select.meth { width: auto; min-width: 104px; max-width: none; padding: 6px; }
.gb .dash { color: #999; }
.gb span.msg { font-size: 12px; color: #666; font-weight: 400; }
/* Sheave calculator page */
.callout { border-left: 6px solid var(--teal); background: #eef7f7; padding: 12px 16px; margin: 16px 0; border-radius: 4px; }
.callout p { margin: 6px 0; }
.sheave-box { flex: 1 1 260px; }
.sheave-box h2 { margin-top: 10px; }
.sv .stat { font-size: 16px; line-height: 1.45; margin: 6px 0; }
.sv .warn { font-weight: 600; }
.sv .sentence { display: block; font-size: 15px; border: 1px dashed #999; padding: 8px 10px; margin-top: 6px; }
details.chart { border: 1px solid #ddd; border-radius: 4px; margin: 8px 0; }
details.chart summary { cursor: pointer; font-weight: 600; padding: 10px 12px; }
details.chart table { border-collapse: collapse; width: 100%; font-size: 14px; }
details.chart th, details.chart td { border-top: 1px solid #eee; padding: 5px 8px; text-align: left; white-space: nowrap; }
/* Sheave page: copy / email recommendation */
.share { margin-top: 16px; }
.share textarea { width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px; }
.share-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn.is-disabled, button.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.copy-status { font-weight: 600; color: var(--teal); }
/* Sheave page: drive sketch */
.drive-fig { margin: 14px 0 4px; }
.drive-fig svg { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; }
.drive-fig .belt { fill: none; stroke: #333; stroke-width: 3; }
.drive-fig .sv-wheel { fill: #e3eef1; stroke: var(--teal); stroke-width: 2.5; }
.drive-fig .sv-new { fill: #fde8e8; stroke: var(--red); }
.drive-fig .sv-old { fill: none; stroke: #777; stroke-width: 1.5; stroke-dasharray: 4 3; }
.drive-fig .sv-hub { fill: #555; }
.drive-fig .sv-ph { fill: none; stroke: #aaa; stroke-width: 2; stroke-dasharray: 6 4; }
.drive-fig .sv-q { font-size: 20px; fill: #999; text-anchor: middle; font-weight: 600; }
.drive-fig .sv-lab { font-size: 12.5px; font-weight: 600; fill: #222; text-anchor: middle; }
.drive-fig .sv-labnew { fill: var(--red-dark); }
.drive-fig .sv-sub { font-size: 11px; fill: #555; text-anchor: middle; }
.drive-fig .fig-note { font-size: 13px; color: #555; text-align: center; margin: 4px 0 0; }
@media print {
  .print-fig svg { max-width: 3.4in; margin: 4px 0; }
  .print-fig .fig-note { text-align: left; font-size: 9pt; }
}
/* Sheave page: turns open */
#m-pdwrap[hidden], #m-turnswrap[hidden] { display: none; }
.sv .midnote { display: block; font-size: 15px; background: #eef7f7; border-left: 4px solid var(--teal); padding: 6px 10px; }
.sv .midnote.warn { background: #fdf0f0; border-left-color: var(--red); }
/* Coil face velocity page */
.step h2 { display: flex; align-items: center; gap: 10px; }
.stepnum { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 18px; }
.step { margin-top: 16px; }
textarea#fpm { width: 100%; max-width: 100%; box-sizing: border-box; font: inherit; padding: 8px; }
@media print { .stepnum { background: none; color: #000; border: 1px solid #000; } }
/* Reorganized nav, home groups, formulas */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.nav a, .nav summary { margin: 0; }
@media (max-width: 640px) { .nav a { margin-right: 0; } .nav { gap: 4px 14px; } }
.navdrop { position: relative; }
.navdrop summary { list-style: none; cursor: pointer; color: var(--teal); font-family: Dosis, "Segoe UI", sans-serif; font-weight: 700; font-size: 18px; }
.navdrop summary::-webkit-details-marker { display: none; }
.navdrop summary::after { content: " \25BE"; }
@media (max-width: 640px) { .navdrop summary { font-size: 16px; } }
.navmenu { position: absolute; left: 0; top: 100%; z-index: 30; background: #fff; border: 1px solid #ccc; border-top: 3px solid var(--teal); border-radius: 0 0 4px 4px; box-shadow: 0 4px 10px rgba(0,0,0,.15); padding: 6px 0; min-width: 170px; }
.navmenu a { display: block; margin: 0; padding: 8px 16px; white-space: nowrap; }
.navmenu a:hover { background: #eef7f7; }
h2.grp { font-family: Dosis, sans-serif; color: var(--teal); margin: 26px 0 12px; }
.fgroup { margin-top: 20px; }
.fitem { border-top: 1px solid #e4e4e4; padding: 8px 0; }
.fitem h3 { margin: 6px 0 2px; font-size: 17px; }
.fx { font-weight: 600; margin: 2px 0; word-break: break-word; }
.fitem .formula { margin: 2px 0 4px; }
/* Kitchen hood page */
.req { color: var(--red-dark); }
.pickgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 10px 0; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 2px solid #d5d5d5; border-radius: 8px; padding: 10px 8px 8px; cursor: pointer; font: inherit; color: var(--ink); text-align: center; }
.pick:hover { border-color: var(--teal); }
.pick[aria-checked="true"] { border-color: var(--teal); background: #eef7f7; box-shadow: 0 0 0 2px var(--teal) inset; }
.pick svg { width: 100%; max-width: 132px; height: auto; display: block; }
.pick .pk-name { font-weight: 600; font-size: 14px; line-height: 1.25; }
.pick .pk-sub { font-size: 12px; color: #666; line-height: 1.2; }
.hsvg .fr { fill: #f4f7f8; stroke: #333; stroke-width: 2; }
.hsvg .ln { fill: none; stroke: #333; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hsvg .lt { fill: none; stroke: #777; stroke-width: 1.1; }
.hsvg .dt { fill: #777; }
.hsvg .ac { fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.hsvg .acf { fill: var(--teal); }
.hsvg .rd { fill: var(--red); }
.hsvg .rdl { fill: none; stroke: var(--red); stroke-width: 1.8; }
.hsvg text { font-family: "Open Sans", sans-serif; font-size: 9px; fill: #333; }
.hsvg .tl { font-size: 8px; fill: #555; }
.methwrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin: 10px 0; }
.hfig { flex: 0 1 300px; }
.hfig svg { width: 100%; max-width: 300px; height: auto; display: block; border: 1px solid #e4e4e4; border-radius: 6px; background: #fff; }
.methwrap .formula { flex: 1 1 280px; margin: 0; }
.htable td input, .htable td select { width: 84px; min-width: 0; max-width: none; padding: 6px; }
.htable td input.rd-in { width: 190px; }
.htable th, .htable td { padding: 6px 4px; vertical-align: middle; }
.htable td.out { white-space: nowrap; font-weight: 600; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 13px; font-weight: 700; color: #fff; }
.badge.pass { background: #2e7d32; }
.badge.fail { background: var(--red-dark); }
.seg[hidden], #meth-row [hidden], #ha-tabs[hidden] { display: none; }
@media print {
  .badge { color: #000; background: none !important; border: 1px solid #000; }
  .print-sheet .hsvg-print svg { max-width: 2.6in; }
}
.htable { width: auto; }
.htable td select { width: 112px; }
#meth { max-width: 460px; }
.ftab { width: auto; font-size: 14px; margin: 6px 0; }
.ftab th, .ftab td { padding: 4px 10px; white-space: nowrap; text-align: center; }
.ftab td:first-child { white-space: normal; text-align: left; max-width: 300px; font-size: 13px; }
.ftab tr.use td { background: rgba(37, 99, 235, 0.10); font-weight: 600; }
#mua-card[hidden], #cj-card[hidden] { display: none; }
.ftab tr.ref td { color: #777; font-style: italic; }
.hw-note { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: #555; max-width: 340px; }
.hw-svg { width: 72px; height: 57px; flex: none; color: #24566e; }
.hw-svg text { fill: currentColor; font-family: inherit; }
