/* ===================================================================
   NỀN TẢNG: reset, kiểu chữ, thanh cuộn, tiện ích
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: var(--font); font-size: var(--fs-md); line-height: var(--lh);
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video, canvas, svg { max-width: 100%; }
img { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
::selection { background: var(--accent-soft-2); }
mark { background: hsl(48 100% 60% / .45); color: inherit; border-radius: 3px; padding: 0 1px; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

.kit-icon { flex: none; vertical-align: middle; }
.kit-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.kit-mention { color: var(--accent); font-weight: 600; cursor: pointer; }
.kit-sr, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kit-truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kit-modal-open body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Điện thoại: cố định giao diện, không cho phóng to/thu nhỏ ---------- */
html { touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body, body * { touch-action: pan-x pan-y; }
body { overscroll-behavior: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-touch-callout: default; user-select: text; -webkit-user-select: text; }
/* iOS tự phóng to khi ô nhập có chữ nhỏ hơn 16px: ép đúng 16px trên màn hình cảm ứng */
@media (pointer: coarse), (max-width: 820px) {
  input, textarea, select, .au-input, .cp-input, .ig-cinput { font-size: 16px !important; }
}
