/*
 * Voice Chef conversation workspace.
 *
 * This file intentionally contains only view-scoped overrides.  It is meant to
 * be loaded after app.css so the conversation can keep a strict SPA viewport:
 * the transcript is the only scrolling region, while its header, voice strip
 * and composer stay available at all times.
 */

html:has(body[data-view="chat"]),
body[data-view="chat"] {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-view="chat"] {
  --chat-bg: #edf2ef;
  --chat-rail: #fefdfc;
  --chat-surface: #fff;
  --chat-ink: #111311;
  --chat-muted: #767b77;
  --chat-green: #2eaa49;
  --chat-green-dark: #178536;
  --chat-green-soft: #e8f4ea;
  --chat-line: #dfe5e0;
  --chat-shadow: 0 8px 24px rgba(26, 54, 34, .07);
  --chat-transcript-max: 1120px;
  background:
    radial-gradient(circle at 91% 12%, rgba(255, 255, 255, .7), transparent 30rem),
    radial-gradient(circle at 12% 90%, rgba(255, 255, 255, .52), transparent 27rem),
    var(--chat-bg);
  color: var(--chat-ink);
}

body[data-view="chat"] .app-shell,
body[data-view="chat"] .chat-screen,
body[data-view="chat"] .chat-layout,
body[data-view="chat"] .conversation-card {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-width: none;
  margin: 0;
  overflow: hidden;
}

body[data-view="chat"] .app-shell {
  display: block;
  padding: 0;
}

body[data-view="chat"] .topbar {
  display: none !important;
}

body[data-view="chat"] .chat-screen {
  padding: 0;
}

body[data-view="chat"] .chat-layout {
  display: grid;
  align-items: stretch;
}

body[data-view="chat"] .conversation-card {
  position: relative;
  top: auto;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

/* The transcript is deliberately the only scroll container in this view. */
body[data-view="chat"] #messages {
  min-width: 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-behavior: auto;
}

body[data-view="chat"] #messages::-webkit-scrollbar {
  display: none;
}

body[data-view="chat"] .empty-conversation,
body[data-view="chat"] .chat-sidebar,
body[data-view="chat"] .voice-mode-controls,
body[data-view="chat"] .composer {
  overflow: hidden;
}

body[data-view="chat"] .chat-toast-region {
  flex: 0 0 auto;
}

body[data-view="chat"] .request-status,
body[data-view="chat"] .voice-status {
  margin: 4px 0;
}

body[data-view="chat"] .composer-hint {
  display: none !important;
}

/* Shared message language. */
body[data-view="chat"] .message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

body[data-view="chat"] .message-row.user {
  justify-content: flex-end;
}

body[data-view="chat"] .message-stack {
  min-width: 0;
  max-width: min(88%, 620px);
  display: grid;
  gap: 9px;
}

body[data-view="chat"] .user .message-stack {
  max-width: min(70%, 540px);
  justify-items: end;
}

body[data-view="chat"] .message-bubble {
  width: fit-content;
  max-width: 100%;
  border: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body[data-view="chat"] .message-meta {
  display: none;
}

body[data-view="chat"] .user .message-bubble {
  color: #fff;
  border-bottom-right-radius: 6px;
  background: linear-gradient(145deg, #171918, #0d0f0e);
  box-shadow: 0 7px 19px rgba(0, 0, 0, .08);
}

body[data-view="chat"] .assistant .message-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #151815;
  border-bottom-left-radius: 6px;
  background: var(--chat-surface);
  box-shadow: var(--chat-shadow);
}

body[data-view="chat"] .message-row.processing .message-bubble {
  color: #4d554f;
  box-shadow: 0 5px 16px rgba(25, 72, 38, .07);
}

body[data-view="chat"] .message-row.processing .message-copy {
  animation: voice-chef-processing-pulse 1.15s ease-in-out infinite alternate;
}

@keyframes voice-chef-processing-pulse {
  from { opacity: .62; }
  to { opacity: 1; }
}

body[data-view="chat"] .message-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-bottom: 2px;
  border: 1px solid rgba(44, 170, 73, .13);
  border-radius: 50%;
  color: transparent;
  background: #fff;
  box-shadow: 0 7px 20px rgba(32, 119, 50, .1);
  font-size: 0;
}

body[data-view="chat"] .message-avatar::before {
  content: "";
  width: 58%;
  height: 58%;
  border-radius: 50%;
  background: linear-gradient(145deg, #55d365, #24943e);
}

body[data-view="chat"] .message-avatar::after {
  content: "▮▯▮";
  position: absolute;
  left: 50%;
  top: 50%;
  color: #fff;
  font-size: 8px;
  letter-spacing: 1px;
  transform: translate(-50%, -50%) scaleY(1.35);
}

body[data-view="chat"] .message-speaker {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  margin: -8px -10px -8px 8px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  font-size: 21px;
}

body[data-view="chat"] .message-speaker:focus-visible {
  outline: 3px solid rgba(46, 170, 74, .3);
  outline-offset: 2px;
}

body[data-view="chat"] .message-speaker.replay-playing {
  background-color: #e2efe5;
}

body[data-view="chat"] .message-speaker.replay-loading {
  animation: vc-replay-pulse 900ms ease-in-out infinite alternate;
}

@keyframes vc-replay-pulse {
  to { opacity: .45; }
}

/* Inline recipe note.  The selectors also cover the current, simpler card. */
body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) {
  width: min(88%, 620px);
}

body[data-view="chat"] .message-article-card {
  min-width: 0;
  overflow: hidden;
  border: 0;
  color: var(--chat-ink);
  text-decoration: none;
  background: #fff;
  box-shadow: var(--chat-shadow);
}

body[data-view="chat"] .message-article-card > span:first-child {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border-radius: 11px;
  color: #21843a;
  background: var(--chat-green-soft);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: none;
}

body[data-view="chat"] .message-article-image {
  display: block;
  width: 100%;
  object-fit: cover;
}

body[data-view="chat"] .message-article-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: var(--chat-ink);
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

body[data-view="chat"] .message-article-info strong {
  display: block;
  color: #111311;
  line-height: 1.12;
}

body[data-view="chat"] .message-article-info small,
body[data-view="chat"] .message-article-meta,
body[data-view="chat"] .message-article-ingredients,
body[data-view="chat"] .message-article-info .ingredients {
  display: block;
  color: #727772;
  line-height: 1.4;
}

body[data-view="chat"] .message-article-meta {
  margin-top: 7px;
}

body[data-view="chat"] .message-article-ingredients,
body[data-view="chat"] .message-article-info .ingredients {
  position: relative;
  margin-top: 13px;
  padding-left: 30px;
  color: #3e433f;
}

body[data-view="chat"] .message-article-ingredients::before,
body[data-view="chat"] .message-article-info .ingredients::before {
  content: "▦";
  position: absolute;
  left: 0;
  top: -.1em;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #218e3c;
  background: #e7f4e9;
  font-size: 13px;
}

body[data-view="chat"] .message-article-info b {
  min-height: 46px;
  display: grid;
  place-items: center;
  margin-top: auto;
  border-radius: 14px;
  color: #fff;
  background: #0d0f0e;
  font-size: 14px;
  font-weight: 650;
}

/* Voice playback strip. */
body[data-view="chat"] .voice-mode-controls {
  position: relative;
  order: 8;
  z-index: 2;
  display: grid;
  align-items: center;
  border: 1px solid rgba(48, 164, 72, .16);
  background: linear-gradient(90deg, rgba(228, 242, 231, .94), rgba(240, 247, 241, .96));
  box-shadow: none;
}

body[data-view="chat"] .voice-mode-button {
  grid-column: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

body[data-view="chat"] .voice-mode-ring {
  display: grid;
  place-items: center;
  border: 2px solid #50bd67;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(50, 174, 75, .08);
}

body[data-view="chat"] .voice-mode-ring::before {
  display: none;
}

body[data-view="chat"] .voice-mode-core {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #53cf62, #26963f);
}

body[data-view="chat"] .voice-mode-copy {
  grid-column: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
}

body[data-view="chat"] .voice-mode-copy strong,
body[data-view="chat"] .voice-mode-copy small {
  display: inline;
  margin: 0;
}

body[data-view="chat"] .voice-mode-copy small {
  color: #353a36;
}

body[data-view="chat"] .voice-mode-copy small::before {
  content: "·";
  margin-right: 8px;
}

body[data-view="chat"] .voice-mode-state {
  display: none;
}

body[data-view="chat"] .voice-waveform {
  grid-column: 4;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
  color: var(--chat-green);
}

body[data-view="chat"] .voice-waveform:empty::before {
  content: "▮ ▯ ▮▮ ▮ ▮▮▮ ▮▮ ▮";
  white-space: nowrap;
  letter-spacing: 1px;
  transform: scaleY(1.35);
}

body[data-view="chat"] .voice-waveform > * {
  width: 2px;
  flex: 0 0 2px;
  border-radius: 2px;
  color: inherit;
  background: currentColor;
}

body[data-view="chat"] .voice-speaker {
  grid-column: 5;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--chat-green-dark);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 4px 14px rgba(30, 75, 40, .08);
}

body[data-view="chat"] .text-mode-button:not(.voice-speaker) {
  display: none;
}

/* Composer: the :has() branch supports the richer three-control DOM. */
body[data-view="chat"] .composer {
  position: relative;
  order: 9;
  z-index: 3;
  align-items: center;
  border: 0;
  background: #fff;
  box-shadow: 0 12px 30px rgba(32, 53, 37, .1);
}

body[data-view="chat"] .composer textarea {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  resize: none;
  overflow-y: hidden;
  border: 1px solid #d8deda;
  outline: 0;
  color: var(--chat-ink);
  background: #fff;
  line-height: 1.35;
}

body[data-view="chat"] .composer textarea::placeholder {
  color: #858a86;
  opacity: 1;
}

body[data-view="chat"] .composer-plus,
body[data-view="chat"] #composer-voice-button,
body[data-view="chat"] .composer .send-button {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

body[data-view="chat"] .composer-plus {
  color: #20923c;
  background: #e8f4ea;
  font-size: 36px;
  font-weight: 300;
}

body[data-view="chat"] .composer-plus:empty::before {
  content: "+";
}

body[data-view="chat"] #composer-voice-button,
body[data-view="chat"] .composer .send-button {
  color: #fff;
  background: linear-gradient(145deg, #55d365, #24943e);
  box-shadow: 0 7px 18px rgba(36, 145, 58, .2);
}

body[data-view="chat"] .composer:has(.composer-plus) {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

body[data-view="chat"] .composer:has(.composer-plus) .composer-plus {
  grid-column: 1;
}

body[data-view="chat"] .composer:has(.composer-plus) textarea {
  grid-column: 2;
}

body[data-view="chat"] .composer:has(#composer-voice-button) #composer-voice-button {
  grid-column: 3;
}

body[data-view="chat"] .composer:has(#composer-voice-button) .send-button {
  display: none;
}

/* Desktop and landscape tablet: canonical 1536 x 1024 composition. */
@media (min-width: 701px) {
  body[data-view="chat"] .chat-screen,
  body[data-view="chat"] .chat-layout {
    background: var(--chat-bg);
  }

  body[data-view="chat"] .chat-layout {
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 0;
  }

  body[data-view="chat"] .chat-sidebar {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 34px 28px 24px;
    border: 0;
    border-right: 1px solid #e7ece8;
    border-radius: 0;
    background: rgba(255, 254, 253, .97);
    box-shadow: none;
  }

  /* Request and voice feedback leaves the composer flow on desktop and becomes
   * a conventional toast stack. The same live regions stay inline on phones. */
  body[data-view="chat"] .chat-toast-region {
    position: fixed;
    z-index: 1000;
    top: max(128px, calc(env(safe-area-inset-top) + 104px));
    right: max(24px, env(safe-area-inset-right));
    width: min(380px, calc(100vw - 398px));
    display: grid;
    gap: 10px;
    pointer-events: none;
  }

  body[data-view="chat"] .chat-toast-region > [hidden] {
    display: none !important;
  }

  body[data-view="chat"] .chat-toast-region > :is(.request-status, .voice-status):not([hidden]):not(.sr-only) {
    --chat-toast-accent: var(--chat-green);
    box-sizing: border-box;
    min-height: 56px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-left: 4px solid var(--chat-toast-accent);
    border-radius: 16px;
    color: #fff;
    background: rgba(21, 25, 22, .94);
    box-shadow: 0 16px 38px rgba(17, 30, 21, .24);
    backdrop-filter: blur(14px);
    animation: chat-toast-enter 180ms ease-out both;
    pointer-events: auto;
  }

  body[data-view="chat"] .chat-toast-region > .request-status:not([hidden]) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  body[data-view="chat"] .chat-toast-region > .voice-status:not([hidden]):not(.sr-only) {
    display: block;
  }

  body[data-view="chat"] .chat-toast-region > .error:not([hidden]) {
    --chat-toast-accent: #ff6f6f;
    background: rgba(54, 25, 25, .96);
  }

  body[data-view="chat"] .chat-toast-region .status-loader {
    grid-column: 1;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .32);
    border-top-color: var(--chat-toast-accent);
    border-radius: 50%;
    animation: chat-toast-spin 800ms linear infinite;
  }

  body[data-view="chat"] .chat-toast-region .request-status.error .status-loader {
    display: none;
  }

  body[data-view="chat"] .chat-toast-region #request-status-text {
    grid-column: 2;
    min-width: 0;
    font-size: 15px;
    font-weight: 620;
    line-height: 1.35;
  }

  body[data-view="chat"] .chat-toast-region #retry {
    grid-column: 3;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
  }

  body[data-view="chat"] .chat-toast-region #retry:hover {
    background: rgba(255, 255, 255, .18);
  }

  body[data-view="chat"] .sidebar-brand {
    min-height: 52px;
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 0 12px 29px;
    border: 0;
    background: transparent;
  }

  body[data-view="chat"] .sidebar-brand-mark,
  body[data-view="chat"] .sidebar-brand small {
    display: none;
  }

  body[data-view="chat"] .sidebar-brand strong {
    display: block;
    font-size: 40px;
    font-weight: 780;
    line-height: 1;
    letter-spacing: -.045em;
  }

  body[data-view="chat"] .sidebar-new-dialogue {
    width: 100%;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 0 31px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: #0d0f0e;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    font-size: 17px;
    font-weight: 680;
  }

  body[data-view="chat"] .sidebar-new-dialogue span {
    font-size: 38px;
    font-weight: 250;
    line-height: 1;
  }

  body[data-view="chat"] .sidebar-navigation {
    display: grid;
    gap: 8px;
    margin-top: 23px;
  }

  body[data-view="chat"] .sidebar-navigation button,
  body[data-view="chat"] .sidebar-current-chat,
  body[data-view="chat"] .sidebar-recent-item {
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 0;
    border-radius: 17px;
    cursor: pointer;
    text-align: left;
    background: transparent;
  }

  body[data-view="chat"] .sidebar-navigation button.active,
  body[data-view="chat"] .sidebar-navigation button:hover,
  body[data-view="chat"] .sidebar-current-chat,
  body[data-view="chat"] .sidebar-recent-item.active {
    background: #e7f1e9;
  }

  body[data-view="chat"] .sidebar-navigation button > span:first-child,
  body[data-view="chat"] .sidebar-chat-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #111411;
    background: transparent;
    font-size: 25px;
  }

  body[data-view="chat"] .sidebar-navigation strong,
  body[data-view="chat"] .sidebar-current-chat strong,
  body[data-view="chat"] .sidebar-recent-item strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 19px;
    font-weight: 520;
  }

  body[data-view="chat"] .sidebar-navigation small {
    display: none;
  }

  body[data-view="chat"] .sidebar-current-chat small,
  body[data-view="chat"] .sidebar-recent-item small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #747a75;
    font-size: 11px;
  }

  body[data-view="chat"] .sidebar-recent {
    margin-top: 24px;
    padding-top: 0;
    border-top: 0;
  }

  body[data-view="chat"] .sidebar-recent > p {
    margin: 0 11px 10px;
    color: #7d827e;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  body[data-view="chat"] .sidebar-current-chat,
  body[data-view="chat"] .sidebar-recent-item {
    min-height: 68px;
  }

  body[data-view="chat"] .sidebar-status {
    display: none;
  }

  body[data-view="chat"] .conversation-card {
    padding: 0 38px 26px;
  }

  body[data-view="chat"] .conversation-head {
    display: none;
  }

  body[data-view="chat"] .conversation-head > div:first-of-type {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  body[data-view="chat"] .conversation-head h2 {
    order: 1;
    margin: 0;
    font-size: 34px;
    font-weight: 770;
    line-height: 1;
    letter-spacing: -.035em;
  }

  body[data-view="chat"] .conversation-head .eyebrow {
    order: 2;
    margin: 10px 0 0;
    color: #787d79;
    font-size: 15px;
    font-weight: 450;
    letter-spacing: 0;
    text-transform: none;
  }

  body[data-view="chat"] .conversation-head .eyebrow::first-letter {
    color: var(--chat-green);
  }

  body[data-view="chat"] .chat-back,
  body[data-view="chat"] .scenario-badge {
    display: none;
  }

  body[data-view="chat"] .chat-head-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 1px;
  }

  body[data-view="chat"] .chat-head-actions button,
  body[data-view="chat"] .chat-overflow,
  body[data-view="chat"] .chat-overflow-menu,
  body[data-view="chat"] .desktop-overflow {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
    font-size: 25px;
  }

  body[data-view="chat"] .chat-head-actions:has(.chat-overflow) > button:not(.chat-overflow),
  body[data-view="chat"] .chat-head-actions:has(.chat-overflow-menu) > button:not(.chat-overflow-menu),
  body[data-view="chat"] .chat-head-actions:has(.desktop-overflow) > button:not(.desktop-overflow) {
    display: none;
  }

  body[data-view="chat"] #messages {
    flex: 1 1 auto;
    padding: 14px 4px;
  }

  body[data-view="chat"] .message-row {
    margin: 0 0 24px;
  }

  body[data-view="chat"] .message-row.user {
    padding-left: 36%;
  }

  body[data-view="chat"] .message-row.assistant {
    padding-right: 23%;
  }

  body[data-view="chat"] .message-avatar {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
  }

  body[data-view="chat"] .message-bubble {
    padding: 17px 22px;
    border-radius: 21px;
    font-size: 19px;
    line-height: 1.35;
  }

  body[data-view="chat"] .message-article-card {
    width: min(100%, 510px);
    min-height: 256px;
    display: grid;
    grid-template-columns: minmax(150px, 225px) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px 18px;
    padding: 14px 16px 16px;
    border-radius: 24px;
  }

  body[data-view="chat"] .message-article-card > span:first-child {
    grid-column: 1 / -1;
    padding: 9px 12px;
    font-size: 14px;
  }

  body[data-view="chat"] .message-article-image {
    grid-column: 1;
    grid-row: 2;
    height: 165px;
    border-radius: 16px;
  }

  body[data-view="chat"] .message-article-info {
    grid-column: 2;
    grid-row: 2;
  }

  body[data-view="chat"] .message-article-info strong {
    font-size: 20px;
  }

  body[data-view="chat"] .message-article-info small,
  body[data-view="chat"] .message-article-meta,
  body[data-view="chat"] .message-article-ingredients,
  body[data-view="chat"] .message-article-info .ingredients {
    font-size: 14px;
  }

  body[data-view="chat"] .voice-mode-controls {
    flex: 0 0 68px;
    min-height: 68px;
    grid-template-columns: 58px minmax(190px, 1fr) minmax(0, 1fr) minmax(120px, 178px) 52px;
    gap: 12px;
    margin: 8px 0 16px;
    padding: 7px 14px;
    border-radius: 22px;
  }

  body[data-view="chat"] .voice-mode-button {
    width: 54px;
    height: 54px;
  }

  body[data-view="chat"] .voice-mode-ring {
    width: 48px;
    height: 48px;
  }

  body[data-view="chat"] .voice-mode-core {
    width: 36px;
    height: 36px;
  }

  body[data-view="chat"] .voice-mode-copy strong {
    font-size: 17px;
    font-weight: 500;
  }

  body[data-view="chat"] .voice-mode-copy small {
    font-size: 15px;
  }

  body[data-view="chat"] .voice-waveform {
    width: 100%;
    height: 36px;
    font-size: 13px;
  }

  body[data-view="chat"] .voice-speaker {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  body[data-view="chat"] .composer {
    flex: 0 0 98px;
    min-height: 98px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 14px;
    margin: 0;
    padding: 11px 12px;
    border-radius: 25px;
  }

  body[data-view="chat"] .composer textarea {
    height: 64px !important;
    min-height: 64px;
    max-height: 64px;
    padding: 18px 24px;
    border-radius: 20px;
    font-size: 18px;
  }

  body[data-view="chat"] .composer-plus,
  body[data-view="chat"] #composer-voice-button,
  body[data-view="chat"] .composer .send-button {
    width: 64px;
    height: 64px;
    min-width: 64px;
  }

  body[data-view="chat"] .composer:has(.composer-plus) {
    grid-template-columns: 64px minmax(0, 1fr) 64px;
  }
}

body[data-view="chat"] .composer textarea {
  overflow-y: auto !important;
  scrollbar-width: none;
}

body[data-view="chat"] .composer textarea::-webkit-scrollbar {
  display: none;
}

/* Phone: 430 x 900 reference, with the same internal-scroll contract. */
@media (max-width: 700px) {
  body[data-view="chat"] .chat-screen {
    padding: max(12px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  }

  body[data-view="chat"] .chat-layout {
    display: block;
  }

  body[data-view="chat"] .chat-sidebar {
    display: none !important;
  }

  body[data-view="chat"] .conversation-card {
    padding: 0;
  }

  body[data-view="chat"] .conversation-head {
    flex: 0 0 66px;
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 0;
    border-radius: 25px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--chat-shadow);
  }

  body[data-view="chat"] .chat-back {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 27px;
  }

  body[data-view="chat"] .conversation-head > div:first-of-type {
    position: relative;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 48px;
  }

  body[data-view="chat"] .conversation-head > div:first-of-type::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 39px;
    height: 39px;
    border-radius: 50%;
    transform: translateY(-50%);
    background: url('/assets/scenarios/quick-v2.webp') center / cover;
  }

  body[data-view="chat"] .conversation-head h2 {
    order: 1;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -.025em;
  }

  body[data-view="chat"] .conversation-head .eyebrow {
    order: 2;
    margin: 4px 0 0;
    color: #777d78;
    font-size: 11px;
    font-weight: 450;
    letter-spacing: 0;
    text-transform: none;
  }

  body[data-view="chat"] .scenario-badge {
    display: none;
  }

  body[data-view="chat"] .chat-head-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1px;
  }

  body[data-view="chat"] .chat-head-actions button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 19px;
  }

  body[data-view="chat"] .desktop-overflow,
  body[data-view="chat"] .chat-overflow,
  body[data-view="chat"] .chat-overflow-menu {
    display: none;
  }

  body[data-view="chat"] #messages {
    flex: 1 1 auto;
    padding: 20px 2px 9px;
  }

  body[data-view="chat"] .message-row {
    gap: 8px;
    margin: 0 0 15px;
  }

  body[data-view="chat"] .message-row.user {
    padding-left: 18%;
  }

  body[data-view="chat"] .message-row.assistant {
    padding-right: 3%;
  }

  body[data-view="chat"] .message-stack,
  body[data-view="chat"] .user .message-stack {
    max-width: min(88%, 330px);
  }

  body[data-view="chat"] .message-avatar {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  body[data-view="chat"] .message-bubble {
    padding: 14px 16px;
    border-radius: 21px;
    font-size: 14px;
    line-height: 1.34;
  }

  body[data-view="chat"] .message-speaker {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 18px;
  }

  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) {
    width: min(88%, 336px);
    max-width: 336px;
  }

  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) > .message-bubble {
    padding-inline: 10px;
    font-size: 13.5px;
    white-space: nowrap;
  }

  body[data-view="chat"] .message-article-card {
    width: min(100%, 300px);
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 13px;
    border-radius: 24px;
  }

  body[data-view="chat"] .message-article-card > span:first-child,
  body[data-view="chat"] .message-article-image,
  body[data-view="chat"] .message-article-info {
    grid-column: 1;
  }

  body[data-view="chat"] .message-article-card > span:first-child {
    padding: 8px 10px;
    font-size: 14px;
  }

  body[data-view="chat"] .message-article-image {
    height: 162px;
    border-radius: 16px;
  }

  body[data-view="chat"] .message-article-info strong {
    font-size: 24px;
  }

  body[data-view="chat"] .message-article-info small,
  body[data-view="chat"] .message-article-meta,
  body[data-view="chat"] .message-article-ingredients,
  body[data-view="chat"] .message-article-info .ingredients {
    font-size: 13px;
  }

  body[data-view="chat"] .message-article-info .message-article-summary {
    display: none;
  }

  body[data-view="chat"] .message-article-ingredients > i {
    display: none;
  }

  body[data-view="chat"] .message-article-info b {
    min-height: 39px;
    margin-top: 13px;
    border-radius: 15px;
    font-size: 15px;
  }

  body[data-view="chat"] .voice-mode-controls {
    flex: 0 0 50px;
    min-height: 50px;
    grid-template-columns: minmax(48px, 1fr) minmax(0, auto) minmax(48px, 1fr) 42px;
    gap: 7px;
    margin: 5px 5px 10px;
    padding: 4px 7px;
    border-radius: 20px;
  }

  body[data-view="chat"] .voice-mode-controls:has(.voice-speaker) .voice-mode-button {
    display: none;
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-speaker)) .voice-mode-button {
    grid-column: 4;
    width: 40px;
    height: 40px;
    display: grid;
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-speaker)) .voice-mode-ring {
    width: 38px;
    height: 38px;
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-speaker)) .voice-mode-core {
    width: 28px;
    height: 28px;
  }

  body[data-view="chat"] .voice-mode-copy {
    grid-column: 2;
    justify-content: center;
    gap: 5px;
  }

  body[data-view="chat"] .voice-mode-copy strong {
    font-size: 12px;
    font-weight: 500;
  }

  body[data-view="chat"] .voice-mode-copy small {
    display: none;
  }

  body[data-view="chat"] .voice-waveform {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 32px;
    justify-content: center;
    font-size: 9px;
  }

  body[data-view="chat"] .voice-waveform + .voice-waveform,
  body[data-view="chat"] .voice-waveform.voice-waveform-end {
    grid-column: 3;
  }

  body[data-view="chat"] .voice-speaker {
    grid-column: 4;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-waveform))::before,
  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-waveform))::after {
    content: "▮ ▯ ▮▮ ▮";
    color: var(--chat-green);
    font-size: 8px;
    letter-spacing: 1px;
    white-space: nowrap;
    text-align: center;
    transform: scaleY(1.35);
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-waveform))::before {
    grid-column: 1;
    grid-row: 1;
  }

  body[data-view="chat"] .voice-mode-controls:not(:has(.voice-waveform))::after {
    grid-column: 3;
    grid-row: 1;
  }

  body[data-view="chat"] .voice-mode-controls:has(.voice-waveform):not(:has(.voice-waveform + .voice-waveform)):not(:has(.voice-waveform-end))::after {
    content: "▮ ▯ ▮▮ ▮";
    grid-column: 3;
    grid-row: 1;
    color: var(--chat-green);
    font-size: 8px;
    letter-spacing: 1px;
    white-space: nowrap;
    text-align: center;
    transform: scaleY(1.35);
  }

  body[data-view="chat"] .composer {
    flex: 0 0 75px;
    min-height: 75px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 8px;
    margin: 0;
    padding: 8px;
    border-radius: 26px;
  }

  body[data-view="chat"] .composer textarea {
    height: 59px !important;
    min-height: 59px;
    max-height: 59px;
    padding: 17px 16px;
    border-radius: 20px;
    font-size: 15px;
  }

  body[data-view="chat"] .composer-plus,
  body[data-view="chat"] #composer-voice-button,
  body[data-view="chat"] .composer .send-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  body[data-view="chat"] .composer-plus {
    font-size: 31px;
  }

  body[data-view="chat"] .composer:has(.composer-plus) {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }
}

@keyframes chat-toast-enter {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chat-toast-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="chat"] #messages {
    scroll-behavior: auto;
  }

  body[data-view="chat"] .chat-toast-region > :is(.request-status, .voice-status),
  body[data-view="chat"] .chat-toast-region .status-loader {
    animation: none;
  }
}

/* Final 1536 × 1024 alignment pass. */
@media (min-width: 701px) {
  body[data-view="chat"] .sidebar-brand {
    padding-bottom: 46px;
  }

  body[data-view="chat"] .sidebar-new-dialogue {
    width: 290px;
  }

  body[data-view="chat"] .sidebar-overflow {
    display: none;
  }

  body[data-view="chat"] .sidebar-recent {
    margin-top: 37px;
  }

  body[data-view="chat"] .sidebar-recent > p {
    margin-bottom: 26px;
  }

  body[data-view="chat"] .sidebar-recent-secondary {
    margin-top: 17px;
    background: #f7f7f7 !important;
  }

  body[data-view="chat"] .sidebar-current-chat .sidebar-chat-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #111;
    border-radius: 9px;
    color: transparent;
    font-size: 0;
  }

  body[data-view="chat"] #sidebar-current-chat .sidebar-chat-icon {
    border-color: #2ca74a;
    color: #fff;
    background: #2ca74a;
  }

  body[data-view="chat"] .sidebar-current-chat .sidebar-chat-icon::before {
    content: "≡";
    color: currentColor;
    font-size: 19px;
    line-height: 1;
  }

  body[data-view="chat"] .conversation-card {
    padding-right: 45px;
    padding-left: 36px;
  }

  body[data-view="chat"] .conversation-head {
    padding-left: 4px;
  }

  body[data-view="chat"] .chat-head-mobile-actions {
    display: none;
  }

  body[data-view="chat"] #messages {
    padding: 18px 4px 0;
  }

  body[data-view="chat"] .message-row {
    margin-bottom: 24px;
  }

  body[data-view="chat"] .message-row.assistant {
    align-items: flex-start;
    gap: 28px;
  }

  body[data-view="chat"] .message-avatar {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
    margin-top: -2px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-view="chat"] .message-avatar::before {
    position: absolute;
    left: 50%;
    top: 0;
    width: 108px;
    height: 76px;
    display: block;
    border-radius: 0;
    background: url("/assets/icons/voice-avatar.webp") center / contain no-repeat;
    filter: drop-shadow(0 7px 16px rgba(32, 119, 50, .12));
    transform: translateX(-50%);
  }

  body[data-view="chat"] .message-avatar::after {
    display: none;
  }

  body[data-view="chat"] .message-bubble {
    font-size: 20px;
  }

  body[data-view="chat"] .assistant .message-bubble {
    display: block;
    padding: 20px 24px 18px;
  }

  body[data-view="chat"] .message-meta {
    display: block;
    margin-top: 2px;
    color: #83878b;
    font-size: 15px;
    line-height: 1.15;
    white-space: nowrap;
  }

  body[data-view="chat"] .user .message-bubble {
    display: flex;
    align-items: flex-end;
    gap: 17px;
    min-height: 70px;
    padding: 18px 24px;
    white-space: nowrap;
  }

  body[data-view="chat"] .user .message-meta {
    flex: 0 0 auto;
    margin-left: auto;
    margin-top: 0;
    color: #d4d7d5;
  }

  body[data-view="chat"] .message-speaker {
    display: none;
  }

  body[data-view="chat"] .message-article-card {
    transform: translateX(-5px);
  }

  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) {
    gap: 12px;
  }

  body[data-view="chat"] .message-article-summary {
    display: none !important;
  }

  body[data-view="chat"] .chat-overflow > summary {
    list-style: none;
  }

  body[data-view="chat"] .chat-overflow > summary::-webkit-details-marker {
    display: none;
  }
}

/* Final phone conversation alignment. */
@media (max-width: 700px) {
  body[data-view="chat"] .chat-screen {
    padding-bottom: 14px;
  }

  body[data-view="chat"] .conversation-head {
    min-height: 62px;
    height: 62px;
    flex-basis: 62px;
    margin: 1px 4px 0;
  }

  body[data-view="chat"] .conversation-head > div:first-of-type {
    transform: translateX(-10px);
  }

  body[data-view="chat"] .message-row.assistant {
    align-items: flex-start;
  }

  body[data-view="chat"] .message-row:nth-child(1) {
    margin-bottom: 17px;
  }

  body[data-view="chat"] .message-row:nth-child(2),
  body[data-view="chat"] .message-row:nth-child(3) {
    margin-bottom: 18px;
  }

  body[data-view="chat"] .message-row:nth-child(2) {
    margin-bottom: 18px;
  }

  body[data-view="chat"] #messages {
    padding-top: 20px;
    padding-bottom: 0;
  }

  body[data-view="chat"] .message-bubble {
    position: relative;
    padding-block: 12.625px;
  }

  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) > .message-bubble {
    padding-block: 13px;
  }

  body[data-view="chat"] .message-row.assistant .message-bubble::before,
  body[data-view="chat"] .message-row.user .message-bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 13px;
  }

  body[data-view="chat"] .message-row.assistant .message-bubble::before {
    left: -8px;
    background: #fff;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
  }

  body[data-view="chat"] .message-row.user .message-bubble::before {
    right: -8px;
    background: #111412;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  body[data-view="chat"] .message-avatar {
    transform: translateX(4px);
  }

  body[data-view="chat"] .message-avatar::before {
    content: "";
    width: 34px;
    height: 28px;
    display: block;
    background: url("/assets/icons/voice-wave.webp") center / 26px 32px no-repeat;
    transform: none;
  }

  body[data-view="chat"] .message-avatar::after {
    display: none;
  }

  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) {
    gap: 15px;
  }

  body[data-view="chat"] .message-article-card {
    padding-bottom: 18px;
  }

  body[data-view="chat"] .voice-waveform {
    overflow: hidden;
    color: transparent;
    background: url("/assets/icons/voice-waveform.webp") center / 78px 32px no-repeat;
    font-size: 0;
  }

  body[data-view="chat"] .voice-mode-controls:has(.voice-waveform):not(:has(.voice-waveform + .voice-waveform)):not(:has(.voice-waveform-end))::after {
    content: "";
    width: 100%;
    height: 32px;
    background: url("/assets/icons/voice-waveform.webp") center / 78px 32px no-repeat;
    transform: none;
  }

  body[data-view="chat"] .voice-mode-copy {
    transform: translateX(6px);
  }

  body[data-view="chat"] .voice-mode-controls {
    margin-bottom: 12px;
  }

  body[data-view="chat"] .composer:has(.composer-plus) {
    grid-template-columns: 46px minmax(0, 1fr) 50px;
    gap: 10px;
    padding: 12px 14px 12px 10px;
  }

  body[data-view="chat"] .composer textarea {
    height: 48px !important;
    min-height: 48px;
    max-height: 48px;
    padding: 13px 14px;
  }

  body[data-view="chat"] .composer-plus {
    width: 46px;
    min-width: 46px;
    height: 46px;
  }

  body[data-view="chat"] #composer-voice-button,
  body[data-view="chat"] .composer .send-button {
    width: 50px;
    min-width: 50px;
    height: 50px;
  }

  body[data-view="chat"] .voice-mode-copy strong,
  body[data-view="chat"] .voice-mode-copy small {
    display: inline;
    font-size: 12px;
  }

  body[data-view="chat"] .voice-mode-copy small::before {
    margin-right: 5px;
  }
}

@media (min-width: 701px) {
  body[data-view="chat"] .message-bubble {
    position: relative;
  }

  body[data-view="chat"] .message-row.assistant .message-bubble::before,
  body[data-view="chat"] .message-row.user .message-bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 13px;
    height: 17px;
  }

  body[data-view="chat"] .message-row.assistant .message-bubble::before {
    left: -11px;
    background: #fff;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
  }

  body[data-view="chat"] .message-row.user .message-bubble::before {
    right: -11px;
    background: #111412;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  body[data-view="chat"] .message-row.user .message-bubble {
    padding-right: 17px;
    padding-left: 23px;
  }

  body[data-view="chat"] .voice-waveform {
    overflow: hidden;
    color: transparent;
    background: url("/assets/icons/voice-waveform.webp") left center / 160px 36px no-repeat;
    font-size: 0;
    transform: translateX(-10px);
  }
}

/* Desktop safeguards loaded before the general responsive polish sheet. */
@media (min-width: 701px) {
  body[data-view="chat"] #messages .message-avatar {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    aspect-ratio: 1 / 1;
    overflow: visible;
  }

  body[data-view="chat"] #messages .message-avatar::before {
    left: 50%;
    top: 0;
    width: 108px;
    height: 76px;
    border-radius: 0;
    background: url("/assets/icons/voice-avatar.webp") center -10px / 182px 128px no-repeat;
    transform: translateX(-50%);
  }

  body[data-view="chat"] #messages .message-avatar::after {
    display: none;
  }

  body[data-view="chat"] .conversation-head > .chat-head-overflow {
    position: relative;
    z-index: 6;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    margin-left: auto;
    overflow: visible;
  }

  body[data-view="chat"] .conversation-head > .chat-head-overflow > summary {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    list-style: none;
  }

  body[data-view="chat"] .conversation-head > .chat-head-overflow > summary::-webkit-details-marker {
    display: none;
  }

  body[data-view="chat"] .conversation-head,
  body[data-view="chat"] #messages,
  body[data-view="chat"] .composer {
    width: 100%;
    max-width: 100%;
    align-self: stretch;
  }
}

/* On wide desktop screens the navigation rail belongs to the viewport edge.
 * Keep the conversation centered in the space left by the shared 350px rail.
 * Message widths stay capped for readability while the workspace itself no
 * longer leaves a large, one-sided gutter on 1920px displays. */
@media (min-width: 1600px) {
  html body.app-active[data-view="chat"] .app-shell {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
  }

  html body[data-view="chat"] .chat-layout {
    grid-template-columns: var(--workspace-rail-width, 350px) minmax(0, 1fr);
    max-width: none;
    margin-inline: 0;
  }

  html body[data-view="chat"] .conversation-card {
    width: 100%;
    max-width: 1400px;
    justify-self: center;
    margin-inline: auto;
  }
}

@media (min-width: 1200px) {
  body[data-view="chat"] #messages {
    width: min(100%, var(--chat-transcript-max));
    max-width: var(--chat-transcript-max);
    align-self: center;
  }

  body[data-view="chat"] #messages .message-row.user,
  body[data-view="chat"] #messages .message-row.assistant {
    padding-right: 0;
    padding-left: 0;
  }
}

/* Desktop conversation polish.  Keep these rules below the alignment pass so
 * the message edges, clipped artwork and compact recipe note resolve from one
 * final set of constraints without affecting the phone composition. */
@media (min-width: 701px) {
  body[data-view="chat"] .conversation-head {
    position: relative;
    z-index: 4;
    isolation: isolate;
    overflow: visible;
    background: var(--chat-bg);
  }

  body[data-view="chat"] .conversation-head > * {
    position: relative;
    z-index: 5;
    opacity: 1;
    visibility: visible;
  }

  body[data-view="chat"] .conversation-head::after {
    content: "";
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: -18px;
    left: 0;
    height: 18px;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      var(--chat-bg) 0,
      var(--chat-bg) 55%,
      rgba(237, 242, 239, 0) 100%
    );
  }

  body[data-view="chat"] #messages {
    position: relative;
    z-index: 1;
    padding-bottom: 28px;
    scroll-padding-top: 24px;
    scroll-padding-bottom: 28px;
  }

  body[data-view="chat"] #messages .message-row:last-child {
    margin-bottom: 0;
  }

  body[data-view="chat"] #messages .message-row.user {
    box-sizing: border-box;
    padding-right: 16px;
  }

  body[data-view="chat"] #messages .message-row.user .message-stack {
    max-width: min(70%, 540px);
  }

  body[data-view="chat"] #messages .message-row.user .message-bubble {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-bottom-right-radius: 6px;
  }

  body[data-view="chat"] #messages .message-row.user .message-copy {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body[data-view="chat"] #messages .message-row.assistant {
    gap: clamp(14px, 1.5vw, 20px);
  }

  body[data-view="chat"] #messages .message-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    overflow: hidden;
    border: 5px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, #70b654, #438f35);
    box-shadow: 0 6px 17px rgba(32, 96, 43, .12);
  }

  body[data-view="chat"] #messages .message-avatar::before {
    inset: 50% auto auto 50%;
    width: 25px;
    height: 32px;
    border-radius: 0;
    background: url("/assets/icons/microphone-white.webp") center / contain no-repeat;
    filter: none;
    transform: translate(-50%, -50%);
  }

  body[data-view="chat"] .message-article-card > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="chat"] .message-article-info {
    overflow: hidden;
  }

  body[data-view="chat"] .message-article-info strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  body[data-view="chat"] .message-article-ingredients,
  body[data-view="chat"] .message-article-info .ingredients {
    min-width: 0;
    margin-top: 9px;
    margin-bottom: 10px;
  }

  body[data-view="chat"] .message-article-ingredients > span:last-child,
  body[data-view="chat"] .message-article-info .ingredients > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  body[data-view="chat"] .message-article-info b {
    width: 100%;
    flex: 0 0 46px;
    margin-top: auto;
  }
}

@media (min-width: 901px) {
  body[data-view="chat"] .message-row.assistant .message-stack:has(.message-article-card) {
    width: min(88%, 640px);
  }

  body[data-view="chat"] .message-article-card {
    width: min(100%, 528px);
    min-height: 270px;
    grid-template-columns: minmax(180px, 218px) minmax(0, 1fr);
    gap: 12px 18px;
    padding: 15px 17px 17px;
  }

  body[data-view="chat"] .message-article-image {
    height: 100%;
    min-height: 176px;
    max-height: 206px;
  }
}

/* The ingredient marker is a real, silent icon in the DOM.  Suppress the old
 * generated glyph so assistive text and visual truncation stay independent. */
body[data-view="chat"] .message-article-ingredients::before,
body[data-view="chat"] .message-article-info .ingredients::before {
  content: none;
  display: none;
}

body[data-view="chat"] .message-article-ingredients > .message-article-ingredients-icon,
body[data-view="chat"] .message-article-info .ingredients > .message-article-ingredients-icon {
  position: absolute;
  left: 0;
  top: -.1em;
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 7px;
  color: transparent;
  background: #e7f4e9 url("/assets/icons/recipe-note-black.webp") center / 13px 13px no-repeat;
  font-size: 0;
}
