/* 📮 Khiếu nại / Góp ý (ticket.js) – tiền tố tk- */
.tk-modal { width: min(560px, calc(100% - 24px)); }
.tk-tabs { margin: 4px 0 12px; }
.tk-tabs button { position: relative; font-size: var(--fs-sm, .875rem); white-space: nowrap; }
.tk-dot { display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--danger, #d23c36); vertical-align: middle; }
.tk-body { display: flex; flex-direction: column; gap: 10px; }
.tk-form, .tk-reply, .tk-open { display: flex; flex-direction: column; gap: 8px; }
.tk-lab { font-weight: 700; font-size: var(--fs-sm, .875rem); margin-top: 4px; }
.tk-form select, .tk-form input, .tk-form textarea, .tk-reply textarea, .tk-open input { width: 100%; min-width: 0; box-sizing: border-box; }
.tk-form textarea, .tk-reply textarea { resize: vertical; min-height: 96px; }
.tk-reply textarea { min-height: 70px; }
.tk-tip { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft, rgba(91, 61, 245, .1)); color: var(--accent-ink, inherit); font-size: var(--fs-sm, .875rem); line-height: 1.45; }
.tk-count { align-self: flex-end; margin-top: -4px; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.tk-attach { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.4; overflow-wrap: anywhere; }
.tk-warn { margin: 0; color: var(--muted); font-size: .82rem; }
.tk-status { margin: 0; min-height: 0; }
.tk-status:empty { display: none; }
.tk-send { min-height: 48px; }

.tk-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.tk-done-h { margin: 6px 0 0; font-weight: 700; }
.tk-code { font: 800 1.7rem/1.2 var(--font-mono, ui-monospace, Consolas, monospace); letter-spacing: .12em; padding: 12px 18px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong, var(--border)); user-select: all; -webkit-user-select: all; max-width: 100%; overflow-wrap: anywhere; }
.tk-done .hint { margin: 0; text-align: center; }
.tk-done .row.two { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tk-list { display: flex; flex-direction: column; gap: 8px; max-height: min(46vh, 380px); overflow-y: auto; }
.tk-list .hint { margin: 6px 0; }
.tk-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; text-align: left; height: auto; min-height: 56px; padding: 10px 14px; line-height: 1.3; white-space: normal; }
.tk-item b { font-weight: 700; overflow-wrap: anywhere; }
.tk-item .tk-item-sub { grid-column: 1; }
.tk-item .tk-st { grid-column: 2; grid-row: 1 / span 2; }
.tk-item.new { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft, rgba(91, 61, 245, .15)); }
.tk-item-sub { color: var(--muted); font-size: .8rem; font-weight: 500; font-family: var(--font-mono, ui-monospace, Consolas, monospace); overflow-wrap: anywhere; }
.tk-st { font-style: normal; font-size: .76rem; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tk-st.open { background: rgba(232, 160, 20, .16); color: #9a6200; border-color: transparent; }
.tk-st.answered { background: rgba(26, 154, 90, .16); color: #12703f; border-color: transparent; }
[data-theme="dark"] .tk-st.open, body.dark .tk-st.open { color: #f2c65c; }
[data-theme="dark"] .tk-st.answered, body.dark .tk-st.answered { color: #6fdca4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tk-st.open { color: #f2c65c; } :root:not([data-theme="light"]) .tk-st.answered { color: #6fdca4; } }
.tk-open { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }
.tk-open-row { display: flex; gap: 8px; }
.tk-open-row input { flex: 1; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono, ui-monospace, Consolas, monospace); }
.tk-open-row button { flex: none; }

.tk-view-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tk-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.tk-info .tk-item-sub { flex-basis: 100%; }
.tk-thread { display: flex; flex-direction: column; gap: 8px; max-height: min(42vh, 360px); overflow-y: auto; padding: 2px; }
.tk-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; background: var(--surface-2); align-self: flex-end; }
.tk-msg.owner { align-self: flex-start; background: var(--gold-soft, rgba(242, 198, 92, .18)); border: 1px solid var(--gold-line, rgba(200, 160, 40, .4)); }
.tk-msg small { display: block; color: var(--muted); font-size: .74rem; margin-bottom: 2px; }
.tk-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }

/* Chân trang + dòng ở trang VIP + nút trong thông báo cấm đấu */
.tk-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px; margin: 28px auto 8px; padding: 14px 16px; max-width: 900px; border-top: 1px solid var(--border); color: var(--muted); font-size: var(--fs-sm, .875rem); text-align: center; }
.tk-foot button.link { font-size: 1rem; min-height: 36px; padding: 6px 4px; }
/* 📜 (28/11) dòng Điều khoản · Bảo mật · Hoàn tiền (chinh-sach.html) – riêng 1 hàng dưới cùng */
.tk-foot .tk-legal { flex-basis: 100%; font-size: .82rem; line-height: 2; }
.tk-legal a, .ar-legal a, .pay-legal a, .gd-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ar-legal { font-size: .8rem; margin-top: 4px; }
/* Nút 📮 Khiếu nại trên thanh trên cùng */
.tk-top { display: inline-flex; align-items: center; gap: 6px; height: var(--tap-sm, 40px); padding: 0 12px 0 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text, inherit); font: inherit; font-size: .85rem; font-weight: 700; white-space: nowrap; cursor: pointer; position: relative; }
.tk-top:hover { border-color: var(--accent, #7c5cff); }
.tk-top .tk-ico { font-size: 1.05rem; line-height: 1; }
.tk-top.tk-has-new::after { position: absolute; top: 2px; right: 2px; margin: 0; }
@media (max-width: 1100px) { /* màn nhỏ: biểu tượng trên, chữ nhỏ dưới (giống nút Giao diện) */
  .tk-top { flex-direction: column; gap: 1px; height: auto; min-height: var(--tap-sm, 40px); padding: 3px 6px; border-radius: 14px; }
  .tk-top .tk-ico { font-size: .95rem; }
  .tk-top .tk-lb { font-size: .62rem; line-height: 1.1; }
}
/* Thanh trên cùng đủ chỗ cho nút 📮 (trước đây 601–900px vốn đã tràn: logo + 4 thẻ + các nút không vừa 1 hàng) */
@media (min-width: 601px) and (max-width: 1100px) {
  .nav-tabs a { flex-direction: column; gap: 1px; padding: 5px 9px; font-size: .7rem; }
  .nav-tabs a .ni svg { width: 18px; height: 18px; }
  .icon-btn.theme-btn { flex-direction: column; gap: 1px; padding: 3px 6px; height: auto; border-radius: 14px; }
  .theme-btn .tb-ico { width: 22px; height: 22px; }
  .theme-btn .tb-ico svg { width: 15px; height: 15px; }
  .theme-btn .tb-label { font-size: .62rem; line-height: 1.1; }
  .nav-actions { gap: 5px; }
}
@media (min-width: 601px) and (max-width: 720px) { .brand .brand-name { display: none; } }
@media (min-width: 601px) and (max-width: 680px) { .nav-tabs a .nl { display: none; } .nav-tabs a { padding: 8px 10px; } } /* rất chật: thẻ chỉ còn biểu tượng */
@media (max-width: 345px) { .topnav .nav-actions { gap: 2px !important; } .topnav .nav-actions #btnInstall { padding: 0 4px !important; font-size: .64rem !important; } } /* (.topnav để thắng settings.css nạp sau) */
@media (max-width: 430px) {
  .brand .brand-name { display: none !important; } /* điện thoại: chỉ giữ logo cho đủ chỗ các nút */
  .tk-top { padding: 3px 4px; }
  .tk-top .tk-lb { font-size: .56rem; }
  .topnav .nav-actions #btnInstall { padding: 0 6px !important; font-size: .7rem !important; }
}
.tk-has-new::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--danger, #d23c36); vertical-align: middle; }
body.timing .tk-foot, body.play-mode .tk-foot, body.bigplay-mode .tk-foot, body.duel-playing .tk-foot { display: none; }
.tk-vip-line { margin: 8px 0 0; font-size: var(--fs-sm, .875rem); color: var(--muted); }
.tk-vip-line button.link { min-height: 32px; padding: 4px 2px; }
.du-appeal { display: inline-block; margin: 6px 0 0; min-height: 34px; padding: 4px 2px; }
.du-note .du-appeal { display: block; }

@media (max-width: 600px) {
  .tk-code { font-size: 1.35rem; letter-spacing: .08em; padding: 10px 12px; }
  .tk-msg { max-width: 94%; }
  .tk-thread { max-height: 31vh; }
  .tk-reply textarea { min-height: 58px; }
  .tk-tabs button { font-size: .8rem; padding: 4px 6px; }
}

/* 🚩 Tố cáo khi đấu (report.js) – tiền tố rp- */
.rp-why { display: flex; flex-direction: column; gap: 6px; }
.rp-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; line-height: 1.35; }
.rp-opt input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--danger, #d23c36); }
.rp-opt:has(input:checked) { border-color: var(--danger, #d23c36); background: rgba(210, 60, 54, .08); }
.rp-modal textarea { min-height: 70px; }
.rp-priv { font-size: .82rem; }
.du-report, .cxo-report { color: var(--danger, #d23c36) !important; font-weight: 700; }
.cxo-report { display: block; margin-top: 4px; }
