:root {
  --ink: #17324d;        /* thanh bên */
  --ink-2: #1f4263;
  --ink-text: #dfe8f0;
  --paper: #f3f5f4;      /* nền */
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5d6b78;
  --line: #dde3e2;
  --jade: #127a63;       /* hành động chính */
  --jade-soft: #e3f1ec;
  --amber: #b7791f;      /* đang chờ */
  --amber-soft: #fbf1df;
  --red: #b42318;
  --red-soft: #fdecea;
  --q-bg: #127a63;      /* bong bóng câu hỏi */
  --radius-s: 6px;
  --radius-l: 14px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #0f2236; --ink-2: #183350; --ink-text: #cfdbe6;
    --paper: #131a21; --surface: #1a232c; --text: #e4e9ee; --muted: #93a2b0; --line: #2a3642;
    --jade: #2fae8f; --jade-soft: #173a31; --amber: #e0a545; --amber-soft: #3a2e17;
    --red: #f07b70; --red-soft: #3d1f1d; --q-bg: #1b6a57;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--paper); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: var(--radius-s); }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--jade); border-color: var(--jade); color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--jade); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.input:focus { border-color: var(--jade); outline: none; box-shadow: 0 0 0 3px var(--jade-soft); }
.err { color: var(--red); font-size: 14px; min-height: 20px; }
.hidden { display: none !important; }

/* ---------------- đăng nhập ---------------- */
.login-wrap { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.login-side { background: var(--ink); color: var(--ink-text); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; font-weight: 600; color: #fff; max-width: 14ch; }
.login-side p { max-width: 38ch; margin: 0; opacity: .85; }
.lane { display: flex; align-items: center; gap: 10px; margin-top: 40px; }
.lane span { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); display: grid; place-items: center; font-size: 12px; }
.lane .gate { width: auto; height: auto; border-radius: var(--radius-s); padding: 6px 12px; background: var(--jade); border-color: var(--jade); color: #fff; font-weight: 600; }
.lane i { flex: 0 0 24px; height: 2px; background: rgba(255,255,255,.35); }
.login-main { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h2 { margin: 0 0 24px; font-size: 22px; font-weight: 600; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 28px; }
  .login-side h1 { font-size: 26px; }
  .lane { margin-top: 20px; }
}

/* ---------------- khung chính ---------------- */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100%; }
.side { background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 18px 16px 14px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.brand { font-weight: 600; color: #fff; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--jade), #1f8fb3); box-shadow: 0 4px 14px rgba(18,122,99,.35); }
.side .btn-new { width: calc(100% - 32px); margin: 0 16px 12px; background: var(--jade); border: 0; color: #fff; padding: 10px 12px; border-radius: 10px; font-weight: 600; text-align: left; transition: filter .15s, transform .1s; }
.side .btn-new:hover { filter: brightness(1.08); }
.side .btn-new:active { transform: scale(.98); }
.conv-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.conv-empty { padding: 10px; opacity: .6; font-size: 13px; }
.conv { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink-text); transition: background .12s; }
.conv:hover { background: var(--ink-2); }
.conv.active { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--jade); }
.conv .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conv .x { opacity: 0; background: none; border: 0; color: inherit; padding: 2px 6px; }
.conv:hover .x, .conv:focus-within .x { opacity: .7; }
.conv .busy { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none; animation: pulse 1.4s ease-in-out infinite; }
.side-foot { padding: 12px 16px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; display: grid; gap: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.side-foot a, .side-foot button { color: var(--ink-text); background: none; border: 0; padding: 0; text-align: left; text-decoration: none; opacity: .8; }
.side-foot a:hover, .side-foot button:hover { opacity: 1; text-decoration: underline; }
.who { color: #fff; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.who small { display: block; opacity: .6; font-weight: 400; font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center; font-weight: 600; flex: none; border: 1px solid rgba(255,255,255,.15); }
.scrim { display: none; }

.main { display: flex; flex-direction: column; min-height: 0; position: relative; }
.gatebar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--muted); min-height: 46px; }
.gatebar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.gatebar.on .dot { background: var(--jade); box-shadow: 0 0 0 4px var(--jade-soft); }
.gatebar.off .dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.gatebar.off #gateText { color: var(--red); }
.lanes { display: flex; gap: 3px; margin-left: auto; }
.lanes i { width: 7px; height: 16px; border-radius: 3px; background: var(--line); transition: background .3s; }
.lanes i.on { background: var(--jade); animation: lane 1.6s ease-in-out infinite; }
.lanes i.on:nth-child(2n) { animation-delay: .3s; } .lanes i.on:nth-child(3n) { animation-delay: .6s; }
.live-pill { font-size: 11px; padding: 2px 8px 2px 18px; border-radius: 99px; border: 1px solid var(--line); position: relative; white-space: nowrap; }
.lanes:empty + .live-pill { margin-left: auto; }
.live-pill::before { content: ""; position: absolute; left: 7px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--amber); }
.live-pill.on { color: var(--jade); border-color: var(--jade-soft); background: var(--jade-soft); }
.live-pill.on::before { background: var(--jade); animation: pulse 2s infinite; }
.menu-btn { display: none; }

.thread { flex: 1; overflow-y: auto; padding: 28px 20px 12px; scroll-behavior: auto; }
.thread-inner { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.turn { display: flex; flex-direction: column; gap: 12px; }
.turn.enter { animation: rise .28s ease-out; }
.empty { max-width: 620px; margin: 9vh auto 0; text-align: center; color: var(--muted); animation: rise .4s ease-out; }
.empty-mark { width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 700;
  background: linear-gradient(135deg, var(--jade), #1f8fb3); box-shadow: 0 10px 30px rgba(18,122,99,.3); }
.empty h2 { color: var(--text); font-weight: 600; font-size: 24px; margin: 0 0 8px; letter-spacing: -.01em; }
.empty p { margin: 0 auto; max-width: 48ch; }
.suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; text-align: left; }
.suggest button { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 2px; transition: border-color .15s, transform .15s, box-shadow .15s; }
.suggest button:hover { border-color: var(--jade); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.suggest b { font-size: 13px; color: var(--text); font-weight: 600; }
.suggest span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.q { align-self: flex-end; max-width: 82%; background: var(--q-bg); color: #fff; padding: 10px 15px; border-radius: 18px 18px 4px 18px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 2px 8px rgba(18,122,99,.18); }
.a { display: flex; gap: 12px; align-items: flex-start; }
.av { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--jade), #1f8fb3); margin-top: 2px; }
.av.dim { background: var(--line); color: var(--muted); }
.av.err { background: var(--red-soft); color: var(--red); }
.av.pulse { animation: glow 1.8s ease-in-out infinite; }
.a-main { flex: 1; min-width: 0; }
.a .body { overflow-wrap: anywhere; padding-top: 4px; }
.a .body > :first-child { margin-top: 0; } .a .body > :last-child { margin-bottom: 0; }
.a .body p { margin: 0 0 12px; }
.a .body h3, .a .body h4, .a .body h5, .a .body h6 { margin: 18px 0 8px; font-weight: 600; line-height: 1.35; }
.a .body h3 { font-size: 18px; } .a .body h4 { font-size: 16px; } .a .body h5, .a .body h6 { font-size: 15px; }
.a .body ul, .a .body ol { margin: 0 0 12px; padding-left: 22px; }
.a .body li { margin: 3px 0; } .a .body li.l1 { margin-left: 20px; } .a .body li.l2 { margin-left: 40px; } .a .body li.l3 { margin-left: 60px; }
.a .body a { color: var(--jade); text-underline-offset: 2px; }
.a .body blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.a .body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.a .body code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; }
.a .body :not(pre) > code { background: var(--paper); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.a .body .code { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.a .body .code-h { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px 5px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface); }
.a .body .code-copy { background: none; border: 0; color: var(--muted); font-size: 12px; padding: 2px 6px; border-radius: 5px; }
.a .body .code-copy:hover { color: var(--text); background: var(--paper); }
.a .body pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.a .body .tbl { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; }
.a .body .tbl table { font-size: 14px; }
.a .body .tbl th, .a .body .tbl td { padding: 8px 12px; }
.a .body .tbl tr:nth-child(even) td { background: color-mix(in srgb, var(--paper) 60%, transparent); }
.a .body.live:not(.empty)::after { content: ""; display: inline-block; width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px; background: var(--jade); border-radius: 2px; animation: caret 1s steps(2) infinite; }
.a .body.live > p:last-child { display: inline; }
.a .body.live.empty { display: none; }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.meta button { background: none; border: 0; color: var(--muted); padding: 2px 6px; margin-left: -2px; font-size: 12px; border-radius: 5px; }
.meta button:hover { color: var(--text); background: var(--surface); }
.meta.cancelled { align-self: flex-end; margin-top: -6px; }
.stage { display: flex; align-items: center; gap: 10px; min-height: 30px; font-size: 14px; color: var(--muted); }
.shimmer { font-weight: 500; background: linear-gradient(90deg, var(--muted) 0%, var(--text) 45%, var(--muted) 90%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
.clock { font-variant-numeric: tabular-nums; font-size: 12px; opacity: .8; }
.stop-link { margin-left: auto; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 12px; padding: 3px 10px; border-radius: 99px; }
.stop-link:hover { border-color: var(--red); color: var(--red); }
.wait { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.wait .wtext { display: grid; gap: 1px; flex: 1; }
.wait .wtext small { font-size: 12.5px; opacity: .85; }
.wait.queued { background: var(--amber-soft); color: var(--amber); }
.wait.error { background: var(--red-soft); color: var(--red); }
.wait .num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.wait .btn-ghost { color: inherit; opacity: .85; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }

.to-bottom { position: absolute; right: 50%; transform: translateX(50%); bottom: 118px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 4px 14px rgba(0,0,0,.12); font-size: 16px; z-index: 5; }
.composer { padding: 10px 20px 16px; }
.composer-inner { max-width: 780px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: 0 6px 24px rgba(20,40,60,.07); transition: border-color .15s, box-shadow .15s; }
.composer-inner:focus-within { border-color: var(--jade); box-shadow: 0 0 0 3px var(--jade-soft), 0 6px 24px rgba(20,40,60,.07); }
.composer textarea { flex: 1; border: 0; resize: none; background: transparent; padding: 8px 0; max-height: 220px; outline: none; line-height: 1.5; }
.composer textarea:placeholder-shown { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-send { display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 9px 14px; }
.btn-stop { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; }
.btn-stop i { width: 12px; height: 12px; border-radius: 3px; background: var(--text); }
.btn-stop:hover { border-color: var(--red); } .btn-stop:hover i { background: var(--red); }
.hint { max-width: 780px; margin: 6px auto 0; font-size: 12px; color: var(--muted); text-align: center; }

@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@keyframes caret { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -120% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(18,122,99,.45); } 50% { box-shadow: 0 0 0 6px rgba(18,122,99,0); } }
@keyframes lane { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .shimmer { color: var(--muted); background: none; }
}

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 20; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .scrim.on { display: block; position: fixed; inset: 0; background: rgba(10,20,30,.4); z-index: 15; }
  .menu-btn { display: inline-block; padding: 4px 8px; }
  .gatebar { padding: 8px 12px; gap: 8px; }
  .lanes { display: none; }
  .live-pill { margin-left: auto; }
  .thread { padding: 18px 12px 8px; }
  .q { max-width: 90%; }
  .a { gap: 8px; } .av { width: 26px; height: 26px; }
  .suggest { grid-template-columns: 1fr; }
  .composer { padding: 8px 10px 12px; }
  .btn-send span { display: none; }
  .hint { display: none; }
}

/* ---------------- quản trị ---------------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.admin header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin h1 { font-size: 22px; margin: 0; font-weight: 600; }
.admin h2 { font-size: 17px; margin: 32px 0 12px; font-weight: 600; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs button { background: none; border: 1px solid transparent; padding: 7px 12px; border-radius: var(--radius-s); color: var(--muted); }
.tabs button.on { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 500; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.stats div { font-size: 13px; color: var(--muted); }
.stats b { display: block; font-size: 24px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.stats .ok { color: var(--jade); } .stats .bad { color: var(--red); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); font-size: 13px; background: var(--paper); }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.tag.done { background: var(--jade-soft); border-color: transparent; color: var(--jade); }
.tag.queued { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
.tag.processing { border-color: var(--jade); color: var(--jade); }
.tag.error { background: var(--red-soft); border-color: transparent; color: var(--red); }
.lbl { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); margin-bottom: 14px; }
.form-row .field { margin: 0; }
.dlg { border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px; background: var(--surface); color: var(--text); width: min(380px, 92vw); }
.dlg::backdrop { background: rgba(10, 20, 30, .45); }
.dlg h3 { margin: 0 0 16px; font-weight: 600; }
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s ease-out; transition: opacity .3s; max-width: 90vw; }
.toast.out { opacity: 0; }
.lbl { white-space: nowrap; }
td .btn { white-space: nowrap; }
a.btn { text-decoration: none; color: var(--text); }

/* Ảnh do AI tạo */
.a .body .ai-img { display: block; margin: 6px 0 12px; }
.a .body .ai-img img { display: block; max-width: min(100%, 520px); height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); }
.a .body .ai-img-dl { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--muted); }

/* Đính kèm tệp với câu hỏi */
.btn-attach { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); flex: none; font-size: 16px; }
.btn-attach:hover { border-color: var(--jade); }
.btn-attach:disabled { opacity: .4; cursor: not-allowed; }
.attach-row { max-width: 780px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; font-size: 13px; }
.att-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; }
.att-chip small { color: var(--muted); }
.att-chip button { background: none; border: 0; color: var(--muted); padding: 0 2px; font-size: 13px; }
.att-chip button:hover { color: var(--red); }
.q-att { align-self: flex-end; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 82%; }
.q-att-img img { display: block; max-width: 180px; max-height: 140px; border-radius: 12px; border: 1px solid var(--line); }
.q-att-file { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--text); text-decoration: none; }
.q-att-file:hover { border-color: var(--jade); }

/* Tệp trong câu trả lời (AI tạo) */
.a .body .ai-file { display: inline-flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 4px 8px 10px 0; color: var(--text); text-decoration: none; max-width: 100%; }
.a .body .ai-file:hover { border-color: var(--jade); }
.a .body .ai-file small { color: var(--jade); white-space: nowrap; }
.a .body .ai-file .ai-file-n { overflow-wrap: anywhere; font-weight: 500; }

/* Ô nhập bị khoá khi câu hỏi trước chưa có câu trả lời */
.composer.locked .composer-inner { background: var(--paper); box-shadow: none; }
.composer.locked textarea { cursor: not-allowed; color: var(--muted); }
.composer.locked .hint { color: var(--amber); }
.composer.locked .btn-send { display: none; }
