/* Kerfwise. The shared look (/_look/look.css) loads after this and sets the type, colours
   and buttons; this file lays out the landing page and the tool, and the print views. */

* { box-sizing: border-box; }
body { margin: 0; }
header.top, main, .site-footer { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; padding-top: 1rem; padding-bottom: 0.5rem; }
header.top nav { font-size: 0.9375rem; }
.small { font-size: 0.875rem; color: var(--muted, #5a5f6b); }
.lede { font-size: 1.125rem; }
img, svg { max-width: 100%; height: auto; }
code { font-size: 0.9em; background: var(--quiet, #f2efe7); padding: 0 0.25em; border-radius: 4px; }

/* --- landing page ---------------------------------------------------------------------- */
.hero { display: grid; gap: 0.75rem 2rem; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "fig" "act"; padding: 0.25rem 0 1rem; }
.hero-text { grid-area: text; }
.hero-act { grid-area: act; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0.25rem 0 0.4rem; }
.hero .sub { font-size: 1.125rem; line-height: 1.5; margin: 0; }
.hero .proof-fig { grid-area: fig; margin: 0; background: var(--surface, #fff); border: 1px solid var(--line, #e4dfd3);
  border-radius: 12px; padding: 0.6rem; }
.hero .proof-fig img { display: block; width: 100%; height: auto; }
.hero .proof-fig figcaption { font-size: 0.8125rem; color: var(--muted, #5a5f6b); margin-top: 0.35rem; }
.hero .actions { margin: 0 0 0.5rem; }
.look .hero .actions .cta { font-size: 1.125rem; }
.hero .priceline { margin: 0; font-size: 0.9375rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.look .hero .priceline .buy-small { min-height: 40px; padding: 0.4rem 1rem; background: var(--surface, #fff); color: var(--accent); }
.look .hero .priceline .buy-small:hover { color: var(--accent-fg); }
.hero .behind-wrap { margin-top: 0.6rem; font-size: 0.875rem; }
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr;
    grid-template-areas: "text fig" "act fig"; align-items: start; }
}
.objections { list-style: none; padding: 0; display: grid; gap: 1rem; margin: 1.5rem 0; }
@media (min-width: 860px) { .objections { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.objections li { background: var(--surface, #fff); border: 1px solid var(--line, #e4dfd3); border-radius: 12px; padding: 1rem 1.1rem; }
.objections strong { display: block; margin-bottom: 0.3rem; }
.offer { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); background: var(--surface, #fff);
  border: 1px solid var(--line, #e4dfd3); border-radius: 12px; padding: 1rem 1.25rem; }
@media (min-width: 760px) { .offer { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: center; } }
.cols { display: grid; gap: 0 2rem; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; } }

/* --- the tool -------------------------------------------------------------------------- */
.panel { background: var(--surface, #fff); border: 1px solid var(--line, #e4dfd3); border-radius: 12px;
  padding: 0.75rem 1rem 1rem; margin: 1rem 0; }
.look .panel h2 { margin-top: 0.25rem; font-size: 1.3rem; }
.project-bar, .settings { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem 0.8rem; }
.project-bar p, .settings p { flex-basis: 100%; margin: 0.25rem 0 0; }
label { font-size: 0.9375rem; }
input[type=text], select, textarea { font: inherit; font-size: 0.9375rem; padding: 0.35rem 0.45rem;
  border: 1px solid var(--line, #d8d2c4); border-radius: 6px; background: var(--bg, #faf8f3); color: var(--fg, #1a1e26); }
textarea { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.875rem; }
.project-bar label, .settings label { display: grid; gap: 0.2rem; }
.look .project-bar button, .look .file-button, .look .panel > button, .look .buttons button, .look .csv button {
  min-height: 40px; padding: 0.4rem 0.9rem; font-size: 0.9375rem; background: var(--surface, #fff); color: var(--accent); }
.look .project-bar button:hover, .look .panel > button:hover, .look .buttons button:hover, .look .csv button:hover { color: var(--accent-fg); }
.file-button { position: relative; display: inline-flex; align-items: center; border: 1.5px solid var(--accent);
  border-radius: 10px; font-weight: 600; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.inputs { border-collapse: collapse; width: 100%; min-width: 44rem; margin-bottom: 0.5rem; }
table.inputs th { text-align: left; font-size: 0.8125rem; padding: 0.2rem 0.25rem; white-space: nowrap; }
table.inputs td { padding: 0.15rem 0.2rem; border: 0; }
table.inputs td.c { text-align: center; }
table.inputs input[type=text] { width: 100%; min-width: 4.5rem; }
table.inputs input.num { min-width: 4.5rem; max-width: 7.5rem; }
.band-cell { white-space: nowrap; font-size: 0.8125rem; }
.band-cell label { margin-right: 0.35rem; font-size: 0.8125rem; }
.look table.inputs button.remove { min-height: 32px; padding: 0 0.6rem; background: transparent; color: var(--muted);
  border-color: var(--line); box-shadow: none; font-size: 1.1rem; line-height: 1; }
.look table.inputs button.remove:hover { color: var(--wrong, #9b1c31); border-color: currentColor; }
.job-grid { display: grid; align-items: end; gap: 0.6rem 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.job-grid label { display: grid; gap: 0.2rem; }
.run-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 1.25rem 0; }
.look button.big { font-size: 1.125rem; }
.problems { color: var(--wrong, #9b1c31); }
.access { padding: 0.6rem 0.9rem; border-radius: 10px; background: var(--wrong-bg, #fcefef); }
.access.ok { background: var(--right-bg, #ebf5ee); }
table.summary { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
table.summary th, table.summary td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--line, #e4dfd3); vertical-align: top; }
table.price-lines { max-width: 40rem; }
table.price-lines .amt, .quote .amt { text-align: right; white-space: nowrap; }
table.price-lines tfoot th, table.price-lines tfoot td { border-bottom: 0; }
.unplaced { border-left: 4px solid var(--wrong, #9b1c31); padding-left: 0.75rem; }
.legend .key { display: inline-block; width: 1.1em; height: 0.8em; vertical-align: -0.05em; border: 1px solid #23443a; margin-left: 0.4rem; }
.legend .key.part { background: #fffaf0; }
.legend .key.offcut { background: #e9dcc0; border-style: dashed; border-color: #a8987a; }
.legend .key.band { background: #c0392b; height: 0.3em; border: 0; vertical-align: 0.15em; }
.sheet-fig { margin: 0.75rem 0 1.25rem; break-inside: avoid; }
.sheet-fig figcaption { font-size: 0.9375rem; margin-bottom: 0.3rem; }
.svg-wrap { overflow-x: auto; }
.svg-wrap svg { width: 100%; height: auto; display: block; }
.held { background: var(--accent-soft, #e8edf5); border-radius: 12px; padding: 0.75rem 1rem; margin: 0.75rem 0; }
.held p { margin-top: 0; }
.buy-panel { border-color: var(--accent); }

/* Labels: the sheet at real size, in inches; shown scaled down on screen. */
.labels { display: grid; gap: 1rem; }
.label-page { position: relative; width: 8.5in; height: 11in; background: #fff; border: 1px solid var(--line, #e4dfd3);
  transform-origin: top left; }
.labels .label-page { zoom: 0.5; }
.label { position: absolute; overflow: hidden; padding: 0.06in 0.1in; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #111; border: 1px dashed #ccc; line-height: 1.15; }
.l-name { font-weight: 700; font-size: 10pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-size { font-size: 9pt; }
.l-meta { font-size: 7pt; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l-band { display: flex; align-items: center; gap: 0.06in; font-size: 7pt; }
.band-icon { width: 0.3in; height: 0.18in; flex: none; }
.band-icon path { fill: none; stroke-width: 2; }
.band-icon .on { stroke: #111; stroke-width: 5; }
.band-icon .off { stroke: #999; }
.size-10 .l-name { font-size: 14pt; }
.size-10 .l-size { font-size: 12pt; }
.size-10 .l-meta, .size-10 .l-band { font-size: 9pt; }
.size-10 .band-icon { width: 0.5in; height: 0.3in; }

.quote { max-width: 40rem; }
.quote-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.quote-head h3 { margin: 0; }
.quote-head p { margin: 0; }
.quote-lines { border-collapse: collapse; width: 100%; margin-top: 0.5rem; }
.quote-note, .price-note { font-size: 0.9375rem; border-left: 3px solid var(--rule, #b08a3e); padding-left: 0.6rem; }
.quote-lines th { text-align: left; padding: 0.5rem 0; border-top: 2px solid var(--fg, #1a1e26); font-size: 1.15rem; }

.stale-print, .print-hint { display: none; }

/* --- print: only what was asked for ----------------------------------------------------- */
@media print {
  /* The browser's own Print never shows a plan that no longer matches the project, nor
     the plan at all: printing is the page's print buttons, which check access first. */
  body.plan-stale #output, body:not([data-print]) #output { display: none !important; }
  body.plan-stale .stale-print { display: block; font-size: 1.2rem; }
  body:not([data-print]):not(.plan-stale) .print-hint { display: block; font-size: 1.2rem; }
  html body.look { background: #fff; color: #000; }
  body[data-print="quote"] #paid > section > h2 { display: none; }
  header.top, .site-footer, .ventures-ask, #tool > section:not(#output), .run-line, .problems, .buy-panel,
  #access-state, .lede, main > h1, #paid-locked, .held { display: none !important; }
  .panel { border: 0; padding: 0; margin: 0 0 0.5rem; }
  body[data-print] #output > section, body[data-print] #paid > section { display: none; }
  body[data-print="diagrams"] #output > section.print-diagrams { display: block; }
  body[data-print="cutlist"] #paid > section.print-cutlist { display: block; }
  body[data-print="quote"] #paid > section:has(#quote) { display: block; }
  body[data-print="quote"] #quote h3 { font-size: 1.5rem; }
  body[data-print="labels"] #paid > section:has(#labels) { display: block; }
  body[data-print="labels"] #paid > section:has(#labels) > *:not(#labels) { display: none; }
  body[data-print="labels"] main { padding: 0; max-width: none; }
  .labels .label-page { zoom: 1; border: 0; break-after: page; margin: 0; }
  .label { border: 0; }
  .sheet-fig { break-inside: avoid; }
  .svg-wrap svg { max-height: 9in; }
}
@page { margin: 0.4in; }
@page labels { size: letter; margin: 0; }
body[data-print="labels"] .label-page { page: labels; }
