/* =====================================================================================
   assets/mobile_kartu.css — Tampilan KARTU & area sentuh untuk HP DAN TABLET layar sentuh hingga 1439px
   Berlaku untuk SEMUA menu: tabel data otomatis menjadi kartu (diatur oleh assets/mobile_kartu.js),
   tombol/isian besar mudah disentuh, navigasi bawah ala aplikasi.
     - HP     (< 768px)        : kartu 1 kolom, sidebar geser dari kiri
     - TABLET (768px - 1439px, pointer sentuh) : kartu 2 kolom, sidebar jadi laci geser
     - Desktop dengan mouse / layar lebar      : TIDAK berubah. Mode cetak tidak tersentuh.
   ===================================================================================== */

/* Bilah navigasi bawah & petunjuk geser: tersembunyi di luar mode HP/tablet */
.mk-bar, .mk-hint, .legger-mobile-cards { display: none; }

/* ======================================================================================
   A. BERLAKU DI HP + TABLET (HP <=1023px; tablet sentuh sampai 1439px)
   ====================================================================================== */
@media screen and (max-width: 1023.98px), screen and (min-width: 1024px) and (max-width: 1439.98px) and (pointer: coarse) {
  html.mk-mode{
    --mk-teal: #0f766e;
    --mk-teal-2: #14b8a6;
    --mk-ink: #0f172a;
    --mk-muted: #64748b;
    --mk-line: #e6ebf1;
    --mk-card: #ffffff;
    --mk-radius: 18px;
  }

  html.mk-mode, html.mk-mode body{ -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: rgba(20, 184, 166, .15); }
  /* Tinggi kerangka mengikuti layar yang benar-benar terlihat (bilah alamat browser HP naik-turun) */
  html.mk-mode #appShellRoot{ height: 100vh !important; height: 100dvh !important; }
  html.mk-mode #appMainContent{ overflow-x: hidden; scroll-behavior: smooth; }

  /* ------------------------------ Header & sidebar ------------------------------ */
  html.mk-mode header.sticky{ height: auto !important; min-height: 64px; align-items: center; gap: 6px; }
  html.mk-mode header.sticky > div:first-child{ flex: 1 1 auto; min-width: 0; }
  html.mk-mode header.sticky > div:last-child{ flex: 0 0 auto; min-width: 0; }
  html.mk-mode header.sticky h2{
    flex: 1 1 auto; min-width: 0; max-width: none !important; padding: 7px 0;
    font-size: 14px; line-height: 1.25; overflow: visible; text-overflow: clip;
    white-space: normal; overflow-wrap: anywhere;
  }
  html.mk-mode header button[onclick^="toggleSidebar"]{
    min-width: 44px; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center;
    margin-right: 6px !important; border-radius: 12px; background: #f1f5f9;
  }
  html.mk-mode #sidebarNav a{ min-height: 48px; font-size: 14px !important; padding-top: 12px !important; padding-bottom: 12px !important; border-radius: 14px !important; }
  html.mk-mode #sidebarNav a i{ font-size: 16px !important; width: 28px !important; }
  /* Bayangan hanya saat drawer benar-benar terbuka; saat tertutup tidak boleh bocor di tepi kiri. */
  html.mk-mode #mainSidebar{ box-shadow: none !important; }
  html.mk-mode #mainSidebar.translate-x-0{ box-shadow: 8px 0 40px rgba(2, 6, 23, .45) !important; }
  html.mk-mode #mainSidebar button[onclick="toggleSidebar()"]{ min-width: 44px; min-height: 44px; display: inline-flex !important; align-items: center; justify-content: center; }

  /* ------------------------------ Isian & tombol (target sentuh >= 44px) ------------------------------ */
  html.mk-mode #appMainContent input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]):not([type=file]), html.mk-mode #appMainContent select, html.mk-mode #appMainContent textarea{
    font-size: 16px !important; min-height: 46px; border-radius: 14px !important; max-width: 100%;
  }
  html.mk-mode #appMainContent textarea{ min-height: 96px; }
  html.mk-mode #appMainContent input[type=checkbox], html.mk-mode #appMainContent input[type=radio]{ width: 22px; height: 22px; accent-color: var(--mk-teal); }
  /* Tombol & tautan-tombol: tinggi minimal 44px. Elemen yang sudah punya tata letak sendiri (flex/block/grid)
     atau sedang disembunyikan (hidden) TIDAK diubah tata letaknya, hanya diberi tinggi minimal. */
  html.mk-mode #appMainContent button:not(.mk-kecil), html.mk-mode #appMainContent input[type=submit], html.mk-mode #appMainContent input[type=button], html.mk-mode #appMainContent a[class*="rounded"][class*="px-"]:not(.mk-kecil){
    min-height: 44px; touch-action: manipulation; border-radius: 14px;
  }
  html.mk-mode #appMainContent button:not(.mk-kecil):not([class*="flex"]):not([class*="block"]):not([class*="grid"]):not(.hidden):not([hidden]), html.mk-mode #appMainContent a[class*="rounded"][class*="px-"]:not(.mk-kecil):not([class*="flex"]):not([class*="block"]):not([class*="grid"]):not(.hidden):not([hidden]){
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  }
  html.mk-mode #appMainContent button:active, html.mk-mode #appMainContent a[class*="rounded"][class*="px-"]:active{ transform: scale(.97); }
  /* Halaman ujian lama (UJIAN_LITE=0): tombol zoom teks soal A-/100%/A+ cukup 40x40, jangan jadi 28x44 */
  html.mk-mode #appMainContent button[onclick^="ubahUkuranTeksSoal"]:not(.mk-kecil){ min-height: 40px; min-width: 40px; }
  /* Toolbar editor soal (Quill) jangan ikut dibesarkan */
  html.mk-mode #appMainContent .ql-toolbar button{ min-height: 0; border-radius: 3px; display: inline-block; }
  html.mk-mode #appMainContent .ql-toolbar select{ min-height: 0; font-size: inherit !important; border-radius: 0 !important; }
  html.mk-mode #appMainContent form select, html.mk-mode #appMainContent form input:not([type=checkbox]):not([type=radio]):not([type=hidden]){ min-width: 0; }

  /* Dropdown sesi/jadwal di halaman monitoring dan berita acara: boleh turun baris,
     tidak memaksa form melebar dan tidak boleh menyusut menjadi kontrol yang tak terbaca. */
  html.mk-mode #appMainContent .mk-filter-form{ width: 100%; max-width: 100%; min-width: 0; flex-wrap: wrap; align-items: stretch; }
  html.mk-mode #appMainContent .mk-filter-form > *{ min-width: 0; }
  html.mk-mode #appMainContent .mk-filter-form .mk-filter-select{ flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%; }
  html.mk-mode #appMainContent .mk-filter-field{ flex: 1 1 220px; width: 100%; min-width: 0; }
  html.mk-mode #appMainContent .mk-filter-field .mk-filter-select{ width: 100%; min-width: 0; max-width: 100%; }

  /* Input foto pada kolom Aksi ID Card harus vertikal dan memenuhi lebar kartu. */
  html.mk-mode table.mk-card td.mk-aksi form[enctype="multipart/form-data"]{
    display: flex !important; flex: 1 1 100% !important; flex-direction: column; align-items: stretch;
    gap: 8px; width: 100%; min-width: 0;
  }
  html.mk-mode table.mk-card td.mk-aksi form[enctype="multipart/form-data"] input[type="file"]{
    display: block; width: 100% !important; max-width: 100%; min-width: 0; font-size: 12px !important;
  }
  html.mk-mode table.mk-card td.mk-aksi form[enctype="multipart/form-data"] button{ width: 100%; flex: 1 1 auto !important; }
  html.mk-mode .mk-action-label{ display: inline-block; margin-left: 4px; font-size: 10px; line-height: 1.15; font-weight: 800; white-space: normal; }

  /* Kartu pratinjau Bank Soal: soal dapat berisi tabel lebar. Batasi konten pertanyaan
     agar tidak mendorong toolbar Lihat/Edit/Hapus keluar dari batas kartu. */
  html.mk-mode #listSoalBS > .bg-white,
  html.mk-mode #listSoalUM > .bg-white{ min-width: 0; max-width: 100%; overflow: hidden; }
  html.mk-mode .mk-soal-card-head{
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 10px; width: 100%; max-width: 100%; min-width: 0;
  }
  html.mk-mode .mk-soal-card-question{
    display: block; flex: 1 1 auto; width: 100%; max-width: 100%; min-width: 0;
    line-height: 1.55; overflow-wrap: anywhere; word-break: normal;
  }
  html.mk-mode .mk-soal-card-question .soal-html-content{
    display: block; width: 100%; max-width: 100%; min-width: 0;
    margin-top: 7px; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  html.mk-mode .mk-soal-card-question .soal-html-content > table{
    width: max-content; max-width: none; min-width: min(100%, 280px);
  }
  html.mk-mode .mk-soal-card-actions{
    display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center;
    justify-content: flex-end; align-self: stretch; gap: 7px;
    width: 100%; max-width: 100%; min-width: 0; margin-left: 0;
  }
  html.mk-mode .mk-soal-card-action{
    display: inline-flex !important; flex: 0 1 auto; align-items: center; justify-content: center;
    gap: 6px; min-width: 76px; max-width: 100%; min-height: 42px !important;
    padding: 7px 10px !important; border: 1px solid #e2e8f0;
    border-radius: 11px !important; background: #f8fafc;
    font-size: 12px; line-height: 1.2; font-weight: 800; white-space: nowrap;
    touch-action: manipulation;
  }
  html.mk-mode .mk-soal-card-action i{ flex: 0 0 auto; }
  html.mk-mode .mk-soal-card-action-text{ display: inline !important; }
  html.mk-mode .mk-soal-card-action:active{ transform: scale(.97); }

  /* Strip tab Master User: pertahankan geser horizontal, beri petunjuk visual jika ada tab tersembunyi. */
  html.mk-mode .mk-tab-scroll-wrap{ position: relative; min-width: 0; max-width: 100%; }
  html.mk-mode .mk-tab-strip{ max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  html.mk-mode .mk-tab-strip::-webkit-scrollbar{ display: none; }
  html.mk-mode .mk-tab-scroll-hint:not([hidden]){
    position: absolute; z-index: 6; right: 10px; top: 50%; transform: translateY(-50%);
    display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 30px;
    padding: 0 7px; border-radius: 999px; color: #0f766e; background: rgba(240,253,250,.97);
    border: 1px solid rgba(20,184,166,.25); box-shadow: 0 1px 8px rgba(15,23,42,.10);
    font-size: 9px; font-weight: 800; pointer-events: none;
  }

  /* Pop-up / dialog: hampir selebar layar, bisa digulir */
  html.mk-mode div.fixed.inset-0[class*="z-"]:not(#sidebarBackdrop) > div[class*="max-w"]{
    width: calc(100% - 24px) !important; max-width: 560px; max-height: calc(100dvh - 28px); overflow-y: auto; border-radius: 22px !important;
  }

  /* ------------------------------ TABEL -> KARTU ------------------------------ */
  html.mk-mode .mk-wrap-card{ border: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; border-radius: 0 !important; max-height: none !important; }
  /* Pembungkus luar (overflow-hidden / max-h) tidak boleh memotong kartu; kartu diberi ruang di kiri-kanan. */
  html.mk-mode .mk-wrap-outer{ overflow: visible !important; max-height: none !important; }
  html.mk-mode .mk-wrap-outer .mk-wrap-card{ padding: 4px 10px 2px !important; }
  html.mk-mode .mk-wrap-outer > table.mk-card, html.mk-mode .mk-wrap-outer > .mk-scroll{ margin-left: 10px; margin-right: 10px; width: calc(100% - 20px) !important; }
  html.mk-mode .mk-wrap-outer > table.mk-card tbody{ padding-top: 4px; }

  /* Legger: layar kecil memakai kartu per siswa. Tabel sumber tetap dipakai untuk desktop/cetak. */
  html.mk-mode .legger-table-wrap{ display: none !important; }
  html.mk-mode .legger-mobile-cards{ display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  html.mk-mode .legger-mobile-card{ min-width: 0; padding: 14px; border: 1px solid #dce6ed; border-left: 4px solid #14b8a6; border-radius: 18px; background: #fff; box-shadow: 0 5px 18px rgba(15,23,42,.06); }
  html.mk-mode .legger-mobile-head{ display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 11px; border-bottom: 1px solid #e8eef3; }
  html.mk-mode .legger-mobile-ident{ flex: 1 1 170px; min-width: 0; }
  html.mk-mode .legger-mobile-name{ margin: 0; color: #0f172a; font-size: 15px; line-height: 1.3; font-weight: 850; overflow-wrap: anywhere; }
  html.mk-mode .legger-mobile-id{ margin-top: 4px; color: #64748b; font-size: 11px; overflow-wrap: anywhere; }
  html.mk-mode .legger-mobile-scorebox{ flex: 0 0 auto; min-width: 82px; text-align: right; }
  html.mk-mode .legger-mobile-score{ color: #0f766e; font-size: 21px; line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; }
  html.mk-mode .legger-mobile-badge{ display: inline-flex; align-items: center; justify-content: center; margin-top: 5px; padding: 4px 8px; border-radius: 999px; font-size: 10px; line-height: 1.2; font-weight: 850; }
  html.mk-mode .legger-mobile-summary{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 11px; }
  html.mk-mode .legger-mobile-summary-item{ min-width: 0; padding: 8px 6px; border-radius: 11px; background: #f8fafc; text-align: center; }
  html.mk-mode .legger-mobile-summary-label{ color: #64748b; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  html.mk-mode .legger-mobile-summary-value{ margin-top: 3px; color: #1e293b; font-size: 13px; font-weight: 850; overflow-wrap: anywhere; }
  html.mk-mode .legger-mobile-section-title{ margin: 13px 0 7px; color: #64748b; font-size: 9px; letter-spacing: .07em; font-weight: 900; text-transform: uppercase; }
  html.mk-mode .legger-mobile-types{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  html.mk-mode .legger-mobile-type{ min-width: 0; padding: 8px 9px; border-radius: 11px; border: 1px solid #e8eef3; background: #fbfdff; }
  html.mk-mode .legger-mobile-type-name{ display: block; margin-bottom: 5px; color: #334155; font-size: 10px; line-height: 1.25; font-weight: 850; overflow-wrap: anywhere; }
  html.mk-mode .legger-mobile-type-values{ display: flex; justify-content: space-between; gap: 4px; color: #475569; font-size: 10px; font-weight: 750; }
  html.mk-mode .legger-mobile-type-values b{ color: #0f172a; font-variant-numeric: tabular-nums; }
  html.mk-mode .legger-mobile-times{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed #e2e8f0; }
  html.mk-mode .legger-mobile-time{ min-width: 0; color: #64748b; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
  html.mk-mode .legger-mobile-time b{ display: block; margin-bottom: 2px; color: #475569; font-size: 9px; text-transform: uppercase; }
  html.mk-mode .legger-mobile-empty{ padding: 18px; border: 1px dashed #cbd5e1; border-radius: 16px; color: #64748b; background: #fff; text-align: center; font-size: 12px; }

  html.mk-mode table.mk-card, html.mk-mode table.mk-card tbody, html.mk-mode table.mk-card tfoot{ display: block; width: 100% !important; min-width: 0 !important; border: 0 !important; background: transparent !important; }
  html.mk-mode table.mk-card thead{
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; /* tetap terbaca pembaca layar */
  }
  html.mk-mode table.mk-card tr{
    position: relative; display: flex; flex-direction: column;
    background: var(--mk-card); border: 1px solid var(--mk-line); border-left: 4px solid var(--mk-teal-2);
    border-radius: var(--mk-radius); padding: 6px 16px 8px; margin: 0 0 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 20px -12px rgba(15, 23, 42, .18);
  }
  html.mk-mode table.mk-card tr.hidden, html.mk-mode table.mk-card tr[hidden]{ display: none; }
  html.mk-mode table.mk-card td, html.mk-mode table.mk-card th{
    display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
    width: auto !important; padding: 10px 0 !important; border: 0 !important; border-bottom: 1px dashed #e9eef4 !important;
    text-align: right !important; font-size: 13px; color: #1e293b; background: transparent !important; position: static !important;
  }
  html.mk-mode table.mk-card td:last-child{ border-bottom: 0 !important; }
  html.mk-mode table.mk-card td.hidden{ display: none; }
  html.mk-mode table.mk-card td::before{
    content: attr(data-label); flex: 0 0 36%; max-width: 40%; text-align: left;
    font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--mk-muted); padding-top: 2px;
  }
  /* Sel data ber-colspan (mis. statistik yang belum cukup peserta) menjadi satu bidang penuh. */
  html.mk-mode table.mk-card td.mk-span-data{
    display: block; width: 100% !important; max-width: 100%; min-width: 0;
    padding: 10px 0 !important; text-align: left !important;
  }
  html.mk-mode table.mk-card td.mk-span-data::before{
    display: block; max-width: none; margin: 0 0 6px; text-align: left;
  }
  html.mk-mode table.mk-card td.mk-span-data > .mk-v{
    display: block; width: 100%; max-width: 100%; text-align: left;
  }
  html.mk-mode table.mk-card td[data-label=""]::before{ display: none; }
  html.mk-mode table.mk-card td > .mk-v{ flex: 1 1 auto; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
  html.mk-mode .mk-v:empty::after{ content: "—"; color: #94a3b8; }

  /* Kepala kartu (identitas) tampil paling atas dan menonjol */
  html.mk-mode table.mk-card td.mk-judul{
    order: -1; display: block; text-align: left !important; padding: 12px 0 12px !important;
    border-bottom: 1px solid var(--mk-line) !important; margin-bottom: 2px;
  }
  html.mk-mode table.mk-card td.mk-judul::before{ display: none; }
  html.mk-mode table.mk-card td.mk-judul .mk-v{ font-size: 15px; line-height: 1.35; font-weight: 700; color: var(--mk-ink); }
  html.mk-mode table.mk-card tr.mk-ada-cek td.mk-judul{ padding-right: 44px !important; }

  /* Kolom nomor urut disembunyikan; kotak centang dipindah ke pojok kartu */
  html.mk-mode table.mk-card td.mk-nomor{ display: none; }
  html.mk-mode table.mk-card td.mk-cek{ position: absolute !important; top: 8px; right: 10px; width: 40px !important; height: 40px; padding: 0 !important; border: 0 !important; justify-content: center; align-items: center; }
  html.mk-mode table.mk-card td.mk-cek::before{ display: none; }

  /* Kolom aksi: tombol besar, mudah disentuh, 2 per baris */
  html.mk-mode table.mk-card td.mk-aksi{ display: block; text-align: left !important; padding-top: 12px !important; border-bottom: 0 !important; }
  html.mk-mode table.mk-card td.mk-aksi::before{ display: block; max-width: none; margin-bottom: 8px; }
  html.mk-mode table.mk-card td.mk-aksi > .mk-v{ display: flex; flex-wrap: wrap; gap: 8px; }
  html.mk-mode table.mk-card td.mk-aksi > .mk-v > *{ flex: 1 1 calc(50% - 8px); min-height: 44px; justify-content: center; text-align: center; margin: 0 !important; }
  html.mk-mode table.mk-card td.mk-aksi > .mk-v > form{ display: contents; }
  html.mk-mode table.mk-card td.mk-aksi a, html.mk-mode table.mk-card td.mk-aksi button{ display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding-left: 10px; padding-right: 10px; border-radius: 12px; background: #f1f5f9; }

  /* Data Panitia UM: setiap anggota menjadi kartu tersendiri pada HP/tablet. */
  html.mk-mode #appMainContent .mk-panitia-list{ display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 10px; border: 0; }
  html.mk-mode #appMainContent .mk-panitia-row{ display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; min-width: 0; padding: 12px !important; border: 1px solid var(--mk-line); border-radius: 14px; background: var(--mk-card); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
  html.mk-mode #appMainContent .mk-panitia-identitas{ flex: 1 1 180px; min-width: 0; }
  html.mk-mode #appMainContent .mk-panitia-name, html.mk-mode #appMainContent .mk-panitia-meta{ white-space: normal !important; overflow: visible !important; text-overflow: clip !important; overflow-wrap: anywhere; }
  html.mk-mode #appMainContent .mk-panitia-actions{ display: flex; flex: 0 0 100%; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 2px; padding-top: 9px; border-top: 1px dashed var(--mk-line); }
  html.mk-mode #appMainContent .mk-panitia-actions button{ display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 88px; min-height: 40px; padding: 7px 12px; border: 1px solid var(--mk-line); border-radius: 10px; background: #f8fafc; font-size: 12px; font-weight: 750; }
  html.mk-mode #appMainContent .mk-panitia-action-text{ display: inline; }

  /* Baris pesan kosong / sub-baris selebar kartu */
  html.mk-mode table.mk-card td.mk-kosong{ display: block; text-align: center !important; color: var(--mk-muted); padding: 18px 4px !important; border-bottom: 0 !important; }
  html.mk-mode table.mk-card td.mk-kosong::before{ display: none; }
  html.mk-mode table.mk-card tr.mk-sub{ padding: 0; border-left-width: 1px; border-color: var(--mk-line); background: transparent; box-shadow: none; margin-top: -6px; }
  html.mk-mode table.mk-card tr.mk-sub > td{ display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }

  /* Lencana/status di dalam kartu tidak ikut melebar */
  html.mk-mode table.mk-card td .rounded-full, html.mk-mode table.mk-card td .rounded-md{ white-space: normal; }

  /* ------------------------------ TABEL LEBAR (matriks nilai dsb.): geser samping ------------------------------ */
  html.mk-mode .mk-scroll{
    overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; border-radius: 14px;
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) 0 0 / 36px 100% no-repeat local,
      linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) 100% 0 / 36px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15,23,42,.22), rgba(0,0,0,0)) 0 0 / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,.22), rgba(0,0,0,0)) 100% 0 / 12px 100% no-repeat scroll;
  }
  html.mk-mode .mk-scroll > table{ min-width: 640px; }
  html.mk-mode .mk-hint{ display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--mk-muted); margin: 0 0 6px; }

  /* ------------------------------ Navigasi bawah ala aplikasi ------------------------------ */
  html.mk-mode .mk-bar{
    position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 25;
    display: flex; align-items: stretch; justify-content: space-around; gap: 4px; padding: 6px;
    background: rgba(15, 23, 42, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 22px; box-shadow: 0 12px 32px -8px rgba(2, 6, 23, .55); transition: transform .2s ease, opacity .2s ease;
  }
  html.mk-mode .mk-bar.mk-bar-sembunyi{ transform: translateY(140%); opacity: 0; pointer-events: none; }
  html.mk-mode .mk-bar a, html.mk-mode .mk-bar button{
    flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #cbd5e1; background: transparent; border: 0; border-radius: 16px; font-size: 11px; font-weight: 700; text-decoration: none; touch-action: manipulation;
  }
  html.mk-mode .mk-bar span{ max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  html.mk-mode .mk-bar i{ font-size: 17px; }
  html.mk-mode .mk-bar a:active, html.mk-mode .mk-bar button:active{ background: rgba(255, 255, 255, .1); }
  html.mk-mode .mk-bar a.mk-aktif{ color: #fff; background: rgba(20, 184, 166, .22); box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .35); }
  html.mk-mode .mk-bar .mk-bar-utama{ background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; box-shadow: 0 6px 16px -6px rgba(20, 184, 166, .8); }

  /* ------------------------------ Mode gelap ------------------------------ */
  html.mk-mode.dark table.mk-card tr{ background: #1e293b; border-color: #334155; border-left-color: #14b8a6; }
  html.mk-mode.dark #appMainContent .mk-panitia-row{ background: #1e293b; border-color: #334155; }
  html.mk-mode.dark #appMainContent .mk-panitia-actions{ border-top-color: #334155; }
  html.mk-mode.dark #appMainContent .mk-panitia-actions button{ background: #334155; border-color: #475569; }
  html.mk-mode.dark table.mk-card td{ color: #e2e8f0; border-bottom-color: #334155 !important; }
  html.mk-mode.dark table.mk-card td.mk-judul{ border-bottom-color: #334155 !important; }
  html.mk-mode.dark table.mk-card td.mk-judul .mk-v{ color: #f1f5f9; }
  html.mk-mode.dark table.mk-card td::before{ color: #94a3b8; }
  html.mk-mode.dark table.mk-card td.mk-aksi a, html.mk-mode.dark table.mk-card td.mk-aksi button{ background: #334155; }
  html.mk-mode.dark table.mk-card tr.mk-sub{ background: transparent; }
  html.mk-mode.dark .mk-scroll{ background: none; }
  html.mk-mode.dark header button[onclick^="toggleSidebar"]{ background: #334155; }
}

/* ======================================================================================
   B. KHUSUS HP (< 768px)
   ====================================================================================== */
@media screen and (max-width: 767.98px) {
  html.mk-mode #appMainContent{ padding: 14px 12px calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
  html.mk-mode header.sticky h2{ max-width: 58vw; }
}

/* ======================================================================================
   C. KHUSUS TABLET (768px - 1439px untuk perangkat pointer sentuh)
   Sidebar desktop (statis, lebar 288px) memakan hampir 40% layar tablet portrait -> dijadikan laci
   geser seperti di HP. Pakai selektor #id + !important supaya menang atas kelas Tailwind md:*.
   ====================================================================================== */
@media screen and (min-width: 768px) and (max-width: 1023.98px), screen and (min-width: 1024px) and (max-width: 1439.98px) and (pointer: coarse) {
  /* Sidebar -> laci */
  html.mk-mode #mainSidebar{ position: fixed !important; top: 0; bottom: 0; left: 0; transform: translateX(-100%) !important; display: flex !important; }
  html.mk-mode #mainSidebar.translate-x-0{ transform: translateX(0) !important; }
  html.mk-mode #sidebarBackdrop:not(.hidden){ display: block !important; }
  html.mk-mode header button[onclick^="toggleSidebar"]{ display: inline-flex !important; }
  html.mk-mode #btnHideSidebarDesktop, html.mk-mode #btnShowSidebarDesktop{ display: none !important; }

  html.mk-mode #appMainContent{ padding: 18px 20px calc(98px + env(safe-area-inset-bottom, 0px)) !important; }
  html.mk-mode header.sticky h2{ max-width: 62vw; font-size: 16px; }

  /* Kartu 2 kolom */
  html.mk-mode .legger-mobile-cards{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.mk-mode #appMainContent .mk-panitia-list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.mk-mode table.mk-card tbody, html.mk-mode table.mk-card tfoot{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  html.mk-mode table.mk-card tr{ margin: 0; }
  html.mk-mode table.mk-card tr.mk-baris-penuh, html.mk-mode table.mk-card tr.mk-sub{ grid-column: 1 / -1; }
  html.mk-mode .mk-scroll > table{ min-width: 720px; }

  /* Bilah bawah: tidak selebar layar tablet */
  html.mk-mode .mk-bar{ left: 0; right: 0; margin: 0 auto; width: min(560px, calc(100% - 24px)); }
}

/* Tablet sentuh lebar dalam posisi landscape: manfaatkan ruang dengan 3 kartu per baris. */
@media screen and (min-width: 1200px) and (max-width: 1439.98px) and (pointer: coarse) {
  html.mk-mode table.mk-card tbody, html.mk-mode table.mk-card tfoot { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media screen and (min-width: 768px) and (max-width: 1023.98px), screen and (min-width: 1024px) and (max-width: 1439.98px) and (pointer: coarse) {
  html.mk-mode #appMainContent .grid[class*="md:grid-cols-3"], html.mk-mode #appMainContent .grid[class*="md:grid-cols-4"], html.mk-mode #appMainContent .grid[class*="md:grid-cols-5"], html.mk-mode #appMainContent .grid[class*="md:grid-cols-6"], html.mk-mode #appMainContent .grid[class*="md:grid-cols-8"], html.mk-mode #appMainContent .grid[class*="lg:grid-cols-3"], html.mk-mode #appMainContent .grid[class*="lg:grid-cols-4"], html.mk-mode #appMainContent .grid[class*="lg:grid-cols-5"], html.mk-mode #appMainContent .grid[class*="lg:grid-cols-6"], html.mk-mode #appMainContent .grid[class*="xl:grid-cols-5"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Layar sangat sempit: label di atas nilai supaya tidak sesak */
@media screen and (max-width: 360px) {
  html.mk-mode .legger-mobile-summary{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  html.mk-mode .legger-mobile-card{ padding: 11px; }
  html.mk-mode .legger-mobile-times{ grid-template-columns: 1fr; }
  html.mk-mode header.sticky h2{ font-size: 12px; }
  html.mk-mode table.mk-card td:not(.mk-judul):not(.mk-cek):not(.mk-aksi):not(.mk-kosong){ flex-direction: column; gap: 4px; text-align: left !important; }
  html.mk-mode table.mk-card td:not(.mk-judul):not(.mk-cek):not(.mk-aksi):not(.mk-kosong)::before{ max-width: none; flex-basis: auto; }
  html.mk-mode table.mk-card td > .mk-v{ width: 100%; }
}

/* Desktop: bilah bawah tidak pernah tampil */
@media screen and (min-width: 1024px) and (pointer: fine) { html.mk-mode .mk-bar{ display: none !important; } }
@media print { html.mk-mode .mk-bar, html.mk-mode .mk-hint, html.mk-mode .legger-mobile-cards{ display: none !important; } }

@media print { .mk-bar, .mk-hint, .legger-mobile-cards { display: none !important; } }
