@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Chakra Petch";
  src: url("../fonts/ChakraPetch-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #121410;
  --panel: #1b1f1c;
  --panel-2: #232823;
  --line: #323832;
  --key: #2a302c;
  --key-hi: #3a423c;
  --cream: #f3efe6;
  --cream-2: #e7e1d4;
  --ticket: #f3efe6;
  --ticket-ink: #1c1915;
  --muted: #9aa398;
  --paper-muted: #6b675e;
  --fascia: #16382b;
  --fascia-2: #0f2a20;
  --moss: #1f5a42;
  --amber: #f5c400;
  --amber-dim: #c9a000;
  --warn: #e8a04a;
  --bad: #c45b4a;
  --max: 1240px;
  --sans: "Chakra Petch", "Bai Jamjuree", "Sarabun", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--cream);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; height: auto; display: block; }
button, input { font: inherit; }
a { color: var(--amber); text-underline-offset: 3px; }
a:hover { color: #ffe26a; }
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* Fascia — shop awning, not a SaaS nav */
.fascia {
  background: var(--fascia);
  border-bottom: 6px solid var(--amber);
  color: var(--cream);
}
.fascia-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px 28px;
  align-items: end;
}
.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--cream);
  text-decoration: none;
  align-self: center;
}
.brand:hover { color: var(--amber); }
.shop-name {
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.shop-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: #c7d4cc;
  margin-top: 4px;
  letter-spacing: 0.04em;
}
.nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4px;
}
.nav a {
  color: var(--cream);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid transparent;
}
.nav a:hover { border-bottom-color: var(--amber); color: var(--amber); }

.intro {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 18px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px 48px;
  align-items: end;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.lede {
  margin: 0;
  color: #d5d8ce;
  font-size: 16px;
  max-width: 48ch;
}

.pos-section { max-width: var(--max); margin: 0 auto; padding: 4px 20px 40px; }
.pos-head { margin-bottom: 8px; }
.pos-head h2, .gets h2, .media-copy h2, .shots-head h2, .excel-copy h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}
.pos-head p, .media-copy p, .shots-head p, .excel-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 62ch;
}

.terminal {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  background: var(--panel);
  border: 1px solid var(--line);
  min-height: 600px;
}
.terminal.flash-bad { box-shadow: inset 0 0 0 2px var(--bad); }

/* Thermal ticket */
.ticket {
  background: var(--ticket);
  color: var(--ticket-ink);
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.ticket-serration {
  height: 10px;
  background:
    radial-gradient(circle at 8px 10px, var(--panel) 6px, transparent 7px) -8px 0 / 16px 10px;
  flex: none;
}
.ticket-top {
  padding: 6px 16px 10px;
  text-align: center;
  border-bottom: 1px dashed #c4beb0;
}
.ticket-shop { font-weight: 700; font-size: 18px; }
.ticket-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-muted);
  margin-top: 2px;
}
.ticket-cols {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--paper-muted);
  border-bottom: 1px dashed #c4beb0;
}
.ticket-lines {
  flex: 1;
  overflow: auto;
  padding: 8px 16px 4px;
  min-height: 140px;
}
.ticket-empty {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-muted);
  text-align: center;
  padding: 36px 8px;
}
.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 7px 0;
  border-bottom: 1px dotted #d4cfc3;
  font-size: 14px;
}
.line-name { font-weight: 500; }
.line-meta {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--paper-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.line-amt { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.qty-ctrl { display: inline-flex; gap: 4px; align-items: center; }
.qty-ctrl button {
  width: 22px;
  height: 22px;
  border: 1px solid #c4beb0;
  background: #fff;
  color: var(--ticket-ink);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.qty-ctrl button:hover { background: var(--cream-2); }

.ticket-tot {
  border-top: 2px solid var(--ticket-ink);
  padding: 10px 16px 8px;
  background: #efe9dc;
}
.tot-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 1px 0;
}
.tot-row.muted { color: var(--paper-muted); }
.tot-grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
  font-weight: 700;
}
.tot-num {
  font-family: var(--mono);
  font-size: 36px;
  line-height: 1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: #111;
}

.pay { padding: 10px 16px 16px; background: #efe9dc; }
.pay-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pay-btn, .pay-confirm, .enter-btn, .dl {
  border: 0;
  cursor: pointer;
  background: var(--fascia);
  color: var(--cream);
  font-weight: 600;
  padding: 10px 8px;
  text-align: center;
  text-decoration: none;
}
.pay-btn:hover, .enter-btn:hover, .pay-confirm:hover, .dl:hover { background: var(--moss); color: #fff; }
.pay-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pay-btn.ghost { background: transparent; color: var(--ticket-ink); border: 1px solid #b9b3a6; }
.pay-btn.ghost:hover { background: #e0d9cb; color: var(--ticket-ink); }
.cash-box { margin-top: 10px; display: grid; gap: 6px; }
.cash-box[hidden], .paid-box[hidden] { display: none !important; }
.cash-label { font-size: 12px; font-weight: 600; }
.tendered {
  width: 100%;
  border: 1px solid #b9b3a6;
  background: #fff;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.change-line {
  font-family: var(--mono);
  font-size: 14px;
}
.change-line strong { font-size: 22px; font-weight: 700; }
.quick-cash { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-cash button {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid #b9b3a6;
  background: #fff;
  padding: 5px 8px;
  cursor: pointer;
}
.quick-cash button:hover { background: var(--cream-2); }
.pay-confirm { width: 100%; margin-top: 2px; }
.paid-box {
  margin-top: 10px;
  border: 1px dashed var(--fascia);
  padding: 10px;
  text-align: center;
  background: #e4eee6;
}
.paid-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  margin-top: 4px;
}
.paid-box button {
  margin-top: 8px;
  background: var(--fascia);
  color: var(--cream);
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

/* Register board */
.board {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 14px 16px;
  background:
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.entry-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.entry-row { display: flex; gap: 8px; margin-top: 4px; }
.code-input {
  flex: 1;
  min-width: 0;
  background: #0d100e;
  color: var(--amber);
  border: 1px solid #3d463e;
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.code-input::placeholder { color: #4a5348; letter-spacing: 0.12em; }
.enter-btn { padding: 0 18px; font-size: 16px; flex: none; }
.entry-msg {
  min-height: 1.3em;
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--warn);
}
.entry-msg.ok { color: #8fca9a; }

.board-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.pad button {
  height: 52px;
  background: var(--key);
  color: var(--cream);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 1px;
}
.pad button:hover { background: var(--key-hi); }
.pad button:active { transform: translateY(1px); }
.pad .k-clear { color: #e8a8a0; }
.pad .k-enter { background: var(--fascia); color: var(--cream); border-color: #1f5a42; }

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.cats button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.cats button[aria-selected="true"], .cats button:hover {
  background: var(--amber);
  color: #1a1500;
  border-color: var(--amber);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  align-content: start;
}
.tile {
  background: #141815;
  border: 1px solid var(--line);
  color: var(--cream);
  text-align: left;
  padding: 8px 8px 7px;
  cursor: pointer;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tile:hover { border-color: var(--amber); }
.tile:disabled { opacity: 0.4; cursor: not-allowed; }
.tile-code {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--amber);
}
.tile-name {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
}
.tile-meta {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.tile.low .tile-meta { color: var(--warn); }

/* What the shop gets — not a card grid */
.gets { max-width: var(--max); margin: 0 auto; padding: 8px 20px 56px; }
.gets-list { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line); }
.gets-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.gets-list .n {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  padding-top: 4px;
}
.gets-list h3 { margin: 0 0 4px; font-size: 18px; font-weight: 600; }
.gets-list p { margin: 0; color: #c5c9bf; font-size: 15px; max-width: 70ch; }

/* Video in a bezel, not a soft card */
.media-sec { max-width: var(--max); margin: 0 auto; padding: 0 20px 56px; }
.media-copy { margin-bottom: 14px; }
.monitor {
  margin: 0;
  background: #0a0c0b;
  border: 10px solid #2a2e2b;
  box-shadow: 0 0 0 1px #111, 0 18px 0 #0a0c0b;
  position: relative;
}
.monitor video { width: 100%; aspect-ratio: 16 / 10; background: #000; object-fit: contain; }

/* Filmstrip, not a 2x3 card grid */
.shots { padding: 0 0 56px; }
.shots-head { max-width: var(--max); margin: 0 auto 14px; padding: 0 20px; }
.film {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 20px 16px;
  scroll-snap-type: x mandatory;
  max-width: var(--max);
  margin: 0 auto;
}
.frame {
  margin: 0;
  flex: 0 0 min(72vw, 520px);
  scroll-snap-align: start;
  cursor: pointer;
}
.frame img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: top;
  border: 1px solid var(--line);
  background: #fff;
}
.frame figcaption {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
}
.frame figcaption span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
}

/* Excel */
.excel { max-width: var(--max); margin: 0 auto; padding: 0 20px 64px; }
.excel-copy { margin-bottom: 14px; }
.sheet-wrap {
  background: #e8e4da;
  color: #1c1915;
  border: 1px solid #c9c3b6;
}
.formula-bar {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  background: #dcd6ca;
  border-bottom: 1px solid #c9c3b6;
  font-family: var(--mono);
  font-size: 13px;
}
.cell-ref { font-weight: 700; }
.cell-fx { color: #1a3d2c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-hint { color: #6b675e; font-size: 11px; }
.sheet-scroll { overflow: auto; max-height: 420px; background: #fff; }
.sheet {
  border-collapse: collapse;
  font-size: 12px;
  min-width: 980px;
  width: 100%;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.sheet th, .sheet td {
  border: 1px solid #d5d0c6;
  padding: 5px 7px;
  text-align: left;
  white-space: nowrap;
}
.sheet th {
  background: #16382b;
  color: #f3efe6;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sheet td.num { text-align: right; }
.sheet td.fx {
  background: #eef6ef;
  cursor: pointer;
}
.sheet tr:hover td { background: #f6f1e4; }
.sheet tr:hover td.fx { background: #dff0e1; }
.sheet td.fx.active { outline: 2px solid var(--fascia); outline-offset: -2px; }

.downloads { list-style: none; margin: 16px 0 0; padding: 0; }
.downloads li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.downloads strong { display: block; font-size: 16px; font-weight: 600; }
.downloads span {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.dl { padding: 10px 16px; font-size: 14px; }

.foot {
  border-top: 1px solid var(--line);
  padding: 28px 20px 40px;
  background: #0d100e;
}
.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.foot p { margin: 10px 0 0; color: #b5bbb0; font-size: 14px; }
.foot a { color: var(--amber); }
.disclaimer { font-size: 13px !important; color: #8b9288 !important; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 9, 0.94);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: min(1200px, 96vw); max-height: 82vh; object-fit: contain; background: #fff; }
.lightbox p { margin: 10px 0 0; color: var(--cream); }
.lb-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 980px) {
  .fascia-inner, .intro, .foot-inner, .board-grid, .terminal {
    grid-template-columns: 1fr;
  }
  .nav { justify-content: flex-start; }
  .shop-name { font-size: 22px; }
  .terminal { min-height: 0; }
  .ticket { min-height: 420px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .pad button { height: 52px; }
  .code-input { font-size: 32px; }
  .tot-num { font-size: 30px; }
  .frame img { height: 200px; }
}
@media (max-width: 640px) {
  .fascia { border-bottom-width: 4px; }
  .fascia-inner { padding: 10px 16px 8px; }
  .intro { padding: 14px 16px 8px; }
  h1 { font-size: 30px; }
  .lede { font-size: 14px; }
  .pos-head p { display: none; }
  .pos-section { padding: 4px 16px 36px; }
  .ticket { min-height: 0; }
  .ticket-lines { min-height: 72px; }
  .ticket-empty { padding: 16px 8px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .pay-btns { grid-template-columns: 1fr 1fr; }
  .pay-btns .ghost { grid-column: 1 / -1; }
  .formula-bar { grid-template-columns: 40px 1fr; }
  .cell-hint { display: none; }
  .downloads li { grid-template-columns: 1fr; }
  .dl { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pad button:active { transform: none; }
}
