/* Small-screen layout and drawer scroll isolation. */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar-foot {
  position: static;
  flex: 0 0 auto;
  margin-top: auto;
}

@media (max-width: 1050px) {
  html.sidebar-scroll-locked {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.sidebar-scroll-locked {
    position: fixed;
    inset-inline: 0;
    top: calc(-1px * var(--sidebar-scroll-y, 0));
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  #sidebar {
    height: 100vh;
    height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #planNavBackdrop {
    touch-action: none;
  }

  .topbar {
    height: 68px;
    min-height: 68px;
    padding-block: 0;
    flex-wrap: nowrap;
    row-gap: 0;
  }

  .topbar > .row {
    width: auto;
    min-width: 0;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar > .row #menuBtn { flex: 0 0 auto; }
  .topbar > .row .topbar-project-label { flex: 0 0 auto; }

  .topbar .page-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .top-actions {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .topbar .usage-meters {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: space-around;
  }

  .voice-subpage-header {
    position: relative;
    top: auto;
    grid-template-columns: minmax(64px, auto) minmax(0, 1fr) minmax(64px, auto);
    gap: 6px;
    padding-inline: 0;
  }

  .voice-subpage-header > .btn {
    min-width: 0;
    padding-inline: 6px;
    white-space: nowrap;
    font-size: 12px;
  }

  .voice-subpage-header h2 {
    min-width: 0;
    font-size: clamp(14px, 4vw, 18px);
    line-height: 1.35;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-inline: 8px;
  }

  .topbar .page-title {
    font-size: 13px;
  }

  .voice-subpage-header {
    grid-template-columns: minmax(54px, auto) minmax(0, 1fr) minmax(54px, auto);
    gap: 3px;
  }

  .voice-subpage-header > .btn {
    padding-inline: 4px;
    font-size: 11px;
  }
}
/* Product editor: keep delivery choices aligned with the app's standard controls. */
#modalCard .product-delivery-toggle{min-height:46px!important;padding:9px 13px!important;border-radius:11px!important;font-size:14px!important}
#modalCard .product-delivery-picker{padding:12px!important;border-radius:12px!important}
#modalCard .product-delivery-scopes{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
#modalCard label.product-delivery-scope{box-sizing:border-box;width:auto!important;min-width:0!important;min-height:42px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;padding:8px 10px!important;border-radius:10px!important;font-size:13px!important;line-height:1.25!important;white-space:nowrap!important}
#modalCard label.product-delivery-scope:last-child{grid-column:1/-1}
#modalCard label.product-delivery-scope:has(input:checked){border-color:#188b58!important;background:#e8f6ed!important;color:#12683f!important}
#modalCard .product-delivery-scope input[type=radio]{flex:0 0 17px!important;width:17px!important;height:17px!important;min-height:17px!important;margin:0!important;accent-color:#188b58!important}
#modalCard .delivery-product-platform-choices{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(132px,1fr))!important;gap:8px!important}
#modalCard label.delivery-product-platform-chip{box-sizing:border-box;min-width:0;min-height:42px;display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:8px 11px;border-radius:10px;background:#fff;font-size:13px;line-height:1.25;white-space:nowrap}
#modalCard label.delivery-product-platform-chip.selected{border-color:#71bb88!important;background:#e8f6ec!important;color:#216b3d!important;font-weight:700}
#modalCard .delivery-product-platform-chip input[type=checkbox]{flex:0 0 17px;width:17px;height:17px;min-height:17px;margin:0;accent-color:#188b58}
#modalCard .product-image-input-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:9px}
#modalCard .product-image-input-row input[type=file]{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#modalCard .product-image-input-row .btn{min-height:42px;padding:8px 14px;border-radius:10px;font-size:14px}
#modalCard .product-gallery-alt-fields{grid-template-columns:1fr 1fr!important;gap:5px!important}
#modalCard .product-gallery-alt-fields label{font-size:10px!important}
@media(max-width:560px){#modalCard .delivery-product-platform-choices{grid-template-columns:repeat(2,minmax(0,1fr))!important}#modalCard .product-delivery-scopes{grid-template-columns:1fr 1fr!important}#modalCard label.product-delivery-scope{font-size:12px!important;padding-inline:6px!important}}
.sales-statement-filters{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:12px;margin:16px 0;padding:16px}.sales-statement-filters label{display:grid;gap:6px;min-width:0;font-weight:650}.sales-statement-filters select,.sales-statement-filters input{width:100%;min-width:0;min-height:42px}.cashier-pos-mode [data-pos-product-picker]{display:block}.cashier-pos-mode .pos-invoice-top-actions [data-pos-quick-add]{white-space:nowrap}
