.mobile-trade-edit,.quick-consumer { display:none!important; }
.erp-file.company-card-capture { display:none; }
.mobile-theme-control { display:none!important; }
@media(max-width:900px) {
  .workspace { height:calc(100dvh - 68px - env(safe-area-inset-bottom)); }
  .workspace > .topbar {
    display:flex; flex-wrap:nowrap; align-items:center; height:auto; min-height:50px;
    padding:3px 10px; gap:5px;
  }
  .topbar .shop-wrap { flex:1 1 auto; min-width:0; }
  .topbar .shop-button { width:100%; min-width:0; min-height:43px; gap:5px; padding:2px; }
  .topbar .shop-button .od-field { min-width:0; }
  .topbar #shop-name { white-space:normal; overflow-wrap:anywhere; font-size:15px; line-height:1.2; }
  .workspace > .topbar .shop-button > .od-icon { display:block; flex:none; width:14px; height:14px; }
  .topbar :is(.shop-mark,.shop-button .tiny,.sample-label,.theme-toggle,#account-header-status,#main-add,.workspace-clock-time) {
    display:none!important;
  }
  .workspace > .topbar .workspace-clock { order:1; margin:0; flex:none; }
  .workspace > .topbar .workspace-clock-date { font-size:11px; }
  .workspace > .topbar .header-notice { order:2; padding:0; }
  .topbar .header-notice :is(b,span) { display:none; }
  .topbar .top-actions { order:3; flex:none; }
  .topbar .mobile-settings { display:inline-flex; }
  .workspace > .topbar :is(.mobile-settings,.header-notice) { width:44px; min-width:44px; height:44px; min-height:44px; flex:none; justify-content:center; }
  .settings-title .mobile-theme-control { display:inline-flex!important; }
  /* Icon-over-label, equal columns and active underline from 21st Mobile Navigation Tabs. */
  .mobile-nav { display:grid; grid-template-columns:repeat(4,minmax(0,1fr))!important; height:calc(68px + env(safe-area-inset-bottom)); min-height:0; padding:4px 5px calc(5px + env(safe-area-inset-bottom)); gap:4px; }
  .mobile-nav > button:not(.mobile-credit) { min-width:0; min-height:48px; align-self:stretch; padding:3px 2px; border-bottom:2px solid transparent; font-size:12px; }
  .mobile-nav > button[aria-current=page] { border-bottom-color:var(--accent); color:var(--accent-dark); background:var(--accent-soft); }
  .mobile-nav .mobile-credit { display:none!important; }
  #main:has(> .mobile-flow) { padding:12px 12px 9px; overflow:hidden; }
  .mobile-flow { display:flex; flex-direction:column; gap:10px; flex:1 1 auto; min-height:0; min-width:0; }
  .mobile-flow-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:7px; }
  .mobile-flow-heading h1 { margin:0; font-size:clamp(20px,5.6vw,27px); line-height:1.2; }
  .mobile-flow-heading .period-picker { width:auto; min-width:0; }
  .mobile-flow-heading :is(.btn,.period-picker .icon-btn) { min-height:40px; }
  .mobile-flow-content,.mobile-flow-scroll { min-height:0; overflow:auto; overscroll-behavior:contain; }
  .mobile-flow-content { display:grid; align-content:start; gap:10px; }
  .mobile-flow-caption { margin:0; font-size:12px; color:var(--muted); }
  .mobile-flow-total { display:grid; min-width:0; gap:8px; padding:12px; }
  .mobile-flow-total-link {
    display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px;
    min-width:0; padding:1px; background:none; color:var(--ink); text-align:left;
  }
  .mobile-flow-total-link > span:nth-child(2) { display:grid; gap:3px; overflow-wrap:anywhere; }
  .mobile-flow-total-link strong { font-size:clamp(22px,6vw,28px); font-variant-numeric:tabular-nums; line-height:1.2; }
  .mobile-flow-total-mark { display:grid; place-items:center; border-radius:9px; width:39px; height:39px; background:var(--accent-soft); color:var(--accent-dark); }
  .mobile-flow-total.is-out .mobile-flow-total-mark { background:var(--ground); color:var(--ink); }
  .mobile-flow-total .btn { justify-self:stretch; min-height:42px; }
  .mobile-flow-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; padding:3px; border-radius:11px; background:var(--ground); border:1px solid var(--line); }
  .mobile-flow-tabs button { display:flex; align-items:center; justify-content:center; gap:5px; min-height:42px; border-radius:8px; background:none; color:var(--muted); font-weight:700; }
  .mobile-flow-tabs button[aria-pressed=true] { background:var(--accent-soft); color:var(--accent-dark); box-shadow:inset 0 -2px var(--accent); }
  .mobile-flow-list { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; overflow:hidden; }
  .mobile-flow-list-header,.mobile-flow-pagination { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; padding:8px 11px; }
  .mobile-flow-list-header { border-bottom:1px solid var(--line); }
  .mobile-flow-list-header h2 { margin:0; font-size:15px; }
  .mobile-flow-list-header small { color:var(--muted); font-size:11px; }
  .mobile-flow-list-header > strong { overflow-wrap:anywhere; }
  .mobile-flow-scroll { flex:1; display:grid; align-content:start; gap:8px; padding:9px; }
  .mobile-flow-entry {
    display:grid; gap:4px; min-width:0; text-align:left; padding:10px; border:1px solid var(--line);
    border-radius:11px; background:var(--paper); color:var(--ink); overflow-wrap:anywhere;
  }
  .mobile-flow-entry-meta,.mobile-flow-entry-bottom { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:3px 8px; }
  .mobile-flow-entry-meta,.mobile-flow-entry-copy,.mobile-flow-entry-bottom > span { color:var(--muted); font-size:12px; }
  .mobile-flow-category { padding:1px 5px; border-radius:5px; background:var(--ground); color:var(--ink); }
  .mobile-flow-entry-name { font-size:16px; }
  .mobile-flow-entry-bottom > strong { display:inline-flex; align-items:center; gap:4px; font-size:16px; font-variant-numeric:tabular-nums; }
  .mobile-flow-empty { margin:0; padding:9px; color:var(--muted); font-size:14px; }
  .mobile-flow-pagination { border-top:1px solid var(--line); justify-content:center; }
  .mobile-company-entry { grid-template-columns:minmax(0,1fr) auto; align-items:center; min-height:54px; }
  .mobile-company-entry > span { display:grid; gap:2px; }
  .mobile-company-entry small { color:var(--muted); }
  .erp-file.company-card-capture { display:inline-flex; color:var(--accent-dark); background:var(--accent-soft); }
  #result-dialog [data-action=result-balances] { display:none; }
  #main[data-view=inventory] .stock-desktop-controls,#main[data-view=inventory] [data-stock-filter=archived],
  #main[data-view=inventory] [data-stock-action=archive],#main[data-view=inventory] .stock-history:has([data-stock-history]) { display:none!important; }
  #main[data-view=settings] :is(#settings-side-slot,.settings-stack > section:has(#mail-settings-form)) { display:none!important; }
  #auth-overlay { max-height:var(--visible-height,100dvh); overflow-y:auto; }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor)[open] {
    position:fixed; inset:auto; top:calc(var(--visible-top,0px) + 6px); left:8px;
    width:calc(100% - 16px); height:calc(var(--visible-height,100dvh) - 12px);
    max-width:none; max-height:none; margin:0; border-radius:14px;
  }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor) > .dialog-layout { display:flex; flex-direction:column; height:100%; max-height:100%; min-height:0; }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor) .dialog-header { flex:none; padding:8px 12px; }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor) .dialog-header p { display:none; }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor) .dialog-body {
    flex:1 1 auto; min-height:0; padding:10px 12px; overflow:auto; overscroll-behavior:contain; scroll-padding:10px;
  }
  :is(#transaction-dialog,#payment-dialog,#company-dialog,#trade-editor) .dialog-footer {
    flex:none; padding:6px 12px max(6px,env(safe-area-inset-bottom)); gap:6px;
  }
  :is(dialog,#auth-overlay) :is(input:not([type=checkbox]),textarea,select) { font-size:16px; }
  #transaction-dialog .form-stack { gap:9px; }
  #transaction-dialog .form-divider { display:none; }
  #detail-dialog .mobile-trade-edit,.quick-consumer:not([hidden]) { display:inline-flex!important; }
  #detail-dialog .dialog-footer,#transaction-dialog .dialog-footer { flex-wrap:wrap; }
  #stock-dialog .stock-priced .stock-link-row,#transaction-dialog .stock-priced .stock-link-row,#trade-editor .stock-priced .stock-link-row {
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) auto;
  }
  :is(#stock-dialog,#transaction-dialog,#trade-editor) .stock-priced .stock-link-row label:first-child { grid-column:1/-1; }
}
