/* Cashier readability for 1280 x 1024 and 1440 x 900 terminals.
   Also used by Owner/Back Office on checkout; other manager screens are unchanged.
   Screen-only: no changes to receipt printing. */
.sale-note-details { margin: 10px 0; }
.sale-note-details summary { color: #4a6255; cursor: pointer; font-size: 12px; }
.sale-note-details label { margin: 8px 0; }
#received-label[hidden] { display: none; }
.change-line, .change-line strong { color: #c00000; }
.screen-reader-title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
#module-actions { display: contents; }
#module-actions:empty { display: none; }
.checkout-warning { margin: 0 0 6px; padding: 5px 7px; background: #fff4dc; color: #78511e; border-radius: 5px; font-size: 12px; line-height: 1.35; }
.checkout-warning:empty { display: none; }

@media screen and (min-width: 1120px) and (max-width: 1499px) {
  .cashier-workspace { font-size: 14px; }
  .cashier-workspace .topbar { height: 36px; padding: 0 12px; }
  .cashier-workspace .header-actions { gap: 8px; }
  .cashier-workspace .header-actions button { font-size: 11px; min-height: 28px; padding: 4px 8px; }
  .cashier-workspace .connection { font-size: 12px; }
  .cashier-workspace .user-strip { padding: 8px 16px; font-size: 12px; }
  .cashier-workspace .sidebar { width: 172px; padding: 10px 7px; }
  .cashier-workspace .sidebar nav button {
    flex: 0 0 auto; min-height: 42px; padding: 10px 8px; font-size: 13px; gap: 7px;
  }
  .cashier-workspace:not([data-role="CASHIER"]) .sidebar nav { gap: 1px; }
  .cashier-workspace:not([data-role="CASHIER"]) .sidebar nav button {
    min-height: 26px; padding: 4px 8px; font-size: 12px;
  }
  .cashier-workspace main { padding: 14px 16px; }
  .cashier-workspace[data-screen="pos"] main {
    display: flex; flex-direction: column; overflow: hidden;
  }
  .cashier-workspace[data-screen="pos"] #screen {
    display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; margin: 0;
  }
  .cashier-workspace .pending-bar { flex-shrink: 0; margin-bottom: 10px; font-size: 12px; }
  .cashier-workspace .screen-heading { margin-bottom: 12px; flex-shrink: 0; }
  .cashier-workspace .screen-heading h1 { font-size: 25px; }
  .cashier-workspace .screen-heading p { font-size: 12px; }
  .cashier-workspace .heading-actions button { font-size: 13px; min-height: 40px; }
  .cashier-workspace .shift-tag { font-size: 12px; }
  .cashier-workspace .pos-grid {
    flex: 1; min-height: 0; height: auto;
    grid-template-columns: 230px minmax(0, 1fr) 300px; gap: 10px;
  }
  .cashier-workspace .pos-grid > * { min-width: 0; }
  .cashier-workspace .favorites { padding: 14px 10px; }
  .cashier-workspace .panel-label { font-size: 12px; letter-spacing: 1px; padding-bottom: 12px; }
  .cashier-workspace .panel-label > span { display: none; }
  .cashier-workspace .favorite-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .cashier-workspace .favorite-grid button {
    min-height: 84px; padding: 7px 5px; font-size: 12px; line-height: 1.3; gap: 5px;
    overflow-wrap: anywhere;
  }
  .cashier-workspace .favorite-grid strong { font-size: 13px; }
  .cashier-workspace .product-search { margin: 12px; min-height: 44px; }
  .cashier-workspace .product-search input { min-width: 0; font-size: 14px; }
  .cashier-workspace .key-hint { display: none; }
  .cashier-workspace .product-results button { min-height: 44px; font-size: 13px; }
  .cashier-workspace .product-results button > strong { font-size: 13px; }
  .cashier-workspace .product-results small { font-size: 11px; }
  .cashier-workspace .cart-heading { padding: 9px 12px; font-size: 12px; }
  .cashier-workspace .cart-heading button { min-height: 32px; font-size: 12px; color: #61756d; }
  .cashier-workspace .cart-table table { table-layout: fixed; }
  .cashier-workspace .cart-table th { padding: 10px 7px; font-size: 11px; letter-spacing: 0; }
  .cashier-workspace .cart-table td { padding: 6px 7px; font-size: 14px; }
  .cashier-workspace .cart-table td strong { font-size: 14px; }
  .cashier-workspace .cart-table th:first-child { width: 38%; }
  .cashier-workspace .cart-table th:nth-child(2) { width: 18%; }
  .cashier-workspace .cart-table th:nth-child(3),
  .cashier-workspace .cart-table th:nth-child(4) { width: 18%; }
  .cashier-workspace .cart-table th:last-child { width: 8%; }
  .cashier-workspace .cart-table td:first-child { width: auto; overflow-wrap: anywhere; }
  .cashier-workspace .cart-table td:nth-child(3),
  .cashier-workspace .cart-table td:nth-child(4) { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .cashier-workspace .cart-table td small { font-size: 11px; }
  .cashier-workspace .qty-input { width: 100%; min-width: 0; min-height: 34px; font-size: 14px; }
  .cashier-workspace .discount-button { min-height: 22px; font-size: 12px; }
  .cashier-workspace .remove { width: 100%; min-height: 34px; padding: 2px; font-size: 22px; color: #61756d; }
  .cashier-workspace .cart-bottom { padding: 12px; font-size: 12px; }
  .cashier-workspace .cart-bottom > span:last-child { display: none; }
  .cashier-workspace .cart-empty h2 { font-size: 20px; }
  .cashier-workspace .cart-empty p { font-size: 14px; }
  .cashier-workspace .checkout-panel {
    display: flex; flex-direction: column; overflow: hidden; padding: 14px;
  }
  .cashier-workspace .checkout-panel > .panel-label { flex-shrink: 0; margin-bottom: 6px; }
  .cashier-workspace .checkout-fields {
    flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-right: 4px;
  }
  .cashier-workspace .checkout-panel label { font-size: 13px; margin: 8px 0; }
  .cashier-workspace .checkout-panel input,
  .cashier-workspace .checkout-panel select { font-size: 14px; min-height: 38px; padding: 8px; }
  .cashier-workspace .cost-label { font-size: 11px; }
  .cashier-workspace .amount-due { padding: 8px 0; }
  .cashier-workspace .amount-due > span { font-size: 11px; margin-bottom: 5px; }
  .cashier-workspace .amount-due > strong { font-size: 42px; }
  .cashier-workspace .total-line { padding: 4px 0; font-size: 13px; }
  .cashier-workspace .payment-title { font-size: 11px; margin-top: 10px; }
  .cashier-workspace .payment-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
  .cashier-workspace .payment-inputs > * { min-width: 0; }
  .cashier-workspace #payment-fields:has(+ #received-label[hidden]) { grid-column: 1 / -1; }
  .cashier-workspace .payment-inputs:has(.employee-payment-fields) { grid-template-columns: 1fr; gap: 0; }
  .cashier-workspace .employee-payment-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cashier-workspace .payment-inputs label { margin: 8px 0 0; }
  .cashier-workspace .payment-inputs input { font-size: 13px; }
  .cashier-workspace .allocation { gap: 6px; padding: 10px 0; }
  .cashier-workspace .allocation span { font-size: 10px; }
  .cashier-workspace .allocation strong { font-size: 13px; }
  .cashier-workspace .change-line { margin: 8px 0; font-size: 13px; }
  .cashier-workspace .change-line strong { font-size: 26px; }
  .cashier-workspace .sale-note-details { margin: 6px 0; }
  .cashier-workspace .sale-note-details summary { font-size: 13px; min-height: 24px; }
  .cashier-workspace .checkout-actions {
    flex-shrink: 0; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; background: white;
  }
  .cashier-workspace .complete { min-height: 46px; font-size: 14px; margin-top: 0; padding: 12px; }
  .cashier-workspace .checkout-panel .secondary { min-height: 40px; font-size: 12px; padding: 10px 6px; }
  .cashier-workspace .text-button { min-height: 30px; margin-top: 4px; font-size: 12px; }
  .cashier-workspace .local-save-note { margin-top: 4px; font-size: 10px; }
}

/* A 900-pixel monitor has less usable height with browser toolbars visible.
   Keep payment entry and completion on screen without shrinking input text. */
@media screen and (min-width: 1120px) and (max-width: 1499px) and (max-height: 820px) {
  .cashier-workspace .topbar { height: 36px; }
  .cashier-workspace .user-strip { padding-top: 5px; padding-bottom: 5px; }
  .cashier-workspace main { padding-top: 10px; padding-bottom: 10px; }
  .cashier-workspace .screen-heading { margin-bottom: 8px; }
  .cashier-workspace .screen-heading .eyebrow { display: none; }
  .cashier-workspace .screen-heading h1 { font-size: 23px; }
  .cashier-workspace .screen-heading p { margin-top: 4px; }
  .cashier-workspace .favorite-grid button { min-height: 78px; padding-top: 5px; padding-bottom: 5px; }
  .cashier-workspace .checkout-panel { padding: 10px 14px; }
  .cashier-workspace .checkout-panel > .panel-label { padding-bottom: 6px; margin-bottom: 4px; }
  .cashier-workspace .checkout-panel label { margin-top: 4px; margin-bottom: 4px; }
  .cashier-workspace .amount-due { padding: 2px 0; }
  .cashier-workspace .amount-due > span { margin-bottom: 3px; }
  .cashier-workspace .amount-due > strong { font-size: 36px; }
  .cashier-workspace .total-line { padding: 0; }
  .cashier-workspace .payment-title { margin-top: 4px; }
  .cashier-workspace .allocation { padding: 4px 0; }
  .cashier-workspace .allocation span { margin-bottom: 3px; }
  .cashier-workspace .change-line { margin: 2px 0; }
  .cashier-workspace .change-line strong { font-size: 22px; }
  .cashier-workspace .sale-note-details { margin: 2px 0; }
  .cashier-workspace .sale-note-details summary { min-height: 20px; }
  .cashier-workspace .checkout-actions { padding-top: 6px; margin-top: 6px; }
  .cashier-workspace .complete { min-height: 42px; padding: 10px 12px; }
  .cashier-workspace .checkout-panel .secondary { min-height: 36px; padding: 8px 6px; margin-top: 6px; }
  .cashier-workspace .text-button { min-height: 24px; margin-top: 2px; }
}

/* Compact shared headers across every module, not just cashier screens. */
@media screen {
  .workspace .topbar { height: 36px; padding: 0 12px; gap: 10px; }
  .workspace .topbar .brand { flex-shrink: 0; gap: 7px; font-size: 16px; }
  .workspace .topbar .brand img { width: 25px; height: 25px; }
  .workspace .topbar .header-actions { min-width: 0; gap: 6px; overflow-x: auto; white-space: nowrap; }
  .workspace .topbar .header-actions > * { flex-shrink: 0; }
  .workspace .topbar .header-actions button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
  .workspace .topbar .shift-tag { padding: 4px 9px; font-size: 11px; }
  .workspace .topbar .demo-tag { padding: 3px 6px; }
  .workspace .user-strip { padding-top: 4px; padding-bottom: 4px; }
}
/* Single-line cart items, including discount; the full name/SKU is in tooltip.
   These rules follow viewport styles so compact heights stay consistent. */
@media screen {
  .workspace .cart-product-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .workspace .cart-product-line > strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace .cart-product-line .discount-button { flex: 0 0 auto; margin: 0; padding: 2px 4px; min-height: 26px; font-size: 12px; color: #175a43; }
  .workspace .cart-table td { padding-top: 3px; padding-bottom: 3px; white-space: nowrap; }
  .workspace .cart-table .qty-input { min-height: 28px; height: 28px; padding: 3px; }
  .workspace .cart-table .remove { min-height: 28px; height: 28px; }
  .workspace .cart-table td:nth-child(3), .workspace .cart-table td:nth-child(4) { font-size: 12px; overflow-wrap: normal; }
  .workspace .cart-table td:nth-child(4) strong { font-size: 12px; }
  .workspace .favorite-grid button { min-height: 58px; gap: 0; padding-left: 2px; padding-right: 2px; overflow-wrap: normal; }
  .workspace .sale-note-details label { margin: 3px 0; }
  .workspace .change-line, .workspace .change-line strong { color: #c00000; }
  .stock-warnings-clear { color: #264b3e; background: #eef5f1; font-size: 12px; }
  #screen .module-note, #screen .master-help, #screen .conversion-note,
  #screen .business-footnote:not([data-pl-rate]):not([role=alert]):not([role=status]) { display: none; }
}
@media screen and (min-width:1120px) and (max-width:1499px) and (max-height:740px){
  .workspace.cashier-workspace .checkout-panel input,.workspace.cashier-workspace .checkout-panel select{min-height:32px;padding:6px}
  .workspace.cashier-workspace .checkout-panel label input,.workspace.cashier-workspace .checkout-panel label select{margin-top:3px}
  .workspace.cashier-workspace .payment-inputs label{margin-top:3px}
  .workspace.cashier-workspace .sale-note-details label{margin:2px 0}
}
/* Bottom warning strip: three persistent desktop warning types, not one long row. */
@media screen {
  .workspace { --pos-small-label-size: 10px; }
  .workspace .favorite-grid button, .workspace .allocation span { font-size: var(--pos-small-label-size); }
  .workspace .favorite-grid button { min-height: 28px; height: auto; padding: 5px 3px; line-height: 1.3; }
  #screen #pos-stock-warnings {
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0;
    flex: 0 0 auto; max-height: 116px; margin: 6px 0 0; padding: 0; overflow: hidden;
    background: var(--zen-bg,#f4f7f6); border-color: var(--line);
  }
  #screen #pos-stock-warnings > div {
    display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
    gap: 3px; padding: 6px 9px; min-width: 0; max-height: 114px;
    overflow-y: auto; scrollbar-width: thin;
  }
  #screen #pos-stock-warnings > div + div { border-left: 1px solid var(--line); }
  #screen #pos-stock-warnings strong { white-space: normal; flex-shrink: 0; }
  #screen #pos-stock-warnings .stock-warning-inactive { color: var(--zen-title,#496152); font-size: 10px; font-weight: normal; }
  #screen #pos-stock-warnings .stock-warning-inactive strong { animation: none; }
}
@media screen and (min-width:1120px) {
  .workspace.cashier-workspace[data-screen="pos"] main { display: flex; flex-direction: column; overflow: hidden; }
  .workspace.cashier-workspace[data-screen="pos"] #screen { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; margin: 0; }
  .workspace.cashier-workspace .pos-grid {
    flex: 1; height: auto; min-height: 0;
    grid-template-columns: clamp(280px,24vw,360px) minmax(0,1fr) 300px;
  }
  .workspace.cashier-workspace .cart-table th:first-child { width: 48%; }
  .workspace.cashier-workspace .cart-table th:nth-child(2) { width: 14%; }
  .workspace.cashier-workspace .cart-table th:nth-child(3),
  .workspace.cashier-workspace .cart-table th:nth-child(4) { width: 16%; }
  .workspace.cashier-workspace .cart-table th:last-child { width: 6%; }
  .workspace.cashier-workspace .cart-table th,
  .workspace.cashier-workspace .cart-table td { padding-left: 4px; padding-right: 4px; }
  .workspace.cashier-workspace .cart-table .qty-input { max-width: 56px; }
  .workspace.cashier-workspace .cart-table .remove { min-width: 20px; font-size: 18px; }
}
