/* bé Tek — widget, bong bóng, Quầy Tek (TEK-7). Dùng biến theme tekcafe nếu có, có giá trị dự phòng. */
.tek{--tek-bg:var(--bg,#fff);--tek-soft:var(--bg-soft,#f5f5f7);--tek-fg:var(--fg,#1d1d1f);--tek-muted:var(--muted,#6e6e73);--tek-line:var(--line,#e5e5ea);--tek-acc:var(--accent,#59c031);--tek-acc-t:var(--accent-text,#3f8f22);--tek-r:var(--radius,14px);font:400 15px/1.45 var(--sans,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif);color:var(--tek-fg)}
@media (prefers-color-scheme:dark){.tek{--tek-bg:var(--bg,#000);--tek-soft:var(--bg-soft,#1c1c1e);--tek-fg:var(--fg,#f5f5f7);--tek-muted:var(--muted,#a1a1a6);--tek-line:var(--line,#2c2c2e);--tek-acc-t:var(--accent-text,#6fd346)}}
.tek *,.tek *::before,.tek *::after{box-sizing:border-box}
.tek [hidden]{display:none!important}
.tek button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0;margin:0}
.tek-sprite{display:block;object-fit:contain}
.tek-side__say{display:none}

/* Nút nổi góc phải (desktop) — fixed nên không gây CLS */
.tek-fab{position:fixed;right:20px;bottom:20px;z-index:70;width:80px;height:80px;border-radius:50%;display:grid;place-items:center;background:var(--tek-soft);border:1px solid var(--tek-line)!important;box-shadow:0 4px 16px rgba(0,0,0,.12)}
.tek-fab .tek-sprite{width:72px;height:72px}
.tek-fab:hover .tek-sprite{transform:translateY(-2px)}
.tek[data-mood=busy] .tek-fab .tek-sprite,.tek[data-mood=hot] .tek-fab .tek-sprite{animation:tek-bob 1.6s ease-in-out infinite}
.tek[data-mood=sleepy] .tek-fab .tek-sprite{animation:tek-bob 3.2s ease-in-out infinite}
@keyframes tek-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}

/* Bong bóng thoại ≤2 dòng chữ */
.tek-bubble{position:fixed;right:20px;bottom:110px;z-index:70;width:280px;max-width:calc(100vw - 32px);padding:12px 36px 12px 14px;background:var(--tek-bg);border:1px solid var(--tek-line);border-radius:var(--tek-r);box-shadow:0 6px 24px rgba(0,0,0,.14)}
.tek-bubble::after{content:"";position:absolute;right:32px;bottom:-7px;width:12px;height:12px;background:var(--tek-bg);border-right:1px solid var(--tek-line);border-bottom:1px solid var(--tek-line);transform:rotate(45deg)}
.tek-bubble__text{margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tek-bubble__acts{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.tek-bubble__x{position:absolute;top:2px;right:2px;width:32px;height:32px;display:grid;place-items:center;color:var(--tek-muted)}
.tek-bubble.is-in{animation:tek-pop .22s ease-out}
@keyframes tek-pop{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.tek-btn{min-height:44px;padding:0 14px;border-radius:999px;border:1px solid var(--tek-line)!important;font-weight:600;font-size:14px}
.tek-btn--pri{background:var(--tek-acc)!important;border-color:var(--tek-acc)!important;color:#0b1a05!important}
.tek-btn--wide{width:100%;margin-top:12px}
.tek-btn:disabled{opacity:.5;cursor:not-allowed}
.tek-iconbtn{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;color:var(--tek-muted)}

/* Panel Quầy Tek: 360px (desktop) */
.tek-panel{position:fixed;right:20px;bottom:110px;z-index:71;width:360px;max-height:min(640px,calc(100vh - 140px));overflow:auto;background:var(--tek-bg);border:1px solid var(--tek-line);border-radius:var(--tek-r);box-shadow:0 12px 40px rgba(0,0,0,.2);padding:0 16px 16px}
.tek-panel__head{display:flex;align-items:center;gap:10px;position:sticky;top:0;background:var(--tek-bg);padding:12px 0 8px}
.tek-panel__head h2{flex:1;margin:0;font-size:18px;font-weight:700}
.tek-tabs{display:flex;gap:4px;padding:4px;background:var(--tek-soft);border-radius:999px;margin-bottom:12px}
.tek-tabs [role=tab]{flex:1;min-height:40px;border-radius:999px;font-weight:600;font-size:14px;color:var(--tek-muted)}
.tek-tabs [aria-selected=true]{background:var(--tek-bg);color:var(--tek-fg);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.tek-muted{color:var(--tek-muted);margin:0 0 12px}
.tek-small{font-size:13px;margin:8px 0 0}
.tek-cup{display:grid;grid-template-columns:1fr auto;gap:6px;align-items:center;margin-bottom:12px;font-size:14px}
.tek-cup__pct{color:var(--tek-acc-t)}
.tek-cup__bar{grid-column:1/-1;height:8px;border-radius:99px;background:var(--tek-soft);overflow:hidden}
.tek-cup__bar i{display:block;height:100%;background:var(--tek-acc);border-radius:99px}
.tek-drinks{list-style:none;margin:0 0 12px;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.tek-drink{width:100%;min-height:76px;text-align:left;display:flex;flex-direction:column;gap:2px;padding:10px 12px!important;border-radius:12px;border:1px solid var(--tek-line)!important;background:var(--tek-soft)!important}
.tek-drink b{font-size:14px}
.tek-drink__amt{color:var(--tek-acc-t);font-weight:700;font-size:14px}
.tek-drink small{color:var(--tek-muted);font-size:12px;line-height:1.3}
.tek-drink[aria-pressed=true]{border-color:var(--tek-acc)!important;box-shadow:inset 0 0 0 1px var(--tek-acc)}
.tek-field{display:grid;gap:4px;font-size:13px;color:var(--tek-muted)}
.tek-field input{min-height:44px;padding:0 12px;border-radius:10px;border:1px solid var(--tek-line);background:var(--tek-bg);color:var(--tek-fg);font:inherit;font-size:16px}

/* Tab giữa thanh tab mobile (theme in qua tkc_tabbar_center) */
.tek-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;font:inherit;font-size:11px;color:var(--muted,#6e6e73);background:none;border:0;padding:0;min-width:44px;cursor:pointer}
.tek-tab .tek-sprite{width:38px!important;height:38px!important;max-width:none;flex:none;margin-top:-8px}
.tek-tab[aria-expanded=true]{color:var(--accent-text,#3f8f22)}

@media (max-width:768px){
	.tek--has-tab .tek-fab{display:none}
	.tek-fab{right:12px;bottom:calc(var(--tabbar-h,0px) + 12px);width:64px;height:64px}
	.tek-fab .tek-sprite{width:56px;height:56px}
	.tek-bubble{right:auto;left:50%;transform:translateX(-50%);bottom:calc(var(--tabbar-h,0px) + 12px);width:300px}
	.tek-bubble::after{right:calc(50% - 6px)}
	.tek-bubble.is-in{animation:none}
	.tek:not(.tek--has-tab) .tek-bubble{left:auto;right:12px;transform:none;bottom:calc(var(--tabbar-h,0px) + 88px)}
	/* bottom sheet */
	.tek-panel{left:0;right:0;bottom:0;width:auto;max-height:82vh;border-radius:var(--tek-r) var(--tek-r) 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom));z-index:80}
}
/* Dưới bài (TEK-9/10/11): reaction, hoá đơn, sponsor */
.tek-after{display:grid;gap:14px;margin:28px 0}
.tek-react{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.tek-react__q{flex-basis:100%;color:var(--tek-muted);font-size:14px}
.tek-react__btn{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--tek-line)!important;border-radius:999px;background:var(--tek-bg)}
.tek-react__btn[aria-pressed=true]{border-color:var(--tek-acc)!important;color:var(--tek-acc-t)}
.tek-react__btn:disabled{opacity:.6}
.tek-react__n{font-variant-numeric:tabular-nums;font-weight:600}
.tek-bill{display:flex;gap:14px;align-items:flex-start;padding:16px;border-radius:var(--tek-r);background:var(--tek-soft);border:1px solid var(--tek-line)}
.tek-bill .tek-sprite{flex:0 0 56px}
.tek-bill__body{flex:1;min-width:0}
.tek-bill__t{margin:0 0 4px;font-size:17px;font-weight:700;line-height:1.3}
.tek-bill__cost{margin:0 0 10px;color:var(--tek-fg)}
.tek-bill__acts{display:flex;flex-wrap:wrap;gap:8px}
.tek-sponsor{margin:0;font-size:14px;color:var(--tek-muted)}
.tek-sponsor b{color:var(--tek-acc-t)}
.tek-pay{display:grid;gap:8px;margin:8px 0;padding:12px;border-radius:12px;background:var(--tek-soft)}
.tek-pay p{margin:0}
.tek-pay__row{display:flex;justify-content:space-between;gap:8px}
.tek-pay__code{font-family:ui-monospace,Menlo,monospace;letter-spacing:.04em;color:var(--tek-acc-t)}
.tek-pay__text{white-space:pre-line}
.tek-pay__acts{display:flex;flex-wrap:wrap;gap:8px}
.tek-pay__acts .tek-btn{flex:1 1 auto;width:auto;white-space:nowrap;padding:0 16px}
.tek-pay-done{margin:8px 0;color:var(--tek-acc-t);font-weight:600}
.tek-toast{position:fixed;left:50%;bottom:calc(var(--tabbar-h,0px) + 16px);transform:translateX(-50%);z-index:75;max-width:min(92vw,420px);padding:10px 16px;border-radius:999px;background:var(--tek-fg);color:var(--tek-bg);font-size:14px;box-shadow:0 4px 16px rgba(0,0,0,.2)}
.tek-follow{margin:0;color:var(--tek-muted);font-size:13px}
.tek-follow a{color:inherit}
@media (prefers-reduced-motion:reduce){
	.tek *{animation:none!important;transition:none!important}
	.tek-fab:hover .tek-sprite{transform:none}
}
.tek-chat__log{max-height:300px;overflow-y:auto;display:flex;flex-direction:column;gap:6px;margin:8px 0}
.tek-msg{margin:0;padding:8px 11px;border-radius:var(--tek-r);max-width:88%;white-space:pre-line;overflow-wrap:anywhere;font-size:14px;line-height:1.45}
.tek-msg--user{align-self:flex-end;background:var(--tek-acc);color:#0b1a05}
.tek-msg--tek{align-self:flex-start;background:var(--tek-soft);color:var(--tek-fg)}
.tek-msg--sys{color:var(--tek-muted)}
.tek-msg__link{color:inherit;text-decoration:underline}
.tek-msg__ok{margin-top:6px;min-height:44px;padding:0 16px!important}
.tek-chat__log{max-height:min(300px,40vh)}
.tek-chat__form{display:flex;gap:8px;align-items:flex-end;position:sticky;bottom:0;background:var(--tek-bg);padding-top:6px}
.tek-chat__form textarea{flex:1 1 auto;min-width:0;min-height:44px;resize:none;border:1px solid var(--tek-line);border-radius:var(--tek-r);background:var(--tek-bg);color:var(--tek-fg);padding:8px;font:inherit}
.tek-chat__form .tek-btn{min-height:44px;flex:none;min-width:64px;padding:0 16px!important}
.tek-hp,.tek-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.tek-req{max-width:680px;margin:32px auto;padding:0 16px}
.tek-req__steps{list-style:none;padding:0;margin:16px 0;border-left:2px solid var(--tek-line,#364751)}
.tek-req__steps li{padding:6px 0 6px 14px;opacity:.55}
.tek-req__steps li.is-done{opacity:1}
.tek-req__steps li.is-current{font-weight:700}
.tek-req__steps li.is-stopped{opacity:1;color:#ff6b6b}
/* Desktop ≥1100px: sidebar cố định bên phải (25/10, Anh duyệt). body.tek-side-on do server in → lề phải có từ khung đầu, không CLS. */
@media (min-width:1100px){
	body.tek-side-on{padding-right:var(--tek-side-w,340px)}
	body.tek-side-on .tek .tek-fab,body.tek-side-on .tek [data-tek-act=close]{display:none!important}
	body.tek-side-on .tek .tek-panel,body.tek-side-on .tek .tek-panel[hidden]{display:flex!important;flex-direction:column;top:0;right:0;bottom:0;width:var(--tek-side-w,340px);max-height:none;border-radius:0;border:0;border-left:1px solid var(--tek-line);box-shadow:none;z-index:65;overflow:hidden}
	body.tek-side-on .tek-panel__head{position:static;flex-direction:column;text-align:center;padding:20px 0 6px;gap:4px}
	body.tek-side-on .tek-panel__head .tek-sprite{width:120px;height:120px}
	body.tek-side-on .tek[data-mood=busy] .tek-panel__head .tek-sprite,body.tek-side-on .tek[data-mood=hot] .tek-panel__head .tek-sprite{animation:tek-bob 1.6s ease-in-out infinite}
	body.tek-side-on .tek-pane:not([hidden]){flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow-y:auto}
	body.tek-side-on #tek-p-chat .tek-chat__log{flex:1 1 auto;max-height:none;min-height:120px}
	body.tek-side-on .tek-side__say{display:-webkit-box!important;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;box-sizing:border-box;height:78px;margin:6px 8px 0;padding:8px 12px;border-radius:var(--tek-r);background:var(--tek-soft);color:var(--tek-fg);font-size:14px;line-height:1.45}
	body.tek-side-on .tek-side__say:empty{background:none}
	body.tek-side-on .tek-bubble{display:none!important}
}
@media print{.tek,.tek-tab{display:none!important}body.tek-side-on{padding-right:0!important}}
