/* v1.7.59 – BS126 "Nhờ AI nhận dạng" – theo 3 bản Gemini Canvas (hộp xác nhận · màn xem lại chọn câu / sau AI · ngăn kiểm đáp án khi Giao bài) */
.rv-ndslot { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.rv-ndq { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 14px; border: 1px solid var(--line); }
.rv-nd { min-height: 44px; border: 1.5px solid var(--accent); color: var(--accent); background: var(--surface); display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rv-nd:hover { background: #f0fdfa; } .rv-nd[aria-pressed="true"] { background: #f0fdfa; }
.rv-ndn { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; }
/* chế độ chọn */
.rc-ndck { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -10px 2px -10px -10px; cursor: pointer; flex: none; }
.rc-ndck input { width: 22px; height: 22px; accent-color: var(--accent); pointer-events: none; }
.nd-on .rc:not(:has(.rc-ndck)) { opacity: .6; }
.nd-on .rc:has(.rc-ndck input:checked) { border: 1.5px solid var(--accent); }
.nd-on .rc:has(.rc-ndck input:checked) > .rc-h { background: #f0fdfa; }
.nd-on .rc-ha .rv-big, .nd-on .rc-ha [data-rv="useimg"], .nd-on .rc-ha [data-rv="unimg"], .nd-on .rc-ha .rc-more { display: none; }
.rv-ndbar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70; width: min(760px, calc(100vw - 32px)); }
.rv-ndbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.rv-ndbar-l, .rv-ndbar-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-ndbar .btn { min-height: 44px; }
@media (max-width: 480px) {
  .rv-ndbar { left: 0; bottom: 0; transform: none; width: 100%; }
  .rv-ndbar-in { border-radius: 14px 14px 0 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; }
  .rv-ndbar-l { justify-content: space-between; } .rv-ndbar-r { display: grid; grid-template-columns: 1fr 1fr; }
  .rv-ndslot { margin-left: 0; width: 100%; } .rv-nd { flex: 1; justify-content: center; }
}
/* đang chạy + kết quả */
.rv-ndrun { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.rv-ndrun > i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .3s; }
.rc.nd-busy { position: relative; pointer-events: none; } .rc.nd-busy::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .6); border-radius: inherit; }
.rv-ndres { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 12px; border-radius: 12px; border: 1px solid #99f6e4; background: #f0fdfa; }
.rv-ndres.part, .rv-ndres.fail { border-color: #fde68a; background: #fffbeb; } .rv-ndres.stop { border-color: #fed7aa; background: #fff7ed; }
.rv-ndres > div { flex: 1; } .rv-ndres p { margin: 0 0 8px; font-size: 14px; }
.rv-ndres-ic { color: var(--accent); display: inline-flex; margin-top: 2px; } .rv-ndres.part .rv-ndres-ic, .rv-ndres.fail .rv-ndres-ic { color: #b45309; } .rv-ndres.stop .rv-ndres-ic { color: #c2410c; }
.rv-ndres-p { display: flex; gap: 8px; flex-wrap: wrap; } .rv-ndres .btn.sm { min-height: 36px; }
.btn.nd-or { color: #c2410c; border-color: #fdba74; background: #fff7ed; }
/* thẻ câu sau AI */
.rc-ndok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 8px 6px 12px; margin-bottom: 10px; border-radius: 10px; background: #f0fdfa; color: var(--accent); font-size: 14px; }
.rc-ndok .grow { flex: 1; } .rc-ndok .btn { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.rc-ndno { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 8px; }
.ai-gy { display: inline-flex; align-items: center; margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff7ed; color: #c2410c; border: 1px solid #fdba74; white-space: nowrap; }
.rc-opt .ai-gy { margin-left: auto; } .ed-ai { gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; } .ed-ai .ai-gy { margin-left: 0; } .ed-ai .grow { flex: 1; }
#rvdoc.nd-flash { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
/* hộp xác nhận (cùng khung .ai2-md của Lời giải AI) */
.nd-md .ai2-md { max-width: 480px; }
.nd-md-ht { display: flex; gap: 12px; align-items: flex-start; } .nd-md-ht h2 { margin: 0 0 2px; font-size: 19px; }
.nd-md-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #f0fdfa; color: var(--accent); border: 1px solid #99f6e4; flex: none; }
.nd-md-ct { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; }
.nd-md-q { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); }
.nd-md-q > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.nd-md-sau { align-self: flex-start; padding: 2px 8px; border-radius: 6px; background: #f0fdfa; color: var(--accent); font-size: 13px; border: 1px solid #99f6e4; }
.nd-md-bar { display: flex; height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.nd-md-bar i { background: var(--accent); } .nd-md-bar u { background: #5eead4; }
.nd-md-chips { display: flex; gap: 6px; flex-wrap: wrap; } .nd-md-chips i { font-style: normal; padding: 2px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 13px; }
.nd-md-het { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.nd-md-het > div { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.nd-md-3t { margin: 4px 0 0; } .nd-md-3 { display: flex; flex-direction: column; gap: 8px; }
.nd-md-3 > div { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; }
.nd-md-3 svg { flex: none; color: var(--accent); }
@media (max-width: 480px) { .nd-md { align-items: flex-end; padding: 0; } .nd-md .ai2-md { max-width: none; border-radius: 16px 16px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; } .nd-md .ai2-md-f .btn { min-height: 44px; flex: 1; } }
/* ngăn kiểm đáp án khi Giao bài */
.nd-gate-bg { position: fixed; inset: 0; z-index: 85; background: rgba(15, 23, 42, .45); display: flex; justify-content: flex-end; }
.nd-gate { width: min(780px, 100vw); height: 100%; background: var(--surface); display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(0,0,0,.18); }
.nd-gate header { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.nd-gate h2 { margin: 0 0 4px; font-size: 20px; } .nd-gate header p { margin: 0 0 10px; }
.nd-g-meta { display: flex; gap: 8px; flex-wrap: wrap; } .nd-g-done, .nd-g-pg { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 8px; font-size: 13px; border: 1px solid var(--line); }
.nd-g-done { color: var(--accent); background: #f0fdfa; border-color: #99f6e4; }
.nd-g-body { flex: 1; overflow: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); }
.nd-g-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; } .nd-g-row.ok { border-color: #99f6e4; }
.nd-g-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .nd-g-h .ai-gy { margin-left: 0; }
.nd-g-okc { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 600; }
.nd-g-c { display: grid; grid-template-columns: 55% 1fr; gap: 14px; align-items: start; }
.nd-g-img { min-height: 60px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.nd-g-cv { width: 100%; height: auto; display: block; }
.nd-g-t { display: flex; flex-direction: column; gap: 10px; }
.nd-g-ans { display: flex; gap: 8px; flex-wrap: wrap; } .nd-g-ans button { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.nd-g-ans button.on { border-color: #fdba74; background: #fff7ed; color: #c2410c; } .nd-g-row.ok .nd-g-ans button.on { border-color: var(--accent); background: #f0fdfa; color: var(--accent); }
.nd-g-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; } .nd-g-tf span { display: flex; align-items: center; gap: 6px; }
.nd-g-tf button { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); } .nd-g-tf button.on { border-color: var(--accent); background: #f0fdfa; color: var(--accent); font-weight: 700; }
.nd-g-short input { min-height: 44px; margin-left: 8px; width: 140px; }
.nd-gate footer { display: flex; justify-content: space-between; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.nd-gate footer .btn { min-height: 44px; }
.nd-zoom { position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .8); display: grid; place-items: center; padding: 16px; cursor: zoom-out; } .nd-zoom img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 8px; }
@media (max-width: 640px) { .nd-g-c { grid-template-columns: 1fr; } .nd-gate header { padding: 14px 16px 10px; } .nd-g-body { padding: 12px 16px; } .nd-gate footer { padding-left: 16px; padding-right: 16px; } .nd-gate footer .btn { flex: 1; } }
/* sau soát của Gemini (26/11): thông báo nổi không được đè lên thanh chọn; điện thoại: viên lượt + nút trên MỘT hàng; ngăn kiểm: câu không có ảnh gốc thì không chừa ô trống 55% */
body:has(#rvndbar) #toast { bottom: 108px; }
@media (max-width: 480px) { body:has(#rvndbar) #toast { bottom: 150px; }
  .rv-ndslot { flex-wrap: nowrap; } .rv-ndq { min-height: 44px; padding: 0 10px; white-space: nowrap; font-size: 13px; } .rv-nd { min-width: 0; } }
.nd-g-c.no-img { grid-template-columns: 1fr; } .nd-g-c.no-img .nd-g-img { min-height: 0; padding: 4px 10px; justify-self: start; cursor: default; }
