/* Ba khung giao diện (Admin §24.1, Workspace §21.1, Console §22.2) và bố cục trang xác thực.
   Board tham chiếu: 5 (Admin), 48 (Workspace), 30 (Console), 1 / 28 / 87–89 (xác thực). */

.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.shell-content { padding: 26px var(--gutter) 48px; display: flex; flex-direction: column; gap: 22px; max-width: 1280px; width: 100%; }
.sidebar { display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; flex: 0 0 auto; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 15px; }
.nav-title { font-size: var(--fs-10); letter-spacing: .09em; font-weight: 600; padding: 0 10px 6px; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: 500; text-decoration: none; }
.nav a .count { margin-left: auto; font-size: var(--fs-11); font-weight: 700; padding: 1px 7px; border-radius: var(--r-pill); }
.nav a .icon { width: 16px; height: 16px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: var(--fs-13); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: var(--fs-11); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px; border-radius: var(--r-pill); cursor: pointer; position: relative; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px var(--gutter); border-bottom: 1px solid var(--border); background: var(--white); position: sticky; top: 0; z-index: 20; }
.menu-toggle { display: none; }

/* ----- Admin: thanh bên tối 248px ----- */
.shell-admin .sidebar { width: var(--sidebar-admin); background: var(--ink); color: var(--slate-300); }
.shell-admin .brand-name { color: var(--white); }
.shell-admin .brand-sub, .shell-admin .nav-title { color: var(--slate-400); }
.shell-admin .logo-mark { background: var(--white); color: var(--ink); }
.shell-admin .nav a { color: var(--slate-300); }
.shell-admin .nav a:hover { background: var(--slate-800); color: var(--white); }
.shell-admin .nav a[aria-current="page"] { background: var(--slate-800); color: var(--white); box-shadow: inset 3px 0 0 var(--lime-500); }
.shell-admin .nav a .count { background: var(--warn-dot); color: var(--white); }
.wallet { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.wallet .eyebrow { color: var(--slate-400); }
.wallet-value { font-family: var(--font-head); font-size: var(--fs-18); font-weight: 600; color: var(--white); }
.wallet-sub { font-size: var(--fs-11); color: var(--slate-400); }
.shell-admin .avatar { background: var(--slate-700); color: var(--white); }

/* ----- Workspace: thanh bên trắng 232px ----- */
.shell-app .sidebar { width: var(--sidebar-app); background: var(--white); border-right: 1px solid var(--border); padding: 18px 12px; gap: 18px; }
.shell-app .logo-mark { background: var(--ink); color: var(--white); }
.shell-app .brand-sub { color: var(--text-3); }
.shell-app .nav a { color: var(--slate-600); }
.shell-app .nav a:hover { background: var(--slate-100); color: var(--text); }
.shell-app .nav a[aria-current="page"] { background: var(--lime-50); color: var(--lime-800); font-weight: 600; }
.shell-app .nav a .count { background: var(--slate-100); color: var(--slate-600); }
.shell-app .nav-bottom { margin-top: auto; }

/* ----- Console: băng tím ở đỉnh + thanh bên tối 236px ----- */
.console-band { background: var(--console-900); color: var(--console-200); padding: 9px var(--gutter); display: flex; flex-wrap: wrap; gap: 6px 14px;
  justify-content: space-between; font-size: var(--fs-11); }
.console-band strong { letter-spacing: .08em; color: var(--white); font-weight: 600; }
.shell-console { flex-direction: column; }
.shell-console > .shell { min-height: calc(100vh - 36px); }
.shell-console .sidebar { width: var(--sidebar-console); background: var(--ink); color: var(--slate-300); height: calc(100vh - 36px); top: 36px; }
.shell-console .logo-mark { background: var(--console-500); color: var(--white); }
.shell-console .brand-name { color: var(--white); }
.shell-console .brand-sub { color: var(--console-300); }
.shell-console .nav a { color: var(--slate-300); }
.shell-console .nav a:hover { background: var(--slate-800); color: var(--white); }
.shell-console .nav a[aria-current="page"] { background: var(--slate-800); color: var(--white); box-shadow: inset 3px 0 0 var(--console-500); }
.shell-console .nav a[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.shell-console .avatar { background: var(--console-700); color: var(--white); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: 1px solid var(--slate-800); }
.sidebar-foot .who { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-12); color: var(--white); }
.sidebar-foot .who span { font-size: var(--fs-11); color: var(--slate-400); }

/* ----- Thu gọn ở màn hẹp: thanh bên thành ngăn trượt ----- */
@media (max-width: 960px) {
  :root { --gutter: 16px; }
  .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 45; transform: translateX(-105%); transition: transform .18s; box-shadow: var(--shadow-drawer); }
  .shell-console .sidebar { top: 0; height: 100vh; }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
}

/* ===== Trang xác thực ===== */
/* Đăng nhập tenant (board 1) / Console (board 28): hai cột */
.auth-split { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--white); }
.auth-brand { flex: 1 1 480px; min-width: 0; padding: 52px; display: flex; flex-direction: column; gap: 34px; background: var(--ink); color: var(--slate-300); }
.auth-brand h1 { font-size: var(--fs-36); line-height: 1.2; color: var(--white); max-width: 450px; }
.auth-brand h1 em { font-style: normal; color: var(--accent); }
.auth-brand p { font-size: 15px; line-height: 1.65; max-width: 450px; }
.auth-brand .brand-name { color: var(--white); font-size: var(--fs-16); }
.auth-brand .brand-sub { color: var(--slate-400); }
.auth-brand .logo-mark { width: 40px; height: 40px; background: var(--white); color: var(--ink); }
.auth-brand .foot { margin-top: auto; font-size: var(--fs-12); color: var(--slate-400); max-width: 450px; }
.auth-note { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: 16px; padding: 20px; max-width: 450px; display: flex; flex-direction: column; gap: 10px; }
.auth-note ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-13); }
.auth-form-col { flex: 999 1 520px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 52px 24px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.auth-form h2 { font-size: var(--fs-28); }
.area-console .auth-brand { background: var(--console-900); color: var(--console-200); }
.area-console .auth-brand .logo-mark { background: var(--console-500); color: var(--white); }
.area-console .auth-brand .brand-sub { color: var(--console-300); }
.area-console .auth-note { background: var(--console-800); border-color: var(--console-700); color: var(--console-100); }
.area-console .auth-brand .foot { color: var(--console-300); }
.step-done { background: var(--slate-50); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 11px; }

/* Trang thẻ giữa màn (board 87, 88, 89, 51) */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-page); }
.auth-head { background: var(--white); border-bottom: 1px solid var(--border); padding: 16px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.auth-head .logo-mark { background: var(--ink); color: var(--white); }
.auth-body { flex: 1 1 auto; display: flex; align-items: flex-start; justify-content: center; padding: 64px 20px; }
.auth-card { width: 100%; max-width: 460px; background: var(--white); border: 1px solid var(--border); border-radius: 22px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: var(--fs-22); }
.auth-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--lime-100); display: flex; align-items: center; justify-content: center; color: var(--lime-800); }
.auth-icon-err { background: var(--err-bg); color: var(--err-fg); }
.auth-foot { padding: 18px 40px; text-align: center; font-size: var(--fs-12); color: var(--text-4); }
@media (max-width: 600px) {
  .auth-brand { padding: 32px 20px; }
  .auth-head, .auth-foot { padding-left: 16px; padding-right: 16px; }
  .auth-body { padding: 32px 16px; }
  .auth-card { padding: 24px 20px; }
}

/* Menu tài khoản và menu ⋯ */
.account { position: relative; }
.account > .menu { right: 0; top: calc(100% + 6px); }
.menu .stack { padding: 8px 12px 4px; }
.qr { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--white); flex: 0 0 auto; }
.secret { word-break: break-all; font-size: var(--fs-12); }
.split-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
@media (max-width: 1100px) { .split-2 { grid-template-columns: minmax(0, 1fr); } }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-13); color: var(--text-2); }
.note-item { border-bottom: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 4px; }
.note-item:last-child { border-bottom: 0; }
.once-box { background: var(--slate-50); border: 1px dashed var(--border-input); border-radius: var(--r-md); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.once-box code { font-size: var(--fs-14); background: none; padding: 0; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item .meta { font-size: var(--fs-11); color: var(--text-3); }
.grid-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-plans .kv { grid-template-columns: minmax(0, 1fr) auto; }
.grid-plans .kv dd { white-space: nowrap; text-align: right; }

/* Sơ đồ tổ chức (board 6, 78) */
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.dept-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--white); }
.dept-mine { border-color: var(--lime-300); }
.catalog-icon { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--slate-100); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.avatar-row { display: flex; align-items: center; }
.avatar-row .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--white); }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.orch-card { background: var(--ink); color: var(--white); border-color: var(--ink); }
.orch-card .subtle { color: var(--slate-400); }
.orch-card .logo-mark { background: var(--white); color: var(--ink); }
.unassigned-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.unassigned-row:last-child { border-bottom: 0; }
.unassigned-row .select { width: auto; min-width: 200px; height: var(--h-sm); font-size: var(--fs-12); }

/* Kho KWSR (board 16, 17, 130) và Cài đặt › Kho KWSR (board 132–134) */
.tab-count { margin-left: 6px; font-size: var(--fs-11); color: var(--text-3); background: var(--slate-100); border-radius: var(--r-pill); padding: 1px 7px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.table-foot:empty { display: none; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); margin: 0; }
.layout-aside { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.aside-sticky { position: sticky; top: 16px; }
@media (max-width: 1080px) {
  .layout-aside { grid-template-columns: minmax(0, 1fr); }
  .aside-sticky { position: static; }
}
.section-title { font-size: var(--fs-13); font-weight: 600; margin: 6px 0 0; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.choice-cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .choice-cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border-input); border-radius: var(--r-md); padding: 12px; cursor: pointer; background: var(--white); }
.choice input { margin: 3px 0 0; accent-color: var(--accent-strong); flex: 0 0 auto; }
.choice:has(input:checked) { border-color: var(--accent-strong); background: var(--lime-50); box-shadow: 0 0 0 1px var(--accent-strong) inset; }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.choice.is-disabled, .seg label.is-disabled { opacity: .55; cursor: not-allowed; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: var(--r-pill); background: var(--slate-100);
  border: 1px solid var(--border); font-size: var(--fs-12); font-weight: 500; color: var(--text); }
.chip .icon { width: 13px; height: 13px; color: var(--text-3); }
.chip-new { background: var(--lime-50); border-color: var(--lime-300); }
.chip-x { border: 0; background: transparent; color: var(--text-3); width: 22px; height: 22px; border-radius: var(--r-pill); cursor: pointer; font-size: var(--fs-13); line-height: 1; }
.chip-x:hover { background: var(--slate-200); color: var(--text); }
.chip-x:focus-visible { outline: 2px solid var(--focus); }
.wf-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; counter-reset: wf; }
.wf-steps li { counter-increment: wf; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); }
.wf-steps li::before { content: counter(wf); width: 24px; height: 24px; flex: 0 0 auto; border-radius: var(--r-pill); background: var(--slate-100);
  display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-12); font-weight: 600; }
.wf-steps li > .grow { flex: 1 1 220px; }
.wf-steps .pill { flex: 0 0 auto; letter-spacing: 0; }
.wf-steps-edit { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.wf-step { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--white); }
.wf-step-head { display: flex; gap: 10px; align-items: flex-start; }
.wf-step-head > .field { flex: 1 1 auto; min-width: 0; }
.wf-step-no { width: 28px; height: var(--h-md); flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; color: var(--text-2); }
.wf-step-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding-left: 38px; }
@media (max-width: 640px) { .wf-step-body { padding-left: 0; } }
.prose-pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-13); line-height: 1.6; color: var(--text); }
.prose-scroll { max-height: 420px; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--slate-50); }
.code-block { margin: 0; padding: 12px; border-radius: var(--r-md); background: var(--slate-50); border: 1px solid var(--border); font-family: var(--font-mono);
  font-size: var(--fs-12); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 480px; overflow: auto; }
.textarea.mono { font-family: var(--font-mono); font-size: var(--fs-12); }
.rule-text { margin: 0; padding: 12px 16px; border-left: 3px solid var(--err-fg); background: var(--err-bg); border-radius: var(--r-sm); font-size: var(--fs-14); font-weight: 500; }
.list-plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.diff { border: 1px solid var(--border); border-radius: var(--r-md); overflow: auto; max-height: 60vh; font-family: var(--font-mono); font-size: var(--fs-12); }
.diff-row { display: flex; gap: 8px; padding: 2px 10px; }
.diff-op { width: 12px; flex: 0 0 auto; color: var(--text-3); }
.diff-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.diff-add { background: var(--ok-bg); color: var(--ok-fg); }
.diff-del { background: var(--err-bg); color: var(--err-fg); text-decoration: line-through; text-decoration-color: rgba(190, 18, 60, .4); }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick label { position: relative; }
.icon-pick input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick span { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: 1px solid var(--border-input); border-radius: var(--r-sm); cursor: pointer; font-size: 18px; }
.icon-pick input:checked + span { border-color: var(--accent-strong); background: var(--lime-50); box-shadow: 0 0 0 1px var(--accent-strong) inset; }
.icon-pick input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.config-row { padding: 8px; border: 1px dashed var(--border-input); border-radius: var(--r-sm); }
.config-row .input, .config-row .select { height: var(--h-sm); font-size: var(--fs-12); }
.config-row .select { width: auto; }

/* Điều kiện kiểm bằng mã — hardCheck (board 128, 149) */
.hc { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: var(--slate-50); }
.hc-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: start; }
.hc-row .field { gap: 0; }
.hc-novalue { display: inline-flex; align-items: center; height: var(--h-md); }
@media (max-width: 640px) {
  .hc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .hc-row > .field { grid-column: 1; }
  .hc-row > .icon-btn { grid-column: 2; grid-row: 1; }
}
.hc-test { border-top: 1px dashed var(--border-input); padding-top: 12px; }
.hc-verdict { font-weight: 600; font-size: var(--fs-13); padding: 8px 12px; border-radius: var(--r-sm); }
.hc-verdict.is-bad { background: var(--err-bg); color: var(--err-fg); }
.hc-verdict.is-ok { background: var(--ok-bg); color: var(--ok-fg); }
.hc-conds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-12); color: var(--text-2); }
.hc-conds li.met { color: var(--text); font-weight: 500; }
.hc-err { color: var(--err-fg); }
.hc-summary { border-left: 3px solid var(--ok-fg); padding: 8px 12px; background: var(--ok-bg); border-radius: var(--r-sm); }
.logo-img { object-fit: contain; background: var(--white); padding: 2px; }
/* Cài đặt › Thương hiệu */
.swatch { width: 18px; height: 18px; border-radius: var(--r-pill); flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(15, 23, 43, .12) inset; margin-top: 1px; }
.swatch-lime { background: #84CC16; } .swatch-teal { background: #14B8A6; } .swatch-blue { background: #2563EB; }
.logo-preview { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--white); padding: 4px; }
.logo-preview-mark { width: 56px; height: 56px; background: var(--ink); color: var(--white); font-size: var(--fs-16); }
.login-preview { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; gap: 14px; background: var(--slate-50); }
.login-preview .logo-mark { background: var(--ink); color: var(--white); }
.login-preview .input { display: flex; align-items: center; color: var(--text-3); }
.form-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--bg-page); }
/* Cài đặt trạng thái (board 25, 120) */
.status-dot { width: 10px; height: 10px; border-radius: var(--r-pill); display: inline-block; flex: 0 0 auto; }
.status-slate { background: #64748B; } .status-blue { background: #2563EB; } .status-teal { background: #0D9488; } .status-lime { background: #65A30D; }
.status-amber { background: #D97706; } .status-orange { background: #EA580C; } .status-rose { background: #E11D48; } .status-violet { background: #7C3AED; }
.tabs-sub { border-bottom: 0; gap: 6px; }
.tabs-sub button { height: 32px; border: 1px solid var(--border); border-radius: var(--r-pill); }
.tabs-sub [aria-selected="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.matrix th, .matrix td { text-align: center; padding: 8px 6px; }
.matrix tbody th { text-align: left; white-space: nowrap; font-weight: 500; }
.matrix-col { font-size: var(--fs-11); min-width: 72px; white-space: normal; }
.matrix-self { color: var(--text-4); }
.matrix-cell input { width: 16px; height: 16px; accent-color: var(--accent-strong); }
.matrix-locked { background: var(--slate-100); }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick label { position: relative; display: inline-flex; padding: 6px; border-radius: var(--r-pill); border: 1px solid transparent; cursor: pointer; }
.color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.color-pick .status-dot { width: 20px; height: 20px; }
.color-pick label:has(input:checked) { border-color: var(--ink); }
.color-pick label:has(input:focus-visible) { outline: 2px solid var(--focus); }
.audit-summary { display: block; max-width: 520px; overflow-wrap: anywhere; }
.shell-admin .login-preview .brand-name { color: var(--text); }
.shell-admin .login-preview .brand-sub { color: var(--text-3); }
.matrix tbody th { text-transform: none; letter-spacing: 0; font-size: var(--fs-12); color: var(--text); background: var(--white); }
/* Mô hình AI (board 121) */
input.switch { appearance: none; width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--slate-300); position: relative; cursor: pointer; margin: 0; flex: 0 0 auto; transition: background .15s; }
input.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-knob); transition: transform .15s; }
input.switch:checked { background: var(--accent-strong); }
input.switch:checked::after { transform: translateX(16px); }
input.switch:disabled { opacity: .55; cursor: not-allowed; }
input.switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.stat-text { font-size: var(--fs-16); }
.catalog-pick { justify-content: flex-start; text-align: left; height: auto; padding: 6px 10px; white-space: normal; }
.table .pill { white-space: nowrap; letter-spacing: 0; }
.table input[type="radio"], .table input[type="checkbox"]:not(.switch) { accent-color: var(--accent-strong); width: 16px; height: 16px; }
/* AI Worker (board 9–15, 123) */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--white); font-size: var(--fs-12); color: var(--text-3); }
.stepper-no { width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--slate-100); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.stepper li.is-current { border-color: var(--accent-strong); color: var(--text); font-weight: 600; }
.stepper li.is-current .stepper-no { background: var(--accent); color: var(--on-accent); }
.stepper li.is-done .stepper-no { background: var(--ok-bg); color: var(--ok-fg); }
.grid-icon-name { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.input-icon { text-transform: uppercase; text-align: center; font-weight: 600; }
.pick-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.pick-row input { margin-top: 3px; accent-color: var(--accent-strong); width: 16px; height: 16px; flex: 0 0 auto; }
.pick-row.is-locked { background: var(--slate-50); cursor: default; }
.pick-list { max-height: 50vh; overflow: auto; }
.worker-card .cell-main a { color: var(--text); }
.worker-mark { width: 36px; height: 36px; font-size: var(--fs-12); background: var(--ink); color: var(--white); flex: 0 0 auto; }
.view-toggle [aria-pressed="true"] { background: var(--slate-100); color: var(--text); }
.card-pad { padding: 12px 14px; }
.select-sm { height: var(--h-sm); font-size: var(--fs-12); width: auto; }
.rule-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.rule-row:last-child { border-bottom: 0; }
.toc { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; }
.toc a { font-size: var(--fs-12); }
.btn.is-disabled { opacity: .5; pointer-events: none; }
/* Động cơ chạy Worker: «Thử một câu», tab Sử dụng (WP 1.9) */
.try-log { display: flex; flex-direction: column; gap: 10px; min-height: 180px; max-height: 46vh; overflow-y: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--slate-50); }
.try-msg { max-width: 85%; padding: 9px 12px; border-radius: var(--r-md); font-size: var(--fs-13); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.try-msg-user { align-self: flex-end; background: var(--ink); color: var(--white); }
.try-msg-ai { align-self: flex-start; background: var(--white); border: 1px solid var(--border); }
.try-msg-err { border-color: var(--err-fg); }
.try-meta { margin-top: 6px; white-space: normal; }
.try-typing { color: var(--text-3); }
.try-input { display: flex; flex-direction: column; gap: 8px; }
.usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.usage-bar { flex: 1 1 0; min-width: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.table tr.row-link { cursor: pointer; }
.table tr.row-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; max-width: 360px; }
.run-steps { gap: 0; }
.run-step { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.run-step:last-child { border-bottom: 0; }
.run-step-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); margin: 0; }
@media (max-width: 640px) { .try-msg { max-width: 100%; } .clamp-1 { max-width: 180px; } }
/* Knowledge (WP 1.10) */
.dropzone { padding: 14px; border: 1.5px dashed var(--border-strong, var(--slate-300)); border-radius: var(--r-md); background: var(--slate-50); }
.index-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sources { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); gap: 4px; white-space: normal; color: var(--text-2); }
.source-ref { font-weight: 600; color: var(--text); }
/* Phê duyệt (WP 1.11) */
.approval-card .kv { grid-template-columns: minmax(110px, max-content) 1fr; }
.steps-mini { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; color: var(--text-2); }
.steps-mini li.is-current { color: var(--text); font-weight: 600; }
.steps-mini li.is-done { color: var(--text-3); }
.batch-bar { position: sticky; top: 8px; z-index: 2; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--lime-50); }
.levels-list { gap: 2px; }

/* ----- Phiên hỗ trợ AI OS: thanh đỏ cố định ở đỉnh khu Quản trị (board 37) ----- */
.support-bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 9px var(--gutter); background: var(--err-strong); color: var(--white); font-size: var(--fs-13); }
.support-bar .grow { flex: 1 1 auto; }
.support-title { font-weight: 700; letter-spacing: .01em; }
.support-company { font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .16); }
.support-mode { font-size: var(--fs-12); opacity: .9; }
.support-mode.is-write { font-weight: 700; padding: 1px 8px; border-radius: var(--r-pill); background: var(--white); color: var(--err-strong); opacity: 1; }
.support-clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.support-clock.is-low { background: var(--white); color: var(--err-strong); padding: 0 6px; border-radius: var(--r-sm); }
.support-bar .btn { background: transparent; color: var(--white); border: 1px solid rgba(255, 255, 255, .6); }
.support-bar .btn:hover { background: rgba(255, 255, 255, .14); }
.support-bar .support-write { background: var(--white); color: var(--err-strong); border-color: var(--white); }
.is-support .topbar { top: 41px; }
@media (max-width: 760px) {
  .support-bar { font-size: var(--fs-12); gap: 6px 10px; }
  .support-bar .grow { display: none; }
  .is-support .topbar { top: 0; position: static; }
}

/* ----- Console: Dashboard & Sức khoẻ hệ thống (board 29, 44) ----- */
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.ops-dot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 auto; background: var(--slate-300); margin-top: 5px; }
.ops-ok > .row .ops-dot { background: var(--ok-fg); }
.ops-warn > .ops-dot, .ops-warn > .row .ops-dot { background: var(--warn-dot); }
.ops-err > .ops-dot, .ops-err > .row .ops-dot { background: var(--err-fg); }
.ops-comp > .row .ops-dot { margin-top: 0; }
.ops-comp.ops-err { border-color: var(--err-border); }
.ops-comp.ops-warn { border-color: var(--warn-border); }
.kv-sm { font-size: var(--fs-12); gap: 6px 14px; }
.ops-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ops-alert { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--slate-50); }
.ops-alert.ops-err { background: var(--err-bg); }
.ops-alert.ops-warn { background: var(--warn-bg); }
.ops-alert-title { font-size: var(--fs-13); font-weight: 600; }
.ops-alert .btn { flex: 0 0 auto; }
.ops-urgent.has-items { border-color: var(--err-border); }
@media (max-width: 560px) {
  .ops-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-alert { flex-wrap: wrap; }
  .ops-alert .btn { margin-left: 20px; }
}

/* ----- Sơ đồ › Người dùng ↔ Worker (board 8, 143, 145) ----- */
.rel-legend .card { padding: 14px 16px; }
.rel-toolbar { padding: 0; flex-wrap: wrap; }
.rel-toolbar .search { flex: 1 1 220px; }
.rel-group-head { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.rel-group-head::-webkit-details-marker { display: none; }
.rel-group-head::before { content: '▾'; color: var(--text-3); font-size: var(--fs-12); }
.rel-group:not([open]) .rel-group-head::before { content: '▸'; }
.rel-table td { vertical-align: top; }
.rel-check { width: 34px; }
.rel-name { font-weight: 600; font-size: var(--fs-13); }
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-pill); background: var(--slate-100);
  color: var(--text); font-size: var(--fs-12); font-weight: 500; white-space: nowrap; }
.rel-chip.is-owner { background: var(--ink); color: var(--white); }
.rel-chip.is-new { background: var(--lime-50); box-shadow: inset 0 0 0 1px var(--lime-600); }
.rel-chip.is-owner.is-new { box-shadow: inset 0 0 0 2px var(--lime-500); }
.rel-chip.is-gone { text-decoration: line-through; opacity: .55; }
.rel-x { all: unset; cursor: pointer; padding: 0 2px; margin-left: 2px; color: var(--text-3); font-weight: 700; }
.rel-x:hover, .rel-x:focus-visible { color: var(--err-fg); }
.rel-req { font-size: var(--fs-12); color: var(--text-2); }
.rel-warn { font-size: var(--fs-12); color: var(--warn-fg); font-weight: 600; }
.rel-more { margin: 6px 12px 12px; }
.rel-unassigned { border-color: var(--warn-border); background: var(--warn-bg); }
.rel-bulk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-lg); background: var(--ink); color: var(--white); }
.rel-bulk .btn-secondary { background: transparent; color: var(--white); border-color: var(--slate-600); }
.rel-savebar { position: sticky; bottom: 12px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-pop); font-size: var(--fs-13); }
.select.is-changed { border-color: var(--lime-600); box-shadow: 0 0 0 1px var(--lime-600); }
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--white); }
.avatar.is-new { background: var(--lime-500); color: var(--white); }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pick-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; }
.pick-item:hover { background: var(--slate-50); }
.pick-item.is-disabled { opacity: .55; cursor: default; }
.pick-item input { margin-top: 3px; }
.view-switch { align-self: flex-start; }
@media (max-width: 760px) {
  .rel-table thead { display: none; }
  .rel-table tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--border); }
  .rel-table td { border: 0; padding: 4px 14px; }
  .rel-table td[data-label] { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; align-items: start; }
  .rel-table td[data-label]::before { content: attr(data-label); font-size: var(--fs-11); color: var(--text-3); padding-top: 3px; }
  .rel-table td.rel-check { position: absolute; right: 4px; }
  .rel-table tr { position: relative; }
}

/* ----- Tổng quan Admin: sức khoẻ Worker, credit 14 ngày (board 5, 26) ----- */
.health-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.health-row { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.health-list li:last-child .health-row { border-bottom: 0; }
.health-row:hover .health-name { text-decoration: underline; }
.health-name { font-weight: 600; font-size: var(--fs-13); }
.health-row .ops-dot { margin-top: 0; }
.health-ok { background: var(--ok-fg); } .health-warn { background: var(--warn-dot); } .health-err { background: var(--err-fg); }
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.bar-fill { width: 100%; max-width: 28px; background: var(--lime-600); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-label { font-size: 10px; color: var(--text-3); white-space: nowrap; }
@media (max-width: 560px) { .bar:nth-child(odd) .bar-label { visibility: hidden; } .bars { gap: 3px; } }

/* ----- Workspace: Danh bạ Worker & Hồ sơ (board 54–56, 58, 84, 142) ----- */
.dir-toolbar { padding: 0; flex-wrap: wrap; }
.dir-toolbar .search { flex: 1 1 220px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dir-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.dir-card.is-paused, .dir-table tr.is-paused { opacity: .62; }
.dir-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--slate-100); display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; flex: 0 0 auto; border: 0; cursor: pointer; padding: 0; }
button.dir-icon:hover, button.dir-icon:focus-visible { box-shadow: 0 0 0 2px var(--lime-500); }
.dir-icon-lg { width: 52px; height: 52px; font-size: 26px; cursor: default; }
.dir-name { font-weight: 600; font-size: var(--fs-14); color: var(--text); text-decoration: none; }
.dir-name:hover { text-decoration: underline; }
.back-link { align-self: flex-start; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); text-decoration: none; margin-bottom: -6px; }
.prof-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.prof-head h1 { font-size: var(--fs-22); margin: 0; }
.prof-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.prof-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--slate-100); }
.prof-label { flex: 0 0 130px; font-size: var(--fs-12); font-weight: 600; color: var(--slate-700); }
.prof-value { flex: 1 1 280px; min-width: 0; font-size: var(--fs-13); line-height: 1.6; color: var(--text-2); }
.prof-value ul { list-style: none; margin: 0; padding: 0; }
.prof-value code { font-size: var(--fs-12); background: var(--slate-100); border-radius: 6px; padding: 2px 7px; }
.prof-docs summary { cursor: pointer; font-weight: 500; color: var(--text); }
.prof-docs[open] summary { margin-bottom: 8px; }
@media (max-width: 860px) { .prof-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .dir-table thead { display: none; }
  .dir-table tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 10px 0; border-bottom: 1px solid var(--border); }
  .dir-table td { border: 0; padding: 4px 14px; }
  .dir-table td[data-label] { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
  .dir-table td[data-label]::before { content: attr(data-label); font-size: var(--fs-11); color: var(--text-3); }
  .dir-table td[data-label] > *, .rel-table td[data-label] > * { justify-self: start; }
}

/* ----- Workspace: Hội thoại (board 60, 83, 86, 92–95) — khung cố định, chỉ vùng tin nhắn cuộn ----- */
.shell-main:has(> .shell-content.is-chat) { height: 100vh; }
.shell-content.is-chat { max-width: none; padding: 0; flex: 1 1 auto; min-height: 0; overflow: hidden; gap: 0; }
.chat-layout { display: flex; height: 100%; min-height: 0; }
.chat-side { width: 268px; flex: 0 0 268px; border-right: 1px solid var(--border); background: var(--white); padding: 16px; display: flex; flex-direction: column;
  gap: 10px; overflow-y: auto; min-height: 0; }
.chat-side-title { font-size: var(--fs-18); }
.chat-group { font-size: var(--fs-10); letter-spacing: .08em; font-weight: 600; color: var(--text-4); text-transform: uppercase; margin-top: 6px; }
.chat-item { display: flex; gap: 9px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); text-decoration: none; color: var(--text-2); font-size: var(--fs-13); }
.chat-item:hover { background: var(--slate-50); }
.chat-item.is-active { background: var(--lime-50); color: var(--text); font-weight: 600; }
.chat-item-icon { width: 28px; height: 28px; border-radius: 9px; background: var(--slate-100); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.chat-item-text { display: flex; flex-direction: column; min-width: 0; }
.chat-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-archive-link { all: unset; cursor: pointer; margin-top: auto; padding-top: 10px; font-size: var(--fs-12); color: var(--text-3); }
.chat-archive-link:hover { color: var(--text); }
.chat-pane { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg-page); }
.chat-empty { margin: auto; padding: 24px; }
.chat-head { flex: 0 0 auto; padding: 12px 22px; border-bottom: 1px solid var(--border); background: var(--white); display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px; }
.chat-title { font-size: var(--fs-14); }
.chat-paused { color: var(--warn-dot); font-weight: 600; }
.chat-back { display: none; text-decoration: none; font-size: 18px; color: var(--text-2); padding: 0 4px; }
.icon-btn-sm { width: 28px; height: 28px; font-size: var(--fs-13); }
.chat-thread { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chat-thread.is-compact { height: min(62vh, 560px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg-page); overflow: hidden; }
.chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.chat-row { display: flex; gap: 10px; align-items: flex-start; }
.chat-row.is-user { flex-direction: row-reverse; }
.chat-col { max-width: min(680px, 82%); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chat-row.is-user .chat-col { align-items: flex-end; }
.chat-avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--lime-100); color: var(--lime-800); font-size: var(--fs-11); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; padding: 0; }
.chat-avatar-worker { border-radius: 10px; background: var(--white); border: 1px solid var(--border); font-size: 16px; cursor: pointer; }
.chat-bubble { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; font-size: var(--fs-13); line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.chat-bubble.is-user { background: var(--lime-50); border-color: var(--lime-200); }
.chat-bubble.is-failed { background: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-fg); }
.chat-typing { font-size: var(--fs-12); color: var(--text-3); }
.chat-typing::after { content: '▍'; animation: blink 1s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.chat-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-source { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-11); color: var(--text-2); background: var(--slate-100); border-radius: var(--r-pill); padding: 3px 10px; }
.chat-source.is-secret { color: var(--console-700); background: var(--console-100); }
.chat-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.chat-act { all: unset; cursor: pointer; font-size: var(--fs-12); color: var(--text-3); padding: 2px 3px; border-radius: 6px; }
.chat-act:hover, .chat-act:focus-visible { color: var(--text); background: var(--slate-100); }
.chat-act.is-on { color: var(--text); background: var(--lime-100); }
.chat-why summary { cursor: pointer; font-size: var(--fs-12); font-weight: 600; color: var(--warn-fg); }
.chat-why p { margin: 6px 0 0; font-size: var(--fs-12); line-height: 1.6; color: var(--text-2); }
.chat-composer { flex: 0 0 auto; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--white); display: flex; flex-direction: column; gap: 8px; position: relative; }
.chat-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--border-input); border-radius: 16px; padding: 7px 7px 7px 14px; background: var(--white); }
.chat-box:focus-within { border-color: var(--lime-600); box-shadow: 0 0 0 3px var(--lime-100); }
.chat-box.is-disabled { border-style: dashed; background: var(--slate-50); }
.chat-input { flex: 1 1 auto; border: 0; outline: 0; resize: none; font: inherit; font-size: var(--fs-13); line-height: 1.5; padding: 7px 0; background: transparent; min-height: 22px; max-height: 200px; }
.chat-stop { white-space: nowrap; }
.chat-blocked { align-items: center; flex-wrap: wrap; }
.chat-cmds { position: absolute; left: 22px; right: 22px; bottom: calc(100% - 6px); background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: 8px; display: flex; flex-direction: column; gap: 2px; z-index: 5; max-height: 260px; overflow-y: auto; }
.chat-cmds-title { font-size: var(--fs-10); letter-spacing: .08em; font-weight: 600; color: var(--text-4); text-transform: uppercase; padding: 4px 8px; }
.chat-cmd { all: unset; cursor: pointer; display: flex; gap: 10px; align-items: baseline; padding: 7px 8px; border-radius: var(--r-sm); }
.chat-cmd code { font-size: var(--fs-12); font-weight: 600; }
.chat-cmd:hover, .chat-cmd.is-active { background: var(--lime-50); }
.chat-excerpt { background: var(--slate-50); padding: 12px 14px; }
.chat-excerpt p { margin: 0; white-space: pre-wrap; max-height: 140px; overflow: auto; }
.pick-worker { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md); width: 100%; }
.pick-worker:hover, .pick-worker:focus-visible { background: var(--lime-50); }
.pick-worker.is-disabled { opacity: .55; cursor: default; background: none; }
.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-item { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.fb-item p { margin: 0; }
.fb-answer { white-space: pre-wrap; max-height: 160px; overflow: auto; }
.modal .chat-thread:not(.is-compact) { height: min(60vh, 560px); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 760px) {
  .chat-side { width: 100%; flex: 1 1 auto; border-right: 0; }
  .chat-layout.has-conv .chat-side { display: none; }
  .chat-layout:not(.has-conv) .chat-pane { display: none; }
  .chat-back { display: inline-block; }
  .chat-messages { padding: 14px; }
  .chat-composer { padding: 10px 12px; }
  .chat-col { max-width: 88%; }
  .chat-head { padding: 10px 12px; }
}
.chat-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
