/* layout component */
.chat-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  min-height: 0;
  padding: 12px;
  overflow: visible;
}
.chat-main {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;
  height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.87);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
  animation: motion-enter-up var(--motion-enter) var(--motion-ease) both;
}
html.theme-dark-effective .chat-main {
  border-color: var(--glass-line);
  background: rgba(20, 31, 39, 0.88);
  box-shadow: var(--shadow);
}
.daily-gift-trigger {
  position: fixed;
  z-index: 72;
  inset-inline-end: clamp(20px, 3vw, 48px);
  bottom: clamp(96px, 13vh, 138px);
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  color: #fff4c4;
  cursor: pointer;
  isolation: isolate;
}
.daily-gift-trigger__box {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  transform: rotate(-1deg);
  transition: filter 180ms ease;
}
.daily-gift-trigger__body {
  position: absolute;
  inset-inline-start: 6px;
  bottom: 4px;
  width: 46px;
  height: 34px;
  overflow: hidden;
  border-radius: 9px 9px 12px 12px;
  background: linear-gradient(145deg, #ff8da8 0%, #f45f86 54%, #df4776 100%);
  box-shadow:
    inset -3px -4px 0 rgba(172, 42, 93, 0.08),
    0 4px 8px rgba(155, 58, 98, 0.13);
}
.daily-gift-trigger__ribbon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 10px;
  background: linear-gradient(90deg, #f2a62d, #ffd96a 45%, #f5b739);
  transform: translateX(-50%);
}
.daily-gift-trigger__lid {
  position: absolute;
  z-index: 2;
  top: 18px;
  inset-inline-start: 3px;
  width: 52px;
  height: 14px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent calc(50% - 5px), #ffd15a calc(50% - 5px), #ffc13d calc(50% + 5px), transparent calc(50% + 5px)),
    linear-gradient(145deg, #ff9cb4, #f05280);
}
.daily-gift-trigger__bow {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 50%;
  width: 44px;
  height: 21px;
  transform: translateX(-50%);
}
.daily-gift-trigger__bow i {
  position: absolute;
  top: 2px;
  width: 23px;
  height: 15px;
  background: linear-gradient(145deg, #ffe184, #f6b630);
}
.daily-gift-trigger__bow i:first-child {
  left: 0;
  border-radius: 75% 42% 58% 45%;
  transform: rotate(16deg);
}
.daily-gift-trigger__bow i:nth-child(2) {
  right: 0;
  border-radius: 42% 75% 45% 58%;
  transform: rotate(-16deg);
}
.daily-gift-trigger__bow b {
  position: absolute;
  z-index: 2;
  top: 5px;
  left: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe68f, #efa625);
  transform: translateX(-50%);
}
.daily-gift-trigger:hover .daily-gift-trigger__box,
.daily-gift-trigger:focus-visible .daily-gift-trigger__box {
  animation: none;
  filter: brightness(1.08) saturate(1.1);
  transform: translateY(-3px) rotate(1deg) scale(1.06);
}
.daily-gift-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, #f2a83b 52%, transparent);
  outline-offset: 5px;
}
.daily-gift-trigger.is-ready .daily-gift-trigger__box {
  animation: daily-gift-float-attention 5.6s ease-in-out infinite;
}
.daily-gift-trigger__sparkle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ffe97d;
  filter: drop-shadow(0 0 7px rgba(255, 222, 91, 0.9));
  pointer-events: none;
}
.daily-gift-trigger__sparkle svg { width: 100%; height: 100%; stroke: currentColor; }
.daily-gift-trigger__sparkle--one { top: -7px; inset-inline-start: 1px; width: 22px; height: 22px; animation: daily-gift-sparkle 2.4s 0.1s ease-in-out infinite; }
.daily-gift-trigger__sparkle--two { top: 7px; inset-inline-end: -8px; width: 17px; height: 17px; animation: daily-gift-sparkle 2.8s 0.8s ease-in-out infinite; }
.daily-gift-trigger__sparkle--three { bottom: -5px; inset-inline-start: -7px; width: 14px; height: 14px; animation: daily-gift-sparkle 2.2s 1.3s ease-in-out infinite; }
@keyframes daily-gift-float-attention {
  0%, 100% { transform: translateY(1px) rotate(-1deg); }
  20% { transform: translateY(-4px) rotate(-1deg); }
  40% { transform: translateY(0) rotate(-1deg); }
  58% { transform: translateY(-4px) rotate(-1deg); }
  68% { transform: translateY(-1px) rotate(-1deg); }
  72% { transform: translateY(-2px) rotate(-6deg); }
  76% { transform: translateY(-3px) rotate(6deg); }
  80% { transform: translateY(-1px) rotate(-4deg); }
  84% { transform: translateY(-2px) rotate(2deg); }
}
@keyframes daily-gift-sparkle {
  0%, 100% { opacity: 0.28; transform: scale(0.65) rotate(-10deg); }
  45% { opacity: 1; transform: scale(1.18) rotate(10deg); }
  62% { opacity: 0.68; transform: scale(0.9) rotate(4deg); }
}
@media (max-width: 900px) {
  body.panel-page {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
  }
  .chat-shell {
    display: block;
    box-sizing: border-box;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
  }
  .chat-main {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .chat-main:has(.welcome:not([hidden])) {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
  .daily-gift-trigger {
    inset-inline-end: 18px;
    bottom: 142px;
    width: 72px;
    height: 72px;
  }
  .daily-gift-trigger__box {
    width: 58px;
    height: 58px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-main {
    animation: none;
    transition-duration: 0.001ms;
  }
  .daily-gift-trigger.is-ready .daily-gift-trigger__box,
  .daily-gift-trigger__sparkle {
    animation: none;
  }
}

/* topbar component */
.chat-topbar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 58px;
  padding: 8px 14px;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  animation: motion-enter-up var(--motion-enter) 90ms var(--motion-ease) both;
}
.chat-heading-group,
.chat-title-wrap {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.chat-heading-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-title {
  display: block;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-control);
  font-weight: 720;
  text-align: start;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}
.status-text {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-text::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #18a87b;
  box-shadow: none;
  content: "";
}
.credit-topbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 6px;
  min-height: 34px;
  padding-inline: 8px;
  border: 1px solid color-mix(in srgb, var(--action) 16%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--action-soft) 52%, var(--surface));
  color: var(--action);
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  opacity: 1;
}
.credit-topbar > span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  color: var(--credit-value);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.credit-topbar .coin-icon {
  width: var(--icon-medium);
  height: var(--icon-medium);
  filter: saturate(0.9);
}
.credit-topbar .price-value {
  color: inherit;
  font-size: var(--text-small);
  font-weight: 720;
}
.credit-topbar:hover,
.credit-topbar:focus-visible {
  border-color: color-mix(in srgb, var(--action) 34%, var(--line));
  background: var(--action-soft);
  color: var(--action-hover);
}
.credit-topbar.credit-received {
  animation: credit-surface-glow 720ms var(--motion-ease);
}
html.theme-dark-effective .chat-topbar {
  border-color: var(--glass-line);
  background: rgba(20, 31, 39, 0.78);
}
html.theme-dark-effective .credit-topbar {
  border-color: rgba(114, 198, 181, 0.2);
  background: #1d4545;
  color: var(--credit-value);
}
@media (min-width: 901px) {
  .credit-topbar {
    min-height: 32px;
    padding-inline: 7px;
  }
  .credit-topbar .coin-icon {
    width: var(--icon-small);
    height: var(--icon-small);
  }
}
@media (max-width: 560px) {
  .chat-topbar {
    min-height: 54px;
    padding-inline: 9px;
  }
  .chat-title-wrap .status-text {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-topbar,
  .credit-topbar.credit-received {
    animation: none;
    transition-duration: 0.001ms;
  }
}

/* welcome component */
.welcome[hidden],
.session-loading[hidden] {
  display: none;
}
.session-loading {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  height: 100%;
  min-height: 220px;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.8;
}
.session-loading-spinner {
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: session-loading-spin 900ms linear infinite;
}
@keyframes session-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .session-loading-spinner { animation: none; }
}
.prompt-chip-icon {
  display: grid;
  flex: 0 0 29px;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}
html.theme-dark-effective .prompt-chip-icon {
  background: #4a2f2a;
  color: var(--accent);
}
.prompt-expand {
  display: none;
}
@media (max-width: 560px) {
.welcome .prompt-chips {
    grid-template-columns: 1fr;
  }
.welcome .prompt-chip {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 15px;
    font-size: 12px;
    line-height: 1.55;
  }
.welcome .prompt-chip-icon {
    flex-basis: 25px;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    font-size: 12px;
  }
.welcome .prompt-chip::after {
    display: none;
  }
.welcome .prompt-chips:not(.is-expanded) .prompt-chip:nth-child(n + 3) {
    display: none;
  }
.welcome .prompt-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 9px auto 0;
    padding: 5px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--secondary);
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
  }
.welcome .prompt-expand:hover {
    background: var(--secondary-soft);
  }
.welcome.is-specialist .prompt-expand {
    display: none;
  }
.welcome .prompt-expand-chevron {
    width: 8px;
    height: 8px;
    border: 0;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.18s ease;
  }
.welcome .prompt-expand.is-expanded .prompt-expand-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
  }
}
.prompt-chip {
  position: relative;
  line-height: 1.6;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.prompt-chip::after {
  margin-inline-start: 8px;
  color: var(--accent);
  content: "↗";
  opacity: 0;
  transition: opacity 0.18s;
}
.prompt-chip:hover::after {
  opacity: 1;
}
@media (max-width: 560px) {
.welcome {
    align-content: start;
    padding-top: 34px;
  }
.welcome-mark {
    border-radius: 21px;
  }
.prompt-chips {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }
.prompt-chip {
    min-height: 54px;
  }
}
.welcome {
  display: grid;
  align-content: center;
  min-height: 100%;
  margin: 0 auto;
  text-align: center;
}
.welcome-mark {
  display: block;
  object-fit: cover;
}
.welcome-identity {
  position: relative;
  z-index: 4;
  width: max-content;
  margin: 0 auto;
}
.welcome-avatar-ring {
  display: block;
  width: max-content;
}
.welcome-avatar-trigger {
  color: inherit;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.welcome-avatar-trigger:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}
.welcome-presence {
  position: absolute;
  inset-inline-end: 1px;
  bottom: 2px;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #28b681;
  box-shadow: 0 2px 8px rgba(40, 182, 129, 0.35);
}
.welcome-eyebrow {
  margin-bottom: 10px;
  font-weight: 780;
  line-height: 1.3;
}
.home-suggestions {
  position: relative;
  display: grid;
}
.home-suggestions[data-hydrating] { visibility: hidden; }
.home-suggestions[hidden] { display: none; }
.home-suggestions-actions {
  position: absolute;
  z-index: 3;
  inset-inline-end: 0;
  top: 8px;
}
.home-suggestions-more {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.home-suggestions-more:hover,
.home-suggestions-more:focus-visible { background: var(--surface-subtle); color: var(--ink); }
.home-suggestions-more:focus-visible { outline: 0; box-shadow: var(--focus); }
.home-suggestions-more svg { width: 20px; height: 20px; }
.home-suggestions-menu {
  position: absolute;
  inset-inline-end: 0;
  top: 38px;
  display: grid;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(26, 35, 38, .16);
}
.home-suggestions-menu[hidden] { display: none; }
.home-suggestions-menu button {
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.home-suggestions-menu button:hover,
.home-suggestions-menu button:focus-visible { background: var(--surface-subtle); outline: 0; }
.home-suggestions-menu button[data-home-suggestions-action="close"] { color: var(--danger); }
.home-suggestions-menu button svg { width: 17px; height: 17px; margin-inline-end: 7px; vertical-align: -4px; }
.prompt-chips.is-loading { pointer-events: none; }
.prompt-chip-skeleton {
  position: relative;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  grid-template-rows: 8px 6px;
  align-content: center;
  min-height: 58px;
  padding: 10px 13px;
  gap: 7px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.prompt-chip-skeleton::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 20%, color-mix(in srgb, var(--surface) 72%, white) 48%, transparent 76%);
  background-size: 220% 100%;
  content: "";
  animation: home-suggestion-shimmer 1.3s ease-in-out infinite;
}
.prompt-chip-skeleton i { grid-row: 1 / 3; width: 29px; height: 29px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 14%, var(--line)); }
.prompt-chip-skeleton b,
.prompt-chip-skeleton small { display: block; border-radius: 999px; background: color-mix(in srgb, var(--secondary) 14%, var(--line)); }
.prompt-chip-skeleton b { width: 82%; }
.prompt-chip-skeleton small { width: 48%; opacity: .68; }
@keyframes home-suggestion-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.tax-assistant-promo {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  max-width: min(100%, 430px);
  margin: 18px auto 4px;
  padding: 12px 16px 12px 13px;
  border: 1px solid rgba(180, 81, 44, 0.22);
  border-radius: 18px;
  background: linear-gradient(115deg, rgba(255, 243, 233, 0.96), rgba(255, 251, 246, 0.86));
  color: #743b25;
  text-align: start;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(180, 81, 44, 0.12);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tax-assistant-promo:hover { transform: translateY(-2px); border-color: rgba(180, 81, 44, .42); box-shadow: 0 14px 30px rgba(180, 81, 44, .18); }
.tax-assistant-promo:focus-visible { outline: 0; box-shadow: var(--focus), 0 10px 26px rgba(180, 81, 44, .12); }
.tax-assistant-promo-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--cinematic-avatar-background); color: #fff; }
.tax-assistant-promo-icon img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }
.tax-assistant-promo-copy { display: grid; gap: 2px; flex: 1; }
.tax-assistant-promo-copy strong { font-size: 14px; font-weight: 800; }
.tax-assistant-promo-copy small { color: rgba(116, 59, 37, .75); font-size: 11px; }
.tax-assistant-promo-arrow { font-size: 20px; font-weight: 700; }
html.theme-dark-effective .tax-assistant-promo { border-color: rgba(220, 130, 87, .35); background: linear-gradient(115deg, rgba(91, 47, 34, .9), rgba(52, 37, 31, .9)); color: #ffe2d2; }
html.theme-dark-effective .tax-assistant-promo-copy small { color: rgba(255, 226, 210, .72); }
body[dir="rtl"] .welcome-eyebrow {
  letter-spacing: 0;
}
.welcome.is-specialist .welcome-avatar-ring {
  border-color: rgba(180, 81, 44, 0.16);
  background: linear-gradient(145deg, #fff, rgba(250, 239, 232, 0.82));
  box-shadow:
    0 18px 45px rgba(70, 48, 38, 0.13),
    0 0 0 6px rgba(180, 81, 44, 0.025);
}
.welcome.is-specialist .welcome-eyebrow {
  font-weight: 760;
  line-height: 1.25;
}
.welcome.is-specialist .prompt-chips {
  display: none;
}
.welcome-eyebrow + h2 {
  margin-top: 7px;
}
.welcome p {
  margin: 0 auto;
  font-weight: 530;
}
#welcome-message {
  position: relative;
  padding: 11px 20px;
  border: 1px solid rgba(180, 81, 44, 0.1);
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.62),
    rgba(250, 239, 232, 0.5)
  );
  box-shadow: 0 8px 24px rgba(70, 48, 38, 0.045);
}
.resume-chat-link {
  display: inline-flex;
  max-width: min(100%, 420px);
  margin: 14px auto 2px;
  padding: 5px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .2s ease, border-color .2s ease;
}
.resume-chat-link:hover,
.resume-chat-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}
.prompt-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.prompt-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  text-align: start;
}
@media (max-width: 900px) {
.prompt-chips {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 640px) {
.welcome-mark {
    width: 104px;
    height: 104px;
    border-radius: 31px;
  }
.welcome-avatar-ring {
    padding: 6px;
    border-radius: 38px;
  }
.welcome p {
    font-size: 17px;
    line-height: 1.75;
  }
.welcome.is-specialist #welcome-message {
    font-size: 17px;
    line-height: 1.75;
  }
#welcome-message {
    padding: 12px 16px;
    border-radius: 15px;
  }
}
.welcome-identity {
  animation: motion-enter-up var(--motion-enter) 145ms var(--motion-ease) both;
}
.welcome-eyebrow {
  animation: motion-enter-up var(--motion-enter) 205ms var(--motion-ease) both;
}
.welcome h2 {
  animation: motion-enter-up var(--motion-enter) 255ms var(--motion-ease) both;
}
.welcome > p {
  animation: motion-enter-up var(--motion-enter) 300ms var(--motion-ease) both;
}
.prompt-chip {
  animation: motion-enter-up var(--motion-enter)
    calc(330ms + var(--motion-index, 0) * 55ms) var(--motion-ease) both;
}
.prompt-chip {
  animation-fill-mode: backwards;
}
.prompt-chip:nth-child(1) {
  --motion-index: 0;
}
.prompt-chip:nth-child(2) {
  --motion-index: 1;
}
.prompt-chip:nth-child(3) {
  --motion-index: 2;
}
.prompt-chip:nth-child(4) {
  --motion-index: 3;
}
.welcome-avatar-ring {
  animation: assistant-breathe 4.8s ease-in-out infinite;
  transition:
    transform var(--motion-state) var(--motion-ease),
    box-shadow var(--motion-state),
    border-color var(--motion-fast);
}
.welcome-avatar-trigger:hover {
  transform: translateY(-3px) rotate(-2deg) scale(1.035);
  box-shadow: 0 20px 44px rgba(180, 81, 44, 0.25);
}
@media (max-width: 900px), (pointer: coarse) {
.prompt-chip {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
.welcome-identity {
    animation: none;
    transition-duration: 0.001ms;
  }
.welcome-eyebrow {
    animation: none;
    transition-duration: 0.001ms;
  }
.welcome h2 {
    animation: none;
    transition-duration: 0.001ms;
  }
.welcome > p {
    animation: none;
    transition-duration: 0.001ms;
  }
.prompt-chip {
    animation: none;
    transition-duration: 0.001ms;
  }
.welcome-avatar-ring {
    animation: none;
    transition-duration: 0.001ms;
  }
}
html.theme-dark-effective .prompt-chip {
  border-color: rgba(185, 210, 214, 0.16);
  background: #20333b;
  color: var(--ink);
}
html.theme-dark-effective .prompt-chip:hover {
  border-color: rgba(239, 139, 98, 0.54);
  background: #29424a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.welcome {
  max-width: 700px;
  padding-block: 26px;
}
.welcome-avatar-ring {
  padding: 7px;
  border: 1px solid color-mix(in srgb, #76aa9f 34%, var(--line));
  border-radius: 34px;
  background: linear-gradient(145deg, #fff, #e8f4f0);
  box-shadow:
    0 18px 42px rgba(23, 71, 62, 0.15),
    0 0 0 6px rgba(77, 145, 130, 0.045);
}
.welcome-mark {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 42%, #fff 0, #f6fbf9 48%, #dfefe9 100%);
  box-shadow: none;
}
.welcome-avatar-ring.welcome-avatar-trigger:hover {
  border-color: color-mix(in srgb, #4d9182 56%, var(--line));
  box-shadow:
    0 22px 48px rgba(23, 71, 62, 0.21),
    0 0 0 7px rgba(77, 145, 130, 0.065);
}
.welcome-eyebrow {
  margin-top: 11px;
  color: var(--muted);
  font-size: var(--text-control);
  letter-spacing: 0;
}
.welcome.is-specialist .welcome-eyebrow {
  margin-top: 11px;
  color: var(--muted);
  font-size: var(--text-control);
  letter-spacing: 0;
}
.welcome h2 {
  max-width: 620px;
  margin: 7px auto 5px;
  color: var(--ink);
  font-size: clamp(27px, 3.5vw, 42px);
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.welcome.is-specialist .welcome-eyebrow + h2 {
  max-width: 620px;
  margin: 7px auto 5px;
  color: var(--ink);
  font-size: clamp(27px, 3.5vw, 42px);
  font-weight: 760;
  line-height: 1.35;
  letter-spacing: -0.02em;
}
body[dir="rtl"] .welcome h2 {
  letter-spacing: 0;
}
.welcome p {
  max-width: 540px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.85;
}
.welcome.is-specialist #welcome-message {
  margin-top: 14px;
  max-width: 580px;
  padding: 12px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 11%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
  color: color-mix(in srgb, var(--ink) 88%, var(--accent));
  font-size: 15px;
  font-weight: 520;
  line-height: 1.9;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 7%, transparent);
}
html.theme-dark-effective .welcome.is-specialist #welcome-message {
  margin-top: 14px;
  max-width: 580px;
  padding: 12px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 11%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent-soft));
  color: color-mix(in srgb, var(--ink) 88%, var(--accent));
  font-size: 15px;
  font-weight: 520;
  line-height: 1.9;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 7%, transparent);
}
.prompt-chips {
  gap: 8px;
  margin-top: 22px;
}
.prompt-chip {
  min-height: 50px;
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  color: var(--ink);
  font-size: var(--text-small);
  box-shadow: none;
}
.prompt-chip::after {
  display: none;
}
.prompt-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px
    color-mix(in srgb, var(--line-strong) 32%, transparent);
  transform: none;
}
.prompt-chip:hover .prompt-chip-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
@media (max-width: 560px) {
.welcome {
    padding: 16px 4px 40px;
  }
.welcome-mark {
    width: 64px;
    height: 64px;
  }
.welcome h2 {
    font-size: 23px;
    white-space: normal;
  }
.welcome.is-specialist .welcome-eyebrow + h2 {
    font-size: 23px;
    white-space: normal;
  }
.welcome p {
    font-size: var(--text-control);
  }
.welcome.is-specialist #welcome-message {
    padding: 11px 15px;
    font-size: 14px;
  }
.welcome .prompt-chips {
    gap: 6px;
    margin-top: 16px;
  }
.welcome .prompt-chip {
    min-height: 48px;
  }
}

/* A temporary layer: the existing composer and controls keep their layout. */
.input-walkthrough[hidden], .input-walkthrough [hidden] { display: none; }
.input-walkthrough { position: fixed; inset: 0; z-index: 1300; pointer-events: none; }
.input-walkthrough-spotlight {
  position: fixed;
  box-sizing: border-box;
  border: 2px solid var(--action);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgb(12 25 28 / 35%);
  transition: top .28s ease, left .28s ease, width .28s ease, height .28s ease;
}
.input-walkthrough-card {
  position: fixed;
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 60px rgb(0 0 0 / 18%);
  pointer-events: auto;
  animation: input-walkthrough-arrive .25s ease both;
}
.input-walkthrough-card:focus { outline: none; }
.input-walkthrough-close {
  position: absolute; inset-inline-end: 10px; top: 10px;
  display: grid; place-items: center; width: 36px; height: 36px;
  padding: 8px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer;
}
.input-walkthrough-close svg { width: 18px; height: 18px; }
.input-walkthrough-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; color: var(--action); background: color-mix(in srgb, var(--action) 10%, var(--surface)); }
.input-walkthrough-icon svg { width: 22px; height: 22px; }
.input-walkthrough-card h3 { margin: 14px 0 7px; font-size: 17px; line-height: 1.6; }
.input-walkthrough-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.9; }
.input-walkthrough-card footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.input-walkthrough-card footer button { min-height: 42px; padding: 8px 18px; border: 0; border-radius: 12px; background: var(--action); color: var(--on-action, #fff); font: inherit; font-size: 13px; cursor: pointer; }
.input-walkthrough-card button:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.input-walkthrough-close:hover { background: var(--surface-hover); }
.input-walkthrough-card footer button:hover { background: var(--action-hover); }
.input-walkthrough-progress { display: flex; gap: 5px; }
.input-walkthrough-progress i { width: 6px; height: 6px; border-radius: 6px; background: var(--line); }
.input-walkthrough[data-step="0"] .input-walkthrough-progress i:first-child,
.input-walkthrough[data-step="1"] .input-walkthrough-progress i:last-child { width: 18px; background: var(--action); }
@keyframes input-walkthrough-arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .input-walkthrough-spotlight { transition: none; }
  .input-walkthrough-card { animation: none; }
}

/* Self-contained presentation for the optional cinematic welcome avatar. */
.cinematic-avatar {
  position: relative;
  display: block;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface-subtle);
  isolation: isolate;
}

.cinematic-avatar::before {
  position: absolute;
  z-index: 0;
  inset: 9%;
  border-radius: 50%;
  background: rgba(231, 185, 93, 0.34);
  content: "";
  filter: blur(12px);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.2, .8, .2, 1);
}

.cinematic-avatar.is-live::before {
  opacity: 1;
  transform: scale(1.18);
}

.cinematic-avatar[data-cinematic-state="thinking"]::before,
.cinematic-avatar[data-cinematic-state="using-tool"]::before {
  background: rgba(111, 184, 177, 0.38);
  opacity: 0.88;
  transform: scale(1.3);
}

.cinematic-avatar[data-cinematic-state="streaming"]::before {
  opacity: 0.76;
  transform: scale(1.24);
}

.cinematic-avatar[data-cinematic-state="error"]::before,
.cinematic-avatar[data-cinematic-state="cancelled"]::before {
  background: rgba(209, 116, 92, 0.28);
  opacity: 0.62;
}

.cinematic-avatar > svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  shape-rendering: geometricPrecision;
}

.cinematic-avatar [data-cinematic-part="screen-glow"] {
  transition: opacity 420ms ease;
}

.cinematic-avatar.is-loading .welcome-mark {
  opacity: 0.45;
}

.welcome-avatar-ring .cinematic-avatar {
  width: 104px;
  height: 104px;
  overflow: visible;
  border-radius: 28px;
  background: var(--cinematic-avatar-background);
}

.welcome-avatar-ring .cinematic-avatar::before {
  inset: 16%;
  background: rgba(107, 177, 161, 0.24);
  filter: blur(15px);
}

.cinematic-avatar.cinematic-avatar--details {
  width: 80px;
  height: 80px;
  background: var(--cinematic-avatar-background);
}

.cinematic-avatar--details::before {
  inset: 16%;
  background: rgba(107, 177, 161, 0.24);
  filter: blur(15px);
}

.cinematic-avatar--details.is-loading .assistant-details-avatar {
  opacity: 0.45;
}

.conversation-avatar-dock {
  position: absolute;
  z-index: 8;
  top: 92px;
  inset-inline-end: clamp(18px, 2.4vw, 36px);
  width: 104px;
  height: 104px;
}
.conversation-avatar-dock[hidden] { display: none; }
.conversation-avatar-menu[hidden],
.conversation-avatar-menu button[hidden] { display: none; }
.conversation-avatar-menu {
  position: absolute;
  z-index: 4;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  display: grid;
  min-width: 210px;
  max-width: calc(100vw - 36px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 16px 38px rgba(26, 35, 38, .16);
}
.conversation-avatar-menu a,
.conversation-avatar-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.conversation-avatar-menu a:hover,
.conversation-avatar-menu button:hover,
.conversation-avatar-menu a:focus-visible,
.conversation-avatar-menu button:focus-visible {
  outline: 0;
  background: var(--surface-subtle);
}
.conversation-avatar-menu a:focus-visible,
.conversation-avatar-menu button:focus-visible { box-shadow: var(--focus); }
.conversation-avatar-menu button[data-avatar-action="dismiss"] { color: var(--danger); }
.conversation-avatar-menu svg {
  width: 17px;
  height: 17px;
  margin-inline-end: 7px;
  vertical-align: -4px;
}
.conversation-avatar {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, #76aa9f 34%, var(--line));
  border-radius: 30px;
  background: linear-gradient(145deg, #fff, #e5f2ed);
  color: inherit;
  cursor: pointer;
  box-shadow:
    0 16px 34px rgba(23, 71, 62, 0.18),
    0 0 0 5px rgba(77, 145, 130, 0.04);
  transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.conversation-avatar:hover {
  box-shadow:
    0 20px 40px rgba(23, 71, 62, 0.23),
    0 0 0 6px rgba(77, 145, 130, 0.06);
  transform: translateY(-2px);
}
.conversation-avatar:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.cinematic-avatar.cinematic-avatar--conversation {
  width: 90px;
  height: 90px;
  overflow: visible;
  border: 0;
  border-radius: 25px;
  background: radial-gradient(circle at 50% 42%, #fff 0, #f6fbf9 48%, #dfefe9 100%);
}

.cinematic-avatar--conversation::before {
  inset: 15%;
  background: rgba(107, 177, 161, 0.24);
  filter: blur(14px);
}

html.theme-dark-effective .welcome-avatar-ring,
html.theme-dark-effective .conversation-avatar {
  border-color: rgba(151, 205, 194, 0.24);
  background: linear-gradient(145deg, #294139, #1d332e);
}

html.theme-dark-effective .welcome-avatar-ring .cinematic-avatar,
html.theme-dark-effective .cinematic-avatar.cinematic-avatar--details,
html.theme-dark-effective .cinematic-avatar.cinematic-avatar--conversation {
  background: radial-gradient(circle at 50% 42%, #334f48 0, #263f39 52%, #1a302b 100%);
}

.conversation-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

@media (max-width: 1100px) {
  .conversation-avatar {
    width: 78px;
    height: 78px;
    border-radius: 23px;
  }
  .conversation-avatar-dock { top: 84px; inset-inline-end: 14px; width: 78px; height: 78px; }

  .cinematic-avatar.cinematic-avatar--conversation {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }
}

@media (max-width: 640px) {
  .cinematic-avatar {
    width: 104px;
    height: 104px;
    border-radius: 31px;
  }

  .conversation-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
  .conversation-avatar-dock { top: 76px; inset-inline-end: 10px; width: 64px; height: 64px; }

  .cinematic-avatar.cinematic-avatar--conversation {
    width: 52px;
    height: 52px;
    border-radius: 17px;
  }

}

@media (max-width: 560px) {
  .cinematic-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .welcome-avatar-ring .cinematic-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .cinematic-avatar.cinematic-avatar--details {
    width: 76px;
    height: 76px;
    border-radius: 21px;
  }

  .cinematic-avatar.cinematic-avatar--conversation {
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .conversation-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }
  .conversation-avatar-dock { width: 58px; height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-avatar::before {
    transition: none;
  }
}

/* Expression artwork belongs to the rig, with normal eyes restored between stories. */
.cinematic-avatar [data-face-art] { opacity: 0; pointer-events: none; transform-box: fill-box; transform-origin: center; }
.cinematic-avatar svg[data-face-expression="love"] [data-face-art="love"],
.cinematic-avatar svg[data-face-expression="sparkle"] [data-face-art="sparkle"],
.cinematic-avatar svg[data-face-expression="laugh"] [data-face-art="laugh"] { opacity: 1; }
.cinematic-avatar svg[data-face-expression="love"] [data-cinematic-part="eye-shell"],
.cinematic-avatar svg[data-face-expression="sparkle"] [data-cinematic-part="eye-shell"],
.cinematic-avatar svg[data-face-expression="laugh"] [data-cinematic-part="eye-shell"] { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cinematic-avatar svg[data-face-expression="love"] [data-face-art="love"] { animation: avatar-heartbeat .7s ease-in-out infinite; }
  .cinematic-avatar svg[data-face-expression="sparkle"] [data-face-art="sparkle"] { animation: avatar-starshine .9s ease-in-out infinite; }
  .cinematic-avatar svg[data-face-expression="blow"] [data-face-art="blow"] { animation: avatar-kiss 1.1s ease-out both; }
}
@keyframes avatar-heartbeat { 0%,100% { transform: scale(.94); } 45% { transform: scale(1.1); } }
@keyframes avatar-starshine { 50% { transform: scale(1.08) rotate(8deg); } }
@keyframes avatar-kiss { 0% { opacity: 0; transform: translate(0,0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(95px,-90px) scale(1.3) rotate(15deg); } }

/* attachments component */
.attachment-tray {
  display: flex;
  box-sizing: border-box;
  flex: 0 0 100%;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 12px 2px;
  scrollbar-width: thin;
}
.attachment-tray[hidden] {
  display: none;
}
.attachment-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: 0 0 min(220px, 72vw);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(116, 128, 143, 0.2);
  border-radius: 14px;
  background: var(--surface-subtle);
}
.attachment-card.is-uploading::before {
  position: absolute;
  z-index: -1;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--attachment-upload-progress, 0%);
  border-radius: 13px;
  background: color-mix(in srgb, var(--gold, #d6a84b) 28%, transparent);
  clip-path: inset(0 round 13px);
  content: '';
  transition: width 0.45s ease-out;
}
.attachment-card-visual {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(31, 107, 99, 0.09);
  color: var(--secondary);
}
.attachment-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attachment-card-visual svg {
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
  stroke: currentColor;
}
.attachment-remove svg {
  display: block;
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
  stroke: currentColor;
}
.attachment-card-copy {
  min-width: 0;
  line-height: 1.25;
}
.attachment-card-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-small);
  font-weight: 700;
}
.attachment-card-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.attachment-remove {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  line-height: 0;
}
.attachment-remove:hover {
  background: rgba(182, 59, 59, 0.1);
  color: var(--danger);
}
.file-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  background: rgba(247, 242, 234, 0.76);
  backdrop-filter: blur(10px) saturate(0.9);
  -webkit-backdrop-filter: blur(10px) saturate(0.9);
  opacity: 1;
}
.file-drop-overlay[hidden] {
  display: none;
}
.file-drop-overlay-card {
  display: grid;
  width: min(540px, calc(100vw - 40px));
  min-height: 310px;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 34px;
  border: 2px dashed color-mix(in srgb, var(--secondary) 58%, transparent);
  border-radius: 30px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 28px 80px rgba(23, 44, 53, 0.2);
  animation: motion-popover-in 0.16s ease-out both;
}
.file-drop-overlay-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 24px;
  background: var(--secondary-soft);
  color: var(--secondary);
}
.file-drop-overlay-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
}
.file-drop-overlay-card strong {
  font-size: clamp(20px, 3vw, 26px);
}
.file-drop-overlay-card > span:last-child {
  max-width: 320px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.attachment-card-copy[data-tooltip]::after {
  inset-block-start: auto;
  inset-block-end: calc(100% + 8px);
  width: max-content;
  min-width: 180px;
  max-width: min(320px, calc(100vw - 32px));
  white-space: normal;
  text-align: start;
  line-height: 1.55;
}
@media (max-width: 560px) {
  .attachment-tray {
    padding: 9px 9px 0;
  }
  .attachment-card {
    flex-basis: min(205px, 78vw);
  }
}
@media (min-width: 561px) {
  .attachment-tray:not([hidden]) {
    margin-bottom: 2px;
  }
  .attachment-tray {
    flex-wrap: wrap;
    overflow: visible;
  }
}
@media (max-width: 560px) {
  .file-drop-overlay-card {
    min-height: 270px;
    padding: 28px 22px;
  }
  .attachment-tray {
    flex: 0 0 auto;
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .file-drop-overlay-card {
    animation: none;
    transition-duration: 0.001ms;
  }
}
html.theme-dark-effective .file-drop-overlay-card {
  border-color: rgba(114, 198, 181, 0.36);
  background: #192f38;
  color: var(--ink);
  box-shadow: var(--shadow);
}
html.theme-dark-effective .file-drop-overlay-card > span:last-child {
  color: var(--muted);
}

/* message-content component */
.bubble.thinking {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-width: 112px;
  color: var(--muted);
}
.thinking-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
}
.bubble.thinking.workspace-preparing {
  display: grid;
  width: min(100%, 620px);
  gap: 12px;
}
.thinking-label { font-size: 13px; }
.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
}
.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: thinking-pulse 1.2s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes thinking-pulse {
  0%, 60%, 100% { opacity: .32; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .thinking-dots i { animation: none; opacity: .65; }
}
.message:not(.user) .bubble.cancelled-empty {
  color: var(--muted);
  font-size: var(--text-small);
  font-style: italic;
}
.bubble a.message-attachment {
  color: var(--ink);
  text-decoration: none;
}
.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.message-attachment {
  color: var(--ink);
  text-decoration: none;
}
.message-attachment.is-image {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: min(190px, 100%);
  min-height: 46px;
  padding: 4px 7px 4px 4px;
  border: 1px solid rgba(31, 107, 99, 0.08);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 95%, var(--secondary-soft));
  opacity: 0.78;
  transition: opacity 0.18s ease;
}
.message-attachment.is-image:hover {
  border-color: rgba(31, 107, 99, 0.15);
  background: color-mix(in srgb, var(--surface) 91%, var(--secondary-soft));
  opacity: 0.92;
}
.message-attachment.is-file:hover {
  border-color: rgba(31, 107, 99, 0.15);
  background: color-mix(in srgb, var(--surface) 91%, var(--secondary-soft));
  opacity: 0.92;
}
.message-attachment-visual {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--secondary);
}
.message-attachment.is-image .message-attachment-visual {
  width: 36px;
  height: 36px;
  border-radius: 7px;
  background: var(--secondary-soft);
}
.message-attachment.is-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.message-attachment-copy {
  min-width: 0;
  padding: 0;
  line-height: 1.3;
}
.message-attachment-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-caption);
  font-weight: 750;
}
.message-attachment-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.message-attachment.is-file {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: min(190px, 100%);
  min-height: 46px;
  padding: 5px 8px 5px 6px;
  border: 1px solid rgba(31, 107, 99, 0.08);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 95%, var(--secondary-soft));
  opacity: 0.78;
}
.message-attachment.is-file .message-attachment-visual {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--secondary-soft);
}
.message-attachment.is-file .message-attachment-visual svg {
  width: var(--icon-small);
  height: var(--icon-small);
  fill: none;
  stroke: currentColor;
}
.message-attachment.is-file span {
  min-width: 0;
}
.message-attachment.is-file .message-attachment-copy {
  padding: 0;
}
.message-attachment.is-file .message-attachment-copy strong {
  font-size: var(--text-caption);
}
.message-attachment.is-file .message-attachment-copy small {
  margin-top: 2px;
  font-size: var(--text-caption);
}
@media (max-width: 560px) {
  .message-attachments {
    grid-template-columns: 1fr;
  }
}
.tool-confirm-actions {
  display: flex;
  gap: 5px;
}
.tool-confirm-actions button {
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  color: #654e9f;
  background: rgba(117, 87, 217, 0.12);
  font-size: var(--text-caption);
  font-weight: 750;
}
.tool-confirm-actions button:first-child {
  color: #fff;
  background: #7054d3;
}
.artifact-card:hover {
  border-color: rgba(117, 87, 217, 0.28);
  background: rgba(117, 87, 217, 0.08);
}
.message-tool-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  visibility: visible;
  opacity: 1;
}
.message-tool-results .tool-result-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}
.message-tool-results .tool-result-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
}
.message-tool-results .tool-result-icon svg {
  width: var(--icon-small);
  height: var(--icon-small);
}
.message-tool-results .tool-result-card > span:nth-child(2) {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
}
.message-tool-results .tool-result-card strong {
  max-width: 160px;
  overflow: hidden;
  font-size: var(--text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-tool-results .tool-result-card small {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-tool-results .tool-confirm-actions button {
  padding: 4px 6px;
  border-radius: 7px;
  font-size: var(--text-caption);
}
.message-tool-results .artifact-card {
  border-color: color-mix(in srgb, var(--secondary) 22%, var(--line));
  color: var(--text);
  background: color-mix(in srgb, var(--secondary) 4%, transparent);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}
.message-tool-results .artifact-card:hover {
  border-color: color-mix(in srgb, var(--secondary) 40%, var(--line));
  background: color-mix(in srgb, var(--secondary) 8%, transparent);
  transform: translateY(-1px);
}
.message-tool-results .artifact-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--secondary) 42%, transparent);
  outline-offset: 2px;
}
.message-tool-results .artifact-card[data-tooltip]::after {
  top: auto;
  right: 50%;
  bottom: calc(100% + 7px);
  width: max-content;
  min-width: 0;
  max-width: min(280px, calc(100vw - 32px));
  overflow-wrap: anywhere;
  white-space: normal;
  transform: translate(50%, 3px);
}
.message-tool-results .artifact-card[data-tooltip]:hover::after,
.message-tool-results .artifact-card[data-tooltip]:focus-visible::after {
  transform: translate(50%, 0);
}
.message-tool-results .artifact-card .tool-result-icon {
  color: var(--secondary);
  background: var(--secondary-soft);
}
.message-tool-results .artifact-card strong {
  color: var(--text);
}
.message-tool-results .table-analysis-result {
  display: grid;
  width: min(100%, 680px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--secondary) 24%, var(--line));
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 96%, var(--secondary));
}
.message-tool-results .structured-tool-result {
  display: inline-grid;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--secondary) 20%, var(--line));
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 97%, var(--secondary));
}
.message-tool-results .calculation-result,
.message-tool-results .datetime-result {
  max-width: min(100%, 380px);
}
.message-tool-results .weather-result {
  max-width: min(100%, 520px);
}
.message-tool-results .planner-result {
  max-width: min(100%, 360px);
}
.planner-notification-warning {
  margin: 0;
  padding: 8px 12px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.message-tool-results .places-result {
  max-width: min(100%, 360px);
}
.places-result > header {
  padding: 8px 10px;
  gap: 7px;
}
.places-result > header strong {
  font-size: 0.78rem;
  line-height: 1.35;
}
.places-result > header small {
  font-size: 0.7rem;
  line-height: 1.35;
}
.message-tool-results .document-search-result {
  max-width: min(100%, 620px);
}
.message-tool-results .datetime-result {
  grid-template-columns: auto auto;
  align-items: stretch;
}
.datetime-result > header {
  border-inline-end: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.datetime-result .datetime-content {
  border-top: 0;
}
.table-analysis-result > header,
.structured-tool-result > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.table-analysis-result > header > span:last-child,
.structured-tool-result > header > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.table-analysis-result > header strong,
.structured-tool-result > header strong {
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-analysis-result > header small,
.structured-tool-result > header small,
.structured-tool-empty {
  color: var(--muted);
  font-size: var(--text-caption);
}
.table-analysis-result .tool-result-icon,
.structured-tool-result .tool-result-icon {
  color: var(--secondary);
  background: var(--secondary-soft);
}
.table-analysis-section,
.table-analysis-empty {
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.table-analysis-section {
  position: relative;
  padding-inline-start: 30px;
}
.table-analysis-section::before {
  position: absolute;
  inset-block-start: 15px;
  inset-inline-start: 13px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--secondary);
  content: "";
}
.table-analysis-section.is-quality::before,
.table-analysis-section.is-caution::before {
  background: var(--warning, #b7791f);
}
.table-analysis-section h3 {
  margin: 0 0 4px;
  font-size: var(--text-small);
}
.table-analysis-section p,
.table-analysis-empty {
  margin-block: 3px 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.65;
}
.table-analysis-section small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.table-analysis-formula {
  display: inline-block;
  direction: ltr;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--text);
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
  font-size: var(--text-small);
  unicode-bidi: isolate;
}
.calculation-equation,
.datetime-content,
.weather-current,
.planner-content,
.places-list,
.document-match-list,
.structured-tool-empty {
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.calculation-equation {
  display: flex;
  align-items: baseline;
  direction: ltr;
  padding: 12px;
  gap: 9px;
  unicode-bidi: isolate;
}
.calculation-equation code {
  overflow-wrap: anywhere;
  color: var(--muted);
}
.calculation-equation strong {
  font-size: var(--text-title);
}
.datetime-content {
  display: flex;
  align-items: baseline;
  padding: 10px 12px;
  gap: 10px;
}
.datetime-content strong {
  direction: ltr;
  font-size: var(--text-title);
  unicode-bidi: isolate;
}
.datetime-content span {
  color: var(--muted);
  font-size: var(--text-small);
}
.weather-current {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  gap: 16px;
}
.weather-current > span {
  display: grid;
  gap: 1px;
}
.weather-current > span:first-child {
  margin-inline-end: auto;
}
.weather-current > span:first-child strong {
  direction: ltr;
  font-size: 1.4rem;
  unicode-bidi: isolate;
}
.weather-current small,
.weather-forecast small {
  color: var(--muted);
  font-size: var(--text-caption);
}
.weather-current b,
.weather-forecast b {
  direction: ltr;
  font-size: var(--text-small);
  unicode-bidi: isolate;
}
.weather-forecast {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 110px));
  overflow-x: auto;
  border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
}
.weather-forecast > span {
  display: grid;
  padding: 9px 11px;
  gap: 2px;
  border-inline-end: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.weather-forecast > span:last-child {
  border-inline-end: 0;
}
.places-list {
  margin: 0;
  padding: 3px 34px 5px 8px;
}
.places-list li {
  padding: 1px 0;
}
.places-list a {
  display: grid;
  padding: 5px 7px;
  gap: 1px;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.places-list a:hover,
.places-list a:focus-visible {
  background: color-mix(in srgb, var(--secondary) 8%, transparent);
}
.places-list a:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--secondary) 35%, transparent);
  outline-offset: -2px;
}
.places-list strong,
.places-list small {
  display: block;
  line-height: 1.4;
}
.places-list strong {
  font-size: 0.8rem;
  font-weight: 650;
}
.places-list small {
  color: var(--muted);
  font-size: 0.7rem;
}
.memory-result {
  flex: 0 1 auto;
  width: fit-content;
  min-width: min(100%, 280px);
  max-width: min(100%, 380px);
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, var(--secondary-soft));
  color: var(--text);
  text-align: start;
  font-size: var(--text-small);
  line-height: 1.6;
}
.memory-result-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.memory-result-header svg {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.memory-result-header strong { font-size: var(--text-caption); font-weight: 600; color: var(--muted); }
.memory-result-status { margin: 4px 0 0; color: var(--muted); font-size: var(--text-caption); }
.memory-result-facts { display: grid; gap: 6px; margin-top: 4px; }
.memory-operation { min-width: 0; }
.memory-operation-heading { display: inline; }
.memory-operation-heading strong { font-size: inherit; font-weight: 600; overflow-wrap: anywhere; }
.memory-operation-heading strong::after { content: ': '; }
.memory-operation-heading small { margin-inline-start: 6px; color: var(--danger); font-size: var(--text-caption); }
.memory-operation-value { display: inline; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-operation-previous { display: block; color: var(--muted); font-size: var(--text-caption); white-space: pre-wrap; overflow-wrap: anywhere; }
.memory-result-actions { display: flex; flex-shrink: 0; gap: 4px; margin-inline-start: auto; }
.memory-result-actions button {
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-size: var(--text-caption);
  cursor: pointer;
}
.memory-result-save { background: var(--secondary-soft); color: var(--secondary); }
.memory-result-dismiss { background: transparent; color: var(--muted); }
.memory-result-actions button:hover { border-color: var(--line); background: var(--surface); }
.memory-result-actions button:focus-visible { outline: 2px solid var(--secondary); outline-offset: 2px; }
.memory-result-actions button:disabled { opacity: 0.6; cursor: wait; }
.memory-result-error { margin: 6px 0 0; color: var(--danger); font-size: var(--text-caption); }
@media (pointer: coarse) {
  .memory-result-actions button { min-height: 44px; }
}

.planner-content {
  display: grid;
  padding: 9px 12px;
  gap: 4px;
}
.planner-content strong,
.planner-content p,
.places-list strong,
.document-match-list p {
  overflow-wrap: anywhere;
}
.planner-content time,
.planner-content p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}
.planner-content strong {
  font-size: var(--text-small);
  line-height: 1.5;
}
.planner-content time {
  display: inline-flex;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--secondary) 8%, var(--surface));
  line-height: 1.45;
}
.structured-tool-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 12px 9px;
}
.document-match-list blockquote {
  margin: 0;
  padding: 9px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.document-match-list blockquote:last-child {
  border-bottom: 0;
}
.document-match-list strong {
  font-size: var(--text-caption);
}
.document-match-list p {
  display: -webkit-box;
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.structured-tool-empty {
  margin: 0;
  padding: 10px 12px;
}
@media (max-width: 560px) {
  .weather-current {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
  .weather-current > span:first-child {
    flex-basis: 100%;
  }
}
@media (max-width: 380px) {
  .message-tool-results .datetime-result {
    grid-template-columns: 1fr;
  }
  .datetime-result > header {
    border-inline-end: 0;
  }
  .datetime-result .datetime-content {
    border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  }
}
.message.user .message-attachment {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 70%, var(--accent-soft));
  color: var(--ink);
  opacity: 1;
}
.message.user .message-attachment:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--surface);
  opacity: 1;
}
.message.user .message-attachment-copy small {
  color: var(--muted);
}
.message.user .message-attachment-visual {
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
  color: var(--accent);
}
@keyframes linked-message {
  0%, 35% { background: color-mix(in srgb, var(--action) 16%, transparent); }
  100% { background: transparent; }
}
.message.message-linked { animation: linked-message 2.4s ease-out; }

/* Preserve original text color until it has been read; no transparent overlay. */
.tts-progress-text { transition: color 160ms ease; cursor: pointer; }
.tts-progress-text.tts-progress-read { color: #168044; }
@media (prefers-reduced-motion: reduce) {
  .tts-progress-text { transition: none; }
}

/* Compact next-step guidance attached to an assistant response. */
.composer-guidance {
  position: static;
  display: flex;
  justify-content: flex-start;
  max-width: 100%;
  padding: 0;
  overflow: visible;
  pointer-events: auto;
}
.composer-guidance[hidden] { display: none; }
.composer-guidance-reply {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px;
  align-items: center;
  width: calc(100% - 20px);
  margin: 8px 10px 2px;
  padding: 8px 9px;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--secondary) 22%, var(--line));
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-subtle) 88%, var(--secondary-soft));
  animation: interaction-guide-in 160ms ease-out both;
}
.composer-guidance-reply[hidden] { display: none; }
.composer-guidance-reply-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary-soft) 82%, var(--surface));
}
.composer-guidance-reply-icon svg { width: 16px; height: 16px; }
.composer-guidance-reply-content { display: grid; min-width: 0; gap: 1px; }
.composer-guidance-reply-label { color: var(--secondary); font-size: var(--text-caption); font-weight: 760; }
.composer-guidance-reply-question {
  overflow: hidden;
  color: var(--text);
  font-size: var(--text-small);
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-guidance-reply-dismiss {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.composer-guidance-reply-dismiss:hover,
.composer-guidance-reply-dismiss:focus-visible {
  outline: none;
  color: var(--text);
  background: color-mix(in srgb, var(--secondary-soft) 70%, transparent);
}
.composer-guidance-reply-dismiss svg { width: 14px; height: 14px; }
.message-reply-context { display: flex; align-items: center; max-width: 100%; margin: 0 0 8px; padding: 6px 8px; gap: 7px; border-inline-start: 3px solid var(--secondary); border-radius: 7px; color: var(--muted); background: color-mix(in srgb, var(--surface-subtle) 88%, var(--secondary-soft)); font-size: var(--text-caption); line-height: 1.5; }
.message-reply-context-marker { display: grid; flex: 0 0 18px; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--secondary); background: var(--secondary-soft); font-weight: 800; }
.message-reply-context > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.interaction-suggestions--pre-send {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.interaction-suggestions--pre-send::-webkit-scrollbar { display: none; }
.interaction-suggestions--pre-send .interaction-suggestion {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
}
.interaction-guide {
  display: grid;
  width: min(100%, 680px);
  margin-top: 14px;
  gap: 8px;
  animation: interaction-guide-in 180ms ease-out both;
}
.interaction-guide--pending {
  display: flex;
  min-height: 52px;
  padding: 2px 0;
  gap: 8px;
}
.interaction-guide--pending span {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 94%, var(--secondary));
  overflow: hidden;
}
.interaction-guide--pending span::before,
.interaction-guide--pending span::after {
  position: absolute;
  inset-inline-start: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--secondary) 16%, var(--line));
  content: "";
}
.interaction-guide--pending span::before {
  inset-block-start: 13px;
  width: 58%;
  height: 7px;
}
.interaction-guide--pending span::after {
  inset-block-start: 27px;
  width: 38%;
  height: 5px;
  opacity: .7;
}
.interaction-guide--pending span:first-child { flex-basis: 115%; }
.interaction-guide--pending span:last-child { flex-basis: 85%; }
.interaction-guide--pending span {
  background-image: linear-gradient(105deg, transparent 20%, color-mix(in srgb, var(--surface) 75%, white) 48%, transparent 76%);
  background-repeat: no-repeat;
  background-size: 220% 100%;
  animation: interaction-guide-skeleton 1.55s ease-in-out infinite;
}
@keyframes interaction-guide-skeleton { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.interaction-workflow {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--secondary) 18%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface) 97%, var(--secondary));
}
.interaction-workflow summary {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 38px;
  padding: 7px 10px;
  gap: 7px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.interaction-workflow summary::-webkit-details-marker { display: none; }
.interaction-workflow summary:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--secondary) 45%, transparent);
  outline-offset: -2px;
}
.interaction-workflow summary > svg {
  width: 18px;
  height: 18px;
  color: var(--secondary);
}
.interaction-workflow summary > span:not(.interaction-workflow-progress) {
  overflow: hidden;
  font-size: var(--text-small);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interaction-workflow-progress {
  color: var(--muted);
  font-size: var(--text-caption);
  font-variant-numeric: tabular-nums;
}
.interaction-workflow-steps {
  display: flex;
  overflow-x: auto;
  margin: 0;
  padding: 5px 11px 11px;
  gap: 0;
  scrollbar-width: thin;
  list-style: none;
}
.interaction-workflow-step {
  position: relative;
  display: grid;
  flex: 1 0 min(150px, 38vw);
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  padding-inline-end: 14px;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.interaction-workflow-step::after {
  position: absolute;
  inset-inline: 20px 0;
  inset-block-start: 50%;
  z-index: 0;
  height: 1px;
  background: color-mix(in srgb, var(--line) 75%, transparent);
  content: "";
}
.interaction-workflow-step:last-child::after { display: none; }
.interaction-workflow-step > span:last-child {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-inline: 3px 7px;
  background: color-mix(in srgb, var(--surface) 97%, var(--secondary));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interaction-workflow-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid color-mix(in srgb, var(--muted) 35%, var(--line));
  border-radius: 50%;
  background: var(--surface);
}
.interaction-workflow-marker i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.interaction-workflow-marker svg { width: 12px; height: 12px; }
.interaction-workflow-step.is-completed { color: var(--secondary); }
.interaction-workflow-step.is-failed { color: var(--danger); }
.interaction-workflow-step.is-failed .interaction-workflow-marker {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
}
.interaction-workflow-step.is-failed .interaction-workflow-marker i {
  width: 7px;
  height: 2px;
  border-radius: 2px;
}
.interaction-workflow-step.is-current { color: var(--text); font-weight: 750; }
.interaction-workflow-step.is-current .interaction-workflow-marker {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 9%, transparent);
}
.interaction-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.interaction-suggestion {
  display: inline-flex;
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 96%, var(--secondary));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 4%, transparent);
  transition: opacity 150ms ease, transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}
.interaction-suggestion:hover,
.interaction-suggestion:focus-within {
  border-color: color-mix(in srgb, var(--secondary) 34%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, var(--secondary));
}
.interaction-delegation-choice {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 3px;
  border-inline-start: 1px solid color-mix(in srgb, var(--line) 56%, transparent);
}
.interaction-delegation-choice button {
  min-height: 30px;
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: var(--text-caption);
  cursor: pointer;
}
.interaction-delegation-choice button:hover,
.interaction-delegation-choice button:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--secondary-soft) 78%, var(--surface));
}
.interaction-delegation-choice button:disabled { opacity: .55; cursor: progress; }
.interaction-suggestion.is-leaving { opacity: 0; transform: scale(.96); pointer-events: none; }
.interaction-suggestion.is-completed { opacity: .68; }
.interaction-suggestion.is-failed { border-color: color-mix(in srgb, var(--danger) 34%, var(--line)); }
.interaction-suggestion-action,
.interaction-suggestion-dismiss {
  display: inline-grid;
  place-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.interaction-suggestion-action {
  grid-template-columns: 22px auto;
  min-height: 36px;
  padding: 5px 5px 5px 10px;
  gap: 11px;
  color: var(--text);
  font-size: var(--text-small);
  font-weight: 690;
}
[dir="rtl"] .interaction-suggestion-action { padding: 5px 8px 5px 5px; }
.interaction-suggestion-action:focus-visible,
.interaction-suggestion-dismiss:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}
.interaction-suggestion-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  color: var(--secondary);
  background: color-mix(in srgb, var(--secondary-soft) 75%, var(--surface));
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--secondary-soft) 75%, var(--surface));
}
.interaction-suggestion-icon svg { width: 20px; height: 20px; }
.interaction-suggestion-icon img:not(.session-assistant-avatar) {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: 1;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}
.interaction-suggestion.is-assistant .interaction-suggestion-icon {
  position: relative;
  width: 22px;
  min-width: 22px;
  height: 22px;
  overflow: visible;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}
.interaction-suggestion.is-assistant .session-assistant-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.interaction-suggestion-dismiss {
  width: 30px;
  min-height: 36px;
  margin-inline-start: -3px;
  border-inline-start: 1px solid color-mix(in srgb, var(--line) 56%, transparent);
  border-radius: 0 999px 999px 0;
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  opacity: .58;
}
[dir="rtl"] .interaction-suggestion-dismiss { border-radius: 999px 0 0 999px; }
.interaction-suggestion-dismiss:hover,
.interaction-suggestion-dismiss:focus-visible { color: var(--text); opacity: 1; }
.interaction-suggestion-dismiss svg { width: 13px; height: 13px; }
.interaction-suggestion-action.is-running { opacity: .6; cursor: progress; }
@keyframes interaction-guide-in {
  from { opacity: 0; transform: translateY(4px); }
}
@media (max-width: 560px) {
  .composer-guidance-reply { width: calc(100% - 12px); margin-inline: 6px; }
  .interaction-guide { margin-top: 11px; }
  .interaction-workflow summary { min-height: 42px; }
  .interaction-workflow-step { flex-basis: min(142px, 58vw); }
  .interaction-guide .interaction-suggestions:not(.interaction-suggestions--pre-send) { flex-wrap: wrap; overflow: visible; padding: 1px 1px 4px; gap: 5px; }
  .interaction-suggestion { flex: 0 0 auto; }
  .interaction-guide .interaction-suggestion-action {
    min-height: 32px;
    padding-block: 3px;
    font-size: var(--text-caption);
  }
  .interaction-guide .interaction-suggestion-dismiss { min-height: 32px; width: 28px; }
  .interaction-guide .interaction-suggestion-icon { box-shadow: 0 0 0 4px color-mix(in srgb, var(--secondary-soft) 75%, var(--surface)); }
  .interaction-guide .interaction-suggestion.is-assistant .interaction-suggestion-icon { box-shadow: none; }
  .interaction-guide .interaction-suggestion.is-assistant .session-assistant-avatar {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .interaction-guide { animation: none; }
  .interaction-suggestion { transition: none; }
}

/* sources component */
.message-activity-dialog {
  position: fixed;
  inset: 0;
  width: min(430px, calc(100vw - 28px));
  max-height: min(720px, calc(100dvh - 28px));
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.message-activity-dialog::backdrop {
  background: rgba(15, 29, 34, 0.42);
  backdrop-filter: blur(3px);
}
.message-activity-dialog-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  max-height: min(720px, calc(100dvh - 28px));
  padding: 18px;
  overflow: hidden;
}
.message-activity-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.message-activity-dialog-head h2 {
  margin: 0;
  font-size: var(--text-title);
}
.message-activity-dialog-close {
  display: grid;
  flex: 0 0 var(--tap-target);
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.message-activity-dialog-close:hover,
.message-activity-dialog-close:focus-visible {
  color: var(--ink);
  background: var(--surface-hover);
  outline: 0;
}
.message-activity-dialog-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
}
.message-activity-dialog-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}
.message-activity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.message-activity-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--secondary) 28%, var(--line));
  border-radius: 999px;
  color: var(--secondary);
  background: var(--secondary-soft);
}
.message-activity-icon {
  display: inline-grid;
  flex: 0 0 15px;
  place-items: center;
  width: 15px;
  height: 15px;
}
.message-activity-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
}
.message-activity-copy {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}
.message-activity-copy strong {
  font-size: var(--text-caption);
  font-weight: 700;
}
.message-activity-copy small {
  min-width: 1.5em;
  padding-inline: 4px;
  border-radius: 999px;
  color: var(--secondary);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: var(--text-caption);
  font-weight: 800;
  text-align: center;
}
.message-activity-sources {
  display: grid;
  gap: 9px;
}
.message-activity-sources h3 {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}
.source-card-list {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr;
}
.message-activity-dialog a.source-card {
  display: flex;
  gap: 9px;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.message-activity-dialog a.source-card:hover {
  color: var(--secondary);
  background: transparent;
}
.message-activity-dialog a.source-card:focus-visible {
  color: var(--secondary);
  background: transparent;
  outline: 0;
}
.source-number {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: var(--text-caption);
  font-weight: 700;
}
.source-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.source-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-small);
}
.source-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  direction: ltr;
  text-align: start;
}
.source-card[data-tooltip]::after {
  display: block;
  top: calc(100% + 6px);
  bottom: auto;
  inset-inline-start: 0;
  right: auto;
  max-width: min(430px, 82vw);
  min-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  text-align: start;
  transform: translateY(-3px);
}
.source-card[data-tooltip]:hover {
  z-index: 30;
}
.source-card[data-tooltip]:hover::after {
  z-index: 30;
  transform: translateY(0);
}
.source-card[data-tooltip]:focus-visible::after {
  z-index: 30;
  transform: translateY(0);
}
.source-card.tooltip-up[data-tooltip]::after {
  top: auto;
  bottom: calc(100% + 6px);
  transform: translateY(3px);
}
.source-card.tooltip-up[data-tooltip]:hover::after {
  transform: translateY(0);
}
.source-card.tooltip-up[data-tooltip]:focus-visible::after {
  transform: translateY(0);
}

/* message-actions component */
.message-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1px;
  min-height: 36px;
  margin-top: 4px;
  transform: none;
}
.message.user .message-actions {
  position: absolute;
  inset-block-end: 4px;
  inset-inline-end: 4px;
  grid-column: auto;
  min-height: 0;
  margin-top: 0;
}
.message.user .bubble {
  position: relative;
  padding-inline-end: calc(15px + 36px);
}
.message-action {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease;
}
.message-action.tts-message-button {
  --message-action-icon-size: 18px;
}
.message-action.share-message-button {
  --message-action-icon-size: 20px;
}
.message-action svg {
  display: block;
  place-self: center;
  width: var(--message-action-icon-size, var(--icon-medium));
  height: var(--message-action-icon-size, var(--icon-medium));
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.message-action:hover {
  background: rgba(31, 107, 99, 0.1);
  color: var(--secondary, #1f6b63);
  outline: 0;
}
.message-action:focus-visible {
  background: rgba(31, 107, 99, 0.1);
  color: var(--secondary, #1f6b63);
  outline: 0;
}
.message-action:disabled {
  cursor: wait;
  opacity: 0.45;
}
.message-action.follow-up-trigger {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 6px;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 36px;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1.5;
  text-align: start;
  transition: background 160ms ease, color 160ms ease;
}
.message-action.follow-up-trigger svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}
.follow-up-trigger-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.message-action.follow-up-trigger:hover,
.message-action.follow-up-trigger:focus-visible,
.message-action.follow-up-trigger[aria-expanded="true"] {
  color: var(--secondary, #1f6b63);
  background: rgba(31, 107, 99, 0.1);
}
.message-action.follow-up-trigger:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}
.message-activity-trigger[aria-expanded="true"],
.report-problem-trigger[aria-expanded="true"] {
  background: rgba(31, 107, 99, 0.1);
  color: var(--accent);
}
.follow-up-panel {
  display: grid;
  gap: 18px;
  width: 100%;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  margin: 0;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--ink) 9%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 98%, var(--accent-soft));
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent),
    0 16px 40px color-mix(in srgb, var(--ink) 10%, transparent);
  opacity: 0;
  transform: translateY(-4px) scale(0.99);
  transform-origin: top;
  transition:
    opacity 160ms ease,
    transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.follow-up-panel.is-visible {
  opacity: 1;
  transform: none;
}
dialog.follow-up-layer:has([data-panel-kind="report"]) {
  width: 480px;
}
.follow-up-handle {
  display: none;
}
.follow-up-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
}
.follow-up-heading strong {
  grid-column: 1;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}
.follow-up-heading small {
  grid-column: 1;
  max-width: 48ch;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.7;
}
.follow-up-close {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.follow-up-close:hover,
.follow-up-close:focus-visible {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: 0;
}
.follow-up-close svg {
  width: var(--icon-medium);
  height: var(--icon-medium);
}
.follow-up-group {
  display: grid;
  gap: 9px;
}
.follow-up-group > span {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 800;
}
.follow-up-group > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.follow-up-tabs,
.follow-up-custom-toggle,
.follow-up-inline-tools {
  display: none;
}
.follow-up-chip {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 96%, var(--surface-subtle));
  font: inherit;
  font-size: var(--text-small);
  font-weight: 750;
  line-height: 1.45;
  text-align: start;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}
.follow-up-chip:hover,
.follow-up-chip:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  outline: 0;
  transform: translateY(-1px);
}
.follow-up-chip:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.follow-up-chip:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}
.follow-up-report-options > div {
  grid-template-columns: minmax(0, 1fr);
}
.follow-up-report-options .follow-up-option {
  position: relative;
  min-height: 46px;
  padding-inline-end: 38px;
}
.follow-up-report-options .follow-up-option::after {
  position: absolute;
  inset-inline-end: 14px;
  content: "";
  width: 7px;
  height: 7px;
  border-block-start: 1.7px solid currentColor;
  border-inline-end: 1.7px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.55;
}
.follow-up-report-options .follow-up-regenerate {
  display: flex;
  align-items: center;
  gap: 9px;
  border-color: color-mix(in srgb, var(--action) 42%, var(--line));
  color: var(--action);
  background: color-mix(in srgb, var(--action-soft) 78%, var(--surface));
}
.follow-up-report-options .follow-up-regenerate::after {
  content: none;
}
.follow-up-report-options .follow-up-regenerate svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.follow-up-report-options .follow-up-regenerate:hover,
.follow-up-report-options .follow-up-regenerate:focus-visible {
  border-color: var(--action);
  color: var(--action-hover);
  background: var(--action-soft);
}
[dir="rtl"] .follow-up-report-options .follow-up-option::after {
  transform: rotate(-135deg);
}
.follow-up-resolution {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 11px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface));
}
.follow-up-success-icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
}
.follow-up-success-icon svg {
  width: 19px;
  height: 19px;
}
.follow-up-resolution > strong {
  color: var(--ink);
  font-size: var(--text-small);
}
.follow-up-resolution > small {
  color: var(--muted);
  font-size: var(--text-caption);
}
.follow-up-resolution > div {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.follow-up-resolution-action {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
}
.follow-up-resolution-fix {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}
.follow-up-resolution-action:hover,
.follow-up-resolution-action:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: translateY(-1px);
}
.follow-up-custom {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.follow-up-custom input {
  min-width: 0;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding-inline: 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-small);
}
.follow-up-custom input:focus {
  border-color: var(--accent);
  outline: var(--focus);
}
.follow-up-custom button {
  border: 0;
  border-radius: 12px;
  padding-inline: 18px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  min-height: 46px;
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
}
.follow-up-custom button:hover,
.follow-up-custom button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  filter: brightness(1.04);
}
.follow-up-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.follow-up-tool {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.follow-up-tool > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-subtle);
}
.follow-up-tool svg {
  width: 17px;
  height: 17px;
}
.follow-up-tool strong {
  overflow: hidden;
  font-size: var(--text-caption);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.follow-up-tool > i {
  display: none;
  color: var(--accent);
}
.follow-up-tool.is-enabled {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 66%, var(--surface));
}
.follow-up-tool.is-enabled > i {
  display: grid;
}
.follow-up-tool.is-locked {
  opacity: 0.6;
}
.follow-up-tool:hover,
.follow-up-tool:focus-visible {
  border-color: var(--accent);
  outline: 0;
}
.follow-up-tools-run {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 800;
  cursor: pointer;
}
.follow-up-tools-run:disabled {
  color: var(--muted);
  background: var(--surface-subtle);
  cursor: not-allowed;
}
body.follow-up-sheet-open {
  overflow: hidden;
}
.follow-up-layer {
  width: 600px;
  max-width: calc(100vw - 48px);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: visible;
  color: var(--text);
  background: transparent;
}
.follow-up-layer::backdrop {
  background: color-mix(in srgb, var(--ink) 42%, transparent);
  backdrop-filter: blur(4px);
}
@media (max-width: 600px) {
  .follow-up-layer {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: flex;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 0;
    align-items: flex-end;
    justify-content: center;
    padding-top: max(24px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--ink) 42%, transparent);
    backdrop-filter: blur(2px);
    animation: follow-up-backdrop-in 160ms ease both;
  }
  .follow-up-panel {
    display: grid;
    gap: 11px;
    width: 100%;
    max-height: min(70dvh, 580px);
    margin: 0;
    padding: 7px 14px max(14px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 55px color-mix(in srgb, var(--ink) 24%, transparent);
    opacity: 1;
    transform: translateY(100%);
    transform-origin: bottom;
  }
  .follow-up-panel.is-visible {
    transform: translateY(0);
  }
  .follow-up-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 1px auto 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 38%, transparent);
  }
  .follow-up-heading {
    min-height: var(--tap-target);
  }
  .follow-up-heading strong {
    font-size: 16px;
  }
  .follow-up-heading small {
    display: none;
  }
  .follow-up-close {
    background: var(--surface-subtle);
  }
  .follow-up-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-subtle);
  }
  .follow-up-tab {
    min-width: 0;
    min-height: 36px;
    padding: 5px 7px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: var(--text-caption);
    font-weight: 800;
    cursor: pointer;
  }
  .follow-up-tab[aria-selected="true"] {
    color: var(--accent);
    background: var(--surface);
    box-shadow: 0 1px 5px color-mix(in srgb, var(--ink) 10%, transparent);
  }
  .follow-up-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
  }
  .follow-up-panel[data-panel-kind="improve"] .follow-up-group {
    display: none;
  }
  .follow-up-panel[data-panel-kind="improve"] .follow-up-group.is-active {
    display: grid;
  }
  .follow-up-group > span {
    display: none;
  }
  .follow-up-group > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .follow-up-group-tools > div:first-of-type {
    display: none;
  }
  .follow-up-group-tools .follow-up-inline-tools {
    display: block;
  }
  .follow-up-chip {
    width: 100%;
    min-height: 40px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: var(--text-caption);
    text-align: center;
  }
  .follow-up-report-options > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .follow-up-report-options .follow-up-option {
    min-height: 42px;
    padding: 7px 9px;
    text-align: center;
  }
  .follow-up-report-options .follow-up-option::after {
    display: none;
  }
  .follow-up-custom-toggle {
    display: block;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--line) 45%);
    border-radius: 10px;
    color: var(--accent);
    background: transparent;
    font: inherit;
    font-size: var(--text-caption);
    font-weight: 800;
    cursor: pointer;
  }
  .follow-up-custom-toggle.is-hidden,
  .follow-up-custom.is-tools-hidden {
    display: none;
  }
  .follow-up-custom {
    display: none;
    grid-template-columns: 1fr;
    padding-top: 0;
    border-top: 0;
  }
  .follow-up-custom.is-open {
    display: grid;
  }
  .follow-up-custom button {
    min-height: 40px;
  }
  .follow-up-resolution {
    padding: 12px;
  }
  .follow-up-resolution > div {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .follow-up-tools-grid {
    gap: 6px;
  }
  .follow-up-tool {
    grid-template-columns: 27px minmax(0, 1fr) 16px;
    min-height: 40px;
    padding: 5px 7px;
  }
  .follow-up-tool > span {
    width: 25px;
    height: 25px;
  }
  .follow-up-tools-run {
    position: sticky;
    inset-block-end: 0;
    min-height: 40px;
    margin-top: 8px;
  }
}
@keyframes follow-up-backdrop-in {
  from { background: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .follow-up-layer,
  .follow-up-panel,
  .follow-up-chip {
    animation: none;
    transition: none;
    transform: none;
  }
}
.message.error .message-action:hover {
  background: rgba(180, 35, 24, 0.1);
  color: #912018;
}
.message.error .message-action:focus-visible {
  background: rgba(180, 35, 24, 0.1);
  color: #912018;
}
@media (max-width: 640px) {
  .message-actions {
    grid-column: 1;
  }
  .message.user .message-actions {
    grid-column: auto;
  }
  .message.user .bubble {
    padding-inline-end: calc(4px + var(--tap-target));
  }
}
@media (max-width: 640px), (hover: none), (pointer: coarse) {
  .message-action.follow-up-trigger {
    min-height: var(--tap-target);
  }
  .message-action {
    flex-basis: var(--tap-target);
    width: var(--tap-target);
    height: var(--tap-target);
  }
  .message-action svg {
    width: var(--message-action-icon-size, 22px);
    height: var(--message-action-icon-size, 22px);
  }
  .message-actions {
    min-height: var(--tap-target);
  }
}

/* Durable interactive workspace blocks embedded in assistant messages. */
.workspace-blocks {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.workspace-blocks-preparing { margin-top: 0; }
.workspace-block {
  width: min(100%, 620px);
  overflow: visible;
  border: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  border-radius: 12px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface-subtle) 46%, transparent);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), opacity 180ms var(--ease);
}
.workspace-block.is-saving { border-color: color-mix(in srgb, var(--secondary) 28%, var(--line)); opacity: .82; }
.workspace-block.is-updating { animation: workspace-content-enter 220ms var(--ease); }
.workspace-block.has-error { animation: workspace-error 260ms ease; border-color: var(--danger); }
.workspace-block-skeleton { display: grid; gap: 9px; min-height: 92px; padding: 15px; border-style: solid; box-shadow: none; }
.workspace-block-skeleton span { height: 9px; border-radius: 5px; background: color-mix(in srgb, var(--line) 72%, transparent); animation: workspace-pulse 1.15s ease-in-out infinite alternate; }
.workspace-block-skeleton span:first-child { width: 38%; height: 13px; background: color-mix(in srgb, var(--secondary) 15%, var(--line)); }
.workspace-block-skeleton span:nth-child(2) { width: 88%; }
.workspace-block-skeleton span:last-child { width: 66%; }
.workspace-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 7px;
}
.workspace-block-heading { display: flex; align-items: center; gap: 7px; min-width: 0; }
.workspace-block-heading > div { display: grid; min-width: 0; gap: 1px; }
.workspace-block-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-small); font-weight: 720; }
.workspace-block-heading small { color: var(--muted); font-size: var(--text-caption); }
.workspace-block-mark {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--secondary);
  background: transparent;
}
.workspace-block svg { width: 14px; height: 14px; fill: none; stroke: currentColor; }
.workspace-ai-trigger,
.workspace-ai-composer button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 9px;
  color: var(--secondary);
  background: transparent;
  font: inherit;
  font-size: var(--text-caption);
  font-weight: 700;
  cursor: pointer;
}
.workspace-ai-trigger { min-height: 26px; justify-content: center; padding: 3px 7px; color: var(--muted); font-size: .7rem; font-weight: 620; }
.workspace-ai-trigger:hover { color: var(--secondary); background: var(--secondary-soft); }
.workspace-ai-trigger:focus-visible { outline: 2px solid color-mix(in srgb, var(--secondary) 35%, transparent); outline-offset: 2px; }
.workspace-progress { height: 2px; margin: 0 10px 2px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--line) 55%, transparent); }
.workspace-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--secondary); transition: width 220ms ease; }
.workspace-checklist-section { padding: 5px 9px 3px; }
.workspace-checklist-section + .workspace-checklist-section { border-top: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.workspace-checklist-section h4 { margin: 0 5px 4px; color: var(--muted); font-size: var(--text-caption); font-weight: 680; }
.workspace-checklist-section ul { display: grid; margin: 0; padding: 0; list-style: none; }
.workspace-checklist-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; border-radius: 9px; transition: background-color 160ms var(--ease), opacity 160ms var(--ease); }
.workspace-checklist-item > label { min-width: 0; flex: 1; }
.workspace-checklist-item.is-editing > label,
.workspace-checklist-item.is-editing > .workspace-row-actions,
.workspace-checklist-item.is-editing > .workspace-row-menu { display: none; }
.workspace-checklist-item:hover,
.workspace-checklist-item:focus-within { background: color-mix(in srgb, var(--secondary-soft) 34%, transparent); }
.workspace-checklist-item label { display: flex; align-items: flex-start; gap: 9px; padding: 7px 6px; cursor: pointer; }
.workspace-checklist-item > label > input[type="checkbox"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.workspace-checkbox {
  display: grid;
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  place-items: center;
  border: 1.5px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 6px;
  color: transparent;
  background: var(--surface);
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.workspace-checklist-item.is-saving-check .workspace-checkbox svg { visibility: hidden; }
.workspace-checklist-item.is-saving-check .workspace-checkbox { position: relative; }
.workspace-checklist-item.is-saving-check .workspace-checkbox::after {
  content: ''; position: absolute; inset: 3px; border: 2px solid var(--secondary);
  border-inline-end-color: transparent; border-radius: 50%;
  animation: workspace-check-spin .8s linear infinite;
}
@keyframes workspace-check-spin { to { transform: rotate(360deg); } }
.workspace-checklist-item > label > input[type="checkbox"]:focus-visible + .workspace-checkbox { outline: 2px solid color-mix(in srgb, var(--secondary) 40%, transparent); outline-offset: 2px; }
.workspace-checklist-item > label > input[type="checkbox"]:checked + .workspace-checkbox { border-color: var(--secondary); color: #fff; background: var(--secondary); transform: scale(.94); }
.workspace-item-copy { display: grid; min-width: 0; gap: 2px; line-height: 1.45; }
.workspace-item-copy small { color: var(--muted); font-size: var(--text-caption); }
.workspace-row-actions { display: inline-flex; padding-inline-end: 3px; opacity: 0; transform: translateX(-3px); transition: opacity 150ms var(--ease), transform 150ms var(--ease); }
.workspace-checklist-item:hover .workspace-row-actions,
.workspace-checklist-item:focus-within .workspace-row-actions,
.workspace-checklist-item.is-menu-open .workspace-row-actions { opacity: 1; transform: translateX(0); }
.workspace-row-action { display: grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; transition: color 140ms ease, background-color 140ms ease; }
.workspace-row-action span { white-space: nowrap; }
.workspace-row-action:hover { color: var(--text); background: var(--surface); }
.workspace-row-action.is-danger:hover { color: var(--danger); }
.workspace-row-action:disabled { opacity: .25; cursor: default; }
.workspace-row-menu { position: absolute; z-index: 20; inset-inline-end: 5px; top: calc(100% - 2px); display: grid; grid-template-columns: minmax(0, 1fr); flex: none; width: max-content; max-width: calc(100% - 10px); min-width: 150px; box-sizing: border-box; gap: 2px; margin: 0; padding: 4px; border: 1px solid color-mix(in srgb, var(--line) 72%, transparent); border-radius: 10px; background: var(--surface); box-shadow: 0 7px 18px color-mix(in srgb, var(--ink) 11%, transparent); animation: workspace-menu-enter 150ms var(--ease); }
.workspace-row-menu[hidden] { display: none; }
.workspace-row-menu .workspace-row-action { display: inline-flex; width: 100%; height: auto; min-height: 32px; justify-content: flex-start; gap: 7px; padding: 5px 8px; font-size: var(--text-caption); }
.workspace-row-menu .workspace-row-action:hover,
.workspace-row-menu .workspace-row-action:focus-visible { color: var(--secondary); background: var(--secondary-soft); outline: 0; }
.workspace-row-menu .workspace-row-action.is-danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.workspace-inline-edit, .workspace-add-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 5px; }
.workspace-inline-edit { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 0 100%; box-sizing: border-box; padding-block: 6px; }
.workspace-inline-edit-actions { display: flex; justify-content: flex-end; gap: 6px; }
.workspace-inline-edit input, .workspace-add-item input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; color: var(--text); background: var(--surface); font: inherit; }
.workspace-inline-edit input { position: static; width: 100%; box-sizing: border-box; opacity: 1; }
.workspace-inline-edit button, .workspace-add-item button { border: 0; border-radius: 9px; padding: 7px 9px; color: var(--secondary); background: var(--secondary-soft); font: inherit; font-size: var(--text-caption); cursor: pointer; }
.workspace-add-trigger { display: inline-flex; align-items: center; gap: 5px; margin: 3px 5px 2px; border: 0; border-radius: 8px; padding: 5px 7px; color: var(--muted); background: transparent; font: inherit; font-size: var(--text-caption); cursor: pointer; opacity: .68; }
.workspace-add-trigger:hover, .workspace-add-trigger:focus-visible { color: var(--secondary); background: var(--secondary-soft); opacity: 1; }
.workspace-add-item { padding-block: 6px 2px; transition: opacity 150ms ease; }
.workspace-add-item[hidden] { display: none; }
.workspace-add-item:focus-within { opacity: 1; }
.workspace-add-item button { display: inline-flex; align-items: center; gap: 4px; }
.workspace-checklist-item.is-complete .workspace-item-copy > span { color: var(--muted); opacity: .72; text-decoration: line-through; text-decoration-thickness: 1px; transition: color 180ms ease, opacity 180ms ease; }
.workspace-ai-composer { display: flex; gap: 7px; padding: 8px 13px 12px; animation: workspace-composer-enter 180ms var(--ease); }
.workspace-ai-composer[hidden] { display: none; }
.workspace-ai-composer input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-small);
}
.workspace-ai-composer input:focus { border-color: var(--secondary); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 12%, transparent); }
.workspace-ai-composer button { padding: 7px 10px; background: var(--secondary-soft); }
.workspace-confirmation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 5px 10px 10px;
  padding: 10px;
  border-radius: 12px;
  color: var(--secondary);
  background: var(--secondary-soft);
  font-size: var(--text-caption);
}
.workspace-confirmation > span { display: inline-flex; align-items: center; gap: 6px; }
.workspace-confirmation button {
  border: 0;
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--secondary);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.workspace-confirmation button:last-child { color: #fff; background: var(--secondary); }
@keyframes workspace-error { 50% { transform: translateX(3px); } }
@keyframes workspace-pulse { to { opacity: .44; } }
@keyframes workspace-content-enter { from { opacity: .72; } to { opacity: 1; } }
@keyframes workspace-composer-enter { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes workspace-menu-enter { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 560px) {
  .workspace-block { border-radius: 13px; }
  .workspace-confirmation { align-items: flex-start; flex-direction: column; }
  .workspace-inline-edit-actions button { min-height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-checklist-item.is-saving-check .workspace-checkbox::after { animation: none; }
  .workspace-block,
  .workspace-progress > span,
  .workspace-checkbox { transition: none; }
  .workspace-block.has-error { animation: none; }
  .workspace-block.is-updating,
  .workspace-ai-composer,
  .workspace-row-menu { animation: none; }
  .workspace-block-skeleton span { animation: none; }
}

/* Language activities are rendered inside the ordinary conversation bubble. */
.workspace-block-language_lesson { padding: 20px; max-width: 100%; overflow-wrap: anywhere; }
.workspace-block-language_lesson h3 { margin: 0 0 18px; font-size: 1.05em; line-height: 1.6; }
.workspace-block-language_lesson h4 { margin: 0 0 10px; font-size: .92em; }

.workspace-block-language_lesson p { white-space: pre-wrap; text-align: start; line-height: 1.85; margin: 8px 0 14px; }
.workspace-block-language_lesson strong { display: block; font-size: .8em; font-weight: 600; color: var(--muted); }
.workspace-block-language_lesson .language-report { margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--secondary-soft); }
.workspace-block-language_lesson .language-correction,
.workspace-block-language_lesson .language-naturalAlternative { padding: 12px 14px; border-inline-start: 2px solid var(--secondary); background: var(--surface); border-radius: 8px; }
.workspace-block-language_lesson details { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.workspace-block-language_lesson summary { padding: 10px 14px; cursor: pointer; min-height: 44px; box-sizing: border-box; line-height: 1.7; color: var(--muted); font-size: .88em; }
.workspace-block-language_lesson summary::marker { color: var(--secondary); font-size: .8em; }
.workspace-block-language_lesson summary:hover,
.workspace-block-language_lesson details[open] > summary { color: var(--secondary); }
.workspace-block-language_lesson details > .language-copy { margin: 0; padding: 4px 14px 14px; }
.workspace-block-language_lesson .language-word { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.workspace-block-language_lesson .language-word > p { flex: 1 1 180px; margin: 0; font-weight: 550; }
.workspace-block-language_lesson .language-word > details { flex-basis: 100%; margin: 0; order: 1; border: 0; background: transparent; }
.workspace-block-language_lesson .language-word summary { padding-inline: 0; }
.workspace-block-language_lesson .language-word details > .language-copy { padding-inline: 0; font-weight: 400; color: var(--muted); }
.workspace-block-language_lesson .language-word bdi { color: var(--muted); font-size: .85em; }
.workspace-block-language_lesson .language-saved { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 20px; color: var(--secondary); background: var(--secondary-soft); font-size: .78em; white-space: nowrap; }
.workspace-block-language_lesson button:focus-visible,
.workspace-block-language_lesson textarea:focus-visible,
.workspace-block-language_lesson summary:focus-visible { outline: 2px solid var(--secondary); outline-offset: 3px; }
.workspace-block-language_lesson form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.workspace-block-language_lesson textarea { box-sizing: border-box; width: 100%; min-height: 100px; resize: vertical; font: inherit; line-height: 1.8; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.workspace-block-language_lesson textarea::placeholder { color: var(--muted); }
.workspace-block-language_lesson button { font: inherit; font-size: .88em; min-height: 44px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease; }
.workspace-block-language_lesson button:hover:not(:disabled) { background: var(--secondary-soft); border-color: var(--secondary); }
.workspace-block-language_lesson .language-primary { background: var(--secondary); border-color: var(--secondary); color: var(--surface); }
.workspace-block-language_lesson .language-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--secondary) 88%, var(--ink)); color: var(--surface); }
.workspace-block-language_lesson .language-save { padding: 7px 12px; color: var(--secondary); }
.workspace-block-language_lesson button:disabled { opacity: .6; cursor: default; }
.workspace-block-language_lesson button[aria-busy="true"] { cursor: progress; }
.workspace-block-language_lesson .language-ratings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.workspace-block-language_lesson .language-ratings > button { flex: 1; }
.workspace-block-language_lesson [hidden] { display: none; }
.workspace-block-language_lesson .language-copy { line-height: 1.85; text-align: start; overflow-wrap: anywhere; }
.workspace-block-language_lesson .language-copy > :first-child { margin-top: 0; }
.workspace-block-language_lesson .language-copy > :last-child { margin-bottom: 0; }
.workspace-block-language_lesson .language-copy > p { text-align: center }
.workspace-block-language_lesson .language-copy + .language-copy { margin-top: 10px; }
.workspace-block-language_lesson .language-copy strong { display: inline; font: inherit; font-weight: 700; color: inherit; }
.workspace-block-language_lesson .language-flashcard { padding: 24px; min-height: 190px; box-sizing: border-box; display: grid; align-items: center; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.workspace-block-language_lesson .language-flashcard-front { text-align: center; }
.workspace-block-language_lesson .language-flashcard-front > p { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 650; text-align: center; margin: 0 0 8px; }
.workspace-block-language_lesson .language-flashcard-front > bdi { color: var(--muted); }
.workspace-block-language_lesson .language-flashcard-front,
.workspace-block-language_lesson .language-flashcard-back { animation: language-card-reveal 240ms ease; }
.workspace-block-language_lesson .language-flashcard-back { text-align: center; }
.workspace-block-language_lesson .language-flashcard-word { display: block; color: var(--muted); font-size: .82em; margin-bottom: 8px; }
.workspace-block-language_lesson .language-flashcard-answer { font-size: 1.35em; font-weight: 700; }
.workspace-block-language_lesson .language-flashcard-answer .language-copy { text-align: center; }
@keyframes language-card-reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.workspace-block-language_lesson .language-flashcard + button { width: 100%; margin-top: 12px; }
.workspace-block-language_lesson .language-recall { font-size: .88em; color: var(--muted); margin: 20px 0 8px; }
.workspace-block-language_lesson .language-choices { display: grid; gap: 8px; margin-top: 18px; }
.workspace-block-language_lesson .language-choices > p { margin: 0 0 4px; color: var(--muted); font-size: .85em; }
.workspace-block-language_lesson .language-choices > button { text-align: start; }
.workspace-block-language_lesson .language-practice-footer { display: grid; gap: 10px; margin-block-start: 20px; padding-block-start: 16px; border-block-start: 1px solid var(--line); }
.workspace-block-language_lesson .language-practice-footer > p { margin: 0; color: var(--muted); font-size: .88em; }
.workspace-block-language_lesson .language-practice-choices { display: grid; gap: 8px; padding: 10px; }
.workspace-block-language_lesson .language-practice-choices > button { width: 100%; text-align: start; }
.workspace-block-language_lesson .language-kind { display: inline-block; margin-bottom: 8px; font-size: .75em; color: var(--secondary); }
.workspace-block-language_lesson .language-feedback { margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.workspace-block-language_lesson .language-review-result { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--language-accent) 9%, var(--surface)); }
.workspace-block-language_lesson .language-review-result strong { color: var(--ink); font-size: .86em; }
.workspace-block-language_lesson .language-review-result span { color: var(--language-accent); font-weight: 650; }
.workspace-block-language_lesson .language-review-score { margin-inline-start: auto; color: var(--muted); font-size: .84em; }
.workspace-block-language_lesson .language-feedback > details { margin-bottom: 0; border: 0; background: transparent; }
.workspace-block-language_lesson .language-feedback > details > summary { padding-inline: 0; }
.workspace-block-language_lesson .language-answer-detail { display: grid; gap: 8px; padding-block: 10px; }
.workspace-block-language_lesson .language-context { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.workspace-block-language_lesson details.language-context { padding: 0; }
.workspace-block-language_lesson .language-question { display: grid; gap: 8px; margin-block: 18px; }
.workspace-block-language_lesson .language-hint { color: var(--muted); font-size: .85em; }
.workspace-block-language_lesson .language-audio:empty { display: none; }
.workspace-block-language_lesson .language-audio .tts-message-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: auto; margin: 0; color: var(--secondary); background: var(--secondary-soft); opacity: 1; }
.workspace-block-language_lesson .language-audio svg { width: 20px; height: 20px; flex: none; }
.workspace-block-language_lesson .language-vocabulary { margin-block: 16px; }
.workspace-block-language_lesson .language-vocabulary > .language-word { margin-inline: 10px; }
.workspace-block-language_lesson form > label { width: 100%; font-size: .88em; color: var(--muted); }
.workspace-block-language_lesson form > label > textarea { display: block; margin-top: 8px; font-size: 1rem; }
.workspace-block-language_lesson .language-skills { display: grid; gap: 16px; padding: 14px; }
.workspace-block-language_lesson .language-skills > section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.workspace-block-language_lesson .language-skills h4 { margin: 0; align-self: center; }
.workspace-block-language_lesson .language-skills .language-copy { grid-column: 1 / -1; }
.workspace-block-language_lesson .language-level { padding: 3px 9px; border-radius: 8px; background: var(--surface); color: var(--secondary); }
.workspace-block-language_lesson .language-report details > h4 { margin-inline: 14px; }
.workspace-block-language_lesson .language-report ol { padding-inline-start: 32px; padding-inline-end: 14px; }
.workspace-block-language_lesson .language-report li + li { margin-top: 8px; }
.workspace-block-language_lesson[class*="language-kind-"] { border-inline-start: 4px solid var(--language-accent); }
.workspace-block-language_lesson .language-kind { color: var(--language-accent); }
.workspace-block-language_lesson .language-report,
.workspace-block-language_lesson .language-feedback { border-color: color-mix(in srgb, var(--language-accent) 42%, var(--line)); background: color-mix(in srgb, var(--language-accent) 8%, var(--surface)); }
.workspace-block-language_lesson .language-context,
.workspace-block-language_lesson .language-flashcard { border-color: color-mix(in srgb, var(--language-accent) 38%, var(--line)); background: color-mix(in srgb, var(--language-accent) 6%, var(--surface)); }
.workspace-block-language_lesson .language-primary { background: var(--language-accent); border-color: var(--language-accent); }
.workspace-block-language_lesson .language-audio .tts-message-button { color: var(--language-accent); background: color-mix(in srgb, var(--language-accent) 12%, var(--surface)); }
.workspace-block-language_lesson.language-kind-roleplay { --language-accent: #3478a5; }
.workspace-block-language_lesson.language-kind-reading { --language-accent: #168a78; }
.workspace-block-language_lesson.language-kind-listening { --language-accent: #7656aa; }
.workspace-block-language_lesson.language-kind-shadowing { --language-accent: #bd6a24; }
.workspace-block-language_lesson.language-kind-assessment { --language-accent: #4964b5; }
.workspace-block-language_lesson.language-kind-vocabulary { --language-accent: #43864b; }
.workspace-block-language_lesson.language-kind-review { --language-accent: #a27618; }
@media (max-width: 560px) {
  .workspace-block-language_lesson { padding: 14px; }
  .workspace-block-language_lesson .language-ratings > button { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-block-language_lesson button { transition: none; }
  .workspace-block-language_lesson .language-flashcard-front,
  .workspace-block-language_lesson .language-flashcard-back { animation: none; }
}

/* Dedicated voice composer; draft, attachments and selections stay intact. */
.composer.is-voice-active #message-input,
.composer.is-voice-active .composer-row,
.composer.is-voice-active .composer-floating-stack,
.composer.is-voice-active .composer-guidance-reply {
  display: none;
}
.voice-recorder[hidden],
.voice-recorder [hidden] { display: none; }
.voice-recorder { display: grid; width: 100%; min-width: 0; box-sizing: border-box; gap: 12px; padding: 12px 16px; color: var(--ink); }
.voice-recorder-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-subtle);
}
.voice-recorder-modes button {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.voice-recorder-modes button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.voice-recorder button:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
.voice-recorder button:disabled { opacity: .5; cursor: wait; }
.voice-recorder-transcript {
  margin: 0;
  max-height: 120px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  text-align: start;
  line-height: 1.8;
  white-space: pre-wrap;
}
.voice-recorder-feedback { display: flex; align-items: center; gap: 8px; min-width: 0; }
.voice-recorder-indicator { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--muted); }
.voice-recorder[data-state="recording"] .voice-recorder-indicator { background: #d84f6a; }
.voice-recorder[data-state="error"] .voice-recorder-indicator { background: #d84f6a; }
.voice-recorder-status { flex: 1; min-width: 0; margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.7; }
.voice-recorder-duration { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.voice-recorder-controls { display: flex; direction: ltr; align-items: center; gap: 12px; }
.voice-recorder-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-subtle);
  cursor: pointer;
}
.voice-recorder-action:hover { background: var(--surface-hover); }
.voice-recorder-action svg { width: 20px; height: 20px; fill: none; }
.voice-recorder-finish, .voice-recorder-submit.is-ready { background: var(--action); color: #fff; border-color: var(--action); }
.voice-recorder-finish:hover, .voice-recorder-submit.is-ready:hover { background: var(--action-hover); }
.voice-recorder-waveform { display: flex; align-items: center; justify-content: center; gap: 3px; flex: 1; min-width: 0; height: 44px; }
.voice-recorder-waveform span { width: 3px; height: 32px; border-radius: 3px; background: var(--action); transform: scaleY(.12); }
@media (max-width: 560px) {
  .voice-recorder { gap: 10px; padding: 10px; }
  .voice-recorder-controls { gap: 8px; }
  .voice-recorder-modes button { font-size: .85rem; }
}
/* composer component */
@media (max-width: 900px) {
  .composer {
    padding: 10px;
  }
}
@media (max-width: 560px) {
  .composer-row .ui-select {
    margin-inline-end: 0;
  }
}
.quick-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.quick-tool-button svg {
  width: 20px;
  height: 20px;
  fill: none;
}
.active-tool-chip svg {
  width: 20px;
  height: 20px;
  fill: none;
}
.composer-floating-stack {
  position: absolute;
  inset-inline-start: 12px;
  bottom: calc(100% + 8px);
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100% - 24px);
  gap: 6px;
  pointer-events: none;
}
.composer-active-tools {
  position: static;
  z-index: auto;
  display: flex;
  max-width: 100%;
  gap: 6px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex-wrap: wrap;
  pointer-events: auto;
}
.composer-active-tools[hidden] {
  display: none;
}
.active-tool-wrap {
  position: relative;
  flex: 0 0 auto;
}
.tools-dialog .tools-menu-list {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 270px;
  max-height: none;
  padding: 10px 16px 18px;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .tools-dialog .tools-menu-list {
    grid-template-columns: 1fr;
  }
}
.send-button:hover {
  border-color: #164c3b;
  background: #164c3b;
  color: #fff;
  transform: translateY(-1px);
}
.composer textarea:hover {
  outline: 0;
  box-shadow: none;
}
.composer textarea:focus {
  outline: 0;
  box-shadow: none;
}
.composer textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}
html[dir="rtl"] .composer-row {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 7px;
}
@media (min-width: 641px) {
  html[dir="rtl"] .composer-row {
    direction: rtl;
    justify-content: flex-start;
  }
  html[dir="rtl"] .composer-row .ui-select {
    direction: rtl;
  }
  html[dir="rtl"] .composer-row .ui-select-menu {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }
  html[dir="rtl"] .composer-actions {
    direction: rtl;
  }
}
.composer-row .ui-select-trigger {
  min-width: 128px;
  height: 38px;
  border-color: transparent;
  border-radius: 19px;
  background: var(--surface-subtle);
  padding-inline: 12px;
}
.tier-power { position: relative; display: block; width: 30px; height: 28px; color: #386f7b; }
.tier-power svg { width: 30px; height: 28px; overflow: visible; }
html.theme-dark-effective .tier-power { color: #72dbe3; }
.tier-select-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.tier-select-head strong { font-size: 13px; }
.tier-help-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; }
.tier-help-button svg { width: 20px; height: 20px; }
.tier-help-button:hover, .tier-help-button:focus-visible { color: var(--accent); background: var(--surface-subtle); }
.tier-option-copy { display: grid; min-width: 0; gap: 2px; text-align: start; }
.tier-option-heading { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tier-option-heading .ui-select-check { flex: 0 0 auto; }
.tier-option-copy small { max-width: 245px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.tier-guide-dialog { width: min(560px, calc(100vw - 28px)); }
.tier-guide-panel { max-height: min(720px, calc(100dvh - 32px)); }
.tier-guide-body { padding: 18px; overflow-y: auto; overscroll-behavior: contain; }
.tier-guide-intro { margin: 0 0 16px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: 16px; color: var(--ink); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); font-size: 13px; line-height: 1.8; }
.tier-guide-list { display: grid; gap: 8px; }
.tier-guide-item { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.tier-guide-item > .tier-power { margin: 0; }
.tier-guide-item strong { display: block; margin-bottom: 3px; font-size: 14px; }
.tier-guide-item p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.tier-guide-formats { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; gap: 5px; margin-top: 8px; padding: 4px 8px; border: 1px solid color-mix(in srgb, #397984 24%, var(--line)); border-radius: 999px; color: #326b75; background: color-mix(in srgb, #8bd2d5 13%, var(--surface)); font-size: 10px; font-weight: 700; line-height: 1.4; }
.tier-guide-formats svg { flex: 0 0 13px; width: 13px; height: 13px; }
.tier-guide-formats.is-empty { border-color: var(--line); color: var(--muted); background: var(--surface-subtle); }
html.theme-dark-effective .tier-guide-formats { color: #91d5d9; background: color-mix(in srgb, #4b939a 18%, var(--surface)); }
.composer-actions {
  overflow: visible;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}
.composer-actions .quick-tool-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}
.composer-actions .quick-tool-button:hover,
.composer-actions .quick-tool-button:focus-visible {
  border-color: var(--line);
}
.composer-actions .quick-tool-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.attachment-control {
  position: relative;
  display: flex;
}
.attachment-menu[hidden] {
  display: none;
}
.attachment-menu {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 8px);
  z-index: 80;
  display: grid;
  gap: 3px;
  width: 190px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.attachment-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  color: var(--ink);
  background: transparent;
  text-align: start;
  cursor: pointer;
}
.attachment-menu button:hover,
.attachment-menu button:focus-visible {
  background: var(--surface-hover);
}
.attachment-menu svg {
  width: 19px;
  height: 19px;
  fill: none;
}
.send-button svg {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
@media (max-width: 560px) {
  .composer textarea {
    padding-inline: 14px 6px;
  }
  html[dir="rtl"] .composer textarea {
    padding-inline: 6px 14px;
  }
}
@media (max-width: 560px) {
  .composer-row,
  html[dir="rtl"] .composer-row {
    justify-content: flex-start;
    gap: 2px;
  }
  .composer-actions {
    gap: 2px;
  }
  .composer-actions .quick-tool-button {
    width: 38px;
    min-width: 38px;
    height: 40px;
    min-height: 40px;
  }
  .composer-row .tier-select .ui-select-trigger,
  html.theme-dark-effective .composer-row .tier-select .ui-select-trigger {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
  .composer {
    padding: 8px 10px max(18px, calc(env(safe-area-inset-bottom) + 8px));
    background: linear-gradient(
    180deg,
    transparent,
    rgba(255, 253, 249, 0.98) 22%
    );
  }
  .composer-inner {
    width: 100%;
    box-shadow: 0 10px 30px rgba(23, 44, 53, 0.12);
  }
  .composer-inner:focus-within {
    box-shadow:
    0 12px 34px rgba(23, 44, 53, 0.15),
    var(--focus);
  }
  .composer textarea {
    font-size: 16px;
    line-height: 1.65;
  }
  .composer-row .ui-select {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 50px);
  }
  .composer-row .ui-select-trigger {
    min-width: 118px;
    max-width: 100%;
    height: 40px;
    border: 1px solid rgba(116, 128, 143, 0.16);
    border-radius: 20px;
    padding-inline: 13px;
    color: var(--ink);
  }
  .composer-row .ui-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .composer-row .ui-select-menu {
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: max-content;
    min-width: 100%;
    max-width: min(160px, calc(100vw - 36px));
    max-height: min(320px, calc(100dvh - 190px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface);
  }
  .composer-row .ui-select-option {
    color: var(--ink);
  }
  .composer-row .ui-select-option-label {
    color: var(--ink);
  }
  .composer-row .ui-select-option.selected {
    color: var(--accent);
  }
  .composer-row .ui-select-option.selected .ui-select-option-label {
    color: var(--accent);
  }
  .send-button {
    flex: 0 0 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(180, 81, 44, 0.25);
  }
}
.composer-inner.is-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.composer-inner.is-stacked textarea,
html[dir="rtl"] .composer-inner.is-stacked textarea {
  width: 100%;
  padding: 13px 16px 6px;
}
.composer-inner.is-stacked .composer-row,
html[dir="rtl"] .composer-inner.is-stacked .composer-row {
  direction: inherit;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  padding: 7px 8px 8px;
}
html[dir="rtl"] .composer-inner.is-stacked .composer-actions {
  order: initial;
}
.composer-inner.is-stacked .composer-actions {
  flex: 1 1 auto;
  min-width: 0;
}
.composer-inner.is-stacked .send-button {
  margin-inline-start: auto;
}
.send-button:active:not(:disabled) {
  transform: scale(0.96);
}
.composer-row .ui-select {
  width: auto;
  overflow: visible;
}
.composer-row .ui-select.open {
  z-index: 120;
}
.composer-row .ui-select-menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
  z-index: 130;
}
@media (min-width: 561px) {
  .composer-inner {
    flex-wrap: wrap;
  }
  .composer textarea {
    width: auto;
    min-height: 52px;
    max-height: 180px;
    padding-block: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-x: hidden;
    resize: none;
  }
}
@media (max-width: 560px) {
  .composer textarea {
    min-height: 52px;
    max-height: 84px;
    resize: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .composer-inner {
    animation: none;
    transition-duration: 0.001ms;
  }
  .send-button.is-streaming {
    transition-duration: 0.001ms;
  }
  .send-button.is-streaming::before {
    animation: none;
    opacity: 0.55;
  }
}

/* AI tier picker is intentionally an icon control, not a compact select field. */
.composer-row .tier-select.ui-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}
.composer-row .tier-select .ui-select-trigger,
html.theme-dark-effective .composer-row .tier-select .ui-select-trigger {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  box-shadow: none;
}
.composer-row .tier-select .ui-select-trigger:hover,
.composer-row .tier-select.open .ui-select-trigger {
  border: 0;
  background: color-mix(in srgb, #ff7a2e 10%, transparent);
  box-shadow: none;
}
.composer-row .tier-select .ui-select-chevron { display: none; }
.composer-row .tier-select .ui-select-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: visible; }
.composer-row .tier-select .ui-select-value > .tier-power { flex: 0 0 auto; margin: 0; transform: none; }
.composer-row .tier-select .tier-select-menu {
  position: absolute;
  inset: auto;
  width: min(300px, calc(100vw - 24px));
  min-width: 280px;
  max-width: none;
  max-height: min(430px, calc(100dvh - 170px));
  padding: 7px;
  border-radius: 20px;
}
.composer-row .tier-select .ui-select-option { display: grid; grid-template-columns: 48px minmax(0, 1fr); min-height: 58px; gap: 10px; padding: 8px 10px; border-radius: 13px; }
.composer-row .tier-select .ui-select-option > .tier-power { grid-column: 1; margin: 0; transform: none; }
.composer-row .tier-select .ui-select-option > .tier-option-copy { grid-column: 2; width: 100%; }
@media (max-width: 560px) {
  .composer-row .tier-select .tier-select-menu {
    position: absolute;
    inset: auto;
    min-width: 0;
    max-width: calc(100vw - 20px);
    padding: 9px;
    border-radius: 20px;
    transform: none;
  }
  .tier-guide-dialog { width: 100%; max-width: none; max-height: 88dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .tier-guide-panel { max-height: 88dvh; border-radius: 24px 24px 0 0; }
}
html.theme-dark-effective .composer {
  background: linear-gradient(180deg, transparent, rgba(17, 27, 34, 0.96) 30%);
}
html.theme-dark-effective .composer textarea {
  background: transparent;
  color: var(--ink);
}
html.theme-dark-effective .model-input {
  border-color: var(--line);
  background: #213640;
  color: var(--ink);
}
html.theme-dark-effective .send-button {
  background: linear-gradient(135deg, #c96d4c, #a94d32);
  color: #fff;
  box-shadow: 0 8px 20px rgba(180, 81, 44, 0.28);
}
.chat-main:has(.composer-active-tools:not([hidden]))
  .messages:not(:has(.welcome)) {
  padding-bottom: 82px;
  scroll-padding-bottom: 82px;
}
.composer {
  border-top: 0;
  position: relative;
  z-index: 40;
  overflow: visible;
  padding: 9px clamp(12px, 4vw, 42px) 13px;
  background: linear-gradient(180deg, transparent, var(--glass) 40%);
}
.composer-inner {
  flex-wrap: wrap;
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  animation: motion-enter-up var(--motion-enter) 390ms var(--motion-ease) both;
  transition:
  border-color var(--motion-state),
  box-shadow var(--motion-state),
  transform var(--motion-state) var(--motion-ease);
  overflow: visible;
  max-width: var(--content-width);
  border-color: color-mix(in srgb, var(--line) 78%, var(--surface));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 96%, var(--accent-soft));
  box-shadow:
  0 1px 3px color-mix(in srgb, var(--ink) 5%, transparent),
  0 9px 26px color-mix(in srgb, var(--ink) 7%, transparent);
}
.composer-inner:focus-within {
  border-color: color-mix(in srgb, var(--action) 42%, var(--line));
  box-shadow:
  0 0 0 1px color-mix(in srgb, var(--action) 12%, transparent),
  0 4px 10px color-mix(in srgb, var(--ink) 8%, transparent),
  0 16px 38px color-mix(in srgb, var(--action) 13%, transparent);
  transform: translateY(-1px);
}
.composer textarea {
  display: block;
  width: auto;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  resize: none;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 180px;
  line-height: 1.6;
  min-height: 52px;
  padding: 13px 15px 6px;
  color: var(--ink);
  font-size: var(--text-body);
}
.composer-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  overflow: visible;
  padding: 6px;
}
.model-input {
  width: min(50vw, 290px);
  border: 0;
  outline: 0;
  padding: 8px 10px;
  font-size: var(--text-small);
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}
.send-button {
  border: 1px solid rgba(116, 128, 143, 0.28);
  font-weight: 800;
  border-color: transparent;
  display: grid;
  place-items: center;
  padding: 0;
  transition:
  transform var(--motion-fast) var(--motion-ease),
  box-shadow var(--motion-state),
  border-radius var(--motion-state),
  background var(--motion-fast),
  color var(--motion-fast);
  min-width: var(--tap-target);
  width: var(--tap-target);
  height: var(--tap-target);
  border-radius: 11px;
  background: var(--button-primary);
  color: #fff;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--action) 18%, transparent);
}
.send-button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--button-primary-hover);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--action) 23%, transparent);
  transform: none;
}
.send-button:disabled {
  cursor: default;
  background: var(--surface-subtle);
  color: var(--muted);
  box-shadow: none;
  opacity: 0.62;
}
.send-button.is-streaming,
.send-button.is-streaming:hover:not(:disabled) {
  position: relative;
  isolation: isolate;
  cursor: pointer;
  border-color: var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 10%, var(--surface));
  color: var(--muted);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--ink) 10%, transparent);
  transform: none;
}
.send-button.is-streaming::before {
  position: absolute;
  z-index: -1;
  inset: -4px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--secondary) 12%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--secondary) 22%, transparent);
  content: "";
  pointer-events: none;
  animation: send-state-pulse 1.4s ease-in-out infinite;
}
.send-button.is-streaming svg {
  opacity: 1;
  transform: none;
}
.quick-tool-button:hover {
  background: var(--action-soft);
  color: var(--action);
}
.quick-tool-button:focus-visible {
  background: var(--action-soft);
  color: var(--action);
}
.quick-tool-button.is-active {
  background: var(--action);
  color: #fff;
}
.quick-tool-button.is-active:hover {
  background: var(--action);
  color: #fff;
}
.active-tool-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--secondary) 28%, transparent);
  border-radius: 11px;
  border-color: color-mix(in srgb, var(--action) 28%, var(--line));
  background: var(--action-soft);
  color: var(--action);
}
html.theme-dark-effective .composer-inner {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
@media (max-width: 900px) {
  .composer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 560px) {
  .composer {
    padding-inline: 8px;
  }
  .composer-inner {
    border-radius: 15px;
  }
}

/* sidebar component */
.session-list-status {
  padding: 8px;
}
.menu-icon {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
  content: "";
  position: relative;
}
.menu-icon::before {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
  content: "";
  position: absolute;
  top: -5px;
}
.menu-icon::after {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 4px;
  background: currentColor;
  content: "";
  position: absolute;
  top: 5px;
}
.tool-menu-icon svg {
  width: 18px;
  height: 18px;
}
.session-item span {
  color: var(--muted);
  font-size: 12px;
}
.session-item:hover {
  color: var(--ink);
}
.session-item.active {
  color: var(--ink);
}
.session-menu.open {
  display: grid;
}
.session-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  text-align: start;
}
.session-menu-item svg { width:18px; height:18px; flex-shrink:0; fill:none; stroke:currentColor; }
.session-title-row { display:flex; align-items:center; gap:4px; min-width:0; }
.session-title-row strong { flex:1; min-width:0; }
.session-pin { display:inline-flex; flex-shrink:0; color:var(--ink); }
.session-pin svg { width:13px; height:13px; fill:none; stroke:currentColor; }
.session-menu-item.danger {
  color: #b42318;
}
.mobile-menu-button {
  display: none;
}
.sidebar-scrim {
  display: none;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    inset-block: 12px;
    inset-inline-start: 12px;
    z-index: 7;
    width: min(286px, calc(100vw - 24px));
    min-height: 0;
    transform: translateX(calc(-100% - 18px));
    transition: transform 0.18s ease;
  }
  [dir="rtl"] .sidebar {
    transform: translateX(calc(100% + 18px));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-menu-button {
    display: grid;
  }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 6;
    display: block;
    border: 0;
    background: rgba(20, 17, 47, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .sidebar-scrim.open {
    opacity: 1;
    pointer-events: auto;
  }
}
@media (max-width: 900px) {
  .sidebar {
    height: calc(100vh - 20px);
    width: min(88vw, 320px);
  }
  html[dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }
}
#new-chat-button {
  border: 1px solid transparent;
  border-color: transparent;
  background: var(--accent);
  color: var(--surface);
  box-shadow: 0 8px 22px rgba(180, 81, 44, 0.22);
}
#new-chat-button:hover {
  transform: translateY(-1px);
  border-color: transparent;
  background: var(--accent-hover);
  color: var(--surface);
}
.session-menu-item:hover {
  border-color: var(--line-strong);
  background: var(--accent-soft);
  color: var(--ink);
}
@media (max-width: 900px) {
  .sidebar {
    box-sizing: border-box;
    max-height: calc(100dvh - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .sidebar .session-list {
    flex: 1 1 auto;
    overflow-y: auto;
  }
}
@media (min-width: 901px) {
  .sidebar {
    animation: motion-enter-side var(--motion-enter) var(--motion-ease) both;
  }
}
.new-chat-button {
  border: 1px solid rgba(116, 128, 143, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  transition:
  background 0.16s ease,
  border-color 0.16s ease,
  transform 0.16s ease;
  width: 100%;
  height: 42px;
  margin: 16px 0 12px;
  font-weight: 700;
  animation: motion-enter-up var(--motion-enter) 110ms var(--motion-ease) both;
}
.new-chat-button:hover {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(84, 95, 109, 0.38);
  transform: translateY(-2px);
}
.new-chat-button:active {
  transform: scale(0.96);
}
body[dir="ltr"] .session-row:hover {
  transform: translateX(2px);
}
@media (max-width: 900px), (pointer: coarse) {
  .session-row:hover {
    transform: none;
  }
}
body > .session-menu {
  z-index: 1000;
  max-height: min(320px, calc(100dvh - 16px));
  overflow-y: auto;
}
@media (prefers-reduced-motion: reduce) {
  .sidebar {
    animation: none;
    transition-duration: 0.001ms;
  }
  .new-chat-button {
    animation: none;
    transition-duration: 0.001ms;
  }
  .session-list {
    animation: none;
    transition-duration: 0.001ms;
  }
  .sidebar-footer {
    animation: none;
    transition-duration: 0.001ms;
  }
}
html.theme-dark-effective .sidebar {
  border-color: var(--glass-line);
  background: rgba(20, 31, 39, 0.88);
  box-shadow: var(--shadow);
}
html.theme-dark-effective .session-menu {
  border-color: var(--line);
  background: #192830;
  color: var(--ink);
  box-shadow: var(--shadow);
}
html.theme-dark-effective .session-row:hover {
  border-color: rgba(114, 198, 181, 0.24);
  background: #203a40;
}
html.theme-dark-effective .session-item:hover {
  color: var(--ink);
}
html.theme-dark-effective .session-item.active {
  color: var(--ink);
}
html.theme-dark-effective .sidebar-footer {
  border-color: rgba(185, 210, 214, 0.16);
  background: rgba(20, 31, 39, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 253, 249, 0.87);
  backdrop-filter: blur(22px) saturate(1.06);
  -webkit-backdrop-filter: blur(22px) saturate(1.06);
  height: calc(100dvh - 24px);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 14px 12px 12px;
  overflow: visible;
}
.sidebar .brand-beta-badge {
  color: color-mix(in srgb, var(--action) 72%, var(--ink));
  font-size: 9px;
}
.brand-row #new-chat-button {
  position: relative;
  z-index: 21;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  min-height: 38px;
  height: 38px;
  margin-inline-start: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}
.brand-row #new-chat-button:hover {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent) 20%);
  color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 12%, transparent);
}
.brand-row #new-chat-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent) 20%);
  color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 12%, transparent);
}
.brand-row #new-chat-button:active {
  background: var(--accent-soft);
  color: var(--accent-hover);
  transform: translateY(0);
  box-shadow: none;
}
.brand-row #new-chat-button svg {
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
}
.session-search {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  margin: 3px 0 7px;
  color: var(--muted);
}
.session-search.is-visible {
  display: flex;
}
.session-search svg {
  position: absolute;
  inset-inline-start: 11px;
  z-index: 1;
  width: var(--icon-small);
  height: var(--icon-small);
  fill: none;
}
.session-search input {
  width: 100%;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-subtle);
  padding: 0 32px 0 10px;
  color: var(--ink);
  font-size: var(--text-small);
}
body[dir="ltr"] .session-search input {
  padding: 0 11px 0 34px;
}
.session-search input:hover {
  border-color: var(--line);
}
.session-search input:focus {
  border-color: var(--line-strong);
  background: var(--surface);
}
.session-search input::placeholder {
  color: var(--muted);
  opacity: 0.82;
}
.session-list {
  display: flex;
  flex-direction: column;
  padding-inline-end: 2px;
  animation: motion-enter-up var(--motion-enter) 165ms var(--motion-ease) both;
  flex: 1 1 auto;
  min-height: 0;
  gap: 2px;
  padding-inline: 0 2px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent;
}
.session-list::-webkit-scrollbar {
  width: 5px;
}
.session-list::-webkit-scrollbar-track {
  background: transparent;
}
.session-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 34%, transparent);
}
.session-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: 11px;
  transition: background 0.16s var(--ease);
}
.session-row:hover {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-hover) 58%, transparent);
  transform: none;
}
.session-row:has(.session-item.active) {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-hover) 74%, var(--accent-soft));
}
html.theme-dark-effective .session-row:has(.session-item.active) {
  border-color: transparent;
  background: color-mix(in srgb, var(--surface-hover) 74%, var(--accent-soft));
}
.session-row:has(.session-item.active)::before {
  position: absolute;
  inset-block: 10px;
  inset-inline-start: -1px;
  width: 3px;
  border-radius: 8px;
  background: var(--accent);
  content: "";
  animation: active-session-in 360ms var(--motion-ease) both;
  display: none;
}
.session-item {
  padding-block: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  text-align: start;
  text-decoration: none;
  transition-timing-function: var(--motion-ease);
  align-self: stretch;
  min-height: 48px;
  padding: 7px 9px;
}
.session-row:has(.session-item.active) .session-assistant-avatar {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--action) 7%, var(--surface));
}
.session-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 680;
  line-height: 1.35;
}
.session-item .session-item-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  align-content: center;
  gap: 1px;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.35;
}
.session-item .session-item-copy > span {
  font-size: var(--text-caption);
  line-height: 1.35;
}
.session-menu {
  padding: 5px;
  position: absolute;
  inset-block-start: 34px;
  inset-inline-end: 4px;
  z-index: 9;
  display: none;
  min-width: 150px;
  overflow: hidden;
  border: 1px solid rgba(116, 128, 143, 0.24);
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.sidebar-footer {
  display: grid;
  padding-top: 12px;
  animation: motion-enter-up var(--motion-enter) 220ms var(--motion-ease) both;
  position: relative;
  gap: 8px;
  padding: 9px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sidebar-footer .legal-powered-by {
  gap: 4px 5px;
  margin: 0;
  padding: 0 4px 8px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.4;
}
.sidebar-footer .legal-powered-by__logo {
  width: 26px;
  height: 19px;
}
.sidebar-footer .legal-powered-by__name {
  font-size: 12px;
}
.sidebar-account-menu {
  position: relative;
}
.sidebar-account-menu > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: 11px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.sidebar-account-menu > summary::-webkit-details-marker {
  display: none;
}
.sidebar-account-menu > summary:hover {
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sidebar-account-menu[open] > summary {
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sidebar-account-menu summary > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.sidebar-account-menu summary strong {
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-account-menu summary small {
  color: var(--muted);
  font-size: var(--text-caption);
}
.sidebar-profile-avatar {
  display: grid;
  flex: 0 0 var(--avatar-small);
  place-items: center;
  width: var(--avatar-small);
  height: var(--avatar-small);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-profile-avatar svg {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
  stroke: currentColor;
}
.sidebar-account-menu > summary:hover .sidebar-profile-avatar {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-account-menu[open] > summary .sidebar-profile-avatar {
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-account-menu[open] .account-menu-chevron {
  transform: rotate(180deg);
}
.sidebar-account-popover {
  position: absolute;
  inset-inline: 0;
  bottom: calc(100% + 7px);
  z-index: 80;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sidebar-account-popover a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap-target);
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 0 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-small);
  text-align: start;
  cursor: pointer;
}
.sidebar-account-popover button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap-target);
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 0 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--text-small);
  text-align: start;
  cursor: pointer;
}
.sidebar-account-popover a:hover {
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sidebar-account-popover button:hover {
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--line);
}
.sidebar-account-popover svg {
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
  color: var(--ink);
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-account-popover a:hover svg {
  color: var(--ink);
}
.sidebar-account-popover button:hover svg {
  color: var(--ink);
}
.sidebar-account-popover form {
  margin: 0;
}
.sidebar-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: var(--tap-target);
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--button-primary);
  color: #fff;
  font-size: var(--text-control);
  font-weight: 720;
  text-decoration: none;
  box-shadow: 0 7px 16px color-mix(in srgb, var(--action) 18%, transparent);
}
.sidebar-login-button svg {
  width: var(--icon-medium);
  height: var(--icon-medium);
  fill: none;
  color: #fff;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar-login-button:hover {
  background: var(--button-primary-hover);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--action) 23%, transparent);
  transform: translateY(-1px);
}
.sidebar-login-button:focus-visible {
  background: var(--button-primary-hover);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--action) 23%, transparent);
  transform: translateY(-1px);
}
.tool-menu-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--action);
  background: var(--action-soft);
}
.tool-menu-item:hover .tool-menu-icon {
  color: var(--action);
  background: var(--action-soft);
}
.tool-menu-item:focus-visible .tool-menu-icon {
  color: var(--action);
  background: var(--action-soft);
}
.tool-menu-item.is-enabled .tool-menu-icon {
  border: 1px solid color-mix(in srgb, var(--action) 24%, var(--line));
  background: var(--surface);
  color: var(--action);
}
.tool-menu-item.is-enabled:hover .tool-menu-icon {
  border: 1px solid color-mix(in srgb, var(--action) 24%, var(--line));
  background: var(--surface);
  color: var(--action);
}
@media (max-width: 900px) {
  .sidebar {
    top: 8px;
    bottom: 8px;
    height: calc(100dvh - 16px);
    border-width: 1px;
    border-radius: 18px;
  }
  body[dir="rtl"] .sidebar {
    top: 8px;
    bottom: 8px;
    height: calc(100dvh - 16px);
    border-width: 1px;
    border-radius: 18px;
  }
  body[dir="ltr"] .sidebar {
    border-width: 0 1px 0 0;
  }
}

/* assistants component */
@media (max-width: 560px) {
  .session-assistant-avatar {
    flex-basis: 43px;
    width: 43px;
    height: 43px;
    border-radius: 14px;
  }
}
.assistant-switcher .ui-select {
  position: relative;
  z-index: 52;
}
.assistant-switcher .ui-select-icon-trigger {
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(31, 107, 99, 0.2);
  border-radius: 50%;
  background: var(--secondary-soft);
}
.assistant-switcher .ui-select.disabled .ui-select-icon-trigger {
  border-color: rgba(31, 107, 99, 0.42);
  cursor: pointer;
}
.assistant-lock-toast {
  position: fixed;
  z-index: 120;
  inset-block-start: 72px;
  inset-inline-end: 16px;
  max-width: min(310px, calc(100vw - 32px));
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(24, 45, 39, 0.12);
  font-size: var(--text-small);
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px);
  transition:
  opacity 0.15s ease,
  transform 0.15s ease;
}
.assistant-lock-toast.visible {
  opacity: 1;
  transform: translateY(0);
}
.assistant-switcher .ui-select-value {
  display: none;
}
.assistant-switcher .ui-select-chevron {
  display: none;
}
.assistant-switcher .ui-select-trigger-icon {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.assistant-switcher .ui-select-menu {
  inset-block-start: calc(100% + 8px);
  inset-block-end: auto;
  inset-inline-start: auto;
  inset-inline-end: 0;
  width: min(240px, calc(100vw - 24px));
  min-width: 210px;
  z-index: 60;
  border-color: var(--line);
  background: var(--surface);
}
.assistant-switcher .ui-select-option {
  justify-content: flex-start;
  white-space: normal;
}
.assistant-switcher .ui-select-option-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--secondary-soft);
  object-fit: cover;
}
.assistant-switcher .ui-select-option-label {
  flex: 1;
}
.assistant-switcher .ui-select-check {
  flex: 0 0 auto;
}
.assistant-switcher {
  position: relative;
  z-index: 80;
}
.assistant-picker-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}
.assistant-picker-copy small {
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 700;
}
@keyframes assistant-catalog-in {
  from {
  opacity: 0;
  transform: translateY(-7px) scale(0.985);
  }
  to {
  opacity: 1;
  transform: none;
  }
}
.assistant-catalog-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.assistant-category-heading p {
  overflow: hidden;
  max-width: 440px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-category-heading > span {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  border-radius: 8px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-size: var(--text-caption);
  font-weight: 800;
}
.assistant-card-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.assistant-card-copy strong {
  overflow: hidden;
  font-size: var(--text-small);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-card-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-card-lock {
  position: absolute;
  inset-block-start: 5px;
  inset-inline-end: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--secondary) 18%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--secondary);
  opacity: 0.82;
}
.assistant-card-lock svg {
  width: var(--icon-small);
  height: var(--icon-small);
}
.assistant-catalog-empty {
  margin: 25px 22px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.welcome-assistant-switch {
  display: none;
}
.message-assistant-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.message-assistant-avatar:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}
.message-assistant-avatar img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  box-shadow: 0 2px 8px rgba(23, 40, 48, 0.06);
  object-fit: cover;
}
.assistant-details-dialog::backdrop {
  background: rgba(23, 44, 53, 0.28);
  backdrop-filter: blur(5px);
}
.assistant-details-close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.assistant-details-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline-end: 30px;
}
.assistant-details-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.assistant-details-status {
  position: absolute;
  inset-block-end: 3px;
  inset-inline-end: 3px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #31a77c;
}
.assistant-details-heading {
  min-width: 0;
}
.assistant-details-eyebrow {
  color: var(--accent);
  font-size: var(--text-caption);
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.assistant-details-heading h2 {
  margin: 4px 0 3px;
  font-size: 24px;
  font-weight: 850;
  overflow-wrap: anywhere;
}
.assistant-details-heading p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
}
.assistant-details-description {
  margin: 24px 0 16px;
  color: var(--muted);
  font-size: var(--text-body);
  line-height: 1.9;
}
.assistant-details-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.assistant-details-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-size: var(--text-caption);
  font-weight: 750;
}
.assistant-details-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 24px;
  padding: 12px 13px;
  border: 1px solid rgba(180, 81, 44, 0.13);
  border-radius: 14px;
  background: #fff8f1;
}
.assistant-details-note > span {
  color: var(--accent);
  font-size: 16px;
  line-height: 1.5;
}
.assistant-details-note p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.75;
}
@media (max-width: 560px) {
  .assistant-details-card {
    padding: 24px 20px;
  }
  .assistant-details-avatar {
    width: 76px;
    height: 76px;
    border-radius: 21px;
  }
  .assistant-details-heading h2 {
    font-size: 21px;
  }
}
.assistant-picker-chevron {
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  display: block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  margin-inline-start: 0;
  border: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
  transition: transform 0.18s ease;
}
.assistant-picker.is-open .assistant-picker-chevron {
  transform: rotate(225deg) translate(-2px, -2px);
}
.assistant-search:focus-within {
  border-color: var(--secondary);
  border: 0;
  background: rgba(243, 237, 227, 0.48);
  box-shadow: 0 0 0 3px rgba(180, 81, 44, 0.12);
}
.assistant-search input:focus-visible {
  outline: 0;
  box-shadow: none;
}
.assistant-search > span {
  line-height: 1;
  font-size: 15px;
}
.assistant-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-small);
}
.assistant-search kbd {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: var(--text-caption);
  display: none;
}
.assistant-catalog-body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(560px, calc(100vh - 115px));
  padding: 0 14px 14px;
}
.assistant-category-section {
  padding: 0 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.assistant-category-section + .assistant-category-section {
  margin-top: 15px;
}
.assistant-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  margin: 0 5px 4px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(31, 107, 99, 0.1);
}
.assistant-category-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 800;
}
.assistant-popular-section .assistant-category-heading {
  border-bottom-color: rgba(180, 81, 44, 0.28);
}
.assistant-popular-section .assistant-category-heading h3 {
  color: var(--accent);
}
.assistant-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.assistant-card strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .assistant-catalog-body {
    padding-inline: 10px;
  }
}
@media (max-width: 560px) {
  .welcome-assistant-switch {
    display: inline-flex;
    align-items: center;
    justify-self: center;
    gap: 6px;
    min-height: 36px;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px solid rgba(31, 107, 99, 0.17);
    border-radius: 999px;
    background: var(--button-primary);
    color: #fff;
    font-size: var(--text-small);
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(24, 45, 39, 0.04);
    transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
  }
  .welcome-assistant-switch:hover {
    border-color: rgba(31, 107, 99, 0.34);
    background: var(--button-primary-hover);
    color: #fff;
  }
  .welcome-assistant-switch:focus-visible {
    border-color: rgba(31, 107, 99, 0.34);
    background: var(--button-primary-hover);
    color: #fff;
  }
  .welcome-assistant-switch:active {
    transform: scale(0.97);
  }
  .welcome-assistant-switch svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .welcome-assistant-switch + h2 {
    margin-top: 10px;
  }
}
.assistant-catalog:not([hidden]) {
  transform-origin: top center;
  animation: motion-popover-in var(--motion-state) var(--motion-ease) both;
}
html.theme-dark-effective .assistant-picker {
  border-color: rgba(114, 198, 181, 0.24);
  background: #20363d;
  color: var(--ink);
}
html.theme-dark-effective .assistant-picker:hover {
  border-color: var(--secondary);
  background: #29484c;
  color: var(--ink);
}
html.theme-dark-effective .assistant-picker.is-open {
  border-color: var(--secondary);
  background: #29484c;
  color: var(--ink);
}
html.theme-dark-effective .assistant-popular-section {
  background: #20343d;
}
html.theme-dark-effective
  .assistant-popular-section
  .assistant-category-heading {
  border-color: rgba(239, 139, 98, 0.36);
}
html.theme-dark-effective .assistant-category-heading {
  border-color: rgba(114, 198, 181, 0.2);
}
html.theme-dark-effective .assistant-card-row:hover {
  background: #29484c;
}
html.theme-dark-effective .assistant-details-heading h2 {
  color: var(--ink);
}
html.theme-dark-effective .assistant-details-card p {
  color: var(--ink);
}
html.theme-dark-effective .assistant-details-heading p {
  color: var(--muted);
}
html.theme-dark-effective .assistant-details-description {
  color: var(--muted);
}
html.theme-dark-effective .assistant-details-close {
  border-color: var(--line);
  background: #203640;
  color: var(--ink);
}
html.theme-dark-effective .assistant-details-close:hover {
  background: #29484c;
}
html.theme-dark-effective .assistant-details-note {
  border-color: rgba(239, 139, 98, 0.28);
  background: #2d2929;
  color: var(--muted);
}
html.theme-dark-effective .assistant-details-start-chat {
  background: linear-gradient(135deg, #c96d4c, #a94d32);
  color: #fff;
}
html.theme-dark-effective .session-assistant-avatar {
  border-color: rgba(114, 198, 181, 0.22);
  background: #29424a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
html.theme-dark-effective .assistant-details-dialog {
  overflow: hidden;
  border-color: rgba(185, 210, 214, 0.2);
  background: #192830;
}
.session-assistant-avatar {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  min-width: 32px;
  max-width: 32px;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  object-fit: cover;
  background: var(--cinematic-avatar-background);
  box-shadow: 0 2px 8px rgba(23, 40, 48, 0.06);
}
.assistant-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 220px;
  padding: 4px 10px 4px 5px;
  border: 1px solid rgba(31, 107, 99, 0.22);
  text-align: start;
  transition: 0.18s ease;
  padding-inline: 13px;
  min-width: 156px;
  height: 38px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}
.assistant-picker:hover {
  box-shadow: 0 8px 24px rgba(31, 107, 99, 0.12);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.assistant-picker.is-open {
  box-shadow: 0 8px 24px rgba(31, 107, 99, 0.12);
  border-color: var(--line-strong);
  background: var(--surface-hover);
}
.assistant-picker.is-disabled {
  opacity: 1;
  border-color: color-mix(in srgb, var(--action) 22%, var(--line));
  background: color-mix(in srgb, var(--action-soft) 76%, var(--surface));
  color: var(--ink);
  box-shadow: none;
  transform: none;
  cursor: default;
}
.assistant-picker.is-disabled:hover {
  border-color: color-mix(in srgb, var(--action) 22%, var(--line));
  background: color-mix(in srgb, var(--action-soft) 76%, var(--surface));
  color: var(--ink);
  box-shadow: none;
  transform: none;
  cursor: default;
}
.assistant-picker.is-disabled:focus-visible {
  border-color: color-mix(in srgb, var(--action) 22%, var(--line));
  background: color-mix(in srgb, var(--action-soft) 76%, var(--surface));
  color: var(--ink);
  box-shadow: none;
  transform: none;
  cursor: default;
}
.assistant-picker-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 680;
}
.assistant-catalog {
  position: absolute;
  inset-block-start: calc(100% + 12px);
  inset-inline-end: 0;
  z-index: 90;
  overflow: hidden;
  border: 1px solid rgba(31, 107, 99, 0.19);
  backdrop-filter: blur(26px);
  animation: assistant-catalog-in 0.18s ease-out;
  width: min(640px, calc(100vw - 28px));
  max-height: min(620px, calc(100dvh - 90px));
  display: flex;
  flex-direction: column;
  border-color: var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.assistant-catalog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 18px 18px 12px;
}
.assistant-catalog-head h2 {
  color: var(--ink);
  font-weight: 850;
  margin: 0;
  font-size: 18px;
}
.assistant-catalog-kicker {
  font-weight: 800;
  display: none;
  color: var(--accent);
  font-size: var(--text-caption);
  letter-spacing: 0;
}
.assistant-catalog-close {
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
}
.assistant-details-close {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-end: 16px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
}
.assistant-catalog-close svg {
  width: 18px;
  height: 18px;
}
.assistant-details-close svg {
  width: 18px;
  height: 18px;
}
.assistant-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--muted);
  height: 28px;
  margin: 0 16px 9px;
  padding-inline: 8px;
  border: 0;
  box-shadow: none;
  transition:
  background 0.18s ease,
  box-shadow 0.18s ease;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface-subtle);
}
.assistant-popular-section {
  margin-inline: 2px;
  padding: 7px 5px 9px;
  border: 0;
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--surface));
}
.assistant-card-row {
  display: flex;
  align-items: center;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  transform: none;
  box-shadow: none;
}
.assistant-card {
  transition: 0.16s ease;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 82px;
  padding: 10px 6px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: center;
  transition-timing-function: var(--motion-ease);
  transform: none;
  box-shadow: none;
}
.assistant-card-row:hover {
  border-color: var(--line);
  background: var(--surface-hover);
  transform: none;
  box-shadow: none;
}
.assistant-card:hover {
  border: 0;
  border-color: var(--line);
  background: var(--surface-hover);
  transform: none;
  box-shadow: none;
}
.assistant-card.is-selected {
  border-color: color-mix(in srgb, var(--action) 45%, var(--line));
  background: var(--action-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--action) 10%, transparent);
}
.assistant-card.is-selected:hover {
  border-color: color-mix(in srgb, var(--action) 45%, var(--line));
  background: var(--action-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--action) 10%, transparent);
}
.assistant-card.is-selected strong {
  color: var(--action);
}
.assistant-card.is-locked {
  filter: grayscale(0.7);
  border-color: transparent;
  background: transparent;
  opacity: 0.55;
}
.assistant-card.is-locked:hover {
  transform: none;
  border-color: transparent;
  background: transparent;
  opacity: 0.55;
}
.assistant-card-avatar {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--cinematic-avatar-background);
  box-shadow: 0 2px 8px rgba(23, 40, 48, 0.06);
  width: 46px;
  height: 46px;
  aspect-ratio: 1;
  border-radius: 11px;
  object-fit: cover;
}
.assistant-picker-avatar {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--cinematic-avatar-background);
  box-shadow: 0 2px 8px rgba(23, 40, 48, 0.06);
  width: 28px;
  height: 28px;
  min-width: 28px;
  max-width: 28px;
  aspect-ratio: 1;
  border-radius: 11px;
  object-fit: cover;
}
.assistant-details-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border: 0;
  background: var(--cinematic-avatar-background);
  box-shadow: none;
  aspect-ratio: 1;
  border-radius: 20px;
  object-fit: cover;
}
.assistant-details-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid rgba(31, 107, 99, 0.2);
  background: rgba(255, 253, 249, 0.98);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(23, 44, 53, 0.25);
  overflow: visible;
  border-radius: 20px;
}
.assistant-details-card {
  position: relative;
  padding: 28px;
  border-color: var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.assistant-details-start-chat {
  flex: 1;
  min-height: var(--tap-target);
  margin-top: 16px;
  border-radius: 13px;
  font: inherit;
  font-size: var(--text-control);
  font-weight: 800;
  cursor: pointer;
  transition:
  background 0.18s ease,
  transform 0.18s ease;
  border: 1px solid transparent;
  background: var(--button-primary);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--action) 18%, transparent);
  opacity: 1;
}
.assistant-details-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.assistant-details-actions .assistant-details-start-chat { margin-top: 0; display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
.assistant-details-actions .assistant-details-start-chat[hidden] { display: none; }
.assistant-details-change-assistant {
  display: grid;
  flex: 0 0 var(--tap-target);
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: pointer;
}
.assistant-details-change-assistant:hover,
.assistant-details-change-assistant:focus-visible {
  border-color: color-mix(in srgb, var(--action) 35%, var(--line));
  background: var(--action-soft);
  color: var(--action);
}
.assistant-details-change-assistant svg { width: 20px; height: 20px; }
.assistant-details-start-chat:hover {
  border-color: transparent;
  background: var(--button-primary-hover);
  color: #fff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--action) 22%, transparent);
  transform: translateY(-1px);
}
.assistant-details-start-chat:focus-visible {
  border-color: transparent;
  background: var(--button-primary-hover);
  color: #fff;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--action) 22%, transparent);
  transform: translateY(-1px);
}
.assistant-details-start-chat:disabled {
  background: var(--surface-subtle);
  color: var(--muted);
  box-shadow: none;
  opacity: 0.7;
  cursor: not-allowed;
}
.assistant-details-start-chat:active {
  background: color-mix(in srgb, var(--action-hover) 88%, #000);
  transform: none;
}
html.theme-dark-effective .assistant-details-card {
  box-shadow: var(--shadow);
  overflow: hidden;
  border-radius: inherit;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
html.theme-dark-effective .assistant-catalog {
  box-shadow: var(--shadow);
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
html.theme-dark-effective .assistant-search {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
@media (max-width: 560px) {
  .assistant-switcher {
    display: block;
    flex: 0 0 var(--tap-target);
    width: var(--tap-target);
    min-width: var(--tap-target);
    max-width: var(--tap-target);
    height: var(--tap-target);
  }
  .assistant-picker {
    display: grid;
    box-sizing: border-box;
    place-items: center;
    width: var(--tap-target);
    min-width: var(--tap-target);
    max-width: var(--tap-target);
    height: var(--tap-target);
    padding: 0;
    overflow: hidden;
    border-radius: 11px;
  }
  .assistant-picker-copy {
    display: none;
  }
  .assistant-picker-chevron {
    display: none;
  }
  .assistant-picker-avatar {
    display: block;
    flex: none;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: inherit;
    box-shadow: none;
    object-fit: cover;
  }
  .assistant-catalog {
    position: fixed;
    inset: 8px;
    display: flex;
    flex-direction: column;
    width: auto;
    height: calc(100dvh - 16px);
    max-height: none;
    border-radius: 18px;
  }
  .assistant-catalog[hidden] {
    display: none;
  }
  .assistant-catalog-head {
    flex: 0 0 auto;
    min-height: 52px;
    padding: 10px 12px 6px;
  }
  .assistant-catalog-head h2 {
    font-size: var(--text-title);
  }
  .assistant-catalog-close {
    width: var(--tap-target);
    height: var(--tap-target);
  }
  .assistant-search {
    flex: 0 0 auto;
    height: var(--tap-target);
    margin: 0 12px 7px;
  }
  .assistant-catalog-body {
    flex: 1 1 auto;
    max-height: none;
    padding: 0 8px 10px;
    overflow-y: auto;
    scroll-behavior: smooth;
  }
  .assistant-category-section + .assistant-category-section {
    margin-top: 9px;
  }
  .assistant-category-heading {
    margin: 0 4px 3px;
    padding-bottom: 4px;
  }
  .assistant-category-heading h3 {
    font-size: var(--text-small);
  }
  .assistant-popular-section {
    padding: 5px 4px 7px;
  }
  .assistant-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  .assistant-card {
    min-height: 76px;
    gap: 5px;
    padding: 6px 3px;
    border-radius: 10px;
  }
  .assistant-card-avatar {
    width: var(--avatar-medium);
    height: var(--avatar-medium);
    border-radius: 12px;
  }
  .assistant-card strong {
    font-size: var(--text-small);
  }
}

/* Public transcript and panel sharing preview use one read-only presentation. */
.share-transcript { display: grid; gap: 32px; }
.share-message { min-width: 0; line-height: 1.9; overflow-wrap: anywhere; }
.share-message > strong { display: block; margin-block-end: 10px; color: var(--muted); font-size: 12px; }
.share-message--user { padding: 18px 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--secondary-soft); }
.share-message--assistant { padding: 4px 6px; }
.share-message .markdown-body > :first-child { margin-block-start: 0; }
.share-message .markdown-body > :last-child { margin-block-end: 0; }
.shared-plain { white-space: pre-wrap; }
.share-message pre { max-width: 100%; overflow: auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; white-space: pre; direction: ltr; text-align: left; }
.share-message .markdown-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.share-message table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse; }
.share-message th, .share-message td { padding: 8px 12px; border: 1px solid var(--line); }
.shared-file, .shared-source { display: block; width: fit-content; margin-block-start: 10px; max-width: 100%; }
.shared-file { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.share-icon { width: 18px; height: 18px; flex-shrink: 0; }
.share-trigger { width: 38px; padding-inline: 0; }

.share-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 32px)); padding: 0; max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.24); overflow: auto; }
.share-dialog-body { min-width: 0; padding: 24px; }
.share-dialog-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 16px; }
.share-dialog-header h2 { margin: 0; font-size: 19px; line-height: 1.6; }
.share-dialog-header p { grid-column: 1 / -1; grid-row: 2; margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.share-dialog-header .icon-button { grid-column: 2; grid-row: 1; }
.share-dialog-content { display: grid; gap: 18px; min-width: 0; padding-block: 22px; }
.share-settings summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; min-height: 40px; }
.share-settings summary::-webkit-details-marker { display: none; }
.share-settings summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.share-settings summary .share-icon { transform: rotate(180deg); }
.share-settings[open] summary .share-icon { transform: none; }
.share-settings[open] .share-options { padding-top: 12px; }
.share-options { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.share-option { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; line-height: 1.8; }
.share-option input { width: 16px; height: 16px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.share-expiry { min-width: 0; border: 0; padding: 0; margin: 0; }
.share-expiry legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.share-expiry-choices { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; }
.share-expiry-choices label { position: relative; min-width: 0; cursor: pointer; }
.share-expiry-choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.share-expiry-choices span { display: grid; place-items: center; min-height: 38px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.share-expiry-choices input:checked + span { background: var(--secondary-soft); color: var(--ink); font-weight: 700; }
.share-expiry-choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.share-expiry-choices input:disabled + span { opacity: .5; cursor: wait; }
.share-expiry-existing { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.share-expiry-existing input { accent-color: var(--accent); }
.share-link-row { margin-block-start: 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; align-items: center; }
.share-link-row input { grid-column: 1 / -1; width: 100%; min-width: 0; box-sizing: border-box; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.share-link-row .ui-button { min-height: 46px; border-radius: 12px; font-size: 13px; gap: 8px; justify-content: center; }
.share-status { margin: 0; font-size: 12px; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; }
.share-status:empty { display: none; }
.share-dialog .dialog-actions { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0; }
.share-dialog .dialog-actions .ui-button { min-height: 44px; font-size: 13px; }
.share-dialog .dialog-actions .share-revoke { flex: 0 0 auto; margin-inline-end: auto; background: transparent; border-color: transparent; color: var(--danger, #b42318); padding-inline: 0; }
.share-dialog #share-publish { flex: 1; }
@media (max-width: 600px) {
  .share-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .share-dialog-body { padding: 20px; }
  .share-dialog-header h2 { font-size: 18px; }
  .share-dialog .dialog-actions { flex-wrap: wrap; }
}
.shared-reader-notice { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 0 auto 20px; max-width: 806px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.shared-reader-notice time { white-space: nowrap; }
.shared-reader-transcript { display: block; }
.shared-reader-hint { margin: 0 0 8px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.8; }

.is-shared-post #chat-form { display: none; }
