/* /huong-dan-bot-telegram-phan-mem-tinh-tien-so-de (trang công khai, nằm trong PublicPage): tên bot, mục lục, video cạnh 3 bước kết nối, gửi và huỷ tin, lệnh, lỗi thường gặp.
   Cùng token thương hiệu (brand.css) với /company. */
.bot-page {
  --bot-telegram: #229ed9; /* màu Telegram, chỉ dùng cho biểu tượng bot và nút chọn của bot */
  --bot-divider: color-mix(in srgb, var(--tts-vien) 75%, var(--tts-trang));
  container: bot / inline-size;
  display: grid;
  gap: 14px;
  color: var(--tts-muc);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.55;
}
.bot-page *, .bot-page *::before, .bot-page *::after { box-sizing: border-box; }
.bot-page :is(a, video):focus-visible { outline: 2px solid var(--tts-xanh); outline-offset: 2px; }
.bot-page :is(h1, h2, h3, p, ol, ul, dl, dd, figure) { margin: 0; }
.bot-page code { padding: 2px 7px; border-radius: 5px; background: var(--tts-nen); color: var(--tts-navy); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: nowrap; }
.bot-page [id^="bot-"] { scroll-margin-top: calc(var(--tts-header-height, 0px) + 16px); }

.bot-card { padding: 16px 18px; border: 1px solid var(--tts-vien); border-radius: 10px; background: var(--tts-trang); }
.bot-card h2 { margin-bottom: 12px; color: var(--tts-navy); font-size: 15px; font-weight: 700; line-height: 1.4; }
.bot-card h2 + .bot-card-lead { margin: -6px 0 12px; color: var(--tts-muc-nhat); }

.bot-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 38px; padding: 8px 16px; border: 1px solid var(--tts-xanh); border-radius: 8px; background: var(--tts-xanh); color: var(--tts-trang); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.bot-button:hover { border-color: var(--tts-navy); background: var(--tts-navy); color: var(--tts-trang); text-decoration: none; }
.bot-button.is-outline { background: var(--tts-trang); color: var(--tts-xanh); }
.bot-button.is-outline:hover { border-color: var(--tts-navy); background: color-mix(in srgb, var(--tts-xanh) 8%, var(--tts-trang)); color: var(--tts-navy); }
.bot-link { justify-self: start; display: inline-flex; align-items: center; gap: 6px; color: var(--tts-xanh); font-size: 12px; font-weight: 600; text-decoration: none; }
.bot-link i { font-size: 10px; transition: transform .15s; }
.bot-link:hover { color: var(--tts-navy); text-decoration: none; }
.bot-link:hover i { transform: translateX(2px); }

/* Tên bot */
/* Tiêu đề dùng khuôn chung của trang công khai (public-eyebrow, public-page-heading); nút hành động ở bên phải */
.bot-header { display: flex; align-items: flex-end; gap: 12px 24px; }
.bot-header-text { flex: 1; min-width: 0; }
.tts-public .bot-handle { gap: 7px; color: var(--tts-muc); font-weight: 600; }
.tts-public .bot-handle:hover { border-color: var(--bot-telegram); color: #1a7fb0; }
.bot-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--bot-telegram); color: #fff; font-size: 10px; }
.bot-avatar i { margin-left: -1px; }
.bot-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Mục lục nhảy nhanh */
.bot-toc { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-toc a { padding: 5px 12px; border: 1px solid var(--tts-vien); border-radius: 999px; background: var(--tts-trang); color: var(--tts-muc); font-size: 12px; font-weight: 600; text-decoration: none; }
.bot-toc a:hover { border-color: color-mix(in srgb, var(--tts-xanh) 45%, var(--tts-vien)); color: var(--tts-navy); text-decoration: none; }

/* Video cạnh các bước: vừa xem vừa làm theo */
.bot-main { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, 1fr); gap: 14px; align-items: stretch; }
.bot-video { overflow: hidden; border-radius: 10px; background: #0f1623; }
.bot-video video { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #0f1623; }

.bot-steps { display: flex; flex-direction: column; }
.bot-steps ol { display: grid; gap: 14px; padding: 0; list-style: none; counter-reset: bot-step; }
.bot-steps li { position: relative; display: grid; gap: 3px; padding-left: 36px; counter-increment: bot-step; }
.bot-steps li::before { content: counter(bot-step); position: absolute; top: 0; left: 0; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tts-navy); color: var(--tts-trang); font-size: 12px; font-weight: 700; }
/* đường nối các số thứ tự */
.bot-steps li:not(:last-child)::after { content: ""; position: absolute; top: 28px; bottom: -12px; left: 11.5px; width: 1px; background: var(--tts-vien); }
.bot-steps h3 { color: var(--tts-muc); font-size: 13px; font-weight: 700; line-height: 24px; }
.bot-steps p { color: var(--tts-muc-nhat); }
.bot-steps strong { color: var(--tts-muc); font-weight: 600; }
.bot-sample { justify-self: start; margin-top: 2px; padding: 5px 10px !important; font-size: 13px !important; }
.bot-done { display: flex; align-items: center; gap: 8px; margin-top: auto !important; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, #1d7a45 8%, var(--tts-trang)); color: #1d6b3d; font-weight: 600; }
.bot-steps ol + .bot-done { margin-top: 16px !important; }

/* Gửi và huỷ tin: hội thoại mẫu kiểu Telegram cạnh quy tắc */
.bot-messaging-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.bot-chat ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 14px 12px; list-style: none; border-radius: 10px; background: #dfe8ef; }
.bot-bubble { display: grid; gap: 1px; max-width: 82%; padding: 6px 10px 7px; border-radius: 12px; background: #fff; box-shadow: 0 1px 1px rgb(15 22 35 / .08); }
.bot-bubble.is-player { align-self: flex-end; border-bottom-right-radius: 4px; background: #e3f7d0; }
.bot-bubble.is-bot { align-self: flex-start; border-bottom-left-radius: 4px; }
.bot-bubble-sender { color: #1a7fb0; font-size: 11px; font-weight: 600; }
.bot-bubble.is-player .bot-bubble-sender { color: #3d8a2e; }
.bot-bubble-text { color: #111b21; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.bot-bubble-text u { text-decoration-color: var(--tts-do); text-decoration-thickness: 2px; }
.bot-chat figcaption { margin-top: 6px; color: var(--tts-muc-nhat); font-size: 11px; }
.bot-rules { display: grid; gap: 12px; padding: 0; list-style: none; }
.bot-rules li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--tts-vien); }
.bot-rules li:last-child { padding-left: 0; border-left: 0; }
.bot-rules h3 { color: var(--tts-muc); font-size: 13px; font-weight: 700; }
.bot-rules p { color: var(--tts-muc-nhat); }
.bot-rules code { justify-self: start; margin-top: 2px; }

/* Lệnh và lỗi: bảng; màn hẹp mỗi dòng thành một thẻ, nhãn cột lấy từ data-label */
.bot-table-scroll { overflow-x: auto; }
.bot-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 13px; }
.bot-table th, .bot-table td { padding: 9px 14px 9px 0; border: 0; border-bottom: 1px solid var(--bot-divider); text-align: left; vertical-align: top; }
.bot-table thead th { padding-top: 0; color: var(--tts-muc-nhat); font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; white-space: nowrap; }
.bot-table tbody tr:last-child > * { border-bottom: 0; }
.bot-table tbody th { font-weight: 600; }
.bot-table td small { display: block; margin-top: 2px; color: var(--tts-xanh); font-size: 11px; font-weight: 600; }
.bot-commands .bot-table tbody th { width: 120px; white-space: nowrap; }
.bot-options { display: flex; flex-wrap: wrap; gap: 4px; }
.bot-options span { padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--bot-telegram) 45%, var(--tts-vien)); border-radius: 999px; color: #1a7fb0; font-size: 12px; white-space: nowrap; }
.bot-muted { color: var(--tts-muc-nhat); }
.bot-errors .bot-table tbody th { width: 36%; color: var(--tts-muc); }
.bot-errors .bot-table td { color: var(--tts-muc-nhat); }
.bot-errors .bot-table td:last-child { color: var(--tts-muc); }

@container bot (max-width: 900px) {
  .bot-main, .bot-messaging-grid { grid-template-columns: minmax(0, 1fr); }
}
@container bot (max-width: 640px) {
  .bot-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bot-table, .bot-table tbody, .bot-table tr, .bot-table th, .bot-table td { display: block; width: 100% !important; }
  .bot-table tr { padding: 10px 0; border-bottom: 1px solid var(--bot-divider); }
  .bot-table tbody tr:last-child { border-bottom: 0; }
  .bot-table th, .bot-table td { padding: 2px 0; border-bottom: 0; white-space: normal !important; }
  .bot-table td::before { content: attr(data-label); display: block; color: var(--tts-muc-nhat); font-size: 11px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
  .bot-table td.is-empty { display: none; }
}
@container bot (max-width: 760px) {
  .bot-header { flex-wrap: wrap; }
  .bot-header-actions { width: 100%; }
}
@container bot (max-width: 540px) {
  .bot-header-actions { width: 100%; }
  .bot-header-actions .bot-button { flex: 1 1 0; }
  .bot-bubble { max-width: 92%; }
}
@media (max-width: 575px) {
  .bot-card { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .bot-button, .bot-link i { transition: none; }
}
