:root {
  /* Warm sawdust neutrals plus one brand color. These are Grainbook's own green defaults; a shop's
     brand color (Settings page) replaces --green … --nav-line at load — see brandPalette() in app.js.
     --green / --green-dark / --mint are the brand accent (names kept from v1). */
  --bg: #F5F3EE; --ink: #1A2130; --muted: #5E6470; --line: #DEDAD2; --line-soft: #EEEBE5;
  --field: #CBC5BB; --card: #FFFFFF; --green: #2F5D46; --green-dark: #1F4231; --mint: #9CC5AE;
  --tint: #E3ECE6; --tint-2: #D3E3D9;
  --nav: #1B211E; --nav-ink: #E9ECE8; --nav-muted: #A9B2AD; --nav-line: #36403B; --danger: #9B2C1F;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", -apple-system, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.4 var(--sans); }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.shell { min-height: 100vh; display: flex; }
.side { flex: 0 0 220px; background: var(--nav); color: var(--nav-ink); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-text b { font-size: 17px; letter-spacing: .01em; }
.brand-text small { font-size: 12px; color: var(--nav-muted); }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a { display: block; padding: 11px 12px; border-radius: 8px; color: var(--nav-ink); text-decoration: none; }
.nav-links a.on { background: var(--green); color: #fff; font-weight: 600; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 10px; }
.nav-head { padding: 0 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--nav-muted); }
.nav-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.nav-foot a { color: var(--nav-muted); text-decoration: none; border-radius: 8px; }
.nav-foot a.on { background: var(--green); color: #fff; }
.nav-foot .who-link { flex: 1; padding: 10px 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-foot .help-link { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--nav-line); border-radius: 50%; font-weight: 700; }
.nav-foot a:hover, .nav-links a:hover:not(.on) { background: rgba(255,255,255,.07); color: var(--nav-ink); }
.side-foot { padding: 12px; border: 1px solid var(--nav-line); border-radius: 10px; font-size: 12px; color: var(--nav-muted); word-break: break-all; }
.side-foot .backup { display: block; margin-top: 10px; color: var(--nav-muted); }
.side-foot .backup.bad { color: #F0A58F; }
.side-foot b { display: block; color: var(--mint); font-weight: 500; font-size: 13px; margin-top: 4px; }
/* tabs at the top of a section (Stock: Slabs / Boards & beams / Inventory count …) */
.subnav { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; scrollbar-width: none; align-self: flex-start; max-width: 100%; }
.subnav[hidden] { display: none; }
.subnav a { padding: 8px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; white-space: nowrap; font-weight: 500; }
.subnav a:hover { color: var(--ink); background: var(--tint); }
.subnav a.on { background: var(--green); color: #fff; }
.tabbar, .more-sheet { display: none; }
main { flex: 1; min-width: 0; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 24px; outline: none; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 600; }
.head .sub { margin-top: 4px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--field); background: var(--card); cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.primary { border: 0; background: var(--green); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--danger); border-color: #E2C3BE; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--green); cursor: pointer; min-height: 32px; text-decoration: none; display: inline-flex; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat span:first-child { font-size: 12px; color: var(--muted); }
.stat span:last-child { font-family: var(--mono); font-size: 24px; font-weight: 500; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { height: 44px; flex: 1 1 260px; max-width: 360px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--field); background: var(--card); }
.pill { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--field); background: var(--card); cursor: pointer; }
.pill.on { border-color: var(--ink); background: var(--ink); color: #fff; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills .pill { height: 40px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-family: var(--mono); }
.inv { min-width: 900px; }
.slab-link { display: flex; align-items: center; gap: 12px; color: var(--ink); min-height: 44px; }
.inv td { white-space: nowrap; }
.slab-link .mono { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.thumb { display: inline-block; flex: none; width: 52px; height: 36px; border-radius: 6px; background-image: repeating-linear-gradient(100deg, rgba(255,255,255,.08) 0 2px, transparent 2px 9px); }
.cat { display: block; font-size: 12px; color: var(--muted); }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip.ready { background: #E3ECE6; color: #1F4231; }
.chip.kiln { background: #F6E9DA; color: #7A410D; }
.chip.air { background: #E1EBF4; color: #1E4A70; }
.chip.hold { background: #ECE6F4; color: #4E3577; }
.chip.sold { background: var(--line-soft); color: #4D5360; }
.web { height: 36px; min-width: 84px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--field); background: var(--card); color: #4D5360; cursor: pointer; }
.web.on { border: 0; background: var(--green); color: #fff; font-weight: 500; }
.web:disabled { cursor: default; opacity: .7; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }

.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-wide { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.col-narrow { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero { height: 300px; border-radius: 12px; background-image: repeating-linear-gradient(100deg, rgba(255,255,255,.07) 0 3px, transparent 3px 16px); display: flex; align-items: flex-end; padding: 16px; }
.hero span { font-family: var(--mono); font-size: 13px; background: rgba(0,0,0,.35); color: #fff; padding: 4px 8px; border-radius: 6px; }
.panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.facts div { display: flex; flex-direction: column; gap: 2px; }
.facts span:first-child { font-size: 12px; color: var(--muted); }
.line { display: flex; justify-content: space-between; gap: 12px; }
.line .mono { white-space: nowrap; }
.line.total { padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 600; }
.lineage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.lineage span.step { padding: 6px 10px; border-radius: 6px; background: var(--tint); }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 14px; margin-right: 8px; }
.row { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.form { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.form .fields { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.form .preview { flex: 2 1 280px; position: sticky; top: 20px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.input { height: 48px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--field); background: var(--card); color: var(--ink); width: 100%; min-width: 0; font-size: 16px; }
textarea.input { height: 80px; padding: 10px 12px; resize: vertical; }
.input.num-in { font-family: var(--mono); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }
.big-price { font-family: var(--mono); font-size: 34px; font-weight: 600; }
.error { color: var(--danger); font-size: 13px; }

.rates { min-width: 720px; }
.rates td { padding: 8px 12px; }
.rate-in { height: 40px; width: 92px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--field); font-family: var(--mono); background: var(--card); }
.rate-in.wide { width: 140px; font-family: var(--sans); }
.rate-in.narrow { width: 70px; text-transform: uppercase; }
.swatch { width: 40px; height: 40px; padding: 2px; border: 1px solid var(--field); border-radius: 6px; background: var(--card); }
.x { width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 18px; }
.x:hover { border-color: var(--field); color: var(--danger); }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--danger); }

.stat small { font-size: 11px; }
.scan .scan-row { display: flex; gap: 8px; }
.scan .scan-row .input { flex: 1; }
.scan.big .input { height: 60px; font-size: 24px; }
.scan.big .cam { height: 60px; }
.cam { height: 48px; gap: 6px; flex: none; }
.scan-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tagdot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.25); }
.tagdot.green { background: #3E9B4F; }
.tagdot.white { background: #FFFFFF; }
.tagdot.blue { background: #2F6FB5; }
.tagbtn::before { content: ""; width: 14px; height: 14px; border-radius: 3px; margin-right: 8px; border: 1px solid rgba(0,0,0,.25); }
.tagbtn.green::before { background: #3E9B4F; }
.tagbtn.white::before { background: #FFFFFF; }
.tagbtn.blue::before { background: #2F6FB5; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photo { position: relative; margin: 0; height: 96px; border-radius: 10px; overflow: hidden; background: var(--line-soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-x { position: absolute; top: 4px; right: 4px; background: rgba(255,255,255,.9); }
.add-photo { border: 1.5px dashed var(--field); background: var(--card); color: var(--green); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; }
.log-picks { display: flex; flex-direction: column; gap: 8px; }
.log-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; min-height: 48px; }
.log-pick .mono { font-weight: 600; font-size: 16px; }
.log-pick span:nth-child(2) { flex: 1; color: var(--muted); }
a.step { color: var(--ink); text-decoration: none; }
a.step:hover { background: var(--tint-2); }
.pill:disabled { opacity: .4; cursor: default; }
h1 .chip { vertical-align: middle; margin-left: 6px; font-family: var(--sans); }
[hidden] { display: none !important; }

.more { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.more-toggle { align-self: flex-start; font-size: 15px; min-height: 44px; text-align: left; }
.match { width: 100%; justify-content: center; gap: 6px; border-style: dashed; color: var(--green); }
.match.on { border: 2px solid var(--green); background: var(--tint); color: var(--green-dark); font-weight: 600; }

.chip.cust { background: #FBEBD0; color: #7A4A0D; }
.timer .timer-face { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.timer .timer-face .mono { font-size: 40px; font-weight: 600; letter-spacing: .02em; }
.timer.running { border: 2px solid #C98A2E; }
.timer-btn { justify-content: center; height: 56px; font-size: 18px; }
.btn.stop { border: 0; background: #A2412A; color: #fff; font-weight: 600; }
.entries summary { cursor: pointer; color: var(--green); min-height: 32px; display: flex; align-items: center; }
.entry { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }

.story blockquote { margin: 0; padding: 12px 16px; border-left: 4px solid var(--mint); background: var(--tint); border-radius: 0 8px 8px 0; white-space: pre-wrap; font-size: 15px; }
.story-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.story-pics img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; display: block; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--card); }
.timeline li span { color: var(--muted); }
.sibs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sib { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; min-height: 36px; }

.estimate { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.est-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.est-table { min-width: 760px; }
.est-table td, .est-table th { white-space: nowrap; }
.est-table tfoot td { border-top: 2px solid var(--ink); padding-top: 12px; }
.est-total { font-size: 18px; font-weight: 700; }
.est-terms p { margin: 0 0 6px; font-size: 13px; }
@media print {
  .side, .no-print, #toast { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .card { border: 0; }
  .estimate { padding: 0; }
  .est-table { min-width: 0; }
}

.hw-sheet { display: flex; flex-wrap: wrap; gap: 24px; }
.hw-card { width: 5in; max-width: 100%; min-height: 7in; box-sizing: border-box; background: #FBF8F2; color: #2A2119; border: 1px solid #D8CCB8; border-radius: 6px; padding: 0.3in; display: flex; flex-direction: column; gap: 12px; font-family: Georgia, "Iowan Old Style", serif; }
.hw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-bottom: 2px solid #2A2119; padding-bottom: 8px; }
.hw-shop { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.hw-kind { font-size: 11px; color: #7A6A55; letter-spacing: .08em; text-transform: uppercase; }
.hw-price { font-size: 30px; font-weight: 700; text-align: right; line-height: 1.1; }
.hw-for { display: block; font-size: 11px; font-weight: 400; letter-spacing: .08em; text-transform: uppercase; color: #7A6A55; }
.hw-photo { height: 2.3in; border-radius: 4px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #F3EDE3; background-image: repeating-linear-gradient(100deg, rgba(255,255,255,.07) 0 3px, transparent 3px 16px); }
.hw-photo img { width: 100%; height: 100%; object-fit: cover; }
.hw-title { margin: 0; font-size: 22px; font-weight: 600; }
.hw-story { margin: 0; font-style: italic; font-size: 15px; line-height: 1.45; border-left: 3px solid #B08D57; padding-left: 12px; }
.hw-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; }
.hw-facts dt { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #7A6A55; }
.hw-facts dd { margin: 0; }
.hw-mate { margin: 0; font-size: 13px; }
.hw-foot { margin-top: auto; display: flex; align-items: baseline; gap: 8px; border-top: 1px solid #D8CCB8; padding-top: 8px; font-size: 11px; color: #7A6A55; text-transform: uppercase; letter-spacing: .08em; }
.hw-foot b { font-size: 18px; color: #2A2119; letter-spacing: .04em; margin-right: 14px; }
@media print {
  .hw-sheet { display: block; }
  .hw-card { width: 5in; height: 7in; border: 0; border-radius: 0; page-break-after: always; break-after: page; }
}

.photo-role { position: absolute; left: 4px; bottom: 4px; border: 0; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.92); color: #5A3F2E; cursor: pointer; }
.photo-role.tree { background: #3E7B47; color: #fff; }
.photo-role.end { background: #8B5E34; color: #fff; }
select.photo-role { appearance: none; -webkit-appearance: none; padding-right: 9px; }
.story-pic { position: relative; display: block; }
.story-pic span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.9); color: var(--ink); padding: 2px 8px; border-radius: 999px; }
.hw-photos { display: grid; gap: 6px; }
.hw-photos.n2 { grid-template-columns: 1fr 1fr; }
.hw-photos.n3 { grid-template-columns: 1fr 1fr 1fr; }
.hw-photos figure { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.hw-photos img { width: 100%; height: 1.55in; object-fit: cover; border-radius: 4px; display: block; }
.hw-photos.n1 img { height: 2.3in; }
.hw-photos figcaption { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: #7A6A55; text-align: center; }

.timer-starts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.timer-starts .timer-btn { height: auto; min-height: 60px; flex-direction: column; gap: 2px; padding: 8px 10px; white-space: normal; text-align: center; }
.timer-starts small { font-size: 12px; font-weight: 400; opacity: .85; }

.kiln-load .scan-pair { align-items: end; }
.rep { min-width: 640px; }
.report-sec .row b { font-size: 15px; }
@media print { .report-sec { break-inside: avoid; } .rep { min-width: 0; font-size: 12px; } }

.plan { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.plan:first-of-type { border-top: 0; }
.meter { height: 8px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--green); }

.site { flex-shrink: 0; background: #F5F6F7; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-family: Georgia, "Iowan Old Style", serif; color: #1B1B1B; }
.web-banner { background: linear-gradient(100deg, #3B2A20, #6A4B36 45%, #4C3A4A); color: #fff; padding: 26px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--sans); }
.web-banner span { font-weight: 700; font-size: 18px; letter-spacing: .04em; }
.web-banner nav { font-size: 12px; letter-spacing: .14em; }
.web-h { margin: 24px 28px 8px; font-size: 26px; }
.web-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; padding: 12px 28px 28px; }
.web-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; }
.web-card-pic { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; display: block; }
.web-nopic { background-image: repeating-linear-gradient(100deg, rgba(255,255,255,.08) 0 3px, transparent 3px 14px); }
.web-card-t { font-size: 15px; }
.web-card-p { font-family: var(--sans); font-size: 14px; color: #444; }
.web-crumb { padding: 18px 28px 0; font-family: var(--sans); font-size: 13px; font-weight: 600; }
.web-product { display: flex; flex-wrap: wrap; gap: 28px; padding: 18px 28px 28px; }
.web-gallery { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.web-main { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.web-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.web-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.web-info { flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; font-family: var(--sans); }
.web-info h1 { font-family: Georgia, serif; font-size: 30px; margin: 0; }
.web-price { font-size: 20px; }
.web-box { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #ddd; padding-top: 10px; font-size: 14px; }
.web-desc { border-top: 1px solid #ddd; padding-top: 10px; font-size: 14px; line-height: 1.5; }
.web-desc p { margin: 6px 0; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: sticky; z-index: 5; height: auto; flex: none; flex-direction: row; align-items: center; padding: 10px 16px; gap: 12px; overflow-x: auto; }
  .brand-text small, .side-foot { display: none; }
  @media (max-width: 480px) { .brand-text { display: none; } }
  /* phones: a slim top bar (logo, you, help) and the main pages along the bottom */
  .side { position: static; justify-content: space-between; padding: 8px 16px; }
  .nav-links { display: none; }
  .nav-foot { margin-top: 0; }
  .nav-foot .who-link { padding: 8px 10px; }
  .nav-foot .help-link { width: 36px; height: 36px; }
  main { padding: 16px 16px calc(48px + var(--tabbar-h)); gap: 18px; }
  .subnav { align-self: stretch; }
  .subnav a { flex: 1 0 auto; text-align: center; padding: 10px 12px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--nav); border-top: 1px solid var(--nav-line);
            padding: 4px 4px env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; justify-content: center;
            background: none; border: 0; border-radius: 10px; color: var(--nav-muted); text-decoration: none; font-size: 12px; font-weight: 500; cursor: pointer; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .on { color: #fff; background: var(--green); }
  .more-sheet:not([hidden]) { display: flex; flex-direction: column; position: fixed; z-index: 21; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px);
            background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 40px rgba(27,33,30,.25); }
  .more-sheet a { padding: 14px 16px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .more-sheet a[hidden] { display: none; }
  .more-sheet a.on { background: var(--tint); color: var(--green-dark); }
  #toast { bottom: calc(var(--tabbar-h) + 12px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form .preview { position: sticky; bottom: var(--tabbar-h); z-index: 4; flex-basis: 100%; margin: 0 -16px -48px; border-radius: 14px 14px 0 0; padding: 12px 16px 16px; gap: 6px; box-shadow: 0 -6px 20px rgba(27,33,30,.12); }
  .form .preview .label, .form .preview .detail { display: none; }
  .form .preview .line.total { padding-top: 0; border-top: 0; align-items: center; }
  .big-price { font-size: 28px; }
  .scan-pair { grid-template-columns: 1fr; }
  /* big targets for gloved hands at the saw */
  .input { height: 56px; font-size: 18px; }
  .scan .cam { height: 56px; width: 60px; }
  .pills { gap: 10px; }
  .pills .pill { height: 50px; min-width: 64px; padding: 0 16px; font-size: 16px; }
  .btn { height: 52px; font-size: 16px; }
  .form .preview .btn.primary { height: 58px; font-size: 18px; }
  .match { height: 56px; }
  .cam span { display: none; }
  .cam { width: 52px; justify-content: center; padding: 0; }
  .hero { height: 200px; }
}

/* slab width readings */
.readings { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 6px; }
.reading { display: flex; align-items: center; gap: 6px; }
.reading .muted { font-size: 12px; min-width: 22px; }
.reading .input { width: 100%; min-width: 0; }
.readings-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }

/* WTB logo */
.brand img { flex-shrink: 0; object-fit: contain; }
.brand-row { display: flex; align-items: center; gap: 12px; }
.logo { flex-shrink: 0; display: block; object-fit: contain; }
.hw-brand { display: flex; align-items: center; gap: 8px; }
.letterhead { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.lh-shop { display: flex; align-items: center; gap: 14px; }
.lh-shop > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); }
.lh-shop b { font-size: 20px; color: var(--ink); }
.gb-mark { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.gb-mark > div { display: flex; flex-direction: column; line-height: 1.15; }
.gb-mark b { font-size: 15px; color: var(--ink); letter-spacing: -0.01em; }
.gb-mark span { font-size: 11px; color: var(--muted); }
@media print { .letterhead { padding-bottom: 10px; border-bottom: 2px solid var(--green); margin-bottom: 8px; } }
.hw-contact { margin-left: auto; font-size: 10px; letter-spacing: .04em; }
.logo-box { display: flex; justify-content: center; padding: 12px; background: var(--bg); border-radius: 10px; }
.logo-box .logo { width: 120px; height: 120px; object-fit: contain; }
.swatch-row { display: flex; align-items: center; gap: 12px; }
.swatch-pick input { width: 52px; height: 52px; padding: 0; border: 1px solid var(--field); border-radius: 10px; background: none; cursor: pointer; }
.suggest { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 10px; background: var(--tint); font-size: 13px; }
.swatches { display: flex; gap: 6px; }
.swatches span { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-top: -8px; }
.tab { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab.on { color: var(--green); border-bottom-color: var(--green); }

/* users + activity */
body.no-delete .need-delete, body.no-override .need-override { display: none !important; }
.perm-box { display: flex; flex-direction: column; gap: 6px; }
body.locked .side, body.locked .tabbar, body.locked .more-sheet { display: none; }
:root { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
.nav-links a[hidden] { display: none; }
.login { max-width: 380px; margin: 6vh auto 0; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login h1 { margin: 0; font-size: 24px; }
.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form .btn { justify-content: center; }
.pin { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; }
.who-pick { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.who-btn { height: 64px; justify-content: center; font-size: 17px; font-weight: 600; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.activity li:first-child { border-top: 0; }
.activity .when { flex: 0 0 130px; color: var(--muted); font-size: 12px; font-family: var(--mono); padding-top: 2px; }
.user-form { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.nav-links .who-link { margin-top: 12px; color: var(--nav-muted); }
@media (max-width: 860px) { .nav-links .who-link { margin-top: 0; } .activity .when { flex-basis: 96px; } }

/* work clock */
#view { display: flex; flex-direction: column; gap: 24px; }
#workbar:empty, #notice:empty { display: none; }
.workbar.notice { background: var(--tint); border-color: var(--tint-2); }
.workbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.workbar.on { background: var(--tint); border-color: var(--tint-2); }
.workbar .what { flex: 1; min-width: 0; }
.workbar .btn { height: 36px; }
.workbar .dot { width: 10px; height: 10px; border-radius: 50%; background: #3E9B4F; flex: 0 0 10px; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .workbar .dot { animation: none; } }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.task-btn { height: 72px; justify-content: center; font-size: 16px; font-weight: 600; white-space: normal; text-align: center; }
button.log-pick { font: inherit; text-align: left; cursor: pointer; width: 100%; }
.crew-on { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.crew-on .btn { height: 36px; }
@media print { #workbar { display: none; } }
button.log-pick { background: var(--card); }
a.pill { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }

/* people's photos */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; }
.avatar.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--tint-2); color: var(--green-dark); font-weight: 600; }
.who-btn { height: auto; padding: 14px 10px; flex-direction: column; gap: 8px; white-space: normal; }
.login-me { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.person-photo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.user-form .grid3 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.measure-me { background: var(--tint); border-color: var(--tint-2); }
.scan-hit { padding: 10px 12px; border-radius: 10px; font-size: 16px; }
.scan-hit.ok { background: #E3F1E6; color: #1F4231; }
.scan-hit.again { background: var(--line-soft); }
.scan-hit.bad { background: #FBE7E3; color: var(--danger); }
.task-btn small { font-weight: 400; }
.user-acts { display: flex; gap: 8px; justify-content: flex-end; }
.user-acts .btn { padding: 6px 12px; font-family: inherit; }
/* phones: each person is a card, so Change and Activity are in reach without scrolling sideways */
@media (max-width: 860px) {
  .users-table thead { display: none; }
  .users-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .users-table td { display: block; padding: 0; border: 0; white-space: normal; text-align: left; }
  .users-table td:first-child { flex-basis: 100%; }
  .users-table td.num:not(.user-acts) { font-family: inherit; }
  .users-table td.pay::before { content: 'Pay '; color: var(--muted); }
  .users-table .user-acts { flex-basis: 100%; justify-content: flex-start; }
  .users-table .user-acts .btn { flex: 1; text-align: center; padding: 10px 12px; }
}
.cust-pick:empty { display: none; }
.cust-note { font-size: 13px; }
.cust-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.cust-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.cust-opt:last-child { border-bottom: 0; }
.cust-opt:hover, .cust-opt:focus { background: var(--tint); outline: none; }
.cust-opt small { color: var(--muted); font-size: 12px; }
tr.click { cursor: pointer; }
@media (max-width: 860px) { .cust-table .email { display: none; } }

/* help: the manual */
#help-q { margin-bottom: 12px; }
.help-toc { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
.help-toc a { white-space: nowrap; }
.help { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; line-height: 1.55; }
.help section { scroll-margin-top: 16px; }
.help h2 { margin: 0; font-size: 20px; }
.help h3 { margin: 10px 0 0; font-size: 15px; }
.help p, .help ul, .help ol { margin: 0; }
.help ul, .help ol { padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.help ul ul { margin-top: 4px; }
.help-table { border-collapse: collapse; }
.help-table th, .help-table td { text-align: left; padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.news { list-style: none; padding-left: 0 !important; }
@media print { .help section { break-inside: avoid; } }
.help section[hidden], #help-none[hidden] { display: none; }

/* sales, holds, QR */
.sale-tag { color: #A23B1E; font-weight: 600; }
.sale-line { color: #A23B1E; }
.sale-species { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px; }
.hw-qr-row { display: flex; align-items: center; gap: 12px; font-size: 11px; color: #555; margin-top: 6px; }
.hw-qr { width: 72px; height: 72px; flex: 0 0 72px; }
.hw-qr svg { width: 100%; height: 100%; }
.sp-photo { display: inline-flex; width: 56px; height: 40px; border-radius: 6px; overflow: hidden; border: 1px dashed var(--field); cursor: pointer; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; }

/* shown only on paper (e.g. the thickness picked on an estimate) */
.print-only { display: none; }
@media print { .print-only { display: inline; } }

/* cut plans */
.plan-stage svg, .plan-thumb svg { display: block; width: 100%; height: auto; border-radius: 10px; background: #222; }
.plan-stage { user-select: none; -webkit-user-select: none; }
.plan-thumb { display: block; }
.plan-colors { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch-btn.on { outline: 3px solid var(--green); outline-offset: 2px; }
.grade-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.cut-picks { display: flex; flex-direction: column; gap: 2px; font-size: 13px; white-space: nowrap; }

.best-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.best-row .actions { flex-wrap: nowrap; }
.sep { height: 1px; background: var(--line); margin: 6px 0; }
.saw-step { font-size: 20px; line-height: 1.4; }
.saw-step b { font-size: 24px; display: block; margin-bottom: 6px; }
.saw-nav { display: flex; gap: 10px; }
.saw-nav .btn { flex: 1; height: 56px; justify-content: center; font-size: 18px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.opt-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; break-inside: avoid; }
.opt-card.chosen { border: 3px solid var(--green); }
