/* SashWeight – professional instrument style
 * Neutral surfaces, hairline rules, restrained colour, tabular numerals.
 * Green = brand/primary action only. Each metal keeps a distinct colour on its selector (safety). */
:root {
  color-scheme: light dark;
  --bg: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --track: #e7e5e0;
  --ink: #16191b;
  --ink-2: #3c4145;
  --ink-3: #62686c;
  --line: #e2e0db;
  --line-2: #bdb9b1;
  --brand: #1d4d35;
  --brand-ink: #ffffff;
  --brand-soft: #e6eee9;
  --accent: #b8471c;
  --good: #1f6e45;
  --bad: #b42a1f;
  --warn-bg: #fbf4dc; --warn-ink: #5f4a00;
  --r: 10px; --r-sm: 8px;
  --tap: 60px;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: system-ui, -apple-system, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --mat: #1d4d35;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111314; --surface: #1a1d1f; --surface-2: #202427; --track: #2a2f32;
    --ink: #f2f4f5; --ink-2: #c4cacd; --ink-3: #9aa1a5;
    --line: #2b3034; --line-2: #3a4146;
    --brand: #5fb488; --brand-ink: #0b1510; --brand-soft: #1b2b23;
    --accent: #f08a5a; --good: #5cc48c; --bad: #ff7a6e;
    --warn-bg: #30290f; --warn-ink: #f0d78a;
  }
}
body[data-material="steel"] { --mat: #8e2b24; }
body[data-material="lead"] { --mat: #4a5866; }
body[data-material="castiron"] { --mat: #6b3a1f; }
@media (prefers-color-scheme: dark) {
  body[data-material="steel"] { --mat: #e07766; }
  body[data-material="lead"] { --mat: #9fb3c6; }
  body[data-material="castiron"] { --mat: #d4935e; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-bottom: 96px; scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; min-height: 100vh; min-height: 100dvh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button, .seg, .bar-btn, .home-card, .tab, .result-label, .group-label, .flabel { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- Header ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + var(--safe-t)) 16px 8px; min-height: calc(56px + var(--safe-t));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.brand img { border-radius: 7px; }
.brand h1 { margin: 0; font: 600 18px/1.1 var(--sans); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#btn-back { display: none !important; }
.bar-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 15px; }
.bar-btn svg { width: 18px; height: 18px; }
.bar-btn:active { background: var(--surface-2); }

main { max-width: 1180px; margin: 0 auto; padding: 16px 16px calc(96px + var(--safe-b)); }

/* ---------- Bottom bar ---------- */
.tabbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px 8px calc(4px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
  transition: transform .2s ease;
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; text-decoration: none; color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
body.typing .tabbar { transform: translateY(110%); }
@media (min-width: 760px) { .tabbar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); bottom: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 8px; box-shadow: 0 4px 16px rgba(0,0,0,.08); } body.typing .tabbar { transform: translateX(-50%); } }

/* ---------- Home: three big picture tiles ---------- */
.home-sub { margin: 2px 2px 14px; color: var(--ink-2); font-size: 15px; }
.section-label { margin: 0 2px 8px; font: 600 13px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.home-grid { display: grid; gap: 12px; }
.home-card { position: relative; display: block; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.home-card:active { transform: scale(.99); }
.home-art { display: block; aspect-ratio: 16 / 8; overflow: hidden; background: var(--track); }
.home-art img, .home-art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
#card-balance .home-art img { object-position: 50% 42%; }
.home-text { padding: 12px 48px 14px 14px; }
.home-text h3 { margin: 0 0 2px; font: 600 18px/1.25 var(--sans); }
.home-text p { margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.35; }
.chev { position: absolute; right: 14px; bottom: 22px; width: 22px; height: 22px; color: var(--ink-3); }
.chev svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 760px) { .home-grid { grid-template-columns: repeat(3, 1fr); } .home-art { aspect-ratio: 4 / 3; } }

.install-card { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.install-card > div { flex: 1; }
.install-card p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }

.recent { margin-top: 24px; }
.recent-head { display: flex; align-items: baseline; justify-content: space-between; }
.recent ul { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.recent li { display: flex; gap: 8px; align-items: center; padding: 10px 10px 10px 14px; }
.recent li + li { border-top: 1px solid var(--line); }
.recent .rtext { flex: 1; font-size: 14px; line-height: 1.35; min-width: 0; }
.recent .rtext b { font-weight: 600; }
.recent .rtime { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.recent button { min-height: 48px; min-width: 60px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; }
.foot-note { margin: 22px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 18px; border-radius: var(--r-sm); border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 16px; }
.btn:active { filter: brightness(.92); }
.btn svg { width: 19px; height: 19px; }
.btn.small { min-height: 44px; font-size: 15px; padding: 0 14px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn.done { background: var(--good); color: #fff; }
.link-btn { background: none; border: 0; color: var(--brand); font-weight: 600; font-size: 14.5px; min-height: 44px; padding: 0 4px; }

/* ---------- Calculator layout ---------- */
.calc-layout { display: grid; gap: 12px; }
.result-col { display: contents; }
.result-card {
  position: sticky; top: calc(var(--hdr, 56px) + 8px); z-index: 10;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--mat);
  border-radius: var(--r); padding: 12px 14px 14px; text-align: left;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
}
.result-label { font: 600 12px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.big { font: 650 50px/1.05 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.025em; margin: 2px 0 8px; color: var(--ink); }
.big.muted { color: var(--ink-3); opacity: .45; }
.big-unit { font-size: 22px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 2px; }
.needed { font-size: 14.5px; color: var(--ink-2); }
.needed b { color: var(--accent); font-weight: 600; }
.what { display: block; margin: 4px 0 0; font-weight: 600; font-size: 14px; color: var(--mat); }
.subs { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 12px; border-top: 1px solid var(--line); font-size: 14.5px; }
.subs div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.subs div:nth-child(odd) { padding-right: 12px; }
.subs div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.subs dt { color: var(--ink-2); }
.subs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.btn.copy { width: 100%; min-height: 52px; font-size: 15px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); }
.btn.copy.done { background: var(--good); color: #fff; border-color: var(--good); }
.from-balance { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; }

.illus-wrap { margin: 0; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--track); }
.piece-svg, .sash-svg { display: block; width: 100%; height: auto; }

.input-col { min-width: 0; }
.group { margin: 0 0 14px; }
.group-label { font-weight: 600; font-size: 14px; margin: 0 0 6px 2px; color: var(--ink-2); }

.seg { display: grid; gap: 2px; padding: 3px; background: var(--track); border-radius: var(--r); }
.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg2 { grid-template-columns: repeat(2, 1fr); }
.seg4 { grid-template-columns: repeat(4, 1fr); }
.seg button { min-height: 56px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 6px; line-height: 1.1; }
.seg button svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; }
.seg button .hole-dot { fill: currentColor; stroke: none; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.seg button.custom::after { content: "*"; color: var(--accent); margin-left: 1px; }
.seg button small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.seg4 button { flex-direction: column; gap: 0; }
.swatch { width: 18px; height: 18px; border-radius: 4px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.swatch.steel { background: linear-gradient(135deg, #cfd2d4 0 34%, #a8402f 35%, #74241c); }
.swatch.lead { background: linear-gradient(135deg, #b6bbc1, #7b8088 55%, #4c5057); }
.swatch.castiron { background: radial-gradient(circle at 30% 30%, #8a5d3e, #4a3426 65%, #2a1c14); }
.swatch.wood.soft { background: repeating-linear-gradient(100deg, #e7c48f 0 3px, #d6aa6c 3px 5px, #e9cb98 5px 8px); }
.swatch.wood.hard { background: repeating-linear-gradient(100deg, #8a4a2b 0 3px, #6e3820 3px 5px, #94553a 5px 8px); }
.swatch.wood.accoya { background: repeating-linear-gradient(100deg, #efe2c6 0 3px, #e0cfa8 3px 5px, #f3e8d0 5px 8px); }

/* material selector inside the result panel – selected metal filled in its own colour */
.mat-seg { margin: 0 0 10px; }
.mat-seg button { min-height: 52px; font-size: 15px; }
#view-calc .mat-seg button[aria-checked="true"] { background: var(--mat); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { #view-calc .mat-seg button[aria-checked="true"] { color: #111; } }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.flabel { font-weight: 600; font-size: 14px; color: var(--ink-2); padding-left: 2px; }
.flabel em { font-weight: 400; font-style: normal; color: var(--ink-3); }
.fwrap { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.fwrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.fwrap input { flex: 1; min-width: 0; height: var(--tap); border: 0; outline: 0; padding: 0 12px; background: transparent; font: 600 24px var(--num); font-variant-numeric: tabular-nums; }
.fwrap input::placeholder { color: var(--ink-3); opacity: .45; font-weight: 500; }
#b-ref { font: 500 16px var(--sans); }
.unit { padding: 0 12px 0 4px; font-weight: 500; font-size: 14px; color: var(--ink-3); align-self: stretch; display: flex; align-items: center; }
.field.accent .fwrap { border-color: var(--ink-3); }
.field.err .fwrap { border-color: var(--bad); }
.ferr { color: var(--bad); font-size: 13px; font-weight: 500; padding-left: 2px; }
.ferr:empty { display: none; }
.field[data-field="ref"] { grid-column: 1 / -1; }

.density-note { font-size: 13.5px; color: var(--ink-2); padding: 10px 12px; border-left: 3px solid var(--line-2); background: var(--surface); border-radius: 0; margin: 16px 0 10px; }
.advanced, .estimator { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.advanced summary, .estimator summary { list-style: none; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.advanced summary::-webkit-details-marker, .estimator summary::-webkit-details-marker { display: none; }
.advanced summary::after, .estimator summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); flex: 0 0 auto; }
.advanced[open] summary::after, .estimator[open] summary::after { transform: rotate(-135deg); }
.advanced[open], .estimator[open] { padding-bottom: 14px; }
.advanced > *:not(summary), .estimator > *:not(summary) { margin-left: 14px; margin-right: 14px; }
.adv-help { font-size: 13.5px; color: var(--ink-2); margin-top: 0; }
.dens-fields { grid-template-columns: 1fr; margin-bottom: 10px; }
.dens-fields .fwrap input { font-size: 19px; }

/* ---------- Balance ---------- */
.bias-flag, .est-flag { display: block; margin: 0 0 8px; padding: 6px 10px; border-radius: 6px; font-weight: 500; font-size: 13.5px; }
.bias-flag { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.est-flag { background: var(--warn-bg); color: var(--warn-ink); }
.sides { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.side { padding: 8px 10px; font-size: 14px; }
.side + .side { border-left: 1px solid var(--line); }
.side .sname { font-weight: 600; color: var(--ink-3); text-transform: uppercase; font-size: 11.5px; letter-spacing: .07em; }
.side .sval { font: 600 18px/1.25 var(--num); font-variant-numeric: tabular-nums; }
.side .add { color: var(--good); } .side .rem { color: var(--bad); } .side .ok { color: var(--good); }
.side .hint { color: var(--ink-3); font-size: 12.5px; }
.to-cut { display: grid; gap: 6px; margin-bottom: 10px; }
.to-cut .btn { min-height: 54px; font-size: 14.5px; background: var(--brand-soft); color: var(--brand); justify-content: flex-start; }
.bias-detail { margin-top: 10px; display: grid; gap: 6px; }
.bias-detail .field { max-width: 240px; }
.bias-help { font-size: 14px; color: var(--ink-2); margin: 8px 2px 0; }
.bias-help b { color: var(--accent); font-weight: 600; }
.compact-line { display: none; font-weight: 600; font-size: 14.5px; }
.compact-line .add { color: var(--good); } .compact-line .rem { color: var(--bad); }

.estimator summary svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--ink-3); }
.estimator summary b { color: var(--brand); font-weight: 600; }
.est-fields { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 14px; }
.est-fields .fwrap input { font-size: 20px; padding: 0 8px; }
.est-fields .unit { padding: 0 8px 0 2px; font-size: 13px; }
#seg-panes button { flex-direction: row; gap: 6px; font-size: 16px; }
#seg-panes svg { stroke-width: 1.6; }
.est-result { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.est-empty { color: var(--ink-2); font-size: 14.5px; }
.est-big { font: 650 32px/1.1 var(--num); font-variant-numeric: tabular-nums; }
.est-break { font-size: 13px; color: var(--ink-2); margin: 4px 0 12px; }
#btn-use-est { width: 100%; }

/* ---------- Rendered images + technical overlays ---------- */
.sash-photo, .piece-photo { position: relative; padding: 0; }
.sash-photo img, .piece-photo img { display: block; width: 100%; height: auto; }
.sash-ov, .piece-ov { position: absolute; inset: 0; width: 100%; height: 100%; }
.sash-ov .hit, .piece-ov .hit { cursor: pointer; pointer-events: all; }
.illus-wrap figcaption { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 5px; background: rgba(255,255,255,.85); color: #3c4145; font-size: 12.5px; font-weight: 500; pointer-events: none; }
.pdim { font: 600 34px var(--sans); paint-order: stroke; stroke: rgba(255, 255, 255, .88); stroke-width: 9px; stroke-linejoin: round; }
.pval { font-weight: 700; }
.pval.q { fill: #b8471c; }
.ovtxt { font: 600 40px var(--num); fill: #16191b; letter-spacing: -.5px; }
.ovtxt.sm { font-size: 32px; }
.ovtxt.cap { font: 600 26px var(--sans); fill: #4f5559; letter-spacing: 2px; }
.ovtag { font: 700 24px var(--sans); fill: #16191b; letter-spacing: 3px; }

/* ---------- Wider screens ---------- */
@media (min-width: 760px) {
  main { padding: 22px 28px calc(110px + var(--safe-b)); }
  .calc-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 20px; }
  .result-col { display: grid; gap: 12px; position: sticky; top: calc(var(--hdr, 56px) + 14px); grid-column: 2; grid-row: 1; }
  .balance .result-col { position: static; }
  .input-col { grid-column: 1; grid-row: 1; }
  .result-card { position: static; padding: 16px 18px 18px; }
  .big { font-size: 64px; }
  .sash-photo { width: 100%; max-width: 560px; margin: 0 auto; }
}

/* ---------- Phones ---------- */
@media (max-width: 759px) {
  .result-col > .illus-wrap { order: 2; }
  .result-card { order: 0; }
  .from-balance { order: 1; }
  .input-col { order: 3; }
  .balance .result-card { position: static; }
  .balance .result-col > .illus-wrap { order: 4; }
  body.typing .balance .result-card { position: sticky; }
  body.typing .result-card { padding: 8px 12px 10px; }
  body.typing .result-card .big { font-size: 36px; margin: 0; }
  body.typing .result-card .big-unit { font-size: 17px; }
  body.typing .result-card .result-label { font-size: 11px; }
  body.typing .result-card .subs,
  body.typing .result-card .copy,
  body.typing .result-card .sides,
  body.typing .result-card .to-cut,
  body.typing .result-card .bias-flag,
  body.typing .result-card .est-flag { display: none; }
  body.typing .result-card .what { font-size: 12.5px; margin-top: 0; }
  body.typing .mat-seg { margin-bottom: 6px; }
  body.typing .mat-seg button { min-height: 48px; font-size: 14px; }
  body.typing .compact-line { display: block; }
  body:not(.home) .brand img { display: none; }
}
@media (max-width: 380px) {
  body { font-size: 15px; }
  .bar-btn span { display: none; }
  .seg button { font-size: 13.5px; }
  .fwrap input { font-size: 21px; }
  .big { font-size: 44px; }
  .est-fields { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
/* readability fixes */
.pdim { font-size: 44px; stroke-width: 11px; }
.illus-wrap figcaption { top: 8px; right: 8px; left: auto; bottom: auto; }
#bal-full .subs { grid-template-columns: 1fr; }
#bal-full .subs div { padding-left: 0; padding-right: 0; border-left: 0; }
.fields { align-items: end; }
.illus-wrap figcaption { top: auto; bottom: 8px; right: 8px; left: auto; }

/* ---------- Balance: step 1 the sash, step 2 the weights ---------- */
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 4px; margin: 0 0 14px; }
.step-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 600 18px/1.2 var(--sans); }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 15px; font-weight: 700; flex: 0 0 auto; }
.step-help { margin: -4px 0 12px; font-size: 14px; color: var(--ink-2); }
.step .fields { margin-bottom: 12px; }
.estimator.est-open { margin: 0 0 12px; padding: 12px 0 12px; background: var(--surface-2); }
.estimator.est-open > * { margin-left: 12px; margin-right: 12px; }
#btn-use-est { display: none; }
#seg-method svg { stroke-width: 1.8; }

/* home in job order */
.section-label { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.step-num.sm { width: 22px; height: 22px; font-size: 12px; }
.home-grid.one { margin-bottom: 18px; }
.home-grid.two { grid-template-columns: 1fr 1fr; }
.home-grid.two .home-art { aspect-ratio: 4 / 3; }
.home-grid.two .home-text { padding: 10px 12px 12px; }
.home-grid.two .home-text h3 { font-size: 16px; }
.home-grid.two .home-text p { font-size: 13.5px; }
.home-grid.two .chev { display: none; }
#card-balance .home-art { aspect-ratio: 16 / 9; }
@media (min-width: 760px) { .home-grid.one, .home-grid.two { max-width: 760px; } .home-grid.one { grid-template-columns: 1fr; } .home-grid.two { grid-template-columns: 1fr 1fr; } #card-balance .home-art { aspect-ratio: 21 / 9; } }
.measure-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.measure-links .btn { min-height: 52px; }
#calc-use { width: 100%; margin-bottom: 8px; }

/* step 2: size of the weights */
.step-head em { font-style: normal; font-weight: 400; font-size: 14px; color: var(--ink-3); }
.size-result { display: grid; grid-template-columns: 38% 1fr; gap: 12px; align-items: center; margin: 0 0 14px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); }
.size-result img { width: 100%; height: auto; border-radius: 6px; display: block; }
.size-label { font: 600 12px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.size-big { font: 650 38px/1.1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.size-unit { font-size: 18px; font-weight: 500; color: var(--ink-2); }
.size-sub { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.cutline { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: var(--brand-soft); font-size: 14.5px; }
.cutline b { font-size: 17px; }
.cutline span { color: var(--ink-2); font-size: 13px; }
body.typing .result-card .cutline { display: block; padding: 4px 8px; margin: 4px 0 0; font-size: 13px; }
body.typing .result-card .cutline b { font-size: 14px; }
#bal-to-cut { display: none !important; }

/* ================= Home: Start a new window ================= */
.start-card { display: grid; grid-template-columns: 42% 1fr; align-items: stretch; margin: 4px 0 20px; text-decoration: none; color: #fff; background: var(--brand); border-radius: 14px; overflow: hidden; min-height: 170px; }
@media (prefers-color-scheme: dark) { .start-card { background: #1d4d35; } }
.start-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.start-text { padding: 16px 16px 16px 14px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.start-text h2 { margin: 0; font: 700 24px/1.1 var(--sans); color: #fff; }
.start-text p { margin: 0; font-size: 14.5px; line-height: 1.35; color: rgba(255,255,255,.88); }
.start-btn { align-self: flex-start; margin-top: 6px; padding: 12px 26px; border-radius: 10px; background: #fff; color: #1d4d35; font-weight: 700; font-size: 17px; }
.start-card:active { filter: brightness(.95); }
.tools-label { margin-top: 4px; }
/* tools: the sash screen as a compact row, then two tiles */
#card-balance { display: grid; grid-template-columns: 120px 1fr; align-items: center; }
#card-balance .home-art { aspect-ratio: auto; height: 100%; min-height: 88px; }
#card-balance .home-text { padding: 10px 40px 10px 12px; }
#card-balance .home-text h3 { font-size: 16px; }
#card-balance .home-text p { font-size: 13.5px; }
#card-balance .chev { top: 50%; bottom: auto; transform: translateY(-50%); }
.home-grid.one { margin-bottom: 12px; }
@media (min-width: 760px) { .start-card { max-width: 760px; min-height: 220px; } #card-balance .home-art { aspect-ratio: auto; } }

/* ================= New window flow ================= */
body.in-job .tabbar { display: none; }
body.in-job main { padding-bottom: calc(110px + var(--safe-b)); max-width: 640px; }
.job-progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 2px 0 18px; }
.job-progress span { height: 6px; border-radius: 3px; background: var(--track); }
.job-progress span.on { background: var(--brand); }
.job-count { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink-3); }
.job-q { margin: 0 0 18px; font: 700 27px/1.15 var(--sans); letter-spacing: -.015em; }
.job-hint { margin: -8px 0 16px; font-size: 16px; color: var(--ink-2); }
.job-note { font-size: 13.5px; color: var(--ink-3); margin: 10px 0 0; }
.job-err { min-height: 0; margin: 8px 0 0; color: var(--bad); font-weight: 600; font-size: 15px; }
.job-err:empty { display: none; }
.choices { display: grid; gap: 12px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choices.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; padding: 16px 10px; border: 2px solid var(--line-2); border-radius: 14px; background: var(--surface); font-weight: 700; font-size: 18px; color: var(--ink); }
.choice svg { width: 72px; height: 96px; }
.choice.small { min-height: 96px; font-size: 15.5px; gap: 6px; }
.choice.small svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.choice.sel { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.choice:active { transform: scale(.98); }
.choices.photos { grid-template-columns: 1fr; }
.choice.photo { flex-direction: row; justify-content: flex-start; min-height: 96px; padding: 8px; gap: 16px; font-size: 20px; }
.choice.photo img { width: 46%; max-width: 220px; border-radius: 8px; display: block; }
.big-input { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line-2); border-radius: 14px; background: var(--surface); padding: 0 18px; min-height: 92px; }
.big-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.big-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 700 48px var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--ink); height: 88px; }
.big-input input::placeholder { color: var(--ink-3); opacity: .35; }
.big-input > span { font-size: 24px; font-weight: 600; color: var(--ink-2); }
.big-input.sm { flex-wrap: wrap; min-height: 0; padding: 8px 14px 4px; }
.big-input.sm em { flex-basis: 100%; font-style: normal; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.big-input.sm input { font-size: 34px; height: 56px; }
.big-input.sm > span { font-size: 18px; }
.big-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-link { display: block; margin: 18px auto 0; font-size: 16px; min-height: 48px; }
.job-estimate { margin: 14px 0 0; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 18px; text-align: center; color: var(--ink-2); }
.job-estimate b { font-size: 30px; color: var(--ink); }
.answer { font: 750 72px/1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.03em; margin: -6px 0 14px; color: var(--brand); }
.answer small { font-size: 28px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.answer-img { width: 100%; height: auto; border-radius: 12px; display: block; margin: 0 0 14px; }
.answer-rows { margin: 0 0 14px; border-top: 1px solid var(--line); font-size: 16px; }
.answer-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.answer-rows dt { color: var(--ink-2); }
.answer-rows dd { margin: 0; font-weight: 700; text-align: right; }
.job-warn { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.job-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: none; grid-template-columns: 1fr 2fr; gap: 10px; padding: 10px 16px calc(10px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); }
body.in-job .job-nav { display: grid; }
.job-nav .btn { min-height: 60px; font-size: 18px; border-radius: 12px; }
.job-nav #j-next[hidden] + * { }
.job-nav:has(#j-next[hidden]) { grid-template-columns: 1fr; }
@media (min-width: 760px) { .job-nav { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 16px; border: 1px solid var(--line); border-radius: 14px; } }
@media (max-width: 380px) { .job-q { font-size: 23px; } .answer { font-size: 60px; } .choice { min-height: 150px; } .big-input input { font-size: 40px; } }
.big-input input { flex: 1 1 0; width: 0; }
.big-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.big-input.sm em { flex: 0 0 100%; }
.choices.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice.photo { align-items: center; }
.choice.photo img { height: auto; align-self: center; aspect-ratio: 1200 / 660; object-fit: cover; flex: 0 0 46%; }

/* step 2: two equal method buttons */
.choices.method { margin: 0 0 18px; }
.choices.method .choice { min-height: 132px; font-size: 17px; }
.choices.method .choice svg { width: 52px; height: 52px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.choices.method .choice.sel { background: var(--brand-soft); }

.choices.method .choice { justify-content: flex-start; padding-top: 18px; }
.choices.method .choice small { font-size: 13.5px; font-weight: 500; line-height: 1.3; color: var(--ink-2); text-align: center; margin-top: -4px; }

/* hole option + change metal on the answer */
.job-hole { margin: 16px 0 10px; }
#j-h-wrap { grid-column: 1; }
.ans-mat { margin: 0 0 12px; }
.ans-mat button { min-height: 52px; }
.ans-mat button[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); }

/* measure-the-sash details */
.job-sub { margin: 18px 0 8px 2px; font-size: 15px; color: var(--ink); }
.job-seg button { min-height: 60px; font-size: 15.5px; }
.job-seg.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.job-seg.seg2 button { flex-direction: column; gap: 0; }
.job-seg small { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-3); }
#j-panes button { flex-direction: row; gap: 8px; font-size: 18px; }
#j-panes svg { width: 26px; height: 26px; stroke-width: 1.6; }
.job-thick { margin-top: 14px; }
.job-estimate small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-3); }
/* home: one big New window card */
.start-card { grid-template-columns: 1fr; min-height: 0; margin-top: 8px; }
.start-card img { aspect-ratio: 4 / 3; height: auto; object-position: 50% 45%; }
.start-text { padding: 18px 18px 20px; gap: 8px; }
.start-text h2 { font-size: 28px; }
.start-text p { font-size: 16px; }
.start-btn { align-self: stretch; text-align: center; padding: 16px; font-size: 19px; border-radius: 12px; margin-top: 10px; }
@media (min-width: 760px) { .start-card { grid-template-columns: 1fr 1fr; max-width: 820px; margin: 24px auto 0; } .start-card img { aspect-ratio: auto; height: 100%; } .start-text { padding: 32px; } }

/* ---- Home v5: photo hero ---- */
body.home .appbar{display:none}
body.home main{padding-top:0}
.hero{position:relative;height:min(68vh,580px);min-height:440px;margin:0 calc(-1 * var(--pad,16px));background:#222 url(img/sash-window.jpg) 50% 38%/cover;overflow:hidden}
.hero:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(0,0,0,.35) 0%,rgba(0,0,0,0) 28%,rgba(0,0,0,0) 45%,rgba(12,32,22,.93) 84%)}
.hero-top{position:absolute;z-index:1;top:calc(18px + env(safe-area-inset-top));left:20px;display:flex;gap:10px;align-items:center;color:#fff;font-weight:600;font-size:18px}
.hero-top img{width:34px;height:34px;border-radius:8px}
.hero-txt{position:absolute;z-index:1;left:20px;right:20px;bottom:24px;color:#fff;max-width:520px}
.hero h1{font-weight:800;font-size:40px;line-height:1.02;margin:0 0 10px;letter-spacing:-.03em;color:#fff}
.hero p{margin:0 0 18px;font-size:16.5px;line-height:1.4;color:rgba(255,255,255,.86)}
.hero-btn{display:flex;align-items:center;justify-content:space-between;height:64px;padding:0 12px 0 22px;border-radius:16px;background:#fff;color:#1d4d35;font-weight:700;font-size:20px;text-decoration:none;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.hero-btn:active{transform:scale(.98)}
.hero-btn span{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#1d4d35;color:#fff;font-size:24px;line-height:1}
.quick{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}
.quick a{display:flex;gap:10px;align-items:center;min-height:64px;padding:12px 14px;border-radius:14px;background:#fff;border:1px solid #e2e0db;text-decoration:none;color:#16191b;font-weight:600;font-size:15px}
.quick svg{width:26px;height:26px;flex:none;fill:none;stroke:#1d4d35;stroke-width:1.9}
.quick small{display:block;font-weight:400;font-size:12.5px;color:#62686c}
#offline-status:empty{display:none}
@media (prefers-color-scheme:dark){.quick a{background:#1c2320;border-color:#2c3530;color:#eef1ee}.quick small{color:#9aa39e}.quick svg{stroke:#8fd0ae}}
@media (min-width:700px){.hero{margin:0;border-radius:22px;margin-top:22px}.quick{max-width:560px}}

/* ---- Home v6: icon + three big buttons ---- */
.home-head{text-align:center;padding:calc(34px + env(safe-area-inset-top)) 0 26px}
.home-icon{width:128px;height:128px;margin:0 auto;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:0 2px 0 #e3e1db}
.home-icon .win{width:62px;height:78px;color:#1d4d35}
.home-head h2{font-weight:800;font-size:32px;line-height:1.1;letter-spacing:-.02em;margin:22px 0 6px}
.home-head p{margin:0;font-size:17px;color:#5b6166}
.home-btns{display:grid;gap:14px;max-width:560px;margin:0 auto}
.hb{display:flex;align-items:center;gap:16px;min-height:84px;padding:0 22px;border-radius:18px;background:#fff;border:1px solid #e3e1db;color:#16191b;text-decoration:none;font-weight:700;font-size:21px;line-height:1.2}
.hb svg{width:30px;height:30px;flex:none;color:#1d4d35}
.hb small{display:block;font-weight:500;font-size:14.5px;color:#666;margin-top:3px}
.hb.main{min-height:104px;background:#1d4d35;border-color:#1d4d35;color:#fff;font-size:24px}
.hb.main small{color:rgba(255,255,255,.78)}
.hb.main .win{width:38px;height:48px;color:#fff}
.hb:active{transform:scale(.98)}
@media (prefers-color-scheme:dark){.home-icon{background:#1c2320;box-shadow:none}.home-icon .win{color:#8fd0ae}.home-head p{color:#9aa39e}.hb{background:#1c2320;border-color:#2c3530;color:#eef1ee}.hb svg{color:#8fd0ae}.hb small{color:#9aa39e}.hb.main{background:#1f6b47;border-color:#1f6b47}.hb.main .win{color:#fff}}

/* ---- Home icon: bigger, animated sash + weights ---- */
.home-icon{width:184px;height:184px;border:0;padding:0;cursor:pointer;-webkit-tap-highlight-color:transparent}
.home-icon:active{transform:scale(.97)}
.win-i{width:112px;height:138px;color:#1d4d35;overflow:visible}
.win-i .glass{fill:#e7f0ea}
.win-i .ts,.win-i .bs,.win-i .wl,.win-i .wr{transition:transform 1.3s cubic-bezier(.45,0,.25,1)}
.win-i.open .bs{transform:translateY(-44px)}
.win-i.open .wl{transform:translateY(44px)}
.home-tip{display:block;margin-top:8px;font-size:13.5px;color:#8a8f93}
@media (prefers-color-scheme:dark){.win-i{color:#8fd0ae}.win-i .glass{fill:#1a2a22}}
@media (prefers-reduced-motion:reduce){.win-i .ts,.win-i .bs,.win-i .wl,.win-i .wr{transition:none}}

/* ---- Material colour themes: whole page tells you which metal ---- */
:root{--bar-bg:var(--surface);--bar-ink:var(--ink);--page-tint:var(--bg)}
body[data-material="steel"]{--mat:#cc2a1f;--mat-soft:#f4f1ee;--bar-bg:#d1301f}
body[data-material="lead"]{--mat:#3a6c99;--mat-soft:#eff2f5;--bar-bg:#3f74a4}
body[data-material="castiron"]{--mat:#a35a14;--mat-soft:#f5f1eb;--bar-bg:#a95f17}
@media (prefers-color-scheme:dark){
 body[data-material="steel"]{--mat:#ff7b6b;--mat-soft:#171312;--bar-bg:#b8291c}
 body[data-material="lead"]{--mat:#a3cdf0;--mat-soft:#121921;--bar-bg:#3d6f9b}
 body[data-material="castiron"]{--mat:#f3bb78;--mat-soft:#1d1811;--bar-bg:#9a6428}
}
body[data-material]{background:var(--mat-soft)}
body[data-material] .appbar{background:var(--bar-bg);border-bottom-color:transparent;color:#fff}
body[data-material] .appbar .brand h1{color:#fff}
body[data-material] .appbar .brand img{box-shadow:0 0 0 2px rgba(255,255,255,.5)}
body[data-material] .appbar .bar-btn{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.35);color:#fff}
.mat-chip{flex:none;padding:4px 10px;border-radius:999px;background:#fff;color:var(--bar-bg);font-weight:800;font-size:13px;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}
.mat-chip[hidden]{display:none}
body[data-material] .result-card{border-top:5px solid var(--mat)}
body[data-material] .btn:not(.ghost):not(.done){background:var(--mat);color:#fff}
body[data-material] .to-cut .btn{background:var(--surface);color:var(--mat);border:1px solid var(--mat)}
body[data-material] .tab.active{color:var(--mat);box-shadow:inset 0 3px 0 var(--mat)}
body[data-material] .job-progress span.on{background:var(--mat)}
body[data-material] .big{color:var(--mat)}

/* step 1: sash + weigh/measure on one screen */
.job-q2{font-size:20px;font-weight:700;margin:22px 0 10px;letter-spacing:-.01em}
#j-err1{min-height:22px;color:var(--mat,var(--brand));font-weight:700;text-align:center}
[data-step="1"] .choices.two:not(.method) .choice{min-height:0;padding:14px 10px}
[data-step="1"] .choices.two:not(.method) .choice svg{width:48px;height:64px}
[data-step="1"] .choices.method .choice{min-height:118px}

/* Next sits right under the boxes so the phone keyboard never hides it */
.job-inline-next{display:flex;width:100%;min-height:64px;margin:18px 0 8px;border-radius:14px;font-size:20px;font-weight:700;gap:6px}
.job-inline-next svg{width:22px;height:22px}
body.typing.in-job .job-nav{display:none}

/* ---- Measure the sash: everything on one screen ---- */
#j-measure .job-hint{display:none}
.mz-card{display:grid;grid-template-columns:1.25fr 1fr;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:8px 14px 8px 4px;margin:4px 0 14px}
.mz-pic{min-width:0}
.mz-svg{display:block;width:100%;height:auto;transition:opacity .3s}
.mz-svg.faint{opacity:.55}
.mz-pic.pop .mz-svg{animation:mzPop .45s cubic-bezier(.3,1.6,.5,1)}
@keyframes mzPop{0%{transform:scale(.94)}100%{transform:scale(1)}}
.mz-pane{animation:mzIn .35s ease both}
@keyframes mzIn{from{opacity:0}to{opacity:1}}
.mz-dim{font:700 12px var(--sans);fill:var(--ink-2);text-anchor:middle}
.mz-dim.t{text-anchor:start;font-size:11px;fill:var(--ink-3)}
.mz-kg{text-align:center;display:flex;flex-direction:column;align-items:center;gap:2px}
.mz-kg span{font-size:13px;font-weight:600;color:var(--ink-3);text-transform:uppercase;letter-spacing:.06em}
.mz-kg b{font:800 34px/1.05 var(--num);color:var(--ink-3);letter-spacing:-.02em}
.mz-kg small{font-size:13.5px;font-weight:600;color:var(--ink-3)}
.mz-kg.ready b{color:var(--good);animation:mzPop .45s cubic-bezier(.3,1.6,.5,1)}
.mz-sec{margin:0 0 12px;border-radius:14px}
.mz-label{display:flex;align-items:center;gap:8px;font-weight:700;font-size:16px;margin:0 0 7px}
.mz-unit{margin-left:auto;font-weight:600;font-size:13px;color:var(--ink-3)}
.tick{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:2px solid var(--line-2);flex:none;transition:background .25s,border-color .25s}
.tick svg{width:16px;height:16px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:24;stroke-dashoffset:24;transition:stroke-dashoffset .35s .05s}
.mz-sec.done .tick{background:var(--good);border-color:var(--good)}
.mz-sec.done .tick svg{stroke-dashoffset:0}
.mz-sec.need{animation:mzShake .5s}
.mz-sec.need .tick{border-color:var(--bad)}
.mz-sec.need .mz-opts button:not([aria-checked="true"]),.mz-sec.need .mz-in:not(.ok){border-color:var(--bad)}
@keyframes mzShake{20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
.mz-row3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.mz-in{display:flex;flex-direction:column;border:2px solid var(--line-2);border-radius:14px;background:var(--surface);padding:6px 10px 2px;transition:border-color .2s}
.mz-in em{font-style:normal;font-size:12.5px;font-weight:600;color:var(--ink-2)}
.mz-in input{width:100%;min-width:0;border:0;outline:0;background:transparent;font:700 28px var(--num);font-variant-numeric:tabular-nums;height:44px;color:var(--ink);padding:0}
.mz-in input::placeholder{color:var(--ink-3);opacity:.4}
.mz-in:focus-within{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
.mz-in.ok{border-color:var(--good)}
.mz-in.bad{border-color:var(--bad)}
.mz-opts{display:grid;gap:8px}
.mz-opts.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.mz-opts.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.mz-opts button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:62px;padding:6px 4px;border:2px solid var(--line-2);border-radius:14px;background:var(--surface);color:var(--ink);transition:transform .12s,border-color .2s,background .2s}
.mz-opts button b{font-size:16px;font-weight:700;line-height:1.1}
.mz-opts button small{font-size:11.5px;font-weight:500;color:var(--ink-3);line-height:1.1;text-align:center}
.mz-opts button svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8}
.mz-opts button .swatch{width:26px;height:18px;border-radius:4px;border:1px solid rgba(0,0,0,.15)}
.mz-opts button:active{transform:scale(.95)}
.mz-opts button[aria-checked="true"]{border-color:var(--brand);background:var(--brand-soft);box-shadow:inset 0 0 0 1px var(--brand)}
.job-inline-next.wait{background:var(--track);color:var(--ink-2)}
@media (prefers-color-scheme:dark){.job-inline-next.wait{background:#2a2f32;color:var(--ink-2)}}

/* real rendered sash on the measure page */
.mz-pic{position:relative;aspect-ratio:1/1}
.mz-pic img.mz-img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;transition:opacity .35s ease,filter .35s}
.mz-pic img.mz-img.on{opacity:1}
.mz-pic.no-timber img.mz-img{filter:grayscale(1) brightness(1.08)}
.mz-pic.faint img.mz-img.on{opacity:.5}
.mz-pic.pop img.mz-img.on{animation:mzPop .45s cubic-bezier(.3,1.6,.5,1)}
.mz-dims span{position:absolute;font:700 12px var(--sans);color:var(--ink-2);background:color-mix(in srgb,var(--surface) 80%,transparent);padding:0 4px;border-radius:4px}
.mz-dims .dw{left:50%;bottom:0;transform:translateX(-50%)}
.mz-dims .dh{left:0;top:50%;transform:translate(-30%,-50%) rotate(-90deg)}
.mz-dims .dt{right:2px;top:4px;font-size:11px;color:var(--ink-3)}
.mz-pic.svg{aspect-ratio:auto}

/* ---- use period ---- */
body.lic-locked{overflow:hidden}
body.lic-locked .tabbar{display:none}
.lic-lock{position:fixed;inset:0;z-index:9999;background:var(--bg);display:grid;place-items:center;padding:24px}
.lic-box{max-width:420px;text-align:center}
.lic-ico{width:84px;height:84px;margin:0 auto 18px;border-radius:50%;background:var(--surface);display:grid;place-items:center;border:1px solid var(--line)}
.lic-ico svg{width:40px;height:40px;fill:none;stroke:var(--ink-2);stroke-width:2;stroke-linecap:round}
.lic-box h2{font-size:26px;margin:0 0 10px}
.lic-box p{font-size:16.5px;color:var(--ink-2);line-height:1.45;margin:0 0 12px}
.lic-box .btn{width:100%;min-height:60px;margin-top:10px;font-size:18px}
.lic-warn{margin:calc(12px + env(safe-area-inset-top)) 0 0;padding:12px 14px;border-radius:12px;background:#fff4d6;border:1px solid #f0d58a;color:#5b4300;font-weight:600;font-size:15px;text-align:center}
@media (prefers-color-scheme:dark){.lic-warn{background:#3a2f12;border-color:#6b5820;color:#f3dc9a}}
