/* Alaka POS — follows DESIGN.md: ink / paper / orange only, Inter Tight, square, flat, no greys. */
:root {
  --ink: #111111;
  --paper: #ffffff;
  --orange: #ff5b14;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.4 'Inter Tight', Arial, sans-serif;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 480px; margin: 64px auto; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
code { font: 500 14px/1.4 ui-monospace, Menlo, Consolas, monospace; }
ul.checks { list-style: none; padding: 0; margin: 0 0 24px; }
ul.checks li { padding: 4px 0; border-bottom: 1px solid var(--ink); }

h1 { font-size: 32px; line-height: 1.05; font-weight: 800; letter-spacing: -0.02em; margin: 8px 0 24px; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 800; margin: 48px 0 16px; }
p { margin: 0 0 16px; max-width: 70ch; }
.meta { font-size: 14px; font-weight: 500; }
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 48px 0 0;
  font-size: 13px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 16px; height: 16px; border-radius: 50%; background: var(--orange); flex: none; }

/* header */
.top { border-bottom: 4px solid var(--ink); background: var(--paper); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 12px; padding-bottom: 12px; }
.logo img { display: block; width: 120px; height: auto; }
/* phone: slim top bar + fixed bottom tab bar */
.top-in { flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.logo { display: block; padding: 4px 0; }
.logo img { width: auto; height: auto; max-width: 150px; max-height: 56px; }
.acct { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 2px solid var(--ink); border-radius: 50%; color: var(--ink); text-decoration: none; }
.acct:hover, .acct:focus-visible { background: var(--ink); color: var(--paper); }
.acct.on { background: var(--orange); border-color: var(--ink); color: var(--ink); }
.acct .nm { position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%); padding: 6px 10px; background: var(--ink); color: var(--paper); font-size: 14px; font-weight: 700; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; opacity: 0; pointer-events: none; }
.acct:hover .nm, .acct:focus-visible .nm { opacity: 1; }
.logo-prev { margin: 16px 0; padding: 24px; border: 1px solid var(--ink); display: inline-block; }
.logo-prev img { display: block; max-width: 240px; max-height: 80px; }
nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
nav a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 4px; font-size: 14px; font-weight: 700; text-decoration: none; text-align: center; border-top: 4px solid var(--ink); }
nav a.on { border-top-color: var(--orange); }
nav a.x { display: none; }
button.link { background: none; border: 0; padding: 12px 8px; min-height: 44px; font: 700 14px 'Inter Tight', Arial, sans-serif; color: var(--ink); text-decoration: underline; cursor: pointer; }
.back { display: inline-block; margin-top: 24px; padding: 8px 0; font-weight: 700; text-decoration: none; }
.back:hover { text-decoration: underline; }
.back + .eyebrow { margin-top: 8px; }
.actions.dash .btn:first-child { flex: 1 1 100%; }
.actions.dash .btn { flex: 1 1 calc(50% - 6px); }
input[type=file] { height: auto; padding: 12px; font: 400 16px 'Inter Tight', Arial, sans-serif; }
input[type=file]::file-selector-button { margin-right: 12px; padding: 10px 16px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); font: 700 14px 'Inter Tight', Arial, sans-serif; cursor: pointer; }
.foot a { color: var(--ink); }
main { padding-bottom: 120px; min-height: 60vh; }
.foot { padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--ink); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  border: 2px solid var(--orange); background: var(--orange); color: var(--ink);
  font: 700 16px 'Inter Tight', Arial, sans-serif; text-decoration: none; cursor: pointer; border-radius: 0;
  transition: transform 150ms var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn.sec { background: var(--paper); border-color: var(--ink); }
.btn:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; align-items: center; }
.actions form { margin: 0; }
form.inline { display: inline; margin-left: 16px; }

/* forms */
label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 16px; }
label > input, label > select { margin-top: 4px; font-weight: 400; }
input, select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); font: 400 16px 'Inter Tight', Arial, sans-serif;
}
input:focus, select:focus { border: 2px solid var(--orange); padding: 0 11px; outline: 3px solid var(--ink); outline-offset: 2px; }
.chk { display: flex; gap: 12px; align-items: center; font-weight: 400; font-size: 16px; }
.chk input { width: 24px; min-height: 24px; height: 24px; flex: none; accent-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
.stack { display: block; }
.form { max-width: 640px; }
.card { border-top: 4px solid var(--ink); padding-top: 16px; margin-top: 32px; }
input.qty { width: 112px; text-align: right; margin-left: auto; }
.bar { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.bar input { flex: 1; min-width: 200px; }

/* messages */
.flash { margin: 24px 0; padding: 12px 16px; border: 1px solid var(--ink); font-weight: 500; }
.flash.err { border: 0; border-left: 8px solid var(--orange); background: var(--paper); box-shadow: none; outline: 1px solid var(--ink); font-weight: 700; }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 24px 0; }
.stat { border-top: 4px solid var(--ink); padding-top: 16px; }
.stat.hot { border-top-color: var(--orange); }
.stat b { display: block; white-space: nowrap; font-size: 28px; line-height: 1; font-weight: 800; letter-spacing: -0.03em; }
.stat span { display: block; margin-top: 8px; font-size: 14px; font-weight: 500; }

/* tables */
.scroll { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th { background: var(--ink); color: var(--paper); text-align: left; font-weight: 700; padding: 12px; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--ink); vertical-align: middle; }
th.n, td.n { text-align: right; }
tr.grp td { font-weight: 800; border-bottom: 4px solid var(--ink); padding-top: 24px; background: var(--paper); }
tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
tr.hide { display: none; }

/* recipe form */
fieldset { border: 0; border-top: 4px solid var(--ink); padding: 16px 0 0; margin: 24px 0; min-width: 0; }
legend { font-weight: 800; font-size: 20px; padding-right: 12px; }
.irow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.irow select { grid-column: 1 / -1; }
.qtywrap { display: flex; align-items: center; gap: 8px; }
.qtywrap input { min-width: 0; }
.u { min-width: 28px; font-size: 14px; font-weight: 700; }
.rc { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.irow .btn { min-height: 48px; padding: 0 16px; }

/* cost analysis */
ul.finds { list-style: none; padding: 0; margin: 0; border-top: 4px solid var(--ink); }
ul.finds li { padding: 16px 0; border-bottom: 1px solid var(--ink); max-width: 80ch; }
ul.finds .pill { margin-right: 8px; }
.meter { height: 8px; margin-top: 4px; border: 1px solid var(--ink); min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--ink); }
.meter .w0 { width: 0%; }
.meter .w2 { width: 2%; }
.meter .w5 { width: 5%; }
.meter .w10 { width: 10%; }
.meter .w15 { width: 15%; }
.meter .w20 { width: 20%; }
.meter .w25 { width: 25%; }
.meter .w30 { width: 30%; }
.meter .w35 { width: 35%; }
.meter .w40 { width: 40%; }
.meter .w45 { width: 45%; }
.meter .w50 { width: 50%; }
.meter .w55 { width: 55%; }
.meter .w60 { width: 60%; }
.meter .w65 { width: 65%; }
.meter .w70 { width: 70%; }
.meter .w75 { width: 75%; }
.meter .w80 { width: 80%; }
.meter .w85 { width: 85%; }
.meter .w90 { width: 90%; }
.meter .w95 { width: 95%; }
.meter .w100 { width: 100%; }

/* pills + rows */
.pill { display: inline-block; padding: 2px 12px; border: 2px solid var(--ink); border-radius: 999px; font-size: 13px; font-weight: 700; vertical-align: middle; }
.pill.hot { background: var(--orange); border-color: var(--orange); }
.pill.done { background: var(--paper); }
.rows { margin: 24px 0; border-top: 4px solid var(--ink); }
.row { display: grid; gap: 4px; padding: 24px 0; border-bottom: 1px solid var(--ink); text-decoration: none; }
.row b { font-size: 20px; font-weight: 800; }
.row:hover b { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--orange); }

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
  .two { grid-template-columns: 1fr 1fr; }
  .irow { grid-template-columns: 1fr 180px 120px 96px; }
  .irow select { grid-column: auto; }
  .top-in { gap: 24px 48px; padding-top: 24px; padding-bottom: 24px; }
  .logo img { max-width: 180px; max-height: 64px; }
  .actions.dash .btn, .actions.dash .btn:first-child { flex: 0 0 auto; }
  main { padding-bottom: 96px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 24px 32px; }
  h1 { font-size: 44px; }
  .stat b { font-size: 40px; }
  .row { grid-template-columns: 320px 1fr; align-items: baseline; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  .top, .foot, .actions, .bar { display: none; }
}

/* language switch: ID | EN */
form.lang { display: flex; align-items: center; gap: 4px; margin: 0; }
form.lang button.link { text-decoration: none; padding: 8px 6px; min-width: 32px; font-weight: 500; }
form.lang button.link.on { font-weight: 900; text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.langs { text-align: right; }
.top-in > form.lang { margin-left: auto; }
.who + form.lang { margin-left: 0; }
td.n { white-space: nowrap; }

/* v0.4.0 spacing pass: roomier tables, headings, filter bars, footer */
.top-in > form.lang { margin-right: -12px; }
@media (min-width: 980px) { .top-in > form.lang { margin-right: 0; margin-left: 0; } }
h2 { margin: 56px 0 20px; }
.eyebrow { margin-top: 56px; }
.scroll { margin: 24px 0; }
th { padding: 14px 16px; }
td { padding: 16px; line-height: 1.35; }
tr.grp td { padding: 20px 16px 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; border-bottom: 2px solid var(--ink); border-left: 4px solid var(--orange); }
.bar { gap: 16px; margin: 24px 0; align-items: center; }
.bar select { flex: 0 1 240px; }
.bar input[type=checkbox] { flex: none; min-width: 0; width: 24px; }
.actions { gap: 16px; margin: 28px 0; }
.stats { gap: 32px 24px; margin: 32px 0; }
.card { margin-top: 48px; padding-top: 24px; }
.card label { display: block; margin: 16px 0; }
.card .btn { margin-top: 8px; }
main { padding-bottom: 128px; }
.foot { padding-top: 40px; padding-bottom: 56px; line-height: 1.6; }
@media (max-width: 719px) { .bar select, .bar input { flex: 1 1 100%; min-width: 0; } .bar input[type=checkbox] { flex: none; } }

/* ---- v0.5/v0.6: welcome screen, weather chip, page transition, motion ---- */
html { scroll-behavior: smooth; }
@view-transition { navigation: auto; }
.top { view-transition-name: topbar; }
nav { view-transition-name: tabbar; }
::view-transition-old(root) { animation: .28s ease both vtOut; }
::view-transition-new(root) { animation: .42s ease both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
main > * { animation: rise .6s cubic-bezier(.25, .6, .25, 1) both; }
main > *:nth-child(2) { animation-delay: .05s; } main > *:nth-child(3) { animation-delay: .1s; } main > *:nth-child(4) { animation-delay: .15s; }
main > *:nth-child(n+5) { animation-delay: .2s; }
.stats .stat, .rows .row, .widgets > * { animation: rise .7s cubic-bezier(.25, .6, .25, 1) both; }
.stats .stat:nth-child(2), .rows .row:nth-child(2) { animation-delay: .08s; } .stats .stat:nth-child(3), .rows .row:nth-child(3) { animation-delay: .16s; }
.stats .stat:nth-child(4), .rows .row:nth-child(4) { animation-delay: .24s; } .rows .row:nth-child(n+5) { animation-delay: .3s; }
.flash { animation: slideIn .5s ease both; transition: opacity .6s, transform .6s; }
.flash.gone { opacity: 0; transform: translateY(-6px); }
:focus-visible { outline-color: var(--orange); }

/* hover + press */
.btn, nav a, .acct, .stat, .row b, button.link, .pill { transition: transform .28s ease, background-color .28s ease, color .28s ease, border-color .28s ease; }
.btn:active { transform: translateY(1px); }
.btn.busy { pointer-events: none; opacity: .55; }
.btn.busy::after { content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
tbody tr { transition: background-color .3s ease; }
td a { text-decoration-color: var(--orange); text-decoration-thickness: 2px; }
.logo img { transition: transform .4s ease; }

/* weather chip */
.wx { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 15px; font-weight: 800; white-space: nowrap; cursor: default; color: var(--ink); }
.wx svg { transition: transform .4s ease; }

/* welcome screen: pure CSS, 3 s bar then fade out */
#intro { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--ink); animation: introOut .7s ease 3s forwards; }
.intro-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: introZoom 4s ease-out both; }
#intro::before { content: ''; position: absolute; inset: 0; background: var(--ink); opacity: .45; z-index: 1; }
.intro-bar i { display: block; height: 100%; width: 0; background: var(--orange); animation: introFill 3s cubic-bezier(.4, 0, .3, 1) forwards; }
@keyframes introFill { to { width: 100%; } }
@keyframes introOut { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes introZoom { from { transform: scale(1.08); } to { transform: scale(1); } }
#intro.skip { animation: introOut .25s ease forwards; }
.intro-prev { margin: 16px 0; border: 1px solid var(--ink); max-width: 480px; }
.intro-prev img { display: block; width: 100%; height: auto; }
@media print { #intro, .wx { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  #intro { animation: introOut .01ms 3s forwards !important; }
  .intro-bar i { animation: introFill 3s linear forwards !important; }
}


/* v0.5.1/v0.6.1: bare welcome screen (picture + bar only), steadier page changes, weather in widgets */
.intro-bar { position: relative; z-index: 2; width: min(360px, 70vw); height: 6px; background: rgba(255, 255, 255, .35); animation: rise .5s ease .1s both; }
.intro-bar i { box-shadow: none; }
.wxbig svg { width: 40px; height: 40px; vertical-align: -7px; margin-right: 4px; }
.wxstat b svg { width: 30px; height: 30px; vertical-align: -5px; margin-right: 2px; }
.wxstat b { white-space: nowrap; }
.wx { display: none; }
/* header and tab bar stay put while the page content changes */
::view-transition-group(topbar), ::view-transition-group(tabbar) { animation-duration: 0s; }
::view-transition-old(topbar), ::view-transition-old(tabbar) { display: none; }
::view-transition-new(topbar), ::view-transition-new(tabbar) { animation: none; }
@supports (view-transition-name: none) { main > * { animation: none; } }

@media (hover: hover) {
  .btn:hover { transform: translateY(-1px); text-decoration: none; }
  .btn:not(.sec):hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .btn.sec:hover { background: var(--ink); color: var(--paper); }
  nav a:hover { color: var(--ink); }
  .stat:hover { border-top-color: var(--orange); }
  .row:hover b { transform: translateX(4px); }
  .row:hover { background: none; }
  tbody tr:not(.grp):hover td:first-child { box-shadow: inset 4px 0 0 var(--orange); }
  tbody tr:not(.grp):hover { background: #FFF1EA; }
  td a:hover { text-decoration-thickness: 3px; }
  .logo:hover img { transform: scale(1.02); }
  .acct:hover { transform: scale(1.03); }
  .wx:hover svg { transform: rotate(-12deg) scale(1.12); color: var(--orange); }
}
.btn:active { transform: translateY(1px); }

a, button { -webkit-tap-highlight-color: transparent; }

/* small tablets use the phone layout (bottom tab bar) until the top menu fits */
@media (min-width: 720px) and (max-width: 979px) { main { padding-bottom: 128px; } }
@media (min-width: 980px) {
  nav { position: static; flex: 1; display: flex; gap: 4px; border: 0; padding: 0; background: none; }
  nav a { display: block; min-height: 0; padding: 12px 12px 8px; margin: 0; border-top: 0; border-bottom: 4px solid transparent; white-space: nowrap; }
  nav a:hover { border-bottom-color: var(--ink); }
  nav a.on { border-bottom-color: var(--orange); }
  nav a.x { display: block; }
  nav a.m { display: none; }
  nav { min-width: 0; }
}

/* ---- header v2 (HR 0.7 / Stok 0.6): sticky, thin rule, sliding marker, menu button below 980px ---- */
.top { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--ink); }
.top-in { flex-wrap: nowrap; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.logo img { max-width: 132px; max-height: 44px; }
html { scroll-padding-top: 96px; }
main { padding-bottom: 64px; }
.foot { padding-bottom: 48px; }
nav { view-transition-name: none; }
nav a, nav a.on { border: 0; }
.mk { display: none; }
.menu-btn { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; }
.menu-btn path { transition: transform .35s ease, opacity .25s ease; transform-origin: 12px 12px; }
.top.open .menu-btn path.l1 { transform: translateY(5px) rotate(45deg); }
.top.open .menu-btn path.l2 { opacity: 0; }
.top.open .menu-btn path.l3 { transform: translateY(-5px) rotate(-45deg); }
.acct { width: 40px; height: 40px; border-width: 1px; }
@media (max-width: 979px) {
  .top-in > form.lang { margin-left: auto; margin-right: 0; }
  nav { position: absolute; top: 100%; left: 0; right: 0; bottom: auto; z-index: 49; display: block; padding: 8px 0 16px; background: var(--paper); border-bottom: 1px solid var(--ink);
        max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; visibility: hidden; opacity: 0; transform: translateY(-4px);
        transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
  .top.open nav { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .3s ease; }
  nav a, nav a.x { display: block; min-height: 0; padding: 14px 16px; border-left: 3px solid transparent; font-size: 17px; text-align: left; }
  nav a.on { border-left: 3px solid var(--orange); }
  nav a.m { display: none; }
}
@media (min-width: 720px) and (max-width: 979px) { nav a, nav a.x { padding-left: 32px; padding-right: 32px; } }
@media (min-width: 980px) {
  .menu-btn { display: none; }
  .top-in { gap: 24px; padding-top: 16px; padding-bottom: 16px; }
  .logo img { max-width: 150px; max-height: 52px; }
  nav { position: static; flex: 1; display: flex; gap: 0; padding: 0; background: none; border: 0; visibility: visible; opacity: 1; transform: none; }
  nav a, nav a.x { position: relative; display: block; padding: 10px 12px; border: 0; white-space: nowrap; }
  nav a.m { display: none; }
  nav a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .35s ease; }
  nav a.on::after { display: none; }
  .mk { display: block; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; background: var(--orange); view-transition-name: navmark; }
  .top-in > form.lang { margin-left: 0; }
}
@media (min-width: 980px) and (hover: hover) { nav a:hover::after { transform: scaleX(1); } }
::view-transition-group(navmark) { animation-duration: .5s; animation-timing-function: cubic-bezier(.35, 0, .2, 1); }
@media print { .menu-btn { display: none; } }

main { min-height: calc(100vh - 240px); }

/* ---- in-place navigation (no header reload): sliding marker, content fade, loading line ---- */
main > * { animation: rise .6s cubic-bezier(.25, .6, .25, 1) both; }
main { transition: opacity .3s ease; }
main.out { opacity: 0; transition: opacity .16s ease; }
html.loading .top::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--orange); transform-origin: left; animation: loadline 1.2s cubic-bezier(.3, .6, .3, 1) both; }
@keyframes loadline { from { transform: scaleX(0); } to { transform: scaleX(.85); } }
html.loading, html.loading a, html.loading button { cursor: progress; }
nav .ind { display: none; }
h1:focus { outline: none; }
@media (min-width: 980px) {
  nav { position: relative; }
  nav.js .mk { display: none; }
  nav .ind { display: block; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--orange); opacity: 0; pointer-events: none;
             transition: transform .55s cubic-bezier(.35, 0, .2, 1), width .55s cubic-bezier(.35, 0, .2, 1), opacity .3s ease; }
  nav .ind.no-anim { transition: none; }
}
@media (prefers-reduced-motion: reduce) { main.out { opacity: 1; } html.loading .top::after { animation: none; transform: scaleX(.85); } }
/* dim the page behind the phone/tablet menu */
.top.open nav { box-shadow: 0 0 0 100vmax rgba(17, 17, 17, .28); clip-path: inset(0 0 -100vmax 0); }
/* UI pass: footer rule lines up with the content column */
.foot { border-top: 0; padding-top: 48px; }
.foot > .meta { display: block; padding-top: 28px; border-top: 1px solid var(--ink); }

/* ---- POS: sell screen, dialogs, receipt ---- */
.pos-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 16px; }
.pos-bar .btn { min-height: 40px; padding: 6px 16px; }
.pos-main { display: grid; gap: 24px; align-items: start; }
.pos-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; }
.pos-cat { flex: none; font: 700 14px/1 'Inter Tight', Arial, sans-serif; padding: 12px 16px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; cursor: pointer; }
.pos-cat.on { background: var(--ink); color: var(--paper); }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 92px; text-align: left; padding: 12px; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; font: 400 14px/1.25 'Inter Tight', Arial, sans-serif; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.tile b { font-weight: 800; font-size: 15px; }
.tile span { font-weight: 500; font-variant-numeric: tabular-nums; }
.tile:active { background: var(--orange); border-color: var(--orange); }
.pos-cart { border-top: 4px solid var(--ink); padding-top: 16px; }
.seg { display: flex; margin-bottom: 16px; }
.seg button { flex: 1; padding: 12px 8px; font: 700 14px/1.1 'Inter Tight', Arial, sans-serif; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; margin-left: -2px; cursor: pointer; }
.seg button:first-child { margin-left: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }
.lines { min-height: 64px; }
.cl { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--ink); }
.ci { min-width: 0; }
.ci b, .ci small, .ci span { display: block; overflow-wrap: anywhere; }
.ci small { font-weight: 500; }
.ci span { font-variant-numeric: tabular-nums; font-size: 14px; }
.cc { display: flex; align-items: center; gap: 8px; flex: none; }
.cc b { min-width: 24px; text-align: center; }
.qb { width: 40px; height: 40px; padding: 0; font: 800 20px/1 'Inter Tight', Arial, sans-serif; background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; cursor: pointer; }
.qb:active { background: var(--orange); border-color: var(--orange); }
.disc { display: flex; gap: 8px; margin: 16px 0; }
.disc select { flex: 1; } .disc input { flex: 1; min-width: 0; }
.sums { display: grid; gap: 4px; margin-bottom: 16px; }
.sums span { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sums .tot { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.pos-fab { display: none; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.quick .btn { min-height: 40px; padding: 6px 14px; }
dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; background: var(--paper); color: var(--ink); border: 4px solid var(--ink); border-radius: 0; box-shadow: none; }
dialog::backdrop { background: rgba(17, 17, 17, .6); }
dialog h2 { margin-top: 0; }
dialog fieldset { margin: 0 0 16px; }
@media (min-width: 720px) {
  .pos-main { grid-template-columns: minmax(0, 1fr) 340px; }
  .pos-cart { position: sticky; top: 96px; }
}
@media (max-width: 719px) {
  .pos-fab { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--paper); border-top: 4px solid var(--ink); }
  .pos-fab button.link { font-weight: 500; text-align: left; padding: 0; text-decoration: none; } .pos-fab b { font-size: 22px; font-weight: 800; margin: 0 8px; } .pos-fab small { font-size: 14px; font-weight: 500; }
  .pos-fab .btn { min-height: 48px; }
  .pos-cart .actions .btn:first-child { display: none; }
  #pos { padding-bottom: 88px; }
}
.receipt-view { max-width: 320px; border: 2px solid var(--ink); padding: 16px; margin: 16px 0; }
.rcpt { display: none; }
.rcpt-in { font: 400 12px/1.35 'Courier New', monospace; color: #000; }
.rcpt-in p { margin: 0 0 6px; white-space: pre-line; }
.rcpt-in .c { text-align: center; }
.rcpt-in .r { display: flex; justify-content: space-between; gap: 8px; }
.rcpt-in hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt-view .rcpt-in { font-size: 13px; }
@media print {
  body * { visibility: hidden; }
  .rcpt, .rcpt * { visibility: visible; }
  .rcpt { display: block; position: absolute; left: 0; top: 0; width: 58mm; }
  #intro { display: none; }
}
@page { margin: 2mm; }
.pos-main > *, .pos-menu { min-width: 0; }
.pos-bar .btn b { margin-left: 6px; }
