/* Narrow.TV POS (kassa). Tablet first (landscape and portrait), also desktop. */

:root {
  --navy: #052b46;
  --navy-2: #084262;
  --blue: #0e95d9;
  --blue-dark: #0877b2;
  --green: #16a34a;
  --green-dark: #11803a;
  --danger: #c62f3a;
  --danger-dark: #a3222c;
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #14202b;
  --muted: #5f6b7a;
  --line: #d6dde5;
  --soft: #e8f6fd;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(5, 43, 70, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 60px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.35 var(--font);
  -webkit-user-select: none;
  user-select: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.25rem;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.pad {
  padding: 1rem 1.25rem;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 52px;
  padding: 0 1.3em;
  border: 2px solid transparent;
  border-radius: 12px;
  font-weight: 800;
  text-align: center;
}

.btn:disabled {
  opacity: .45;
  cursor: default;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
}

.btn-primary:active:not(:disabled) {
  background: var(--blue-dark);
}

.btn-pay {
  background: var(--green);
  color: #fff;
}

.btn-pay:active:not(:disabled) {
  background: var(--green-dark);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:active:not(:disabled) {
  background: var(--danger-dark);
}

.btn-ghost {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.btn-ghost:active:not(:disabled) {
  background: var(--bg);
}

.btn-small {
  min-height: 48px;
  padding: 0 1em;
  font-size: .95rem;
}

.btn-big {
  min-height: 64px;
  font-size: 1.15rem;
}

.btn-wide {
  width: 100%;
}

.icon-button {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.icon-small {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.button-row .btn {
  flex: 1 1 10em;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0 .4em;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: .85rem;
}

/* Header */

.top-bar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 .75rem 0 1rem;
  background: var(--navy);
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--blue);
  font-weight: 900;
  font-size: 1.2rem;
}

.brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.brand-text span {
  overflow: hidden;
  color: #b8d3e6;
  font-size: .9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: .75rem;
}

.staff-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: var(--navy-2);
}

.staff-name {
  max-width: 12em;
  overflow: hidden;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chip-button {
  min-height: 44px;
  padding: 0 .9em;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
}

.net-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: #b8d3e6;
  font-size: .9rem;
}

.net-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .25);
}

.net-status.is-offline {
  color: #fecaca;
  font-weight: 800;
}

.net-status.is-offline .net-dot {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .3);
}

.clock {
  min-width: 3.2em;
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.menu-button {
  width: 52px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 1.5rem;
}

/* Screens */

.app {
  position: relative;
  flex: 1;
  min-height: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  overflow: auto;
}

.screen.is-active {
  display: flex;
}

.center-card {
  display: grid;
  gap: 1rem;
  width: min(460px, calc(100% - 2rem));
  margin: auto;
  padding: 2rem;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.center-card p {
  margin: 0;
}

.spinner {
  justify-self: center;
  width: 44px;
  height: 44px;
  border: 4px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.spinner-small {
  width: 22px;
  height: 22px;
  border-width: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Pairing */

.code-input {
  width: 100%;
  min-height: 72px;
  border: 2px solid var(--line);
  border-radius: 14px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: .4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -webkit-user-select: text;
  user-select: text;
}

.code-input:focus {
  border-color: var(--blue);
  outline: none;
}

.lang-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
}

.lang-button {
  min-height: 44px;
  padding: 0 .8em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: .9rem;
}

.lang-button.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

/* Staff login */

.staff-wrap {
  width: 100%;
  margin: auto;
  padding: 2rem 1.5rem;
}

.staff-pick {
  display: grid;
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 200px));
  justify-content: center;
  gap: 1rem;
}

.staff-tile {
  display: grid;
  justify-items: center;
  gap: .5rem;
  min-height: 150px;
  padding: 1.2rem .8rem;
  border: 0;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.staff-tile:active {
  transform: scale(.98);
}

.avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--navy-2);
  color: #fff;
  font-weight: 900;
  font-size: 1.4rem;
}

.staff-tile-name {
  font-weight: 800;
  font-size: 1.1rem;
}

.role-tag {
  padding: .1em .6em;
  border-radius: 999px;
  background: var(--soft);
  color: var(--blue-dark);
  font-size: .8rem;
  font-weight: 800;
}

.grid-message {
  display: grid;
  grid-column: 1 / -1;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.pin-card {
  display: grid;
  justify-items: center;
  gap: 1rem;
  width: min(380px, 100%);
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.pin-card > .btn {
  justify-self: start;
}

.pin-dots {
  display: flex;
  gap: .8rem;
  min-height: 24px;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border: 2px solid var(--navy-2);
  border-radius: 50%;
}

.pin-dot.is-optional {
  border-style: dashed;
  opacity: .6;
}

.pin-dot.is-filled {
  border-style: solid;
  background: var(--navy-2);
  opacity: 1;
}

.pin-dots.is-shaking {
  animation: shake .35s;
}

@keyframes shake {
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Keypads (PIN and amounts) */

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  width: 100%;
}

.key {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 1.45rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.key:active {
  background: var(--soft);
}

.key-ok {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.numpad {
  display: grid;
  gap: .5rem;
}

.numpad-display {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .35rem .35rem 1rem;
  border: 2px solid var(--blue);
  border-radius: 12px;
  background: var(--soft);
}

.numpad-display output {
  flex: 1;
  font-size: 2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.key-clear {
  width: 56px;
  min-height: 52px;
  font-size: 1.1rem;
}

.float-card {
  width: min(420px, calc(100% - 2rem));
}

/* Sell screen */

.screen-sell {
  display: none;
  overflow: hidden;
}

.screen-sell.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 36%, 440px);
}

.catalog-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.catalog-tools {
  padding: .75rem .75rem 0;
}

.search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 1.05rem;
  -webkit-user-select: text;
  user-select: text;
}

.search-input:focus {
  border-color: var(--blue);
  outline: none;
}

.category-bar {
  display: flex;
  flex-shrink: 0;
  gap: .5rem;
  padding: .75rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-bar button {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 1.2em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-weight: 800;
}

.category-bar button.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.product-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: min-content;
  align-content: start;
  gap: .6rem;
  padding: 0 .75rem .75rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .4rem;
  min-width: 0;
  min-height: 104px;
  padding: .7rem;
  border: 1px solid transparent;
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
}

.tile:active:not(:disabled) {
  transform: scale(.97);
  background: var(--soft);
}

.tile.has-image {
  border-left-width: 1px;
  border-left-color: transparent;
}

.tile-image {
  display: block;
  margin: -.3rem -.3rem 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: var(--soft);
}

.tile-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-name {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 800;
  line-height: 1.2;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.tile-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .2rem .5rem;
}

.tile-price {
  color: var(--navy-2);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tile-stock {
  color: var(--muted);
  font-size: .78rem;
}

.tile-flag {
  color: var(--danger);
  font-weight: 800;
  font-size: .8rem;
}

.tile.is-sold-out {
  border-left-color: var(--line);
  opacity: .55;
  cursor: not-allowed;
}

/* Cart */

.cart-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .75rem .75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.cart-lines {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.cart-empty {
  margin: 0;
  padding: 2rem 1.25rem;
  color: var(--muted);
  text-align: center;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .6rem .75rem .6rem 1rem;
  border-bottom: 1px solid var(--line);
}

.cart-line.is-flash {
  animation: flash 1s ease-out;
}

@keyframes flash {
  from { background: #d9f2e3; }
  to { background: transparent; }
}

.line-main {
  min-width: 0;
}

.line-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.line-options {
  color: var(--muted);
  font-size: .88rem;
}

.line-unit {
  color: var(--muted);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}

.line-side {
  display: grid;
  flex-shrink: 0;
  justify-items: end;
  gap: .3rem;
}

.line-total {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.stepper button {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.stepper button:active {
  background: var(--soft);
}

.stepper strong {
  min-width: 1.8em;
  font-size: 1.1rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stepper-small button {
  width: 44px;
  height: 44px;
}

.stepper .line-remove {
  margin-left: .2rem;
  border-color: transparent;
  color: var(--danger);
}

.cart-foot {
  display: grid;
  gap: .4rem;
  padding: .75rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 .25rem;
  font-size: 1.2rem;
  font-weight: 800;
}

.cart-total strong {
  font-size: 1.9rem;
  font-variant-numeric: tabular-nums;
}

.cart-vat {
  min-height: 1.2em;
  padding: 0 .25rem;
  color: var(--muted);
  font-size: .85rem;
}

.cart-buttons {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .5rem;
}

.cart-buttons .btn-pay {
  min-height: 68px;
  font-size: 1.3rem;
}

/* Dialogs */

.modal {
  width: min(560px, calc(100vw - 1.5rem));
  max-width: none;
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(5, 43, 70, .35);
  overflow: auto;
}

.modal:focus {
  outline: none;
}

.modal::backdrop {
  background: rgba(5, 25, 40, .55);
}

.modal-pay,
.modal-detail,
.modal-refund {
  width: min(920px, calc(100vw - 1.5rem));
}

.modal-list {
  width: min(680px, calc(100vw - 1.5rem));
}

.modal-narrow,
.modal-menu {
  width: min(440px, calc(100vw - 1.5rem));
}

.modal-confirm {
  width: min(440px, calc(100vw - 1.5rem));
  padding: 1.5rem;
}

.confirm-text {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem .75rem .75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

/* Options dialog */

.options-form {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.options-body {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.option-group {
  margin: 0;
  padding: 0;
  border: 0;
}

.option-group legend {
  margin-bottom: .5rem;
  font-weight: 900;
}

.option-group legend small {
  margin-left: .4em;
  color: var(--muted);
  font-weight: 600;
}

.option-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .5rem;
}

.option {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 56px;
  padding: .4rem .8rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.option:has(input:checked) {
  border-color: var(--blue);
  background: var(--soft);
}

.option input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--blue);
}

.option-name {
  flex: 1;
  font-weight: 700;
}

.option small {
  color: var(--muted);
  white-space: nowrap;
}

.option.is-sold-out {
  opacity: .5;
}

.options-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.options-foot .btn {
  flex: 1;
}

/* Payment */

.pay-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

.pay-layout.is-summary-only {
  grid-template-columns: minmax(0, 1fr);
}

.pay-summary {
  display: grid;
  align-content: start;
  gap: .75rem;
}

.sum-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 800;
}

.sum-row strong {
  font-variant-numeric: tabular-nums;
}

.sum-total {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--navy);
  color: #fff;
  font-size: 1.1rem;
}

.sum-total strong {
  font-size: 2.2rem;
}

.sum-remaining {
  padding: .8rem 1.1rem;
  border: 2px solid var(--green);
  border-radius: 14px;
  color: var(--green-dark);
  font-size: 1.05rem;
}

.sum-remaining strong {
  font-size: 1.7rem;
}

.pay-rows {
  display: grid;
  gap: .4rem;
}

.pay-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .6rem;
  min-height: 48px;
  padding: .2rem .4rem .2rem .9rem;
  border-radius: 12px;
  background: var(--bg);
}

.pay-method {
  font-weight: 800;
}

.pay-detail {
  color: var(--muted);
  font-size: .85rem;
}

.pay-status {
  display: grid;
  gap: .5rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--soft);
}

.pay-status:not(.is-error) {
  grid-auto-flow: column;
  justify-content: start;
  align-items: center;
  font-weight: 800;
}

.pay-status.is-error {
  border: 2px solid var(--danger);
  background: #fdecee;
}

.pay-status.is-error strong {
  color: var(--danger);
  font-size: 1.1rem;
}

.pay-status p {
  margin: 0;
}

.pay-entry {
  display: grid;
  align-content: start;
  gap: .6rem;
}

.method-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .3rem;
  padding: .3rem;
  border-radius: 14px;
  background: var(--bg);
}

.method-tabs button {
  min-height: 52px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 800;
}

.method-tabs button.is-active {
  background: var(--panel);
  color: var(--navy);
  box-shadow: var(--shadow);
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: .4rem;
}

.quick {
  display: grid;
  place-content: center;
  min-height: 56px;
  padding: .2rem;
  border: 2px solid var(--green);
  border-radius: 12px;
  background: #effaf3;
  color: var(--green-dark);
  font-weight: 900;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.quick small {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quick:active {
  background: #d9f2e3;
}

.change-preview {
  min-height: 1.3em;
  margin: 0;
  color: var(--green-dark);
  font-weight: 900;
  text-align: right;
}

.card-text {
  margin: 0;
  padding: 1rem;
  border-radius: 12px;
  background: var(--soft);
  font-weight: 700;
}

.success {
  display: grid;
  justify-items: center;
  gap: .5rem;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 2.4rem;
  font-weight: 900;
}

.success p {
  margin: 0;
}

.change-label {
  margin-top: .5rem !important;
  font-size: 1.2rem;
  font-weight: 800;
}

.change-amount {
  color: var(--green-dark);
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.success .button-row {
  width: 100%;
  margin-top: 1rem;
}

/* Lists (open orders, transactions) */

.list {
  display: grid;
}

.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
  padding: .6rem 1.25rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  text-align: left;
}

.list-row:active {
  background: var(--soft);
}

.order-number {
  display: grid;
  place-items: center;
  min-width: 3.2em;
  height: 48px;
  padding: 0 .5em;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.list-main,
.list-side {
  display: grid;
  min-width: 0;
}

.list-title {
  font-weight: 800;
}

.list-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: .88rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.list-side {
  justify-items: end;
  font-variant-numeric: tabular-nums;
}

.list-side small {
  color: var(--muted);
}

.is-negative {
  color: var(--danger);
}

.source-tag {
  display: inline-block;
  margin-right: .3em;
  padding: .05em .5em;
  border-radius: 6px;
  background: var(--soft);
  color: var(--blue-dark);
  font-size: .8rem;
  font-weight: 900;
}

/* Menu */

.menu-list {
  display: grid;
  gap: .5rem;
  padding: 1rem 1.25rem 1.25rem;
}

.menu-who {
  margin: 0 0 .25rem;
  color: var(--muted);
  font-weight: 700;
}

.menu-item {
  min-height: 56px;
  padding: 0 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-weight: 800;
  text-align: left;
}

.menu-item:active,
.menu-item.is-active {
  border-color: var(--blue);
  background: var(--soft);
}

.menu-item.is-danger {
  margin-top: .5rem;
  color: var(--danger);
}

/* Transaction detail, reports */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 260px);
  gap: 1.25rem;
  padding: 1.25rem;
}

.detail-actions {
  display: grid;
  align-content: start;
  gap: .6rem;
}

.paper {
  justify-self: center;
  width: 100%;
  max-width: 380px;
  padding: 1rem 1.1rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: var(--shadow);
  color: #000;
  font: 14px/1.4 "Courier New", ui-monospace, Menlo, monospace;
}

/* Refund */

.refund {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
}

.refund-lines {
  display: grid;
  align-content: start;
  gap: .5rem;
}

.refund-lines > .btn {
  justify-self: start;
}

.refund-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .5rem .5rem .5rem .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.refund-side,
.cash-move {
  display: grid;
  align-content: start;
  gap: .75rem;
}

.cash-move {
  padding: 1.25rem;
}

.cash-move p {
  margin: 0;
}

.field {
  display: grid;
  gap: .3rem;
}

.field-label {
  margin: 0;
  font-weight: 800;
}

.text-input {
  width: 100%;
  min-height: 52px;
  padding: 0 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  -webkit-user-select: text;
  user-select: text;
}

.text-input:focus {
  border-color: var(--blue);
  outline: none;
}

/* Toasts */

.toasts {
  position: fixed;
  inset: calc(var(--header-h) + .75rem) auto auto 50%;
  z-index: 50;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  display: grid;
  justify-items: center;
  gap: .5rem;
  width: min(560px, calc(100vw - 2rem));
  transform: translateX(-50%);
  pointer-events: none;
}

.toasts:empty {
  display: none;
}

.toast {
  padding: .8rem 1.2rem;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(5, 43, 70, .3);
  transition: opacity .3s, transform .3s;
}

.toast-error {
  background: var(--danger);
}

.toast-success {
  background: var(--green);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

/* Receipt layout: on-screen preview (.paper) and print (.print-area) */

.rc-row {
  display: flex;
  justify-content: space-between;
  gap: .8em;
}

.rc-row span:last-child {
  flex-shrink: 0;
  text-align: right;
}

.rc-center {
  text-align: center;
}

.rc-strong {
  font-weight: 700;
}

.rc-big {
  font-size: 1.2em;
}

.rc-sub {
  padding-left: 1.2em;
  font-size: .92em;
}

.rc-indent {
  padding-left: 1.2em;
}

.rc-total {
  font-size: 1.25em;
  font-weight: 700;
}

.rc-rule {
  margin: .45em 0;
  border-top: 1px dashed #000;
}

.rc-vat {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1.2fr 1.3fr;
  gap: .3em;
  font-size: .92em;
}

.rc-vat span:not(:first-child) {
  text-align: right;
}

.rc-vat-head {
  font-weight: 700;
}

.rc-note {
  margin-top: .4em;
  font-style: italic;
}

.rc-footer {
  white-space: pre-line;
}

.rc-thanks {
  margin-top: .5em;
  font-size: 1.15em;
}

.print-area {
  display: none;
}

/* Portrait tablets and narrow windows: products on top, receipt below */

@media (max-width: 900px), (orientation: portrait) and (max-width: 1100px) {
  .screen-sell.is-active {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(300px, 44%);
  }

  .cart-pane {
    border-top: 2px solid var(--line);
    border-left: 0;
  }

  .cart-line {
    align-items: center;
  }

  .line-side {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .line-side .line-total {
    order: 2;
    min-width: 5.5em;
    text-align: right;
  }

  .pay-layout,
  .detail,
  .refund {
    grid-template-columns: minmax(0, 1fr);
  }

  .staff-name {
    max-width: 8em;
  }
}

@media (max-width: 640px) {
  .net-status span:last-child,
  .brand-text span {
    display: none;
  }

  .chip-button {
    padding: 0 .6em;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .key {
    min-height: 50px;
  }

  .sum-total strong {
    font-size: 1.8rem;
  }
}

/* Printing: only the receipt, 80 mm thermal paper (72 mm printable) */

@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }

  html,
  body {
    display: block;
    height: auto;
    overflow: visible;
    background: #fff;
  }

  body > *:not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block;
    width: 72mm;
    margin: 0 auto;
    padding: 3mm 0 6mm;
    background: #fff;
    color: #000;
    font: 11.5px/1.35 "Courier New", ui-monospace, Menlo, monospace;
  }

  .print-area * {
    color: #000 !important;
    background: transparent !important;
  }
}
