/* mobile-web-20261023-1: iPhone presentation */
/* Additive iPhone presentation; server business logic remains authoritative. */
@media (max-width: 1000px) {
  html.bb-phone { -webkit-text-size-adjust:100%; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
  .bb-phone body { font-size:16px; }
  .bb-phone .shell,.bb-phone .shell.collapsed { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); min-height:0; height:calc(100dvh - var(--bb-phone-nav-height,68px) - env(safe-area-inset-bottom,0px)); }
  .bb-phone .window-strip { display:none; }
  .bb-phone .shell>.sidebar,.bb-phone .shell.collapsed>.sidebar { display:none; }
  .bb-phone .topbar { grid-column:1; grid-row:1; flex-direction:column-reverse; align-items:stretch; height:auto; padding:10px 16px; gap:10px; border-bottom:1px solid var(--line); }
  .bb-phone .topbar-right { display:flex; justify-content:space-between; width:100%; flex-wrap:wrap; gap:8px; }
  .bb-phone .topbar-right .operator,.bb-phone .topbar-right .venue-label,.bb-phone .narrow-location { display:none; }
  .bb-phone .company-identity { max-width:65%; min-width:0; }
  .bb-phone .company-identity>strong { font-size:14px; white-space:normal; }
  .bb-phone .connection-state { display:block; border:0; padding:0; }
  .bb-phone .connection-state>span,.bb-phone .connection-state>strong { font-size:11px; }
  .bb-phone .topbar-left { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
  .bb-phone .topbar-left>[data-action=collapse],.bb-phone .toolbar-history { display:none; }
  .bb-phone .topbar-left>button { flex:1 1 auto; font-size:14px; }
  .bb-phone .topbar-left>[data-action=refresh],.bb-phone .topbar-left>[data-action=stock-actions] { display:none; }
  .bb-phone .topbar-left .refresh-label { display:none; }
  .bb-phone .workspace { grid-column:1; grid-row:2; min-height:0; overflow:auto; overscroll-behavior:contain; }
  .bb-phone .content { padding:18px 16px 24px; min-width:0; }
  .bb-phone button,.bb-phone button.icon,.bb-phone .library-card-actions button { min-height:44px; }
  .bb-phone button.icon,.bb-phone .tab-close { min-width:44px; }
  .bb-phone input,.bb-phone select,.bb-phone textarea { font-size:max(16px,1rem)!important; min-height:44px; }
  .bb-phone button { border-radius:10px; }
  .bb-phone h1 { font-size:28px; letter-spacing:-.6px; line-height:1.15; }
  .bb-phone .breadcrumb { font-size:10px; margin-bottom:7px; }
  .bb-phone .page-heading p { font-size:14px; line-height:1.5; }
  .bb-phone .page-heading { gap:12px; margin-bottom:18px; }
  .bb-phone .heading-actions { flex-wrap:wrap; justify-content:flex-start; }
  .bb-phone .stats { gap:8px; flex-wrap:wrap; }
  .bb-phone .stat-card { flex:1 1 100px; min-width:0; padding:12px; border-radius:12px; }
  .bb-phone .stat-card label,.bb-phone .stat-card span { font-size:12px; }
  .bb-phone .stat-card strong { font-size:24px; }
  .bb-phone .toolbar { flex-wrap:wrap; gap:8px; }
  .bb-phone .toolbar .search { flex-basis:100%; max-width:none; min-width:0; }
  .bb-phone .toolbar select { max-width:100%; }
  .bb-phone .toolbar .push { margin-left:0; }
  .bb-phone .product-name { font-size:16px; line-height:1.35; white-space:normal; }
  .bb-phone .stock-page,.bb-phone .library-page { flex:none; min-height:auto; }
  .bb-phone .stock-main,.bb-phone .library-canvas { min-height:auto; }
  .bb-phone .form-grid,.bb-phone .settings-grid { grid-template-columns:minmax(0,1fr); }
  .bb-phone .form-grid .full { grid-column:1; }
  .bb-phone .form-help,.bb-phone .form-grid label,.bb-phone .review-list { font-size:.875rem!important; }
  .bb-phone .form-grid input,.bb-phone .form-grid select { min-width:0; width:100%; }
  .bb-phone input[type=checkbox],.bb-phone input[type=radio] { width:22px!important; height:22px; min-height:22px; flex:0 0 22px; }
  .bb-phone label:has(input[type=checkbox]),.bb-phone label:has(input[type=radio]) { min-height:44px; display:flex; align-items:center; gap:10px; }
  .bb-phone dialog { width:calc(100vw - 20px); max-width:600px; max-height:calc(100dvh - 24px); border-radius:18px; }
  .bb-phone .modal-header,.bb-phone .modal-body { padding:18px; }
  .bb-phone .modal-footer { padding:14px 18px; flex-wrap:wrap; }
  .bb-phone .stock-page>.inspector { position:fixed; top:10px; right:10px; bottom:10px; width:calc(100vw - 20px); max-width:480px; z-index:81; border-radius:16px; }
  .bb-phone .library-grid { grid-template-columns:minmax(0,1fr); }
  .bb-phone .library-card { border-radius:14px; }
  .bb-phone .library-card .library-open { padding:14px; }
  .bb-phone .library-card-details,.bb-phone .library-card-actions { padding:10px 14px; }
  .bb-phone .library-card-actions { flex-wrap:wrap; }
  .bb-phone .library-name { font-size:17px; }
  .bb-phone .signin-page { min-height:100dvh; padding:20px; }
  .bb-phone .signin-card { padding:24px; }
  .bb-phone .signin-card label { font-size:16px; }
  .bb-phone .statusbar { padding-bottom:12px; }
  .bb-phone .statusbar>span:first-child { display:none; }
  .bb-phone #toast { bottom:90px; }
  #bb-phone-nav { position:fixed; z-index:9; bottom:0; left:0; right:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px)); gap:4px; background:var(--chrome); border-top:1px solid var(--line); }
  #bb-phone-nav button { border:0; min-height:56px; display:flex; flex-direction:column; gap:4px; font-size:.75rem; color:var(--muted); background:transparent; white-space:normal; overflow-wrap:anywhere; min-width:0; }
  #bb-phone-nav button[aria-current=page] { color:var(--accent); background:var(--subtle); font-weight:650; }
  #bb-phone-nav .icon-svg { width:21px; height:21px; }
  #bb-phone-more { padding:0; }
  #bb-phone-more::backdrop { background:#0009; }
  #bb-phone-more header { display:flex; align-items:center; justify-content:space-between; padding:18px; border-bottom:1px solid var(--line); }
  #bb-phone-more h2 { margin:0; font-size:22px; }
  #bb-phone-more .bb-phone-menu { padding:14px; display:grid; grid-template-columns:1fr 1fr; gap:10px; max-height:65dvh; overflow:auto; }
  #bb-phone-more .bb-phone-menu button { min-height:60px; justify-content:flex-start; white-space:normal; text-align:left; }
  #bb-phone-more .bb-phone-menu .icon-svg { flex:none; }
  #bb-phone-more .bb-phone-menu p { grid-column:1/-1; color:var(--muted); font-size:13px; margin:8px 4px; }
  #bb-phone-more .bb-phone-workspace-row { grid-column:1/-1; display:grid; grid-template-columns:1fr auto; gap:8px; }
  #bb-phone-more [aria-current=page] { border-color:var(--accent); }
  .bb-phone:has(#bb-phone-nav[hidden]) .shell { height:100dvh; }
  #bb-phone-nav[hidden] { display:none; }
}
@media(min-width:721px) and (max-width:1000px) {
  .bb-phone .shell { height:calc(100dvh - var(--bb-phone-nav-height,68px) - env(safe-area-inset-bottom,0px)); }
  .bb-phone .topbar { flex-direction:row-reverse; align-items:center; }
  .bb-phone .topbar-left { width:auto; flex:1; }
  .bb-phone .topbar-right { width:auto; max-width:34%; }
}
@media(prefers-reduced-motion:reduce) { .bb-phone * { scroll-behavior:auto!important; } }

@media(max-width:1000px){.bb-phone .topbar{padding-top:calc(10px + env(safe-area-inset-top,0px));}#bb-phone-more .bb-phone-install{grid-column:1/-1;display:block;}#bb-phone-more .bb-phone-install-help{grid-column:1/-1;margin:0;padding:12px;line-height:1.5;font-size:14px;}#bb-phone-nav[hidden]{display:none!important;}}

/* Phone and tablet presentation. Desktop decoration is scoped out in workspace-palette.css.
   Device selection is in device-presentation.js; operations remain in the shared app. */
@media screen and (forced-colors:none) {
  html.bb-touch:not([data-display-mode=ascii]) {
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    -webkit-text-size-adjust:100%;
    --bg:#101827!important;--chrome:#141f31!important;--surface:#1a283c!important;
    --raised:#23334a!important;--line:#3b4c63!important;--border:#8294ad!important;
    --text:#f2f6fc!important;--muted:#b7c5d9!important;--panel:var(--surface);
    --table-head:var(--raised)!important;--row-hover:var(--raised)!important;
    --focus-sep:var(--bg)!important;color-scheme:dark;
  }
  html.bb-touch[data-theme=light]:not([data-display-mode=ascii]) {
    --bg:#f3f6fb!important;--chrome:#ffffff!important;--surface:#ffffff!important;
    --raised:#eaf0f8!important;--line:#d7e0ec!important;--border:#74859b!important;
    --text:#182b45!important;--muted:#53657c!important;color-scheme:light;
  }
  html.bb-touch[data-accent=Blue]:not([data-display-mode=ascii]) {
    --accent:#8bbcff!important;--hover:#b3d3ff!important;--on:#102442!important;
    --subtle:#233e60!important;--selected:#29496d!important;--cyan:var(--accent)!important;
    --focus:var(--accent)!important;--selection-text:var(--text)!important;
  }
  html.bb-touch[data-theme=light][data-accent=Blue]:not([data-display-mode=ascii]) {
    --accent:#245fbd!important;--hover:#184a97!important;--on:#ffffff!important;
    --subtle:#e7effc!important;--selected:#dbe8fc!important;
  }
}
html.bb-touch {--touch-radius:16px;}
.bb-touch body {font-size:15px;line-height:1.5;}
.bb-touch #dashboard-light,.bb-touch .ambient-settings-row {display:none!important;}
/* Mapped shelf regions retain their percentage geometry on touch devices. */
.bb-touch button:not(.marker),.bb-touch button.icon,.bb-touch .button,.bb-touch .nav-item,
.bb-touch .toolbar button,.bb-touch .stock-table td button,.bb-touch .pagination button {
  min-height:44px!important;height:auto!important;min-width:44px!important;border-radius:10px;touch-action:manipulation;
}
.bb-touch input:not([type=checkbox]):not([type=radio]),.bb-touch select,.bb-touch textarea {
  min-height:44px!important;height:auto!important;font-size:16px!important;border-radius:10px;
}
.bb-touch input[type=checkbox],.bb-touch input[type=radio] {width:22px;height:22px;min-height:22px;accent-color:var(--accent);}
.bb-touch label:has(input[type=checkbox]),.bb-touch label:has(input[type=radio]) {min-height:44px;}
.bb-touch button:focus-visible,.bb-touch a:focus-visible {outline:3px solid var(--accent);outline-offset:3px;}
.bb-touch .icon-svg {width:20px;height:20px;}
.bb-touch .dashboard-shell .workspace-actions {padding:0 0 16px;gap:8px;}
.bb-touch .workspace-actions button {flex:0 1 auto;white-space:normal;}
.bb-touch .dashboard-shell .page-heading {padding:0;margin:0 0 20px;align-items:flex-start;flex-wrap:wrap;}
.bb-touch .page-heading h1 {font-size:28px;font-weight:700;letter-spacing:-.035em;}
.bb-touch .page-heading p {font-size:14px;line-height:1.5;}
.bb-touch .breadcrumb {font-family:inherit;font-size:11px;letter-spacing:.06em;}
.bb-touch .heading-actions {flex-wrap:wrap;justify-content:flex-start;}
.bb-touch .stock-main {background:transparent;}
.bb-touch .stat-card {background:var(--surface);border-radius:var(--touch-radius);padding:14px;}
.bb-touch .stat-card strong {font-size:25px;font-weight:700;}
.bb-touch .stat-card label,.bb-touch .stat-card span {font-size:12px;}
.bb-touch .toolbar {padding:12px;border:1px solid var(--line);border-radius:var(--touch-radius);gap:8px;}
.bb-touch .search {min-width:0;}
.bb-touch .search>.icon-svg {top:12px;}
.bb-touch .product-name {font-size:16px;line-height:1.4;}
.bb-touch .stock-table .qty {font-size:18px;}
.bb-touch .stock-table .unit {font-size:13px;}
.bb-touch .stock-table .badge {font-size:12px;padding:4px 7px;height:auto;}
.bb-touch .table-card,.bb-touch .settings-section,.bb-touch .library-card {border-radius:var(--touch-radius);}
.bb-touch .settings-section {padding:20px;}
.bb-touch .pagination {gap:8px;padding:12px;flex-wrap:wrap;font-size:13px;}
.bb-touch .pagination .pages {gap:8px;}
.bb-touch .dashboard-page {padding:0 0 24px;}
.bb-touch .dashboard-page .page-heading {padding:0;}
.bb-touch .dashboard-app,.bb-touch .dashboard-panel,.bb-touch .dashboard-hero {border-radius:var(--touch-radius);padding:20px;}
.bb-touch .dashboard-app p,.bb-touch .dashboard-list-row,.bb-touch .dashboard-panel>p {font-size:14px;}
.bb-touch .dashboard-metrics>div>span,.bb-touch .dashboard-metrics button {font-size:12px;}
.bb-touch .dashboard-app:hover {transform:none;}
.bb-touch dialog {width:640px;max-width:calc(100vw - 24px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 24px);border-radius:20px;}
.bb-touch .modal-header,.bb-touch .modal-body,.bb-touch .modal-footer {padding:18px;}
.bb-touch .modal-footer {flex-wrap:wrap;}
.bb-touch .review-list {grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);font-size:14px;}
.bb-touch .stock-page>.inspector {position:fixed;top:calc(12px + env(safe-area-inset-top,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px));right:calc(12px + env(safe-area-inset-right,0px));width:min(440px,calc(100vw - 24px));min-width:0;max-width:none;z-index:81;border-radius:20px;box-shadow:0 16px 60px #10244240;}
.bb-touch .inspector-backdrop {z-index:80;}
.bb-touch .statusbar {font-size:12px;}
.bb-touch .statusbar>span:first-child {display:none;}
.bb-touch .form-help,.bb-touch .form-grid label {font-size:14px;}

/* Phone: one scrolling work area and persistent, labelled navigation. */
html[data-device=phone] .shell,html[data-device=phone] .shell.collapsed {
  grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)!important;
  min-height:0;height:calc(100dvh - var(--bb-phone-nav-height,68px) - env(safe-area-inset-bottom,0px));
}
html[data-device=phone] .shell .window-strip,html[data-device=phone] .shell>.sidebar {display:none;}
html[data-device=phone] .dashboard-shell .topbar {grid-row:1;height:auto;min-height:0;flex-direction:column-reverse;align-items:stretch;padding:calc(10px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 10px max(16px,env(safe-area-inset-left,0px));gap:8px;}
html[data-device=phone] .topbar-left,html[data-device=phone] .topbar-right {width:100%;max-width:none;flex:1;flex-wrap:wrap;margin:0;}
html[data-device=phone] .topbar-left>button {font-size:14px;}
html[data-device=phone] .workspace {grid-column:1;grid-row:2;overflow:auto;}
html[data-device=phone] .content {padding:20px max(16px,env(safe-area-inset-right,0px)) 20px max(16px,env(safe-area-inset-left,0px));overflow:visible;flex:none;}
html[data-device=phone] .stats {grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
html[data-device=phone] .stat-card {padding:12px 8px;display:block;}
html[data-device=phone] .stat-card>.icon-svg {display:none;}
html[data-device=phone] .stat-card strong {font-size:22px;overflow-wrap:anywhere;}
html[data-device=phone] .toolbar .search {flex-basis:100%;max-width:none;}
html[data-device=phone] .toolbar select {flex:1 1 calc(50% - 8px);max-width:100%;min-width:0;}
html[data-device=phone] .toolbar .push {display:none;}
html[data-device=phone] .stock-page:not(.library-page) .stock-table {display:block;min-width:0;width:100%;}
html[data-device=phone] .stock-page:not(.library-page) .stock-table thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);}
html[data-device=phone] .stock-page:not(.library-page) .stock-table tbody {display:block;}
html[data-device=phone] .stock-page:not(.library-page) .stock-table tr {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;padding:12px 8px;border-bottom:1px solid var(--line);}
html[data-device=phone] .stock-page:not(.library-page) .stock-table td {display:none;border:0;padding:4px;height:auto;}
html[data-device=phone] .stock-page:not(.library-page) .stock-table td.stock-identity,
html[data-device=phone] .stock-page:not(.library-page) .stock-table td.stock-quantity,
html[data-device=phone] .stock-page:not(.library-page) .stock-table td:last-child {display:block;}
html[data-device=phone] .stock-identity {grid-column:1;grid-row:1/3;min-width:0;}
html[data-device=phone] .stock-quantity {grid-column:2;grid-row:1;text-align:right;}
html[data-device=phone] .stock-table td:last-child {grid-column:2;grid-row:2;text-align:right;}
html[data-device=phone] .product-cell {min-width:0;}
html[data-device=phone] .product-cell>div {min-width:0;}
html[data-device=phone] .product-name {white-space:normal;max-width:none;overflow-wrap:anywhere;}
html[data-device=phone] .narrow-sku {display:block;white-space:normal;font-size:12px;color:var(--muted);}
html[data-device=phone] .product-cell img {width:40px;height:40px;flex-shrink:0;}
.touch-stock-status {display:none;}
html[data-device=phone] .touch-stock-status {display:block;margin-top:6px;white-space:normal;}
.bb-touch .area-workspace-link,.bb-touch #manage-people-link {min-height:44px!important;display:inline-flex;align-items:center;}
html[data-device=phone] .form-grid,html[data-device=phone] .settings-grid {grid-template-columns:minmax(0,1fr);}
html[data-device=phone] .form-grid .full {grid-column:1;}
html[data-device=phone] .library-grid,html[data-device=phone] .dashboard-apps,html[data-device=phone] .dashboard-lower {grid-template-columns:minmax(0,1fr);}
html[data-device=phone] .library-card-actions {flex-wrap:wrap;}
html[data-device=phone] #bb-phone-nav {padding-left:max(10px,env(safe-area-inset-left,0px));padding-right:max(10px,env(safe-area-inset-right,0px));box-shadow:0 -4px 24px #182b450a;}
html[data-device=phone] #bb-phone-nav button {font-size:12px;border-radius:12px;}
html[data-device=phone] #bb-phone-more .bb-phone-menu {grid-template-columns:minmax(0,1fr);}
html[data-device=phone] .pagination .pages {margin-left:0;}
html[data-device=phone] .settings {max-width:100%;}

/* Tablet, including landscape iPads: touch controls and a labelled side directory. */
html[data-device=tablet] .shell,html[data-device=tablet] .shell.collapsed {grid-template-columns:184px minmax(0,1fr);grid-template-rows:52px auto minmax(0,1fr)!important;min-height:0;height:100dvh;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);}
html[data-device=tablet] .window-strip {grid-column:1/-1;grid-row:1;height:52px;display:flex;}
html[data-device=tablet] .window-strip .tabs {height:52px;min-width:0;}
html[data-device=tablet] .window-strip .tab {min-width:120px;}
html[data-device=tablet] .window-strip .tab-close {margin:0;}
html[data-device=tablet] .dashboard-shell .topbar {grid-row:2;height:auto;min-height:64px;padding:10px 16px;flex-wrap:wrap;}
html[data-device=tablet] .topbar-right {flex-wrap:wrap;}
html[data-device=tablet] .topbar-left>[data-action=collapse],html[data-device=tablet] .collapse-control {display:none;}
html[data-device=tablet] .shell>.sidebar {grid-column:1;grid-row:3;display:flex;position:static;width:auto;padding:12px 4px;overflow:auto;}
html[data-device=tablet] .sidebar .nav-item {justify-content:flex-start;padding:10px;min-height:48px;font-size:13px;white-space:normal;text-align:left;}
html[data-device=tablet] .sidebar .nav-item span,html[data-device=tablet] .sidebar .eyebrow {display:inline;}
html[data-device=tablet] .sidebar .nav-item .venue-menu-label {display:grid;}
html[data-device=phone] .content>.setup-guide {order:10;margin-top:20px;}
html[data-device=tablet] .workspace {grid-column:2;grid-row:3;overflow:auto;}
html[data-device=tablet] .content {padding:24px 20px;overflow:visible;flex:none;}
html[data-device=tablet] .stock-page,html[data-device=tablet] .stock-main {min-height:0;flex:none;}
html[data-device=tablet] .stock-main {width:100%;}
html[data-device=tablet] .table-scroll {max-height:65dvh;overflow:auto;}
html[data-device=tablet] .stock-table td {height:58px;padding:8px 12px;}
html[data-device=tablet] .toolbar .search {flex-basis:100%;max-width:none;}
html[data-device=tablet] .library-grid,html[data-device=tablet] .dashboard-apps {grid-template-columns:repeat(2,minmax(0,1fr));}
html[data-device=tablet] .dashboard-lower {grid-template-columns:1fr;}
html[data-device=tablet] .library-card-actions {flex-wrap:wrap;}
html[data-device=tablet] .dashboard-metrics {gap:12px;}
html[data-device=tablet] .settings-grid {grid-template-columns:1fr;}
#bb-phone-nav[hidden] {display:none!important;}
@media(max-width:1100px) {
  html[data-device=tablet] .stock-page:not(.library-page) .stock-table {min-width:0;width:100%;}
  html[data-device=tablet] .stock-page:not(.library-page) .stock-table :is(.stock-sku,.stock-category,.stock-minimum,.stock-changed) {display:none;}
  html[data-device=tablet] .stock-page:not(.library-page) .stock-table th:first-child,
  html[data-device=tablet] .stock-page:not(.library-page) .stock-table th:has([data-sort=category]),
  html[data-device=tablet] .stock-page:not(.library-page) .stock-table th:has([data-sort=lastChanged]) {display:none;}
  html[data-device=tablet] .stock-page:not(.library-page) .product-cell {min-width:0;}
  html[data-device=tablet] .stock-page:not(.library-page) .product-name {max-width:220px;white-space:normal;overflow-wrap:anywhere;}
  html[data-device=tablet] .stock-page:not(.library-page) .narrow-sku {display:block;font-size:12px;}
}
@media(prefers-reduced-motion:reduce) {.bb-touch * {scroll-behavior:auto!important;}}
