.pos-content { height: calc(100vh - 56px); }
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 430px; height: 100%; }
.pos-left { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; min-height: 0; }
.pos-search { font-size: 18px; min-height: 48px; }
.pos-products { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; align-content: start; }
.tile { display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 12px 13px; text-align: left; background: var(--surface); border: 1px solid var(--graphite-200); border-radius: var(--radius); cursor: pointer; }
.tile:hover:not(:disabled) { border-color: var(--blue); }
.tile:disabled { opacity: 0.5; cursor: not-allowed; }
.tile-title { font-weight: 600; }
.tile-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tile-price { font-weight: 700; font-variant-numeric: tabular-nums; }

.ticket { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--graphite-200); }
.ticket-head { padding: 14px 18px; border-bottom: 1px solid var(--graphite-200); }
.ticket-lines { flex: 1; overflow-y: auto; }
.ticket-line { padding: 12px 18px; border-bottom: 1px solid var(--graphite-100); display: flex; flex-direction: column; gap: 8px; }
.ticket-line-title { font-weight: 600; }
.line-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.discount-box { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; padding: 10px; background: var(--blue-soft); border-radius: var(--radius); }
.discount-box .input { min-height: 34px; padding: 5px 8px; }
.ticket-foot { padding: 14px 18px; border-top: 1px solid var(--graphite-200); display: flex; flex-direction: column; gap: 10px; }
.sum { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sum.total { font-size: 25px; font-weight: 750; }
.sum.discount { color: var(--blue); }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods .btn.selected { background: var(--graphite-900); border-color: var(--graphite-900); color: #fff; }

.receipt { font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", monospace; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.receipt-center { text-align: center; }
.receipt-line { display: flex; justify-content: space-between; gap: 12px; }
.receipt hr { border: 0; border-top: 1px dashed var(--graphite-300); width: 100%; margin: 2px 0; }
.receipt .strong { font-weight: 700; font-size: 16px; }

.pos-bar, .pos-back { display: none; }

@media (max-width: 860px) {
  .pos-content { height: auto; }
  .pos { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pos-left { padding: 12px; gap: 10px; }
  .pos-search { font-size: 16px; }
  .pos-products { overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 76px; }
  .tile { min-height: 110px; padding: 11px; }
  .tile-foot { flex-direction: column; gap: 2px; }
  .pos[data-view="products"] .ticket { display: none; }
  .pos[data-view="ticket"] .pos-left { display: none; }
  .pos-bar { display: flex; justify-content: space-between; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15; box-shadow: var(--shadow); font-size: 16px; }
  .pos-back { display: inline-flex; }
  .ticket { border-left: 0; min-height: calc(100dvh - 110px); }
  .ticket-head { padding: 10px 14px; }
  .ticket-line { padding: 12px 14px; }
  .discount-box { grid-template-columns: 84px minmax(0, 1fr); }
  .ticket-foot { position: sticky; bottom: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -6px 18px rgb(30 35 41 / 8%); }
  .sum.total { font-size: 22px; }
}

@media print {
  body > #app, #toasts { display: none; }
  dialog { position: static; width: 100%; max-height: none; box-shadow: none; }
  dialog::backdrop { display: none; }
  .dialog-head, .dialog-actions { display: none; }
}
