/* Voice inventory: kraft + chalk, deep rust signal. Zilla Slab (display) + Barlow (text). */
:root {
  --kraft: #E2D2B3;
  --kraft-dark: #C7B38D;
  --chalk: #F7F1E4;
  --ink: #2B2118;
  --ink-2: #57472F;          /* 5.9:1 on kraft */
  --line: #B9A57F;
  --rust: #A63A1F;           /* 6.2:1 with white */
  --rust-dark: #7F2A14;
  --amber: #F2B62D; --amber-ink: #3A2600; --amber-line: #C98F0B;
  --green: #35602A; --green-bg: #DDEBCF; --green-line: #8FB37A;
  --r: 6px;
  --slab: "Zilla Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--kraft); color: var(--ink); font: 1.0625rem/1.5 var(--sans); overflow-wrap: break-word; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.ico { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-2); }
.small-p { font-size: .9375rem; }

.banner { background: var(--ink); color: #F1E8D6; }
.banner p { max-width: 1240px; margin: 0 auto; padding: 10px var(--gutter); font-size: 1rem; }
.banner b { color: #fff; }

.hero { padding: clamp(24px, 4vw, 44px) 0 clamp(16px, 3vw, 28px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .9375rem; margin-bottom: 14px; }
.brand .ico { color: var(--rust); }
.brand span { font-weight: 500; color: var(--ink-2); }
h1 { font-family: var(--slab); font-weight: 700; font-size: clamp(2.5rem, 5.6vw, 4.5rem); line-height: 1; letter-spacing: -.01em; max-width: 26ch; margin-bottom: 16px; }
h1 em { font-style: normal; color: var(--rust); }
.lede { max-width: 56ch; font-size: 1.1875rem; color: var(--ink-2); font-weight: 500; }

.layout { display: grid; grid-template-columns: 410px minmax(0, 1fr); gap: 36px; align-items: start; padding-bottom: 56px; }
.sec-h { margin-bottom: 14px; }
.sec-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-top .sec-h { margin-bottom: 0; }
.tag { display: inline-block; background: var(--ink); color: var(--chalk); font-family: var(--slab); font-weight: 600; font-size: 1.25rem; letter-spacing: .02em; padding: 4px 16px 5px; border-radius: 3px 3px 3px 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 20px; border: 2px solid transparent; border-radius: var(--r); font-weight: 700; cursor: pointer; transition: background-color .15s, border-color .15s; }
.btn.primary { background: var(--rust); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--rust-dark); }
.btn.primary:disabled { background: #B9AA92; color: #4A3D2B; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--chalk); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 1rem; }
.btn.quiet { background: #fff; border-color: var(--ink); }
.btn.quiet:hover { background: var(--amber); }
.btn.wide { width: 100%; }

/* phone */
.phone { position: relative; background: var(--ink); border-radius: 40px; padding: 12px; box-shadow: 0 22px 40px -22px rgba(43,33,24,.7); }
.ph-notch { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; background: var(--ink); border-radius: 0 0 14px 14px; z-index: 2; }
.ph-screen { background: var(--chalk); border-radius: 30px; padding: 40px 16px 20px; display: grid; gap: 18px; min-height: 620px; }

.rec-zone { display: grid; justify-items: center; gap: 8px; }
.rec { display: grid; justify-items: center; gap: 6px; background: none; border: 0; cursor: pointer; padding: 4px; }
.rec-ico { display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; background: var(--rust); color: #fff; box-shadow: 0 0 0 6px var(--chalk), 0 0 0 9px var(--rust); transition: background-color .15s; }
.rec-ico .ico { width: 44px; height: 44px; }
.rec:hover .rec-ico { background: var(--rust-dark); }
.rec:focus-visible { outline: none; }
.rec:focus-visible .rec-ico { outline: 3px solid var(--ink); outline-offset: 10px; }
.rec-label { font-family: var(--slab); font-weight: 700; font-size: 1.25rem; margin-top: 8px; }
.rec.is-rec .rec-ico { background: var(--ink); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--chalk), 0 0 0 16px rgba(166,58,31,.55); } }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 40px; width: 100%; opacity: .25; }
.wave span { flex: 0 0 5px; height: 12%; background: var(--rust); border-radius: 3px; }
.wave.on { opacity: 1; }
.wave.on span { animation: bar .7s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.09s); }
@keyframes bar { from { height: 12%; } to { height: var(--h); } }
.rec-status { text-align: center; font-weight: 600; color: var(--ink-2); min-height: 3em; max-width: 30ch; }

.samples { display: grid; gap: 8px; }
.samples-k, .block-k { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .8125rem; color: var(--ink-2); }
.block-k span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.samples-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sample { display: grid; gap: 0; justify-items: start; text-align: left; min-height: 60px; padding: 8px 10px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); cursor: pointer; }
.sample b { font-family: var(--slab); font-size: 1.125rem; }
.sample small { font-size: .875rem; color: var(--ink-2); line-height: 1.2; }
.sample:hover:not(:disabled) { background: var(--amber); }
.sample:disabled { opacity: .55; cursor: not-allowed; }
.sample.sel { background: var(--ink); color: var(--chalk); }
.sample.sel small { color: #E0D3BA; }

.block { display: grid; gap: 6px; }
.transcript { min-height: 4.6em; background: #fff; border: 2px dashed var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 1.125rem; line-height: 1.4; }
.transcript:empty::before { content: "Your words will appear here."; color: var(--ink-2); font-style: italic; font-size: 1rem; }
.transcript.typing::after { content: ""; display: inline-block; width: 2px; height: 1.1em; background: var(--rust); margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.heard { display: grid; gap: 10px; background: #fff; border: 2px solid var(--ink); border-radius: var(--r); padding: 14px; }
.hlist { list-style: none; display: grid; gap: 10px; }
.hrow { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r); border: 2px solid var(--green-line); background: #F5F9EE; }
.hrow.needs { border-color: var(--amber-line); background: #FFF6DA; }
.h-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.h-name { font-family: var(--slab); font-weight: 700; font-size: 1.1875rem; }
.h-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.h-delta, .h-sign { font-family: var(--slab); font-weight: 700; font-size: 1.75rem; line-height: 1; font-variant-numeric: tabular-nums; }
.h-qty { width: 92px; min-height: 48px; padding: 4px 8px; border: 2px solid var(--ink); border-radius: var(--r); background: #fff; font-family: var(--slab); font-weight: 700; font-size: 1.5rem; }
.h-unit { font-weight: 600; }
.h-prev { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 1rem; }
.h-prev b { color: var(--ink); }
.h-flag { font-weight: 600; }
.heard-hint { font-size: .9375rem; color: var(--ink-2); }
.heard-hint:empty { display: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 5px; border: 1.5px solid; font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.chip .ico { width: 1.1em; height: 1.1em; }
.chip.okc { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.chip.low, .chip.check { background: var(--amber); border-color: var(--amber-line); color: var(--amber-ink); }

.reply { display: grid; gap: 6px; animation: rise .4s ease-out both; }
.reply[hidden] { display: none; }
.reply-from { display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--ink-2); font-weight: 600; }
.reply-from time { margin-left: auto; }
.reply .bubble { background: var(--ink); color: var(--chalk); border-radius: 6px 20px 20px 20px; padding: 12px 16px; font-size: 1.125rem; line-height: 1.4; }
.reply-link a { font-weight: 700; color: var(--rust-dark); text-underline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* stock sheet */
.sheet { background: var(--chalk); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 700; font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; padding: 12px 16px; background: var(--ink); color: var(--chalk); }
.grid th.r, .grid td.r { text-align: right; }
.grid td { padding: 10px 16px; border-bottom: 2px dashed var(--kraft-dark); }
.grid .row:last-child td { border-bottom: 0; }
.c-item { font-family: var(--slab); font-weight: 600; font-size: 1.1875rem; }
.c-on .n { font-family: var(--slab); font-weight: 700; font-size: 1.875rem; line-height: 1; font-variant-numeric: tabular-nums; }
.c-min .n { font-size: 1.125rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.c-unit { color: var(--ink-2); }
.row.is-low .c-on .n { color: var(--rust); }
.row.changed td { background: #FBE9A6; animation: flash 4.5s ease-out both; }
.row.changed .c-on::after { content: attr(data-delta); display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 4px; background: var(--ink); color: var(--chalk); font-weight: 700; font-size: .9375rem; vertical-align: 4px; font-variant-numeric: tabular-nums; }
@keyframes flash { 0%, 55% { background-color: #FBE9A6; } 100% { background-color: transparent; } }

.reorder { margin-top: 20px; background: var(--chalk); border: 2px solid var(--ink); border-left: 10px solid var(--rust); border-radius: var(--r); padding: 16px 18px; }
.reorder h3 { display: flex; align-items: center; gap: 8px; font-family: var(--slab); font-size: 1.375rem; margin-bottom: 2px; }
.reorder ul { list-style: none; margin-top: 10px; display: grid; gap: 6px; }
.reorder li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 8px 0; border-bottom: 2px dashed var(--kraft-dark); }
.reorder li:last-child { border-bottom: 0; }
.ro-name { font-family: var(--slab); font-weight: 700; font-size: 1.1875rem; }
.ro-meta { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ro-none { color: var(--ink-2); }

.foot { border-top: 2px solid var(--ink); padding: 22px 0 40px; color: var(--ink-2); font-size: .9375rem; }
.foot p { max-width: 74ch; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .truck { max-width: 460px; }
}
@media (max-width: 640px) {
  .grid, .grid tbody { display: block; }
  .grid thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sheet { background: transparent; border: 0; overflow: visible; }
  .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "item stat" "on on" "meta meta"; align-items: center; gap: 2px 12px; background: var(--chalk); border: 2px solid var(--ink); border-left-width: 8px; border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
  .row.is-low { border-left-color: var(--amber-line); }
  .row td { display: block; padding: 0 !important; border: 0 !important; }
  .row.changed td { animation: none; background: transparent; }
  .row.changed { animation: flash-card 4.5s ease-out both; }
  .c-item { grid-area: item; }
  .c-stat { grid-area: stat; justify-self: end; }
  .c-on { grid-area: on; text-align: left !important; }
  .c-on::before { content: "On hand "; font-size: .9375rem; font-weight: 500; color: var(--ink-2); margin-right: 6px; }
  .c-min, .c-unit { display: inline !important; grid-area: meta; }
  .c-min { justify-self: start; }
  .c-min::before { content: "Minimum "; }
  .c-min .n { font-size: 1rem; }
  .c-unit { justify-self: end; }
  .samples-row { grid-template-columns: 1fr; }
  .sample { min-height: 56px; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
  .h-prev { margin-left: 0; width: 100%; }
}
@keyframes flash-card { 0%, 55% { background-color: #FBE9A6; } 100% { background-color: var(--chalk); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .row.changed td, .row.changed { background: #FBE9A6; }
  .wave.on span { height: var(--h); }
  .rec.is-rec .rec-ico { box-shadow: 0 0 0 6px var(--chalk), 0 0 0 12px var(--rust); }
}
