:root {
  --brand: #1d3a5f;
  --brand-ink: #ffffff;
  --accent: #2563eb;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #16202c;
  --muted: #5b6878;
  --border: #d7dde5;
  --ai: #f5b301;
  --ai-bg: #fff7dd;
  --ok: #15803d;      --ok-bg: #e6f6ec;
  --warn: #b45309;    --warn-bg: #fdf3e1;
  --yellow: #a16207;  --yellow-bg: #fef9c3;
  --orange: #c2410c;  --orange-bg: #ffedd5;
  --red: #b91c1c;     --red-bg: #fee2e2;
  --grey: #4b5563;    --grey-bg: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #0f2036;
    --bg: #0d1117;
    --surface: #161b22;
    --surface-2: #1f2630;
    --text: #e6edf3;
    --muted: #9aa7b6;
    --border: #2d3640;
    --ai-bg: #3a2f0b;
    --ok: #4ade80;     --ok-bg: #12301f;
    --warn: #fbbf24;   --warn-bg: #3a2a0b;
    --yellow: #facc15; --yellow-bg: #3a330b;
    --orange: #fb923c; --orange-bg: #3d220e;
    --red: #f87171;    --red-bg: #3d1414;
    --grey: #cbd5e1;   --grey-bg: #2a313b;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}

h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--brand); color: var(--brand-ink);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand div { display: flex; flex-direction: column; line-height: 1.15; }
.brand span { font-size: .78rem; opacity: .8; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.topbar .btn-ghost { color: var(--brand-ink); border-color: rgba(255,255,255,.35); }

/* ── Tabs ───────────────────────────────────────────── */
.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 8px 16px 0; background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 56px; z-index: 9;
}
.tabs button {
  border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 88px; }   /* chừa chỗ cho nút "Hỏi AI" */
.tab-panel { display: flex; flex-direction: column; gap: 14px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ── Cards & forms ──────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 16px; margin: 0 0 14px; box-shadow: var(--shadow); min-width: 0;
}
legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grid.sub { margin: 4px 0 10px 28px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 600; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin-bottom: 8px; white-space: nowrap; }
label.inline select { width: auto; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.ai-filled { border-color: var(--ai) !important; background: var(--ai-bg) !important; }
.req { color: var(--red); }
.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-weight: 500; margin-top: 10px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.check small { color: var(--muted); font-weight: 400; }
.hint, small.hint { color: var(--muted); font-size: .82rem; font-weight: 400; margin: 0 0 8px; }
.fineprint { color: var(--muted); font-size: .8rem; text-align: center; }

.slab-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.slab-cols h3 { margin-top: 0; }
.slabs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.slab-row { display: grid; grid-template-columns: 1fr 1fr 1.3fr auto; gap: 8px; align-items: end; }
.icon-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 8px; width: 38px; height: 40px; cursor: pointer;
}

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); white-space: nowrap;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ai { background: var(--ai-bg); border-color: var(--ai); color: var(--text); }
.btn-danger { color: var(--red); border-color: var(--red); background: transparent; }
.btn-ghost { background: transparent; }
.btn-small { padding: 6px 10px; font-size: .85rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Pills / status ─────────────────────────────────── */
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-muted { background: rgba(255,255,255,.15); color: inherit; }
.pill-on { background: #16a34a; color: #fff; }
.st-safe      { background: var(--ok-bg);     color: var(--ok); }
.st-attention { background: var(--yellow-bg); color: var(--yellow); }
.st-urgent    { background: var(--orange-bg); color: var(--orange); }
.st-overdue   { background: var(--red-bg);    color: var(--red); }
.st-completed, .st-unknown { background: var(--grey-bg); color: var(--grey); }
.st-overdue.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .st-overdue.pulse { animation: none; } }

/* ── Dashboard ──────────────────────────────────────── */
.summary { display: flex; gap: 8px; flex-wrap: wrap; }
.summary .pill { font-size: .82rem; padding: 6px 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ctn {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left;
  font: inherit; color: inherit; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
}
.ctn:hover { border-color: var(--accent); }
.ctn.b-safe { border-left-color: var(--ok); }
.ctn.b-attention { border-left-color: #eab308; }
.ctn.b-urgent { border-left-color: #f97316; }
.ctn.b-overdue { border-left-color: #dc2626; }
.ctn.b-completed, .ctn.b-unknown { border-left-color: #9ca3af; }
.ctn-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ctn-no { font-weight: 800; font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; }
.ctn-meta { color: var(--muted); font-size: .85rem; }
.ctn-big { font-size: 1.05rem; font-weight: 700; }

.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; }
.empty .row-gap { justify-content: center; }
.empty-title { font-weight: 700; font-size: 1.1rem; margin: 0 0 4px; }

/* ── Results ────────────────────────────────────────── */
.result { display: flex; flex-direction: column; gap: 12px; }
.phases { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phase { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.phase dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; }
.phase dt { color: var(--muted); font-size: .85rem; }
.phase dd { margin: 0; font-weight: 600; text-align: right; }
.total { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--brand); color: #fff; border-radius: var(--radius); padding: 14px 16px; }
.total strong { font-size: 1.4rem; }
.verdict { border-radius: var(--radius); padding: 14px 16px; font-weight: 600; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--red-bg); color: var(--red); }
.verdict ul { margin: 8px 0 0; padding-left: 20px; font-weight: 500; }
.compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compare div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.compare span { display: block; color: var(--muted); font-size: .8rem; }
.compare strong { font-size: 1.15rem; }

.route { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.route strong { display: block; margin-bottom: 4px; }
#email-text { min-height: 300px; }

/* ── Banners / toast / dialog ───────────────────────── */
.banner { margin: 0; padding: 10px 16px; font-size: .88rem; border-radius: 10px; }
body > .banner { border-radius: 0; text-align: center; }
.banner-warn { background: var(--warn-bg); color: var(--warn); }
.banner-ai { background: var(--ai-bg); color: var(--text); border: 1px solid var(--ai); }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; font-size: .9rem;
}
.toast.error { background: #b91c1c; }
dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: 480px; width: calc(100% - 32px);
  background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog li { margin-bottom: 6px; }

/* ── Đối chiếu chứng từ ─────────────────────────────── */
.cc-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cc-docs .card { margin: 0; }
.cc-doc legend { padding: 0; margin: 0; font-size: 1rem; }
.cc-doc > .section-head { margin-bottom: 10px; }
.cc-doc .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cc-items { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.cc-item { display: grid; gap: 8px; align-items: end; }
.cc-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cc-summary > * { border-radius: var(--radius); padding: 10px 14px; }
.cc-summary button { border: 2px solid transparent; font: inherit; text-align: left; cursor: pointer; }
.cc-summary button:hover { filter: brightness(.97); }
.cc-summary button.active { border-color: currentColor; }
.cc-summary span { display: block; font-size: .82rem; font-weight: 600; }
.cc-summary strong { font-size: 1.5rem; }
.sev-critical { background: var(--red-bg); color: var(--red); }
.sev-warning  { background: var(--yellow-bg); color: var(--yellow); }
.sev-info     { background: var(--surface-2); color: var(--text); }
.sev-ok       { background: var(--ok-bg); color: var(--ok); }
.findings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
details .findings { margin-top: 10px; }
details summary { cursor: pointer; font-weight: 600; }
.finding { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: start;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left-width: 5px;
  border-radius: var(--radius); padding: 10px 14px; }
.finding.sev-critical { border-left-color: var(--red); }
.finding.sev-warning { border-left-color: #eab308; }
.finding.sev-info { border-left-color: var(--accent); }
.finding.sev-ok { border-left-color: var(--ok); }
.finding .hint { margin: 2px 0 0; }
.finding-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sev-badge { font-size: .8rem; font-weight: 700; white-space: nowrap; }
.finding.sev-critical .sev-badge { color: var(--red); }
.finding.sev-warning .sev-badge { color: var(--yellow); }
.finding.sev-ok .sev-badge { color: var(--ok); }

/* ── Trợ lý AI ──────────────────────────────────────── */
.chat-fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30;
  border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.chat-panel {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 100px));
  display: flex; flex-direction: column; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.28); overflow: hidden;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--brand); color: var(--brand-ink); }
.chat-head div:first-child { display: flex; flex-direction: column; line-height: 1.2; }
.chat-head span { font-size: .75rem; opacity: .8; }
.chat-head .btn-ghost { color: var(--brand-ink); border-color: rgba(255,255,255,.35); }
.chat-head .icon-btn { width: 34px; height: 34px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 88%; padding: 9px 12px; border-radius: 12px; overflow-wrap: anywhere; font-size: .92rem; }
.msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }
.msg-typing { color: var(--muted); font-style: italic; }
.chat-empty { color: var(--muted); font-size: .9rem; }
.chat-empty p { margin: 0 0 10px; }
.chat-chips { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.chat-chips .btn { white-space: normal; text-align: left; }
.chat-form { border-top: 1px solid var(--border); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.chat-ctx { margin: 0; font-size: .8rem; }
.chat-ctx input { width: 16px; height: 16px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { font-family: inherit; font-size: .92rem; resize: none; min-height: 44px; max-height: 140px; }
.chat-note { margin: 0; font-size: .72rem; color: var(--muted); }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .cc-docs { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cc-summary { grid-template-columns: 1fr 1fr; }
  .finding { grid-template-columns: 1fr; gap: 4px; }
  .cc-item { grid-template-columns: 1fr 1fr !important; }
  .cc-item label:first-child { grid-column: 1 / -1; }
  .chat-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .chat-fab { padding: 10px 14px; }
  main { padding: 12px 12px 80px; }
  .brand span, #ai-pill { display: none; }
  .tabs { top: 52px; padding: 4px 8px 0; }
  .tabs button { padding: 10px 10px; font-size: .88rem; }
  .slab-cols, .phases { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .grid.sub { margin-left: 0; }
  .actions .btn { flex: 1; }
}

/* ───────── Đăng nhập & tài khoản ───────── */
.user-box { display: flex; align-items: center; gap: 8px; }
.user-box img { border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; color: var(--brand-ink); }
.user-meta strong { font-size: .85rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta .pill { font-size: .68rem; padding: 1px 6px; align-self: flex-start; }
.login-screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: linear-gradient(160deg, var(--brand) 0%, var(--bg) 70%); overflow-y: auto; }
.login-card { background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid var(--border); padding: 32px 28px; max-width: 420px; width: 100%; text-align: center; }
.login-card h1 { margin: 10px 0 6px; font-size: 1.6rem; }
.login-tag { color: var(--muted); margin: 0 0 22px; }
.login-error { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 10px 12px; font-size: .9rem; text-align: left; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 12px 16px; font-size: 1rem; text-decoration: none; margin-bottom: 14px; }
.btn-google svg { background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
body.auth-locked > :not(.login-screen):not(.toast):not(dialog) { visibility: hidden; }
@media (max-width: 640px) {
  .user-meta strong { display: none; }          /* điện thoại: chỉ còn nhãn gói — vẫn bấm được để mở Tài khoản */
  .topbar .lbl { display: none; }               /* nút Hướng dẫn / Cài ứng dụng chỉ còn biểu tượng */
  .topbar-actions { gap: 6px; }
  .user-box { gap: 6px; }
}.banner-info { background: var(--ok-bg); color: var(--text); border: 1px solid var(--ok); display: flex; gap: 12px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }.tabs button.locked::after { content: " 🔒"; font-size: .8em; }button.user-meta { background: transparent; border: 0; cursor: pointer; text-align: left; padding: 2px 4px; border-radius: 6px; font: inherit; }
button.user-meta:hover { background: rgba(255,255,255,.12); }
.kv-plain { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv-plain dt { color: var(--muted); }
.kv-plain dd { margin: 0; font-weight: 600; word-break: break-word; }
.danger-zone { border: 1px solid var(--red); border-radius: 8px; padding: 8px 12px; }
.danger-zone summary { color: var(--red); cursor: pointer; font-weight: 600; }
.danger-zone input { width: 100%; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }.grounds-box { list-style: none; padding: 10px 12px; margin: 8px 0; border-radius: 8px; background: var(--bg); border: 1px dashed var(--border); display: grid; gap: 4px; font-size: .9rem; }
.grounds-box .g-ok { color: var(--ok); }
.grounds-box .g-no { color: var(--warn); }.tg-box { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.tg-box p { margin: 4px 0 8px; }
/* ── Onboarding lần đầu ── */
.onboard-mods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.onboard-mods > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.onboard-mods p { margin: 6px 0 0; font-size: .86rem; }
.onboard-steps { padding-left: 20px; font-size: .9rem; }
.onboard-steps li { margin-bottom: 6px; }
#onboard-dialog { max-width: 620px; }
@media (max-width: 560px) { .onboard-mods { grid-template-columns: 1fr; } }

/* ── Đối chiếu: đã xử lý / copy / khóa nút theo gói ── */
.finding-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.finding.resolved { opacity: .6; }
.finding.resolved .finding-head strong { text-decoration: line-through; }
.btn.locked::after { content: " 🔒"; font-size: .85em; }
@media (max-width: 560px) { .cc-summary { grid-template-columns: repeat(2, 1fr); } }

/* ── Căn cứ tranh chấp trên thẻ container (bước 2.4) ── */
.ctn-ground { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--ok-bg); color: var(--text);
  border: 1px solid var(--ok); font-size: .85rem; font-weight: 500; }
.ctn-holiday { margin-top: 8px; padding: 6px 10px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.ctn-ground-go { display: inline-block; margin-left: 6px; font-weight: 700; color: var(--ok); text-decoration: underline; }

/* ── Tài khoản công ty (bước 2.5) ── */
.org-list { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.org-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: .88rem; word-break: break-word; }
.org-invite-row { display: flex; gap: 6px; }
.org-invite-row input { flex: 1; min-width: 0; }

/* ── Nhắc gia hạn (bước 2.6) ── */
.banner-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
body > .banner-row { justify-content: center; }

/* ── Phản hồi 👍/👎 (B4) ── */
.fb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.fb-note { display: block; width: 100%; }
.fb-note textarea { width: 100%; margin-top: 4px; }

/* ── Đối chiếu nhiều bộ ── */
.cc-mode { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.ccb-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 120px; padding: 20px 16px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; font-weight: 600; }
.ccb-drop:hover, .ccb-drop.over { border-color: var(--accent); background: var(--surface-2); }
#ccb-progress progress { width: 100%; height: 10px; }
.ccb-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.ccb-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--border); }
.ccb-list li:first-child { border-top: 0; }
.ccb-list .pill { background: var(--surface-2); color: var(--text); }
.ccb-list select { margin-left: auto; width: auto; min-width: 0; flex: 0 1 260px; max-width: 100%; }
.ccb-list li > div.hint { flex-basis: 100%; order: 9; }
.ccb-set { margin-top: 10px; }
.ccb-set-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ccb-set-head .btn { margin-left: auto; }
.ccb-loose { border-color: var(--warn); }
.table-wrap { overflow-x: auto; }
.ccb-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ccb-table th, .ccb-table td { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.ccb-table td .btn { margin: 2px 4px 2px 0; }
.ccb-row.tone-critical td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.ccb-row.tone-warning td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.ccb-row.tone-ok td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
