/* ===== BMT v26: mobiel app-design ===== */
img, video, iframe { max-width: 100%; height: auto; }
svg { max-width: 100%; }
pre { white-space: pre-wrap; word-break: break-word; }
main.wrap { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.mk-tabbar, .mk-sheet { display: none; }

@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }

  /* Kopbalk */
  .topbar { position: sticky; top: 0; z-index: 800; display: flex !important; flex-wrap: nowrap !important;
            align-items: center; gap: .6rem; padding: calc(.45rem + env(safe-area-inset-top, 0px)) .8rem .45rem !important;
            background: rgba(255,255,255,.95); -webkit-backdrop-filter: saturate(180%) blur(12px);
            backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid #e3e8ef; }
  .topbar nav { display: none !important; }
  .topbar .terug { flex: none; width: 40px; height: 40px; }
  .topbar .brand { flex: none; display: flex; align-items: center; }
  .topbar .brand img.logo { height: 38px; width: auto; }
  .topbar .uit { margin-left: auto; flex: none; font-size: .88rem; font-weight: 600; padding: .45rem .8rem;
                 border-radius: 999px; background: #eef2f8; color: #1b4f9c !important; text-decoration: none; }

  main.wrap { padding: 1rem .9rem 1.2rem !important; }
  main.wrap h1 { font-size: 1.55rem; line-height: 1.2; }
  input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; max-width: 100%; }
  main.wrap button, main.wrap .btn, main.wrap input[type=submit] { min-height: 44px; }

  /* Tabbalk onderin */
  .mk-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
               background: rgba(255,255,255,.96); -webkit-backdrop-filter: saturate(180%) blur(14px);
               backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid #e3e8ef;
               padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .mk-tabbar a, .mk-tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
               color: #7a8494; text-decoration: none; font: 600 11px/1.1 -apple-system, system-ui, sans-serif;
               background: none; border: 0; padding: 4px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mk-tabbar .actief { color: #1b4f9c; }
  .mk-ic { position: relative; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
  .mk-ic svg { width: 24px; height: 24px; }
  .mk-badge { position: absolute; top: -4px; right: -9px; background: #e11d48; color: #fff; border-radius: 999px;
              font-size: 10px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
              display: flex; align-items: center; justify-content: center; }
  .mk-sheet.open { display: block; position: fixed; inset: 0; z-index: 950; background: rgba(15,23,42,.35); }
  .mk-paneel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 20px 20px 0 0;
               padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 30px rgba(0,0,0,.15); }
  .mk-greep { width: 40px; height: 5px; border-radius: 3px; background: #d5dbe3; margin: 4px auto 10px; }
  .mk-paneel a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid #eef1f5;
                 color: #1f2937; text-decoration: none; font-size: 1.02rem; font-weight: 500; }
  .mk-paneel a:last-child { border-bottom: 0; }
  .mk-paneel a svg { width: 22px; height: 22px; color: #1b4f9c; }
  .bd-install { bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important; }
  .bd-push { bottom: calc(152px + env(safe-area-inset-bottom, 0px)) !important; }

  /* Tabbladen die niet passen: nette knoppen die doorlopen */
  .mk-tabs { display: flex !important; flex-wrap: wrap !important; gap: .45rem !important; overflow: visible !important;
             border-bottom: 0 !important; margin-bottom: 1rem !important; }
  .mk-tabs > * { flex: 0 0 auto !important; width: auto !important; padding: .5rem .9rem !important; border-radius: 999px !important;
             background: #eef2f8 !important; color: #1b4f9c !important; border: 0 !important; white-space: nowrap !important;
             font-size: .92rem !important; font-weight: 600 !important; text-decoration: none !important; margin: 0 !important; }
  .mk-tabs > .mk-aan { background: #1b4f9c !important; color: #fff !important; }
  .mk-tabs > *::after, .mk-tabs > *::before { display: none !important; }

  /* Tabellen als kaartjes */
  .bd-scroll { overflow-x: visible; }
  table.mk { display: block; width: 100% !important; border: 0 !important; background: none !important; }
  table.mk thead, table.mk tr.mk-kop { display: none !important; }
  table.mk tbody, table.mk tfoot { display: block; }
  table.mk tr { display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e8ef; border-radius: 14px;
                padding: .55rem .9rem; margin: 0 0 .65rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
  table.mk td, table.mk tr > th { display: flex; justify-content: space-between; align-items: center; gap: .8rem;
                padding: .4rem 0 !important; border: 0 !important; border-top: 1px solid #f0f3f7 !important;
                text-align: right; width: auto !important; white-space: normal !important; background: none !important; }
  table.mk td::before { content: attr(data-label); font-weight: 500; color: #7a8494; text-align: left; flex: none; max-width: 45%; }
  table.mk td.mk-titel { order: -1; border-top: 0 !important; justify-content: flex-start; text-align: left;
                font-weight: 700; font-size: 1.06rem; padding-top: .25rem !important; }
  table.mk td.mk-titel::before { display: none; }
  table.mk td.mk-titel[data-nr]::before { display: inline-flex; content: attr(data-nr); flex: none; max-width: none;
                width: 32px; height: 32px; border-radius: 50%; background: #1b4f9c; color: #fff; font-weight: 700;
                font-size: .9rem; align-items: center; justify-content: center; }
  table.mk td.mk-leeg, table.mk td.mk-nummer { display: none !important; }
  table.mk td.mk-acties { justify-content: flex-start; flex-wrap: wrap; text-align: left; gap: .5rem 1rem; }
  table.mk td.mk-acties::before, table.mk td[data-label=""]::before { display: none; }
  table.mk td form { margin: 0; }
}

.mk-te-breed { outline: 3px solid #e11 !important; outline-offset: -3px; }
#mk-rapport { position: fixed; left: .5rem; right: .5rem; top: .5rem; z-index: 10000; max-height: 40vh; overflow: auto;
              background: #fff; border: 2px solid #e11; border-radius: 10px; padding: .6rem .8rem;
              font: 13px/1.4 system-ui, sans-serif; color: #222; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
#mk-rapport b { color: #e11; }
