/* ============================================================
   chat-core.css — unified AI assistant base theme + global bottom dock.
   Single source of truth for tokens, typography, message bubbles,
   avatar badges, input/button chrome and scrollbars for BOTH the
   global bottom sheet and the product-page top dock.

   Layout/positioning for the product top dock lives in
   product-dock-layout.css (loaded only on views/product.ejs).
   ============================================================ */

/* Stacking scale (from the UI spec): canvas 10 · tint 40 · lens 60 · sheet 80 · floating bar 90 · navbar 100 */
:root {
  --z-canvas: 10;
  --z-tint: 40;
  --z-lens: 60;
  --z-sheet: 80;
  --z-bar: 90;
  --z-nav: 100;
  --z-topdock: 10000; /* product top dock: above the navbar (z-index 1000) */

  /* Brand palette (single source of truth) */
  --oxblood: #4a121a;
  --oxblood-deep: #53191b; /* 2px hairline used by lens + send chrome */
  --cream: #e4d8b4;
  --khaki: #d5cebe;
  --tint: rgba(30, 25, 38, 0.65);
  --parchment: #efe7cd;
  --parchment-deep: #e6dbb6;
  --ink: #2b0b10;

  /* Dark AI surface (agent tree + product top dock) */
  --ai-dark: rgba(26, 25, 24, 0.96);
  --ai-dark-muted: rgba(228, 216, 180, 0.55);
  --ai-dark-line: rgba(228, 216, 180, 0.12);

  /* Shared type + shape */
  --ai-font: "Unna" serif;
  --ai-radius-pill: 999px;

  --nav-h: 15vh; /* matches .navbar height (navbar.ejs) — JS refines to px */
  --kb: 0px; /* raised above the on-screen keyboard (set by JS) */
  --spring:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Background scroll-lock while the dock is maximized (full state). */
html.ai-dock-open,
body.ai-dock-open {
  overflow: hidden !important;
  touch-action: none;
}
body.ai-dock-open .ai-sheet__log,
body.ai-dock-open .ai-tree {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.ai-tint {
  position: fixed;
  inset: 0;
  background: var(--tint);
  z-index: var(--z-tint);
  backdrop-filter: blur(2px);
}
.ai-tint[hidden],
.ai-lens[hidden],
.ai-launch[hidden] {
  display: none;
}

/* ---- Sheet (three-state dock) ---- */
.ai-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-bar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 180px; /* resting = minimized footprint */
  background: var(--parchment);
  color: var(--oxblood);
  font-family: var(--ai-font);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(30, 25, 38, 0.28);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition: var(--spring);
  will-change: transform, height;
}
.ai-sheet[data-state="full"] {
  z-index: var(--z-sheet);
  height: 85vh;
  height: 85dvh;
}
.ai-sheet[data-state="collapsed"] {
  height: 60px;
  transform: translate3d(0, 0, 0);
}
.ai-sheet.is-dragging {
  transition: none;
}

/* handle = the mini/max toggle line */
.ai-sheet__handle {
  flex: none;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 0 3px;
  color: inherit;
}
.ai-sheet__handle-line {
  display: block;
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
}
.ai-sheet__handle-chevron {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid currentColor;
  opacity: 0.5;
}
.ai-sheet[data-state="full"] .ai-sheet__handle-chevron {
  border-bottom: none;
  border-top: 6px solid currentColor;
}
.ai-sheet[data-state="minimized"] .ai-sheet__handle,
.ai-sheet[data-state="collapsed"] .ai-sheet__handle {
  padding: 5px 0 1px;
}
.ai-sheet[data-state="collapsed"] .ai-sheet__handle {
  padding: 3px 0 0;
}
.ai-sheet[data-state="collapsed"] .ai-sheet__handle-chevron {
  display: none;
}

/* ---- header: agent profile + menu toggle (above the output) ---- */
.ai-sheet__head {
  flex: none;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 18px 12px;
  border-bottom: 1px solid rgba(74, 18, 26, 0.12);
}
.ai-sheet[data-state="minimized"] .ai-sheet__head,
.ai-sheet[data-state="collapsed"] .ai-sheet__head {
  display: none;
}
.ai-head__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ai-head__avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--oxblood);
  color: var(--cream);
}
.ai-head__name {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.ai-menu__toggle {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(74, 18, 26, 0.25);
  background: var(--parchment-deep);
  color: var(--oxblood);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.ai-menu__toggle:hover {
  background: var(--cream);
  border-color: var(--oxblood);
}

/* Keep the agent avatar + menu toggle above the agent-menu overlay (ai-tree). */
#aiHeadAvatar,
#aiMenuToggle {
  position: relative;
  z-index: 20;
}
#aiHeadAvatar {
  width: 24px;
  height: 24px;
  flex: none;
}
.ai-menu__toggle img {
  display: block;
}
.ai-history {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
}
.ai-history__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid rgba(74, 18, 26, 0.25);
  background: var(--parchment-deep);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
}
.ai-history__prompt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-history__arrow {
  flex: none;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.3s;
}
.ai-history__toggle[aria-expanded="true"] .ai-history__arrow {
  transform: rotate(180deg);
}
.ai-history__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, 86vw);
  max-height: 42vh;
  overflow-y: auto;
  background: var(--parchment);
  border: 1px solid rgba(74, 18, 26, 0.2);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(30, 25, 38, 0.25);
  padding: 6px;
}
.ai-history__menu[hidden] {
  display: none;
}
.ai-history__empty {
  padding: 14px;
  text-align: center;
  opacity: 0.6;
  font-style: italic;
}
.ai-history__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
}
.ai-history__item:hover {
  background: var(--parchment-deep);
}
.ai-history__item.is-active {
  background: rgba(74, 18, 26, 0.08);
}
.ai-history__item-icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--oxblood);
  color: var(--cream);
  font-size: 0.65rem;
}
.ai-history__item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-history__item-arrow {
  flex: none;
  opacity: 0.5;
}

/* ---- body: left branch tree + single active output ---- */
.ai-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
}
.ai-sheet[data-state="collapsed"] .ai-sheet__body {
  display: none;
}
.ai-sheet[data-state="minimized"] .ai-sheet__body {
  flex: none;
  overflow: hidden;
}
.ai-sheet[data-state="minimized"] .ai-tree {
  display: none;
}
.ai-sheet[data-state="minimized"] .ai-sheet__log {
  height: 100px;
}
.ai-sheet[data-state="minimized"] .ai-output {
  height: auto;
  justify-content: flex-start;
}
.ai-sheet[data-state="minimized"] .ai-output__prompt {
  display: none;
}
.ai-sheet[data-state="minimized"] .ai-output__reply {
  font-size: 0.8rem;
  line-height: 1.4;
  /* text-align: left; */
  /* white-space: nowrap; */
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
  width: 80%;
  /* overflow-y: auto; */
  padding: 15px 26px;
  /* background: radial-gradient(1100px 480px at 50% -10%, rgba(74, 18, 26, 0.06), transparent 60%), linear-gradient(180deg, var(--parchment), var(--parchment-deep)); */
  color: var(--ink);
  overscroll-behavior: contain;
  margin-top: 0;
}
.ai-sheet[data-state="minimized"] .ai-output__reply::first-letter {
  font-size: inherit;
  color: inherit;
}
.ai-tree {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80%;
  z-index: 100;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 20px 26px;
  background: rgba(26, 25, 24, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  color: var(--cream);
  transform: translate3d(-100%, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.35s;
  will-change: transform;
  backface-visibility: hidden;
}
.ai-tree.is-open {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-tree__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.6;
  margin: 0 0 12px;
  color: var(--cream);
}
.ai-agent-list,
.ai-tree__history {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ai-agent-list__item {
  margin: 0;
}
.ai-agent-list__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 1px solid rgba(228, 216, 180, 0.22);
  background: rgba(228, 216, 180, 0.06);
  color: var(--cream);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.ai-agent-list__btn:hover {
  background: rgba(228, 216, 180, 0.12);
  border-color: rgba(228, 216, 180, 0.5);
}
.ai-agent-list__btn.is-active {
  background: rgba(228, 216, 180, 0.16);
  border-color: var(--cream);
}
.ai-agent-list__btn img {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex: none;
}
.ai-agent-list__name {
  flex: 1;
  font-weight: 600;
}
.ai-agent-list__unlock {
  font-size: 0.72rem;
  opacity: 0.7;
}

.ai-tree__node {
  margin: 0;
}
.ai-tree__btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--cream);
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}
.ai-tree__btn:hover {
  background: rgba(228, 216, 180, 0.1);
  opacity: 1;
}
.ai-tree__node.is-active .ai-tree__btn {
  background: rgba(228, 216, 180, 0.14);
  opacity: 1;
  font-weight: 700;
}
.ai-tree__empty {
  padding: 10px 2px;
  opacity: 0.6;
  font-style: italic;
  color: var(--cream);
}

.ai-sheet__log {
  flex: 1 1 auto;
  /* min-width: 0; */
  overflow-y: auto;
  padding: 10px 26px;
  background:
    radial-gradient(
      1100px 480px at 50% -10%,
      rgba(74, 18, 26, 0.06),
      transparent 60%
    ),
    linear-gradient(180deg, var(--parchment), var(--parchment-deep));
  color: var(--ink);
  overscroll-behavior: contain;
}
.ai-output {
  display: flex;
  max-width: 68ch;
  margin: 0 auto;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  align-items: center;
}
.ai-output__prompt {
  font-style: italic;
  font-size: 0.82rem;
  opacity: 0.6;
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 2px solid rgba(74, 18, 26, 0.25);
}
.ai-output__reply {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  text-align: justify;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 3rem;
  margin-top: 10rem;
}
.ai-output__reply::first-letter {
  font-size: 1.5em;
  color: var(--oxblood);
}
.ai-empty {
  display: grid;
  place-items: center;
  height: 100%;
  text-align: center;
  opacity: 0.65;
  font-style: italic;
}
.ai-notice {
  margin: 18px auto 0;
  max-width: 66ch;
}
.ai-notice--system {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
}
.ai-notice--assistant {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--parchment-deep);
  border: 1px solid rgba(74, 18, 26, 0.14);
  font-size: 1rem;
}
.ai-results {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ai-results a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--parchment-deep);
  border: 1px solid rgba(74, 18, 26, 0.15);
  text-decoration: none;
  color: var(--ink);
}
.ai-results a:hover {
  background: var(--cream);
}
.ai-confirm {
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--oxblood);
  background: var(--oxblood);
  color: var(--cream);
  font: inherit;
  cursor: pointer;
}

.ai-bar {
display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
}

.ai-sheet[data-state="minimized"] .ai-bar,
.ai-sheet[data-state="collapsed"] .ai-bar {
  padding: 5px 18px 8px;
}
.ai-sheet[data-state="collapsed"] .ai-bar {
  padding: 3px 18px 6px;
}
.ai-bar__badge {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--oxblood);
  display: grid;
  place-items: center;
}
.ai-bar__input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font: inherit;
    font-size: 1.1rem;
    color: var(--oxblood);
}
.ai-bar__input::placeholder {
  color: currentColor;
  opacity: 0.8;
}
.ai-bar__lens,
.ai-bar__send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 2px solid var(--oxblood-deep);
  background: #ddd;
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ai-bar__context {
  flex: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid var(--oxblood-deep);
  background: #ddd;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.ai-sheet[data-has-messages="true"] .ai-bar__send,
.ai-sheet[data-state="minimized"] .ai-bar__send,
.ai-sheet[data-state="full"] .ai-bar__send {
  background: var(--cream);
  color: var(--oxblood);
  border-color: var(--cream);
}
.ai-bar__lens .ic-x {
  display: none;
}
.ai-bar__lens[aria-pressed="true"] .ic-x {
  display: block;
}
.ai-bar__lens[aria-pressed="true"] .ic-cam {
  display: none;
}
.ai-bar__lens[aria-pressed="true"] {
  background: var(--oxblood);
  color: var(--cream);
  border-color: var(--cream);
}
.ai-dock-slot {
  min-height: 84px;
  display: block;
}

/* ---- Lens ---- */
html.ai-lens-on,
html.ai-lens-on body {
  overflow: hidden;
  overscroll-behavior: none;
}

/* Google Lens-style selection highlight (applied by lens.js to selected text nodes). */
.lens-highlighted {
  background-color: rgba(212, 175, 55, 0.18) !important;
  border-left: 3px solid #d4af37 !important;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.ai-lens {
  position: fixed;
  inset: 0;
  z-index: var(--z-lens);
  touch-action: none;
}
.ai-lens__box {
  position: absolute;
  border: 1.5px solid var(--cream);
  border-radius: 6px;
  cursor: move;
  box-shadow: 0 0 0 100vmax rgba(30, 25, 38, 0.55); /* tint everywhere EXCEPT inside the box */
}
.ai-lens__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--oxblood); /* #4A121A fill */
  touch-action: none;
}
.ai-lens__corner[data-h="nw"] {
  left: -6px;
  top: -6px;
  border-top: 3px solid var(--cream); /* #E4D8B4 border */
  border-left: 3px solid var(--cream);
  border-radius: 8px 0 0 0;
  cursor: nwse-resize;
}
.ai-lens__corner[data-h="ne"] {
  right: -6px;
  top: -6px;
  border-top: 3px solid var(--cream);
  border-right: 3px solid var(--cream);
  border-radius: 0 8px 0 0;
  cursor: nesw-resize;
}
.ai-lens__corner[data-h="sw"] {
  left: -6px;
  bottom: -6px;
  border-bottom: 3px solid var(--cream);
  border-left: 3px solid var(--cream);
  border-radius: 0 0 0 8px;
  cursor: nesw-resize;
}
.ai-lens__corner[data-h="se"] {
  right: -6px;
  bottom: -6px;
  border-bottom: 3px solid var(--cream);
  border-right: 3px solid var(--cream);
  border-radius: 0 0 8px 0;
  cursor: nwse-resize;
}
.ai-lens__cancel {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  background: var(--oxblood);
  color: var(--cream);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
}
.ai-lens__cancel[data-place="out-top"] {
  right: 0;
  top: -44px;
}
.ai-lens__cancel[data-place="out-right"] {
  right: -44px;
  top: 0;
}
.ai-lens__cancel[data-place="in"] {
  right: 8px;
  top: 8px;
}
/* Second (dual) cancel control — mirrors the primary and sits at the opposite corner. */
.ai-lens__cancel--alt[data-place="out-top"] {
  left: 0;
  top: -44px;
  right: auto;
}
.ai-lens__cancel--alt[data-place="out-right"] {
  left: -44px;
  top: 0;
  right: auto;
}
.ai-lens__cancel--alt[data-place="in"] {
  left: 8px;
  top: 8px;
  right: auto;
}
.ai-lens.is-agent .ai-lens__box {
  animation: aiPulse 1.2s ease-in-out infinite;
  cursor: default;
}
.ai-lens.is-agent .ai-lens__corner {
  display: none;
}
@keyframes aiPulse {
  50% {
    border-color: #fff;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-sheet,
  .ai-tree,
  .ai-lens.is-agent .ai-lens__box {
    transition: none;
    animation: none;
  }
}

/* ---- Weather badge + attribution + manual city picker ---- */
.ai-weather {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 6px 18px 10px;
  border-bottom: 1px solid rgba(74, 18, 26, 0.1);
  background: rgba(74, 18, 26, 0.04);
}
.ai-sheet[data-state="minimized"] .ai-weather,
.ai-sheet[data-state="collapsed"] .ai-weather {
  display: none;
}
.ai-weather__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  padding: 0;
}
.ai-weather__icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.ai-weather__temp {
  font-weight: 700;
}
.eg-attribution {
  font-size: 0.7rem;
  opacity: 0.72;
}
.eg-attribution a {
  color: var(--oxblood);
  text-underline-offset: 2px;
}
.ai-city {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.ai-city[hidden] {
  display: none;
}
.ai-city input {
  max-width: 220px;
  width: 100%;
  border: 1px solid rgba(74, 18, 26, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.85rem;
  background: var(--parchment);
  color: var(--ink);
  outline: none;
}
.ai-city input:focus {
  border-color: var(--oxblood);
}
.ai-city button {
  border: 1px solid var(--oxblood);
  background: var(--oxblood);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 16px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ---- News source attribution tags (Rook agent) ---- */
.ai-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  align-self: flex-start;
}
.eg-news-source {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(74, 18, 26, 0.3);
  background: var(--parchment-deep);
  color: var(--oxblood);
  font-size: 0.78rem;
  text-decoration: none;
}
.eg-news-source:hover {
  background: var(--cream);
  border-color: var(--oxblood);
}

/* ============================================================
   Shared custom scrollbars — light transcript + dark surfaces.
   ============================================================ */
.ai-sheet__log {
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 18, 26, 0.45) transparent;
}
.ai-tree,
.ai-top-dock__log {
  scrollbar-width: thin;
  scrollbar-color: rgba(228, 216, 180, 0.35) transparent;
}
.ai-sheet__log::-webkit-scrollbar,
.ai-tree::-webkit-scrollbar,
.ai-top-dock__log::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ai-sheet__log::-webkit-scrollbar-track,
.ai-tree::-webkit-scrollbar-track,
.ai-top-dock__log::-webkit-scrollbar-track {
  background: transparent;
}
.ai-sheet__log::-webkit-scrollbar-thumb {
  background: rgba(74, 18, 26, 0.45);
  border-radius: 999px;
}
.ai-tree::-webkit-scrollbar-thumb,
.ai-top-dock__log::-webkit-scrollbar-thumb {
  background: rgba(228, 216, 180, 0.35);
  border-radius: 999px;
}

/* ============================================================
   Product-page top dock — shared theme + components (surface,
   message bubbles, input/button chrome, handle visuals).
   Positional/state-height rules live in product-dock-layout.css.
   ============================================================ */
.ai-top-dock {
  background: var(--oxblood);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font-family: var(--ai-font);
}

/* handle visuals */
.ai-top-dock__handle-line {
  flex: none;
  width: 40px;
  height: 3px;
  border-radius: var(--ai-radius-pill);
  background: currentColor;
  opacity: 0.5;
}
.ai-top-dock__handle-title {
  display: none;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* transcript message bubbles */
.ai-top-dock__msg {
  margin: 0 0 10px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: justify;
  padding: 2rem;
}
.ai-top-dock__msg--user {
  color: var(--ai-dark-muted);
}
.ai-top-dock__msg--agent {
  color: var(--cream);
}

/* Input bar + send button reuse the global sheet's .ai-bar / .ai-bar__input /
   .ai-bar__send classes (defined above) so the product dock is visually
   identical to the main chat sheet. */
