/* Trang /huong-dan (site/public/huong-dan.html): hướng dẫn sử dụng thiết bị AQUA-S20 và ứng dụng
   AFARCO Aqua. Nạp sau legal.css và dùng lại token của nó; ở đây chỉ có hình, bước, bảng và bản in.
   Ảnh ở /assets/huong-dan: thiết bị và LCD xuất từ simulator firmware (tests/sim/web), màn hình app
   từ ảnh nghiệm thu Android (customer/android/app/src/test/screenshots) và emulator. */

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.actions a, .actions button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgb(255 255 255 / 0.28); background: none; color: var(--on-navy);
  text-decoration: none; font: 600 15px var(--font); cursor: pointer; }
.actions a:hover, .actions button:hover { background: rgb(255 255 255 / 0.1); }
.actions .primary { background: var(--on-navy); color: var(--navy); border-color: var(--on-navy); }
.actions .primary:hover { background: var(--on-navy-2); }
.actions .icon { width: 18px; height: 18px; }

/* Mục lục ba phần */
.toc-parts { display: grid; gap: 14px; margin: 16px 0 4px; }
@media (min-width: 720px) { .toc-parts { grid-template-columns: repeat(3, 1fr); } }
.toc-parts section { padding: 16px 18px; border-radius: var(--radius-box); background: var(--canvas); }
.toc-parts h3 { margin: 0 0 6px; font-size: 15px; color: var(--primary); }
.toc-parts ol { margin: 0; counter-reset: none; }
.toc-parts li { padding: 0; margin: 0; counter-increment: none; }
.toc-parts li::before { content: none; }
.toc-parts a { display: flex; gap: 4px; padding: 4px 0; color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.45; }
.toc-parts a:hover { color: var(--primary); }
.toc-parts a span { flex: none; min-width: 26px; color: var(--primary); font-weight: 600; }

.part { margin: 0 0 4px; color: var(--primary); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.part + h2 { margin-top: 6px; }
.lead { color: var(--ink-2); font-size: 17px; }

/* Tải ứng dụng: mã QR + nút cửa hàng */
.stores { display: grid; gap: 12px; margin: 14px 0 10px; }
@media (min-width: 560px) { .stores { grid-template-columns: 1fr 1fr; } }
.store { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: var(--radius-box);
  border: 1px solid var(--line); background: var(--primary-tint); color: var(--ink-2); text-decoration: none; }
.store:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.store img { width: 112px; height: 112px; flex: none; border-radius: 8px; background: #fff; }
.store .label { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.store .value { display: block; color: var(--ink); font-weight: 800; font-size: 19px; line-height: 1.3; }
.store .hint { display: block; color: var(--primary); font-size: 14px; font-weight: 600; margin-top: 4px; }

/* Hình */
.fig { margin: 18px 0 22px; }
.fig img { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; text-align: center; }
.fig.device img { border-radius: var(--radius-box); border: 1px solid var(--line); }
.fig.narrow { max-width: 460px; margin-inline: auto; }
.fig.medium { max-width: 620px; margin-inline: auto; }
.fig.lcd { max-width: 400px; margin-inline: auto; }
.fig.lcd img { border-radius: 12px; border: 10px solid #0d0f12; box-shadow: 0 6px 24px rgb(11 46 79 / 0.18); }

/* Thông báo push (cắt từ khay thông báo Android) và tin Zalo */
.fig.push { max-width: 540px; margin-inline: auto; }
.fig.push img { border-radius: 26px; box-shadow: 0 8px 28px rgb(11 46 79 / 0.14); }
.zalo { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 14px 0 22px; align-items: flex-start; }
.zalo .fig { margin: 0; flex: 0 1 360px; }
.zalo img { border-radius: 14px; border: 1px solid var(--line); }

/* Ảnh điện thoại: một hàng, tự xuống dòng trên màn hình hẹp. */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 16px 14px; margin: 16px 0 22px; align-items: start; }
@media (min-width: 720px) { .shots { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px 16px; } }
.shots.two { grid-template-columns: repeat(auto-fit, minmax(128px, 210px)); justify-content: center; }
.shots.one { grid-template-columns: minmax(0, 230px); justify-content: center; }
.phone { margin: 0; }
.phone img { display: block; width: 100%; height: auto; border-radius: 22px; border: 6px solid #10202f; background: #fff;
  box-shadow: 0 8px 28px rgb(11 46 79 / 0.14); }
.phone figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: center; }
.phone figcaption b { display: block; color: var(--ink); font-size: 14px; }

/* Ảnh các bước lắp đặt: lưới 2 cột */
.steps-fig { display: grid; gap: 16px; margin: 8px 0 22px; align-items: start; }
@media (min-width: 600px) { .steps-fig { grid-template-columns: 1fr 1fr; } }
.steps-fig .fig { margin: 0; }
.steps-fig figcaption { text-align: left; }
.steps-fig figcaption b { color: var(--ink); }

/* Thiết bị + màn hình đặt cạnh nhau */
.duo { display: grid; gap: 18px; align-items: center; margin: 16px 0 22px; }
@media (min-width: 680px) { .duo { grid-template-columns: 1fr 1fr; } }
.duo .fig { margin: 0; }

/* Bảng */
.table-wrap { overflow-x: auto; margin: 12px 0 18px; border: 1px solid var(--line); border-radius: var(--radius-box); }
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
table.grid th, table.grid td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid th { background: var(--primary-tint); color: var(--ink); font-weight: 600; }
table.grid td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* Phím trên thiết bị */
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 7px;
  border-radius: 8px; background: #1b1d20; color: #fff; font-size: 13px; font-weight: 600; line-height: 1; vertical-align: 1px; }
.path { color: var(--ink); font-weight: 600; }

/* Danh sách bộ phận đánh số theo hình */
dl.parts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 8px 0 16px; }
dl.parts dt { color: var(--ink); font-weight: 600; }
dl.parts dd { margin: 0; }
@media (max-width: 520px) { dl.parts { grid-template-columns: 1fr; gap: 0; } dl.parts dd { margin-bottom: 8px; } }

.note.ok { background: #E3F4EA; color: #14532D; }

/* ── Bản in / PDF: A4, mỗi phần sang trang mới, không cắt ngang hình ── */
@page { size: A4; margin: 14mm 13mm 16mm; }
@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.55; }
  .actions, .ripples, .waves { display: none !important; }
  /* Giữ nền navy ở bìa và chân trang: logo AFARCO nét trắng, nền trắng thì mất logo. */
  .hero, footer { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .hero { background: radial-gradient(120% 90% at 78% 0%, var(--night-top) 0%, var(--navy) 68%); color: var(--on-navy);
    padding: 22px 26px 28px; border-radius: 16px; margin-bottom: 18px; }
  .hero h1, .brand { color: var(--on-navy); }
  .lede { color: var(--on-navy-2); }
  .eyebrow { margin-top: 26px; color: var(--on-navy-overline); }
  .switch { display: none; }
  footer { background: var(--navy); color: var(--on-navy-muted); border-radius: 12px; }
  main { padding: 0; }
  .card { margin: 0; }
  .card + .card { break-before: page; }
  h2 { break-after: avoid; margin-top: 26px; }
  h3 { break-after: avoid; }
  .fig, .phone, .duo, .table-wrap, .note, dl.parts, ol > li, .stores, .zalo, .keep { break-inside: avoid; }
  /* The step number box is taller than one line; keep it inside its item so a page break cannot cut it. */
  ol > li { min-height: 30px; }
  .zalo { flex-wrap: nowrap; gap: 10px; }
  .zalo .fig { flex: 1 1 0; }
  .fig.push { max-width: 420px; }
  .fig.push img { box-shadow: none; }
  .stores { grid-template-columns: 1fr 1fr; }
  .store .hint { display: none; }
  .shots, .shots.two, .shots.one { grid-template-columns: repeat(5, 1fr); gap: 10px; justify-content: start; }
  .duo .shots.one { grid-template-columns: minmax(0, 200px); justify-content: center; }
  .phone img { box-shadow: none; border-width: 3px; border-radius: 14px; }
  .fig.lcd { max-width: 300px; }
  .fig.lcd img { box-shadow: none; border-width: 6px; }
  .fig.device.full { max-width: 520px; margin-inline: auto; }
  .toc-parts section { background: none; border: 1px solid var(--line); }
  a { color: inherit; text-decoration: none; }
  footer { margin-top: 12px; }
}
