/* Tablet uses the existing shipment form and save actions. */
#tablet-nav-toggle, .tablet-toolbar { display: none; }
.tablet-product-column, .tablet-weight-column { display: contents; }
.mode-switch { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sidebar-mode-switch { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body.tablet-mode { font-size: 14px; }
body.tablet-mode .app { display: block; }
body.tablet-mode main { height: 100vh; height: 100dvh; }
body.tablet-mode .app > aside {
  display: none; position: fixed; top: 60px; bottom: 0; left: 0;
  width: 278px; height: calc(100vh - 60px); height: calc(100dvh - 60px);
  z-index: 35; padding: 12px; box-shadow: 10px 0 30px #10273633;
}
body.tablet-mode.tablet-nav-open .app > aside { display: flex; }
body.tablet-mode .app > aside .brand { padding-bottom: 12px; }
body.tablet-mode main > header {
  position: relative; z-index: 36; height: 60px; padding: 6px 12px;
  gap: 10px; background: white;
}
body.tablet-mode #tablet-nav-toggle:not([hidden]) {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-height: 44px; padding: 6px 12px; border: 1px solid #b9cdc7;
  border-radius: 8px; background: white; color: var(--navy); font-weight: 800;
}
body.tablet-mode .page-title-block { flex: 1; }
body.tablet-mode .page-title-block h1 { font-size: 17px; }
body.tablet-mode .page-title-block p,
body.tablet-mode main > header #today,
body.tablet-mode main > header .connection-state { display: none; }
body.tablet-mode .header-meta { gap: 10px; }
body.tablet-mode .store-mode-switch { display: grid; }
body.tablet-mode .mode-switch button { min-height: 42px; padding: 5px 10px; font-size: 13px; }
body.tablet-mode .content {
  max-width: none; height: calc(100vh - 60px); height: calc(100dvh - 60px);
  padding: 8px 12px; overflow: auto;
}
body.tablet-mode #shipment.active { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 8px; }
body.tablet-mode #shipment #shipment-edit-bar { grid-column: 1 / -1; grid-row: 1; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
body.tablet-mode #shipment-edit-bar .hybrid-ship-head { flex: 1.25 1 330px; min-width: 310px; margin: 0; }
body.tablet-mode #shipment-edit-bar #organization-selector { flex: .65 1 180px; min-width: 160px; max-width: 290px; }
body.tablet-mode #shipment-edit-bar #organization-selector label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
body.tablet-mode #shipment-edit-bar #organization-selector select { flex: 1; min-width: 0; max-width: 240px; min-height: 44px; }
body.tablet-mode #shipment-edit-bar #shipment-delivery-field { flex: 1.15 1 330px; min-width: 300px; margin: 0; }
body.tablet-mode #open-saved-shipments { flex: none; width: auto; white-space: nowrap; }
body.tablet-mode #shipment-edit-context { flex-basis: 100%; min-width: 0; }
body.tablet-mode #hybrid-shipment {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px 10px; flex: 1; min-height: 0;
}
body.tablet-mode .hybrid-ship-head { grid-column: 1 / span 5; grid-row: 1; margin: 0; }
body.tablet-mode .hybrid-date-picker { display: flex; align-items: center; gap: 8px; margin: 0; }
body.tablet-mode .hybrid-date-picker > strong { white-space: nowrap; font-size: 13px; }
body.tablet-mode .hybrid-date-options { display: flex; flex: 1; gap: 5px; }
body.tablet-mode .hybrid-date-choice { min-height: 44px; min-width: 0; flex: 1; padding: 3px 8px; border-radius: 8px; }
body.tablet-mode .hybrid-date-choice span { display: inline; font-size: 13px; }
body.tablet-mode .hybrid-date-choice small { display: block; margin: 0; font-size: 11px; }
body.tablet-mode #shipment .shipment-mobile-hide-note,
body.tablet-mode .hybrid-steps { display: none; }
body.tablet-mode #shipment-delivery-field {
  grid-column: 6 / span 7; grid-row: 1; margin: 0; padding: 3px 8px;
  display: flex; flex-wrap: nowrap; gap: 8px; border-radius: 8px; box-shadow: none;
}
body.tablet-mode #shipment-delivery-field[hidden] { display: none; }
body.tablet-mode .shipment-delivery-heading { display: grid; gap: 0; flex: none; }
body.tablet-mode #shipment-delivery-desktop-title { font-size: 12px; }
body.tablet-mode .delivery-default-setting { font-size: 10px; gap: 4px; }
body.tablet-mode .delivery-default-setting input { width: 18px; height: 18px; min-height: 18px; }
body.tablet-mode #shipment-delivery-options { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; }
body.tablet-mode #shipment-delivery-options[hidden] { display: none; }
body.tablet-mode #shipment-delivery-user { min-width: 0; width: 100%; min-height: 40px; padding: 4px 6px; font-size: 12px; }
body.tablet-mode #shipment-delivery-options details { position: relative; font-size: 11px; }
body.tablet-mode #shipment-delivery-options details p { position: relative; min-width: 180px; background: white; }
body.tablet-mode .shipment-items {
  grid-column: 1 / span 9; grid-row: 1; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 0 8px; margin: 0; padding: 4px 8px; box-shadow: none;
}
body.tablet-mode .shipment-items-head { grid-column: 1; grid-row: 1; padding: 0; border: 0; }
body.tablet-mode .shipment-items-head h3 { font-size: 13px; }
body.tablet-mode .shipment-items-head p,
body.tablet-mode #add-shipment-item { display: none; }
body.tablet-mode .shipment-item-list { grid-column: 2; grid-row: 1; display: flex; gap: 5px; padding: 0; overflow-x: auto; min-width: 0; }
body.tablet-mode .shipment-item-list > button { flex: 0 0 auto; min-width: 108px; min-height: 44px; max-width: 220px; padding: 4px 10px; border-radius: 8px; }
body.tablet-mode .shipment-item-list > button .shipment-item-number { display: none; }
body.tablet-mode .shipment-item-list > button .shipment-item-summary { display: block; font-size: 10px; line-height: 1.3; }
body.tablet-mode .shipment-item-list > button strong { font-size: 14px; margin: 0; }
body.tablet-mode .shipment-item-list > button small { font-size: 10px; }
body.tablet-mode .shipment-items-foot { grid-column: 3; grid-row: 1; padding: 0; }
body.tablet-mode #remove-shipment-item { min-height: 36px; padding: 3px 7px; font-size: 11px; }
body.tablet-mode .shipment-items > .card-body { grid-column: 1 / -1; padding: 0; display: flex; align-items: center; gap: 8px; }
body.tablet-mode #shipment-product-selection { margin: 0; padding: 0; border: 0; background: transparent; font-size: 11px; }
body.tablet-mode #shipment-product-selection:not(.selection-warning) { display: none; }
body.tablet-mode #confirm-shipment-product { padding: 2px 8px; min-height: 36px; font-size: 12px; }
body.tablet-mode .shipment-weight-summary { grid-column: 10 / span 3; grid-row: 1; margin: 0; padding: 0 8px; border: 0; background: transparent; align-self: center; }
body.tablet-mode .shipment-weight-values { display: flex; flex-direction: column; gap: 1px; }
body.tablet-mode .shipment-weight-values div { display: flex; flex-direction: row; align-items: baseline; gap: 8px; }
body.tablet-mode .shipment-weight-values span { font-size: 11px; }
body.tablet-mode .shipment-weight-values strong { font-size: 14px; }
body.tablet-mode #shipment-weight-warning { margin: 0; font-size: 12px; }

body.tablet-mode .hybrid-layout {
  grid-column: 1 / -1; grid-row: 2; min-height: 0;
  grid-template-columns: minmax(480px, 46%) minmax(0, 1fr); gap: 10px;
  align-items: stretch;
}
body.tablet-mode .hybrid-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; max-height: none; min-width: 0; box-shadow: none; }
body.tablet-mode .hybrid-pane > .card-head { flex: none; padding: 7px 10px; gap: 6px; min-height: 52px; flex-wrap: wrap; }
body.tablet-mode .hybrid-pane > .card-head h3 { font-size: 14px; }
body.tablet-mode #shipment-product-heading { flex: none; }
body.tablet-mode #shipment-product-pane > .card-head { flex-wrap: nowrap; align-items: center; }
body.tablet-mode #shipment-product-pane > .card-head .shipment-items { flex: 1; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; }
body.tablet-mode #shipment-product-pane .shipment-items-head h3 { font-size: 12px; }
body.tablet-mode #shipment-product-pane .shipment-item-list > button { min-width: 90px; max-width: 170px; }
body.tablet-mode #shipment-allocation-pane > .card-head .shipment-weight-summary { flex: 1; margin: 0; padding: 0 4px; }
body.tablet-mode #shipment-voice-open, body.tablet-mode #allocation-voice-open { padding: 5px 8px; min-height: 40px; font-size: 12px; }
body.tablet-mode #hybrid-product-meta { display: none; }
body.tablet-mode .hybrid-counter { font-size: 11px; padding: 4px 6px; }
body.tablet-mode .hybrid-pane-body { flex: 1; min-height: 0; padding: 8px 10px; overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: auto; }
body.tablet-mode #shipment-product-pane > .hybrid-pane-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: start; align-items: start; gap: 10px; }
body.tablet-mode #shipment-product-pane > .hybrid-pane-body > :not(.tablet-product-column):not(.tablet-weight-column) { grid-column: 1 / -1; }
body.tablet-mode .tablet-product-column, body.tablet-mode .tablet-weight-column { display: block; min-width: 0; }
body.tablet-mode .tablet-weight-column { padding-left: 10px; border-left: 1px solid var(--line); }
body.tablet-mode .tablet-weight-column #shipment-count-buttons { margin-top: 0; }
body.tablet-mode #hybrid-product-search { min-height: 40px; padding: 5px 8px; font-size: 14px; }
body.tablet-mode .hybrid-product-groups { gap: 4px; margin-top: 5px; }
body.tablet-mode .hybrid-product-group { min-height: 34px; padding: 3px 8px; font-size: 11px; }
body.tablet-mode #hybrid-product-frequent-state { margin: 4px 0; font-size: 11px; line-height: 1.4; }
body.tablet-mode #hybrid-product-frequent-state[data-state="ready"] { display: none; }
body.tablet-mode .hybrid-pane .hybrid-product-grid { margin-top: 6px; gap: 5px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
body.tablet-mode .hybrid-product { min-height: 44px; padding: 6px 8px; font-size: 13px; }
body.tablet-mode #shipment-product-options { margin-top: 6px; }
body.tablet-mode #shipment-product-options > summary { min-height: 32px; font-size: 12px; padding-block: 4px; }
body.tablet-mode .hybrid-fields { gap: 6px; }
body.tablet-mode .hybrid-fields label { font-size: 11px; }
body.tablet-mode .hybrid-fields select { min-height: 40px; padding: 5px; font-size: 13px; }
body.tablet-mode .shipment-count-select, body.tablet-mode #shipment-count-hint, body.tablet-mode #hybrid-weight-hint { display: none; }
body.tablet-mode #shipment-count-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 5px; }
body.tablet-mode #shipment-count-buttons button { min-width: 0; min-height: 36px; padding: 4px; border: 1px solid #accabe; border-radius: 7px; font-size: 12px; font-weight: 800; background: white; color: var(--navy); }
body.tablet-mode #shipment-count-buttons button[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }
body.tablet-mode .hybrid-section-title { margin: 6px 0 4px; }
body.tablet-mode .hybrid-section-title h4 { font-size: 13px; }
body.tablet-mode .hybrid-pane .hybrid-weight-row { grid-template-columns: minmax(70px, 1fr) minmax(60px, .8fr) 36px; padding: 5px; gap: 5px; }
body.tablet-mode .hybrid-weight-row .hybrid-range { display: none; }
body.tablet-mode .hybrid-weight-row label { font-size: 11px; gap: 1px; }
body.tablet-mode .hybrid-weight-row input { min-height: 44px; padding: 5px 8px; font-size: 16px; }
body.tablet-mode #hybrid-add-weight { min-height: 36px; margin-top: 5px; font-size: 12px; }

body.tablet-mode .hybrid-store-table { display: block; width: 100%; min-width: 0; border-spacing: 0; }
body.tablet-mode .hybrid-store-table thead, body.tablet-mode .hybrid-store-table tbody { display: block; }
body.tablet-mode .hybrid-store-table tr {
  display: grid; grid-template-columns: minmax(115px, 1fr) 76px 62px 80px 88px 38px;
  gap: 5px; align-items: center;
}
body.tablet-mode .hybrid-store-table th { padding: 2px 3px; font-size: 11px; }
body.tablet-mode .hybrid-store-table td { display: block; padding: 1px 0; min-width: 0; border: 0; white-space: normal; background: transparent; }
body.tablet-mode .hybrid-store-table tbody tr { border-bottom: 1px solid var(--line); padding: 1px 3px; border-radius: 6px; background: #f6f9f8; margin-top: 3px; }
body.tablet-mode .hybrid-store-table td:first-child { display: grid; grid-template-columns: minmax(0,1fr) 36px; align-items: center; gap: 2px; }
body.tablet-mode .hybrid-store-name { white-space: normal; overflow-wrap: anywhere; font-size: 12px; line-height: 1.3; }
body.tablet-mode .hybrid-store-add-weight { min-height: 40px; width: 36px; margin: 0; padding: 0; font-size: 0; border-style: solid; }
body.tablet-mode .hybrid-store-add-weight::after { content: '+'; font-size: 20px; }
body.tablet-mode .hybrid-store-table .hybrid-mini { width: 100%; min-width: 0; min-height: 44px; padding: 4px; font-size: 16px; }
body.tablet-mode .hybrid-store-table select.hybrid-mini { font-size: 14px; }
body.tablet-mode .hybrid-store-table td:nth-child(5) { display: grid; grid-template-columns: minmax(0,1fr) 21px; align-items: center; gap: 2px; }
body.tablet-mode .hybrid-store-table .basis { grid-column: 2; grid-row: 1; font-size: 9px; line-height: 1.1; text-align: right; }
body.tablet-mode .delivery-pending-label { grid-column: 1 / -1; grid-row: 2; font-size: 10px; line-height: 1.1; }
body.tablet-mode .delivery-pending-label:empty { display: none; }
body.tablet-mode .hybrid-refs { gap: 2px; }
body.tablet-mode .hybrid-ref { width: 100%; min-height: 44px; padding: 3px; font-size: 11px; }
body.tablet-mode .hybrid-ref small { font-size: 9px; }
body.tablet-mode .hybrid-store-table td:nth-child(4) { font-size: 11px; }
body.tablet-mode .hybrid-store-table .row-remove { width: 36px; min-height: 44px; font-size: 16px; }
body.tablet-mode .hybrid-store-empty { display: block !important; }
body.tablet-mode .hybrid-store-empty td { display: block !important; }
body.tablet-mode .hybrid-store-actions { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; margin-top: 6px; }
body.tablet-mode .hybrid-store-actions select { min-height: 40px; font-size: 12px; padding: 4px 8px; }
body.tablet-mode .hybrid-store-actions button { min-height: 40px; padding: 5px 9px; font-size: 12px; }
body.tablet-mode .hybrid-summary { margin-top: 8px; gap: 5px; }
body.tablet-mode .hybrid-summary div { padding: 6px; }
body.tablet-mode .hybrid-summary span { font-size: 10px; }
body.tablet-mode .hybrid-summary strong { font-size: 14px; }
body.tablet-mode .hybrid-warning { padding: 6px 8px; font-size: 11px; }
body.tablet-mode .device-draft-bar { padding: 8px; font-size: 11px; }
body.tablet-mode #shipment-allocation-pane .actions,
body.tablet-mode #add-shipment-item-bottom { display: none; }
body.tablet-mode #shipment > #tablet-shipment-toolbar {
  display: flex !important; flex: none; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: white;
}
body.tablet-mode .tablet-toolbar button { min-height: 46px; padding: 6px 16px; font-size: 14px; }
body.tablet-mode #tablet-save-state { flex-basis: 100%; margin: 0; padding: 6px 10px; font-size: 13px; max-height: 90px; overflow-y: auto; }
body.tablet-mode #tablet-add-product { margin-right: auto; }
body.tablet-mode button:focus-visible { outline: 3px solid #102736; outline-offset: 2px; }
body.tablet-mode button:disabled { opacity: .5; cursor: default; }

@media (max-width: 1099px) {
  body.tablet-mode main { height: auto; }
  body.tablet-mode .content { height: auto; overflow: visible; }
  body.tablet-mode #shipment.active { display: block; height: auto; }
  body.tablet-mode #shipment #shipment-edit-bar { margin-bottom: 8px; }
  body.tablet-mode #hybrid-shipment { display: block; }
  body.tablet-mode .hybrid-ship-head, body.tablet-mode #shipment-delivery-field, body.tablet-mode .shipment-items, body.tablet-mode .shipment-weight-summary { margin-bottom: 8px; }
  body.tablet-mode .hybrid-layout { grid-template-columns: 1fr; }
  body.tablet-mode .hybrid-pane { height: auto; }
  body.tablet-mode .hybrid-pane-body { overflow: visible; }
  body.tablet-mode .hybrid-pane .hybrid-product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body.tablet-mode #shipment > #tablet-shipment-toolbar { position: sticky; bottom: 0; z-index: 10; margin-top: 8px; }
}
@media (max-width: 599px) {
  body.tablet-mode main > header { flex-wrap: wrap; height: auto; min-height: 60px; }
  body.tablet-mode .header-meta { width: 100%; justify-content: space-between; }
  body.tablet-mode .mode-switch button { font-size: 11px; padding: 4px 6px; }
  body.tablet-mode .shipment-items { grid-template-columns: minmax(0,1fr); gap: 4px; }
  body.tablet-mode .shipment-items-head,
  body.tablet-mode .shipment-item-list,
  body.tablet-mode .shipment-items-foot { grid-column: 1; grid-row: auto; }
  body.tablet-mode .hybrid-store-table tr { grid-template-columns: minmax(100px,1fr) 64px 52px 72px 34px; }
  body.tablet-mode .hybrid-store-table td:nth-child(4), body.tablet-mode .hybrid-store-table th:nth-child(4) { display: none; }
  body.tablet-mode .hybrid-store-table td:first-child { grid-template-columns: minmax(0,1fr); }
  body.tablet-mode .hybrid-store-add-weight { width: 100%; min-height: 30px; }
  body.tablet-mode .tablet-toolbar button { padding-inline: 6px; font-size: 12px; }
}
