/*
 * Wavy chat — full-width shell design.
 *
 * Implements the "Wavy chat – new chat (empty)" artboard: gradient panel, white rail,
 * 60px command bar, centred welcome stack and the 4-up prompt cards.
 *
 * SCOPE: every rule is gated on `.ai_modal.fullwidth-mode`. Widget mode and sidebar
 * mode share this markup, so the design-only bits (.wv-fw-*, .wv-disclaimer) stay hidden unless full width is active and the shared regions are
 * left structurally untouched.
 *
 * Loaded after global.ai.button.css / weavy.integration.css / weavy.fullwidth.css.
 */

.ai_modal {
  --wv-accent: #3366e8;
  --wv-accent-light: color-mix(in srgb, var(--wv-accent) 68%, #ffffff);
  --wv-accent-deep: #2447b8;
  --wv-primary-grad: linear-gradient(135deg, var(--wv-accent-light) 0%, var(--wv-accent) 100%);
  --wv-panel-grad: linear-gradient(135deg, #bcd7ec 0%, #e3ecf7 26%, #f2f5fb 52%, #e1e7fb 76%, #c8d3f7 100%);
  --wv-ink: #111827;
  --wv-ink-soft: #1f2937;
  --wv-muted: #6b7280;
  --wv-body: #4b5563;
  --wv-body-soft: #5b6577;
  --wv-hairline: #e9edf5;
  --wv-card-border: #e5e9f2;
  --wv-lift-sm: 0 6px 18px rgba(40, 60, 120, 0.1);
  --wv-lift-md: 0 10px 28px rgba(40, 60, 120, 0.1);
  --wv-lift-lg: 0 14px 40px rgba(40, 60, 120, 0.14);
  --wv-shadow-accent: 0 8px 20px rgba(51, 102, 232, 0.32);
}

/* design-only affordances stay off for widget + sidebar modes */
.wv-fw-ico,
.wv-fw-label,
.wv-fw-title,
.wv-disclaimer,
.wv-composer-attach,
.chip-kind {
  display: none;
}

/* ------------------------------------------------------------------ panel */

.ai_modal.fullwidth-mode {
  width: min(1872px, 98vw) !important;
  height: min(1128px, 96vh) !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.ai_modal.fullwidth-mode .ai_modal_wrapper {
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr) !important;
  grid-template-rows: 60px minmax(0, 1fr) !important;
  gap: 16px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  padding: 16px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 28px !important;
  background: var(--wv-panel-grad) !important;
  box-shadow: 0 28px 70px rgba(30, 45, 90, 0.28) !important;
  font-family: var(--gf-font);
  color: var(--wv-ink);
}

/* ---------------------------------------------------------------- sidebar */

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar {
  display: flex !important;
  grid-column: 1 !important;
  grid-row: 1 / -1 !important;
  flex-direction: column !important;
  gap: 0 !important;
  box-sizing: border-box !important;
  width: 280px !important;
  min-width: 280px !important;
  padding: 18px 14px 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  box-shadow: var(--wv-lift-md) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-header {
  margin-bottom: 14px;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 4px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-header .gradient-orb {
  box-sizing: border-box !important;
  border: 0 !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  flex: none;
  border-radius: 20px !important;
  box-shadow: 0 6px 16px rgba(51, 102, 232, 0.35) !important;
}

.ai_modal.fullwidth-mode .wv-rail-identity {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-header h2 {
  margin: 0 !important;
  font-size: var(--gf-text-rail) !important;
  font-weight: var(--gf-weight-bold) !important;
  line-height: 22px !important;
  letter-spacing: -0.01em !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .wv-rail-sub {
  font-size: var(--gf-text-body, 16px);
  line-height: 20px;
  font-weight: var(--gf-weight-normal);
  color: var(--wv-muted);
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-header .version {
  display: inline-flex !important;
  align-items: center !important;
  flex: none;
  height: 28px !important;
  padding: 0 12px !important;
  border-radius: 14px !important;
  background: #eef2ff !important;
  color: #3b4f9a !important;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-gallery-header,
.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-folder-header {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: none !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-medium) !important;
  color: var(--wv-ink-soft) !important;
  text-align: left;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-gallery-header {
  margin-bottom: 0 !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-folder-header {
  margin-top: 2px;
  margin-bottom: 0 !important;
  padding: 0 6px 0 12px !important;
}

/* placeholders are empty until JS fills them — whitespace keeps `:empty` from
   matching, so test for children instead */
.ai_modal.fullwidth-mode .sg-wavy-sidebar-gallery-empty:not(:has(*)),
.ai_modal.fullwidth-mode .folder-list-container:not(:has(*)) {
  display: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-gallery-header:hover,
.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-folder-header:hover {
  background: #f6f8fc !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-gallery-header > svg,
.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-folder-header > svg {
  width: 18px !important;
  height: 18px !important;
  flex: none;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-gallery-header > span,
.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-folder-header > span:not(.wv-rail-add) {
  flex: 1;
  min-width: 0;
}

.ai_modal.fullwidth-mode .wv-rail-add {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px !important;
  height: 28px !important;
  padding: 0;
  border-radius: 14px !important;
  background: #eef2fa !important;
  color: #374151;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-history-header {
  margin-top: 14px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px;
  min-height: 28px !important;
  padding: 0 6px 0 12px !important;
  border: 0 !important;
  background: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-history-header > span {
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--wv-muted) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-history-header button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: none !important;
  opacity: 0.4;
}

.ai_modal.fullwidth-mode .sg-wavy-sidebar-history-empty {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  text-align: center !important;
}

.ai_modal.fullwidth-mode .wv-rail-empty-art {
  width: 120px !important;
  height: 84px !important;
  flex: none;
}

.ai_modal.fullwidth-mode .wv-rail-empty-title {
  margin-top: 6px;
  font-size: var(--gf-text-body, 16px);
  font-weight: var(--gf-weight-semibold);
  color: var(--wv-ink);
}

.ai_modal.fullwidth-mode .wv-rail-empty-copy {
  font-size: var(--gf-text-body, 16px);
  line-height: 24px;
  color: var(--wv-body-soft);
}

.ai_modal.fullwidth-mode .sg-wavy-sidebar-history-empty .sg-wavy-empty-type-btn {
  display: none !important;
}

/* The tone switch and layout pickers belong to the bottom edge of the rail, not to the end of the
   history list. `margin-top: auto` pushes them down whenever the list is short, and `sticky` keeps
   them there once the list is long enough to scroll. The negative side/bottom margins cancel the
   rail's own padding so the footer reaches the rounded corner; it stays opaque so history rows
   scroll underneath it instead of showing through. */
.ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar-footer {
  margin: auto -14px -14px !important;
  position: sticky !important;
  bottom: 0 !important;
  z-index: 2 !important;
  background: #fff !important;
  border-radius: 0 0 22px 22px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  padding: 12px 14px 14px !important;
  border-top: 1px solid var(--wv-hairline) !important;
}

.ai_modal.fullwidth-mode .wv-rail-tone {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 0 4px !important;
}

.ai_modal.fullwidth-mode .wv-rail-tone-title {
  font-size: var(--gf-text-body, 16px);
  font-weight: var(--gf-weight-semibold);
  line-height: 20px;
  color: var(--wv-ink);
}

.ai_modal.fullwidth-mode .wv-rail-tone-copy {
  font-size: var(--gf-text-body, 16px);
  line-height: 22px;
  color: var(--wv-muted);
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch {
  display: block !important;
  position: relative !important;
  flex: none;
  width: 46px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 14px !important;
  background: transparent !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch input {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch .slider {
  position: absolute !important;
  inset: 0;
  box-sizing: border-box;
  border-radius: 14px !important;
  background: #c4c9d2 !important;
  transition: background 160ms ease;
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch .slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.3);
  transition: left 160ms ease;
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch input:checked + .slider {
  background: var(--wv-primary-grad) !important;
}

.ai_modal.fullwidth-mode .wv-rail-tone .wv-switch input:checked + .slider::before {
  left: 21px;
}

.ai_modal.fullwidth-mode .wv-rail-layouts {
  position: static !important;
  width: 100% !important;
  background: none !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.ai_modal.fullwidth-mode .wv-rail-layouts > li {
  /* `li.sidebar` otherwise inherits the app shell's fixed sidebar box */
  position: static !important;
  width: auto !important;
  min-width: 0 !important;
  bottom: auto !important;
  transform: none !important;
  gap: 0 !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 40px !important;
  padding: 0 !important;
  border: 1px solid var(--wv-card-border) !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  color: #374151 !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .wv-rail-layouts > li:hover {
  background: #f7f9fd !important;
}

.ai_modal.fullwidth-mode .wv-rail-layouts > li > svg {
  width: 18px !important;
  height: 18px !important;
}

/* the switcher needs the label text; the design shows the glyph only */
.ai_modal.fullwidth-mode .wv-rail-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ------------------------------------------------------------- command bar */

.ai_modal.fullwidth-mode .modal-header {
  display: flex !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-items: center !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  height: 60px !important;
  /* right padding keeps the panel's close button clear of the actions */
  padding: 0 80px 0 4px !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-header-search {
  box-sizing: border-box !important;
  padding: 0 !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  flex: none !important;
  width: 320px !important;
  max-width: 320px !important;
  height: 40px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-header-search > svg {
  position: absolute !important;
  top: 12px !important;
  left: 14px !important;
  width: 16px !important;
  height: 16px !important;
  pointer-events: none;
}

.ai_modal.fullwidth-mode .sg-wavy-header-search > input,
.ai_modal.fullwidth-mode #sgWavyConversationSearch {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 40px !important;
  padding: 0 14px 0 38px !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: var(--wv-lift-sm) !important;
  outline: none;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin-left: auto !important;
}

.ai_modal.fullwidth-mode .sg-wavy-header-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 40px !important;
  padding: 0 16px !important;
  border-radius: 20px !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-header-btn > svg:not(.wv-fw-ico) {
  display: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-header-btn > span:not(.wv-fw-label) {
  display: none !important;
}

.ai_modal.fullwidth-mode .wv-fw-ico {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}

.ai_modal.fullwidth-mode .wv-fw-label {
  display: inline;
}

.ai_modal.fullwidth-mode .wv-fw-title {
  display: block;
}

.ai_modal.fullwidth-mode .sg-wavy-share-btn {
  padding: 0 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: var(--wv-ink-soft) !important;
  box-shadow: var(--wv-lift-sm) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-new-chat-btn {
  padding: 0 18px !important;
  border: 0 !important;
  background: var(--wv-primary-grad) !important;
  color: #ffffff !important;
  box-shadow: var(--wv-shadow-accent) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-close-outside {
  position: absolute !important;
  top: 26px !important;
  right: 26px !important;
  left: auto !important;
  /* Above the sticky header. The header is z-index 100, spans the whole top of the panel and
     reserved 80px of right padding for this button — but padding does not create a hole in the
     hit area, so at a lower z-index the header swallowed every click on it and the panel's close
     control read as dead. */
  z-index: 10003 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--wv-lift-sm) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-fullwidth-close-outside > svg {
  width: 16px !important;
  height: 16px !important;
}

/* ------------------------------------------------------------ content area */

.ai_modal.fullwidth-mode .modal-content {
  display: flex !important;
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex-direction: column !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}

/* `display` is deliberately not forced here: the app shows/hides these steps with
   `.homepage-hidden` and inline styles, and a !important would pin both open. */
.ai_modal.fullwidth-mode #sgWavyModalInitial,
.ai_modal.fullwidth-mode #sgWavyModalChat {
  display: flex;
  flex: 1 !important;
  min-height: 0 !important;
  flex-direction: column !important;
  padding: 0 !important;
}

.ai_modal.fullwidth-mode #sgWavyModalInitial {
  box-sizing: border-box !important;
  position: relative;
  /* `safe` centring keeps the hero visible instead of clipping it when the
     welcome stack is taller than the panel on short screens */
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 8px 24px !important;
  overflow-y: auto;
}

/* auto margins centre the group when there is room and collapse when there is not,
   so a short panel scrolls instead of clipping the hero or stacking the footnote */
.ai_modal.fullwidth-mode #sgWavyModalInitial > .sg-wavy-initial-content {
  margin-top: auto;
}

.ai_modal.fullwidth-mode #sgWavyModalInitial > .sg-wavy-modal-overviews {
  margin-top: 30px !important;
}

.ai_modal.fullwidth-mode #sgWavyModalInitial > .wv-entry-row {
  margin-top: 30px !important;
}

.ai_modal.fullwidth-mode #sgWavyModalInitial > .wv-disclaimer {
  position: static;
  margin-top: auto;
  padding-top: 12px;
}

.ai_modal.fullwidth-mode .sg-wavy-initial-content {
  flex: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 0 !important;
  text-align: center !important;
}

/* the same animated globe the rail uses, scaled up */
.ai_modal.fullwidth-mode .sg-wavy-initial-content > .gradient-orb {
  flex: none;
  width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  margin-bottom: 6px;
  border-radius: 32px !important;
  box-shadow: 0 12px 28px rgba(51, 102, 232, 0.4) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-initial-content .greeting {
  margin: 0 !important;
  font-size: var(--gf-text-hero) !important;
  line-height: 40px !important;
  font-weight: var(--gf-weight-bold) !important;
  letter-spacing: -0.02em !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-initial-content .question {
  margin: -10px 0 0 !important;
  font-size: var(--gf-text-hero) !important;
  line-height: 40px !important;
  font-weight: var(--gf-weight-bold) !important;
  letter-spacing: -0.02em !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-initial-content .question .highlight {
  background: linear-gradient(90deg, var(--wv-accent-light) 0%, var(--wv-accent) 60%, var(--wv-accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}

/* prompt cards — icon + title share a <h3> in the shared markup, so
   `display: contents` promotes them into this grid without touching the DOM */
.ai_modal.fullwidth-mode .sg-wavy-modal-overviews {
  flex: none !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 14px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* full width lays the prompts out two-up; the widget keeps them stacked */
.ai_modal.fullwidth-mode .sg-wavy-modal-overviews {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas:
    "icon title"
    "icon body";
  column-gap: 14px !important;
  row-gap: 0;
  align-items: start;
  box-sizing: border-box !important;
  min-height: 112px;
  padding: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.78) !important;
  box-shadow: var(--wv-lift-md) !important;
  cursor: pointer;
  text-align: left !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item:hover,
.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item.is-picked {
  border: 1.5px solid var(--wv-accent) !important;
  background: linear-gradient(135deg, #eaf0ff 0%, #dde7ff 100%) !important;
  box-shadow: 0 12px 30px rgba(51, 102, 232, 0.2) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 {
  display: contents !important;
  margin: 0 !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 > svg {
  display: block !important;
  grid-area: icon;
  box-sizing: border-box !important;
  width: 40px !important;
  height: 40px !important;
  padding: 10px !important;
  border-radius: 20px !important;
  background: var(--wv-primary-grad) !important;
  box-shadow: 0 6px 14px rgba(51, 102, 232, 0.3) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 > svg [stroke] {
  stroke: #ffffff !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 > svg [fill]:not([fill="none"]) {
  fill: #ffffff !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 > span:not(.wv-fw-title) {
  display: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > h3 > .wv-fw-title {
  display: block;
  grid-area: title;
  font-size: var(--gf-text-body) !important;
  line-height: 22px !important;
  font-weight: var(--gf-weight-semibold) !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-modal-overview-item > p {
  grid-area: body;
  margin: 4px 0 0 !important;
  font-size: var(--gf-text-body, 16px) !important;
  line-height: 24px !important;
  color: var(--wv-body) !important;
}

/* entry pills */
.ai_modal_wrapper .wv-entry-row {
  display: flex !important;
  flex: none !important;
  /* sidebar mode stacks this row by default; the design keeps the two pills side by side */
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.ai_modal_wrapper .wv-entry-row > button {
  flex: 1 1 0 !important;
  max-width: 280px !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  width: auto !important;
  height: 52px !important;
  padding: 0 18px !important;
  border-radius: 26px !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  cursor: pointer;
}

.ai_modal_wrapper .wv-entry-row > button > svg {
  width: 18px !important;
  height: 18px !important;
  flex: none;
}

.ai_modal_wrapper .wv-entry-row > button > svg:not(.wv-fw-ico) {
  display: none !important;
}

.ai_modal_wrapper .wv-entry-row > button > .wv-fw-ico {
  display: block !important;
}

.ai_modal_wrapper .wv-entry-row > button.type-btn {
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--wv-ink-soft) !important;
  box-shadow: 0 10px 28px rgba(40, 60, 120, 0.12) !important;
}

.ai_modal_wrapper .wv-entry-row > button.speak-btn {
  position: relative;
  border: 0 !important;
  background: var(--wv-primary-grad) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(51, 102, 232, 0.38) !important;
}

.ai_modal_wrapper .wv-entry-row > button.speak-btn > svg [fill]:not([fill="none"]) {
  fill: #ffffff !important;
}

.ai_modal_wrapper .wv-entry-row > button.speak-btn > svg [stroke] {
  stroke: #ffffff !important;
}

/* --------------------------------------------------------------- composer */

.ai_modal.fullwidth-mode .sg-wavy-textarea-container {
  box-sizing: border-box !important;
  min-height: 64px !important;
  width: 100% !important;
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: 10px 10px 10px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  border-radius: 28px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 249, 255, 0.84) 100%) !important;
  box-shadow: var(--wv-lift-lg) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row textarea,
.ai_modal.fullwidth-mode #sgWavyTextarea {
  order: 2;
  flex: 1 !important;
  min-width: 0;
  /* height stays writable — the composer grows the textarea as the text wraps */
  height: 24px;
  min-height: 24px !important;
  max-height: 168px !important;
  padding: 8px 0 !important;
  border: 0 !important;
  background: none !important;
  outline: none;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  line-height: 24px !important;
  color: var(--wv-ink) !important;
  resize: none;
}

/* the legacy "expanded" variant pads the composer out; keep the pill shape */
.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded {
  min-height: 64px !important;
  padding: 10px 10px 10px 12px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded textarea,
.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded #sgWavyTextarea {
  min-height: 24px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded .wavy_text_send_btn,
.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded #sgWavySendBtn {
  width: 44px !important;
  height: 44px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-container.expanded .sg-wavy-textarea-icon {
  width: 40px !important;
  height: 40px !important;
}

/* the AI-tools "+" the composer already ships with, dressed as the design's attach pill */
.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-tools-plus-btn {
  order: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: var(--wv-primary-grad) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(51, 102, 232, 0.3) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-tools-plus-btn > svg {
  width: 18px !important;
  height: 18px !important;
  stroke: #ffffff !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-textarea-icon {
  order: 3;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: none !important;
  color: var(--wv-body) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-textarea-icon > svg {
  width: 18px !important;
  height: 18px !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-textarea-icon > svg:not(.wv-fw-ico) {
  display: none !important;
}

.ai_modal.fullwidth-mode .sg-wavy-textarea-input-row .sg-wavy-textarea-icon > .wv-fw-ico {
  display: block !important;
}

.ai_modal.fullwidth-mode .wavy_text_send_btn,
.ai_modal.fullwidth-mode #sgWavySendBtn {
  order: 4;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: #e3e6ec !important;
  color: #9aa1ae !important;
  cursor: not-allowed;
}

/* the composer has no "has text" class, so read the textarea state directly */
.ai_modal.fullwidth-mode .sg-wavy-textarea-container:has(#sgWavyTextarea:not(:placeholder-shown))
  .wavy_text_send_btn,
.ai_modal.fullwidth-mode .sg-wavy-textarea-container:has(#sgWavyTextarea:not(:placeholder-shown))
  #sgWavySendBtn,
.ai_modal.fullwidth-mode .wavy_text_send_btn[data-wavy-stop="true"],
.ai_modal.fullwidth-mode #sgWavySendBtn[data-wavy-stop="true"],
.ai_modal.fullwidth-mode .wavy_text_send_btn.is-ready,
.ai_modal.fullwidth-mode #sgWavySendBtn.is-ready {
  background: var(--wv-primary-grad) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(51, 102, 232, 0.35) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .wavy_text_send_btn > svg,
.ai_modal.fullwidth-mode #sgWavySendBtn > svg {
  width: 18px !important;
  height: 18px !important;
}

.ai_modal.fullwidth-mode .wv-disclaimer {
  display: block;
  flex: none;
  padding: 0 0 6px;
  text-align: center;
  font-size: var(--gf-text-body, 16px);
  color: var(--wv-body-soft);
}


/* ------------------------------------------------------------------ gallery */

/* the gallery replaces the welcome/chat area instead of stacking over it */
.ai_modal.fullwidth-mode.gallery-active .modal-content {
  display: none !important;
}

.ai_modal.fullwidth-mode #galleryContent,
.ai_modal.fullwidth-mode.gallery-active #galleryContent {
  grid-column: 2 !important;
  grid-row: 2 !important;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 4px 8px !important;
  overflow-y: auto;
}

.ai_modal.fullwidth-mode .gallery-header[data-grid-lifted] {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 60px !important;
  min-height: 60px !important;
  /* right gutter keeps the panel's close button clear of the search pill */
  padding: 0 80px 0 4px !important;
  margin: 0 !important;
}

.ai_modal.fullwidth-mode .gallery-header > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 1 auto !important;
  min-width: 0;
}

.ai_modal.fullwidth-mode .gallery-back-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 40px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: var(--wv-lift-sm) !important;
  color: var(--wv-ink-soft) !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .gallery-back-btn > svg {
  width: 16px !important;
  height: 16px !important;
}

.ai_modal.fullwidth-mode .gallery-header h2 {
  margin: 0 !important;
  font-size: var(--gf-text-card, 20px) !important;
  font-weight: var(--gf-weight-bold) !important;
  letter-spacing: -0.01em !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .gallery-search,
.ai_modal.fullwidth-mode .gallery-header[data-grid-lifted] .gallery-search {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
  box-sizing: border-box !important;
  width: 320px !important;
  min-width: 320px !important;
  height: 40px !important;
  padding: 0 14px !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: var(--wv-lift-sm) !important;
  margin-left: auto !important;
  margin-right: 0 !important;
}

.ai_modal.fullwidth-mode .gallery-search > svg {
  width: 16px !important;
  height: 16px !important;
  flex: none;
}

.ai_modal.fullwidth-mode .gallery-search input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  padding: 4px 0 0 !important;
}

.ai_modal.fullwidth-mode .gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--wv-lift-md);
  aspect-ratio: 1 / 1;
}

.ai_modal.fullwidth-mode .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  padding: 24px !important;
  text-align: center;
  font-size: var(--gf-text-body, 16px) !important;
  color: var(--wv-body-soft) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state > .gradient-orb {
  width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  margin-bottom: 6px;
  border-radius: 32px !important;
  box-shadow: 0 12px 28px rgba(51, 102, 232, 0.4) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state > p {
  margin: 0 !important;
  font-size: var(--gf-text-card, 20px) !important;
  line-height: 28px !important;
  font-weight: var(--gf-weight-bold) !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state > h3 {
  margin: 0 !important;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  color: var(--wv-ink) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state > span {
  font-size: var(--gf-text-body, 16px) !important;
  line-height: 24px !important;
  color: var(--wv-body-soft) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state .sg-wavy-empty-btns {
  display: flex !important;
  gap: 12px !important;
  margin-top: 8px;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state .sg-wavy-empty-btns > button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  width: 240px !important;
  height: 52px !important;
  padding: 0 !important;
  border-radius: 26px !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state .sg-wavy-empty-type-btn {
  border: 1px solid rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--wv-ink-soft) !important;
  box-shadow: 0 10px 28px rgba(40, 60, 120, 0.12) !important;
}

.ai_modal.fullwidth-mode .sg-wavy-gallery-empty-state .sg-wavy-empty-speak-btn {
  border: 0 !important;
  background: var(--wv-primary-grad) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(51, 102, 232, 0.38) !important;
}


/* ------------------------------------------------------------ conversation */

/* the title replaces the command bar's search; search slides right of it */
.wv-conv-title,
.wv-rail-new-chat {
  display: none;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  order: 1;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-title-text {
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--gf-text-card, 20px);
  font-weight: var(--gf-weight-bold);
  letter-spacing: -0.01em;
  color: var(--wv-ink);
}

/* the title turns into this field while it is being renamed — same type as the title,
   which the script copies inline, so only the shell is styled here */
.ai_modal.fullwidth-mode.wv-conversation .wv-conv-title-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  margin: -4px 0;
  padding: 0 16px;
  border: 1px solid var(--wv-accent);
  border-radius: 999px;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(51, 102, 232, 0.16);
  font-family: inherit;
  font-size: var(--gf-text-card, 20px);
  font-weight: var(--gf-weight-bold);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--wv-ink);
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-title-input::placeholder {
  color: var(--wv-muted);
  font-weight: var(--gf-weight-semibold);
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  color: #4b5563;
  cursor: pointer;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-edit:hover {
  background: #f2f5fb;
}

/* the pencil becomes a tick while the field is open: it settles the rename */
.ai_modal.fullwidth-mode.wv-conversation .wv-conv-edit.is-editing {
  color: var(--wv-accent);
  background: #eef3ff;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-conv-edit.is-editing svg {
  width: 16px;
  height: 16px;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-header-search {
  order: 2;
  width: 260px !important;
  max-width: 260px !important;
  margin-left: auto;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-header-actions {
  order: 3;
}

/* new chat is a rail pill once a conversation is open */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-header-actions .sg-wavy-new-chat-btn {
  display: none !important;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-rail-new-chat {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  height: 44px !important;
  margin-top: 14px !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 22px !important;
  background: var(--wv-primary-grad) !important;
  box-shadow: var(--wv-shadow-accent) !important;
  color: #ffffff !important;
  font-family: inherit;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold) !important;
  cursor: pointer;
}

.ai_modal.fullwidth-mode.wv-conversation .wv-rail-new-chat > svg {
  width: 16px !important;
  height: 16px !important;
  flex: none;
}

/* messages: a centred 760 column, not the full width of the pane */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 8px 24px 8px !important;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message {
  box-sizing: border-box;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  gap: 10px;
  align-items: flex-start;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.ai {
  flex-direction: row;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.user {
  flex-direction: row-reverse;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message-content {
  max-width: calc(100% - 46px);
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.user .sg-wavy-chat-message-content {
  align-items: flex-end;
}

/* the same globe the rail uses, at message size */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-avatar {
  width: 32px !important;
  height: 32px !important;
  margin-top: 2px;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-avatar.ai {
  background: none !important;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-avatar.ai .gradient-orb {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
}

/* wavy's turns read on white; the tail corner stays soft rather than sharp */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.ai .sg-wavy-chat-bubble {
  padding: 13px 18px !important;
  border-radius: 20px !important;
  border-top-left-radius: 8px !important;
  background: #ffffff !important;
  color: var(--wv-ink) !important;
  box-shadow: 0 6px 18px rgba(40, 60, 120, 0.08) !important;
  font-size: var(--gf-text-body, 16px);
  line-height: 24px;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.user .sg-wavy-chat-bubble {
  padding: 11px 18px !important;
  border-radius: 22px !important;
  border-bottom-right-radius: 8px !important;
  background: #323d55 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 22px rgba(30, 45, 90, 0.18) !important;
  font-size: var(--gf-text-body, 16px);
  line-height: 24px;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-bubble.thinking {
  border-radius: 20px !important;
  border-top-left-radius: 8px !important;
  background: #ffffff !important;
}

/* the reasoning card is its own surface: no second bubble around it */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-bubble[data-reasoning="true"] {
  width: 100%;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-meta {
  margin-top: 2px;
  padding: 0 !important;
  font-size: var(--gf-text-body, 16px);
  line-height: 22px;
  color: var(--wv-body-soft);
  text-align: left;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.user .sg-wavy-chat-meta {
  text-align: right;
}


/* message action row — crisp, evenly weighted glyphs */
.ai_modal .sg-wavy-chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ai_modal .sg-wavy-chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  color: #4b5563;
  opacity: 1;
}

.ai_modal .sg-wavy-chat-action-btn > svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.7;
}

.ai_modal .sg-wavy-chat-action-btn:hover {
  background: rgba(17, 24, 39, 0.06);
  color: #111827;
}

.ai_modal .sg-wavy-chat-action-btn.liked {
  color: #059669;
}

.ai_modal .sg-wavy-chat-action-btn.disliked {
  color: #dc2626;
}

.ai_modal .sg-wavy-chat-action-btn.liked > svg,
.ai_modal .sg-wavy-chat-action-btn.disliked > svg {
  stroke-width: 2;
}

.ai_modal .sg-wavy-chat-action-btn.copied {
  color: #059669;
}

.ai_modal .sg-wavy-chat-action-btn.copied > svg {
  stroke-width: 2.3;
}

/* on a white answer card the row needs a slightly stronger base tone — but never
   over the state colours below */
.ai_modal.fullwidth-mode.wv-conversation
  .sg-wavy-chat-message.ai
  .sg-wavy-chat-action-btn:not(.liked):not(.disliked):not(.copied) {
  color: #475467;
}


/* the meta row belongs beside the actions, not on its own centred line */
.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message-content > .sg-wavy-chat-meta {
  align-self: flex-start;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-message.user .sg-wavy-chat-message-content > .sg-wavy-chat-meta {
  align-self: flex-end;
}

.ai_modal.fullwidth-mode.wv-conversation .sg-wavy-chat-actions {
  gap: 4px;
  padding: 0;
}

.ai_modal.fullwidth-mode .sg-wavy-chat-messages {
  flex: 1 !important;
  min-height: 0 !important;
  padding: 0 24px 8px !important;
  overflow-y: auto;
}

.ai_modal.fullwidth-mode #sgWavyModalChat > .sg-wavy-chat-header {
  gap: 14px !important;
  padding: 0 24px 12px !important;
}

.ai_modal.fullwidth-mode #sgWavyModalChat > .sg-wavy-chat-header .gradient-orb {
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 17px !important;
  box-shadow: 0 8px 20px rgba(51, 102, 232, 0.32) !important;
}

.ai_modal.fullwidth-mode #sgWavyModalChat > .sg-wavy-chat-header .question {
  margin: 0 !important;
  font-size: var(--gf-text-header) !important;
  line-height: 26px !important;
  font-weight: var(--gf-weight-bold) !important;
  letter-spacing: -0.01em !important;
}

.ai_modal.fullwidth-mode #sgWavyModalChat > .sg-wavy-textarea-container {
  margin-bottom: 8px !important;
}


/* attachment cards inside the composer */
.ai_modal.fullwidth-mode .sg-wavy-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px !important;
  padding: 0 !important;
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
  min-height: 52px;
  padding: 6px 8px 6px 6px !important;
  border: 1px solid rgba(51, 102, 232, 0.14) !important;
  border-radius: 14px !important;
  background: #f1f4fe !important;
  font-family: inherit;
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-thumb,
.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  object-fit: cover;
  font-size: var(--gf-text-header);
  line-height: 1;
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 210px;
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-name {
  max-width: 210px !important;
  font-size: var(--gf-text-body, 16px) !important;
  font-weight: var(--gf-weight-semibold);
  line-height: 20px !important;
  color: var(--wv-ink) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-kind {
  display: block;
  font-size: var(--gf-text-body, 16px);
  line-height: 18px;
  color: var(--wv-muted);
}

.ai_modal.fullwidth-mode .sg-wavy-chips-container .sg-wavy-upload-chip .chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  margin-left: 2px;
  border-radius: 50%;
  background: #ffffff;
  color: #4b5563;
  font-size: var(--gf-text-body);
  line-height: 1;
  cursor: pointer;
}

/* chips sit right above the text instead of floating away from it */
.ai_modal.fullwidth-mode .sg-wavy-chips-container {
  margin-bottom: 6px !important;
  padding: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .ai_modal.fullwidth-mode .wv-rail-tone .wv-switch .slider,
  .ai_modal.fullwidth-mode .wv-rail-tone .wv-switch .slider::before {
    animation: none !important;
    transition: none !important;
  }
}

/* ----------------------------------------------------------- small screens */

@media (max-width: 1180px) {
  .ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar {
    width: 248px !important;
    min-width: 248px !important;
  }

  .ai_modal.fullwidth-mode .sg-wavy-header-search {
    width: 240px !important;
    max-width: 240px !important;
  }

}

@media (max-width: 980px) {
  .ai_modal.fullwidth-mode .ai_modal_wrapper {
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
  }

  .ai_modal.fullwidth-mode .sg-wavy-fullwidth-sidebar {
    display: none !important;
  }

  .ai_modal_wrapper .sg-wavy-modal-overviews {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .ai_modal.fullwidth-mode .wv-entry-row {
    max-width: 420px !important;
  }

  .ai_modal.fullwidth-mode .sg-wavy-initial-content .greeting,
  .ai_modal.fullwidth-mode .sg-wavy-initial-content .question {
    font-size: var(--gf-text-heading) !important;
    line-height: 34px !important;
  }

  .ai_modal.fullwidth-mode .sg-wavy-header-search {
    width: 100% !important;
    max-width: none !important;
  }
}
