/* Layout: fixed pine sidebar beside a working canvas. The size-run strip is the signature element. */
:root {
  --bg: #EFF4F1; --surface: #FFFFFF; --surface-2: #F6F9F7; --line: #DBE4DF; --line-2: #BFCDC6;
  --ink: #13231D; --ink-2: #47594F; --ink-3: #6A7D74;
  --pine: #0B6E55; --pine-hover: #095C47; --on-pine: #FFFFFF; --pine-soft: #DDF0E8; --pine-text: #0A5C47;
  --side: #0B2A22; --side-2: #15463A; --side-ink: #BFD4CC; --side-strong: #FFFFFF;
  --gold: #F2AE24; --gold-hover: #DE9C14; --on-gold: #241A02; --gold-soft: #FCEFCF; --gold-text: #7A5200;
  --good: #136F45; --good-soft: #DCF2E5; --warn: #955600; --warn-soft: #FBEBCB; --bad: #AF2C2C; --bad-soft: #FAE1DE;
  --r0: #EDF1EF; --r0t: #8A9A92; --r1: #FBE3B4; --r1t: #6D4A00; --r2: #A9DCC8; --r2t: #0B4436; --r3: #0B6E55; --r3t: #FFFFFF;
  --tile: #E7EEEA; --chart: #84BFAC; --chart-now: #0B6E55; --grid: #E2E9E5;
  --scrim: rgb(6 20 15 / .6); --shadow: 0 12px 40px rgb(10 35 27 / .22);
  --display: "Bricolage Grotesque", "Hind Madurai", system-ui, sans-serif;
  --body: "Figtree", "Hind Madurai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-w: 236px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0B1512; --surface: #13201C; --surface-2: #192924; --line: #26382F; --line-2: #3A5048;
  --ink: #E6EFEB; --ink-2: #A9BDB4; --ink-3: #8BA097;
  --pine: #2FB48E; --pine-hover: #3FC6A0; --on-pine: #06211A; --pine-soft: #17392F; --pine-text: #6FD8B9;
  --side: #081C17; --side-2: #15392F; --side-ink: #A9C2B9; --side-strong: #FFFFFF;
  --gold: #F2AE24; --gold-hover: #FFC046; --on-gold: #241A02; --gold-soft: #3A2C0B; --gold-text: #F4C766;
  --good: #66D39F; --good-soft: #143525; --warn: #F0BB62; --warn-soft: #39290C; --bad: #F48F85; --bad-soft: #421D1A;
  --r0: #1C2C27; --r0t: #7E948A; --r1: #4E3A10; --r1t: #F8D489; --r2: #1F5C4A; --r2t: #CDEFE2; --r3: #35BC96; --r3t: #06211A;
  --tile: #C9D6D0; --chart: #2F6F5C; --chart-now: #4FD0AA; --grid: #22342D;
  --scrim: rgb(0 0 0 / .68); --shadow: 0 12px 40px rgb(0 0 0 / .5); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0B1512; --surface: #13201C; --surface-2: #192924; --line: #26382F; --line-2: #3A5048;
  --ink: #E6EFEB; --ink-2: #A9BDB4; --ink-3: #8BA097;
  --pine: #2FB48E; --pine-hover: #3FC6A0; --on-pine: #06211A; --pine-soft: #17392F; --pine-text: #6FD8B9;
  --side: #081C17; --side-2: #15392F; --side-ink: #A9C2B9; --side-strong: #FFFFFF;
  --gold: #F2AE24; --gold-hover: #FFC046; --on-gold: #241A02; --gold-soft: #3A2C0B; --gold-text: #F4C766;
  --good: #66D39F; --good-soft: #143525; --warn: #F0BB62; --warn-soft: #39290C; --bad: #F48F85; --bad-soft: #421D1A;
  --r0: #1C2C27; --r0t: #7E948A; --r1: #4E3A10; --r1t: #F8D489; --r2: #1F5C4A; --r2t: #CDEFE2; --r3: #35BC96; --r3t: #06211A;
  --tile: #C9D6D0; --chart: #2F6F5C; --chart-now: #4FD0AA; --grid: #22342D;
  --scrim: rgb(0 0 0 / .68); --shadow: 0 12px 40px rgb(0 0 0 / .5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); letter-spacing: -.01em; text-wrap: balance; }
h3 { font-size: 15.5px; font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
small { font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.muted { color: var(--ink-3); font-weight: 400; }
.block { display: block; }
.grow { flex: 1; }
.lede { color: var(--ink-2); font-size: 15.5px; }
.ta { font-family: "Hind Madurai", var(--body); }
.ic { flex: none; }
.only-m { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
html.framed .needs-print { display: none !important; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.sm { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.btn.primary:hover { background: var(--pine-hover); border-color: var(--pine-hover); }
.btn.cta { background: var(--gold); border-color: var(--gold); color: var(--on-gold); font-weight: 700; min-height: 46px; }
.btn.cta:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.btn.wide { width: 100%; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.btn.ghost-bad { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.ghost-bad:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--pine-soft); color: var(--pine-text); }
.icon-btn.on-dark { color: var(--side-ink); }
.icon-btn.on-dark:hover { background: var(--side-2); color: var(--side-strong); }
.link { color: var(--pine-text); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; text-align: left; }
.link:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-row > .field { flex: 1 1 130px; }
.field-row > .field.grow2 { flex: 2 1 240px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
input:not([type=checkbox]), select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); }
input:focus, select:focus { outline: 2px solid var(--pine); outline-offset: -1px; border-color: var(--pine); }
input::placeholder { color: var(--ink-3); }
.prefix { position: relative; }
.prefix span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 600; }
.prefix input { padding-left: 26px; }
.prefix.auto input { background: var(--pine-soft); border-color: var(--pine); font-weight: 700; color: var(--pine-text); }
.field-row, .two { display: flex; flex-wrap: wrap; gap: 12px; }
.two > .field { flex: 1 1 150px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.center { align-items: center; text-align: center; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 600; font-size: 14px; }
.note { font-size: 13px; color: var(--pine-text); font-weight: 600; min-height: 0; }
.note:empty { display: none; }

.search-box { position: relative; min-width: 0; }
.toolbar > .search-box { flex: 1 1 240px; }
.search-box .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-box input { padding-left: 38px; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--pine-soft); color: var(--pine-text); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.gold { background: var(--gold-soft); color: var(--gold-text); }

.chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 13px; min-height: 36px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.chip:hover { border-color: var(--pine); }
.chip.on { background: var(--pine); border-color: var(--pine); color: var(--on-pine); }
.chips.big .chip { min-height: 40px; padding: 8px 18px; font-size: 14.5px; }
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { flex: 1; min-height: 40px; padding: 6px 12px; border: 0; border-left: 1px solid var(--line); background: transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--pine); color: var(--on-pine); }
.seg.small button { min-height: 34px; font-size: 12.5px; padding: 4px 10px; }
.seg button.on-H { background: var(--gold); color: var(--on-gold); }
.seg button.on-A { background: var(--bad); color: var(--surface); }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; padding: 8px 0 11px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--pine-text); border-bottom-color: var(--pine); }

/* Size-run strip */
.run { display: inline-flex; gap: 3px; }
.run-cell { display: inline-flex; flex-direction: column; align-items: center; width: 31px; padding: 3px 0 2px; border-radius: 5px; line-height: 1.1; }
.run-cell i { font-style: normal; font-size: 10px; opacity: .78; }
.run-cell b { font-size: 13px; }
.run-cell.lg { width: auto; padding: 1px 8px; }
.run-cell.l0 { background: var(--r0); color: var(--r0t); } .run-cell.l1 { background: var(--r1); color: var(--r1t); } .run-cell.l2 { background: var(--r2); color: var(--r2t); } .run-cell.l3 { background: var(--r3); color: var(--r3t); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 12.5px; color: var(--ink-3); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.login-art { background: var(--side); color: var(--side-strong); padding: 40px max(40px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; justify-content: space-between; gap: 34px; }
.login-art h1 { font-size: clamp(30px, 3.6vw, 48px); line-height: 1.08; max-width: 15em; }
.login-art p { color: var(--side-ink); font-size: 17px; max-width: 31em; margin-top: 14px; }
.login-run { display: flex; align-items: flex-end; gap: 8px; }
.art-size { display: flex; flex-direction: column; justify-content: space-between; align-items: center; width: 62px; height: var(--h); padding: 7px 0; border-radius: 7px; background: var(--side-2); color: var(--side-ink); }
.art-size b { color: var(--side-strong); font-size: 17px; }
.art-size i { font-style: normal; font-size: 12px; }
.login-form { display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); }
.login-form > div { width: min(370px, 100%); }
.login-form h2 { font-size: 30px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 17.5px; color: var(--side-strong); }
.brand.big { font-size: 21px; }
.logo { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--side-2); flex: none; }
.brand .logo svg, .top-brand svg { display: block; }

/* Shell */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px 12px; padding-left: max(12px, env(safe-area-inset-left, 0px)); z-index: 40; }
.side .brand { padding: 0 8px 16px; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; scrollbar-width: none; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group > span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 0 10px 4px; color: var(--side-ink); opacity: .7; font-weight: 600; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; font-weight: 500; font-size: 14.5px; }
.side-nav a:hover { background: var(--side-2); color: var(--side-strong); }
.side-nav a.active { background: var(--gold); color: var(--on-gold); font-weight: 700; }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 2px; border-top: 1px solid var(--side-2); margin-top: 10px; }
.who { display: flex; flex-direction: column; line-height: 1.25; }
.who b { color: var(--side-strong); font-size: 14px; }
.who small { opacity: .8; }

.app-main { margin-left: var(--side-w); min-height: 100vh; min-width: 0; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 10px; padding-block: 11px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; min-width: 0; }
.top h1 { font-size: 23px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding-block: 16px 34px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 14px; justify-content: space-between; color: var(--ink-2); }
.page-head p { max-width: 70ch; }
.show-me { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--pine-text); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; padding: 4px; }
.show-me:hover { text-decoration: underline; }
.bottom-nav { display: none; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; gap: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-head .muted { font-size: 13px; }
.pad { padding: 14px 16px; }
.step { display: flex; align-items: center; gap: 9px; }
.step i { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: var(--pine); color: var(--on-pine); font-style: normal; font-size: 12.5px; }
.sub { margin-top: 6px; font-family: var(--display); font-size: 18px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; min-width: 0; }
.toolbar.end { justify-content: flex-end; }
.toolbar > select { flex: 0 1 190px; width: auto; }
.dates { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dates input { width: 158px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stat { background: var(--surface); padding: 13px 16px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stat label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.stat strong { font-family: var(--display); font-size: 25px; line-height: 1.25; font-weight: 700; }
.stat small { color: var(--ink-3); }

/* Home */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-a { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .12s; }
.quick-a:hover { border-color: var(--pine); }
.quick-a span { display: flex; flex-direction: column; line-height: 1.3; }
.quick-a small { color: var(--ink-3); }
.quick-a.main { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.quick-a.main:hover { background: var(--gold-hover); border-color: var(--gold-hover); }
.quick-a.main small { color: var(--on-gold); opacity: .78; }
.grid-home { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.span2 { grid-column: span 2; }
.chart { position: relative; }
.chart svg { display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--ink-3); font-size: 11.5px; font-family: var(--body); }
.chart .bar { fill: var(--chart); }
.chart .bar.now { fill: var(--chart-now); }
.chart .hit { cursor: pointer; outline: none; }
.chart .hit:hover, .chart .hit:focus { fill: var(--pine); fill-opacity: .08; }
.tip { position: absolute; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 6px 11px; border-radius: 7px; font-size: 12.5px; pointer-events: none; display: flex; flex-direction: column; white-space: nowrap; }
.tip b { font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.rows li:first-child { border-top: 0; }
.rows.tight li { padding: 6px 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.row-main small { color: var(--ink-3); }
.meter { display: block; height: 5px; background: var(--r0); border-radius: 3px; margin-top: 5px; }
.meter i { display: block; height: 100%; background: var(--pine); border-radius: 3px; }
.num { font-weight: 700; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 600; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tbody tr:hover { background: var(--surface-2); }
.art { display: flex; align-items: center; gap: 10px; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink-3); padding: 34px 18px; text-align: center; }
.empty.small { padding: 22px 10px; }
.empty.wide { grid-column: 1 / -1; }

/* Billing */
.bill-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.bill-pick { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.prod { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .12s, transform .12s; min-width: 0; }
.prod:hover:not(:disabled) { border-color: var(--pine); transform: translateY(-1px); }
.prod:disabled { opacity: .5; cursor: not-allowed; }
.shoe-tile { display: grid; place-items: center; background: var(--tile); border-radius: 8px; height: 76px; flex: none; }
.shoe-tile.sm { width: 48px; height: 38px; border-radius: 6px; }
.prod .shoe-tile { margin-bottom: 6px; }
.prod-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.prod-sub { font-size: 12.5px; color: var(--ink-3); }
.prod-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 5px; }
.prod-foot b { font-size: 16px; font-family: var(--display); }
.prod-foot small { color: var(--ink-3); }
.prod-foot small.lowtxt { color: var(--warn); font-weight: 700; }
.bill-cart { position: sticky; top: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 92px); overflow-y: auto; }
.cart-head { display: flex; justify-content: space-between; align-items: center; }
.cart-lines { display: flex; flex-direction: column; gap: 8px; }
.line { padding: 9px 10px; border-radius: 8px; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.line-top { display: flex; justify-content: space-between; align-items: flex-start; }
.line-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.line-name small { color: var(--ink-3); }
.line-top .icon-btn { width: 30px; height: 30px; }
.line-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); }
.stepper button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 17px; font-weight: 700; color: var(--pine-text); }
.stepper b { min-width: 24px; text-align: center; }
.rate { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-3); }
.rate input { width: 78px; min-height: 32px; padding: 3px 7px; }
.cart-form { display: flex; flex-direction: column; gap: 10px; }
.totals, .inv-sum { display: flex; flex-direction: column; gap: 3px; }
.totals > div, .inv-sum > div { display: flex; justify-content: space-between; }
.grand { font-weight: 700; font-size: 20px; font-family: var(--display); padding-top: 6px; margin-top: 3px; border-top: 1px dashed var(--line-2); }
.sheet-scrim, .bill-bar { display: none; }
.pick-head { display: flex; gap: 13px; align-items: center; margin-bottom: 14px; }
.pick-head .shoe-tile { width: 88px; height: 64px; }
.pick-head > div:last-child { display: flex; flex-direction: column; line-height: 1.35; }
.price { font-family: var(--display); font-size: 20px; }
.size-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.size-btn { display: flex; flex-direction: column; align-items: center; padding: 9px 4px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); cursor: pointer; }
.size-btn b { font-size: 20px; font-family: var(--display); line-height: 1.15; }
.size-btn small { color: var(--ink-3); }
.size-btn:hover:not(:disabled) { border-color: var(--pine); background: var(--pine-soft); }
.size-btn:disabled { opacity: .4; cursor: not-allowed; background: var(--r0); }

/* Invoice */
.invoice { position: relative; max-width: 390px; margin: 0 auto; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 6px; padding: 16px; font-size: 13.5px; display: flex; flex-direction: column; gap: 10px; }
.inv-head { text-align: center; }
.inv-head h2 { font-size: 21px; }
.inv-head p { font-size: 12px; color: var(--ink-2); }
.inv-meta { display: flex; flex-direction: column; font-size: 12.5px; padding-block: 7px; border-block: 1px dashed var(--line-2); }
.inv-items { width: 100%; border-collapse: collapse; }
.inv-items th { text-align: left; font-size: 11.5px; color: var(--ink-3); padding-bottom: 4px; }
.inv-items td { padding: 4px 0; vertical-align: top; }
.inv-items .r, .print-st .r { text-align: right; }
.inv-items th + th, .inv-items td + td { padding-left: 7px; }
.inv-items small { display: block; color: var(--ink-3); font-size: 11px; }
.inv-sum { border-top: 1px dashed var(--line-2); padding-top: 7px; margin-top: 2px; }
.inv-foot { text-align: center; font-size: 12px; color: var(--ink-2); }
.void { position: absolute; inset: 40% 0 auto; text-align: center; font-family: var(--display); font-size: 36px; color: var(--bad); transform: rotate(-12deg); opacity: .8; }

/* Purchase */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.summary { position: sticky; top: 76px; }
.summary dl { margin: 0; display: flex; flex-direction: column; gap: 5px; }
.summary dl > div { display: flex; justify-content: space-between; align-items: baseline; }
.summary dt { color: var(--ink-2); }
.summary dd { margin: 0; font-weight: 700; }
.summary .big dd { font-family: var(--display); font-size: 25px; }
.calc { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; padding: 11px 14px; border-radius: 8px; background: var(--pine-soft); min-height: 60px; }
.calc-step { display: flex; flex-direction: column; line-height: 1.25; }
.calc-step small { color: var(--ink-2); font-size: 12px; }
.calc-step b { font-size: 17px; }
.calc-step.hl { background: var(--pine); color: var(--on-pine); padding: 4px 12px; border-radius: 7px; }
.calc-step.hl small { color: var(--on-pine); opacity: .85; }
.calc-op { color: var(--pine-text); font-weight: 700; }
.size-entry { display: flex; flex-wrap: wrap; gap: 8px; }
.size-in { display: flex; flex-direction: column; width: 64px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.size-in span { text-align: center; font-size: 12.5px; font-weight: 700; background: var(--surface-2); padding: 3px 0; border-bottom: 1px solid var(--line); }
.size-in input { border: 0; border-radius: 0; text-align: center; min-height: 38px; padding: 4px; }
.add-row { display: flex; gap: 9px; flex-wrap: wrap; }
.suggest-wrap { position: relative; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; margin-top: 3px; }
.suggest button { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 8px 12px; background: none; border: 0; cursor: pointer; line-height: 1.3; }
.suggest button:hover { background: var(--pine-soft); }
.suggest small { color: var(--ink-3); }

/* Statements */
.st-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.st-head h3 { font-family: var(--display); font-size: 19px; }
.st-actions { display: flex; gap: 7px; flex-wrap: wrap; }
#sOut { display: flex; flex-direction: column; }
#sOut .stats { margin-bottom: 14px; }

/* Setup and Help */
.setup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.pct { display: inline-flex; align-items: center; gap: 5px; }
.pct input { width: 72px; min-height: 36px; text-align: right; }
.tour-hero { flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.tour-hero h3 { font-family: var(--display); font-size: 21px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 10px; }
.help-card { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); }
.help-card:hover { border-color: var(--pine); }
.help-card > .ic { color: var(--pine-text); }
.help-card span { display: flex; flex-direction: column; flex: 1; line-height: 1.3; min-width: 0; }
.help-card small { color: var(--ink-3); }
.help-card em { font-style: normal; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.faq { gap: 0; padding-block: 4px; }
.faq details { padding: 11px 0; border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin-top: 6px; color: var(--ink-2); max-width: 75ch; }

/* Modal and toast */
#modal-root { position: relative; z-index: 80; }
.scrim { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); width: min(500px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.modal.sm { width: min(410px, 100%); } .modal.lg { width: min(720px, 100%); } .modal.inv { width: min(470px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px 11px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.more-list { display: flex; flex-direction: column; }
.more-list a, .more-list button { display: flex; align-items: center; gap: 13px; padding: 12px 6px; border: 0; border-top: 1px solid var(--line); background: none; font-weight: 600; font-size: 15.5px; text-align: left; cursor: pointer; }
.more-list a:first-child { border-top: 0; }
.welcome-shoe { display: grid; place-items: center; width: 136px; height: 88px; border-radius: 12px; background: var(--tile); }
.welcome-h { font-family: var(--display); font-size: 21px; }
#toast-root { position: fixed; z-index: 120; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 9px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); font-weight: 500; }
.toast.bad .ic { color: var(--bad); }
.toast.good .ic { color: var(--pine); }

/* Tour */
#tour-root { position: fixed; inset: 0; z-index: 100; }
.tour-block { position: fixed; inset: 0; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 200vmax var(--scrim); transition: left .22s ease, top .22s ease, width .22s ease, height .22s ease; pointer-events: none; }
.tour-spot.none { width: 0 !important; height: 0 !important; left: 50% !important; top: 50% !important; box-shadow: 0 0 0 200vmax var(--scrim); }
.tour-card { position: fixed; width: min(372px, calc(100vw - 24px)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 8px; transition: left .22s ease, top .22s ease; }
.tour-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tour-count { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tour-lang { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; flex: none; }
.tour-lang button { border: 0; background: none; padding: 3px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; min-height: 28px; }
.tour-lang button.on { background: var(--pine); color: var(--on-pine); }
.tour-bar { height: 4px; background: var(--r0); border-radius: 2px; overflow: hidden; }
.tour-bar i { display: block; height: 100%; background: var(--gold); transition: width .22s; }
.tour-card h3 { font-family: var(--display); font-size: 19px; line-height: 1.25; }
.tour-card p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.tour-acts { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.tour-skip { background: none; border: 0; color: var(--ink-3); font-size: 13px; cursor: pointer; padding: 4px 0; }
.tour-skip:hover { color: var(--ink); text-decoration: underline; }

#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; background: #fff; }
  .invoice { background: #fff; border: 0; max-width: 76mm; padding: 0; color: #000; }
  .print-st { font-size: 11px; color: #000; }
  .print-st h2 { font-size: 18px; } .print-st h3 { font-size: 14px; }
  .print-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0; }
  .print-st table { width: 100%; border-collapse: collapse; }
  .print-st th, .print-st td { border-bottom: 1px solid #bbb; padding: 3px 5px; text-align: left; }
  .print-st .r { text-align: right; }
  @page { margin: 9mm; }
}

@media (max-width: 1120px) {
  .grid-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-home .span2:first-child { grid-column: 1 / -1; }
  .grid-home .span2:last-child { grid-column: 1 / -1; }
  .bill-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
}

@media (max-width: 860px) {
  .only-m { display: inline-flex !important; }
  .no-m { display: none !important; }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 35; background: var(--bg); }
  .side { display: none; }
  .app-main { margin-left: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .top { padding-block: 9px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 7px; }
  .top h1 { font-size: 20px; }
  .top-brand .logo { width: 34px; height: 34px; background: var(--side); border-radius: 8px; }
  .tour-btn span { display: none; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px 22px; }
  input:not([type=checkbox]), select { font-size: 16px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 3px; }
  #toast-root { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--side); padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); }
  .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 0; color: var(--side-ink); font-size: 11.5px; font-weight: 600; padding: 5px 0; border-radius: 8px; cursor: pointer; }
  .bottom-nav a.active { background: var(--gold); color: var(--on-gold); }
  .quick { grid-template-columns: 1fr 1fr; }
  .quick-a.main { grid-column: 1 / -1; }
  .quick-a { padding: 12px; }
  .grid-home, .setup { grid-template-columns: minmax(0, 1fr); }
  .grid-home .span2 { grid-column: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat strong { font-size: 21px; }
  .stat { padding: 11px 12px; }

  .bill-layout { grid-template-columns: minmax(0, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 60px; }
  .bill-cart { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 88dvh; border-radius: 16px 16px 0 0; border: 0; padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); transform: translateY(105%); transition: transform .24s ease; visibility: hidden; }
  .bill-cart.open { transform: none; visibility: visible; }
  .sheet-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 65; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sheet-scrim.open { opacity: 1; pointer-events: auto; }
  .bill-bar { display: flex; align-items: center; gap: 10px; position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 45; padding: 12px 15px; border: 0; border-radius: 10px; background: var(--gold); color: var(--on-gold); font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
  .bill-bar b { font-family: var(--display); font-size: 17px; }
  .bar-go { margin-left: auto; font-weight: 700; }

  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody { display: block; }
  .tbl.cards tr { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { display: flex; justify-content: space-between; align-items: center; gap: 14px; border: 0; padding: 0; text-align: right; }
  .tbl.cards td::before { content: attr(data-l); color: var(--ink-3); font-size: 13px; flex: none; }
  .tbl.cards td.main { order: -1; justify-content: flex-start; text-align: left; font-weight: 700; margin-bottom: 2px; }
  .tbl.cards td.main::before, .tbl.cards td[data-l=""]::before { display: none; }
  .tbl.cards td[data-l=""] { justify-content: flex-end; margin-top: 4px; }
  .tour-hero .btn { width: 100%; }
  .toolbar > select { flex: 1 1 100%; }
  .toolbar .chips { width: 100%; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); gap: 18px; }
  .login-art h1 { font-size: 27px; }
  .login-art p { font-size: 15.5px; }
  .login-run { display: none; }
  .login { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
