/* MSE Tools · responsief: tablet, en op ≤820 px een eigen mobiele indeling (tabbalk, kaartrijen, niets schuift zijwaarts). */
.tabbar, .sheet, .sheet-bg { display: none; }

@media (max-width: 1360px) {
  .kanalen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .tegels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tegel-h small { display: none; }
}
@media (max-width: 1100px) {
  :root { --side-w: 78px; }
  .side { padding: 18px 12px 14px; align-items: center; }
  .logo b, .nav-lab, .nav a span, .nav .cnt, .side-vandaag { display: none; }
  .nav { width: 52px; }
  .nav a { justify-content: center; padding: 0; }
  .top-date { display: none; }
  .search { width: min(320px, 34vw); }
  .hero-mid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .lens { flex-direction: row; }
  .lens-b .spark { display: none; }
  .ov-onder { grid-template-columns: minmax(0, 1fr); }
  .stats4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanalen-grid { grid-template-columns: minmax(0, 1fr); }
  .in-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  :root { --gap: 12px; --r-card: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 0 16px calc(104px + env(safe-area-inset-bottom)); }
  .top { height: 62px; gap: 10px; margin: 0 -16px 2px; padding: 0 16px; }
  .top-brand { display: inline-flex; }
  .search { display: none; position: absolute; left: 16px; right: 16px; top: 11px; width: auto; z-index: 5; }
  .search.open { display: flex; }
  .search kbd { display: none; }
  .ib--search { display: inline-grid; }
  .me, .top-date { display: none; }
  .ib { width: 36px; height: 36px; }
  .badge { height: 24px; padding: 0 8px; font-size: 9.5px; }
  /* in de smalle bovenbalk is geen plaats voor de labels: de held (oogregel) en de voorraadpagina melden het zelf */
  .top-r .badge--bron, .top-r .badge--droog { display: none !important; }
  .ph { flex-direction: column; align-items: stretch; gap: 14px; margin: 12px 0 18px; }
  .ph-title { font-size: 28px; }
  .ph-sub { font-size: 13.5px; }
  .ph-actions .btn { flex: 1; }
  .card { padding: 16px; }
  .sectie-h { margin: 26px 0 12px; }
  .sectie-h h2 { font-size: 20px; }

  /* held */
  .hero { margin-top: 4px; border-radius: 20px; }
  .hero-in { padding: 22px 18px 18px; }
  .hero-kop { font-size: 27px; }
  .hero-mid { margin-top: 22px; gap: 18px; }
  .lens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .lens-b { display: flex; flex-direction: column; align-items: flex-start; padding: 11px 10px 11px 12px; border-radius: 14px; }
  .lens-b small { font-size: 9px; letter-spacing: .08em; white-space: normal; }
  .lens-b b { font-size: 19px; font-stretch: 112%; margin-top: 7px; letter-spacing: -.04em; max-width: 100%; overflow-wrap: anywhere; }
  .lens-b > span { font-size: 11px; margin-top: 4px; }
  .lens-merk { display: none; }
  .hero-g-h { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero-g-st { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .st--big { grid-column: 1 / -1; }
  .st--big b { font-size: 44px; }
  .st--mnd { padding-bottom: 0; }
  .blok .seg { align-self: flex-start; }
  .hero-kgr { min-height: 210px; }
  .lint-nu { padding-left: 18px; max-width: 100%; border-right: 0; flex: 1; }
  .lint-band { display: none; }
  .tegels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tegel { padding: 14px 14px 13px; min-height: 160px; }
  .tegel-h { align-items: flex-start; gap: 9px; }
  .tegel-h .doos { width: 30px; height: 30px; }
  .tegel-h b { white-space: normal; font-size: 12.5px; line-height: 1.25; }
  .tegel-v { font-size: 32px; margin-top: 12px; }
  .tegel-o { font-size: 11.5px; align-items: flex-start; margin-top: 7px; }
  .tegel-o i { margin-top: 5px; }
  .tegel-m { height: 34px; padding-top: 10px; }
  .tegel-m.blokjes i { width: 11px; height: 11px; }
  .tegel-m.balk small { display: none; }
  .lt-rij { grid-template-columns: 70px 8px minmax(0, 1fr); }
  .td-rij { gap: 10px; }
  .kan-strook { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
  .kan-mini { padding: 13px; }
  .kan-mini-v > span { font-size: 17px; }

  /* tabellen worden kaartrijen */
  .tbl-wrap { margin: 0; }
  .lijst { padding: 14px; }
  .lijst-h { flex-direction: column; align-items: stretch; }
  .zoekveld { width: 100%; }
  .lijst-h .seg { align-self: flex-start; }
  .tbl, .tbl tbody { display: block; width: 100%; }
  .tbl thead { display: none; }
  .tbl tr.rij { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 14px 14px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); }
  .tbl tr.rij:hover td { background: transparent; }
  .tbl td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; border-radius: 0; min-width: 0; text-align: right; }
  .tbl td::before { content: attr(data-l); font: 600 10px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: left; flex: none; }
  .tbl td:first-child { text-align: left; justify-content: flex-start; padding-right: 36px; }
  .tbl td:first-child::before { display: none; }
  .tbl td.c-prod { min-width: 0; }
  .tbl td.c-open { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .tbl td.c-open::before { display: none; }
  .tbl td .stapel { text-align: right; align-items: flex-end; }
  .tbl td.c-prod .stapel, .tbl td.c-klant .stapel { text-align: left; align-items: flex-start; }
  .tbl td.c-gaten { align-items: flex-start; }
  .tbl td.c-gaten .gaten-l { justify-content: flex-end; }
  .tbl tr.detail, .tbl tr.uitslag-rij { display: block; margin: -4px 0 10px; }
  .tbl tr.detail td, .tbl tr.uitslag-rij td { display: block; padding: 0; text-align: left; border: 0; }
  .tbl tr.detail td::before, .tbl tr.uitslag-rij td::before { display: none; }
  .item { grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; }
  .item-p { display: none; }
  .tbl--voorraad td.c-edit { width: auto; display: block; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 3px; }
  .tbl--voorraad td.c-edit::before { display: block; margin-bottom: 8px; }
  .edit { width: 100%; justify-content: space-between; }
  .stepper { flex: 1; }
  .stepper input { flex: 1; width: auto; min-width: 0; }
  .tabs { gap: 10px; justify-content: space-between; }
  .tabs button { font-size: 12.5px; gap: 5px; }
  .tabs .cnt { padding: 3px 5px; font-size: 10px; }
  .meer-rij .btn { width: 100%; }

  /* zijpaneel */
  .drawer, .drawer--breed { width: 100vw; border-left: 0; }
  .drawer-h { padding: 16px 16px 14px; }
  .drawer-body { padding: 4px 16px 20px; }
  .drawer-f { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .drawer-f .btn { flex: 1; }
  .foto--groot { width: 56px; height: 56px; }
  .drawer-t { gap: 12px; }
  .drawer-t h2 { font-size: 18px; }
  .regel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .veld--aantal { grid-column: 1; grid-row: 2; } .veld--prijs { grid-column: 2; grid-row: 2; } .veld--btw { grid-column: 3; grid-row: 2; }
  .regel-tot { grid-column: 1 / 3; grid-row: 3; }
  .regel > .ib { grid-column: 3; grid-row: 3; }

  /* kanalen, onFact, instellingen */
  .stats4, .stats2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px; }
  .stat b { font-size: 28px; }
  .kanalen-grid, .in-grid { grid-template-columns: minmax(0, 1fr); }
  .kanaal-top { flex-wrap: wrap; }
  .in-thema span { max-width: none; }
  .auth-in { padding: 24px 20px 24px; }
  .auth-kop { font-size: 26px; }

  /* onderste tabbalk en "Meer" */
  .tabbar { display: flex; position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 66px; padding: 6px; gap: 2px; border-radius: 22px; background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -18px rgba(0, 0, 0, .6); }
  .tabbar[hidden] { display: none; }
  .tabbar a { position: relative; z-index: 1; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 16px; text-decoration: none; color: var(--ink-3); font-size: 10.5px; font-weight: 700; transition: color .25s; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a .ic { width: 20px; height: 20px; }
  .tabbar a.on { color: #fff; }
  .tab-pill { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 16px; background: var(--acc); box-shadow: var(--shadow-acc); }
  .sheet-bg { display: block; position: fixed; inset: 0; z-index: 80; background: rgba(8, 9, 12, .5); opacity: 0; transition: opacity .25s; }
  .sheet-bg.on { opacity: 1; }
  .sheet { display: flex; flex-direction: column; gap: 2px; position: fixed; z-index: 81; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); background: var(--card); border: 1px solid var(--line-2); border-radius: 24px; padding: 10px 10px 12px; box-shadow: var(--shadow-pop); }
  .sheet[hidden], .sheet-bg[hidden] { display: none; }
  .sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--card-3); margin: 2px auto 8px; }
  .sheet a, .sheet button { display: flex; align-items: center; gap: 13px; height: 50px; padding: 0 14px; border-radius: 14px; text-decoration: none; border: 0; background: transparent; text-align: left; font-size: 15px; font-weight: 700; color: var(--ink); }
  .sheet a:hover, .sheet button:hover { background: var(--card-2); }
  .sheet a.on { color: var(--acc-ink); }
  .sheet .ic { width: 19px; height: 19px; color: var(--ink-2); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .tabs .cnt { display: none; }
  .hero-kop { font-size: 24px; }
  .lens-b b { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
