/* ============================================================
   GreenLync — Animation CSS (Capture / Analyse / Act / Ask)
   All selectors are scoped to their host containers so nothing
   leaks into site styles. Montserrat-only. Theme-aware.
   ============================================================ */

/* =================== CAPTURE (Tokey widget) =================== */
.tokey-host { max-width: 420px; width: 100%; margin: 0 auto; }
.tokey-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.tokey-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tokey-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  flex-shrink: 0; overflow: hidden;
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
}
.tokey-avatar svg { width: 100%; height: 100%; display: block; }
.tokey-name {
  font-family: var(--font-display);
  font-size: 1.2rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em;
}
.tokey-online {
  margin-left: auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--green-600); box-shadow: 0 0 0 4px rgba(61,143,46,0.18);
}
.tokey-headline {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; color: var(--text);
  margin: 8px 0 18px; line-height: 1.3; letter-spacing: -0.01em;
}
.tokey-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tokey-chips .chip {
  padding: 11px 16px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 14px; color: var(--text-muted);
  font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
  transition: transform 0.25s cubic-bezier(0.22,1,0.36,1),
              background 0.3s ease, border-color 0.3s ease,
              color 0.3s ease, opacity 0.4s ease, box-shadow 0.3s ease;
  cursor: pointer; line-height: 1; white-space: nowrap; position: relative;
}
.tokey-chips .chip.is-tapped {
  background: var(--green-600); border-color: var(--green-600); color: #ffffff;
  box-shadow: 0 0 0 4px rgba(61,143,46,0.18), 0 6px 16px rgba(61,143,46,0.3);
}
@keyframes tokeyChipTapPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.94); }
  70%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.tokey-chips .chip.is-tapping { animation: tokeyChipTapPulse 0.6s cubic-bezier(0.22,1,0.36,1); }
.tokey-chips .chip.is-tapping::after {
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(61,143,46,0.4);
  animation: tokeyChipRipple 0.7s ease-out;
}
@keyframes tokeyChipRipple {
  0%   { box-shadow: 0 0 0 0 rgba(61,143,46,0.5); }
  100% { box-shadow: 0 0 0 18px rgba(61,143,46,0); }
}
.tokey-chips.has-tapped .chip:not(.is-tapped) { opacity: 0.75; }
.tokey-response {
  opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity 0.5s ease, max-height 0.7s cubic-bezier(0.22,1,0.36,1);
}
.tokey-response.is-visible { opacity: 1; max-height: 400px; }
.tokey-divider { height: 1px; background: var(--border); margin: 20px 0 18px; }
.tokey-reply { font-size: 15px; color: var(--text); line-height: 1.5; margin-bottom: 16px; }
.tokey-reply strong { color: var(--text); font-weight: 700; }
.tokey-followups { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-followup {
  padding: 10px 18px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 14px; color: var(--text-muted);
  font-weight: 500; opacity: 0; transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.chip-followup--primary {
  background: var(--green-600); color: #ffffff; border-color: var(--green-600);
  box-shadow: 0 4px 12px rgba(61,143,46,0.25);
}
.tokey-response.is-visible .chip-followup { opacity: 1; transform: translateY(0); }
.tokey-response.is-visible .chip-followup:nth-child(1) { transition-delay: 0.15s; }
.tokey-response.is-visible .chip-followup:nth-child(2) { transition-delay: 0.30s; }
.tokey-response.is-visible .chip-followup:nth-child(3) { transition-delay: 0.45s; }

/* =================== ANALYSE (dashboard chart SVG) =================== */
.gl-chart-host { max-width: 820px; width: 100%; margin: 0 auto; }
.gl-chart-host svg { width: 100%; height: auto; display: block; }
.gl-concept-banner {
  max-width: 820px; margin: 0 auto 1.5rem;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  gap: 14px; flex-wrap: wrap;
  color: #faf7f0; font-size: 14px; font-weight: 500; text-align: center;
}
.gl-concept-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  font-weight: 600; font-size: 13px;
}
.gl-concept-chip--taps {
  background: rgba(59,130,246,0.18); color: #93c5fd;
  border: 1px solid rgba(59,130,246,0.4);
}
.gl-concept-chip--taps::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #3b82f6;
}
.gl-concept-chip--pos {
  background: rgba(16,185,129,0.18); color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.4);
}
.gl-concept-chip--pos::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #10b981;
}
.gl-concept-plus {
  color: var(--amber-300);
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
}
.gl-concept-equals {
  color: var(--amber-300);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700;
  padding: 6px 12px;
  border: 1px dashed rgba(232,199,119,0.45);
  border-radius: 6px;
}

.gl-chart-host .gl-line { stroke-dasharray: 1200; stroke-dashoffset: 1200; }
.gl-chart-host .gl-area { opacity: 0; }
.gl-chart-host .gl-bar  { transform: scaleY(0); }
.gl-chart-host .gl-barh { transform: scaleX(0); transform-origin: left center; }
.gl-chart-host .gl-dot  { opacity: 0; transform: scale(0); transform-origin: center; }
.gl-chart-host .gl-fade { opacity: 0; }

.gl-chart-host.gl-animate .gl-line { animation: glDrawLine 1.6s cubic-bezier(0.22,1,0.36,1) forwards; }
.gl-chart-host.gl-animate .gl-area { animation: glFadeIn 1.4s cubic-bezier(0.22,1,0.36,1) 0.45s forwards; }
.gl-chart-host.gl-animate .gl-bar  { animation: glGrowBarV 0.9s cubic-bezier(0.22,1,0.36,1) forwards; }
.gl-chart-host.gl-animate .gl-barh { animation: glGrowBarH 0.9s cubic-bezier(0.22,1,0.36,1) forwards; }
.gl-chart-host.gl-animate .gl-dot  {
  animation: glPopDot 0.55s cubic-bezier(0.22,1,0.36,1) 1.3s forwards,
             glPulse 1.8s ease-in-out 1.9s infinite;
}
.gl-chart-host.gl-animate .gl-fade { animation: glFadeIn 0.5s ease-out forwards; }

.gl-chart-host .gl-bar[data-delay="1"] { animation-delay: 0.20s; }
.gl-chart-host .gl-bar[data-delay="2"] { animation-delay: 0.30s; }
.gl-chart-host .gl-bar[data-delay="3"] { animation-delay: 0.40s; }
.gl-chart-host .gl-bar[data-delay="4"] { animation-delay: 0.50s; }
.gl-chart-host .gl-bar[data-delay="5"] { animation-delay: 0.60s; }
.gl-chart-host .gl-bar[data-delay="6"] { animation-delay: 0.70s; }
.gl-chart-host .gl-bar[data-delay="7"] { animation-delay: 0.80s; }
.gl-chart-host .gl-bar[data-delay="8"] { animation-delay: 0.90s; }
.gl-chart-host .gl-barh[data-delay="1"] { animation-delay: 0.30s; }
.gl-chart-host .gl-barh[data-delay="2"] { animation-delay: 0.45s; }
.gl-chart-host .gl-barh[data-delay="3"] { animation-delay: 0.60s; }
.gl-chart-host .gl-fade[data-delay="1"] { animation-delay: 0.40s; }
.gl-chart-host .gl-fade[data-delay="2"] { animation-delay: 0.55s; }
.gl-chart-host .gl-fade[data-delay="3"] { animation-delay: 0.70s; }
.gl-chart-host .gl-fade[data-delay="callout"] { animation-delay: 1.10s; }
.gl-chart-host .gl-fade[data-delay="ribbon"]  { animation-delay: 1.50s; }

@keyframes glDrawLine { to { stroke-dashoffset: 0; } }
@keyframes glFadeIn   { to { opacity: 1; } }
@keyframes glGrowBarV { to { transform: scaleY(1); } }
@keyframes glGrowBarH { to { transform: scaleX(1); } }
@keyframes glPopDot   { to { opacity: 1; transform: scale(1); } }
@keyframes glPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* =================== ACT (Monday briefing card) =================== */
.act-host {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 20px;
  padding: clamp(18px, 3cqw, 26px);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  gap: clamp(10px, 1.6cqw, 14px);
  container-type: inline-size;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
.act-date-banner {
  display: flex; align-items: center;
  gap: clamp(10px, 2cqw, 14px);
  padding: clamp(10px, 1.8cqw, 14px) clamp(14px, 2.6cqw, 18px);
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  border-radius: 12px; color: #faf7f0;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  flex-shrink: 0;
}
.act-host.is-animated .act-date-banner { opacity: 1; transform: translateY(0); }
.act-date-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-300); flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(110,231,183,0.7);
}
.act-host.is-animated .act-date-pulse { animation: actDatePulse 2s ease-in-out 0.5s infinite; }
@keyframes actDatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(110,231,183,0.7); }
  50%      { box-shadow: 0 0 0 6px rgba(110,231,183,0); }
}
.act-date-label {
  font-family: var(--font-mono);
  font-size: clamp(9px, 1.6cqw, 10.5px);
  font-weight: 700; letter-spacing: 1.4px;
  color: var(--amber-300); text-transform: uppercase;
}
.act-date-main {
  font-family: var(--font-display);
  font-size: clamp(15px, 3cqw, 19px); font-weight: 700;
  color: #faf7f0; letter-spacing: -0.01em; line-height: 1.1;
}
.act-date-sub { font-size: clamp(10px, 1.8cqw, 12px); color: #a8b8ad; margin-top: 2px; font-weight: 500; }
.act-date-text-group { flex: 1; min-width: 0; }

.act-header {
  display: flex; align-items: center;
  gap: clamp(10px, 2cqw, 14px);
  padding-bottom: clamp(10px, 1.6cqw, 12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.act-icon {
  width: clamp(40px, 7cqw, 48px); height: clamp(40px, 7cqw, 48px);
  border-radius: 10px;
  background: linear-gradient(135deg, #f4e5a8, var(--amber-300));
  display: grid; place-items: center;
  font-size: clamp(19px, 3.5cqw, 22px);
  flex-shrink: 0;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}
.act-host.is-animated .act-icon { opacity: 1; transform: translateY(0); }
.act-header-text { flex: 1; opacity: 0; transition: opacity 0.5s ease 0.3s; min-width: 0; }
.act-host.is-animated .act-header-text { opacity: 1; }
.act-category {
  font-size: clamp(9px, 1.6cqw, 10.5px); font-weight: 700;
  letter-spacing: 1.4px; color: var(--text-dim); text-transform: uppercase;
  margin-bottom: 4px;
}
.act-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 2.8cqw, 18px); font-weight: 700;
  color: var(--text); line-height: 1.25; letter-spacing: -0.01em;
}
.act-segments {
  background: var(--surface-2); border-radius: 12px;
  padding: clamp(10px, 1.8cqw, 14px) clamp(12px, 2.2cqw, 16px);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.5s ease 0.5s, transform 0.5s ease 0.5s;
  flex-shrink: 0;
}
.act-host.is-animated .act-segments { opacity: 1; transform: translateY(0); }
.act-segments-label {
  font-size: clamp(9px, 1.6cqw, 10.5px); font-weight: 700;
  letter-spacing: 1.4px; color: var(--text-dim); text-transform: uppercase;
  margin-bottom: clamp(8px, 1.4cqw, 10px);
}
.act-seg-row {
  display: grid;
  grid-template-columns: 1fr clamp(80px, 15cqw, 110px) clamp(54px, 10cqw, 72px);
  align-items: center; gap: clamp(8px, 1.5cqw, 12px);
}
.act-seg-head {
  padding: 0 0 clamp(4px, 0.8cqw, 6px);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(3px, 0.6cqw, 5px);
}
.act-seg-head > div {
  font-size: clamp(8px, 1.4cqw, 9.5px); font-weight: 700;
  letter-spacing: 1.2px; color: var(--text-dim); text-transform: uppercase;
}
.act-seg-head > div:nth-child(3) { text-align: right; }
.act-seg-data { padding: clamp(3px, 0.5cqw, 4px) 0; }
.act-seg-metric {
  display: flex; align-items: center; gap: clamp(6px, 1.1cqw, 8px);
  font-size: clamp(11px, 2cqw, 13px);
  color: var(--text); font-weight: 500; min-width: 0;
}
.act-seg-dot {
  width: clamp(7px, 1.3cqw, 9px); height: clamp(7px, 1.3cqw, 9px);
  border-radius: 50%; flex-shrink: 0;
}
.act-seg-metric-name {
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-seg-bar-wrap {
  height: 5px; background: var(--border-strong); border-radius: 3px; overflow: hidden;
}
.act-seg-bar {
  height: 100%; border-radius: 3px; width: 0;
  transition: width 1.0s cubic-bezier(0.22,1,0.36,1);
}
.act-host.is-animated .act-seg-row[data-row="1"] .act-seg-bar { width: var(--bar-w); transition-delay: 0.65s; }
.act-host.is-animated .act-seg-row[data-row="2"] .act-seg-bar { width: var(--bar-w); transition-delay: 0.80s; }
.act-host.is-animated .act-seg-row[data-row="3"] .act-seg-bar { width: var(--bar-w); transition-delay: 0.95s; }
.act-host.is-animated .act-seg-row[data-row="4"] .act-seg-bar { width: var(--bar-w); transition-delay: 1.10s; }
.act-seg-benchmark {
  font-size: clamp(10px, 1.8cqw, 12px); font-weight: 700; text-align: right;
}
.act-seg-benchmark.bad  { color: var(--red-600); }
.act-seg-benchmark.warn { color: #a37a08; }
.act-seg-benchmark.ok   { color: var(--green-700); }

.act-actions {
  background: var(--surface-2); border-radius: 12px;
  padding: clamp(10px, 1.8cqw, 14px) clamp(12px, 2.2cqw, 16px);
  opacity: 0; transition: opacity 0.5s ease 1.3s;
  flex-shrink: 0;
}
.act-host.is-animated .act-actions { opacity: 1; }
.act-action-row {
  display: flex; align-items: flex-start;
  gap: clamp(10px, 1.8cqw, 14px);
  padding: clamp(5px, 0.9cqw, 7px) 0;
}
.act-btn {
  padding: clamp(6px, 1.1cqw, 8px) clamp(10px, 1.8cqw, 14px);
  border-radius: 5px;
  font-size: clamp(9px, 1.6cqw, 10.5px);
  font-weight: 800; letter-spacing: 1.1px;
  color: #ffffff; text-transform: uppercase;
  min-width: clamp(74px, 13cqw, 92px); text-align: center;
  flex-shrink: 0;
  background: #1a2e1e;
  transition: background 0.6s ease, box-shadow 0.6s ease;
}
.act-host.is-animated .act-btn-fix {
  background: var(--green-700);
  box-shadow: 0 0 0 3px rgba(45,122,42,0.18), 0 4px 10px rgba(45,122,42,0.25);
  transition-delay: 1.5s;
}
.act-host.is-animated .act-btn-do {
  background: #d8a018;
  box-shadow: 0 0 0 3px rgba(216,160,24,0.18), 0 4px 10px rgba(216,160,24,0.25);
  transition-delay: 1.85s;
}
.act-host.is-animated .act-btn-stop {
  background: #c02626;
  box-shadow: 0 0 0 3px rgba(192,38,38,0.18), 0 4px 10px rgba(192,38,38,0.25);
  transition-delay: 2.2s;
}
.act-action-text {
  font-size: clamp(11px, 2cqw, 13px); color: var(--text);
  line-height: 1.45; padding-top: 2px; min-width: 0;
}
.act-action-roi {
  display: block; margin-top: 3px; font-weight: 700;
  font-size: clamp(10.5px, 1.9cqw, 12.5px);
}
.act-action-roi.green { color: var(--green-700); }
.act-action-roi.amber { color: #a37a08; }
.act-action-roi.red   { color: var(--red-600); }

.act-friction {
  background: var(--amber-100); border-radius: 12px;
  padding: clamp(12px, 2.2cqw, 16px) clamp(14px, 2.6cqw, 18px);
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.6s ease 2.4s, transform 0.6s ease 2.4s;
  flex-shrink: 0;
}
.act-host.is-animated .act-friction { opacity: 1; transform: translateY(0); }
.act-friction-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: clamp(5px, 1cqw, 7px) clamp(9px, 1.6cqw, 12px);
  background: #2a0a0a; color: #ffffff;
  border-radius: 5px;
  font-size: clamp(10px, 1.8cqw, 12px); font-weight: 700;
  margin-bottom: clamp(8px, 1.4cqw, 12px);
}
.act-host.is-animated .act-friction-badge {
  animation: actFrictionFlash 1.8s ease-in-out 2.8s infinite;
}
@keyframes actFrictionFlash {
  0%, 100% { background: #2a0a0a; box-shadow: 0 0 0 0 rgba(220,38,38,0); }
  50%      { background: var(--red-600); box-shadow: 0 0 0 8px rgba(220,38,38,0), 0 0 20px 2px rgba(220,38,38,0.6); }
}
.act-friction-title {
  font-family: var(--font-display);
  font-size: clamp(13px, 2.5cqw, 17px); font-weight: 700;
  color: var(--text); line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: clamp(6px, 1.1cqw, 9px);
}
.act-friction-body {
  font-size: clamp(11px, 2cqw, 13px); color: var(--text-muted); line-height: 1.55;
}
.act-friction-body strong { color: var(--text); font-weight: 700; }
.act-friction-body em { font-style: normal; font-weight: 700; color: var(--red-600); }

/* Dark theme tweak: amber friction bg is too light → darken */
html[data-theme="dark"] .act-friction {
  background: rgba(232,199,119,0.10);
  border: 1px solid rgba(232,199,119,0.25);
}

/* =================== ASK (chat on dashboard) =================== */
.composition-host {
  position: relative;
  max-width: 880px; width: 100%; margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.composition-host .dashboard-bg {
  position: absolute; inset: 0; padding: 14px;
  opacity: 0.5; filter: saturate(0.8);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
}
.composition-host .db-kpi-strip {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.composition-host .db-kpi {
  background: var(--surface); border-radius: 10px; padding: 10px 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.composition-host .db-kpi-label {
  font-size: 8px; letter-spacing: 0.6px; color: var(--text-dim);
  font-weight: 700; text-transform: uppercase; margin-bottom: 4px;
}
.composition-host .db-kpi-val {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700; color: var(--text); line-height: 1;
  letter-spacing: -0.01em;
}
.composition-host .db-kpi-delta { font-size: 9px; font-weight: 700; margin-top: 4px; }
.composition-host .db-kpi-delta.up { color: var(--green-500); }
.composition-host .db-kpi-delta.down { color: var(--red-500); }

.composition-host .db-card {
  background: var(--surface); border-radius: 10px; padding: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.composition-host .db-title {
  font-size: 10px; font-weight: 700; color: var(--text);
  margin-bottom: 8px; display: flex; align-items: center; gap: 5px;
}
.composition-host .db-subtitle { font-size: 8px; color: var(--text-dim); font-weight: 600; margin-left: auto; }
.composition-host .db-sales { grid-column: 1 / 3; }
.composition-host .db-sales-chart { position: relative; height: 110px; margin-top: 4px; }
.composition-host .db-sales-chart svg { width: 100%; height: 100%; display: block; }

.composition-host .db-cats { grid-column: 3; }
.composition-host .db-cat-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 9px; }
.composition-host .db-cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.composition-host .db-cat-name { flex: 1; color: var(--text); font-weight: 600; }
.composition-host .db-cat-val { font-weight: 700; color: var(--text); font-size: 9px; }
.composition-host .db-cat-bar {
  height: 4px; border-radius: 2px; margin-top: 2px;
  background: var(--border); overflow: hidden; margin-bottom: 4px;
}
.composition-host .db-cat-bar-fill { height: 100%; border-radius: 2px; }

.composition-host .db-strains { grid-column: 1; }
.composition-host .db-strain-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; font-size: 9px;
  border-bottom: 1px solid var(--border);
}
.composition-host .db-strain-row:last-child { border-bottom: none; }
.composition-host .db-strain-rank {
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--bg-softer); color: var(--green-600);
  font-weight: 700; font-size: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.composition-host .db-strain-name {
  flex: 1; color: var(--text); font-weight: 500; font-size: 9px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.composition-host .db-strain-rev { font-weight: 700; font-size: 8.5px; color: var(--green-500); }

.composition-host .db-peak { grid-column: 2; }
.composition-host .db-peak-grid {
  display: grid;
  grid-template-columns: 18px repeat(12, 1fr);
  gap: 2px; margin-top: 4px;
}
.composition-host .db-peak-day {
  font-size: 7px; color: var(--text-dim); text-transform: uppercase;
  font-weight: 700; display: flex; align-items: center;
}
.composition-host .db-peak-cell { aspect-ratio: 1; border-radius: 2px; min-height: 8px; }
.composition-host .db-peak-legend {
  font-size: 7px; color: var(--text-dim); margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}

.composition-host .db-team { grid-column: 3; }
.composition-host .db-team-row {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 0; font-size: 9px;
}
.composition-host .db-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #c89a3d, #a37c1c);
  color: #ffffff; font-weight: 700; font-size: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.composition-host .db-team-row:nth-child(2) .db-avatar { background: linear-gradient(135deg, #3d8f2e, #2d6a21); }
.composition-host .db-team-row:nth-child(3) .db-avatar { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.composition-host .db-team-row:nth-child(4) .db-avatar { background: linear-gradient(135deg, #ef4444, #dc2626); }
.composition-host .db-team-name { flex: 1; color: var(--text); font-weight: 500; font-size: 9px; }
.composition-host .db-team-val { font-weight: 700; font-size: 9px; color: var(--text); }

.composition-host .db-inv { grid-column: 1 / 3; }
.composition-host .db-inv-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 9px;
  border-bottom: 1px solid var(--border);
}
.composition-host .db-inv-row:last-child { border-bottom: none; }
.composition-host .db-inv-tag {
  font-size: 7.5px; font-weight: 800;
  padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.4px; text-transform: uppercase;
}
.composition-host .db-inv-tag.low { background: #fef3c7; color: #a16207; }
.composition-host .db-inv-tag.out { background: #fee2e2; color: #b91c1c; }
.composition-host .db-inv-tag.hot { background: #d1fae5; color: #047857; }
.composition-host .db-inv-name { flex: 1; font-weight: 500; color: var(--text); }
.composition-host .db-inv-val { font-weight: 700; color: var(--text); font-size: 9px; }

.composition-host .chat-panel {
  position: absolute;
  top: 8%; right: 3%;
  width: 58%; height: 86%;
  background: var(--surface); border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 12px 40px rgba(13,31,20,0.25);
  border: 1px solid var(--border);
  z-index: 2;
}
.composition-host .chat-header {
  flex-shrink: 0; padding: 12px 16px;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  color: #ffffff; display: flex; align-items: center; gap: 10px;
}
.composition-host .chat-header-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: grid; place-items: center;
  font-size: 16px; flex-shrink: 0;
}
.composition-host .chat-header-info { flex: 1; min-width: 0; }
.composition-host .chat-header-name {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.01em;
}
.composition-host .chat-header-role { font-size: 10px; opacity: 0.85; line-height: 1.2; font-weight: 500; }
.composition-host .chat-header-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #c7f5ea; box-shadow: 0 0 0 3px rgba(199,245,234,0.3);
  flex-shrink: 0;
}
.composition-host .chat-body {
  flex: 1; overflow-y: auto; padding: 12px;
  background: var(--bg);
  scroll-behavior: smooth;
}
.composition-host .chat-body::-webkit-scrollbar { width: 5px; }
.composition-host .chat-body::-webkit-scrollbar-thumb { background: rgba(61,143,46,0.3); border-radius: 3px; }

.composition-host .msg {
  max-width: 88%; padding: 9px 12px; border-radius: 14px;
  margin-bottom: 7px; font-size: 12px; line-height: 1.45;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.composition-host .msg.is-shown { opacity: 1; transform: translateY(0); }
.composition-host .msg-user {
  background: var(--green-600); color: #ffffff;
  margin-left: auto; border-bottom-right-radius: 4px; font-weight: 500;
}
.composition-host .msg-lync {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  margin-right: auto; margin-bottom: 12px; font-size: 11.5px;
}
.composition-host .msg-lync strong { color: var(--green-700); font-weight: 700; }
.composition-host .msg-lync .fix-line {
  display: block; margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(61,143,46,0.3);
  color: var(--green-700); font-weight: 700; font-size: 11.5px;
}

.composition-host .typing {
  display: inline-flex; gap: 3px;
  padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; border-bottom-left-radius: 4px;
  opacity: 0; transition: opacity 0.3s ease;
  margin-bottom: 7px; align-self: flex-start;
}
.composition-host .typing.is-shown { opacity: 1; }
.composition-host .typing span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--green-600);
  animation: askTypingDot 1.2s ease-in-out infinite;
}
.composition-host .typing span:nth-child(2) { animation-delay: 0.15s; }
.composition-host .typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes askTypingDot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.composition-host .inline-graph {
  margin-top: 10px; padding: 10px;
  background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border);
}
.composition-host .inline-graph-title {
  font-size: 9px; font-weight: 800;
  letter-spacing: 0.4px; color: var(--text);
  text-transform: uppercase; margin-bottom: 8px;
}
.composition-host .graph-row {
  display: flex; align-items: center;
  margin-bottom: 6px; font-size: 10px;
}
.composition-host .graph-label {
  width: 70px; font-weight: 700; color: var(--text);
  font-size: 9.5px; line-height: 1.2; padding-right: 4px;
}
.composition-host .graph-bars {
  flex: 1; display: flex; align-items: center; height: 16px;
}
.composition-host .graph-center {
  width: 1px; height: 18px; background: var(--text); flex-shrink: 0;
}
.composition-host .graph-bar {
  height: 10px; border-radius: 3px;
  transition: transform 0.9s cubic-bezier(0.22,1,0.36,1);
  transform: scaleX(0);
}
.composition-host .msg-lync.is-shown .graph-bar { transform: scaleX(1); }
.composition-host .msg-lync.is-shown .graph-bar:nth-child(odd) { transition-delay: 0.3s; }
.composition-host .graph-red { background: linear-gradient(90deg, var(--red-500), #dc2626); transform-origin: right center; }
.composition-host .graph-green { background: linear-gradient(90deg, var(--green-500), #059669); transform-origin: left center; }
.composition-host .graph-number { font-size: 9px; font-weight: 700; color: var(--text); min-width: 34px; }
.composition-host .graph-number-red { color: #dc2626; text-align: right; margin-right: 4px; }
.composition-host .graph-number-green { color: #059669; margin-left: 4px; }
.composition-host .graph-footer {
  margin-top: 6px; padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 9.5px; color: var(--text); font-weight: 700; text-align: center;
}
.composition-host .graph-footer strong { color: #059669; }

.composition-host .chat-input {
  flex-shrink: 0; padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px;
  background: var(--surface);
}
.composition-host .chat-input-field {
  flex: 1; padding: 8px 12px;
  background: var(--surface-2); border-radius: 999px;
  font-size: 11px; color: var(--text-dim); font-weight: 500;
}
.composition-host .chat-send {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-600); display: grid; place-items: center;
  color: #fff; font-size: 11px; flex-shrink: 0;
}

/* Mobile: expand chat, shrink dashboard */
@media (max-width: 560px) {
  .composition-host .chat-panel { top: 5%; right: 3%; width: 78%; height: 90%; }
  .composition-host .msg, .composition-host .msg-lync { font-size: 10.5px; padding: 7px 10px; }
  .composition-host .msg-lync .fix-line { font-size: 10.5px; }
  .composition-host .graph-label { width: 62px; font-size: 8.5px; }
  .composition-host .graph-number { font-size: 8.5px; }
  .composition-host .dashboard-bg { padding: 8px; gap: 6px; }
  .composition-host .db-kpi-val { font-size: 14px; }
}

/* Dark mode tweaks for the inventory pills — keep contrast readable */
html[data-theme="dark"] .composition-host .db-inv-tag.low { background: rgba(254,243,199,0.14); color: #f4d35e; }
html[data-theme="dark"] .composition-host .db-inv-tag.out { background: rgba(254,226,226,0.14); color: #fca5a5; }
html[data-theme="dark"] .composition-host .db-inv-tag.hot { background: rgba(209,250,229,0.14); color: #6ee7b7; }

/* Reduced motion: disable all animations in this file */
@media (prefers-reduced-motion: reduce) {
  .tokey-chips .chip.is-tapping,
  .act-host.is-animated .act-date-pulse,
  .act-host.is-animated .act-friction-badge,
  .composition-host .typing span,
  .gl-chart-host .gl-line,
  .gl-chart-host .gl-area,
  .gl-chart-host .gl-bar,
  .gl-chart-host .gl-barh,
  .gl-chart-host .gl-dot,
  .gl-chart-host .gl-fade {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
    transform: scaleX(1) scaleY(1) scale(1) !important;
  }
}
