/* 🌿 NHẮC NGHỈ NGƠI khi làm bài (19/11/2026) — hộp mời nghỉ sau ~30 phút làm bài liên tục. docs/nhac-nghi-ngoi.md
   Chỉ NHẮC, không bao giờ khoá tài khoản. Mọi luật nằm dưới `dialog.nn` để không đụng giao diện trang làm bài.
   Màu theo html[data-theme] của trang làm bài (nút Sáng/Tối) + cài đặt máy. */
dialog.nn{
  --kem:#faf5e9; --kem-sang:#fffdf6; --kem-sau:#f4ecd8; --vien:#e8dcc0; --oliu:#5f6e33; --oliu-dam:#46521f; --oliu-nhat:#eef1e1;
  --nau:#3b3220; --nau-nhat:#7c6f56; --vang:#c9a24a; --troi:#e8f0ec; --tren-oliu:#fff;
  --nay:cubic-bezier(.34,1.4,.64,1);
  border:0; padding:0; background:transparent; max-width:min(480px,calc(100vw - 24px)); width:100%; color:var(--nau);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Roboto,Arial,sans-serif; overflow:visible; margin:auto;
}
html[data-theme="dark"] dialog.nn{
  --kem:#1c1a16; --kem-sang:#26231d; --kem-sau:#2f2b23; --vien:#3d372b; --oliu:#a9b97a; --oliu-dam:#c3d394; --oliu-nhat:#2c3220;
  --nau:#f1e8d4; --nau-nhat:#b5a88c; --vang:#d9b45e; --troi:#243029; --tren-oliu:#14171c;
}
/* 19/11/2026: BỎ backdrop-filter — trên Chrome/Safari nó cùng hộp có animation + cuộn dọc làm vỡ lớp vẽ (dải tối chạy dọc giữa hộp, chữ ghi chú hiện đè sai chỗ). Chỉ làm tối nền, không làm mờ. */
dialog.nn::backdrop{ background:rgba(28,34,26,.5); animation:nn-mo .35s ease; }
@keyframes nn-mo{ from{ opacity:0; } }
dialog.nn *{ box-sizing:border-box; }
dialog.nn .nn-hop{ position:relative; background:var(--kem-sang); border:1px solid var(--vien); border-radius:26px; padding:26px 24px 20px;
  box-shadow:0 30px 70px -28px rgba(40,50,25,.75); animation:nn-len .55s var(--nay); overflow:hidden; max-height:calc(100vh - 24px); max-height:calc(100dvh - 24px); overflow-y:auto; }
@keyframes nn-len{ from{ transform:translateY(18px) scale(.96); opacity:0; } }
dialog.nn .nn-hop::before{ content:""; position:absolute; inset:0 0 auto 0; height:6px; background:linear-gradient(90deg,#8fb39a,var(--vang),#8fb39a); opacity:.9; }
dialog.nn .nn-la{ width:58px; height:58px; margin:0 auto 12px; border-radius:50%; background:var(--troi); display:grid; place-items:center; color:var(--oliu-dam); animation:nn-tho 5s ease-in-out infinite; }
dialog.nn .nn-la svg{ width:30px; height:30px; }
@keyframes nn-tho{ 0%,100%{ transform:scale(1); } 50%{ transform:scale(1.07); } }
dialog.nn h3{ margin:0 0 6px; text-align:center; font-family:"Noto Serif","Iowan Old Style",Palatino,Georgia,serif; font-size:1.38rem; line-height:1.3; color:var(--oliu-dam); font-weight:700; }
dialog.nn .nn-phu{ margin:0 auto; text-align:center; max-width:34ch; font-size:1rem; color:var(--nau-nhat); line-height:1.6; }
dialog.nn .nn-goiy{ list-style:none; margin:16px 0 0; padding:0; display:grid; gap:8px; }
dialog.nn .nn-goiy li{ display:flex; gap:12px; align-items:flex-start; padding:10px 12px; border-radius:14px; background:var(--kem-sau); font-size:.95rem; line-height:1.45; margin:0; }
dialog.nn .nn-goiy li > span{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; background:var(--troi); display:grid; place-items:center; color:var(--oliu-dam); }
dialog.nn .nn-goiy svg{ width:18px; height:18px; } dialog.nn .nn-goiy b{ display:block; color:var(--nau); font-size:.97rem; } dialog.nn .nn-goiy em{ font-style:normal; color:var(--nau-nhat); font-size:.88rem; }
dialog.nn .nn-yen{ margin:12px 0 0; display:flex; gap:8px; font-size:.86rem; color:var(--nau-nhat); line-height:1.5; }
dialog.nn .nn-yen svg{ width:16px; height:16px; flex:0 0 auto; margin-top:3px; color:var(--oliu); }
dialog.nn .nn-nut{ display:grid; gap:8px; margin-top:16px; }
dialog.nn button.nn-btn{ min-height:52px; padding:0 20px; border-radius:999px; border:1px solid var(--vien); background:linear-gradient(180deg,var(--kem-sang),var(--kem-sau)); font:inherit; font-weight:800; font-size:1rem; cursor:pointer; color:var(--oliu-dam); transition:transform .16s var(--nay); box-shadow:none; width:auto; margin:0; }
dialog.nn button.nn-btn:active{ transform:scale(.97); }
dialog.nn button.nn-btn.chinh{ background:linear-gradient(180deg,var(--oliu),var(--oliu-dam)); border-color:var(--oliu-dam); color:var(--tren-oliu); }
dialog.nn button:focus-visible{ outline:3px solid var(--vang); outline-offset:2px; }
dialog.nn .nn-hai{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
dialog.nn button.nn-lk{ border:0; background:none; min-height:44px; font:inherit; font-size:.9rem; font-weight:700; color:var(--oliu); cursor:pointer; text-decoration:underline; text-underline-offset:3px; padding:0 4px; box-shadow:none; }
dialog.nn .nn-cuoi{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; margin-top:4px; }
dialog.nn .nn-hom{ margin:10px 0 0; text-align:center; font-size:.8rem; color:var(--nau-nhat); }
dialog.nn .nn-man{ display:none; } dialog.nn .nn-man.hien{ display:block; animation:nn-vao .4s ease; } @keyframes nn-vao{ from{ opacity:0; transform:translateY(8px); } }

dialog.nn .nn-vong{ position:relative; width:150px; height:150px; margin:14px auto 6px; }
dialog.nn .nn-vong svg{ width:150px; height:150px; transform:rotate(-90deg); } dialog.nn .nn-vong circle{ fill:none; stroke-width:9; }
dialog.nn .nn-vong .nen{ stroke:var(--kem-sau); } dialog.nn .nn-vong .tr{ stroke:var(--oliu); stroke-linecap:round; transition:stroke-dashoffset 1s linear; }
dialog.nn .nn-vong .so{ position:absolute; inset:0; display:grid; place-items:center; font-size:2.2rem; font-weight:800; color:var(--oliu-dam); font-variant-numeric:tabular-nums; }
dialog.nn .nn-thov{ position:relative; width:150px; height:150px; margin:14px auto 6px; display:grid; place-items:center; }
dialog.nn .nn-thov i{ position:absolute; inset:18px; border-radius:50%; background:radial-gradient(circle,var(--troi),transparent 72%); animation:nn-hit 8s ease-in-out infinite; }
dialog.nn .nn-thov i:nth-child(2){ inset:34px; background:var(--oliu-nhat); opacity:.8; animation-delay:.15s; }
@keyframes nn-hit{ 0%,100%{ transform:scale(.72); } 50%{ transform:scale(1.18); } }
dialog.nn .nn-thov span{ position:relative; font-size:1rem; font-weight:700; color:var(--oliu-dam); }
dialog.nn .nn-dem{ text-align:center; font-size:1.9rem; font-weight:800; color:var(--oliu-dam); font-variant-numeric:tabular-nums; }

dialog.nn .nn-chon{ display:grid; gap:8px; margin-top:12px; }
dialog.nn .nn-chon button{ min-height:50px; padding:0 16px; text-align:left; border-radius:14px; border:2px solid var(--vien); background:var(--kem); font:inherit; font-weight:700; font-size:.98rem; cursor:pointer; display:flex; justify-content:space-between; align-items:center; color:var(--nau); box-shadow:none; width:auto; margin:0; }
dialog.nn .nn-chon button[aria-pressed="true"]{ border-color:var(--oliu); background:var(--oliu-nhat); }
dialog.nn .nn-chon button[aria-pressed="true"]::after{ content:"✓"; color:var(--oliu); font-weight:800; }
dialog.nn .nn-ghichu{ margin:12px 0 0; padding:10px 12px; border-radius:12px; background:rgba(201,162,74,.16); font-size:.86rem; color:var(--nau); line-height:1.55; }
dialog.nn .nn-tab{ display:flex; gap:6px; margin-top:12px; } dialog.nn .nn-tab button{ flex:1; min-height:44px; border-radius:12px; border:1px solid var(--vien); background:var(--kem); font:inherit; font-weight:700; cursor:pointer; color:var(--nau); padding:0 4px; box-shadow:none; width:auto; margin:0; }
dialog.nn .nn-tab button[aria-selected="true"]{ background:var(--oliu); color:var(--tren-oliu); border-color:var(--oliu); }
dialog.nn ol.nn-buoc{ margin:12px 0 0; padding-left:0; list-style:none; counter-reset:nnb; display:grid; gap:8px; }
dialog.nn ol.nn-buoc li{ counter-increment:nnb; display:flex; gap:12px; font-size:.95rem; line-height:1.5; margin:0; }
dialog.nn ol.nn-buoc li::before{ content:counter(nnb); flex:0 0 auto; width:28px; height:28px; border-radius:50%; background:var(--oliu-nhat); color:var(--oliu-dam); display:grid; place-items:center; font-weight:800; font-size:.85rem; margin-top:1px; }
dialog.nn button.nn-quay{ border:0; background:none; min-height:44px; padding:0 4px; font:inherit; font-weight:700; font-size:.9rem; color:var(--oliu); cursor:pointer; box-shadow:none; }
@media (max-width:520px){ dialog.nn .nn-hai{ grid-template-columns:1fr; } dialog.nn .nn-hop{ padding:22px 18px 16px; } }
@media (prefers-reduced-motion: reduce){ dialog.nn *, dialog.nn::backdrop{ animation:none !important; transition:none !important; } }

/* Ô nhập số phút tự do */
dialog.nn .nn-tuy{ margin-top:14px; }
dialog.nn .nn-tuy label{ display:block; font-size:.9rem; font-weight:700; color:var(--nau-nhat); margin-bottom:6px; }
dialog.nn .nn-tuy-hang{ display:flex; align-items:center; gap:8px; }
dialog.nn .nn-tuy-hang input{ width:5.5em; min-height:48px; padding:0 12px; font:inherit; font-size:1.05rem; font-weight:700; text-align:center; border:2px solid var(--vien); border-radius:14px; background:var(--kem); color:var(--nau); -moz-appearance:textfield; }
dialog.nn .nn-tuy-hang input:focus-visible{ outline:3px solid var(--vang); outline-offset:2px; border-color:var(--oliu); }
dialog.nn .nn-tuy-hang span{ color:var(--nau-nhat); font-weight:700; }
dialog.nn .nn-tuy-hang button.nn-btn{ min-height:48px; padding:0 20px; }
dialog.nn .nn-loi{ margin:6px 0 0; min-height:1.2em; font-size:.86rem; color:#a8452f; }
html[data-theme="dark"] dialog.nn .nn-loi{ color:#e08468; }

/* Nút ở trang làm bài (viên thuốc cạnh «Cổng học viên») và dòng trong ⚙️ Cài đặt của Cổng */
button.nn-pill{ display:inline-flex; align-items:center; gap:6px; vertical-align:top; margin:6px 0 12px 8px; padding:10px 18px; min-height:44px; border-radius:999px; border:1.5px solid rgba(95,110,51,.55); background:rgba(255,253,246,.95); color:#46521f; font:700 .94rem/1.2 system-ui,-apple-system,"Segoe UI",sans-serif; cursor:pointer; -webkit-tap-highlight-color:transparent; }
button.nn-pill:hover{ background:#fff; } button.nn-pill:focus-visible{ outline:3px solid #c9a24a; outline-offset:2px; }
button.nn-pill b{ font-weight:800; }
html[data-theme="dark"] button.nn-pill{ background:rgba(44,40,32,.95); color:#c3d394; border-color:rgba(169,185,122,.55); }
#nn-cd-btn .nn-cd-gt{ margin-left:auto; margin-right:6px; font-weight:700; color:#7c6f56; font-size:.92rem; }
@media (max-width:420px){ button.nn-pill{ margin-left:0; } }
#khu-cai-dat #nn-cd-btn::after{ margin-left:0 !important; }
