:root { --side-w: 232px; --bottom-nav: 70px; }
.tlts-app, .tlts-gate { font-family: "Inter", "Segoe UI", system-ui, sans-serif; }
.tlts-gate { padding-left: 0; }
.tlts-gate .gate > .brand img { width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain; }
.tlts-app [hidden], .tlts-gate [hidden] { display: none !important; }
.tlts-app .topbar { gap: 14px; }
.tlts-app .topbar .brand { white-space: normal; }
.tlts-app .topbar .byline { display: block; }
.tlts-app main, .tlts-gate .gate { min-width: 0; overflow-wrap: anywhere; }
.tlts-gate .gate { animation: none; }
.tlts-app .panel, .tlts-gate .panel { box-shadow: none; }
.tlts-tools, .tlts-quick, .tlts-subnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tlts-quick, .tlts-subnav { margin-bottom: 14px; }
.tlts-subnav a { padding: 6px 9px; border-radius: 8px; text-decoration: none; }
.tlts-subnav [aria-current] { background: var(--gold-tint); }
.tlts-tools .ai-pick { order: 3; max-width: 100%; }
.tlts-tools .ai-pick summary { white-space: normal; }
.tlts-tools .ai-pop { width: min(300px, calc(100vw - 28px)); }
.tlts-app .hero-text, .tlts-app .hero .filters { position: relative; }
.tlts-heading { margin: 0 0 22px; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--gold-line); border-radius: 20px;
  background: linear-gradient(128deg, var(--gold-tint), transparent 70%), var(--panel); }
.tlts-heading h1 { font-size: clamp(24px, 4vw, 38px); }
.tlts-heading p { color: var(--muted); margin: 6px 0 0; }
.tlts-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.tlts-links > a { display: grid; gap: 4px; margin: 0; color: var(--text); text-decoration: none; }
.tlts-links > a:hover { border-color: var(--gold-line); }
.tlts-links span { color: var(--muted); }
.tlts-wrap-text { white-space: pre-wrap; }
.gate-user { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.gate-user > span { flex: 1; font-weight: 600; }
.gate-user small { display: block; }
.gate-menu { position: relative; max-width: 100%; }
.gate-menu summary { cursor: pointer; padding: 8px 10px; overflow-wrap: anywhere; }
.gate-menu > div { min-width: 156px; padding: 10px; display: grid; gap: 7px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.gate-user .gate-menu > div { position: absolute; z-index: 15; top: 100%; right: 0; }
.tlts-nav { gap: 4px; }
.tlts-nav > a { color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: 10px; min-height: 44px; }
.tlts-nav > a:hover { color: var(--text); background: var(--hover); }
.tlts-nav > a[aria-current="page"] { color: var(--accent-strong); background: var(--gold-tint); font-weight: 650; }
.tlts-app .tlts-nav > a { white-space: normal; }
.tlts-gate:has(.nav-cong) .gate, .tlts-gate:has(.tlts-guest) .gate {
  max-width: 1240px; margin: 0 auto; padding: 20px clamp(12px, 3vw, 34px) 52px; }
.tlts-gate:has(.nav-cong) .gate > .brand, .tlts-gate:has(.tlts-guest) .gate > .brand { justify-content: flex-start; }
.tlts-gate .gate .tlts-chat-form { display: block; }
.tlts-chat-log { min-height: 200px; max-height: min(52vh, 520px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.tlts-chat-turn { padding: 10px 14px; margin: 0; max-width: min(96%, 720px); align-self: start; white-space: pre-wrap;
  background: var(--panel2); border-radius: 12px; overflow-wrap: anywhere; }
.tlts-chat-turn[data-user] { align-self: end; background: var(--gold-tint); }
.tlts-chat-prompts { margin: 12px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tlts-chat-prompts button { text-align: left; }
.tlts-chat-status { min-height: 1.6em; margin: 6px 0; }
.tlts-guest .cards { margin-block: 12px; }
.tlts-guest-items { list-style: none; padding: 0; margin: 0; }
.tlts-guest-items li { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tlts-guest-items li > span { flex: 1 1 160px; min-width: 0; }
.tlts-sale-page[data-sale-view="san-pham"] #db-hero,
.tlts-sale-page[data-sale-view="cai-dat"] #db-hero,
.tlts-sale-page[data-sale-view="cai-dat"] #db-products,
.tlts-sale-page:not([data-sale-view="cai-dat"]) .tlts-sale-config,
.tlts-sale-page[data-sale-view="gui-anh"] #db-products { display: none; }
.tlts-sale-page .dbx-ds { min-width: 0; }
.tlts-sale-page .dbx-ds :is(strong, b, small, a) { overflow-wrap: anywhere; }

@media (min-width: 901px) {
  .tlts-app { padding-left: var(--side-w); }
  .tlts-app .topbar { position: fixed; inset: 0 auto 0 0; display: flex; flex-flow: column nowrap; align-items: stretch;
    width: var(--side-w); padding: 20px 14px; overflow: auto; border-right: 1px solid var(--line); }
  .tlts-app .tlts-nav { display: grid; flex: none; margin-top: 12px; overflow: visible; }
  .tlts-app .tlts-tools { order: 3; margin-top: auto; }
  .tlts-app .tk-box { order: 4; border-top: 1px solid var(--line); }
  .tlts-gate .nav-cong, .tlts-gate .tlts-guest-nav { display: grid; align-content: start; position: fixed;
    inset: 86px auto 0 0; width: var(--side-w); padding: 14px; border-right: 1px solid var(--line); background: var(--topbar); z-index: 5; }
  .tlts-gate:has(.nav-cong) .gate, .tlts-gate:has(.tlts-guest) .gate { width: calc(100% - var(--side-w)); margin-left: var(--side-w); }
  .tlts-gate:has(.nav-cong) .gate > .brand, .tlts-gate:has(.tlts-guest) .gate > .brand { position: fixed; inset: 0 auto auto 0;
    z-index: 6; width: var(--side-w); height: 86px; padding: 14px; font-size: 17px; margin: 0; background: var(--topbar); }
}

@media (max-width: 900px) {
  .tlts-app { padding-left: 0; }
  .tlts-app .topbar { position: relative; display: flex; align-items: center; flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .tlts-app .topbar .brand { flex: 1 1 160px; min-width: 0; }
  .tlts-app .tk-box { order: 2; flex: 0 1 auto; max-width: 48%; }
  .tlts-app .tk-box > div { position: absolute; z-index: 15; top: 100%; right: 0; }
  .tlts-app .tlts-tools { order: 3; flex: 1 1 100%; }
  .tlts-app .tlts-tools .ai-pick { margin-left: 0; }
  .tlts-app .tlts-tools .ai-pop { right: auto; left: 0; }
  .tlts-app:has(.tlts-nav) main, .tlts-gate:has(.tlts-nav) .gate { padding-bottom: calc(var(--bottom-nav) + 45px + env(safe-area-inset-bottom, 0px)); }
  .tlts-app:has(.dbn:not([hidden])) main { padding-bottom: calc(var(--bottom-nav) + 95px + env(safe-area-inset-bottom, 0px)); }
  .tlts-nav { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; gap: 3px;
    position: fixed; z-index: 31; inset: auto 0 0; min-height: var(--bottom-nav); padding: 5px 5px calc(5px + env(safe-area-inset-bottom, 0px));
    background: var(--topbar); border-top: 1px solid var(--line); overflow: visible; }
  .tlts-nav > a, .tlts-app .tlts-nav > a { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 4px;
    text-align: center; font-size: clamp(11px, 2.8vw, 13px); line-height: 1.25; overflow-wrap: anywhere; }
  .tlts-nav .ico { width: 16px; height: 16px; }
  .tlts-app .dbn, .tlts-app .pp { bottom: calc(var(--bottom-nav) + 6px + env(safe-area-inset-bottom, 0px)); }
  .tlts-app:has(#tien-trinh:not([hidden])) .dbn { right: 8px; bottom: calc(var(--bottom-nav) + 76px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 680px) {
  .tlts-app .panel, .tlts-gate .panel { padding: 14px; }
  .tlts-sale-page #db-products .dbx-loc { flex-wrap: wrap; overflow: visible; }
  .tlts-sale-page #db-products .dbx-loc button { flex: 0 1 auto; white-space: normal; }
  .tlts-app .cards, .tlts-gate .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
  .tlts-app .card, .tlts-gate .card { padding: 12px; }
  .tlts-app .card strong, .tlts-gate .card strong { font-size: clamp(18px, 4vw, 23px); }
  .tlts-app .tlts-nav:has(> a:nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tlts-table { display: block; width: 100%; }
  .tlts-table :is(thead, tr[data-tlts-head]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tlts-table :is(tbody, tfoot) { display: block; }
  .tlts-table tr:not([data-tlts-head]) { display: grid; gap: 4px; margin: 0 0 8px; padding: 8px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
  .tlts-table tr > :is(td, th), .tlts-table tr > td.r { display: block; padding: 4px; border: 0; white-space: normal; text-align: left; overflow-wrap: anywhere; }
  .tlts-table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; color: var(--muted); font-size: .78rem; font-weight: 600; }
  .tlts-table td :is(input, select, button, a) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
}
