/* =========================================================================
   guide.css — KHUNG HUONG DAN HIEN SAU KHI TAI

   Cap voi shared/js/download.js. Khung do JS dung len (khong co san trong
   HTML), nen tep nay phai duoc nap o MOI trang co nut tai.

   Vi sao hien ANH chu khong nhung PDF: xem ghi chu dau download.js.
   ========================================================================= */

.guide {
  position: fixed;
  inset: 0;
  z-index: 120;                 /* tren nav (100), duoi toast (200) */
  display: none;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  overflow-y: auto;
}

.guide.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide__box {
  width: min(920px, 100%);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--sh-xl);
  overflow: hidden;
  animation: guide-in .22s ease-out both;
}

@keyframes guide-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.guide__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  /* Vien vang mong o canh tren: bao day la thong bao, khong phai loi. */
  box-shadow: inset 0 3px 0 var(--accent-solid);
}

.guide__head b { font-size: .96rem; line-height: 1.4; }

/* Anh la phan chinh: cho no an het cho con lai va tu cuon neu man hinh thap. */
.guide__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface-2);
}

.guide__body img {
  display: block;
  width: 100%;
  height: auto;
}

.guide__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* Dien thoai: bo le ngoai cho anh rong het co, chan trang tranh vung vuot
   cua he dieu hanh. */
@media (max-width: 640px) {
  .guide { padding: 0; }

  .guide__box {
    width: 100%;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .guide__foot {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .guide__foot .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .guide__box { animation: none; }
}
