/**
 * Design Studio chrome — layout + component rules.
 *
 * Tokens live in manual-tokens.css (load before this file).
 * Scope: fullscreen workbench marked with [data-studio-chrome="1"].
 */

:root {
  --studio-chrome-h: 44px;
  --studio-chrome-max: 920px;
  --studio-chrome-inset: 12px;
  --studio-chrome-gap: 6px;
  --studio-chrome-hit: 28px;
  --studio-chrome-icon: 15px;
  --studio-chrome-radius: 999px;
  --studio-chrome-z: 100420;
  --studio-menu-z: 100530;
}

/* -------------------------------------------------------------------------- */
/* Host: canvas stays full-bleed; chrome floats over it                       */
/* -------------------------------------------------------------------------- */

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen {
  position: relative !important;
  overflow: hidden !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen
  > .chat-prototype-visual-pane:not(.hidden),
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen
  > .chat-prototype-code-pane:not(.hidden) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

/* -------------------------------------------------------------------------- */
/* Toolbar shell                                                              */
/* -------------------------------------------------------------------------- */

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen
  > .chat-prototype-workbench-head {
  position: absolute !important;
  top: var(--studio-chrome-inset) !important;
  /* Content-sized + margin auto. Fixed 920px + absolute center left a dead gap. */
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  z-index: var(--studio-chrome-z) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: max-content !important;
  max-width: calc(100% - (2 * var(--studio-chrome-inset))) !important;
  height: var(--studio-chrome-h) !important;
  min-height: var(--studio-chrome-h) !important;
  max-height: var(--studio-chrome-h) !important;
  margin: 0 auto !important;
  margin-inline: auto !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
  flex: none !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: var(--studio-chrome-radius) !important;
  background-color: rgba(10, 12, 16, 0.82) !important;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 40%, transparent 70%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.05)) !important;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(32px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.5) !important;
  color: var(--studio-chrome-ink) !important;
  transform: none !important;
  overflow: visible !important;
  isolation: isolate !important;
}

/* Beat #chat-root theme rules that still set asymmetric head grids */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen
  > .chat-prototype-workbench-head {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  gap: 8px !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(button, span, strong, small, em, label, p, li, div) {
  color: inherit;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-mode-tab.is-active,
    .chat-prototype-device-tab.is-active,
    .chat-prototype-workbench-insert-btn.is-open,
    .chat-prototype-workbench-apply,
    .chat-prototype-seo-autofix,
    [aria-expanded="true"]:not(.chat-prototype-seo-score):not(.chat-prototype-workbench-settings)
  ) {
  color: var(--studio-chrome-accent) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(.chat-prototype-workbench-apply, .chat-prototype-seo-autofix) {
  color: var(--studio-chrome-accent-ink) !important;
}

/* Auto-hide: fully gone until pointer is in the top zone (JS toggles revealed) */
@media (hover: hover) and (pointer: fine) {
  .chat-media.chat-media--block-draft-fullscreen
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-prototype-fullscreen
    > .chat-prototype-workbench-head {
    opacity: 0 !important;
    pointer-events: none !important;
    top: calc(var(--studio-chrome-inset) - 8px) !important;
    transform: none !important;
    transition: opacity 0.16s ease, top 0.2s ease !important;
  }

  .chat-media.chat-media--block-draft-fullscreen
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-toolbar-revealed.is-prototype-fullscreen
    > .chat-prototype-workbench-head,
  .chat-media.chat-media--block-draft-fullscreen
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-prototype-fullscreen
    > .chat-prototype-workbench-head:focus-within {
    opacity: 1 !important;
    pointer-events: auto !important;
    top: var(--studio-chrome-inset) !important;
    transform: none !important;
  }
}

/* -------------------------------------------------------------------------- */
/* Groups: kill boxed “inline bars” from legacy theme                         */
/* -------------------------------------------------------------------------- */

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-mode-tools,
    .chat-prototype-mode-toggle,
    .chat-prototype-device-tabs,
    .chat-prototype-workbench-insert,
    .chat-prototype-view-controls,
    .chat-prototype-workbench-head-center,
    .chat-prototype-insert-menu,
    .chat-prototype-template-menu
  ) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-workbench-head-center {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  align-self: center !important;
  flex: 0 0 auto !important;
  gap: 0 !important;
  height: var(--studio-chrome-hit) !important;
  min-height: var(--studio-chrome-hit) !important;
  max-height: var(--studio-chrome-hit) !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: auto !important;
  pointer-events: auto !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-mode-tools {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  justify-content: flex-start !important;
  align-items: center !important;
  align-self: center !important;
  height: var(--studio-chrome-hit) !important;
  grid-area: auto !important;
  gap: 2px !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 8px 0 0 !important;
  border: 0 !important;
  border-right: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  z-index: auto !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-mode-toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  height: var(--studio-chrome-hit) !important;
  min-height: var(--studio-chrome-hit) !important;
  max-height: var(--studio-chrome-hit) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  grid-area: auto !important;
  grid-column: auto !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  margin-left: 0 !important;
  padding: 0 0 0 8px !important;
  justify-content: flex-end !important;
  align-items: center !important;
  align-self: center !important;
  height: var(--studio-chrome-hit) !important;
  gap: 3px !important;
  border: 0 !important;
  border-left: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  z-index: auto !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-device-tabs {
  gap: 1px !important;
  padding: 0 8px 0 0 !important;
  margin: 0 !important;
  height: var(--studio-chrome-hit) !important;
  border: 0 !important;
  border-right: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-workbench-insert {
  gap: 1px !important;
  padding: 0 2px 0 8px !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-template-menu {
  padding-left: 2px !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls {
  justify-content: flex-end !important;
  gap: 3px !important;
  position: relative !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(.chat-prototype-insert-menu, .chat-prototype-workbench-insert) {
  position: relative !important;
}

/* Never let chrome resets override utility hide */
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .hidden {
  display: none !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-mode-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* -------------------------------------------------------------------------- */
/* Icon chips                                                                 */
/* -------------------------------------------------------------------------- */

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-mode-tab,
    .chat-prototype-device-tab,
    .chat-prototype-workbench-insert-btn,
    .chat-prototype-workbench-settings,
    .chat-prototype-close-btn
  ) {
  display: inline-grid !important;
  place-items: center !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  background-image: none !important;
  color: #e6ecf2 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background 0.14s ease, color 0.14s ease !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-mode-tab:hover,
    .chat-prototype-device-tab:hover,
    .chat-prototype-workbench-insert-btn:hover,
    .chat-prototype-workbench-settings:hover,
    .chat-prototype-close-btn:hover
  ) {
  background: var(--studio-chrome-hover) !important;
  color: var(--studio-chrome-ink) !important;
  box-shadow: none !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-mode-tab.is-active,
    .chat-prototype-device-tab.is-active,
    .chat-prototype-workbench-insert-btn.is-open,
    [aria-expanded="true"]:not(.chat-prototype-seo-score):not(.chat-prototype-workbench-settings)
  ) {
  background: var(--studio-chrome-active-bg) !important;
  color: var(--studio-chrome-accent) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--studio-chrome-accent) 55%, transparent) !important;
  outline: 0 !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-device-icon,
    .chat-prototype-workbench-insert-btn svg,
    .chat-prototype-workbench-settings svg,
    .chat-prototype-device-tab svg,
    .chat-prototype-settings-icon,
    .chat-prototype-target-icon,
    .studio-icon
  ) {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: block !important;
  margin: 0 !important;
  color: inherit !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: 1 !important;
  overflow: visible !important;
  vector-effect: non-scaling-stroke;
}

/* Beat legacy #chat-root 0.68×0.5rem crush on Lucide device glyphs */
:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-device-tab
  :is(svg, .chat-prototype-device-icon, .studio-icon) {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  opacity: 1 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-device-tab
  :is(svg, .chat-prototype-device-icon, .studio-icon)
  :is(path, rect, circle, line, polyline, polygon) {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  opacity: 1 !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-mode-icon {
  width: 15px !important;
  height: 15px !important;
  display: block !important;
  margin: 0 !important;
  background-color: currentColor !important;
  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;
  -webkit-mask-position: center !important;
  mask-position: center !important;
  -webkit-mask-size: contain !important;
  mask-size: contain !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-workbench-insert-btn svg,
    .chat-prototype-device-tab svg,
    .studio-icon
  )
  :is(path, rect, circle, line, polyline, polygon) {
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.5 !important;
}

/* -------------------------------------------------------------------------- */
/* SEO + CTA pills                                                            */
/* -------------------------------------------------------------------------- */

/*
 * Theme-final uses :is(#chat-root, …) which always counts as #id specificity.
 * Mirror that prefix here so Design Studio chrome actually wins.
 */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Quiet status chip: label + score, status lives in the number only */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score[data-prototype-seo-score] {
  --studio-seo-ink: var(--studio-seo-good);
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--studio-chrome-hit) !important;
  min-height: var(--studio-chrome-hit) !important;
  max-height: var(--studio-chrome-hit) !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 1px solid var(--studio-chrome-glass-edge) !important;
  border-radius: 999px !important;
  background: var(--studio-chrome-row) !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--studio-seo-ink) !important;
  font: 500 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score.is-warning {
  --studio-seo-ink: var(--studio-seo-warn);
  border-color: var(--studio-chrome-glass-edge) !important;
  background: var(--studio-chrome-row) !important;
  box-shadow: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score.is-low {
  --studio-seo-ink: var(--studio-seo-bad);
  border-color: var(--studio-chrome-glass-edge) !important;
  background: var(--studio-chrome-row) !important;
  box-shadow: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score[data-prototype-seo-score]:is(:hover, :focus-visible, [aria-expanded="true"]) {
  border-color: color-mix(in srgb, var(--studio-chrome-accent) 35%, var(--studio-chrome-glass-edge)) !important;
  background: var(--studio-chrome-hover) !important;
  outline: 0 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score[data-prototype-seo-score]
  > span {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--studio-chrome-ink-soft) !important;
  font: 600 8px/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-seo-score[data-prototype-seo-score]
  > strong {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--studio-seo-ink) !important;
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: -0.02em !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(.chat-prototype-workbench-target, .chat-prototype-workbench-apply) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 10px !important;
  border: 1px solid color-mix(in srgb, var(--studio-chrome-accent) 42%, transparent) !important;
  border-radius: 8px !important;
  background: var(--studio-chrome-accent-soft) !important;
  color: var(--studio-chrome-accent) !important;
  box-shadow: none !important;
  font: 650 9px/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

/* Insert target: keep the download glyph readable (never solid neon plate) */
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target {
  flex: 0 0 auto !important;
  gap: 0 !important;
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--studio-chrome-ink) !important;
  box-shadow: none !important;
  font-size: 0 !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target:hover,
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target:focus-visible {
  border-color: color-mix(in srgb, var(--studio-chrome-accent) 40%, transparent) !important;
  background: var(--studio-chrome-hover) !important;
  color: var(--studio-chrome-accent) !important;
  box-shadow: none !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target.is-needs-target {
  border-style: dashed !important;
  border-color: color-mix(in srgb, var(--studio-chrome-accent) 55%, transparent) !important;
  background: var(--studio-chrome-accent-soft) !important;
  color: var(--studio-chrome-accent) !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target.is-active,
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target.is-needs-target.is-active {
  border-style: solid !important;
  border-color: var(--studio-chrome-accent) !important;
  background: var(--studio-chrome-accent-soft) !important;
  color: var(--studio-chrome-accent) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--studio-chrome-accent) 18%, transparent) !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target.is-ready {
  border-style: solid !important;
  border-color: color-mix(in srgb, var(--studio-seo-good) 55%, transparent) !important;
  background: var(--studio-seo-mark-good-bg) !important;
  color: var(--studio-seo-good) !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target
  .chat-prototype-target-icon {
  display: block !important;
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
  opacity: 1 !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.75 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  color: inherit !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-view-controls
  > button.chat-prototype-workbench-target
  .chat-prototype-workbench-target-label {
  /* Icon-only in the compact toolbar; label stays for a11y via aria-label. */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(.chat-prototype-workbench-target-label, .chat-prototype-workbench-apply-label) {
  font-size: 9px !important;
  line-height: 1 !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-close-icon {
  font: 500 18px/1 "Work Sans", sans-serif !important;
  color: inherit !important;
}

/* -------------------------------------------------------------------------- */
/* Overlay menus (drop from toolbar, never push canvas)                       */
/* -------------------------------------------------------------------------- */

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-seo-popover,
    .chat-prototype-insert-dropdown,
    .chat-prototype-template-dropdown
  ),
/* Portaled insert menus live on document.body (Icons / Images / Text / Shape). */
html body > .chat-prototype-insert-dropdown.is-overlay,
html body > .chat-prototype-insert-dropdown[data-pf-portaled="1"] {
  z-index: var(--studio-menu-z) !important;
  border: 1px solid var(--studio-chrome-glass-edge) !important;
  border-radius: 14px !important;
  background: var(--studio-chrome-panel) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(22px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.35) !important;
  transform-origin: top right !important;
  color: var(--studio-chrome-ink) !important;
}

html body > .chat-prototype-insert-dropdown.is-overlay,
html body > .chat-prototype-insert-dropdown[data-pf-portaled="1"] {
  position: fixed !important;
  display: flex !important;
  flex-direction: column !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 100520 !important;
}

/* SEO readiness panel */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-seo-popover {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto !important;
  gap: 12px !important;
  width: min(340px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 520px) !important;
  margin: 0 !important;
  padding: 14px !important;
  overflow: hidden !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  .chat-prototype-seo-popover.hidden {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  min-width: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-title {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-title > strong {
  display: block !important;
  margin: 0 !important;
  color: var(--studio-chrome-ink) !important;
  font: 650 13px/1.15 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-title > small {
  display: block !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 11px/1.3 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-scorewrap {
  display: grid !important;
  justify-items: end !important;
  gap: 0 !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-scorewrap > strong {
  color: var(--studio-seo-bad) !important;
  font: 650 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: -0.04em !important;
  font-variant-numeric: tabular-nums !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover.is-warning
  .chat-prototype-seo-popover-scorewrap > strong {
  color: var(--studio-seo-warn) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover.is-good
  .chat-prototype-seo-popover-scorewrap > strong,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover:not(.is-low):not(.is-warning)
  .chat-prototype-seo-popover-scorewrap > strong {
  color: var(--studio-seo-good) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-scorewrap > span {
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  letter-spacing: 0.04em !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-meter {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 4px !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: var(--studio-chrome-row-edge) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-meter > span {
  display: block !important;
  width: calc(var(--seo-score, 0) * 1%) !important;
  height: 100% !important;
  border-radius: inherit !important;
  background: linear-gradient(90deg, var(--studio-seo-bad), var(--studio-seo-warn) 55%, var(--studio-seo-good)) !important;
  transition: width 0.2s ease !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-lede {
  margin: 0 !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 11px/1.4 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist {
  display: grid !important;
  grid-auto-rows: max-content !important;
  align-content: start !important;
  align-items: stretch !important;
  gap: 6px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 2px 0 0 !important;
  overflow: auto !important;
  list-style: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-group {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin: 8px 0 0 !important;
  padding: 0 2px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 650 9px/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-group:first-child {
  margin-top: 0 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-group > em {
  font: 600 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-style: normal !important;
  opacity: 0.8 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li:not(.is-group) {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  grid-auto-flow: column !important;
  gap: 8px !important;
  align-items: start !important;
  margin: 0 !important;
  padding: 9px 10px !important;
  border: 1px solid var(--studio-chrome-row-edge) !important;
  border-radius: 10px !important;
  background: var(--studio-chrome-row) !important;
  position: static !important;
  height: auto !important;
  min-height: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
  box-sizing: border-box !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-tip {
  border-color: color-mix(in srgb, var(--studio-seo-warn) 35%, transparent) !important;
  background: var(--studio-chrome-row-tip) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-pass {
  opacity: 0.78 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li:not(.is-group) > .chat-prototype-seo-mark,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-mark {
  display: grid !important;
  place-items: center !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 18px !important;
  height: 18px !important;
  margin: 1px 0 0 !important;
  border-radius: 999px !important;
  background: var(--studio-seo-mark-warn-bg, rgba(232, 184, 106, 0.16)) !important;
  color: var(--studio-seo-warn) !important;
  font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  position: static !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-checklist > li.is-pass .chat-prototype-seo-mark {
  background: var(--studio-seo-mark-good-bg, rgba(125, 222, 168, 0.14)) !important;
  color: var(--studio-seo-good) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-check-copy {
  display: grid !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  gap: 3px !important;
  min-width: 0 !important;
  position: static !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-check-copy > strong {
  display: block !important;
  margin: 0 !important;
  color: var(--studio-chrome-ink) !important;
  font: 600 12px/1.3 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-check-copy > small {
  display: block !important;
  margin: 0 !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 11px/1.4 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  white-space: normal !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-popover-foot {
  display: grid !important;
  gap: 8px !important;
  margin: 0 !important;
  padding-top: 8px !important;
  border-top: 1px solid var(--studio-chrome-row-edge) !important;
  position: static !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-autofix {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  width: 100% !important;
  min-height: 34px !important;
  height: auto !important;
  padding: 0 12px !important;
  border: 1px solid color-mix(in srgb, var(--studio-chrome-accent) 50%, transparent) !important;
  border-radius: 999px !important;
  background: var(--studio-chrome-accent-soft) !important;
  color: var(--studio-chrome-accent-ink) !important;
  box-shadow: none !important;
  font: 600 11px/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: normal !important;
  cursor: pointer !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-autofix.hidden {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-hint {
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: var(--studio-chrome-row) !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 11px/1.4 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-seo-hint[hidden] {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  [data-prototype-seo-fix-status] {
  min-height: 0 !important;
  color: var(--studio-chrome-ink-dim) !important;
  font: 500 11px/1.35 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  [data-prototype-seo-fix-status]:empty {
  display: none !important;
}

/* Hide legacy fullscreen chrome that theme-final still injects into the head */
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-workbench-head
  :is(
    .chat-prototype-zoom-control,
    .chat-prototype-grid-toggle,
    .chat-prototype-grid-autoplace,
    button[data-prototype-fullscreen]
  ) {
  display: none !important;
}


/* ========================================================================== */
/* Format menu panels — SINGLE SOURCE (More + Image, in-strip + portaled)     */
/* Portaled panels live on document.body, so rules must not require #chat-root */
/* Theme-final has stacked legacy skins; this file loads last and wins.       */
/* ========================================================================== */

:root {
  --format-panel-z: 100520;
  --format-panel-max-h: min(72vh, 26rem);
  --format-panel-w: min(15.5rem, calc(100vw - 1rem));
  --format-panel-radius: 12px;
  --format-panel-pad: 0.4rem;
  --format-panel-bg: var(--dx-panel, var(--custom-panel));
  --format-panel-line: var(--dx-line, var(--custom-line));
  --format-panel-copy: var(--dx-copy, var(--custom-copy));
  --format-panel-muted: var(--dx-muted, var(--custom-muted));
  --format-panel-row: color-mix(in srgb, var(--format-panel-copy) 4%, transparent);
  --format-panel-input: color-mix(in srgb, var(--format-panel-copy) 6%, var(--format-panel-bg));
  --format-panel-shadow: 0 16px 40px color-mix(in srgb, #000 28%, transparent);
}

html body > .chat-format-menu-panel.chat-format-menu-panel--more.is-pinned-fixed,
html body > .chat-format-menu-panel.chat-format-menu-panel--more[data-pf-portaled="1"],
html body > .chat-format-menu-panel.chat-format-menu-panel--image.is-pinned-fixed,
html body > .chat-format-menu-panel.chat-format-menu-panel--image[data-pf-portaled="1"],
html body > .chat-format-menu-panel.chat-format-image-tools.is-pinned-fixed,
html body > .chat-format-menu-panel.chat-format-image-tools[data-pf-portaled="1"],
html body > .chat-format-menu-panel.is-pinned-fixed,
html body > .chat-format-menu-panel[data-pf-portaled="1"],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel.is-pinned-fixed,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel[data-pf-portaled="1"],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-menu-panel--more,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-menu-panel--image,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-image-tools {
  box-sizing: border-box !important;
  z-index: var(--format-panel-z) !important;
  display: grid !important;
  gap: 0 !important;
  width: var(--format-panel-w) !important;
  min-width: 13rem !important;
  max-width: var(--format-panel-w) !important;
  max-height: var(--format-panel-max-h) !important;
  margin: 0 !important;
  padding: var(--format-panel-pad) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  border: 1px solid var(--format-panel-line) !important;
  border-radius: var(--format-panel-radius) !important;
  background: var(--format-panel-bg) !important;
  background-image: none !important;
  color: var(--format-panel-copy) !important;
  box-shadow: var(--format-panel-shadow) !important;
  font-family: "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500 !important;
  pointer-events: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: color-mix(in srgb, var(--format-panel-muted) 55%, transparent) transparent !important;
}

/* Never let closed in-strip panels fight the format bar layout */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-format-menu:not([open]) > .chat-format-menu-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  position: static !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  box-shadow: none !important;
}

html body > .chat-format-menu-panel.is-pinned-fixed,
html body > .chat-format-menu-panel[data-pf-portaled="1"],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel.is-pinned-fixed,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel[data-pf-portaled="1"] {
  position: fixed !important;
}

/* In-strip (pre-portal) panels are absolute under the menu, not fixed on body */
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-prototype-format-strip
  .chat-format-menu
  > .chat-format-menu-panel:not(.is-pinned-fixed):not([data-pf-portaled="1"]) {
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  z-index: var(--format-panel-z) !important;
}

body > .chat-format-menu-panel.is-pinned-fixed *,
body > .chat-format-menu-panel[data-pf-portaled="1"] * {
  pointer-events: auto !important;
}

body > .chat-format-menu-panel--image.is-pinned-fixed,
body > .chat-format-menu-panel--image[data-pf-portaled="1"],
body > .chat-format-image-tools.is-pinned-fixed,
body > .chat-format-image-tools[data-pf-portaled="1"],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-menu-panel--image,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-image-tools {
  width: min(23rem, calc(100vw - 1rem)) !important;
  max-width: min(23rem, calc(100vw - 1rem)) !important;
}

body > .chat-format-menu-panel--type-style.is-pinned-fixed,
body > .chat-format-menu-panel--type-style[data-pf-portaled="1"],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu[open] > .chat-format-menu-panel--type-style {
  width: min(10rem, calc(100vw - 1rem)) !important;
  max-width: 10rem !important;
  min-width: 8.5rem !important;
}

/* Sections */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-section {
  display: grid !important;
  gap: 0.16rem !important;
  margin: 0 0 0.28rem !important;
  padding: 0.3rem 0.28rem 0.34rem !important;
  border: 0 !important;
  border-top: 0 !important;
  border-radius: 10px !important;
  background: var(--format-panel-row) !important;
  box-shadow: none !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-section:last-child {
  margin-bottom: 0 !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) :is(.chat-format-section-label, .chat-format-panel-label) {
  display: block !important;
  margin: 0 0 0.1rem !important;
  padding: 0 0.1rem !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--format-panel-muted) !important;
  font: 650 0.55rem/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
}

/* Rows */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row {
  display: grid !important;
  grid-template-columns: 2.6rem minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 0.35rem !important;
  min-height: 1.55rem !important;
  margin: 0 !important;
  padding: 0.08rem 0.1rem !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--format-panel-copy) !important;
  font: 600 0.62rem/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  text-transform: none !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row:hover {
  background: color-mix(in srgb, var(--pf-chat-neon) 6%, transparent) !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row > span:first-child,
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-field > span {
  color: var(--format-panel-muted) !important;
  font: 650 0.55rem/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

/* Selects / text inputs */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) :is(.chat-format-select, select, input[type="text"], input[type="search"], input[type="url"]) {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 1.5rem !important;
  height: 1.5rem !important;
  max-height: 1.5rem !important;
  padding: 0 0.45rem !important;
  border: 1px solid var(--format-panel-line) !important;
  border-radius: 7px !important;
  background: var(--format-panel-input) !important;
  color: var(--format-panel-copy) !important;
  box-shadow: none !important;
  font: 600 0.62rem/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) :is(.chat-format-select, select) {
  padding-right: 1.1rem !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) :is(.chat-format-select, select, input):hover {
  border-color: color-mix(in srgb, var(--pf-chat-neon) 42%, var(--format-panel-line)) !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) :is(.chat-format-select, select, input):focus {
  outline: none !important;
  border-color: var(--pf-chat-neon) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pf-chat-neon) 18%, transparent) !important;
}

/* Precision rows (pad / radius / opacity) — must work on body-portaled panels */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row--precision {
  grid-template-columns: 2.6rem minmax(0, 1fr) !important;
  min-height: 2.35rem !important;
  align-items: center !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-precision-control {
  display: grid !important;
  grid-template-columns: minmax(3.5rem, 1fr) 2.85rem 1.35rem !important;
  align-items: center !important;
  gap: 0.28rem !important;
  width: 100% !important;
  min-width: 0 !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-precision-control input[type="range"] {
  width: 100% !important;
  min-width: 0 !important;
  height: 1.1rem !important;
  margin: 0 !important;
  accent-color: var(--pf-chat-neon) !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-precision-control input[type="number"] {
  width: 100% !important;
  min-width: 0 !important;
  height: 1.45rem !important;
  max-height: 1.45rem !important;
  padding: 0 0.3rem !important;
  text-align: right !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-precision-control small {
  color: var(--format-panel-muted) !important;
  font: 650 0.55rem/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

/* Bg color + clear */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row:has(input[type="color"]) {
  grid-template-columns: 2.6rem auto auto 1fr !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) input[type="color"] {
  width: 1.35rem !important;
  min-width: 1.35rem !important;
  height: 1.35rem !important;
  min-height: 1.35rem !important;
  padding: 0 !important;
  border: 1px solid var(--format-panel-line) !important;
  border-radius: 999px !important;
  background: transparent !important;
  cursor: pointer !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-btn--clear {
  display: inline-grid !important;
  place-items: center !important;
  width: 1.35rem !important;
  min-width: 1.35rem !important;
  height: 1.35rem !important;
  min-height: 1.35rem !important;
  padding: 0 !important;
  border: 1px solid var(--format-panel-line) !important;
  border-radius: 999px !important;
  background: var(--format-panel-input) !important;
  color: var(--format-panel-muted) !important;
  cursor: pointer !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-btn--clear:hover,
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-btn--clear.is-active {
  border-color: var(--pf-chat-neon) !important;
  color: var(--pf-chat-neon) !important;
}

/* Link actions */
:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row--link-actions {
  display: flex !important;
  grid-template-columns: none !important;
  gap: 0.35rem !important;
  justify-content: flex-end !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row--link-actions .chat-format-btn {
  min-height: 1.5rem !important;
  padding: 0 0.65rem !important;
  border: 1px solid var(--format-panel-line) !important;
  border-radius: 999px !important;
  background: var(--format-panel-input) !important;
  color: var(--format-panel-copy) !important;
  font: 650 0.58rem/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  cursor: pointer !important;
}

:is(
  body > .chat-format-menu-panel.is-pinned-fixed,
  body > .chat-format-menu-panel[data-pf-portaled="1"],
  :is(#chat-root, .chat-media.chat-media--block-draft-fullscreen) .chat-format-menu-panel
) .chat-format-menu-row--link-actions .chat-format-btn--action {
  border-color: var(--pf-chat-neon) !important;
  color: var(--pf-chat-neon) !important;
  background: color-mix(in srgb, var(--pf-chat-neon) 10%, transparent) !important;
}


/* ========================================================================== */
/* AI Ask fab — bottom-left, difference blend, fills blue on hover            */
/* ========================================================================== */

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-ai-wand--fab,
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand.chat-prototype-ai-wand--fab {
  position: absolute !important;
  left: max(14px, env(safe-area-inset-left)) !important;
  bottom: max(14px, env(safe-area-inset-bottom)) !important;
  right: auto !important;
  top: auto !important;
  z-index: 100450 !important;
  display: inline-grid !important;
  place-items: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
  mix-blend-mode: difference !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: color 0.16s ease, transform 0.16s ease !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab
  .chat-prototype-ai-wand-icon {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  background-color: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M9.937%2015.5A2%202%200%200%200%208.5%2014.063l-6.135-1.582a.5.5%200%200%201%200-.962L8.5%209.936A2%202%200%200%200%209.937%208.5l1.582-6.135a.5.5%200%200%201%20.963%200L14.063%208.5A2%202%200%200%200%2015.5%209.937l6.135%201.581a.5.5%200%200%201%200%20.964L15.5%2014.063a2%202%200%200%200-1.437%201.437l-1.582%206.135a.5.5%200%200%201-.963%200z'/%3E%3C/svg%3E") center / contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M9.937%2015.5A2%202%200%200%200%208.5%2014.063l-6.135-1.582a.5.5%200%200%201%200-.962L8.5%209.936A2%202%200%200%200%209.937%208.5l1.582-6.135a.5.5%200%200%201%20.963%200L14.063%208.5A2%202%200%200%200%2015.5%209.937l6.135%201.581a.5.5%200%200%201%200%20.964L15.5%2014.063a2%202%200%200%200-1.437%201.437l-1.582%206.135a.5.5%200%200%201-.963%200z'/%3E%3C/svg%3E") center / contain no-repeat !important;
  transition: background-color 0.16s ease, transform 0.16s ease !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab:hover,
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab:focus-visible {
  mix-blend-mode: normal !important;
  color: var(--studio-chrome-accent, var(--pf-chat-neon)) !important;
  outline: none !important;
  transform: translateY(-1px) !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab.is-active {
  mix-blend-mode: normal !important;
  color: var(--studio-chrome-accent, var(--pf-chat-neon)) !important;
}

.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab:hover
  .chat-prototype-ai-wand-icon,
.chat-media.chat-media--block-draft-fullscreen
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-ai-wand--fab.is-active
  .chat-prototype-ai-wand-icon {
  background-color: currentColor !important;
  transform: scale(1.06) !important;
}

/* Keep the fab off the canvas while the workbench is not fullscreen. */
.chat-media.chat-media--block-draft:not(.chat-media--block-draft-fullscreen)
  .chat-prototype-ai-wand--fab,
.chat-block-draft:not(.is-prototype-fullscreen)
  > .chat-prototype-ai-wand--fab {
  display: none !important;
}

/* -------------------------------------------------------------------------- */
/* Scoped admin preview header (sleek chrome)                                 */
/* -------------------------------------------------------------------------- */

#admin-preview .admin-preview-head {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 12px 0 4px !important;
  border-bottom: 1px solid color-mix(in srgb, #fff 8%, transparent) !important;
  background: color-mix(in srgb, #0a0d0e 92%, #1a2226) !important;
  box-sizing: border-box !important;
}

#admin-preview .admin-preview-meta {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#admin-preview .admin-preview-eyebrow {
  margin: 0 !important;
  flex: 0 0 auto !important;
  color: color-mix(in srgb, var(--pf-chat-neon, #00cfff) 55%, #7a8b92) !important;
  font: 600 9px/1 Lato, "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  opacity: 0.85 !important;
}

#admin-preview .admin-preview-url {
  margin: 0 !important;
  min-width: 0 !important;
  color: #a7b2b6 !important;
  font: 400 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#admin-preview .admin-preview-actions,
#admin-preview #admin-preview-open {
  display: none !important;
}

#admin-preview .admin-preview-back {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: #c8d0d3 !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
  transition: background-color 0.14s ease, color 0.14s ease !important;
}

#admin-preview .admin-preview-back:hover,
#admin-preview .admin-preview-back:focus-visible {
  background: color-mix(in srgb, #fff 7%, transparent) !important;
  color: #f4f7f8 !important;
  outline: none !important;
}

#admin-preview .admin-preview-back-icon {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
}

body.is-admin-preview-open #admin-preview.admin-preview {
  grid-template-rows: 36px minmax(0, 1fr) !important;
}

/* -------------------------------------------------------------------------- */
/* Page templates dropdown — compact, studio-aligned                          */
/* -------------------------------------------------------------------------- */

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-dropdown {
  width: min(52rem, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem) !important;
  padding: 0.55rem 0.6rem 0.5rem !important;
  gap: 0 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 0.75rem !important;
  margin: 0 0 0.35rem !important;
  padding: 0 0.1rem !important;
  min-height: 1.4rem !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-head > span:first-child {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-head strong {
  display: block !important;
  margin: 0 !important;
  color: var(--studio-chrome-ink) !important;
  font: 650 0.72rem/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-head small {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-arrows {
  display: inline-flex !important;
  gap: 2px !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-arrows button {
  width: 1.55rem !important;
  height: 1.55rem !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--studio-chrome-muted, #9aa7ad) !important;
  font-size: 1rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-arrows button:hover {
  background: color-mix(in srgb, var(--pf-chat-neon) 12%, transparent) !important;
  color: var(--studio-chrome-ink) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cats {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0.2rem !important;
  margin: 0 0 0.4rem !important;
  padding: 0 0 0.35rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none !important;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cats::-webkit-scrollbar {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cat {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.28rem !important;
  min-height: 1.35rem !important;
  padding: 0.12rem 0.45rem !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--studio-chrome-muted, #9aa7ad) !important;
  font: 600 0.55rem/1 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cat span {
  min-width: 0.95rem !important;
  height: 0.95rem !important;
  padding: 0 0.22rem !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, #fff 8%, transparent) !important;
  font-size: 0.5rem !important;
  opacity: 0.8 !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cat:hover {
  color: var(--studio-chrome-ink) !important;
  background: color-mix(in srgb, #fff 5%, transparent) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cat.is-active {
  color: var(--pf-chat-neon, #00cfff) !important;
  background: color-mix(in srgb, var(--pf-chat-neon, #00cfff) 14%, transparent) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-cat.is-active span {
  background: color-mix(in srgb, var(--pf-chat-neon, #00cfff) 24%, transparent) !important;
  color: inherit !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-dropdown [data-template-results] {
  display: flex !important;
  gap: 0.35rem !important;
  margin: 0 !important;
  padding: 0.05rem 0.05rem 0.15rem !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: thin !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-dropdown [data-template-index],
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card {
  display: grid !important;
  grid-template-rows: 3.6rem auto !important;
  gap: 0 !important;
  flex: 0 0 8.6rem !important;
  width: 8.6rem !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 85%, transparent) !important;
  border-radius: 9px !important;
  background: color-mix(in srgb, #fff 4%, transparent) !important;
  color: var(--studio-chrome-ink) !important;
  text-align: left !important;
  cursor: pointer !important;
  scroll-snap-align: start !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card:hover {
  border-color: color-mix(in srgb, var(--pf-chat-neon) 55%, var(--studio-chrome-glass-edge)) !important;
  background: color-mix(in srgb, var(--pf-chat-neon) 8%, transparent) !important;
  box-shadow: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-media {
  position: relative !important;
  display: block !important;
  height: 3.6rem !important;
  overflow: hidden !important;
  background: color-mix(in srgb, #fff 6%, transparent) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-media img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  filter: grayscale(0.35) contrast(1.05) !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-swatch {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-copy {
  display: grid !important;
  gap: 0.12rem !important;
  min-height: 0 !important;
  padding: 0.4rem 0.45rem 0.45rem !important;
  align-content: start !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-copy > strong {
  margin: 0 !important;
  color: var(--studio-chrome-ink) !important;
  font: 650 0.68rem/1.15 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-copy > small {
  margin: 0 !important;
  color: var(--studio-chrome-muted, #9aa7ad) !important;
  font: 500 0.5rem/1.2 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-copy > em,
:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-card-meta {
  display: none !important;
}

:is(#chat-root, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  .chat-prototype-template-empty {
  padding: 0.55rem 0.2rem !important;
  color: var(--studio-chrome-muted, #9aa7ad) !important;
  font: 500 0.68rem/1.3 "Work Sans", "Helvetica Neue", Arial, sans-serif !important;
}

/* -------------------------------------------------------------------------- */
/* Final lock: beat legacy #chat-root theme head grids / full-bleed overlays  */
/* -------------------------------------------------------------------------- */

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"].is-prototype-fullscreen
  > .chat-prototype-workbench-head {
  position: absolute !important;
  top: var(--studio-chrome-inset) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: max-content !important;
  max-width: calc(100% - (2 * var(--studio-chrome-inset))) !important;
  height: var(--studio-chrome-h) !important;
  min-height: var(--studio-chrome-h) !important;
  max-height: var(--studio-chrome-h) !important;
  margin: 0 auto !important;
  margin-inline: auto !important;
  padding: 0 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  grid-template-columns: none !important;
  grid-template-areas: none !important;
  transform: none !important;
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: var(--studio-chrome-radius) !important;
  background-color: rgba(10, 12, 16, 0.82) !important;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 40%, transparent 70%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 28%, transparent 72%, rgba(255, 255, 255, 0.05)) !important;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(32px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(32px) saturate(1.5) !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  > .chat-prototype-mode-tools {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-self: center !important;
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  height: var(--studio-chrome-hit) !important;
  margin: 0 !important;
  padding: 0 8px 0 0 !important;
  border: 0 !important;
  border-right: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
  background: transparent !important;
  box-shadow: none !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  .chat-prototype-mode-toggle,
:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  .chat-prototype-device-tabs {
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  height: var(--studio-chrome-hit) !important;
  min-height: var(--studio-chrome-hit) !important;
  max-height: var(--studio-chrome-hit) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  .chat-prototype-device-tabs {
  border-right: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
  padding-right: 8px !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  > .chat-prototype-workbench-head-center {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  align-self: center !important;
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: var(--studio-chrome-hit) !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  > .chat-prototype-view-controls {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  display: inline-flex !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  margin-left: 0 !important;
  padding: 0 0 0 8px !important;
  align-self: center !important;
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--studio-chrome-hit) !important;
  border: 0 !important;
  border-left: 1px solid color-mix(in srgb, var(--studio-chrome-glass-edge) 70%, transparent) !important;
}

@media (hover: hover) and (pointer: fine) {
  :is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-prototype-fullscreen
    > .chat-prototype-workbench-head {
    opacity: 0 !important;
    pointer-events: none !important;
    top: calc(var(--studio-chrome-inset) - 8px) !important;
    transform: none !important;
  }

  :is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-toolbar-revealed.is-prototype-fullscreen
    > .chat-prototype-workbench-head,
  :is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
    .chat-block-draft[data-studio-chrome="1"].is-toolbar-auto-hide.is-prototype-fullscreen
    > .chat-prototype-workbench-head:focus-within {
    opacity: 1 !important;
    pointer-events: auto !important;
    top: var(--studio-chrome-inset) !important;
    transform: none !important;
  }
}

/* Device / mode chips: bright ink so Lucide glyphs read on dark glass */
:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  :is(.chat-prototype-mode-tab, .chat-prototype-device-tab, .chat-prototype-workbench-insert-btn, .chat-prototype-workbench-settings, .chat-prototype-close-btn) {
  color: #e8eef4 !important;
}

:is(#chat-root, body.is-designs-view, .chat-media.chat-media--block-draft-fullscreen)
  .chat-block-draft[data-studio-chrome="1"]
  > .chat-prototype-workbench-head
  :is(.chat-prototype-mode-tab.is-active, .chat-prototype-device-tab.is-active, .chat-prototype-device-tab[aria-pressed="true"]) {
  color: var(--studio-chrome-accent, #0099ff) !important;
}

