:root {
  --chat-primary: #3e3aab;
  --chat-primary-soft: rgba(62, 58, 171, 0.1);
  --chat-ink: #111827;
  --chat-muted: #6b7280;
  --chat-soft: #f7f7f8;
  --chat-soft-2: #ececf1;
  --chat-line: #e5e7eb;
  --chat-panel: #ffffff;
  --chat-radius: 18px;
  --chat-content: 48rem;
  --chat-ease: cubic-bezier(.22, 1, .36, 1);
  --chat-ring: 0 0 0 4px rgba(62, 58, 171, 0.12);
  --chat-shadow-soft: 0 10px 32px rgba(17, 24, 39, 0.08);
  --chat-shadow-card: 0 14px 38px rgba(62, 58, 171, 0.12);
  --chat-shadow-hover: 0 18px 44px rgba(62, 58, 171, 0.16);
}

body.page-chat {
  margin: 0;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100svh;
  overflow: hidden;
  background: var(--chat-panel);
  color: var(--chat-ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --chat-viewport-height: 100svh;
}

body.page-chat * {
  box-sizing: border-box;
}

.chat-shell {
  display: grid;
  grid-template-columns: 16.25rem minmax(0, 1fr);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100svh;
  background: var(--chat-panel);
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: 100svh;
  padding: 0.75rem;
  background: var(--chat-soft);
  color: var(--chat-ink);
  border-right: 1px solid var(--chat-line);
}

.chat-sidebar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.75rem;
    padding: 0rem 0.55rem 3.33rem;
    border-radius: 10px;
    color: var(--chat-ink);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.92rem;
}

.chat-sidebar__brand:hover,
.chat-sidebar__foot a:hover,
.chat-history-item:hover,
.chat-history-item.is-active {
  background: #f1f1ff;
  border: 1px solid #3e3aab3b;
}

.chat-sidebar__brand:hover {
    opacity: 0.66;
    background: none !important;
    border: none !important;
}

.chat-sidebar__brand img {
    width: 6rem;
    height: auto;
    padding: 0.66rem 0;
}

.chat-sidebar__new,
.chat-ghost-btn,
.chat-composer button,
.chat-locked button,
.chat-suggestions button,
.chat-history-item {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.chat-sidebar__new {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.75rem;
  margin: 0.65rem 0 1rem;
  padding: 0 0.75rem;
  border-radius: 10px;
  color: var(--chat-ink);
  background: transparent;
  font-weight: 700;
}

.chat-sidebar__new i {
  color: var(--chat-primary);
}

.chat-sidebar__new:hover {
  background: var(--chat-soft-2);
}

button#chat-page-new:hover {
    box-shadow: none;
    background: none;
    opacity: 0.66;
}

.chat-sidebar__section {
  min-height: 0;
  margin-bottom: 0.85rem;
}

.chat-sidebar__section:first-of-type {
  flex: 1 1 auto;
}

.chat-sidebar__label,
.chat-eyebrow {
  margin: 0.4rem 0 0.45rem;
  padding: 0 0.65rem;
  color: #8b90a2;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16rem;
  text-transform: uppercase;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.chat-history-empty {
  margin: 0.25rem 0.55rem;
  color: #969bad;
  font-size: 0.82rem;
}

.chat-history-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 2.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 2px;
  text-align: left;
  background: transparent;
  color: var(--chat-ink);
}

.chat-history-item__title,
.chat-history-item__preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-history-item__title {
    padding-right: 2.4rem;
    font-size: 0.88rem;
    font-weight: 700;
}

.chat-history-item__preview {
  margin-top: 0.1rem;
  color: #8b90a2;
  font-size: 0.76rem;
}

.chat-history-item__date {
  position: absolute;
  top: 0.58rem;
  right: 0.65rem;
  color: #a0a4b2;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
}

.chat-sidebar__foot {
    display: grid;
    gap: 0.18rem;
    padding: 1rem 0 3rem;
    border-top: 1px solid var(--chat-line);
}

.chat-sidebar__foot a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.45rem;
  padding: 0 0.65rem;
  border-radius: 10px;
  color: #4b5563;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.chat-sidebar__foot i {
  color: var(--chat-primary);
}

.chat-main {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-width: 0;
    height: 95svh;
    background: #ffffff;
}

.chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 3.75rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid #00000017;
}

.chat-topbar > div:first-child {
  min-width: 0;
}

.chat-eyebrow {
  display: none;
}

.chat-topbar h1 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    min-width: 0;
    max-width: 100%;
}

.chat-topbar h1 span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-topbar h1 i {
    color: grey;
    font-size: 0.95em;
    margin: 0;
}

.chat-topbar p:not(.chat-eyebrow) {
    margin: 0.12rem 0 0;
    color: var(--chat-muted);
    font-size: 0.66rem;
}

.chat-ghost-btn.chat-ghost-btn--link {
    border-radius: 4px;
    padding: 0 3.33rem;
}

.chat-ghost-btn.chat-ghost-btn--link i {
    opacity: 0.33;
}

.chat-topbar__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-left: 1px solid #00000017;
    padding: 0.66rem 1rem;
    position: relative;
    top: -0.5rem;
}

.chat-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2.2rem;
  padding: 0 0.72rem;
  border: 1px solid var(--chat-line);
  border-radius: 999px;
  color: #4b5563;
  background: var(--chat-panel);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.chat-ghost-btn:hover {
  color: var(--chat-primary);
  border-color: rgba(62, 58, 171, 0.24);
  background: var(--chat-primary-soft);
}

.chat-ghost-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

button#chat-page-delete {
    background: none;
    border: none;
    opacity: 0.33;
}

button#chat-page-delete:hover {
    border-radius: 4px;
    padding: 0 1.33rem;
    color: #e30000;
    box-shadow: none !important;
    opacity: 1;
    background: rgb(255 18 0 / 10%);
}

.chat-locked {
  display: none;
  align-items: center;
  gap: 0.9rem;
  width: min(var(--chat-content), calc(100vw - 19rem));
  margin: 0.5rem auto 0;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.08);
}

.chat-locked.is-visible {
  display: flex;
}

.chat-locked i {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 10px;
  color: #d97706;
  background: rgba(245, 158, 11, 0.13);
}

.chat-locked strong {
  display: block;
  font-size: 0.9rem;
}

.chat-locked p {
  margin: 0.08rem 0 0;
  color: var(--chat-muted);
  font-size: 0.86rem;
}

.chat-locked button {
  margin-left: auto;
  padding: 0.58rem 0.78rem;
  border-radius: 10px;
  color: #fff;
  background: var(--chat-primary);
  font-weight: 800;
}

.chat-thread {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem 2rem;
  scroll-behavior: smooth;
}

.chat-thread::-webkit-scrollbar,
.chat-history-list::-webkit-scrollbar {
  width: 0.45rem;
}

.chat-thread::-webkit-scrollbar-thumb,
.chat-history-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #d1d5db;
}

.chat-empty {
  display: flex;
  min-height: 100%;
  max-width: var(--chat-content);
  margin: 0 auto;
  padding: 7vh 0 2rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#chat-page-empty i {
    color: #3e3aab;
    opacity: 1;
}

.chat-empty.is-hidden {
  display: none;
}

.chat-empty img {
  width: 2.45rem;
  height: auto;
  opacity: 0.9;
}

.chat-empty h2 {
  margin: 1.25rem 0 0.55rem;
  color: var(--chat-ink);
  font-family: inherit;
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.chat-empty p {
  max-width: 36rem;
  margin: 0;
  color: var(--chat-muted);
  font-size: 1rem;
  line-height: 1.55;
}

.chat-suggestions {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.chat-suggestions button {
    min-height: 3.25rem;
    padding: 0.82rem 0.95rem;
    border: 1px solid var(--chat-line);
    border-radius: 8px;
    color: #374151;
    background: #fff;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 700;
    transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.chat-suggestions button:hover {
  color: var(--chat-primary);
  border-color: rgba(62, 58, 171, 0.28);
  background: var(--chat-primary-soft);
}

.chat-message {
  display: grid;
  grid-template-columns: 2rem minmax(0, var(--chat-content));
  gap: 0.85rem;
  max-width: calc(var(--chat-content) + 2.85rem);
  margin: 0 auto 1.65rem;
}

.chat-message--user {
  display: flex;
  justify-content: flex-end;
  max-width: var(--chat-content);
}

.chat-message--user .chat-message__avatar {
  display: none;
}

.chat-message--user .chat-message__body {
  max-width: min(36rem, 78%);
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--chat-soft-2);
  box-shadow: none;
}

.chat-message--assistant .chat-message__body {
  padding: 0.2rem 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-message__avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: #fff;
  background: var(--chat-primary);
  font-size: 0.62rem;
  font-weight: 900;
}

.chat-message__avatar img {
  width: 1.08rem;
  height: auto;
  -webkit-filter: brightness(0) invert(1);
          filter: brightness(0) invert(1);
}

.chat-message__body {
  min-width: 0;
  max-width: 100%;
  color: var(--chat-ink);
  font-size: 0.98rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: normal;
}

.chat-message__meta {
    margin: 0.35rem 0;
    color: #9ca3af;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08rem;
    text-transform: uppercase;
}

.chat-message--user .chat-message__meta {
  display: none;
}

.chat-message__body p {
  margin: 0;
  max-width: 100%;
}

.chat-message__body p + p {
  margin-top: 0.85rem;
}

.chat-message__body code {
    padding: 0.08rem 0.66rem;
    border-radius: 5px;
    background: var(--chat-primary-soft);
    color: var(--chat-primary);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.9em;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chat-source-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.32rem;
    color: var(--chat-primary);
    text-decoration: underline;
    text-underline-offset: 0.18em;
    font-weight: 700;
}

.chat-source-link i {
    font-size: 0.72em;
}

.chat-page-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 3.33rem 0 0.66rem;
    padding: 0.33rem 2rem;
    border-radius: 12px;
    color: var(--chat-primary);
    text-decoration: none;
    font-weight: 600;
    background: none;
    border-radius: 6px;
    border: 1px solid var(--chat-primary-soft);
}

.chat-page-cta:hover {
    background: var(--chat-primary);
}

.chat-page-cta--urgent {
    color: #dc2626;
    border: 1.5px solid #dc262669;
}

.chat-page-cta.chat-page-cta--urgent:hover {
    background: #dc2626;
}

.chat-page-cta--formation  {
    color: #39ae00;
    border: 1px solid rgb(22 163 74 / 37%);
}

.chat-page-cta--formation:hover  {
    background: #39ae00;
}

.chat-composer {
    display: grid;
    grid-template-columns: 1fr 2.35rem;
    gap: 0.55rem;
    align-items: end;
    align-content: center;
    justify-items: stretch;
    width: 100%;
    height: 3.33rem;
    min-height: 3.33rem;
    margin: 0 auto 1.15rem;
    padding: 0.66rem 0.9rem 0.66rem 0.9rem;
    border: 1.5px solid #3e3aab;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 30px #100e4f26;
    max-width: 800px;
}

.chat-composer.is-disabled {
  opacity: 0.62;
}

.chat-composer textarea {
  min-width: 0;
  min-height: 2.35rem;
  max-height: none;
  overflow: hidden;
  resize: none;
  border: 0;
  outline: 0;
  padding: 0.52rem 0.2rem;
  color: var(--chat-ink);
  background: transparent;
  font: inherit;
  line-height: 1.45;
}

.chat-composer textarea::-webkit-input-placeholder {
  color: #9ca3af;
}

.chat-composer textarea::-moz-placeholder {
  color: #9ca3af;
}

.chat-composer textarea::-ms-input-placeholder {
  color: #9ca3af;
}

.chat-composer textarea::placeholder {
  color: #9ca3af;
}

.chat-composer button {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  align-self: end;
  border-radius: 50%;
  color: #fff;
  background: var(--chat-primary);
  font-size: 0.95rem;
}

.chat-composer button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@supports not (height: 100svh) {
  body.page-chat,
  .chat-shell,
  .chat-sidebar {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  .chat-main {
    height: 100vh;
    height: -webkit-fill-available;
  }
}

body.page-chat .chat-sidebar {
  animation: chat-sidebar-in .48s var(--chat-ease) backwards;
}

body.page-chat .chat-topbar {
  animation: chat-topbar-in .42s var(--chat-ease) backwards;
}

body.page-chat .chat-empty {
  animation: chat-empty-in .58s var(--chat-ease) .08s backwards;
}

body.page-chat .chat-composer {
  transition:
    height .16s var(--chat-ease),
    transform .18s var(--chat-ease),
    border-color .18s var(--chat-ease),
    box-shadow .18s var(--chat-ease),
    opacity .18s var(--chat-ease);
  animation: chat-composer-in .5s var(--chat-ease) .1s backwards;
}

body.page-chat .chat-composer:focus-within {
  transform: translateY(-1px);
  border-color: rgba(62, 58, 171, .82);
  box-shadow: var(--chat-ring), 0 18px 46px rgba(62, 58, 171, .16);
}

body.page-chat .chat-sidebar__new,
body.page-chat .chat-sidebar__foot a,
body.page-chat .chat-ghost-btn,
body.page-chat .chat-page-cta,
body.page-chat .chat-composer button,
body.page-chat .chat-suggestions button,
body.page-chat .chat-history-item {
  transition:
    transform .18s var(--chat-ease),
    box-shadow .18s var(--chat-ease),
    background-color .18s var(--chat-ease),
    border-color .18s var(--chat-ease),
    color .18s var(--chat-ease),
    opacity .18s var(--chat-ease);
}

a.chat-ghost-btn.chat-ghost-btn--link {
    color: var(--chat-primary);
    border: none;
}

body.page-chat .chat-sidebar__new,
body.page-chat .chat-sidebar__foot a,
body.page-chat .chat-history-item {
  border: 1px solid transparent;
}

body.page-chat .chat-sidebar__new:hover,
body.page-chat .chat-sidebar__foot a:hover,
body.page-chat .chat-ghost-btn:hover,
body.page-chat .chat-page-cta:hover,
body.page-chat .chat-suggestions button:hover,
body.page-chat .chat-history-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--chat-shadow-soft);
}

body.page-chat .chat-sidebar__new:active,
body.page-chat .chat-sidebar__foot a:active,
body.page-chat .chat-ghost-btn:active,
body.page-chat .chat-page-cta:active,
body.page-chat .chat-composer button:active,
body.page-chat .chat-suggestions button:active,
body.page-chat .chat-history-item:active {
  transform: translateY(0) scale(.985);
  box-shadow: none;
}

body.page-chat .chat-ghost-btn:focus-visible,
body.page-chat .chat-sidebar__new:focus-visible,
body.page-chat .chat-sidebar__foot a:focus-visible,
body.page-chat .chat-suggestions button:focus-visible,
body.page-chat .chat-composer button:focus-visible,
body.page-chat .chat-page-cta:focus-visible,
body.page-chat .chat-history-item:focus-visible {
  outline: none;
  box-shadow: var(--chat-ring), var(--chat-shadow-soft);
}

body.page-chat .chat-suggestions button {
  animation: chat-card-in .46s var(--chat-ease) backwards;
}

body.page-chat .chat-suggestions button:nth-child(1) { animation-delay: .08s; }
body.page-chat .chat-suggestions button:nth-child(2) { animation-delay: .14s; }
body.page-chat .chat-suggestions button:nth-child(3) { animation-delay: .2s; }
body.page-chat .chat-suggestions button:nth-child(4) { animation-delay: .26s; }

body.page-chat .chat-history-item.is-active {
    border: 1px solid #3e3aab0f;
    color: #3e3aab;
}

.chat-message.chat-message--assistant {
    padding: 1.33rem 1rem;
    border: 1px solid #3e3aab36;
    border-radius: 14px;
}

.chat-message.chat-message--assistant:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(17, 24, 39, .08);
}

body.page-chat .chat-message {
  animation: chat-message-left .34s var(--chat-ease) backwards;
}

body.page-chat .chat-message--user {
  animation-name: chat-message-right;
}

body.page-chat .chat-message__avatar,
body.page-chat .chat-message--user .chat-message__body {
  transition:
    transform .18s var(--chat-ease),
    box-shadow .18s var(--chat-ease),
    background-color .18s var(--chat-ease);
}

body.page-chat .chat-message--user .chat-message__body:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(17, 24, 39, .08);
}

body.page-chat .chat-message--assistant:hover .chat-message__avatar {
  transform: scale(1.05);
  box-shadow: var(--chat-shadow-card);
}

body.page-chat .chat-locked.is-visible {
  animation: chat-card-in .38s var(--chat-ease) backwards;
}

@keyframes chat-sidebar-in {
  from { opacity: 0; transform: translate3d(-16px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes chat-topbar-in {
  from { opacity: 0; transform: translate3d(0, -10px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes chat-composer-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes chat-empty-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes chat-card-in {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes chat-message-left {
  from { opacity: 0; transform: translate3d(-10px, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes chat-message-right {
  from { opacity: 0; transform: translate3d(10px, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (hover: none) {
  body.page-chat .chat-sidebar__new:hover,
  body.page-chat .chat-sidebar__foot a:hover,
  body.page-chat .chat-ghost-btn:hover,
  body.page-chat .chat-page-cta:hover,
  body.page-chat .chat-suggestions button:hover,
  body.page-chat .chat-history-item:hover,
  body.page-chat .chat-message--user .chat-message__body:hover,
  body.page-chat .chat-message--assistant:hover .chat-message__avatar {
    transform: none;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-chat .chat-sidebar,
  body.page-chat .chat-topbar,
  body.page-chat .chat-empty,
  body.page-chat .chat-composer,
  body.page-chat .chat-suggestions button,
  body.page-chat .chat-message,
  body.page-chat .chat-locked.is-visible {
    animation: none !important;
  }

  body.page-chat .chat-sidebar__new,
  body.page-chat .chat-sidebar__foot a,
  body.page-chat .chat-ghost-btn,
  body.page-chat .chat-page-cta,
  body.page-chat .chat-composer,
  body.page-chat .chat-composer button,
  body.page-chat .chat-suggestions button,
  body.page-chat .chat-history-item,
  body.page-chat .chat-message__avatar,
  body.page-chat .chat-message--user .chat-message__body {
    transition: none !important;
  }
}

@media (max-width: 900px) {
  body.page-chat {
    overflow: hidden;
    width: 100%;
  }

  .chat-shell {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
  }

  .chat-sidebar {
    position: static;
    z-index: 20;
    display: none;
    min-height: auto;
    max-height: none;
    transform: none;
    border-top: 1px solid var(--chat-line);
    border-right: 0;
    box-shadow: none;
  }

  .chat-sidebar__section {
    overflow: auto;
  }

  .chat-main {
    height: var(--chat-viewport-height, 100svh);
    min-width: 0;
    max-width: 100vw;
    overflow: hidden;
  }

  .chat-topbar {
    gap: 0.55rem;
    min-width: 0;
    min-height: 3.5rem;
    padding: 0 0.75rem;
    overflow: hidden;
  }

  .chat-topbar h1 {
    gap: 0.45rem;
    font-size: 0.95rem;
  }

  .chat-topbar h1 i {
    flex: 0 0 auto;
  }

  .chat-topbar h1 span {
    display: block;
    max-width: 100%;
  }

  .chat-topbar p:not(.chat-eyebrow) {
    display: none;
  }

  .chat-topbar__actions {
    gap: 0.32rem;
    flex: 0 0 auto;
    padding: 0;
    border-left: 0;
    top: 0;
  }

  .chat-topbar__actions .chat-ghost-btn,
  .chat-ghost-btn.chat-ghost-btn--link {
    width: 2.18rem;
    min-height: 2.05rem;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .chat-ghost-btn i {
    margin: 0;
    font-size: 0.92rem;
  }

  .chat-thread {
    width: 100%;
    max-width: 100vw;
    padding: 0.75rem 0.7rem 1.1rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .chat-empty {
    padding-top: 2rem;
    max-width: 100%;
  }

  .chat-empty h2 {
    font-size: 1.5rem;
    letter-spacing: 0;
  }

  .chat-empty p {
    font-size: 0.92rem;
  }

  .chat-suggestions {
    grid-template-columns: 1fr;
  }

  .chat-message,
  .chat-message--user {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .chat-message {
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.55rem;
    margin-bottom: 1rem;
  }

  .chat-message__avatar {
    width: 1.65rem;
    height: 1.65rem;
  }

  .chat-message.chat-message--assistant {
    padding: 0.85rem 0.7rem;
    border-radius: 10px;
  }

  .chat-message__body {
    font-size: 0.94rem;
    line-height: 1.62;
  }

  .chat-message__meta {
    letter-spacing: 0.04rem;
  }

  .chat-message--user .chat-message__body {
    max-width: min(88%, calc(100vw - 4rem));
    padding: 0.62rem 0.78rem;
  }

  .chat-composer,
  .chat-locked {
    width: calc(100% - 1.4rem);
    max-width: none;
  }

  .chat-composer {
    min-width: 0;
    margin-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    border-radius: 8px;
    flex: 0 0 auto;
  }

  .chat-composer textarea {
    font-size: 0.95rem;
  }

  body.page-chat .chat-sidebar {
    animation: none;
  }

  body.page-chat .chat-composer:focus-within,
  body.page-chat .chat-message--user .chat-message__body:hover {
    transform: none;
  }
}

@keyframes chat-mobile-sidebar-in {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(calc(100% - 3.9rem)); }
}
