/* dothi.css — giao diện đồ thị kéo thử (dothi.js), dùng chung cho app (khối ceao-dothi trong Hỏi AI) và trang Tóm tắt SGK.
   Chỉ dùng biến màu của app, mỗi biến có giá trị dự phòng cho trang công khai; chế độ tối tự theo biến. */
.dt-body { --dt-cw: var(--cw, #4f6bff); --dt-line: #f59a78; font-size: 16.5px; line-height: 1.5; color: var(--label, #1d1d1f); overflow-wrap: anywhere; }
/* Chú giải hàm */
.dt-lgs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 10px; }
.dt-lg { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }
.dt-lg > i { flex: none; width: 14px; height: 4px; border-radius: 2px; }
.dt-f { font-family: KaTeX_Math, 'Times New Roman', serif; font-size: 18px; }
/* Nút viên thuốc: hàm mẫu, Đặt lại (như .cw-pill của app, vùng bấm ≥ 44px nhờ ::before) */
.dt-pill {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--fill, rgba(120, 120, 128, 0.14)); color: var(--label, #1d1d1f); font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), background 0.2s;
}
.dt-pill::before { content: ''; position: absolute; inset: -4px; }
.dt-pill:active { transform: scale(0.96); transition-duration: 0.1s; }
.dt-pill.on { background: color-mix(in srgb, var(--dt-cw) 16%, transparent); color: var(--dt-cw); }
.dt-pill .dt-f { font-size: 17px; font-weight: 400; }
.dt-samples { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; margin: -4px -2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.dt-samples::-webkit-scrollbar { display: none; }
/* Hình vẽ */
.dt-svg { display: block; width: 100%; max-width: 620px; height: auto; margin: 0 auto; border-radius: 16px; background: var(--fill-2, var(--fill, rgba(120, 120, 128, 0.08))); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: crosshair; }
.dt-svg .gr { stroke: var(--gx-line, var(--sep, rgba(0, 0, 0, 0.12))); stroke-width: 0.6; }
.dt-svg .ax { stroke: var(--label-2, #6e6e73); stroke-width: 1.1; }
.dt-svg .lb { fill: var(--label-2, #6e6e73); font-size: 10.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.dt-svg .ax-n { fill: var(--label, #1d1d1f); font-style: italic; font-weight: 600; font-size: 12px; }
.dt-svg .cv { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dt-svg .rd { pointer-events: none; } /* nhóm đọc toạ độ không đỡ cú bấm vào đường y = m */
.dt-svg .rd-l { stroke: var(--label-3, var(--label-2, #6e6e73)); stroke-width: 0.8; stroke-dasharray: 3 3; }
.dt-svg .rd circle { fill: var(--dt-cw); stroke: var(--gx-page, var(--card, #fff)); stroke-width: 2; }
.dt-svg .rd-bg { fill: var(--gx-page, var(--card, #fff)); stroke: var(--gx-line, var(--sep, rgba(0, 0, 0, 0.12))); stroke-width: 0.6; }
.dt-svg .rd-t { fill: var(--label, #1d1d1f); font-weight: 600; font-size: 11.5px; }
/* Đường ngang y = m: nét đứt tông cam san hô của logo, kéo được bằng dải trong suốt .dt-mh */
.dt-m .dt-ml { stroke: var(--dt-line); stroke-width: 2; stroke-dasharray: 6 4; }
.dt-mh { fill: transparent; cursor: ns-resize; touch-action: none; }
.dt-mt { fill: var(--label, #1d1d1f); font-weight: 700; font-size: 11.5px; }
/* Đoạn [p; q]: dải dọc mờ, chấm hai đầu mút, nhãn x = … dưới trục; Diện tích: miền tô giữa đồ thị và trục Ox (tông cam của đường y = m) */
.dt-svg .dt-seg { fill: color-mix(in srgb, var(--dt-cw) 10%, transparent); }
.dt-svg .dt-pt { fill: var(--dt-cw); stroke: var(--gx-page, var(--card, #fff)); stroke-width: 2; }
.dt-svg .dt-st { fill: var(--dt-cw); font-weight: 700; }
.dt-svg .dt-area { fill: color-mix(in srgb, var(--dt-line) 28%, transparent); stroke: none; }
/* Thanh trượt tham số + đường ngang, nút Đặt lại ở cuối dãy */
.dt-sls { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 18px; align-items: center; margin-top: 12px; }
.dt-sl { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.dt-sl > span { flex: none; min-width: 74px; font-variant-numeric: tabular-nums; }
.dt-sl > span i { font-family: KaTeX_Math, 'Times New Roman', serif; font-size: 18px; }
.dt-sl input { flex: 1; min-width: 0; height: 32px; margin: 0; accent-color: var(--dt-cw); }
.dt-sl.dt-line input { accent-color: var(--dt-line); }
.dt-sls .dt-pill { justify-self: start; }
/* Dòng đọc tự tính */
.dt-read { margin-top: 10px; }
.dt-read p { margin: 6px 0; }
.dt-cur { font-weight: 700; }
/* Thử thách */
.dt-try { margin-top: 12px; }
.dt-try-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dt-try-n { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--fill, rgba(120, 120, 128, 0.14)); color: var(--label-2, #6e6e73); font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; transition: background 0.2s, color 0.2s; }
.dt-try.all .dt-try-n { background: color-mix(in srgb, var(--green, #248a3d) 18%, transparent); color: var(--green, #248a3d); }
.dt-try ul { list-style: none; padding: 0; margin: 6px 0 0; }
.dt-try li { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.dt-try li > i { position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--label-3, var(--label-2, #6e6e73)); transition: background 0.25s, box-shadow 0.25s; }
.dt-try li.on > i { background: var(--green, #248a3d); box-shadow: inset 0 0 0 1.5px var(--green, #248a3d); }
.dt-try li.on > i::after { content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.dt-try li.on > span { color: var(--green, #248a3d); font-weight: 600; }
/* Khung trên trang Tóm tắt SGK (giống .card của trang đó: nền --card, viền inset --sep, bo 20px) */
.dt-wrap { --cw: #4f6bff; margin: 16px 0; padding: 14px 16px; border-radius: 20px; background: var(--card, #fff); box-shadow: inset 0 0 0 1px var(--sep, rgba(0, 0, 0, 0.1)); }
.dt-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; }
.dt-tag { color: var(--cw, #4f6bff); font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.dt-title { font-size: 17px; font-weight: 700; }
@media (max-width: 480px) {
  .dt-sls { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dt-pill, .dt-try-n, .dt-try li > i { transition: none; }
}
