/* Kasper Chat — full-stage conversation + creative preview */

/* Break out of the global .k-content 1120px rail on chat pages only. */
.k-content:has(.tn-page--chat),
.k-content:has(.kc-shell) {
  max-width: none;
  width: 100%;
  padding: .65rem .85rem 0;
}

.tn-page--chat {
  gap: .65rem;
  min-height: calc(100vh - var(--k-topbar-h, 60px) - 1.25rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.kc-shell {
  --kc-max: 100%;
  --kc-text-max: min(52rem, 100%);
  --kc-preview-max: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - var(--k-topbar-h, 60px) - 4.5rem);
  height: 100%;
  margin: 0;
  border-radius: 1rem;
  background:
    radial-gradient(ellipse 70% 40% at 50% -10%, color-mix(in srgb, var(--k-brand) 12%, transparent), transparent 60%),
    var(--k-bg);
  overflow: hidden;
  border: 1px solid var(--k-line);
}

.kc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--k-line);
  background: color-mix(in srgb, var(--k-surface) 88%, transparent);
  backdrop-filter: blur(10px);
}
.kc-top__meta { min-width: 0; }
.kc-top__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--k-brand-ink);
  display: flex;
  align-items: center;
  gap: .45rem;
}
[data-theme="dark"] .kc-top__title { color: var(--k-ink); }
.kc-top__mark {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--k-brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--k-brand) 18%, transparent);
  flex: 0 0 auto;
}
.kc-top__sub {
  margin: .2rem 0 0;
  font-size: .78rem;
  color: var(--k-ink-soft);
}
.kc-top__actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }

.kc-caps {
  margin: 0;
  min-width: 11rem;
  border: 1px solid var(--k-line);
  border-radius: .75rem;
  background: var(--k-surface);
  overflow: clip;
}
.kc-caps__sum {
  list-style: none;
  cursor: pointer;
  padding: .35rem .7rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--k-ink);
}
.kc-caps__sum::-webkit-details-marker { display: none; }
.kc-caps__body {
  padding: .35rem .7rem .55rem;
  font-size: .8rem;
  color: var(--k-ink-soft);
  border-top: 1px solid var(--k-line);
  display: grid;
  gap: .2rem;
}

.kc-main {
  min-height: 0;
  overflow: auto;
  scroll-behavior: auto;
}
.kc-thread {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1.1rem 1rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-sizing: border-box;
}
.kc-empty {
  text-align: center;
  padding: 2.25rem 1rem 2.5rem;
  color: var(--k-ink-soft);
  animation: kc-empty-in .55s cubic-bezier(.22, 1, .36, 1) both;
}
.kc-empty__hero {
  position: relative;
  width: min(13.5rem, 58vw);
  margin: 0 auto 1rem;
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: end center;
}
.kc-empty__glow {
  position: absolute;
  inset: 12% 8% 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--k-brand) 34%, transparent), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}
.kc-empty__kasper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  max-height: 16rem;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 18px 28px rgba(8, 61, 59, .18));
  animation: kc-kasper-float 4.8s ease-in-out infinite;
}
.kc-empty__brand {
  margin: 0 0 .35rem;
  font-family: var(--k-display, "Outfit", "Cairo", sans-serif);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--k-brand-strong);
}
.kc-empty h2 {
  margin: 0 0 .35rem;
  color: var(--k-brand-ink);
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -.01em;
}
[data-theme="dark"] .kc-empty h2 { color: var(--k-ink); }
.kc-empty > p {
  margin: 0 auto;
  max-width: 26rem;
  line-height: 1.6;
}
.kc-empty__tips {
  margin: 1.15rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
  max-width: 28rem;
}
.kc-empty__tip {
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--k-brand) 22%, var(--k-line));
  background: color-mix(in srgb, var(--k-brand) 8%, var(--k-surface));
  color: var(--k-brand-ink);
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.kc-empty__tip:hover {
  background: color-mix(in srgb, var(--k-brand) 16%, var(--k-surface));
  border-color: color-mix(in srgb, var(--k-brand) 40%, var(--k-line));
  transform: translateY(-1px);
}
[data-theme="dark"] .kc-empty__tip { color: var(--k-ink); }

.kc-msg {
  display: grid;
  grid-template-columns: 2.35rem minmax(0, 1fr);
  gap: .7rem;
  align-items: start;
  animation: kc-in .34s cubic-bezier(.22, 1, .36, 1) both;
}
.kc-msg.is-mine {
  grid-template-columns: minmax(0, 1fr) 2.35rem;
}
.kc-msg.is-mine .kc-msg__avatar { order: 2; }
.kc-msg.is-mine .kc-msg__stack { order: 1; text-align: end; }
.kc-msg.is-mine .kc-msg__body {
  margin-inline-start: auto;
  background: color-mix(in srgb, var(--k-brand) 14%, var(--k-surface));
  border-color: color-mix(in srgb, var(--k-brand) 22%, var(--k-line));
}
.kc-msg__avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  background: var(--k-gradient-brand);
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--k-brand) 16%, transparent);
}
.kc-msg__avatar--kasper {
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--k-brand) 28%, #0b1f1e), #0b1f1e 70%);
  padding: 0;
}
.kc-msg__avatar--kasper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
  display: block;
}
.kc-msg.is-mine .kc-msg__avatar {
  background: linear-gradient(145deg, #64748b, #334155);
  box-shadow: none;
}
.kc-msg__who {
  margin: 0 0 .28rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--k-ink-soft);
}
.kc-msg__stack {
  min-width: 0;
  width: 100%;
}
.kc-msg.is-bot .kc-msg__body {
  max-width: var(--kc-text-max);
}
.kc-msg.is-mine .kc-msg__body {
  max-width: min(40rem, 100%);
}
.kc-msg__body {
  display: inline-block;
  max-width: 100%;
  padding: .9rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--k-line);
  background: var(--k-surface);
  color: var(--k-ink);
  line-height: 1.65;
  font-size: .95rem;
  white-space: pre-wrap;
  text-align: start;
  box-shadow: var(--k-shadow-sm);
}
.kc-msg__body a {
  color: var(--k-brand-strong);
  font-weight: 700;
  text-underline-offset: .12em;
}
.kc-msg__cites {
  margin-top: .45rem;
  font-size: .8rem;
  text-align: start;
}
.kc-msg__cites summary {
  cursor: pointer;
  color: var(--k-ink-soft);
  font-weight: 700;
}

/* Live / saved reply path under the bot message — collapsed until opened */
.kc-path {
  margin-top: .65rem;
  border: 1px solid var(--k-line);
  border-radius: .85rem;
  background: color-mix(in srgb, var(--k-bg-muted) 70%, var(--k-surface));
  overflow: clip;
  text-align: start;
}
.kc-path__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .55rem .75rem;
  font-size: .8rem;
  font-weight: 800;
  color: var(--k-brand-ink);
}
[data-theme="dark"] .kc-path__summary { color: var(--k-ink); }
.kc-path__summary::-webkit-details-marker { display: none; }
.kc-path__summary::before {
  content: "▸";
  font-size: .7rem;
  color: var(--k-ink-soft);
  transition: transform .15s ease;
}
[dir="rtl"] .kc-path__summary::before { content: "◂"; }
.kc-path[open] > .kc-path__summary { border-bottom: 1px solid var(--k-line); }
.kc-path[open] > .kc-path__summary::before { transform: rotate(90deg); }
[dir="rtl"] .kc-path[open] > .kc-path__summary::before { transform: rotate(-90deg); }
.kc-path__count {
  margin-inline-start: auto;
  font-size: .72rem;
  font-weight: 700;
  color: var(--k-ink-soft);
}
.kc-path__list { padding: .55rem .65rem .7rem !important; gap: .4rem !important; }
.kc-path__branch {
  padding: 0;
  font-size: .82rem;
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  background: var(--k-bg-muted);
  overflow: clip;
}
.kc-path__branch.is-pending { opacity: .55; }
.kc-path__branch.is-active {
  border-color: color-mix(in srgb, var(--k-brand) 45%, var(--k-line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--k-brand) 12%, transparent);
  opacity: 1;
}
.kc-path__branch.is-ok { border-color: color-mix(in srgb, var(--k-brand) 35%, var(--k-line)); }
.kc-path__branch.is-warn { border-color: color-mix(in srgb, #c9a227 50%, var(--k-line)); }
.kc-path__branch.is-fail { border-color: color-mix(in srgb, #c0392b 45%, var(--k-line)); }
.kc-path__branch.is-skip { opacity: .65; }
.kc-path__branch-sum {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .6rem;
  font-weight: 700;
}
.kc-path__branch-sum::-webkit-details-marker { display: none; }
.kc-path__branch-sum::before {
  content: "+";
  width: .9rem;
  color: var(--k-ink-soft);
  font-weight: 800;
  flex: 0 0 auto;
}
.kc-path__branch[open] > .kc-path__branch-sum::before { content: "−"; }
.kc-path__branch-sum strong { flex: 1; font-size: .84rem; }
.kc-path__state {
  font-size: .72rem;
  font-weight: 700;
  color: var(--k-ink-soft);
  white-space: nowrap;
  padding: .12rem .4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--k-surface) 80%, transparent);
}
.kc-path__body {
  padding: 0 .65rem .55rem 1.5rem;
  border-top: 1px dashed color-mix(in srgb, var(--k-line) 80%, transparent);
}
.kc-path__detail {
  margin: .4rem 0 0;
  color: var(--k-ink-soft);
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.kc-path__fact { margin-top: .45rem; }
.kc-path__meta {
  margin: .2rem 0 0;
  color: var(--k-ink-soft);
  font-size: .74rem;
  line-height: 1.4;
}
.kc-path__sql {
  margin: .35rem 0 0;
  padding: .45rem .55rem;
  max-height: 10rem;
  overflow: auto;
  border-radius: .4rem;
  border: 1px solid var(--k-line);
  background: color-mix(in srgb, var(--k-surface) 88%, var(--k-ink) 4%);
  color: var(--k-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.kc-inline-asset {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--k-brand);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .15em;
  cursor: pointer;
}
.kc-inline-asset:hover { color: var(--k-brand-ink, var(--k-brand)); }
.kc-assets {
  display: grid;
  gap: .85rem;
  margin-top: .85rem;
  width: 100%;
  max-width: none;
}
/* Webpage / file previews use the full chat stage width. */
.kc-msg.is-bot .kc-assets:has(.kc-asset--web),
.kc-msg.is-bot .kc-assets:has(.kc-asset--file) {
  width: 100%;
  max-width: none;
  position: static;
  inset: auto;
  translate: none;
}
.kc-asset--image {
  margin: 0;
  max-width: min(100%, 34rem);
}
.kc-asset__media {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: .7rem;
  overflow: hidden;
}
.kc-asset--image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: .7rem;
  border: 1px solid var(--k-line);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--k-surface) 92%, #fff), var(--k-surface));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--k-ink) 8%, transparent);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kc-asset__media:hover img {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--k-ink) 12%, transparent);
}
.kc-asset--image figcaption {
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--k-ink-soft);
}
.kc-asset--web {
  width: 100%;
  max-width: none;
  border: 1px solid var(--k-line);
  border-radius: 1rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--k-surface) 96%, var(--k-ink) 2%);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--k-ink) 9%, transparent);
}
.kc-asset--web-error {
  width: 100%;
  padding: .85rem 1rem;
  border-radius: .85rem;
  border: 1px solid color-mix(in srgb, #b42318 35%, var(--k-line));
  background: color-mix(in srgb, #fee4e2 65%, var(--k-surface));
  color: #b42318;
  font-size: .88rem;
  font-weight: 600;
}
.kc-asset--file {
  border: 1px solid var(--k-line);
  border-radius: .85rem;
  background: color-mix(in srgb, var(--k-surface) 94%, var(--k-brand) 4%);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--k-ink) 6%, transparent);
  overflow: hidden;
}
.kc-asset__file {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem;
}
.kc-asset__file-ico {
  width: 2rem;
  height: 2.35rem;
  border-radius: .3rem;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--k-brand) 18%, var(--k-surface)), var(--k-surface));
  border: 1px solid var(--k-line);
  position: relative;
  flex: 0 0 auto;
}
.kc-asset__file-ico::after {
  content: "";
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  border-style: solid;
  border-width: 0 .55rem .55rem 0;
  border-color: transparent color-mix(in srgb, var(--k-brand) 35%, var(--k-line)) transparent transparent;
}
.kc-asset__file-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: .15rem;
}
.kc-asset__file-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}
.kc-asset__file-meta span {
  font-size: .75rem;
  color: var(--k-ink-soft);
}
.kc-attach-bar {
  width: 100%;
  margin: 0 0 .45rem;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.kc-attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .35rem;
}
.kc-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 16rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  border: 1px solid var(--k-line);
  background: color-mix(in srgb, var(--k-surface) 88%, var(--k-brand) 6%);
  color: var(--k-ink);
  font-size: .75rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-attach-chip__ico {
  width: .7rem;
  height: .7rem;
  border-radius: .12rem;
  background: color-mix(in srgb, var(--k-brand) 55%, #083d3b);
  box-shadow: .2rem -.15rem 0 color-mix(in srgb, var(--k-brand) 30%, transparent);
  flex: 0 0 auto;
}
.kc-attach-chip button {
  border: 0;
  background: transparent;
  color: var(--k-ink-soft);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 .1rem;
}
.kc-asset__bar {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
  padding: .55rem .7rem;
  border-bottom: 1px solid var(--k-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--k-surface) 88%, #fff), var(--k-surface));
  font-size: .8rem;
}
.kc-asset__chrome {
  display: inline-flex;
  gap: .28rem;
  flex: 0 0 auto;
}
.kc-asset__chrome span {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--k-ink-soft) 45%, transparent);
}
.kc-asset__chrome span:nth-child(1) { background: #ff5f57; }
.kc-asset__chrome span:nth-child(2) { background: #febc2e; }
.kc-asset__chrome span:nth-child(3) { background: #28c840; }
.kc-asset__title {
  flex: 1 1 8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.kc-asset__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-inline-start: auto;
}
.kc-asset__status {
  padding: .65rem .85rem;
  font-size: .8rem;
  color: var(--k-ink-soft);
  background: color-mix(in srgb, var(--k-surface) 90%, var(--k-brand) 4%);
  border-bottom: 1px solid var(--k-line);
}
.kc-asset__status.is-error {
  color: #b42318;
  background: color-mix(in srgb, #fee4e2 70%, var(--k-surface));
}
.kc-asset__frame {
  display: block;
  width: 100%;
  min-height: 28rem;
  height: min(86vh, 64rem);
  border: 0;
  background:
    linear-gradient(180deg, #f8fafc, #eef2f7);
}
.kc-artifact-stage {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: stretch;
  padding: 0;
}
.kc-artifact-stage[hidden] { display: none !important; }
.kc-artifact-stage__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #0b1220 78%, transparent);
  backdrop-filter: blur(8px);
}
.kc-artifact-stage__panel {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: var(--k-surface);
  box-shadow: none;
}
.kc-artifact-stage__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--k-line);
}
.kc-artifact-stage__title {
  font-size: .95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-artifact-stage__body {
  min-height: 0;
  background: #0f172a;
  display: grid;
}
.kc-artifact-stage__img {
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
}
.kc-artifact-stage__frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
body.kc-artifact-open { overflow: hidden; }
.kc-msg__body--wait {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--k-ink-soft);
  font-weight: 500;
  font-size: .85rem;
}
.kc-typing {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.kc-typing > i {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--k-ink-soft);
  animation: kc-typing-wave 1.2s ease-in-out infinite;
}
.kc-typing > i:nth-child(2) { animation-delay: .18s; }
.kc-typing > i:nth-child(3) { animation-delay: .36s; }
@keyframes kc-typing-wave {
  0%, 60%, 100% { transform: translateY(0); opacity: .38; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@keyframes kc-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes kc-empty-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes kc-kasper-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes kc-pulse {
  0%, 100% { opacity: .35; transform: scale(.9); }
  50% { opacity: 1; transform: scale(1); }
}
.kc-msg.is-pending .kc-msg__avatar {
  opacity: .85;
}

.kc-composer-dock {
  padding: .65rem 1rem 1rem;
  border-top: 1px solid var(--k-line);
  background: color-mix(in srgb, var(--k-surface) 92%, transparent);
  backdrop-filter: blur(12px);
}
.kc-composer {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: end;
  padding: .65rem .75rem;
  border: 1px solid var(--k-line);
  border-radius: 1.35rem;
  background: var(--k-surface);
  box-shadow: 0 10px 30px rgba(8, 61, 59, .08);
}
.kc-composer:focus-within {
  border-color: color-mix(in srgb, var(--k-brand) 45%, var(--k-line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--k-brand) 14%, transparent), 0 10px 30px rgba(8, 61, 59, .08);
}
.kc-composer textarea {
  border: 0;
  resize: none;
  outline: none;
  background: transparent;
  color: var(--k-ink);
  font: inherit;
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 2.6rem;
  max-height: 9rem;
  padding: .55rem .35rem;
  line-height: 1.45;
}
.kc-composer .kc-icon-btn {
  flex: 0 0 auto;
}
.kc-icon-btn {
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: color-mix(in srgb, var(--k-brand-soft) 80%, transparent);
  color: var(--k-brand-strong);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.kc-icon-btn:hover { transform: translateY(-1px); }
.kc-icon-btn.is-voice {
  background: linear-gradient(145deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, .45);
  animation: kc-pulse 2.2s ease-out infinite;
}
.kc-icon-btn.is-send {
  background: var(--k-brand);
  color: #fff;
}
.kc-icon-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; animation: none; }
.kc-hint {
  width: 100%;
  margin: .45rem 0 0;
  font-size: .75rem;
  color: var(--k-ink-soft);
  text-align: center;
}

/* —— Voice modal: light, roomy, responsive —— */
.kc-voice {
  --kc-amp: 0;
  --kc-voice-ink: var(--k-ink, #0f1f1e);
  --kc-voice-mute: var(--k-ink-soft, #5c6f6c);
  --kc-voice-accent: var(--k-brand, #10B981);
  --kc-voice-surface: #ffffff;
  border: 0;
  padding: 0;
  width: min(32rem, calc(100vw - 1.5rem));
  max-height: min(42rem, calc(100dvh - 1.5rem));
  border-radius: 1.5rem;
  background:
    radial-gradient(ellipse 90% 55% at 50% -8%, color-mix(in srgb, var(--kc-voice-accent) 16%, transparent), transparent 62%),
    var(--kc-voice-surface);
  color: var(--kc-voice-ink);
  overflow: auto;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--k-line, #d7e4df) 90%, transparent),
    0 22px 56px rgba(8, 61, 59, .14);
  animation: kc-voice-in .32s cubic-bezier(.22, 1, .36, 1);
}
.kc-voice::backdrop {
  background: rgba(15, 31, 30, .28);
  backdrop-filter: blur(8px);
}
.kc-voice[data-state="listening"] { --kc-voice-accent: #059669; }
.kc-voice[data-state="thinking"] { --kc-voice-accent: #d97706; }
.kc-voice[data-state="speaking"] { --kc-voice-accent: #0d9488; }
.kc-voice[data-state="idle"] { --kc-voice-accent: var(--k-brand, #10B981); }

.kc-voice__shell {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.kc-voice__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.15rem 1.15rem .45rem 1.35rem;
}
.kc-voice__id { min-width: 0; text-align: start; flex: 1; }
.kc-voice__mark {
  display: block;
  margin: 0 0 .2rem;
  font-family: var(--k-display, "Outfit", "Cairo", sans-serif);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--k-brand-strong, #059669);
}
.kc-voice__who {
  margin: 0;
  max-width: 100%;
  font-family: var(--k-display, "Outfit", "Cairo", sans-serif);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--kc-voice-ink);
  text-wrap: balance;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-voice__close {
  border: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--k-bg, #f6f8f7) 88%, var(--k-brand) 6%);
  color: var(--kc-voice-mute);
  cursor: pointer;
  flex: 0 0 auto;
  transition: color .15s ease, background .15s ease;
}
.kc-voice__close:hover {
  color: var(--kc-voice-ink);
  background: color-mix(in srgb, var(--k-brand) 12%, #fff);
}

.kc-voice__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: .55rem 1.5rem 1.5rem;
  min-height: 24rem;
  background:
    radial-gradient(ellipse 58% 42% at 50% 28%,
      color-mix(in srgb, #2dd4bf 14%, transparent),
      transparent 70%);
}

.kc-voice__badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin: 0 0 .55rem;
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--kc-voice-accent) 28%, var(--k-line, #d7e4df));
  background: color-mix(in srgb, var(--kc-voice-accent) 10%, #fff);
  color: color-mix(in srgb, var(--kc-voice-accent) 55%, #083d3b);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .01em;
}

.kc-voice__cue,
.kc-cine__cue {
  margin: 0 0 .85rem;
  max-width: 24rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .01em;
  color: color-mix(in srgb, var(--kc-voice-accent, var(--k-brand)) 42%, #083d3b);
  text-wrap: balance;
  transition: color .2s ease, transform .2s ease, opacity .2s ease;
}
.kc-voice[data-state="listening"] .kc-voice__cue,
.kc-cine[data-state="listening"] .kc-cine__cue {
  color: #047857;
  transform: scale(1.02);
}
.kc-voice[data-state="thinking"] .kc-voice__cue,
.kc-cine[data-state="thinking"] .kc-cine__cue {
  color: #b45309;
}
.kc-voice[data-state="speaking"] .kc-voice__cue,
.kc-cine[data-state="speaking"] .kc-cine__cue {
  color: #0f766e;
}
.kc-voice[data-state="listening"] .kc-voice__badge,
.kc-cine[data-state="listening"] .kc-cine__badge {
  animation: kc-voice-turn-pulse 1.4s ease-in-out infinite;
}

.kc-mic-gate {
  width: min(100%, 22rem);
  margin: .35rem 0 1rem;
  padding: .9rem 1rem 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, #f59e0b 35%, var(--k-line, #d7e4df));
  background:
    linear-gradient(180deg, color-mix(in srgb, #f59e0b 10%, #fff), #fff);
  box-shadow: 0 10px 28px color-mix(in srgb, #92400e 8%, transparent);
  text-align: center;
}
.kc-mic-gate--overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  width: auto;
  margin: 0;
  padding: 1.25rem;
  border: 0;
  border-radius: 0 0 1.5rem 1.5rem;
  background: color-mix(in srgb, #fff 88%, #fef3c7 12%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
  display: grid;
  place-items: center;
}
.kc-mic-gate[hidden] {
  display: none !important;
}
.kc-mic-gate__card {
  width: min(100%, 22rem);
  padding: 1.25rem 1.2rem 1.3rem;
  border-radius: 1.15rem;
  border: 1px solid color-mix(in srgb, #f59e0b 40%, var(--k-line, #d7e4df));
  background: #fff;
  box-shadow: 0 16px 40px color-mix(in srgb, #92400e 12%, transparent);
}
.kc-voice.is-mic-blocked .kc-orb,
.kc-voice.is-mic-blocked .kc-voice__wave,
.kc-voice.is-mic-blocked .kc-voice__actions,
.kc-voice.is-mic-blocked .kc-voice__badge,
.kc-voice.is-mic-blocked .kc-voice__cue,
.kc-voice.is-mic-blocked .kc-voice__status,
.kc-voice.is-mic-blocked .kc-voice__transcript,
.kc-cine.is-mic-blocked .kc-avatar,
.kc-cine.is-mic-blocked .kc-cine__panel,
.kc-cine.is-mic-blocked .kc-cine__actions {
  filter: blur(3px);
  opacity: .28;
  pointer-events: none;
}
.kc-mic-gate__title {
  margin: 0 0 .35rem;
  font-size: 1.08rem;
  font-weight: 800;
  color: #7c2d12;
}
.kc-mic-gate__body {
  margin: 0 0 1rem;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--kc-voice-mute, #5c6f6c);
}
.kc-mic-gate .kc-voice__cta,
.kc-mic-gate .kc-cine__cta {
  width: 100%;
  min-height: 3.1rem;
  font-size: 1.02rem;
}
@keyframes kc-voice-turn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--kc-voice-accent) 0%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--kc-voice-accent) 22%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .kc-voice[data-state="listening"] .kc-voice__badge,
  .kc-cine[data-state="listening"] .kc-cine__badge {
    animation: none;
  }
  .kc-voice[data-state="listening"] .kc-voice__cue,
  .kc-cine[data-state="listening"] .kc-cine__cue {
    transform: none;
  }
}
.kc-voice__badge::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--kc-voice-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kc-voice-accent) 18%, transparent);
}

.kc-orb {
  --kc-amp: 0;
  position: relative;
  width: 13.5rem;
  height: 13.5rem;
  display: grid;
  place-items: center;
  margin: .35rem 0 1.15rem;
}
.kc-orb__aura {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%,
      rgba(94, 234, 212, .42) 0%,
      rgba(45, 212, 191, .22) 28%,
      rgba(13, 148, 136, .1) 48%,
      transparent 72%);
  filter: blur(18px);
  opacity: calc(0.72 + var(--kc-amp) * 0.45);
  transform: scale(calc(1.02 + var(--kc-amp) * 0.08));
  animation: kc-orb-aura 4.8s ease-in-out infinite;
}
.kc-orb__ring {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #99f6e4 26%, transparent);
  opacity: calc(0.22 + var(--kc-amp) * 0.48);
  transform: scale(calc(0.94 + var(--kc-amp) * 0.1));
  pointer-events: none;
  box-shadow:
    0 0 calc(14px + var(--kc-amp) * 36px) color-mix(in srgb, #2dd4bf 24%, transparent);
  transition: border-color .2s ease;
}
.kc-orb__ring--outer {
  inset: 2%;
  opacity: calc(0.12 + var(--kc-amp) * 0.28);
  border-color: color-mix(in srgb, #5eead4 18%, transparent);
  transform: scale(calc(0.98 + var(--kc-amp) * 0.06));
  animation-delay: .55s;
}
.kc-voice[data-state="listening"] .kc-orb__ring,
.kc-voice[data-state="speaking"] .kc-orb__ring {
  animation: kc-ring-breathe 1.8s ease-in-out infinite;
}
.kc-orb__mic {
  position: relative;
  z-index: 2;
  width: 8.75rem;
  height: 8.75rem;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
  transform: scale(calc(1 + var(--kc-amp) * 0.055));
  transition: transform .18s ease, filter .15s ease;
}
.kc-orb__mic:hover { filter: brightness(1.07) saturate(1.05); }
.kc-orb__mic:active { filter: brightness(.96); transform: scale(calc(0.97 + var(--kc-amp) * 0.04)); }
.kc-orb__mic:focus-visible {
  outline: 2px solid color-mix(in srgb, #5eead4 70%, transparent);
  outline-offset: 6px;
}
.kc-voice[data-state="thinking"] .kc-orb__mic,
.kc-voice[data-state="speaking"] .kc-orb__mic {
  pointer-events: none;
}

/* Premium fluid glass orb */
.kc-orb__sphere {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  background: #0f766e;
  box-shadow:
    0 28px 56px rgba(2, 44, 34, .42),
    0 10px 24px rgba(6, 95, 70, .28),
    0 0 0 1px rgba(255, 255, 255, .16) inset,
    0 -10px 28px rgba(2, 44, 34, .35) inset,
    0 0 calc(26px + var(--kc-amp) * 58px) color-mix(in srgb, #2dd4bf 42%, transparent);
  animation: kc-orb-breathe 5.2s ease-in-out infinite;
}
.kc-orb__sphere-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .62) 0%, transparent 26%),
    radial-gradient(circle at 68% 78%, rgba(2, 44, 34, .72) 0%, transparent 46%),
    radial-gradient(circle at 48% 42%, #99f6e4 0%, #5eead4 16%, #2dd4bf 34%, #14b8a6 52%, #0d9488 70%, #115e59 88%, #042f2e 100%);
}
.kc-orb__sphere-liquid {
  position: absolute;
  inset: -42%;
  border-radius: 42% 58% 48% 52% / 52% 42% 58% 48%;
  background:
    radial-gradient(ellipse 55% 48% at 38% 36%, rgba(204, 251, 241, .55) 0%, transparent 58%),
    radial-gradient(ellipse 48% 42% at 72% 64%, rgba(13, 148, 136, .55) 0%, transparent 60%),
    radial-gradient(ellipse 40% 36% at 52% 78%, rgba(6, 78, 59, .5) 0%, transparent 62%);
  filter: blur(8px) saturate(1.2);
  mix-blend-mode: soft-light;
  opacity: calc(0.78 + var(--kc-amp) * 0.2);
  animation: kc-orb-liquid 7.5s ease-in-out infinite;
}
.kc-orb__sphere-swirl {
  position: absolute;
  inset: -40%;
  border-radius: 46% 54% 50% 50% / 50% 46% 54% 50%;
  background:
    conic-gradient(from 190deg,
      transparent 0deg,
      rgba(207, 250, 254, .58) 42deg,
      transparent 88deg,
      rgba(45, 212, 191, .5) 140deg,
      transparent 188deg,
      rgba(153, 246, 228, .42) 245deg,
      transparent 300deg,
      rgba(165, 243, 252, .35) 330deg,
      transparent 360deg);
  filter: blur(12px) saturate(1.35);
  mix-blend-mode: screen;
  animation: kc-orb-swirl 11s linear infinite;
  opacity: calc(0.62 + var(--kc-amp) * 0.32);
}
.kc-orb__sphere-caustic {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 42% 28% at 62% 58%, rgba(255, 255, 255, .28) 0%, transparent 70%),
    radial-gradient(ellipse 30% 22% at 28% 62%, rgba(165, 243, 252, .22) 0%, transparent 72%);
  mix-blend-mode: overlay;
  opacity: calc(0.45 + var(--kc-amp) * 0.25);
  animation: kc-orb-caustic 6.4s ease-in-out infinite;
  pointer-events: none;
}
.kc-orb__sphere-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .78) 0%, rgba(255, 255, 255, .18) 16%, transparent 38%),
    radial-gradient(circle at 72% 78%, transparent 40%, rgba(2, 44, 34, .28) 100%),
    linear-gradient(155deg, rgba(255, 255, 255, .22), transparent 38%, rgba(2, 44, 34, .2) 100%);
  pointer-events: none;
}
.kc-orb__sphere-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .55),
    inset 0 -14px 28px rgba(2, 44, 34, .28),
    inset 0 0 0 1.5px rgba(255, 255, 255, .12);
  pointer-events: none;
}
.kc-voice[data-state="listening"] .kc-orb__sphere-swirl,
.kc-voice[data-state="speaking"] .kc-orb__sphere-swirl {
  animation-duration: 5.5s;
}
.kc-voice[data-state="listening"] .kc-orb__sphere-liquid,
.kc-voice[data-state="speaking"] .kc-orb__sphere-liquid {
  animation-duration: 4.2s;
}
.kc-voice[data-state="thinking"] .kc-orb__sphere-swirl {
  animation-duration: 3.2s;
}
.kc-voice[data-state="thinking"] .kc-orb__aura {
  animation-duration: 2.6s;
  filter: blur(16px) hue-rotate(18deg);
}
@keyframes kc-orb-swirl {
  to { transform: rotate(360deg); }
}
@keyframes kc-orb-liquid {
  0%, 100% {
    transform: rotate(0deg) scale(1);
    border-radius: 42% 58% 48% 52% / 52% 42% 58% 48%;
  }
  33% {
    transform: rotate(18deg) scale(1.04);
    border-radius: 54% 46% 58% 42% / 46% 54% 42% 58%;
  }
  66% {
    transform: rotate(-12deg) scale(0.98);
    border-radius: 48% 52% 42% 58% / 58% 48% 52% 42%;
  }
}
@keyframes kc-orb-caustic {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .4; }
  50% { transform: translate(-4%, 3%) scale(1.06); opacity: .62; }
}
@keyframes kc-orb-aura {
  0%, 100% { transform: scale(1); opacity: .7; }
  50% { transform: scale(1.08); opacity: .95; }
}
@keyframes kc-orb-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}
.kc-orb__mic-ico {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
  opacity: .92;
  filter: drop-shadow(0 2px 8px rgba(8, 61, 59, .25));
}
.kc-orb__mic.is-live .kc-orb__mic-ico {
  animation: kc-mic-pulse 1.1s ease-in-out infinite;
}
@keyframes kc-mic-pulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.kc-voice__wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .28rem;
  height: 1.7rem;
  margin: 0 0 .95rem;
}
.kc-voice__wave i {
  display: block;
  width: .22rem;
  height: 100%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--kc-voice-accent) 70%, #083d3b);
  transform-origin: center;
  transform: scaleY(calc(0.22 + var(--kc-amp) * 0.78));
  opacity: calc(0.28 + var(--kc-amp) * 0.72);
  will-change: transform;
}
.kc-voice[data-state="idle"] .kc-voice__wave i {
  opacity: .22;
  transform: scaleY(.28);
}
.kc-voice__wave i:nth-child(1),
.kc-voice__wave i:nth-child(5) { height: 70%; }
.kc-voice__wave i:nth-child(2),
.kc-voice__wave i:nth-child(4) { height: 90%; }

.kc-voice__status {
  margin: 0;
  font-family: var(--k-display, "Outfit", "Cairo", sans-serif);
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -.015em;
  color: var(--kc-voice-ink);
}
.kc-voice[data-state="listening"] .kc-voice__status {
  color: #047857;
}
.kc-voice[data-state="thinking"] .kc-voice__status {
  color: #b45309;
}
.kc-voice[data-state="speaking"] .kc-voice__status {
  color: #0f766e;
}
.kc-voice__transcript {
  margin: .65rem 0 0;
  max-width: 26rem;
  width: 100%;
  min-height: 3.6rem;
  padding: .85rem 1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--kc-voice-accent) 22%, var(--k-line, #d7e4df));
  background: color-mix(in srgb, var(--k-bg, #f6f8f7) 70%, #fff);
  color: var(--kc-voice-ink);
  font-size: .95rem;
  line-height: 1.65;
  text-wrap: pretty;
  box-sizing: border-box;
}
.kc-voice[data-state="listening"] .kc-voice__transcript {
  border-color: color-mix(in srgb, #059669 35%, var(--k-line, #d7e4df));
  background: color-mix(in srgb, #ecfdf5 70%, #fff);
}

.kc-voice__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  margin-top: 1.15rem;
  width: 100%;
}
.kc-voice__cta {
  border: 0;
  border-radius: 999px;
  padding: .7rem 1.35rem;
  font: inherit;
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
  color: #fff;
  background: var(--k-brand, #10B981);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--k-brand, #10B981) 22%, transparent);
  transition: transform .15s ease, filter .15s ease;
  min-height: 2.75rem;
}
.kc-voice__cta:hover { filter: brightness(1.04); transform: translateY(-1px); }
.kc-voice__cta:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.kc-voice__cta--ghost {
  color: var(--k-brand-ink, #083d3b);
  background: color-mix(in srgb, var(--k-brand) 10%, #fff);
  box-shadow: none;
  border: 1px solid color-mix(in srgb, var(--k-brand) 22%, var(--k-line, #d7e4df));
}
.kc-voice[data-state="listening"] .kc-voice__cta:not(.kc-voice__cta--ghost),
.kc-voice__cta.is-live:not(.kc-voice__cta--ghost) {
  background: #dc2626;
  box-shadow: 0 8px 18px rgba(220, 38, 38, .22);
}
.kc-voice__cta:not(.kc-voice__cta--ghost) {
  min-width: 11rem;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .kc-voice {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  .kc-voice__stage { min-height: calc(100dvh - 4.5rem); padding-bottom: 2rem; }
  .kc-mic-gate--overlay { border-radius: 0; }
}

@keyframes kc-voice-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes kc-ring-breathe {
  0%, 100% { opacity: .28; }
  50% { opacity: .55; }
}

@media (max-width: 1024px) {
  .kc-voice {
    width: min(30rem, calc(100vw - 1.5rem));
  }
}

@media (max-width: 720px) {
  .k-content:has(.tn-page--chat),
  .k-content:has(.kc-shell) { padding: .45rem .55rem 0; }
  .kc-thread { padding: .85rem .35rem 1.25rem; }
  .kc-shell { min-height: calc(100vh - var(--k-topbar-h, 60px) - 1rem); }
  .kc-empty { padding: 1.5rem .75rem 2rem; }
  .kc-empty__kasper { max-height: 13rem; }
  .kc-empty__tip { font-size: .7rem; }
  .kc-composer { padding: .55rem .6rem; }
  .kc-composer textarea { flex-basis: 8rem; }
  .kc-asset__frame { min-height: 22rem; height: min(78vh, 40rem); }
  .kc-voice {
    width: min(100vw - 1rem, 28rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 1.25rem;
  }
  .kc-voice__bar { padding: 1rem .9rem .35rem 1.05rem; }
  .kc-voice__stage {
    padding: .4rem 1rem 1.15rem;
    min-height: 18.5rem;
  }
  .kc-orb {
    width: 11.5rem;
    height: 11.5rem;
  }
  .kc-orb__mic {
    width: 7.5rem;
    height: 7.5rem;
  }
  .kc-voice__transcript {
    min-height: 2.8rem;
    font-size: .88rem;
  }
  .kc-voice__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .kc-voice__cta { width: 100%; }
}

@media (max-width: 420px) {
  .kc-voice {
    width: calc(100vw - .75rem);
    max-height: calc(100dvh - .75rem);
  }
  .kc-voice__who { font-size: 1.08rem; }
  .kc-orb {
    width: 10rem;
    height: 10rem;
  }
  .kc-orb__mic {
    width: 6.5rem;
    height: 6.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-msg,
  .kc-empty,
  .kc-empty__kasper,
  .kc-msg.is-pending .kc-msg__avatar,
  .kc-typing > i,
  .kc-voice,
  .kc-icon-btn.is-voice,
  .kc-orb__ring,
  .kc-orb__aura,
  .kc-orb__sphere,
  .kc-orb__sphere-swirl,
  .kc-orb__sphere-liquid,
  .kc-orb__sphere-caustic {
    animation: none !important;
  }
  .kc-orb__mic,
  .kc-orb__ring,
  .kc-orb__aura,
  .kc-orb__sphere,
  .kc-voice__wave i,
  .kc-empty__kasper,
  .kc-voice__cta {
    transform: none !important;
  }
}

/* ── Message actions ── */
.kc-msg__acts {
  display: flex;
  gap: .35rem;
  margin-top: .3rem;
  opacity: 0;
  transition: opacity .15s ease;
}
.kc-msg:hover .kc-msg__acts,
.kc-msg__acts:focus-within { opacity: 1; }
.kc-msg__act {
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  padding: .1rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--kc-line, #d7e4df);
  background: transparent;
  color: var(--kc-soft, #5c6f6c);
  cursor: pointer;
}
.kc-msg__act:hover { background: #e6f4ee; color: #083d3b; }

/* ── Load older ── */
.kc-load-older {
  display: block;
  margin: 0 auto .75rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--kc-line, #d7e4df);
  background: #fff;
  color: #0e7a62;
  cursor: pointer;
}
.kc-load-older:hover { background: #e6f4ee; }
.kc-load-older:disabled { opacity: .5; cursor: default; }

/* ── Markdown body ── */
.kc-msg__body--md > :first-child { margin-top: 0; }
.kc-msg__body--md > :last-child { margin-bottom: 0; }
.kc-msg__body--md p { margin: 0 0 .55em; }
.kc-msg__body--md ul,
.kc-msg__body--md ol { margin: 0 0 .55em; padding-inline-start: 1.25rem; }
.kc-msg__body--md h1, .kc-msg__body--md h2, .kc-msg__body--md h3,
.kc-msg__body--md h4 { margin: .7em 0 .35em; line-height: 1.4; }
.kc-msg__body--md h1 { font-size: 1.15em; }
.kc-msg__body--md h2 { font-size: 1.08em; }
.kc-msg__body--md h3 { font-size: 1em; }
.kc-msg__body--md code {
  font-family: Consolas, monospace;
  font-size: .88em;
  background: #f3f6f5;
  border-radius: 5px;
  padding: .05em .3em;
  direction: ltr;
  unicode-bidi: embed;
}
.kc-msg__body--md pre {
  background: #0f1f1e;
  color: #e7fff6;
  border-radius: 10px;
  padding: .7rem .85rem;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  margin: 0 0 .55em;
}
.kc-msg__body--md pre code { background: none; padding: 0; color: inherit; }
.kc-msg__body--md table {
  border-collapse: collapse;
  margin: 0 0 .55em;
  font-size: .92em;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}
.kc-msg__body--md th, .kc-msg__body--md td {
  border: 1px solid #d7e4df;
  padding: .3em .6em;
  text-align: start;
}
.kc-msg__body--md th { background: #e6f4ee; }
.kc-msg__body--md blockquote {
  margin: 0 0 .55em;
  padding-inline-start: .8em;
  border-inline-start: 3px solid #059669;
  color: #5c6f6c;
}
.kc-msg__body--md a { color: #0e7a62; }
.kc-msg__body--md img { max-width: 100%; border-radius: 8px; }
