/* Be Vietnam Pro (SIL OFL 1.1, xem fonts/OFL.txt) — tự phục vụ, không gọi CDN. */
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/be-vietnam-pro-vietnamese-700-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/be-vietnam-pro-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
/* Bảng thiết kế theo mockup: nền sáng, thanh bên xanh đen, nhấn xanh dương.
   Font: Be Vietnam Pro tự phục vụ từ /fonts (CSP chỉ cho phép 'self'); dự phòng bằng font hệ thống. */
:root {
  --bg: #f2f6fb; --card: #ffffff; --ink: #0b1b3f; --muted: #5a6683; --line: #dfe6f1; --line2: #ebf0f7; --soft: #f5f8fc;
  --brand: #0b58e9; --brand-ink: #ffffff; --brand-soft: #e6effe; --brand-text: #0845b8;
  --teal: #06dfd7; --teal-bg: #ddf8f6; --teal-text: #0a7f7a; --green: #12d269;
  --ok: #0b7a44; --ok-bg: #e0f8ea; --warn: #7a4500; --warn-bg: #fff3dc; --bad: #b42318; --bad-bg: #fdecec; --neutral: #3f4b66; --neutral-bg: #eef1f6;
  --side: #0a1a3f; --side-active: #0b58e9; --side-text: #b4c2e0; --side-line: #1e3470;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070f22; --card: #0f1c3a; --ink: #eaf0fb; --muted: #9db0d3; --line: #1f3366; --line2: #172a55; --soft: #0b1730;
    --brand: #5b8dff; --brand-ink: #06122b; --brand-soft: #14295a; --brand-text: #a9c2ff;
    --teal: #06dfd7; --teal-bg: #0c3a40; --teal-text: #6ff0ea;
    --ok: #6ee0b0; --ok-bg: #12382c; --warn: #ffcf7a; --warn-bg: #3b2c0c; --bad: #ff9a90; --bad-bg: #3d1a17; --neutral: #b6c4e2; --neutral-bg: #172a55;
    --side: #050c1d; --side-active: #0b58e9;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
h1 { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
a { color: var(--brand); }

/* khung */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
nav { background: var(--side); padding: 24px 16px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.brandrow { display: flex; align-items: center; gap: 12px; padding: 0 10px 24px; }
.brand { font-size: 19px; font-weight: 700; color: #fff; line-height: 1.1; }
.brandsub { font-size: 12px; color: #8c98ad; }
nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 10px; color: var(--side-text); text-decoration: none; }
nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
nav a.active svg { color: #fff; }
nav .nbadge { margin-left: auto; background: #e5393b; color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 0 8px; min-width: 22px; text-align: center; }
nav .mode { background: rgba(255,255,255,.06); border-radius: 12px; padding: 12px 14px; font-size: 12px; color: var(--side-text); line-height: 1.5; margin-bottom: 8px; }
nav .mode b { display: block; color: #fff; margin-bottom: 2px; }
nav .who { display: flex; align-items: center; gap: 12px; padding: 12px; border-top: 1px solid var(--side-line); margin-top: 8px; color: #fff; font-size: 13px; }
nav .whoname { min-width: 0; word-break: break-all; line-height: 1.25; }
nav .logout { padding: 0 4px; }
nav .logout button { width: 100%; background: transparent; color: var(--side-text); border-color: var(--side-line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
main { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .sub { font-size: 13px; color: var(--muted); }
.content { padding: 24px 32px; width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; background: var(--neutral-bg); color: var(--neutral); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.dot.ok { color: var(--ok); } .dot.warn { color: #d98a00; } .dot.bad { color: var(--bad); }

/* thẻ & lưới */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.grid4 .card { margin: 0; }
.stat-card .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-card .label.split { display: flex; justify-content: space-between; }
.bigstat { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 22px; font-weight: 700; line-height: 1.25; flex-wrap: wrap; }
.bigstat .num, .num { font-size: 28px; font-weight: 700; }
.bar { height: 8px; border-radius: 99px; background: var(--line2); margin-top: 10px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #06dfd7, #0b58e9); }
.bar.amber > div { background: #ffb020; }
.bar.green > div { background: linear-gradient(90deg, #06dfd7, #12d269); }
.alert { padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); margin-bottom: 8px; }
.note { border-radius: 10px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn); margin: 0 0 16px; font-size: 13px; }

/* huy hiệu */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--neutral-bg); color: var(--neutral); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); }

/* điều khiển */
button, .btn { font: inherit; font-weight: 600; font-size: 13px; padding: 8px 14px; border-radius: 8px; border: 1px solid #cbd2df; background: var(--card); color: var(--ink); cursor: pointer; min-height: 38px; }
@media (prefers-color-scheme: dark) { button, .btn { border-color: var(--line); } }
button:hover { border-color: var(--brand); }
button.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input, select, textarea { font: inherit; width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid #cbd2df; background: var(--card); color: var(--ink); min-height: 38px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; vertical-align: middle; }
@media (prefers-color-scheme: dark) { input, select, textarea { border-color: var(--line); } }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 3px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.row > * { flex: 0 0 auto; }
.row > .grow { flex: 1 1 200px; }

/* bảng */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line2); vertical-align: top; word-break: break-word; }
th { font-size: 12px; color: var(--muted); font-weight: 600; border-bottom-color: var(--line); }
.tablewrap { overflow-x: auto; }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.err { color: var(--bad); }
.ok { color: var(--ok); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; max-height: 480px; overflow: auto; }
.bubble-wrap { display: flex; flex-direction: column; max-width: 78%; margin-bottom: 6px; }
.bubble-wrap.in { align-items: flex-start; } .bubble-wrap.out { align-items: flex-end; margin-left: auto; }
.meta { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.bubble { padding: 10px 14px; white-space: pre-wrap; word-break: break-word; }
.bubble.in { background: var(--card); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; }
.bubble.out { background: var(--brand); color: var(--brand-ink); border-radius: 14px 4px 14px 14px; }
.bubble.manual { background: var(--ink); color: var(--card); border-radius: 14px 4px 14px 14px; }
.bubble.fail { background: var(--bad-bg); color: var(--bad); border-radius: 14px 4px 14px 14px; }
.msg { padding: 8px 0; border-bottom: 1px dashed var(--line); }

.qr { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.login { max-width: 380px; margin: 10vh auto; padding: 24px; }
.loginbrand { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

@media (max-width: 1100px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .brandrow { width: 100%; padding: 0 4px 8px; }
  nav a { height: 40px; padding: 0 10px; font-size: 13px; }
  nav .grow { display: none; }
  nav .who, nav .logout { width: 100%; margin-top: 4px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .content { padding: 16px; }
  .grid4 { grid-template-columns: 1fr; }
  .bubble-wrap { max-width: 92%; }
}

/* ---- bố cục hai cột (Zalo, Xưởng) ---- */
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols.studio { grid-template-columns: 380px minmax(0, 1fr); }
.col { display: flex; flex-direction: column; min-width: 0; }
.col .card { margin-bottom: 20px; }
.idrow { display: flex; align-items: center; gap: 16px; }
.avatar.big { width: 60px; height: 60px; font-size: 20px; background: var(--brand-soft); color: var(--brand-text); }
.idname { font-size: 18px; font-weight: 700; }
.badgecol { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tile { background: var(--soft); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-weight: 600; word-break: break-word; }
.actions { margin-top: 16px; gap: 10px; }
.timeline .tl { display: flex; gap: 14px; padding: 9px 0; }
.timeline .dot { margin-top: 7px; }
.tlt { font-weight: 600; }
.dot.neutral { color: #98a2b3; } .dot.info { color: var(--brand); }
.qrrow { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qrbox { flex: none; width: 208px; height: 208px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; display: flex; align-items: center; justify-content: center; }
.qrbox .qr { width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; }
.qrph { text-align: center; color: #5b6577; font-size: 13px; padding: 8px; }
.qrside { flex: 1; min-width: 160px; }
.bigtimer { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.steps { margin: 14px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.8; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border-radius: 99px; min-height: 32px; padding: 4px 14px; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tasklist { display: flex; flex-direction: column; }
.taskitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; background: transparent; padding: 10px 6px; min-height: 0; font-weight: 400; }
.taskitem.sel { background: var(--brand-soft); border-radius: 8px; border-bottom-color: transparent; }
.tname { font-weight: 600; }
.preview { padding: 0; overflow: hidden; margin-bottom: 0 !important; }
.pvhead { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.pvtitle { font-size: 17px; font-weight: 700; }
.stamp { border: 2px solid var(--bad); color: var(--bad); font-weight: 700; font-size: 13px; padding: 3px 12px; border-radius: 6px; letter-spacing: .04em; white-space: nowrap; }
.pvbody { padding: 20px 24px; background: var(--soft); }
.pv2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.pv2 .tile { background: var(--card); border: 1px solid var(--line); }
.shots { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.shots th { background: var(--bg); padding: 9px 12px; }
.shots td { padding: 10px 12px; font-size: 13px; }
.shots tfoot td { font-weight: 700; background: var(--soft); border-bottom: 0; }
.shots tfoot td:last-child, .shots tbody td:last-child { text-align: right; }
.sb { margin: 18px 0 8px; font-size: 14px; }
.frames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.frame { min-height: 112px; border: 2px dashed #b8c2d6; border-radius: 10px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); font-size: 12px; padding: 8px; }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.filechip { background: var(--brand-soft); color: var(--brand-text); border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 600; text-decoration: none; }
.actionbar { display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--card); flex-wrap: wrap; }
.badge.info { background: var(--brand-soft); color: var(--brand-text); }
.actions button, .actionbar button { white-space: nowrap; }
@media (max-width: 1100px) { .cols, .cols.studio { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .tiles, .pv2, .frames { grid-template-columns: 1fr; } .idrow { flex-wrap: wrap; } .badgecol { align-items: flex-start; } .pvhead, .pvbody, .actionbar { padding-left: 16px; padding-right: 16px; } }

/* ---- Hội thoại / Bộ não / Dự án / Cài đặt ---- */
.cols.conv { grid-template-columns: 430px minmax(0, 1fr); }
.cols.kb { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.card.flush { padding: 18px 0 0; overflow: hidden; }
.card.flush .chips { padding: 0 18px 14px; }
.convlist { display: flex; flex-direction: column; max-height: 520px; overflow: auto; }
.convrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line2); border-radius: 0; background: transparent; padding: 12px 18px; font-weight: 400; min-height: 0; }
.convrow:hover { background: var(--soft); }
.convrow.sel { background: var(--brand-soft); }
.cinfo { min-width: 0; }
.cname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cavatar { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.cavatar.group { background: #ffb020; color: #3d2800; } .cavatar.user { background: var(--brand-soft); color: var(--brand-text); border-radius: 50%; }
.convlist .empty { padding: 28px 18px; }
.detail { padding: 0; overflow: hidden; margin-bottom: 0; }
.detail .pvhead { flex-wrap: wrap; }
.ctl { gap: 8px; }
.ctl select { width: auto; min-width: 150px; }
.chatbody { max-height: 560px; overflow: auto; min-height: 220px; }
.chat.tall { max-height: none; margin-top: 0; }
.composer { padding: 14px 24px; border-top: 1px solid var(--line); background: var(--card); }
.composer label { margin-top: 0; }
.row.nowrap { flex-wrap: nowrap; align-items: flex-end; }
.row.nowrap > .grow { min-width: 0; }
.pad-b { padding-bottom: 4px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.dropzone { flex: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 2px dashed #b8c2d6; border-radius: 12px; background: var(--soft); padding: 22px 16px; cursor: pointer; color: var(--brand); min-height: 190px; margin: 0; }
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.dz-t { font-weight: 600; color: var(--ink); font-size: 14px; }
.uprow { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.upfields { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 4px; }
.upfields > button { margin-top: 10px; }
.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; color: var(--ink); margin-bottom: 8px; }
.note.tight { margin: 12px 0 0; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.split h2 { margin: 0; }
.docs td, .docs th { white-space: normal; }
.docs .acts { white-space: nowrap; text-align: right; }
.linkbtn { border: 0; background: none; color: var(--brand); padding: 6px 8px; min-height: 0; margin-right: 6px; }
.hit { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.hit.hist { background: var(--soft); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid2 .card { margin: 0; }
table.kv th { width: 150px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom-color: var(--line2); }
table.kv td { border-bottom-color: var(--line2); }
table.kv tr:last-child th, table.kv tr:last-child td { border-bottom: 0; }
.projgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 16px; align-items: start; }
.projgrid .card { margin: 0; }
.sect { margin-top: 18px; }
.sect-t { font-weight: 600; margin-bottom: 8px; }
.listrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.listrow.col-s { flex-direction: column; align-items: flex-start; gap: 4px; }
.sect .row { margin-top: 10px; }
@media (max-width: 1100px) { .cols.conv, .cols.kb { grid-template-columns: 1fr; } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .projgrid { grid-template-columns: 1fr; } .row.wrapm { flex-wrap: wrap; } .ctl select { width: 100%; } .composer { padding: 12px 16px; } table.kv th { width: 110px; } }
.badge { white-space: nowrap; }
.docs th, .docs td { padding: 10px 6px; }
.docs td:first-child { min-width: 130px; }
.docs td:nth-child(3) { white-space: nowrap; }
.docs td:nth-child(3) .badge { margin-left: 4px; }
.cols > .col, .content { min-width: 0; }
.row.nowrap input, .row.nowrap select { min-width: 0; }
@media (max-width: 1280px) { .row.wrapm { flex-wrap: wrap; } }
.docs th, .docs td { white-space: nowrap; }
.docs td:first-child { white-space: normal; min-width: 130px; }
.docs .acts button:not(.linkbtn) { min-height: 32px; padding: 4px 10px; }
.cols.kb { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }

/* ---- ColorAgent: nhãn đối tượng, danh sách chuẩn bị, đăng nhập, lời chào ---- */
.badge.in { background: var(--teal-bg); color: var(--teal-text); }
.badge.kh { background: var(--brand-soft); color: var(--brand-text); }
.badge.own { background: var(--ink); color: var(--card); }
.cavatar.group { background: var(--teal-bg); color: var(--teal-text); }
.brandname { font-weight: 700; letter-spacing: -.01em; }
.brandname span { background: linear-gradient(90deg, #0b58e9, #12d269); -webkit-background-clip: text; background-clip: text; color: transparent; }
nav .brandname { color: #fff; font-size: 19px; }
nav .brandname span { background: linear-gradient(90deg, #4d86ff, #12d269); -webkit-background-clip: text; background-clip: text; }
.setup { border-color: #f3d9a6; background: #fffcf5; }
.setup.complete { border-color: var(--line); background: var(--card); }
@media (prefers-color-scheme: dark) { .setup { background: #1a1608; border-color: #5c4510; } .setup.complete { background: var(--card); border-color: var(--line); } }
.steps5 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 14px; }
.stepi { display: flex; gap: 12px; align-items: flex-start; }
.stepi .n { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; background: var(--brand); color: var(--brand-ink); }
.stepi.done .n { background: var(--ok); color: #fff; }
.stepi.todo .n { background: var(--card); color: var(--muted); border: 1.5px solid var(--line); }
.stepi a.btn { display: inline-block; margin-top: 6px; text-decoration: none; background: var(--brand); color: var(--brand-ink); padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; }
.greet { font-size: 26px; }
.loginwrap { display: flex; flex-wrap: wrap; min-height: 100vh; }
.loginhero { flex: 1 1 420px; background: var(--side); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.loginhero h2 { font-size: 36px; line-height: 1.15; letter-spacing: -.02em; max-width: 460px; margin: 0; }
.loginhero p { color: var(--side-text); font-size: 16px; max-width: 440px; margin: 16px 0 0; }
.loginhero .foot { color: #8ea0c6; font-size: 13px; }
.loginside { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 40px; }
.loginside .login { margin: 0; width: 100%; max-width: 400px; padding: 32px; }

/* ---- Cài đặt: lưới ô nhập, trang rộng hết cỡ ---- */
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; margin-top: 4px; }
.fgrid label { margin-top: 12px; }
.bubble-wrap { max-width: min(78%, 720px); }
.projgrid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

.answer { white-space: pre-wrap; background: var(--brand-soft); color: var(--ink); border-radius: 12px; padding: 14px 16px; margin-top: 12px; }

/* ---- Chat thử kiểu Zalo ---- */
.zwrap { max-width: 860px; margin: 0 auto; }
.zchat { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: min(720px, calc(100vh - 300px)); min-height: 440px; margin-bottom: 0; }
.zhead { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.zname { font-weight: 700; font-size: 16px; }
.zbar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.zbar .chips { gap: 6px; }
.zlist { flex: 1; overflow-y: auto; padding: 18px; background: #e8eef6; display: flex; flex-direction: column; gap: 12px; }
@media (prefers-color-scheme: dark) { .zlist { background: #0a1630; } }
.zrow { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.zrow.me { align-self: flex-end; flex-direction: column; align-items: flex-end; gap: 2px; }
.zrow.bot img { width: 32px; height: 32px; border-radius: 50%; background: #fff; padding: 4px; flex: none; }
.zcol { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zb { padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.zrow.me .zb { background: #d4e4ff; color: #0b1b3f; border-bottom-right-radius: 4px; }
.zrow.bot .zb { background: #fff; color: #0b1b3f; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.zrow.bot .zb.fail { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.zmeta { font-size: 11px; color: var(--muted); padding: 0 4px; }
.zmeta .linkbtn { font-size: 11px; padding: 0; margin: 0; min-height: 0; }
.zsrc { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 4px; }
.zsrc .hit { margin-top: 6px; }
.zempty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; }
.zempty-t { font-weight: 700; font-size: 17px; }
.zsug { justify-content: center; margin-top: 6px; }
.zinput { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; background: var(--card); }
.zinput textarea { resize: none; max-height: 140px; border-radius: 20px; padding: 10px 16px; }
.zsend { width: 44px; height: 44px; min-height: 44px; border-radius: 50%; padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 13px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8aa0c8; animation: zdot 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes zdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .7; } }
@media (max-width: 760px) { .zchat { height: calc(100vh - 200px); } .zrow { max-width: 94%; } }

/* ---- Sơ đồ tri thức ---- */
.kmap { width: 100%; height: auto; display: block; }
.klink { opacity: .45; stroke: var(--muted); }
.klink.g-org { stroke: #06dfd7; } .klink.g-internal { stroke: #0b58e9; } .klink.g-owner { stroke: #0b1b3f; } .klink.g-group { stroke: #8a5cf6; }
@media (prefers-color-scheme: dark) { .klink.g-owner { stroke: #9db0d3; } }
.knode.g-org { fill: #06dfd7; } .knode.g-internal { fill: #0b58e9; } .knode.g-owner { fill: #0b1b3f; } .knode.g-group { fill: #8a5cf6; }
@media (prefers-color-scheme: dark) { .knode.g-owner { fill: #9db0d3; } }
.kroot { fill: var(--ink); } .kroot-t { fill: var(--card); font-size: 11px; font-weight: 700; }
.knum { fill: #fff; font-size: 13px; font-weight: 700; }
.knode.g-org + .knum { fill: #0b1b3f; }
.klab { fill: var(--ink); font-size: 13px; } .klab.strong { font-weight: 700; }
.kdom { cursor: pointer; outline: none; }
.kdom:hover .klab, .kdom.on .klab, .kdom:focus-visible .klab { font-weight: 700; }
.kdom:focus-visible circle, .kdom.on circle { stroke: var(--ink); stroke-width: 3; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.pgrid .card { margin: 0; }
.topic { padding: 10px 0; border-top: 1px solid var(--line2); }
.topic:first-of-type { border-top: 0; }
.stack { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line2); margin: 8px 0 6px; }
.stack i { display: block; height: 100%; }
.stack i.g-org { background: #06dfd7; } .stack i.g-internal { background: #0b58e9; } .stack i.g-owner { background: #0b1b3f; } .stack i.g-group { background: #8a5cf6; }
@media (prefers-color-scheme: dark) { .stack i.g-owner { background: #9db0d3; } }
@media (max-width: 760px) { .pgrid { grid-template-columns: 1fr; } }

/* ---- Soạn thẻ tri thức ---- */
.cardrow textarea.cardbody { min-height: 260px; font: inherit; line-height: 1.55; white-space: pre-wrap; }
.cardrow .split input { font-weight: 700; font-size: 16px; }

/* ---- Bộ não gộp: thanh tab, cây tệp, trình xem, chuông, thanh bên con ---- */
.brainwrap .bhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.btabs { display: flex; gap: 6px; flex-wrap: wrap; }
.btabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.btabs a:hover { border-color: var(--brand); }
.btabs a.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.bstats { color: var(--muted); font-size: 13px; } .bstats b { color: var(--ink); }
nav .subnav { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px 18px; padding-left: 10px; border-left: 1px solid var(--side-line); }
nav .subnav a { height: 36px; font-size: 13px; }
.topact { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.bell { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13px; }
.bell[hidden] { display: none; }
.bell .bn { background: #e5393b; color: #fff; border-radius: 99px; min-width: 20px; padding: 0 6px; text-align: center; font-size: 12px; }
.vault { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.vleft { margin: 0; padding: 14px; position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.vleft .split { margin: 0; } .vlabel { font-size: 12px; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.iconbtn { width: 34px; height: 34px; min-height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.vtree { overflow: auto; min-height: 120px; flex: 1; margin: 0 -6px; padding: 0 6px; }
.vgroup > summary, .vdom > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 7px 4px; font-weight: 600; list-style: none; }
.vgroup > summary::-webkit-details-marker, .vdom > summary::-webkit-details-marker { display: none; }
.vgroup > summary { font-size: 13px; } .vdom { margin-left: 14px; } .vdom > summary { font-weight: 500; font-size: 13px; color: var(--ink); }
.vdom[open] > summary { color: var(--brand-text); }
.vitem { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; border-radius: 8px; background: transparent; padding: 6px 8px 6px 14px; min-height: 0; font-weight: 400; font-size: 13px; }
.vitem:hover { background: var(--soft); } .vitem.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.vitem .vt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vitem.hit { flex-direction: column; align-items: flex-start; gap: 2px; padding-left: 8px; } .vitem.hit .vt { white-space: normal; font-weight: 600; } .vsnip { display: block; }
.vaud { width: auto; min-height: 32px; padding: 4px 10px; }
.vviewer { margin: 0; min-height: 420px; }
.vhead { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; } .vhead h2 { margin: 0 0 2px; font-size: 20px; }
.vact { margin: 10px 0 14px; } .vact select { width: auto; min-width: 220px; }
.vbody { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.chunk { padding: 10px 0; border-bottom: 1px dashed var(--line2); } .cpage { font-size: 12px; color: var(--brand-text); font-weight: 600; margin-bottom: 2px; } .ctext { white-space: pre-wrap; line-height: 1.6; }
.vempty { text-align: center; padding: 56px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; } .vempty h2 { margin: 0; color: var(--ink); }
.zfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--line2); background: var(--card); font-size: 12px; }
.zfoot .flab { color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.zfoot .fchip { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-bg); color: var(--ok); border-radius: 99px; padding: 2px 10px; font-weight: 600; }
.zfoot .fchip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
@media (max-width: 1000px) { .vault { grid-template-columns: 1fr; } .vleft { position: static; max-height: 420px; } }

.vgroup > summary::before, .vdom > summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.vgroup[open] > summary::before, .vdom[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .vgroup > summary::before, .vdom > summary::before { transition: none; } }

/* ---- Đồ thị chấm ---- */
.gseg { margin-bottom: 12px; }
.galaxy { position: relative; height: clamp(440px, 72vh, 780px); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse at 55% 35%, var(--brand-soft) 0%, var(--card) 62%); margin-bottom: 16px; }
.gcanvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none; }
.gcanvas.grab { cursor: grabbing; } .gcanvas:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.gtip { position: absolute; z-index: 3; pointer-events: none; max-width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(11, 27, 63, .15); font-size: 13px; }
.gtip[hidden], .gsel[hidden] { display: none; }
.gtop { position: absolute; left: 12px; top: 12px; right: 64px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; z-index: 2; }
.gsearch { width: 240px; min-height: 36px; border-radius: 99px; padding: 6px 14px; }
.glegend { display: flex; gap: 6px; flex-wrap: wrap; }
.gleg { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 12px; border-radius: 99px; background: var(--card); }
.gleg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; } .gleg.off { opacity: .45; }
.gctl { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 2; }
.gbtn { background: var(--card); border: 1px solid var(--line); }
.gstats { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 24px rgba(11, 27, 63, .12); z-index: 2; }
.gstats > div { padding: 10px 22px; text-align: center; display: flex; flex-direction: column; gap: 2px; } .gstats > div + div { border-left: 1px solid var(--line); }
.gstats b { font-size: 24px; line-height: 1; } .gstats span { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.gsel { position: absolute; left: 12px; bottom: 14px; width: min(340px, calc(100% - 24px)); margin: 0; z-index: 3; max-height: 55%; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.gsel .split { margin: 0; align-items: flex-start; } .gnb { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; } .gnb .linkbtn { text-align: left; padding: 3px 0; margin: 0; }
@media (max-width: 760px) { .gstats > div { padding: 8px 12px; } .gstats b { font-size: 18px; } .gsel { bottom: 76px; } .gsearch { width: 180px; } }

.idxchip { font-weight: 600; } .idxchip.ok { color: var(--ok); } .idxchip.busy { color: var(--warn); }
.viatag { margin-left: 8px; font-size: 11px; font-weight: 600; background: var(--brand-soft); color: var(--brand-text); border-radius: 99px; padding: 1px 8px; }

.micbtn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--card); border: 1px solid var(--line); color: var(--ink, inherit); cursor: pointer; }
.micbtn:hover { border-color: var(--accent, #2f6fed); }
.micbtn.rec { background: #d93025; border-color: #d93025; color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
.micbtn.busy { opacity: .55; cursor: wait; }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, .45); } 50% { box-shadow: 0 0 0 8px rgba(217, 48, 37, 0); } }
@media (prefers-reduced-motion: reduce) { .micbtn.rec { animation: none; } }

.callwrap { display: grid; gap: 16px; max-width: 760px; }
.callcard { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 20px; text-align: center; }
.callorb { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--card); border: 2px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.callorb[data-s="listening"] { border-color: #2f9e6b; }
.callorb[data-s="hearing"] { border-color: #2f9e6b; box-shadow: 0 0 0 10px rgba(47, 158, 107, .18); }
.callorb[data-s="thinking"] { border-color: #e0a100; animation: micpulse 1.4s ease-in-out infinite; }
.callorb[data-s="speaking"] { border-color: var(--accent, #2f6fed); box-shadow: 0 0 0 10px rgba(47, 111, 237, .16); }
.callstatus { font-weight: 600; font-size: 17px; }
.callmeter { width: min(320px, 80%); height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.callmeter i { display: block; height: 100%; width: 0; background: #2f9e6b; transition: width .08s linear; }
.callact { justify-content: center; }
.callbtn { min-height: 48px; padding: 0 28px; font-size: 16px; }
.calllog { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.cl { padding: 8px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.cl.me { align-self: flex-end; }
.cl.sys { color: var(--muted, #6b7280); font-size: 13px; border-style: dashed; }
.cl b { display: block; font-size: 12px; opacity: .65; margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .callorb[data-s="thinking"] { animation: none; } }

/* Kết nối nick chính + nhóm Zalo */
.avatar.sq { border-radius: 10px; background: var(--neutral-bg); color: var(--neutral); }
.avatar.ok { background: var(--ok-bg); color: var(--ok); }
.avatar.sq.ok { background: var(--brand-soft); color: var(--brand-text); }
.wiz { margin-bottom: 16px; }
.whead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.whead h2 { margin: 0; }
.wsteps { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.wstep { flex: 1 1 160px; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 14px; }
.wstep b { width: 24px; height: 24px; border-radius: 50%; background: var(--neutral-bg); color: var(--neutral); display: flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.wstep.on { border-color: var(--brand); color: var(--ink); }
.wstep.on b { background: var(--brand); color: var(--brand-ink); }
.wstep.done b { background: var(--ok-bg); color: var(--ok); }
.wbody { display: grid; gap: 12px; }
.wbot { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.wlist { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.wcode { font-size: 38px; font-weight: 600; letter-spacing: 8px; padding: 10px 20px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; font-variant-numeric: tabular-nums; }
.wwait { display: flex; align-items: center; gap: 10px; margin: 0; }
.spin { width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: wspin 0.9s linear infinite; display: inline-block; }
@keyframes wspin { to { transform: rotate(360deg); } }
.btnlink { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 500; }
.grp-bar { align-items: center; flex-wrap: wrap; }
.grp-bar h2 { margin: 0; }
.grp-search { max-width: 220px; }
.grp-grid { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.grp-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; align-content: start; background: var(--card); }
.grp-card.new { border-color: #d98a00; background: var(--warn-bg); }
.grp-card.on { border-color: var(--brand); }
.grp-top { display: flex; align-items: center; gap: 10px; }
.grp-info { min-width: 0; }
.grp-name { font-weight: 600; overflow-wrap: anywhere; }
.grp-form { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.grp-form label { font-size: 13px; color: var(--muted); }

.grp-main { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.grp-learn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.grp-learn input { margin-top: 3px; flex: none; }
.grp-learn-wrap { display: grid; gap: 6px; }

.fbbtns { display: inline-flex; gap: 4px; margin-left: 8px; }
.fbtn { min-height: 28px; padding: 0 8px; border-radius: 99px; background: transparent; border: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.fbtn.on { background: var(--brand-soft); border-color: var(--brand); }
.insbars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-top: 14px; }
.insbar { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 6px; }
.insbar i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.insbar.hasgap i { background: linear-gradient(to top, #d98a00 0, var(--brand) 100%); }

.cfpair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.cfpair > div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
@media (max-width: 760px) { .cfpair { grid-template-columns: 1fr; } }

.mono { font-family: ui-monospace, Consolas, monospace; background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.wrapany { overflow-wrap: anywhere; user-select: all; }
.pre { white-space: pre-wrap; }
