/* ============================================================
   Knowledge Assistant demo (Demos page, tile 06): a chat window inside the laptop frame.
   Light, grey and white like the rest of the site. Layout follows the usual chat apps: sidebar
   (features on top, then pinned, then chats) and a centre with the orb, the box and starter cards.
   See scripts/knowledge-assistant.js.
   ============================================================ */
.ka {
  --ka-ink: #141311; --ka-soft: #3a3833; --ka-muted: #6e6b63; --ka-faint: #8f8c83;
  --ka-line: #e7e6e1; --ka-line-2: #d9d7cf; --ka-tint: #f5f5f3; --ka-tint-2: #eeede9;
  --ka-side-w: clamp(212px, 22vw, 262px);
  --ka-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: absolute; inset: 0; display: flex; overflow: hidden;
  font-family: var(--font-body, 'Switzer', 'Segoe UI', sans-serif); font-size: 14px; line-height: 1.45;
  color: var(--ka-ink); background: #fff; letter-spacing: -0.003em;
}
/* zero-specificity reset, so every component below can set its own background and colour */
:where(.ka) button, :where(.ka) textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.ka) button { cursor: pointer; border: 0; background: none; text-align: left; padding: 0; -webkit-tap-highlight-color: transparent; }
.ka-i { width: 17px; height: 17px; flex: none; display: block; }
.ka :focus-visible { outline: 2px solid var(--ka-ink); outline-offset: 2px; }
.ka .ka-box textarea:focus-visible { outline: 0; }

/* ---------- sidebar ---------- */
.ka-side {
  width: var(--ka-side-w); flex: none; display: flex; flex-direction: column; min-height: 0;
  background: var(--ka-tint); border-right: 1px solid var(--ka-line); padding: 16px 12px 12px;
  transition: margin-left 340ms var(--ka-ease), opacity 240ms ease;
}
.ka.ka-collapsed .ka-side { margin-left: calc(var(--ka-side-w) * -1); opacity: 0; pointer-events: none; }
.ka-side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 16px; }
.ka-logo { height: 13px; width: auto; display: block; }
.ka-icon { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ka-soft); transition: background-color 160ms ease, transform 160ms ease; }
.ka-icon:hover { background: rgba(20, 19, 17, 0.06); }
.ka-icon:active { transform: scale(0.95); }
.ka-close-side { display: none; }
.ka-new {
  display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 12px; margin-bottom: 6px;
  border-radius: 12px; background: #fff; border: 1px solid var(--ka-line-2); font-weight: 500; color: var(--ka-ink);
  transition: border-color 180ms ease, transform 160ms ease, box-shadow 200ms ease;
}
.ka-new:hover { border-color: #b9b7ae; box-shadow: 0 6px 14px -10px rgba(20, 19, 17, 0.4); }
.ka-new:active { transform: scale(0.98); }
.ka-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 0 8px; scrollbar-width: none; }
.ka-scroll::-webkit-scrollbar { display: none; }
.ka-feat { padding-bottom: 4px; }
.ka-label { margin: 16px 10px 5px; font-size: 11.5px; letter-spacing: 0.02em; color: var(--ka-faint); }
.ka-label-first { margin-top: 12px; }
.ka-recent .ka-label:first-child { margin-top: 16px; }
.ka-item {
  width: 100%; display: flex; align-items: center; gap: 9px; height: 33px; padding: 0 10px; border-radius: 9px;
  color: var(--ka-soft); transition: background-color 140ms ease, color 140ms ease;
}
.ka-item .ka-i { width: 15px; height: 15px; color: var(--ka-faint); transition: color 140ms ease; }
.ka-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-item:hover { background: rgba(20, 19, 17, 0.055); color: var(--ka-ink); }
.ka-item:hover .ka-i { color: var(--ka-soft); }
.ka-item.is-on { background: var(--ka-tint-2); color: var(--ka-ink); font-weight: 500; }
.ka-item.is-on .ka-i { color: var(--ka-ink); }
.ka-more { height: 28px; color: var(--ka-faint); font-size: 12.5px; }
.ka-more .ka-i { transition: transform 260ms var(--ka-ease); }
.ka-more .ka-i.is-up { transform: rotate(180deg); }
.ka-crow { position: relative; display: flex; align-items: center; }
.ka-crow .ka-chat { padding-right: 34px; }
.ka-pin {
  position: absolute; right: 4px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 8px; color: var(--ka-faint);
  display: inline-flex; align-items: center; justify-content: center; opacity: 0; transform: scale(0.9);
  transition: opacity 140ms ease, transform 200ms var(--ka-ease), background-color 140ms ease, color 140ms ease;
}
.ka-pin .ka-i { width: 14px; height: 14px; }
.ka-crow:hover .ka-pin, .ka-pin:focus-visible, .ka-crow.is-pinned .ka-pin { opacity: 1; transform: none; }
.ka-pin:hover { background: rgba(20, 19, 17, 0.08); color: var(--ka-ink); }
.ka-crow.is-pinned .ka-pin { color: var(--ka-ink); }
.ka-crow.is-pinned .ka-pin .ka-i { fill: currentColor; }
@media (hover: none) { .ka-pin { opacity: 0.7; transform: none; } }
.ka-me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--ka-line); margin-top: 4px; }
.ka-av { width: 30px; height: 30px; border-radius: 50%; background: var(--ka-ink); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ka-me-t { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.ka-me-t b { font-weight: 500; font-size: 13px; }
.ka-me-t small { font-size: 11.5px; color: var(--ka-muted); }

/* ---------- main column ---------- */
.ka-main {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative;
  background: radial-gradient(70% 55% at 50% 36%, #f3f3f1 0%, rgba(255, 255, 255, 0) 70%), #fff;
}
.ka-top { height: 56px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 20px 0 12px; }
.ka-title { font-weight: 500; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka:not(.ka-has-msgs) .ka-title { color: var(--ka-muted); font-weight: 400; }
.ka-sync { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ka-line); background: rgba(255, 255, 255, 0.8); font-size: 12px; color: var(--ka-muted); white-space: nowrap; }
.ka-sync i { width: 6px; height: 6px; border-radius: 50%; background: #23a35b; box-shadow: 0 0 0 3px rgba(35, 163, 91, 0.16); }

.ka-stage { flex: 1; min-height: 0; position: relative; }
.ka-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 24px 6px;
  transition: opacity 360ms var(--ka-ease), transform 460ms var(--ka-ease), filter 360ms ease;
}
.ka-orb { flex: 0 1 168px; min-height: 72px; aspect-ratio: 1; margin-bottom: 4px; transition: opacity 480ms ease, transform 640ms var(--ka-ease), filter 480ms ease; }
.ka-orb canvas { width: 100%; height: 100%; display: block; }
.ka-h { margin: 0; font-family: var(--font-display, inherit); font-weight: 400; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.028em; line-height: 1.1; text-wrap: balance; }
.ka-sub { margin: 8px 0 0; min-height: 20px; color: var(--ka-muted); font-size: 14px; }
.ka.is-typing .ka-orb { opacity: 0; transform: scale(0.8); filter: blur(8px); }
.ka.ka-has-msgs .ka-empty { opacity: 0; transform: translateY(-12px) scale(0.985); filter: blur(6px); pointer-events: none; }
.ka.ka-fresh .ka-empty { animation: ka-rise 520ms var(--ka-ease) both; }
@keyframes ka-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ka-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- conversation ---------- */
.ka-thread {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  opacity: 0; visibility: hidden; transition: opacity 320ms ease 120ms, visibility 0s linear 480ms;
}
.ka-thread::-webkit-scrollbar { display: none; }
.ka.ka-has-msgs .ka-thread { opacity: 1; visibility: visible; transition-delay: 120ms, 0s; }
.ka-thread-in { max-width: 720px; margin: 0 auto; padding: 14px 24px 28px; display: flex; flex-direction: column; gap: 24px; }
.ka-msg { display: flex; gap: 12px; min-width: 0; }
.ka-m-user { justify-content: flex-end; }
.ka-bubble { max-width: 82%; padding: 10px 16px; border-radius: 18px 18px 6px 18px; background: var(--ka-tint-2); font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.ka-in { animation: ka-rise 380ms var(--ka-ease) both; }
/* who is speaking: the bot picture on a finished answer, the moving orb while it works */
.ka-lead { width: 36px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center; margin-top: -3px; }
.ka-lead-orb { width: 44px; height: 44px; flex: none; display: block; margin: -6px; }
/* the bot picture is white on clear (as in the site chat): here it is turned black and sits on the page with no circle behind it */
.ka-bot { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ka-bot img { width: auto; height: 22px; display: block; filter: brightness(0); }
.ka-bot-s img { height: 19px; }
.ka-ai { min-width: 0; flex: 1; font-size: 14.5px; line-height: 1.62; color: var(--ka-soft); padding-top: 2px; }
.ka-body p { margin: 0 0 10px; overflow-wrap: anywhere; }
.ka-body p:last-child { margin-bottom: 0; }
.ka-body strong { color: var(--ka-ink); font-weight: 600; }
.ka-body ul { margin: 0 0 10px; padding: 0; list-style: none; }
.ka-body li { position: relative; padding-left: 16px; margin-bottom: 7px; overflow-wrap: anywhere; }
.ka-body li::before { content: ""; position: absolute; left: 3px; top: 0.72em; width: 4px; height: 4px; border-radius: 50%; background: var(--ka-faint); }
.ka-body, .ka-bubble { -webkit-user-select: text; user-select: text; }
.ka-w { animation: ka-fade 280ms ease-out both; }
.ka-blk { animation: ka-rise 380ms var(--ka-ease) both; }

/* structured answers: a section line, then label and value rows that are easy to scan */
.ka-body .ka-sec { margin: 14px 0 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ka-muted); }
.ka-body .ka-sec:first-child { margin-top: 0; }
.ka-body ul.ka-kvlist { margin: 4px 0 12px; padding: 2px 14px; border: 1px solid var(--ka-line); border-radius: 14px; background: var(--ka-tint); }
.ka-body ul.ka-kvlist:last-child { margin-bottom: 0; }
.ka-kv { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 9px 0; margin: 0; border-bottom: 1px solid var(--ka-line); }
.ka-body .ka-kv { padding-left: 0; }
.ka-body .ka-kv::before { display: none; }
.ka-kv:last-child { border-bottom: 0; }
.ka-k { color: var(--ka-muted); min-width: 0; }
.ka-v { color: var(--ka-ink); max-width: 64%; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ka-kv.ka-total { padding-top: 11px; }
.ka-kv.ka-total .ka-k { color: var(--ka-ink); font-weight: 600; }
.ka-kv.ka-total .ka-v strong { font-size: 1.06em; }

/* the steps it took (above the answer, folded away) */
.ka-trail { margin: 0 0 8px; }
.ka-trail-b { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 4px; margin-left: -4px; border-radius: 8px; font-size: 12.5px; color: var(--ka-faint); transition: background-color 140ms ease, color 140ms ease; }
.ka-trail-b .ka-i { width: 13px; height: 13px; }
.ka-trail-b:hover { background: var(--ka-tint); color: var(--ka-soft); }
.ka-trail-c { transition: transform 240ms var(--ka-ease); }
.ka-trail.is-open .ka-trail-c { transform: rotate(180deg); }
.ka-trail-l { display: none; margin: 4px 0 2px; padding: 0 0 0 4px; list-style: none; font-size: 12.5px; color: var(--ka-muted); }
.ka-trail.is-open .ka-trail-l { display: block; animation: ka-fade 220ms ease-out both; }
.ka-trail-l li { display: flex; align-items: center; gap: 8px; line-height: 24px; }
.ka-trail-l .ka-i { width: 12px; height: 12px; color: #23a35b; }

/* working lines while it answers */
.ka-steps { margin: 0; padding: 0; list-style: none; }
.ka-steps li { display: flex; align-items: center; gap: 8px; min-height: 28px; font-size: 14px; animation: ka-rise 300ms var(--ka-ease) both; }
.ka-steps li.is-done { color: var(--ka-faint); font-size: 13px; min-height: 22px; }
.ka-steps li.is-done .ka-i { width: 13px; height: 13px; color: #23a35b; }
.ka-shimmer {
  display: inline-block; line-height: 28px; color: transparent;
  background: linear-gradient(100deg, #9a978f 30%, #141311 50%, #9a978f 70%) 0 0 / 220% 100%; -webkit-background-clip: text; background-clip: text;
  animation: ka-shimmer 1.6s linear infinite;
}
@keyframes ka-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.ka-stopped { padding-left: 40px; font-size: 13px; color: var(--ka-faint); }

/* sources, copy, follow-up questions */
.ka-srcs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.ka-late { animation: ka-rise 420ms var(--ka-ease) both; }
.ka-srcs-l { font-size: 11.5px; color: var(--ka-faint); margin-right: 2px; }
.ka-src { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: 8px; background: var(--ka-tint); border: 1px solid var(--ka-line); font-size: 12px; color: var(--ka-muted); }
.ka-src .ka-i { width: 13px; height: 13px; }
.ka-acts { margin-top: 6px; margin-left: -6px; }
.ka-copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 12px; color: var(--ka-faint); opacity: 0; transition: opacity 160ms ease, background-color 140ms ease, color 140ms ease; }
.ka-copy .ka-i { width: 13px; height: 13px; }
.ka-msg:hover .ka-copy, .ka-copy:focus-visible, .ka-copy.is-done { opacity: 1; }
.ka-copy:hover { background: var(--ka-tint); color: var(--ka-ink); }
.ka-copy.is-done { color: #1c8a4b; }
@media (hover: none) { .ka-copy { opacity: 0.8; } }
.ka-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.ka-next-l { flex-basis: 100%; font-size: 11.5px; color: var(--ka-faint); margin-bottom: -2px; }
.ka-nx {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 6px 10px 6px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--ka-line-2); font-size: 13px; line-height: 1.3; color: var(--ka-soft);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}
.ka-nx .ka-i { width: 13px; height: 13px; color: var(--ka-faint); transform: rotate(45deg); transition: color 160ms ease; }
.ka-nx:hover { background: var(--ka-ink); border-color: var(--ka-ink); color: #fff; }
.ka-nx:hover .ka-i { color: #fff; }
.ka-nx:active { transform: scale(0.97); }

/* recommendation and watch-out boxes inside an answer */
.ka-call {
  display: flex; flex-direction: column; gap: 4px; margin: 4px 0 12px; padding: 11px 14px 12px; border-radius: 14px;
  background: var(--ka-tint); border: 1px solid var(--ka-line); color: var(--ka-soft); font-size: 14px; line-height: 1.55;
}
.ka-call:last-child { margin-bottom: 0; }
.ka-call-l { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ka-ink); }
.ka-call-l .ka-i { width: 13px; height: 13px; }
.ka-call-t { overflow-wrap: anywhere; }
.ka-call-rec { background: linear-gradient(180deg, #f8f8f6, #f3f3f0); border-color: var(--ka-line-2); }
.ka-call-warn { background: #fbf6ee; border-color: #eadcc4; }
.ka-call-warn .ka-call-l { color: #8a5a14; }

/* ---------- the box ---------- */
.ka-dock { flex: none; width: 100%; max-width: 744px; margin: 0 auto; padding: 0 24px 12px; }
.ka-boxwrap { position: relative; }
.ka-box {
  background: #fff; border: 1px solid var(--ka-line-2); border-radius: 24px; padding: 14px 12px 10px 18px;
  box-shadow: 0 1px 2px rgba(20, 19, 17, 0.04), 0 18px 34px -22px rgba(20, 19, 17, 0.3);
  transition: border-color 200ms ease, box-shadow 240ms ease;
}
.ka-box:focus-within { border-color: #bdb9ae; box-shadow: 0 1px 2px rgba(20, 19, 17, 0.04), 0 22px 40px -22px rgba(20, 19, 17, 0.34); }
.ka-box-in { display: flex; align-items: flex-start; gap: 10px; }
.ka-box-ic { width: 26px; height: 26px; display: inline-flex; align-items: center; flex: none; }
.ka-box textarea {
  display: block; flex: 1; min-width: 0; min-height: 26px; max-height: 132px; resize: none; border: 0; outline: 0; background: none;
  font-size: 15.5px; line-height: 1.5; padding: 0; overflow-y: auto; scrollbar-width: none; -webkit-user-select: text; user-select: text;
}
.ka-box textarea::placeholder { color: var(--ka-faint); }
.ka-box textarea { caret-color: var(--ka-ink); }
.ka-box textarea::-webkit-scrollbar { display: none; }
.ka-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 36px; padding-left: 30px; }
.ka-scope { min-width: 0; margin-right: auto; display: inline-flex; }
.ka-allfiles { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; border-radius: 8px; background: var(--ka-tint); font-size: 12.5px; color: var(--ka-muted); }
.ka-allfiles .ka-i { width: 14px; height: 14px; }
.ka-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 3px 0 8px; border-radius: 8px; background: var(--ka-tint-2); font-size: 12.5px; color: var(--ka-soft); max-width: 100%; }
.ka-chip .ka-i { width: 14px; height: 14px; }
.ka-chip-x { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; color: var(--ka-muted); }
.ka-chip-x:hover { background: rgba(20, 19, 17, 0.08); }
.ka-chip-x .ka-i { width: 12px; height: 12px; }
.ka-count { font-size: 12px; color: var(--ka-faint); font-variant-numeric: tabular-nums; }
.ka-count.is-low { color: #b4690e; }
.ka-send {
  width: 36px; height: 36px; border-radius: 50%; flex: none; background: var(--ka-ink); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 160ms ease, background-color 180ms ease, color 180ms ease;
}
.ka-send .ka-i { width: 18px; height: 18px; }
.ka-send:hover:not(:disabled) { background: #000; transform: translateY(-1px); }
.ka-send:active:not(:disabled) { transform: scale(0.95); }
.ka-send:disabled { background: var(--ka-tint-2); color: #a8a59c; cursor: default; }
.ka-send.is-stop .ka-i { width: 16px; height: 16px; }

/* suggestions that open above the box when you click into it */
.ka-suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 3; padding: 8px;
  background: #fff; border: 1px solid var(--ka-line); border-radius: 20px; transform-origin: 50% 100%;
  box-shadow: 0 2px 4px rgba(20, 19, 17, 0.04), 0 24px 44px -20px rgba(20, 19, 17, 0.34);
  opacity: 0; transform: translateY(6px) scale(0.985); pointer-events: none; visibility: hidden;
  transition: opacity 180ms ease, transform 240ms var(--ka-ease), visibility 0s linear 240ms;
}
.ka-suggest p { margin: 2px 10px 4px; font-size: 11.5px; color: var(--ka-faint); }
.ka-sg { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 6px 10px; border-radius: 12px; font-size: 14px; color: var(--ka-soft); transition: background-color 130ms ease, color 130ms ease; }
.ka-sg .ka-i { width: 15px; height: 15px; color: var(--ka-faint); }
.ka-sg:hover { background: var(--ka-tint); color: var(--ka-ink); }
.ka.is-focus:not(.ka-has-msgs):not(.is-typing) .ka-suggest { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }

/* starter cards (new chat only) */
.ka-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; max-height: 150px; transition: opacity 320ms ease, max-height 480ms var(--ka-ease), margin 480ms var(--ka-ease), transform 480ms var(--ka-ease); }
.ka-card {
  display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 13px; border-radius: 16px; min-width: 0;
  background: rgba(255, 255, 255, 0.7); border: 1px solid var(--ka-line); color: var(--ka-ink);
  transition: transform 220ms var(--ka-ease), border-color 180ms ease, box-shadow 220ms ease, background-color 180ms ease;
}
.ka-card:hover { transform: translateY(-2px); border-color: var(--ka-line-2); background: #fff; box-shadow: 0 14px 26px -18px rgba(20, 19, 17, 0.35); }
.ka-card:active { transform: scale(0.985); }
.ka-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ka-card-ic { width: 28px; height: 28px; border-radius: 9px; background: var(--ka-tint-2); display: inline-flex; align-items: center; justify-content: center; color: var(--ka-soft); }
.ka-card-ic .ka-i { width: 15px; height: 15px; }
.ka-card-tag { height: 22px; padding: 0 9px; border-radius: 999px; background: var(--ka-tint); border: 1px solid var(--ka-line); font-size: 11px; line-height: 20px; color: var(--ka-muted); }
.ka-card-title { font-weight: 500; font-size: 13.5px; }
.ka-card-text { font-size: 12.5px; color: var(--ka-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ka-card-q .ka-card-title { font-weight: 400; font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ka-card-q .ka-card-text { display: none; }
.ka.ka-has-msgs .ka-cards { opacity: 0; max-height: 0; margin-top: 0; transform: translateY(10px); pointer-events: none; overflow: hidden; }
.ka-foot { margin: 10px 0 0; text-align: center; font-size: 11.5px; color: var(--ka-faint); }

/* ---------- smaller screens: the sidebar becomes a drawer ---------- */
.ka-scrim { display: none; }
@media (max-width: 760px) {
  .ka-side { position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: min(280px, 82%); transform: translateX(-102%); transition: transform 340ms var(--ka-ease); box-shadow: 18px 0 40px -24px rgba(20, 19, 17, 0.5); }
  .ka.ka-collapsed .ka-side { margin-left: 0; opacity: 1; pointer-events: auto; }
  .ka.ka-side-open .ka-side { transform: none; }
  .ka-close-side { display: inline-flex; }
  .ka-scrim { display: block; position: absolute; inset: 0; z-index: 5; background: rgba(20, 19, 17, 0.28); opacity: 0; pointer-events: none; transition: opacity 280ms ease; }
  .ka.ka-side-open .ka-scrim { opacity: 1; pointer-events: auto; }
  .ka-top { padding: 0 12px 0 8px; height: 52px; }
  .ka-sync { display: none; }
  .ka-orb { flex-basis: 128px; }
  .ka-dock { padding: 0 12px 10px; }
  .ka-cards { display: flex; overflow-x: auto; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .ka-cards::-webkit-scrollbar { display: none; }
  .ka-card { flex: 0 0 66%; }
  .ka-foot { display: none; }
  .ka-thread-in { padding: 8px 14px 20px; }
  .ka-row { padding-left: 0; }
}
.df-window:has(.ka) { aspect-ratio: 16 / 10; }
@media (max-width: 640px) {
  .df-window:has(.ka) { aspect-ratio: auto; height: min(660px, 84svh); }
}
@media (prefers-reduced-motion: reduce) {
  .ka *, .ka *::before, .ka *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
}
