/* ===== V25n (01/12/2026) — Mobile Card Maker: fixed bottom tab bar (TikTok-style) + pop-up sheets + BIG sharp preview =====
   Chỉ có hiệu lực khi JS gắn html.mk-v25n (≤640px). PC giữ nguyên. */
.mk-v25n-bar,.mk-v25n-sheet{display:none}

@media (max-width:640px){
  html.mk-v25n{scroll-padding-top:64px}
  html.mk-v25n body{padding-bottom:calc(64px + env(safe-area-inset-bottom))}

  /* Ẩn các khối cũ (đã chuyển vào pop) + chữ thừa quanh thẻ */
  html.mk-v25n .mk-tabs,
  html.mk-v25n .mk-mbar,
  html.mk-v25n .mk-preview-side,
  html.mk-v25n .mk-status,
  html.mk-v25n .mk-stage-acts,
  html.mk-v25n .mk-stage-meta,
  html.mk-v25n .mk-top__acts,
  html.mk-v25n .mk-shell > .mk-own-bar,
  html.mk-v25n .mk-shell > .mk-col,
  html.mk-v25n .c-wrap > .mk-own-bar{display:none!important}
  html.mk-v25n .mk-top h1{font-size:22px;margin-bottom:2px}
  html.mk-v25n .mk-top__sub{font-size:13.5px;line-height:1.5;margin:0}

  /* THẺ XEM TRƯỚC TO: ≥92% bề ngang, vừa chiều cao màn (trừ header + thanh tab) */
  html.mk-v25n .mk-stage{
    position:relative;top:auto;order:1;padding:10px 0 6px;background:transparent;border:0;box-shadow:none;
    display:flex;flex-direction:column;align-items:center;gap:8px;
  }
  html.mk-v25n .mk-preview-row{justify-content:center}
  html.mk-v25n .mk-card-frame{
    width:min(92vw, calc((100svh - 56px - 64px - 28px) * 0.714))!important;
    flex:0 0 auto;max-width:460px;aspect-ratio:750/1050;margin:0 auto;cursor:zoom-in;touch-action:pan-y;
  }
  html.mk-v25n .mk-card-tilt{border-radius:14px;box-shadow:0 14px 34px rgba(0,0,0,.28)}
  html.mk-v25n #mk-preview-slot svg{display:block;width:100%;height:auto}

  /* Chip khung chỉ nằm trong pop Frame */
  html.mk-v25n .mk-stage > .mk-styles{display:none!important}

  /* Pop mở ⇒ CHẾ ĐỘ CHỈNH: thẻ cố định giữa header và pop, nền che nội dung trang phía sau, thẻ vẫn to (≥220px) */
  html.mk-v25n[data-v25n-sheet="half"] .mk-stage,
  html.mk-v25n[data-v25n-sheet="full"] .mk-stage{
    position:fixed;left:0;right:0;top:52px;z-index:58;margin:0;padding:8px 0;
    bottom:calc(58px + env(safe-area-inset-bottom) + 46svh);
    display:flex;align-items:center;justify-content:center;background:var(--c-bg);
  }
  html.mk-v25n[data-v25n-sheet="full"] .mk-stage{bottom:calc(58px + env(safe-area-inset-bottom) + 76svh)}
  html.mk-v25n[data-v25n-sheet="half"] .mk-card-frame{
    width:max(220px, min(92vw, calc((100svh - 52px - 46svh - 58px - 16px) * 0.714)))!important;
  }
  html.mk-v25n[data-v25n-sheet="full"] .mk-card-frame{width:max(110px, calc((100svh - 52px - 76svh - 58px - 14px) * 0.714))!important}
  html.mk-v25n[data-v25n-sheet="half"] .mk-card-tilt,html.mk-v25n[data-v25n-sheet="full"] .mk-card-tilt{box-shadow:0 8px 22px rgba(0,0,0,.25)}

  /* THANH TAB CỐ ĐỊNH DƯỚI — SÁT MÉP */
  html.mk-v25n .mk-v25n-bar{
    display:grid;grid-template-columns:repeat(5,1fr);align-items:stretch;
    position:fixed;left:0;right:0;bottom:0;z-index:60;
    height:calc(58px + env(safe-area-inset-bottom));padding:0 4px env(safe-area-inset-bottom);margin:0;
    background:var(--c-card);border-top:1px solid var(--c-line);box-shadow:0 -6px 18px rgba(15,23,42,.08);
    transition:transform .2s ease;
  }
  html.mk-v25n .mk-v25n-bar.is-off{transform:translateY(110%)}
  .mk-v25n-tab{
    appearance:none;border:0;background:transparent;color:var(--c-mut);font:600 11.5px/1.1 Rajdhani,system-ui,sans-serif;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:44px;padding:4px 0;cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  .mk-v25n-tab svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .mk-v25n-tab.on{color:var(--c-acc)}
  .mk-v25n-tab--center .mk-v25n-plus{
    display:flex;align-items:center;justify-content:center;width:52px;height:34px;border-radius:11px;
    background:linear-gradient(135deg,#e03131,#c92a2a);color:#fff;box-shadow:0 4px 12px rgba(201,42,42,.35);
  }
  .mk-v25n-tab--center .mk-v25n-plus svg{width:22px;height:22px;stroke-width:2.6}
  .mk-v25n-tab--center{color:var(--c-ink)}

  /* CỬA SỔ POP (bottom sheet) — Thu gọn / Đóng */
  html.mk-v25n .mk-v25n-sheet{
    display:flex;flex-direction:column;position:fixed;left:0;right:0;z-index:59;
    bottom:calc(58px + env(safe-area-inset-bottom));height:46svh;
    background:var(--c-card);border:1px solid var(--c-line);border-bottom:0;border-radius:18px 18px 0 0;
    box-shadow:0 -12px 32px rgba(15,23,42,.18);transition:height .2s ease;
  }
  html.mk-v25n .mk-v25n-sheet[hidden]{display:none}
  html.mk-v25n .mk-v25n-sheet[data-size="full"]{height:76svh}
  .mk-v25n-sheet__hdr{
    position:relative;display:flex;align-items:center;gap:6px;padding:12px 8px 8px 16px;flex:0 0 auto;
    border-bottom:1px solid var(--c-line);touch-action:none;
  }
  .mk-v25n-grip{position:absolute;top:5px;left:50%;width:40px;height:4px;margin-left:-20px;border-radius:4px;background:var(--c-line)}
  .mk-v25n-sheet__t{flex:1 1 auto;font:700 17px/1.2 Oswald,sans-serif;color:var(--c-ink)}
  .mk-v25n-sheet__size,.mk-v25n-sheet__x{
    width:44px;height:44px;border-radius:12px;border:1px solid var(--c-line);background:var(--c-soft);color:var(--c-ink);
    display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex:0 0 auto;
  }
  .mk-v25n-sheet__size svg,.mk-v25n-sheet__x svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
  .mk-v25n-sheet__body{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:12px 14px 18px}

  /* Nội dung pop: dùng lại khối có sẵn, gỡ khung/viền thừa */
  .mk-v25n-panel .mk-col,.mk-v25n-panel .mk-own-bar{display:block!important;border:0;box-shadow:none;padding:0;margin:0 0 12px;background:transparent}
  .mk-v25n-panel .mk-own-bar{padding:12px;border:1px solid var(--c-line);border-radius:14px;background:var(--c-soft)}
  .mk-v25n-panel .mk-col h2{font-size:17px;margin:0 0 10px}
  .mk-v25n-panel .mk-moblist{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;max-height:none;overflow:visible;padding:0}
  .mk-v25n-panel .mk-mobitem{flex-direction:column;align-items:center;text-align:center;min-height:104px;padding:8px 4px;gap:6px;font-size:13px}
  .mk-v25n-panel .mk-mobitem img,.mk-v25n-panel .mk-mobitem canvas{width:56px!important;height:56px!important;image-rendering:pixelated;object-fit:contain}
  .mk-v25n-panel .mk-styles{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;overflow:visible!important;flex-wrap:wrap;
  }
  .mk-v25n-panel .mk-style-btn{min-height:48px;font-size:14px;white-space:normal;width:100%}
  .mk-v25n-panel .mk-mini-toggle{display:none!important}
  .mk-v25n-panel details.mk-acc{margin-bottom:10px}
  .mk-v25n-panel input,.mk-v25n-panel select,.mk-v25n-panel textarea{font-size:16px}
  .mk-v25n-panel .mk-pip-btn{min-height:44px;min-width:44px;padding:4px 10px}
  .mk-v25n-panel .mk-pip-tag{min-height:44px;padding:4px 12px}

  /* Pop Save: nút lớn rõ ràng */
  .mk-v25n-save{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
  .mk-v25n-big{
    display:flex;align-items:center;justify-content:center;gap:8px;min-height:54px;border-radius:14px;
    border:1px solid var(--c-line);background:var(--c-card);color:var(--c-ink);font:700 15.5px/1 Rajdhani,system-ui,sans-serif;cursor:pointer;
  }
  .mk-v25n-big svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
  .mk-v25n-big--pri{background:linear-gradient(135deg,#e03131,#c92a2a);color:#fff;border-color:transparent}
  .mk-v25n-row{display:flex;align-items:center;gap:10px;min-height:44px;font-size:14.5px;color:var(--c-ink)}
  .mk-v25n-row input{width:20px;height:20px}
  .mk-v25n-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:6px 0 10px}
  .mk-v25n-grid > *{
    display:flex;align-items:center;justify-content:center;text-align:center;min-height:46px;padding:6px 8px;border-radius:12px;
    border:1px solid var(--c-line);background:var(--c-soft);color:var(--c-ink);font:600 14px/1.2 Rajdhani,system-ui,sans-serif;text-decoration:none;cursor:pointer;
  }
  .mk-v25n-note{font-size:12.5px;color:var(--c-mut);margin:4px 0 0}
  .mk-v25n-msg{font-size:13px;color:var(--c-acc2);min-height:18px;margin:6px 0 0}
}
