/**
 * Demo console — meta-bar styles.
 *
 * Color choice: muted lime (#d4e028) instead of full brightness (#e4f222).
 * Keeps bright lime exclusive to product CTAs (Approve, Ask Ramp button)
 * even while the bar above is also lime-toned. The eye still distinguishes
 * the two — bar is dimmer, CTAs pop.
 *
 * Typography: full mono lowercase (JetBrains Mono with system-mono fallback).
 * The mono+lowercase combination is the load-bearing "this is dev/demo
 * apparatus" signal. Don't switch to sans even when an IDE fallback is in play.
 */

:root {
  --dc-lime: #d4e028;
  --dc-lime-border: #b6c11f;
  --dc-text: #1a1919;
  --dc-text-2: rgba(26, 25, 25, 0.65);
  --dc-text-3: rgba(26, 25, 25, 0.45);
  --dc-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --dc-bar-h: 42px;
}

/* Root container — sticky at the top of the viewport, normal flow when
 * un-scrolled (so the bar genuinely pushes the page down, not overlaid).
 * Sticky so navigation stays reachable during scroll. The companion panel
 * (position:fixed) and Ramp's sticky topbar both read --demo-console-h
 * to offset themselves below us. */
.dc-root {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

/* Expanded bar — animated height so collapse genuinely reclaims layout space */
.dc-bar {
  height: var(--dc-bar-h);
  background: var(--dc-lime);
  color: var(--dc-text);
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--dc-mono);
  font-size: 12px;
  gap: 14px;
  border-bottom: 1px solid var(--dc-lime-border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: height 0.22s cubic-bezier(0.2, 0, 0, 1),
              border-bottom-width 0.22s, opacity 0.18s ease;
  overflow: hidden;
}

.dc-collapsed .dc-bar {
  height: 0;
  border-bottom-width: 0;
  opacity: 0;
  box-shadow: none;
}

/* Back-to-slides link — leftmost item, way out of the slide-deck flow */
.dc-back {
  color: var(--dc-text-2);
  font-size: 12px;
  text-decoration: none;
  font-family: inherit;
  flex-shrink: 0;
  padding: 3px 6px;
  border-radius: 2px;
  transition: color 0.12s ease, background 0.12s ease;
}
.dc-back:hover {
  color: var(--dc-text);
  background: rgba(0, 0, 0, 0.05);
}

/* Brand label */
.dc-brand {
  color: var(--dc-text-2);
  font-size: 12px;
  flex-shrink: 0;
}
.dc-brand strong { color: var(--dc-text); font-weight: 500; }
.dc-divider { color: var(--dc-text-3); }

/* Tabs */
.dc-tabs { display: flex; gap: 2px; align-items: center; }
.dc-tab {
  color: var(--dc-text-2);
  font-size: 12px;
  cursor: pointer;
  text-transform: lowercase;
  padding: 5px 10px;
  border-radius: 3px;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.dc-tab:hover { color: var(--dc-text); background: rgba(0, 0, 0, 0.05); }
.dc-tab-active {
  background: var(--dc-text);
  color: var(--dc-lime);
}
.dc-tab-active:hover {
  background: var(--dc-text);
  color: var(--dc-lime);
}

/* Persona region — interactive on companion, display-only elsewhere */
.dc-personas {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dc-persona-label {
  color: var(--dc-text-3);
  font-size: 11px;
  margin-right: 4px;
}
.dc-persona-pill {
  padding: 3px 6px;
  color: var(--dc-text-2);
  font-size: 12px;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.12s ease;
  font-family: inherit;
  background: transparent;
  border: 0;
  user-select: none;
}
.dc-persona-pill:hover { color: var(--dc-text); }
.dc-persona-pill-active {
  color: var(--dc-text);
  font-weight: 500;
}
.dc-persona-pill-active::before {
  content: "[";
  color: var(--dc-text-3);
  font-weight: 400;
  margin-right: 1px;
}
.dc-persona-pill-active::after {
  content: "]";
  color: var(--dc-text-3);
  font-weight: 400;
  margin-left: 1px;
}
.dc-persona-pill:focus-visible {
  outline: 2px solid var(--dc-text);
  outline-offset: 1px;
  border-radius: 2px;
}

/* Display-only state on non-companion surfaces */
.dc-personas-static .dc-persona-static-value {
  color: var(--dc-text-2);
  font-size: 12px;
  font-style: italic;
}

/* Reset + collapse */
.dc-reset {
  color: var(--dc-text-2);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  background: transparent;
  border: 0;
  font-family: inherit;
  border-radius: 3px;
  margin-left: 4px;
  transition: color 0.12s ease, background 0.12s ease;
}
.dc-reset:hover { color: var(--dc-text); background: rgba(0, 0, 0, 0.06); }
.dc-collapse {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dc-text-3);
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 3px;
  font-size: 14px;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.dc-collapse:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--dc-text);
}

/* Pill row — wrapper that keeps the pill horizontally centered. Lives in
 * normal flow so the pill is always visible at top center, regardless of
 * collapse state. Page content begins below the pill. */
.dc-pill-row {
  display: flex;
  justify-content: center;
  position: relative;
  /* Negative top margin pulls the pill up so its top edge sits flush with
   * the bottom border of the bar, then the pill hangs ~18px into the page
   * area. Net effect: pill reads as a handle attached to the bar, and the
   * total chrome above the page is bar + (pill - overlap). */
  margin-top: 0;
  pointer-events: none;
}

.dc-pill {
  background: var(--dc-lime);
  color: var(--dc-text);
  font-family: var(--dc-mono);
  font-size: 11px;
  padding: 4px 18px 5px;
  border-radius: 0 0 8px 8px;
  cursor: pointer;
  border: 0;
  font-weight: 400;
  letter-spacing: 0.02em;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: background 0.12s ease, box-shadow 0.18s ease;
}
.dc-pill::after {
  /* Chevron flips based on collapse state. Down ⌄ when collapsed (signals
   * "open me"); up ⌃ when expanded (signals "close me"). */
  content: "⌃";
  font-size: 13px;
  line-height: 1;
  opacity: 0.55;
  transform: translateY(-1px);
}
.dc-collapsed .dc-pill::after {
  content: "⌄";
}
.dc-pill:hover {
  background: #c8d426;
}
.dc-pill:hover::after {
  opacity: 0.9;
}
.dc-collapsed .dc-pill {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10);
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .dc-bar, .dc-pill { transition: none; }
}

/* On narrow screens, drop the brand label so tabs don't wrap */
@media (max-width: 720px) {
  .dc-brand { display: none; }
  .dc-bar > .dc-divider:first-of-type { display: none; }
  .dc-persona-label { display: none; }
}
