/* src/css/on-tap.css – Ôn tập (flashcard). Dùng chung các lớp hoc-* của hoc-an-sao.css (nạp sau tệp đó).
   Màu theo theme: biến --hs-* (chung với Học an sao) và --ot-* khai báo trong theme.css.
   Thẻ ôn, khối thống kê (nền giấy), nút chấm Quên/Khó/Được/Dễ và thanh nút mobile giữ màu riêng ở mọi theme. */
   .ot-page { display: none; }
   body[data-layout="desktop"].mb-page-on .ot-page,
   body[data-layout="mobile"].on-open .ot-page {
     display: block;
     position: fixed; left: 0; right: 0;
     overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
     color: var(--hs-chu); font: 14px/1.55 Arial, sans-serif;
     background: var(--ot-nen);
     background-attachment: fixed;
   }
   body[data-layout="desktop"].mb-page-on .ot-page { top: 44px; bottom: 0; z-index: 940; }
   body[data-layout="mobile"].on-open .ot-page {
     top: calc(48px + env(safe-area-inset-top)); bottom: 0; z-index: 8960;      /* trên trang Học (8950), dưới thanh trên cùng */
     padding-bottom: env(safe-area-inset-bottom);
   }
   body[data-layout="mobile"].on-open { overflow: hidden; }
   .ot-wrap { max-width: 860px; }
   
   /* ── Tổng quan ──────────────────────────────────────────────── */
   .ot-so { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 auto 18px; max-width: 640px; }
   body[data-layout="mobile"] .ot-so { grid-template-columns: repeat(2, 1fr); }
   .ot-so > div {
     display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 14px;
     background: var(--hs-the); border: 1px solid var(--ot-vien);
   }
   .ot-so b { font: 900 26px 'Playfair Display', Georgia, serif; color: var(--hs-tieu); }
   .ot-so span { font-size: 12px; color: var(--hs-mo); }
   .ot-so-kq .ot-r0 b { color: var(--ot-r0); } .ot-so-kq .ot-r1 b { color: var(--ot-r1); } .ot-so-kq .ot-r2 b { color: var(--ot-r2); } .ot-so-kq .ot-r3 b { color: var(--ot-r3); }
   .ot-bd { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
   .ot-bd-nut { min-width: min(320px, 100%); height: 46px; font-size: 15px; }
   .ot-xong { padding: 12px 18px; border-radius: 12px; background: rgba(127, 214, 160, .12); color: var(--ot-xong); }
   .ot-them { color: var(--hs-vang); }
   .ot-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
   body[data-layout="mobile"] .ot-cards { grid-template-columns: 1fr; }
   .ot-khoi { padding: 16px 18px; border-radius: 14px; background: #fffdf7; color: #2b2112; box-shadow: var(--hs-the-bong); }
   .ot-khoi h3 { margin: 0 0 10px; font: 700 16px 'Playfair Display', Georgia, serif; color: #1b2350; }
   .ot-khoi h3 small { font: bold 12px Arial, sans-serif; color: #8b5e1a; margin-left: 4px; }
   .ot-h3-2 { margin-top: 18px !important; }
   .ot-mo { margin: 0 0 10px; font-size: 13px; color: #6b5a3a; }
   .ot-rong { padding: 10px 0; font-style: italic; color: #8a7a5a; }
   .ot-chu { display: flex; gap: 14px; margin-bottom: 8px; font-size: 11px; color: #7a5c2a; }
   .ot-chu i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
   .ot-chu i.hoc, .ot-chang-bar i.hoc { background: #e0c48a; }
   .ot-chu i.thuoc, .ot-chang-bar i.thuoc { background: #2e8b57; }
   .ot-chang { display: grid; grid-template-columns: 1fr 90px 44px; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; }
   .ot-chang-ten { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
   .ot-chang-bar { position: relative; height: 6px; border-radius: 99px; background: #efe6cf; overflow: hidden; }
   .ot-chang-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
   .ot-chang-so { text-align: right; font-size: 12px; color: #7a5c2a; font-variant-numeric: tabular-nums; }
   .ot-dong { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; }
   .ot-dong input[type="number"] { width: 70px; margin-left: auto; padding: 5px 8px; border: 1px solid #d9cba6; border-radius: 8px; font: 14px Arial, sans-serif; }
   .ot-chon-chang { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; }
   .ot-chon-chang label { display: flex; align-items: center; gap: 6px; }
   
   /* Thẻ "Ôn tập hôm nay" trên bản đồ Học an sao (nằm trong .hoc-page → dùng bảng --hs-*) */
   .ot-map {
     display: flex; align-items: center; gap: 14px; width: min(560px, 100%); margin: -6px auto 22px; padding: 12px 16px;
     border: 1px solid var(--hs-vien-dam); border-radius: 14px;
     background: linear-gradient(120deg, rgba(242, 200, 110, .16), var(--hs-back-nen));
     color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s, background .15s;
   }
   .ot-map:hover { transform: translateY(-2px); background: linear-gradient(120deg, rgba(242, 200, 110, .24), var(--hs-o-nen)); }
   .ot-map-icon { flex: 0 0 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--hs-vang-dac); color: var(--hs-tren-vang); font-size: 18px; }
   .ot-map-chu { flex: 1; display: flex; flex-direction: column; min-width: 0; }
   .ot-map-chu b { color: var(--hs-tieu); font-size: 15px; }
   .ot-map-chu span { font-size: 12.5px; color: var(--hs-phu); }
   .ot-map-mui { font-size: 26px; color: var(--hs-vang); }
   
   /* ── Phiên ôn: thẻ ──────────────────────────────────────────── */
   .ot-wrap-phien { max-width: 620px; }
   .ot-prog { margin: 0 auto 16px; width: 100%; }
   .ot-the-khung { perspective: 1200px; }
   .ot-the {
     position: relative; min-height: 260px; padding: 18px 20px 16px; border-radius: 18px;
     background: #fffdf7; color: #2b2112; box-shadow: var(--ot-the-bong);
     cursor: pointer; outline: none; touch-action: pan-y;
     transition: transform .16s ease-in, box-shadow .2s;
   }
   .ot-the.dang-lat { transform: rotateY(90deg); }
   .ot-the.lat-xong { animation: ot-lat .22s ease-out; }
   @keyframes ot-lat { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }
   .ot-the.lat { cursor: default; }
   .ot-the.vuot-phai { box-shadow: 0 0 0 4px #2e8b57, var(--ot-the-bong); }
   .ot-the.vuot-trai { box-shadow: 0 0 0 4px #c0392b, var(--ot-the-bong); }
   .ot-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
   .ot-chip { padding: 2px 9px; border-radius: 99px; font: bold 11px Arial, sans-serif; background: #efe6cf; color: #7a5c2a; }
   .ot-chip.ot-kt { background: #1b2350; color: #f2c86e; }
   .ot-chip.ot-bt { background: #8b5e1a; color: #fff; }
   .ot-chip.ot-tc { background: #2e6b5a; color: #fff; }
   .ot-chip.ot-moi { background: #fff1c9; color: #8b5e1a; }
   .ot-cau { font-size: 18px; line-height: 1.55; text-align: center; margin: 10px 0 14px; }
   .ot-cau b { color: #8b5e1a; }
   .ot-cau-nho { font-size: 14px; color: #6b5a3a; margin: 0 0 8px; }
   .ot-gach { height: 1px; margin: 4px 0 12px; background: linear-gradient(90deg, transparent, #d9cba6, transparent); }
   .ot-dap { font-size: 18px; line-height: 1.55; text-align: center; font-weight: bold; color: #1b2350; }
   .ot-dap.ok { color: #2e8b57; } .ot-dap.no { color: #c0392b; }
   .ot-giai { margin-top: 10px; font-size: 14px; line-height: 1.6; color: #4a3a22; text-align: center; }
   .ot-giai b { color: #8b5e1a; }
   .ot-lat-goiy { margin-top: 12px; text-align: center; font-size: 12px; color: #a08a5c; }
   .ot-ban { max-width: 340px; margin: 12px auto 0; }
   .ot-the .hoc-lc { margin-bottom: 4px; }
   .ot-the .hoc-bang { text-align: left; }
   .ot-nut { margin-top: 14px; display: flex; justify-content: center; }
   .ot-nut-lat { min-width: min(260px, 100%); height: 44px; }
   .ot-nut .ui-btn-ghost { color: var(--hs-vang); border: 1px solid var(--ot-vien-dam); }   /* nút viền trên nền trang */
   .ot-cham { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; width: 100%; }
   .ot-r {
     display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 4px;
     border: 0; border-radius: 12px; cursor: pointer; touch-action: manipulation;
     font: 14px Arial, sans-serif; color: #fff; transition: transform .1s, filter .1s;
   }
   .ot-r:hover { filter: brightness(1.1); transform: translateY(-1px); }
   .ot-r span { font-size: 11.5px; opacity: .85; }
   .ot-r0 { background: #b23a2c; } .ot-r1 { background: #b07a1c; } .ot-r2 { background: #2e7d52; } .ot-r3 { background: #2f5f9e; }
   .ot-goiy { margin-top: 12px; text-align: center; font-size: 12px; color: var(--hs-mo-2); }
   
   
   /* Mobile, đang ôn: thanh nút (Lật thẻ / Không biết / Quên – Khó – Được – Dễ) thay chỗ thanh tab đáy, ngón cái dễ chạm */
   body[data-layout="mobile"].on-open.ot-phien .ot-page { bottom: calc(64px + env(safe-area-inset-bottom)); }
   body[data-layout="mobile"].on-open.ot-phien .ot-nut {
     position: fixed; left: 0; right: 0; bottom: 0; z-index: 9001; margin: 0;
     height: calc(64px + env(safe-area-inset-bottom)); box-sizing: border-box; align-items: center;
     padding: 7px calc(10px + env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left));
     background: var(--ui-mtop); border-top: 1px solid var(--ui-mtop-vien);    /* như thanh trên cùng: luôn tối ở mọi theme */
     --hs-vang: #f2c86e; --ot-vien-dam: rgba(240, 205, 135, .45);              /* nút viền trên thanh tối */
   }
   body[data-layout="mobile"].on-open.ot-phien .ot-nut-lat { width: 100%; min-width: 0; height: 48px; }
   body[data-layout="mobile"].on-open.ot-phien .ot-cham { height: 50px; gap: 6px; }
   body[data-layout="mobile"].on-open.ot-phien .ot-r { padding: 5px 2px; justify-content: center; }
   
   /* ── Thẻ của tôi ────────────────────────────────────────────── */
   .ot-form { padding: 16px 18px; border-radius: 14px; background: #fffdf7; color: #2b2112; box-shadow: var(--hs-the-bong); margin-bottom: 16px; }
   .ot-form h3 { margin: 0 0 10px; font: 700 16px 'Playfair Display', Georgia, serif; color: #1b2350; }
   .ot-form label { display: block; margin-bottom: 10px; font: bold 12px Arial, sans-serif; color: #7a5c2a; }
   .ot-form textarea, .ot-form select {
     display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 8px 10px;
     border: 1px solid #d9cba6; border-radius: 8px; background: #fff;
     font: 14px/1.5 Arial, sans-serif; color: #1a1008; resize: vertical;
   }
   .ot-form textarea:focus, .ot-form select:focus { outline: none; border-color: #c48a2c; }
   .ot-loi { min-height: 1.2em; margin-top: 6px; color: #c0392b; font-size: 13px; }
   .ot-ds { display: flex; flex-direction: column; gap: 8px; }
   .ot-ds-the { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: rgba(255, 253, 247, .96); color: #2b2112; box-shadow: var(--ot-ds-vien); }
   .ot-ds-the.dang-sua { box-shadow: 0 0 0 2px #f2c86e; }
   .ot-ds-chu { flex: 1; min-width: 0; }
   .ot-ds-truoc { font-weight: bold; color: #1b2350; }
   .ot-ds-sau { margin: 2px 0 6px; color: #4a3a22; font-size: 13px; }
   .ot-ds-chu .ot-chip { margin-right: 4px; }
   .ot-ds-nut { display: flex; flex-direction: column; gap: 4px; }
   .ot-xoa-hoi { background: #c0392b !important; color: #fff !important; }
   
   @media (prefers-reduced-motion: reduce) {
     .ot-the, .ot-the.lat-xong { transition: none; animation: none; }
   }