:root {
  --wb-mint: #8cf0c5;
  --wb-teal: #35c7b0;
  --wb-amber: #f0aa48;
  --wb-red: #ff716b;
  --wb-ink: #07110f;
}

.wandering-boy-root {
  position: fixed;
  inset: 0;
  z-index: 118;
  overflow: hidden;
  pointer-events: none;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wandering-boy-track {
  position: absolute;
  left: 0;
  bottom: 14px;
  width: clamp(180px, 18vw, 220px);
  will-change: transform;
  pointer-events: none;
}

.wandering-boy-root[data-mode="dashboard"] .wandering-boy-track {
  bottom: 50px;
}

.wandering-boy-root[data-mode="app"] {
  z-index: 90;
}

.wandering-boy-root[data-mode="app"] .wandering-boy-track {
  bottom: 76px;
  width: clamp(180px, 18vw, 220px);
}

.wandering-boy-actor {
  /* The Command theme styles all buttons with a filled background. The
     canvas launcher must stay transparent, including hover/focus states. */
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  outline: 0;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  filter: drop-shadow(0 13px 12px rgba(0, 0, 0, .48));
}

.wandering-boy-root[data-dragging="true"] .wandering-boy-actor { cursor: grabbing; }
.wandering-boy-root[data-dismissed="true"] .wandering-boy-track,
.wandering-boy-root[data-dismissed="true"] .wandering-boy-panel { display: none; }

.wandering-boy-reopen {
  position: absolute;
  right: 14px;
  bottom: 18px;
  display: none;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(140, 240, 197, .42);
  border-radius: 999px;
  background: rgba(7, 20, 17, .96);
  color: #dcfff0;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  cursor: pointer;
  pointer-events: auto;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.wandering-boy-root[data-dismissed="true"] .wandering-boy-reopen { display: block; }
.wandering-boy-root[data-mode="dashboard"] .wandering-boy-reopen { bottom: 52px; }
.wandering-boy-root[data-mode="app"] .wandering-boy-reopen { bottom: 76px; }
.wandering-boy-reopen:hover,
.wandering-boy-reopen:focus-visible { border-color: var(--wb-mint); outline: 0; }

.wandering-boy-actor:focus-visible {
  border-radius: 44%;
  outline: 3px solid var(--wb-mint);
  outline-offset: 4px;
}

.wandering-boy-character {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  transform: scaleX(var(--wb-facing, 1));
  transform-origin: center bottom;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity 140ms linear;
}

.wandering-boy-character[hidden] { display: none; }
.wandering-boy-fallback { display: block; width: 100%; max-height: 245px; object-fit: contain; }
.wandering-boy-root[data-paused="true"] .wandering-boy-character { transition: none; }
.wandering-boy-root[data-paused="true"] .wandering-boy-beacon { animation: none; }
.wandering-boy-motion-choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wandering-boy-motion-label { width: 100%; margin: 0 0 4px; font-size: 10px; color: #9fbdaf; }
.wandering-boy-motion-choices button:disabled { opacity: .5; cursor: default; }
.wandering-boy-motion-choices button[aria-pressed="true"] { border-color: var(--wb-mint); }

.wandering-boy-beacon {
  position: absolute;
  top: 26%;
  right: 31%;
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 999px;
  background: var(--wb-teal);
  box-shadow: 0 0 0 0 rgba(53, 199, 176, .55);
  animation: wandering-boy-beacon 1.8s ease-out infinite;
}

.wandering-boy-root[data-tone="critical"] .wandering-boy-beacon {
  background: var(--wb-red);
  box-shadow: 0 0 0 0 rgba(255, 113, 107, .58);
}

.wandering-boy-root[data-tone="warning"] .wandering-boy-beacon {
  background: var(--wb-amber);
  box-shadow: 0 0 0 0 rgba(240, 170, 72, .56);
}

.wandering-boy-speech {
  position: absolute;
  left: 82%;
  top: 3%;
  width: max-content;
  max-width: min(250px, 58vw);
  padding: 9px 12px;
  border: 1px solid rgba(140, 240, 197, .42);
  border-radius: 13px 13px 13px 4px;
  background: rgba(6, 16, 14, .96);
  color: #eefcf6;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .42);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .2s ease, transform .2s ease;
}

.wandering-boy-speech::after {
  position: absolute;
  left: -7px;
  bottom: 8px;
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(140, 240, 197, .42);
  border-bottom: 1px solid rgba(140, 240, 197, .42);
  background: rgba(6, 16, 14, .96);
  content: "";
  transform: rotate(45deg);
}

.wandering-boy-speech[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

.wandering-boy-speech[data-left="true"] { left: auto; right: 62%; }

.wandering-boy-panel {
  --wb-panel-bottom: 22px;
  --wb-panel-top-gap: 12px;
  position: absolute;
  right: 18px;
  bottom: var(--wb-panel-bottom);
  display: flex;
  flex-direction: column;
  width: min(430px, calc(100vw - 32px));
  height: min(640px, calc(100vh - var(--wb-panel-bottom) - var(--wb-panel-top-gap)));
  height: min(640px, calc(100dvh - var(--wb-panel-bottom) - var(--wb-panel-top-gap)));
  overflow: hidden;
  border: 1px solid rgba(140, 240, 197, .27);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 6%, rgba(53, 199, 176, .16), transparent 31%),
    linear-gradient(160deg, rgba(12, 27, 23, .985), rgba(5, 12, 11, .985));
  color: #eaf9f2;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .05);
  pointer-events: auto;
  scrollbar-color: rgba(140, 240, 197, .35) transparent;
}

.wandering-boy-root[data-mode="dashboard"] .wandering-boy-panel {
  --wb-panel-bottom: 50px;
}

.wandering-boy-root[data-mode="app"] .wandering-boy-panel {
  --wb-panel-bottom: 74px;
}

.wandering-boy-panel,
.wandering-boy-panel * { box-sizing: border-box; min-width: 0; }

.wandering-boy-panel[hidden] {
  display: none;
}

.wandering-boy-panel-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 17px 12px;
  border-bottom: 1px solid rgba(140, 240, 197, .14);
}

.wandering-boy-kicker {
  margin: 0 0 3px;
  color: var(--wb-mint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.wandering-boy-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  line-height: 1.1;
}

.wandering-boy-panel-controls {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.wandering-boy-icon-button {
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(140, 240, 197, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  color: #eaf9f2;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
}

.wandering-boy-icon-button:hover,
.wandering-boy-icon-button:focus-visible {
  border-color: rgba(140, 240, 197, .72);
  background: rgba(140, 240, 197, .11);
  outline: 0;
}

.wandering-boy-panel-body {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
  padding: 12px 17px 14px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.wandering-boy-overview {
  flex: 0 1 auto;
  min-height: 32px;
  max-height: 35%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wandering-boy-overview-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px;
  cursor: pointer;
  list-style: none;
}

.wandering-boy-overview-summary::-webkit-details-marker { display: none; }
.wandering-boy-overview-summary:focus-visible { outline: 2px solid var(--wb-mint); outline-offset: -2px; }
.wandering-boy-details-label { flex-shrink: 0; color: var(--wb-mint); font-size: 11px; font-weight: 800; }
.wandering-boy-details-label::after { content: " +"; }
.wandering-boy-overview[open] .wandering-boy-details-label::after { content: " −"; }
.wandering-boy-overview-content { padding: 10px 2px 2px; }

.wandering-boy-overview .wandering-boy-status {
  margin: 0;
}

.wandering-boy-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(53, 199, 176, .33);
  border-radius: 999px;
  background: rgba(53, 199, 176, .09);
  color: #baf7dd;
  font-size: 11px;
  font-weight: 850;
}

.wandering-boy-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wb-teal);
  content: "";
}

.wandering-boy-root[data-tone="critical"] .wandering-boy-status {
  border-color: rgba(255, 113, 107, .42);
  background: rgba(255, 113, 107, .1);
  color: #ffd3cf;
}

.wandering-boy-root[data-tone="critical"] .wandering-boy-status::before { background: var(--wb-red); }
.wandering-boy-root[data-tone="warning"] .wandering-boy-status::before { background: var(--wb-amber); }

.wandering-boy-headline {
  margin: 0 0 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.22;
}

.wandering-boy-message,
.wandering-boy-server {
  margin: 0;
  color: #b9cdc5;
  font-size: 13px;
  line-height: 1.52;
}

.wandering-boy-server {
  flex: 0 0 auto;
  margin: 0;
  color: #7fa99a;
  font-size: 11px;
  font-weight: 750;
}

.wandering-boy-issues {
  display: grid;
  gap: 9px;
  margin: 15px 0;
}

.wandering-boy-issue {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(140, 240, 197, .16);
  border-left: 3px solid var(--wb-teal);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.wandering-boy-issue[data-severity="critical"] { border-left-color: var(--wb-red); }
.wandering-boy-issue[data-severity="warning"] { border-left-color: var(--wb-amber); }

.wandering-boy-issue strong {
  color: #f6fff9;
  font-size: 12px;
}

.wandering-boy-issue span {
  color: #a9bdb5;
  font-size: 11px;
  line-height: 1.42;
}

.wandering-boy-issue a {
  width: fit-content;
  margin-top: 3px;
  color: var(--wb-mint);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.wandering-boy-issue a:hover,
.wandering-boy-issue a:focus-visible { text-decoration: underline; }

.wandering-boy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wandering-boy-action {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(140, 240, 197, .3);
  border-radius: 10px;
  background: rgba(140, 240, 197, .09);
  color: #dcfff0;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.wandering-boy-action--primary {
  border-color: rgba(53, 199, 176, .7);
  background: linear-gradient(135deg, #188e7e, #12685f);
  color: #fff;
}

.wandering-boy-action:hover,
.wandering-boy-action:focus-visible {
  border-color: var(--wb-mint);
  filter: brightness(1.08);
  outline: 0;
}

.wandering-boy-chat {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  gap: 10px;
}

.wandering-boy-transcript {
  display: grid;
  flex: 1 1 0;
  min-height: 0;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-color: rgba(140, 240, 197, .35) transparent;
}

.wandering-boy-bubble {
  width: min(92%, 350px);
  padding: 9px 11px;
  border: 1px solid rgba(140, 240, 197, .16);
  border-radius: 12px 12px 12px 4px;
  background: rgba(255, 255, 255, .045);
}

.wandering-boy-bubble--user {
  justify-self: end;
  border-color: rgba(53, 199, 176, .34);
  border-radius: 12px 12px 4px 12px;
  background: rgba(53, 199, 176, .12);
}

.wandering-boy-bubble-label {
  display: block;
  margin-bottom: 3px;
  color: var(--wb-mint);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.wandering-boy-bubble--user .wandering-boy-bubble-label { color: #fff; }
.wandering-boy-bubble p {
  margin: 0;
  color: #d8e8e1;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.wandering-boy-navigation {
  display: inline-flex;
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid rgba(140, 240, 197, .38);
  border-radius: 8px;
  color: var(--wb-mint);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.wandering-boy-quick-prompts {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
}

.wandering-boy-prompt {
  padding: 6px 8px;
  border: 1px solid rgba(140, 240, 197, .22);
  border-radius: 999px;
  background: rgba(140, 240, 197, .06);
  color: #c8e7da;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}

.wandering-boy-prompt:hover,
.wandering-boy-prompt:focus-visible { border-color: var(--wb-mint); color: #fff; outline: 0; }

.wandering-boy-form {
  display: grid;
  flex: 0 0 auto;
  margin: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
}

.wandering-boy-input {
  width: 100%;
  height: 54px;
  min-height: 46px;
  resize: none;
  overflow-y: auto;
  padding: 9px 10px;
  border: 1px solid rgba(140, 240, 197, .25);
  border-radius: 10px;
  background: rgba(0, 0, 0, .24);
  color: #f5fff9;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.wandering-boy-input:focus { border-color: var(--wb-mint); outline: 2px solid rgba(140, 240, 197, .14); }
.wandering-boy-input::placeholder { color: #78988b; }

.wandering-boy-send {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(53, 199, 176, .72);
  border-radius: 10px;
  background: linear-gradient(135deg, #188e7e, #12685f);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.wandering-boy-send:disabled,
.wandering-boy-input:disabled { cursor: wait; opacity: .65; }

@keyframes wandering-boy-beacon {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 680px) {
  .wandering-boy-track { width: 180px; bottom: 58px; }
  .wandering-boy-root[data-mode="app"] .wandering-boy-track { width: 180px; }
  .wandering-boy-root[data-mode="dashboard"] .wandering-boy-track { bottom: 58px; }
  .wandering-boy-panel,
  .wandering-boy-root[data-mode="dashboard"] .wandering-boy-panel {
    --wb-panel-bottom: 10px;
    --wb-panel-top-gap: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
  .wandering-boy-root[data-mode="app"] .wandering-boy-panel {
    --wb-panel-bottom: 72px;
    right: 10px;
    width: calc(100vw - 20px);
  }
  .wandering-boy-speech { max-width: 190px; font-size: 11px; }
  .wandering-boy-root[data-dismissed="true"] .wandering-boy-reopen { right: 10px; }
}

@media (max-height: 500px) {
  .wandering-boy-track, .wandering-boy-root[data-mode="app"] .wandering-boy-track { width: 135px; }
  .wandering-boy-panel-head { padding: 8px 12px; align-items: center; }
  .wandering-boy-kicker { display: none; }
  .wandering-boy-title { font-size: 18px; }
  .wandering-boy-panel-body { padding: 8px 12px; gap: 6px; }
  .wandering-boy-chat { gap: 6px; }
  .wandering-boy-input { height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .wandering-boy-character { transition: none; }
  .wandering-boy-beacon { animation: none; }
  .wandering-boy-speech { transition: none; }
}
