/*
  EKB guide for LibreChat (ekb-guide.js): the portal's guide (apps/portal/src/guide/guide.css) in plain CSS over the
  overlay's tokens (--ekb-*, ekb-theme.css; LibreChat puts `dark` / `light` on <html>). The orange is the mascot's,
  only for the guide: the lit cluster, the glow behind the mascot button, the warm corner of the cards.
  No coloured stripe, no outline alone: the lit cluster is a soft glow along its corners; cards are raised surfaces.
  Every class is prefixed ekbg- so nothing of LibreChat is touched.
*/
html {
  --ekbg: #f7941d;
  --ekbg-text: #9a5200;
  --ekbg-ring: rgba(247, 148, 29, 0.4);
  --ekbg-glow: rgba(247, 148, 29, 0.48);
  --ekbg-glow-far: rgba(247, 148, 29, 0.2);
  --ekbg-dim: rgba(14, 20, 32, 0.16);
  --ekbg-wash: rgba(247, 148, 29, 0.16);
  --ekbg-shade: rgba(247, 148, 29, 0.55);
}
html.dark {
  --ekbg: #ffa23a;
  --ekbg-text: #ffbe73;
  --ekbg-ring: rgba(255, 162, 58, 0.45);
  --ekbg-glow: rgba(255, 162, 58, 0.52);
  --ekbg-glow-far: rgba(255, 162, 58, 0.2);
  --ekbg-dim: rgba(2, 4, 8, 0.34);
  --ekbg-wash: rgba(255, 162, 58, 0.15);
  --ekbg-shade: rgba(255, 162, 58, 0.45);
}

/* ───────── the mascot button ───────── */
.ekbg-root[hidden] {
  display: none;
}
.ekbg-trigger {
  position: fixed;
  top: 8px;
  left: calc(100vw - 104px);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  isolation: isolate;
}
.ekbg-trigger-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(20, 28, 45, 0.22));
  transition: transform 160ms ease;
}
.ekbg-trigger:hover .ekbg-trigger-img {
  transform: translateY(-1px) scale(1.04);
}
.ekbg-trigger:focus-visible {
  outline: 2px solid var(--ekb-focus, #b56f00);
  outline-offset: 2px;
}
/* not seen the tour yet: a blurred orange glow behind it that breathes slowly */
.ekbg-halo {
  position: absolute;
  inset: -6px;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--ekbg-glow), transparent);
  filter: blur(5px);
  opacity: 0;
}
.ekbg-lit .ekbg-halo {
  opacity: 0.7;
  animation: ekbg-breathe 2.8s ease-in-out infinite;
}
.ekbg-lit.ekbg-calm .ekbg-halo {
  animation: none;
}

/* ───────── shared surfaces ───────── */
.ekbg-card {
  color: var(--ekb-fg);
  font-family: var(--ekb-font);
  border: 1px solid var(--ekb-line);
  background:
    radial-gradient(90% 70% at 0% 0%, var(--ekbg-wash), transparent 62%),
    linear-gradient(160deg, var(--ekb-card-a), var(--ekb-card-b));
  box-shadow:
    var(--ekb-pop-shadow),
    0 18px 50px -24px var(--ekbg-shade);
}
.ekbg-mascot {
  flex: none;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.ekbg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  font: 600 12.5px/1 var(--ekb-font);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}
.ekbg-btn:focus-visible,
.ekbg-link:focus-visible,
.ekbg-close:focus-visible {
  outline: 2px solid var(--ekb-focus);
  outline-offset: 2px;
}
.ekbg-btn-primary {
  color: var(--ekb-sel-ink);
  background: linear-gradient(180deg, var(--ekb-sel-a), var(--ekb-sel-b));
  box-shadow: var(--ekb-sel-shadow);
}
.ekbg-btn-primary:hover {
  filter: brightness(1.03);
}
.ekbg-btn-quiet {
  color: var(--ekb-fg);
  background: linear-gradient(180deg, var(--ekb-tile-a), var(--ekb-tile-b));
  box-shadow: var(--ekb-rise-sm);
}
.ekbg-btn-ghost {
  color: var(--ekb-fg2);
  background: transparent;
}
.ekbg-btn-ghost:hover {
  color: var(--ekb-fg);
  background: var(--ekb-active);
}
.ekbg-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  margin-top: 2px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ekb-blue-text);
  font: 600 12.5px/1.3 var(--ekb-font);
  cursor: pointer;
}
.ekbg-link:hover {
  text-decoration: underline;
}

/* ───────── the run's layer ───────── */
.ekbg-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}
.ekbg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.ekbg-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  box-shadow:
    0 0 0 1px var(--ekbg-ring),
    0 0 16px 2px var(--ekbg-glow),
    0 0 44px 10px var(--ekbg-glow-far),
    0 0 0 200vmax var(--ekbg-dim);
  animation: ekbg-fade 180ms ease-out both;
}
.ekbg-layer[data-motion="on"] .ekbg-ring {
  transition:
    transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    width 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    height 240ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-radius 240ms ease;
}
.ekbg-dim {
  position: fixed;
  inset: 0;
  background: var(--ekbg-dim);
  animation: ekbg-fade 180ms ease-out both;
}

/* ───────── the tooltip ───────── */
.ekbg-tip {
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  width: min(372px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  pointer-events: auto;
  text-align: left;
}
.ekbg-layer[data-motion="on"] .ekbg-tip {
  animation: ekbg-tip-in 150ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.ekbg-tip-centred {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
.ekbg-layer[data-motion="on"] .ekbg-tip-centred {
  animation: ekbg-fade 150ms ease-out both;
}
.ekbg-tip-wide {
  width: min(560px, calc(100vw - 24px));
}
.ekbg-tip-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ekbg-tip-mascot {
  width: 56px;
  height: 56px;
  margin: -4px 0 0 -4px;
}
.ekbg-tip-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}
.ekbg-tour-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ekb-fg3);
}
.ekbg-title-sm {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ekb-fg);
}
.ekbg-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ekb-fg2);
}
.ekbg-tip-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
}
.ekbg-count {
  margin-right: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--ekb-fg3);
  font-variant-numeric: tabular-nums;
}
.ekbg-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  background: var(--ekb-card-a);
  border: 1px solid var(--ekb-line);
  transform: rotate(45deg);
}
.ekbg-arrow[data-side="bottom"] {
  top: -8px;
  border-right: 0;
  border-bottom: 0;
}
.ekbg-arrow[data-side="top"] {
  bottom: -8px;
  background: var(--ekb-card-b);
  border-left: 0;
  border-top: 0;
}
.ekbg-arrow[data-side="right"] {
  left: -8px;
  border-right: 0;
  border-top: 0;
}
.ekbg-arrow[data-side="left"] {
  right: -8px;
  background: var(--ekb-card-b);
  border-left: 0;
  border-bottom: 0;
}
.ekbg-arrow[hidden] {
  display: none;
}
.ekbg-figure {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}
.ekbg-figure figcaption {
  font-size: 12px;
  color: var(--ekb-fg2);
}
.ekbg-preview {
  display: block;
  max-width: 100%;
  max-height: 46vh;
  object-fit: contain;
  object-position: left top;
  border-radius: 12px;
  box-shadow: var(--ekb-rise-sm);
}
@media (max-width: 639px) {
  .ekbg-tip:not(.ekbg-tip-centred) {
    width: calc(100vw - 16px);
    gap: 8px;
    padding: 12px 12px 10px;
  }
  .ekbg-tip-mascot {
    width: 44px;
    height: 44px;
  }
}

/* ───────── welcome and detail dialogs ───────── */
.ekbg-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 12px;
}
.ekbg-modal-top {
  z-index: 1300;
}
.ekbg-backdrop {
  position: absolute;
  inset: 0;
  background: var(--ekb-overlay);
  animation: ekbg-fade 160ms ease-out both;
}
.ekbg-welcome,
.ekbg-detail {
  position: relative;
  box-sizing: border-box;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border-radius: 20px;
  background:
    radial-gradient(70% 60% at 0% 0%, var(--ekbg-wash), transparent 65%),
    linear-gradient(160deg, var(--ekb-card-a), var(--ekb-card-b));
  box-shadow:
    var(--ekb-pop-shadow),
    0 30px 80px -30px var(--ekbg-shade);
  animation: ekbg-fade 160ms ease-out both;
}
.ekbg-welcome:focus,
.ekbg-tip:focus {
  outline: none;
}
.ekbg-welcome {
  display: flex;
  width: min(600px, calc(100vw - 24px));
}
.ekbg-welcome-hero {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: center;
  width: 210px;
  padding: 24px 0;
  background: radial-gradient(60% 55% at 50% 60%, var(--ekbg-wash), transparent 72%);
}
.ekbg-hero {
  width: 190px;
  height: 190px;
  filter: drop-shadow(0 18px 22px rgba(20, 28, 45, 0.22));
}
.ekbg-welcome-main {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px 24px 8px;
}
.ekbg-title-lg {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ekb-fg);
}
.ekbg-lead {
  margin: -8px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ekb-fg2);
}
.ekbg-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ekbg-lines li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ekbg-line-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ekb-fg);
}
.ekbg-line-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ekb-fg2);
}
.ekbg-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.ekbg-actions .ekbg-btn {
  height: 36px;
  padding: 0 15px;
  font-size: 13px;
}
@media (max-width: 639px) {
  .ekbg-welcome {
    flex-direction: column;
  }
  .ekbg-welcome-hero {
    width: auto;
    padding: 18px 16px 0;
  }
  .ekbg-hero {
    width: 150px;
    height: 150px;
  }
  .ekbg-welcome-main {
    padding: 14px 20px 20px;
  }
}

.ekbg-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(620px, calc(100vw - 24px));
  padding: 16px 20px 22px;
}
.ekbg-detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 0 -6px;
}
.ekbg-detail-mascot {
  width: 96px;
  height: 96px;
}
.ekbg-title-md {
  flex: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ekb-fg);
}
.ekbg-close {
  display: grid;
  flex: none;
  place-items: center;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ekb-fg2);
  cursor: pointer;
}
.ekbg-close:hover {
  color: var(--ekb-fg);
}
.ekbg-close svg {
  width: 18px;
  height: 18px;
}
.ekbg-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ekbg-steps li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ekb-fg2);
}
.ekbg-step-no {
  min-width: 18px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--ekbg-text);
  font-variant-numeric: tabular-nums;
}
.ekbg-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--ekb-well);
  box-shadow: var(--ekb-sink);
}
.ekbg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}
.ekbg-table th,
.ekbg-table td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.ekbg-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ekb-fg2);
}
.ekbg-table tbody th {
  font-weight: 600;
  color: var(--ekb-fg);
}
.ekbg-table tbody td {
  color: var(--ekb-fg2);
}
.ekbg-table tbody tr > * {
  border-top: 1px solid var(--ekb-line);
}
.ekbg-note {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ekb-fg2);
}

@keyframes ekbg-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.9);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.1);
  }
}
@keyframes ekbg-fade {
  from {
    opacity: 0;
  }
}
@keyframes ekbg-tip-in {
  from {
    opacity: 0;
    translate: 0 5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ekbg-lit .ekbg-halo,
  .ekbg-ring,
  .ekbg-dim,
  .ekbg-tip,
  .ekbg-backdrop,
  .ekbg-welcome,
  .ekbg-detail {
    animation: none !important;
    transition: none !important;
  }
}
