/*
 * Bodylet AI: the live session demo
 *
 * Needs the brand tokens (tokens/tokens.css) and typefaces (fonts/fonts.css)
 * on the page. Three layers, in this order:
 *
 *   .bl-sd       the session window: bar, screen, trail
 *   .bl-rd-*     the remote desktop inside the screen, in two looks
 *                (data-skin="pane" and data-skin="dusk"), and its windows
 *   .pt-* .fw-* .gm-*   the interfaces inside those windows
 *
 * The window takes the scheme of the page (light with tokens/light.css); the
 * screen inside it keeps the dark scheme in both, as the remote desktop is the
 * same picture whatever the page around it.
 *
 * The remote desktop is laid out on a fixed stage of 720 × 405 px and scaled
 * as a whole, so every size below the "Remote desktop" heading is in stage
 * pixels. README.md is the design specification; the numbers here are its
 * numbers.
 */

/* ══ The session window ═════════════════════════════════════════════════════ */

.bl-sd {
  --sd-inset: 8px;                 /* space around the screen */
  --sd-side: 296px;                /* width of the trail */
  --sd-agent: var(--bl-agent);
  --sd-human: var(--bl-human);

  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--bl-border-strong);
  border-radius: var(--bl-radius-lg);
  background: var(--bl-window-bg);
  box-shadow: var(--bl-highlight), var(--bl-shadow-3);
  color: var(--bl-text);
  font-family: var(--bl-font-sans);
  font-size: var(--bl-text-sm);
  line-height: var(--bl-leading-ui);
  text-align: left;
  -webkit-text-size-adjust: 100%;  /* a phone must not enlarge the text of the window by itself */
  text-size-adjust: 100%;
  container: bl-sd / inline-size;
}

.bl-sd *,
.bl-sd *::before,
.bl-sd *::after {
  box-sizing: border-box;
}

.bl-sd [hidden] {
  display: none !important;
}

.bl-sd-icon {
  flex: none;
  width: 1em;
  height: 1em;
}

/* ── Bar ───────────────────────────────────────────────────────────────── */

.bl-sd__bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 10px 0 16px;
  border-bottom: 1px solid var(--bl-border);
}

.bl-sd__machine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--bl-text-3);
  font-size: var(--bl-text-xs);
  white-space: nowrap;
}

.bl-sd__machine .bl-sd-icon {
  width: 16px;
  height: 16px;
}

.bl-sd__machine b {
  color: var(--bl-text);
  font-family: var(--bl-font-mono);
  font-size: var(--bl-text-sm);
  font-weight: var(--bl-weight-semibold);
  letter-spacing: -0.01em;
}

.bl-sd__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bl-text-2);
  font-size: var(--bl-text-xs);
  font-weight: var(--bl-weight-medium);
  white-space: nowrap;
}

.bl-sd__link i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bl-ok);
  transition: background-color var(--bl-dur-2) ease;
}

.bl-sd__link[data-state="connecting"] {
  color: var(--bl-text-3);
}

.bl-sd__link[data-state="connecting"] i {
  background: var(--bl-text-3);
  animation: bl-sd-breathe 900ms var(--bl-ease-in-out) infinite alternate;
}

.bl-sd__link[data-state="off"] {
  color: var(--bl-text-3);
}

.bl-sd__link[data-state="off"] i {
  background: var(--bl-text-faint);
}

.bl-sd__actions {
  display: inline-flex;
  flex: none;
  gap: 8px;
  margin-left: auto;
}

/* The two controls exist only where they work: hidden until the script runs,
   absent where scripting is off. Their place is kept, so nothing moves. */
.bl-sd:not(.is-live) .bl-sd__actions {
  visibility: hidden;
}

@media (scripting: none) {
  .bl-sd__actions {
    display: none;
  }
}

.bl-sd-btn {
  --_bg: var(--bl-surface-1);
  --_bg-hover: var(--bl-surface-3);
  --_fg: var(--bl-text);
  --_bd: var(--bl-border-strong);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--_bd);
  border-radius: var(--bl-radius-sm);
  background: var(--_bg);
  color: var(--_fg);
  font: var(--bl-weight-semibold) var(--bl-text-sm) / 1 var(--bl-font-sans);
  letter-spacing: var(--bl-tracking-ui);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--bl-dur-1) ease,
    border-color var(--bl-dur-1) ease,
    color var(--bl-dur-1) ease,
    transform var(--bl-dur-1) var(--bl-ease-out);
}

.bl-sd-btn:hover {
  background: var(--_bg-hover);
}

.bl-sd-btn:active {
  transform: scale(0.975);
}

.bl-sd-btn:focus-visible {
  outline: 2px solid var(--bl-accent);
  outline-offset: 2px;
}

.bl-sd-btn .bl-sd-icon {
  width: 15px;
  height: 15px;
}

.bl-sd-btn--human {
  --_bg: var(--bl-human-wash);
  --_bg-hover: color-mix(in srgb, var(--bl-human) 20%, transparent);
  --_fg: var(--bl-human);
  --_bd: var(--bl-human-line);
}

.bl-sd-btn--danger {
  --_bg: var(--bl-danger-wash);
  --_bg-hover: color-mix(in srgb, var(--bl-danger) 20%, transparent);
  --_fg: var(--bl-danger);
  --_bd: var(--bl-danger-line);
}

/* ── Split ─────────────────────────────────────────────────────────────── */

.bl-sd__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sd-side);
  min-height: 0;
}

.bl-sd__main {
  min-width: 0;
  padding: var(--sd-inset);
}

/* ── Screen ────────────────────────────────────────────────────────────── */

.bl-sd__screen {
  /* The screen keeps the dark scheme in every scheme (tokens/tokens.css): its
     pointers are the lime and the blue drawn for the remote desktop. */
  --sd-agent: var(--bl-agent);
  --sd-human: var(--bl-human);
  --_edge: var(--bl-accent-line-strong);
  --_halo: rgba(176, 240, 79, 0.16);

  position: relative;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  border-radius: var(--bl-radius-md);
  background: var(--bl-black);
  isolation: isolate;
  touch-action: manipulation;
}

.bl-sd__screen[data-holder="human"] {
  --_edge: var(--sd-human);
  --_halo: rgba(156, 203, 255, 0.16);
}

.bl-sd__screen[data-holder="none"] {
  --_edge: var(--bl-border-strong);
  --_halo: transparent;
}

/* Whose desktop it is right now, said by the edge. */
.bl-sd__edge {
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--_edge), inset 0 0 22px -6px var(--_halo);
  pointer-events: none;
  transition: box-shadow var(--bl-dur-2) ease;
}

/* The still follows the rule of the live screen: the desktop is never drawn
   under 0.7 of its size (504 by 283.5). On a narrower screen the still shows
   a part of the desktop, the part where its story ends (--_fx, --_fy: 0 is
   the left or top edge, 1 the right or bottom one). */
.bl-sd__still {
  --_w: max(100%, 504px);
  --_h: max(100%, 283.5px);

  position: absolute;
  top: calc((100% - var(--_h)) * var(--_fy, 0.5));
  left: calc((100% - var(--_w)) * var(--_fx, 0.5));
  display: block;
  width: var(--_w);
  max-width: none;
  height: var(--_h);
  object-fit: cover;
}

.bl-sd[data-scenario="browser"] .bl-sd__still {
  --_fx: 1;                        /* the download, top right */
  --_fy: 0;
}

.bl-sd[data-scenario="systems"] .bl-sd__still {
  --_fy: 0.2;                      /* the window from its title down */
}

.bl-sd[data-scenario="workstation"] .bl-sd__still {
  --_fx: 1;                        /* the running program, at the right */
  --_fy: 0.7;
}

.bl-sd__cam {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  transform-origin: 0 0;
  will-change: transform;
}

.bl-sd__cam.is-ended {
  filter: grayscale(1) brightness(0.22);
}

.bl-sd__stage {
  position: relative;
  width: 720px;
  height: 405px;
  overflow: hidden;
  opacity: 1;
  transition: opacity 240ms ease;
}

.bl-sd__stage[inert] {
  pointer-events: none;            /* what `inert` does, for an engine that does not know it */
  user-select: none;
  -webkit-user-select: none;
}

.bl-sd__stage.is-out {
  opacity: 0;
}

/* A visitor in control drives the blue pointer; the system one steps aside. */
.bl-sd__screen[data-holder="human"],
.bl-sd__screen[data-holder="human"] * {
  cursor: none !important;
}

/* ── Pointers ──────────────────────────────────────────────────────────── */

.bl-sd-ptr {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: 22px;
  height: 22px;
  margin: -2.2px 0 0 -2.9px;       /* the tip of the arrow is the hot spot */
  color: var(--sd-agent);
  pointer-events: none;
  will-change: transform;
  transition: opacity var(--bl-dur-2) ease;
}

.bl-sd-ptr--human {
  z-index: 5;
  color: var(--sd-human);
}

.bl-sd-ptr svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.5));
  transform-origin: 2.9px 2.2px;
  transition: transform 70ms var(--bl-ease-out);
}

.bl-sd-ptr.is-down svg {
  transform: scale(0.86);
}

.bl-sd-ptr__arrow {
  fill: currentColor;
  stroke: var(--bl-text-on-accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* The agent's mark: the full stop of the wordmark, the dot that means "live". */
.bl-sd-ptr__dot {
  fill: currentColor;
  stroke: var(--bl-text-on-accent);
  stroke-width: 1.3;
  transition: fill var(--bl-dur-2) ease;
}

.bl-sd-ptr.is-parked {
  opacity: 0.6;
}

/* No session, no agent on the desktop. */
.bl-sd[data-mode="ended"] .bl-sd-ptr {
  opacity: 0;
}

.bl-sd-ptr.is-parked .bl-sd-ptr__dot {
  fill: var(--bl-text-on-accent);
  stroke: currentColor;
}

.bl-sd-ptr__ring {
  position: absolute;
  top: -10.8px;
  left: -10.1px;
  width: 26px;
  height: 26px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.3);
}

.bl-sd-ptr__ring.is-on {
  animation: bl-sd-ring 380ms var(--bl-ease-out);
}

@keyframes bl-sd-ring {
  from {
    opacity: 0.7;
    transform: scale(0.3);
  }
  to {
    opacity: 0;
    transform: scale(1);
  }
}

/* ── Capture marks: a screenshot was taken ─────────────────────────────── */

.bl-sd__marks {
  position: absolute;
  inset: 10px;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
}

.bl-sd__marks.is-on {
  animation: bl-sd-marks 560ms var(--bl-ease-out);
}

.bl-sd__marks i {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--sd-agent);
}

.bl-sd__marks i:nth-child(1) { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 4px; }
.bl-sd__marks i:nth-child(2) { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 4px; }
.bl-sd__marks i:nth-child(3) { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 4px; }
.bl-sd__marks i:nth-child(4) { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 4px; }

@keyframes bl-sd-marks {
  0% {
    opacity: 0;
    transform: scale(1.025);
  }
  22% {
    opacity: 1;
    transform: none;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* ── Veil: connecting, ended ───────────────────────────────────────────── */

.bl-sd__veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  opacity: 0;
  transition: opacity var(--bl-dur-2) ease;
}

.bl-sd__veil.is-on {
  opacity: 1;
}

.bl-sd[data-mode="ended"] .bl-sd__veil {
  background: rgba(4, 6, 5, 0.5);
}

.bl-sd__veil p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.bl-sd__veil b {
  color: var(--bl-text);
  font-size: var(--bl-text-md);
  font-weight: var(--bl-weight-semibold);
}

.bl-sd__veil span {
  color: var(--bl-text-2);
  font-size: var(--bl-text-sm);
}

.bl-sd__veil span:empty {
  display: none;
}

/* ── Trail ─────────────────────────────────────────────────────────────── */

.bl-sd__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--bl-border);
  contain: size;                   /* the screen sets the height, not the trail */
}

.bl-sd__head {
  flex: none;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--bl-border);
}

.bl-sd__holder {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--bl-text);
  font-size: var(--bl-text-sm);
  font-weight: var(--bl-weight-semibold);
}

.bl-sd__holder i {
  --_c: var(--sd-agent);
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 3px;
  border-radius: 50%;
  background: var(--_c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--_c) 18%, transparent);
  transition: background-color var(--bl-dur-2) ease, box-shadow var(--bl-dur-2) ease;
}

.bl-sd__holder[data-holder="human"] i {
  --_c: var(--sd-human);
}

.bl-sd__holder[data-holder="none"] i {
  --_c: var(--bl-text-faint);
}

.bl-sd__task {
  margin: 6px 0 0 24px;
  color: var(--bl-text-2);
  font-size: var(--bl-text-sm);
  line-height: 1.45;
  text-wrap: pretty;
}

.bl-sd__log {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 8px 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

/* Older steps leave under a soft edge, not a hard cut. */
.bl-sd__log.is-scrolled {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
}

/* Before the script runs, and without it, the trail is the finished story.
   What matters is its end: the last steps and the outcome. The column is
   laid out from its bottom edge, so it opens on its end in every engine with
   no script, older steps pass under the same soft edge as in the live state,
   and the reader can still scroll back up. A trail shorter than the column
   stays at the top (the auto margin takes the free space). */
.bl-sd:not(.is-live) .bl-sd__log {
  display: flex;
  flex-direction: column-reverse;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28px);
}

.bl-sd:not(.is-live) .bl-sd__trail {
  flex: none;
  margin-bottom: auto;
  padding-top: 22px;               /* keeps a short trail clear of the soft edge */
}

.bl-sd__log::-webkit-scrollbar {
  display: none;
}

.bl-sd__trail {
  margin: 0;
  padding: 0;
  list-style: none;
  transition: opacity 280ms ease;
}

.bl-sd__trail.is-leaving {
  opacity: 0;
}

/* Shown only while the trail is empty, whatever the markup says. */
.bl-sd__trail:not(:empty) + .bl-sd__empty {
  display: none;
}

.bl-sd__empty {
  margin: 0;
  padding: 6px 0 0 24px;
  color: var(--bl-text-3);
  font-size: var(--bl-text-sm);
}

.bl-sd-step {
  --_c: var(--bl-lime-600);
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  column-gap: 10px;
  padding: 6px 0;
  transition: opacity 240ms var(--bl-ease-out), transform 240ms var(--bl-ease-out);
}

.bl-sd-step.is-entering {
  opacity: 0;
  transform: translateY(5px);
  transition: none;
}

/* The rail between two steps. */
.bl-sd-step::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -7px;
  left: 6.5px;
  width: 1px;
  background: var(--bl-border);
}

.bl-sd-step:last-child::before {
  display: none;
}

.bl-sd-step__node {
  display: grid;
  place-items: center;
  grid-row: 1 / span 3;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border-radius: 50%;
  color: var(--_c);
}

.bl-sd-step__node::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: background-color var(--bl-dur-2) ease, box-shadow var(--bl-dur-2) ease;
}

.bl-sd-step__text {
  grid-column: 2;
  color: var(--bl-text-2);
  font-size: var(--bl-text-sm);
  font-weight: var(--bl-weight-medium);
  line-height: 1.4;
  transition: color var(--bl-dur-2) ease;
}

.bl-sd-step__tool {
  grid-column: 2;
  margin-top: 1px;
  color: var(--bl-text-3);
  font-family: var(--bl-font-mono);
  font-size: var(--bl-text-2xs);
  font-variant-ligatures: none;
  line-height: 1.45;
}

.bl-sd-step__note {
  grid-column: 2;
  margin-top: 1px;
  color: var(--bl-text-3);
  font-size: var(--bl-text-xs);
  line-height: 1.45;
}

/* Happening now. */
.bl-sd-step[data-state="doing"] {
  --_c: var(--sd-agent);
}

.bl-sd-step[data-state="doing"] .bl-sd-step__text {
  color: var(--bl-text);
}

.bl-sd-step[data-state="doing"] .bl-sd-step__node::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px currentColor;
  width: 8px;
  height: 8px;
  animation: bl-sd-breathe 800ms var(--bl-ease-in-out) infinite alternate;
}

/* The visitor's own actions. */
.bl-sd-step[data-who="human"] {
  --_c: var(--sd-human);
}

.bl-sd-step[data-who="human"] .bl-sd-step__text {
  color: var(--bl-text);
}

.bl-sd-step[data-state="stopped"] {
  --_c: var(--bl-danger);
}

/* An input the desktop refused. */
.bl-sd-step[data-state="refused"] {
  --_c: var(--bl-danger);
}

.bl-sd-step[data-state="refused"] .bl-sd-step__node {
  background: var(--bl-danger-wash);
}

.bl-sd-step[data-state="refused"] .bl-sd-step__node::before {
  display: none;
}

.bl-sd-step[data-state="refused"] .bl-sd-step__node .bl-sd-icon,
.bl-sd-step--result .bl-sd-step__node .bl-sd-icon {
  width: 9px;
  height: 9px;
  stroke-width: 2.6;
}

.bl-sd-step[data-state="refused"] .bl-sd-step__text {
  color: var(--bl-text);
}

.bl-sd-step__tool b {
  color: var(--bl-danger);
  font-weight: var(--bl-weight-medium);
}

/* The outcome. */
.bl-sd-step--result {
  --_c: var(--sd-agent);
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--bl-border);
}

.bl-sd-step--result::before {
  display: none;
}

.bl-sd-step--result .bl-sd-step__node {
  background: var(--bl-accent-wash-3);
}

.bl-sd-step--result .bl-sd-step__node::before {
  display: none;
}

.bl-sd-step--result .bl-sd-step__text {
  color: var(--bl-text);
  font-weight: var(--bl-weight-semibold);
}

.bl-sd-shots {
  display: flex;
  grid-column: 2;
  gap: 8px;
  margin-top: 8px;
}

.bl-sd-shot {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
  max-width: 132px;
}

.bl-sd-shot__frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--bl-radius-sm);
  box-shadow: 0 0 0 1px var(--bl-border-strong);
}

.bl-sd-shot__frame > .bl-rd-desk {
  position: absolute;
  inset: 0 auto auto 0;
  width: 720px;
  height: 405px;
  transform: scale(0.16);          /* set to the frame's real width by the script */
  transform-origin: 0 0;
}

.bl-sd-shot code {
  color: var(--bl-text-3);
  font-family: var(--bl-font-mono);
  font-size: var(--bl-text-2xs);
}

@keyframes bl-sd-breathe {
  from {
    opacity: 0.45;
  }
  to {
    opacity: 1;
  }
}

/* ── Narrow: the trail goes under the screen ───────────────────────────── */

@container bl-sd (max-width: 880px) {
  .bl-sd__split {
    grid-template-columns: minmax(0, 1fr) 248px;
  }
}

@container bl-sd (max-width: 760px) {
  .bl-sd__split {
    grid-template-columns: minmax(0, 1fr);
  }

  .bl-sd__side {
    border-top: 1px solid var(--bl-border);
    border-left: 0;
    contain: none;
  }

  .bl-sd__head {
    padding: 12px 16px 10px;
  }

  .bl-sd__log {
    flex: none;
    height: 176px;
  }
}

@container bl-sd (max-width: 520px) {
  .bl-sd__bar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .bl-sd__machine .bl-sd-icon {
    display: none;
  }

  .bl-sd__link {
    margin-left: auto;
  }

  .bl-sd__actions {
    width: 100%;
    margin: 0;
  }

  .bl-sd-btn {
    flex: 1;
    height: 36px;
  }

  .bl-sd__main {
    --sd-inset: 6px;
  }
}

/* Engines without container queries (before 2023) take the same steps from
   the width of the page, which is right where the window is as wide as the
   page, as on a phone. */
@supports not (container-type: inline-size) {
  @media (max-width: 820px) {
    .bl-sd__split {
      grid-template-columns: minmax(0, 1fr);
    }

    .bl-sd__side {
      border-top: 1px solid var(--bl-border);
      border-left: 0;
      contain: none;
    }

    .bl-sd__head {
      padding: 12px 16px 10px;
    }

    .bl-sd__log {
      flex: none;
      height: 176px;
    }
  }

  @media (max-width: 560px) {
    .bl-sd__bar {
      flex-wrap: wrap;
      gap: 8px 10px;
      padding: 10px 12px;
    }

    .bl-sd__machine .bl-sd-icon {
      display: none;
    }

    .bl-sd__link {
      margin-left: auto;
    }

    .bl-sd__actions {
      width: 100%;
      margin: 0;
    }

    .bl-sd-btn {
      flex: 1;
      height: 36px;
    }

    .bl-sd__main {
      --sd-inset: 6px;
    }
  }
}

/* ══ Remote desktop ═════════════════════════════════════════════════════════
   Stage pixels from here on. Grid 4; radii 4 (marks), 5 to 6 (controls),
   8 or 10 (windows); type 9.5 / 10.5 / 11.5 / 13 / 15 to 16. */

.bl-rd-desk {
  --rd-win: #ffffff;
  --rd-chrome: #e9edf3;
  --rd-chrome-2: #f5f7fa;
  --rd-line: rgba(22, 32, 54, 0.1);
  --rd-line-2: rgba(22, 32, 54, 0.2);
  --rd-ink: #161d2b;
  --rd-ink-2: #4c586b;
  --rd-ink-3: #7b8698;
  --rd-hover: rgba(22, 32, 54, 0.06);
  --rd-press: rgba(22, 32, 54, 0.12);
  --rd-accent: #3d5fe0;
  --rd-accent-ink: #ffffff;
  --rd-select: rgba(61, 95, 224, 0.12);
  --rd-select-text: rgba(61, 95, 224, 0.28);
  --rd-field: #ffffff;
  --rd-url: #e6eaf1;
  --rd-win-radius: 8px;
  --rd-win-line: rgba(18, 28, 48, 0.22);
  --rd-sheet: #ffffff;
  --rd-sheet-line: #a9b3c2;

  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #2b4777;
  color: var(--rd-ink);
  font: 500 11.5px / 1.35 var(--bl-font-sans);
  letter-spacing: 0;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
}

.bl-rd-desk[data-skin="dusk"] {
  --rd-win: #1f1c28;
  --rd-chrome: #2b2836;
  --rd-chrome-2: #25222e;
  --rd-line: rgba(255, 255, 255, 0.08);
  --rd-line-2: rgba(255, 255, 255, 0.16);
  --rd-ink: #eceaf3;
  --rd-ink-2: #b6b1c6;
  --rd-ink-3: #8b869c;
  --rd-hover: rgba(255, 255, 255, 0.07);
  --rd-press: rgba(255, 255, 255, 0.13);
  --rd-accent: #b79cff;
  --rd-accent-ink: #1a1430;
  --rd-select: rgba(183, 156, 255, 0.16);
  --rd-select-text: rgba(183, 156, 255, 0.34);
  --rd-field: #17151f;
  --rd-url: rgba(255, 255, 255, 0.07);
  --rd-win-radius: 10px;
  --rd-win-line: rgba(255, 255, 255, 0.1);
  --rd-sheet: #34303f;
  --rd-sheet-line: #8b869c;
  background: #15101f;
}

.bl-rd-desk button {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

.bl-rd-desk button:focus-visible,
.bl-rd-desk input:focus-visible {
  outline: 1.5px solid var(--rd-accent);
  outline-offset: 1px;
}

.bl-rd-desk input {
  min-width: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.bl-rd-desk h3,
.bl-rd-desk p {
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-wrap: wrap;
}

/* Bold and small inherit; each interface sets its own. */
.bl-rd-desk b {
  color: inherit;
  font-weight: 600;
}

.bl-rd-desk small {
  font-size: inherit;
}

.bl-rd-desk ::selection {
  background: var(--rd-select-text);
  color: inherit;
}

.bl-rd-desk .bl-sd-icon {
  display: block;
}

.bl-rd-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bl-rd-kind {
  flex: none;
  width: 14px;
  height: 14px;
}

.bl-rd-wall {
  position: absolute;
  inset: 0;
  background: url("assets/wall-pane.svg") center / cover no-repeat;
}

[data-skin="dusk"] .bl-rd-wall {
  background-image: url("assets/wall-dusk.svg");
}

.bl-rd-wins {
  position: absolute;
  inset: 0;
}

/* ── Application tiles ─────────────────────────────────────────────────── */

.bl-rd-tile {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 27%;
  background: linear-gradient(160deg, #ffd27a, #f0a52e);
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.28);
  transition: transform 110ms var(--bl-ease-out);
}

.bl-rd-tile svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bl-rd-tile[data-tile="browser"] {
  background: linear-gradient(160deg, #7c98ff, #3a58d6);
}

.bl-rd-tile[data-tile="fernway"] {
  background: linear-gradient(160deg, #ff8f66, #dd4f28);
}

.bl-rd-tile[data-tile="game"] {
  background: linear-gradient(160deg, #2a322c, #141a16);
}

/* ── Pane: shortcuts, task bar, launcher ───────────────────────────────── */

.bl-rd-shortcuts {
  position: absolute;
  top: 10px;
  left: 8px;
  display: grid;
  gap: 4px;
}

.bl-rd-desk .bl-rd-shortcut {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 60px;
  padding: 6px 2px 5px;
  border-radius: 6px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-shadow: 0 1px 2px rgba(6, 12, 28, 0.7);
}

.bl-rd-shortcut .bl-rd-tile {
  width: 28px;
  height: 28px;
}

.bl-rd-shortcut:is(:hover, .is-hover) {
  background: rgba(255, 255, 255, 0.12);
}

.bl-rd-shortcut.is-selected {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.bl-rd-taskbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 36px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(233, 238, 246, 0.92);
  box-shadow: 0 -1px 0 rgba(14, 24, 44, 0.2);
}

.bl-rd-taskbar__apps {
  display: flex;
  grid-column: 2;
  gap: 3px;
}

.bl-rd-desk .bl-rd-task {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  transition: background-color 110ms ease;
}

.bl-rd-task .bl-rd-tile {
  width: 20px;
  height: 20px;
}

.bl-rd-task:is(:hover, .is-hover) {
  background: rgba(20, 30, 50, 0.08);
}

.bl-rd-task:is(:active, .is-active) {
  background: rgba(20, 30, 50, 0.13);
}

.bl-rd-task:is(:active, .is-active) .bl-rd-tile,
.bl-rd-task:is(:active, .is-active) > svg {
  transform: scale(0.88);
}

.bl-rd-task--home > svg {
  width: 17px;
  height: 17px;
  fill: var(--rd-accent);
  transition: transform 110ms var(--bl-ease-out);
}

.bl-rd-task--home.is-on {
  background: rgba(20, 30, 50, 0.1);
}

.bl-rd-task__run {
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 5px;
  height: 2.5px;
  margin-left: -2.5px;
  border-radius: 2px;
  background: rgba(20, 30, 50, 0.4);
  opacity: 0;
  transform-origin: center;
  transition: transform 160ms var(--bl-ease-out), opacity 120ms ease, background-color 120ms ease;
}

.bl-rd-task.is-running .bl-rd-task__run {
  opacity: 1;
}

.bl-rd-task.is-front .bl-rd-task__run {
  background: var(--rd-accent);
  transform: scaleX(2.6);
}

.bl-rd-clock {
  display: grid;
  grid-column: 3;
  justify-self: end;
  padding-right: 12px;
  color: var(--rd-ink-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: right;
}

.bl-rd-desk .bl-rd-clock b {
  color: var(--rd-ink);
  font-size: 10.5px;
  font-weight: 600;
}

.bl-rd-launcher {
  position: absolute;
  bottom: 43px;
  left: 50%;
  z-index: 900;
  width: 232px;
  margin-left: -116px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(246, 248, 251, 0.98);
  box-shadow: 0 0 0 1px rgba(18, 28, 48, 0.16), 0 16px 36px -12px rgba(8, 14, 30, 0.5);
  animation: bl-rd-rise 170ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

.bl-rd-desk .bl-rd-launcher p {
  margin-bottom: 8px;
  color: var(--rd-ink-3);
  font-size: 10px;
  font-weight: 600;
}

.bl-rd-launcher div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.bl-rd-desk .bl-rd-launcher button {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 7px 0 6px;
  border-radius: 6px;
  font-size: 10px;
}

.bl-rd-launcher button .bl-rd-tile {
  width: 26px;
  height: 26px;
}

.bl-rd-launcher button:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

@keyframes bl-rd-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ── Dusk: top panel and dock ──────────────────────────────────────────── */

.bl-rd-panel {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  height: 24px;
  background: rgba(12, 9, 18, 0.9);
  color: #eceaf3;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: pre;
}

.bl-rd-dock {
  position: absolute;
  top: 24px;
  bottom: 0;
  left: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 50px;
  padding-top: 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 14, 26, 0.82);
}

.bl-rd-dock .bl-rd-task {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.bl-rd-dock .bl-rd-task .bl-rd-tile {
  width: 26px;
  height: 26px;
}

.bl-rd-dock .bl-rd-task:is(:hover, .is-hover) {
  background: rgba(255, 255, 255, 0.1);
}

.bl-rd-dock .bl-rd-task:is(:active, .is-active) {
  background: rgba(255, 255, 255, 0.16);
}

.bl-rd-dock .bl-rd-task__run {
  top: 50%;
  bottom: auto;
  left: -5px;
  width: 3px;
  height: 3px;
  margin: -1.5px 0 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.55);
}

.bl-rd-dock .bl-rd-task.is-front .bl-rd-task__run {
  background: var(--rd-accent);
  transform: scaleY(3.4);
}

/* ── Windows ───────────────────────────────────────────────────────────── */

.bl-rd-win {
  position: absolute;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--rd-win-radius);
  background: var(--rd-win);
  box-shadow: 0 0 0 1px var(--rd-win-line), 0 10px 24px -12px rgba(6, 12, 28, 0.5), 0 2px 6px -2px rgba(6, 12, 28, 0.25);
  opacity: 0;
  transform: scale(0.9);
}

.bl-rd-win.is-front {
  box-shadow: 0 0 0 1px var(--rd-win-line), 0 22px 48px -14px rgba(6, 12, 28, 0.62), 0 5px 14px -4px rgba(6, 12, 28, 0.32);
}

/* Pane opens the way a Windows-style shell does: a short scale-up that
   decelerates hard. Dusk opens quicker and from a little further. */
.bl-rd-win.is-open {
  opacity: 1;
  transform: none;
  transition: transform 240ms cubic-bezier(0.1, 0.9, 0.2, 1), opacity 110ms linear, box-shadow 160ms ease;
}

[data-skin="dusk"] .bl-rd-win {
  transform: scale(0.84);
}

[data-skin="dusk"] .bl-rd-win.is-open {
  transform: none;
  transition: transform 170ms cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 120ms linear, box-shadow 160ms ease;
}

.bl-rd-win.is-still {
  transition: none !important;
}

.bl-rd-win.is-closing {
  opacity: 0;
  transform: scale(0.95);
  transition: transform 150ms cubic-bezier(0.4, 0, 1, 1), opacity 150ms cubic-bezier(0.4, 0, 1, 1);
  pointer-events: none;
}

.bl-rd-win.is-min {
  opacity: 0;
  transform: translate(var(--to-x, 0), var(--to-y, 120px)) scale(0.14);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.7, 0.2), opacity 160ms 60ms linear;
  pointer-events: none;
  visibility: hidden;
  transition-behavior: allow-discrete;
}

[data-skin="dusk"] .bl-rd-win.is-min {
  transition-duration: 250ms, 190ms;
}

.bl-rd-win.is-sizing {
  transition: left 200ms var(--bl-ease-out), top 200ms var(--bl-ease-out), width 200ms var(--bl-ease-out), height 200ms var(--bl-ease-out);
}

.bl-rd-win.is-max {
  border-radius: 0;
}

.bl-rd-win.is-dragging {
  transition: none;
}

.bl-rd-win__bar {
  display: flex;
  flex: none;
  align-items: center;
  height: 30px;
  background: var(--rd-chrome);
  touch-action: none;
}

.bl-rd-win__lead {
  display: flex;
  flex: 1;
  align-items: center;
  align-self: stretch;
  gap: 7px;
  min-width: 0;
  padding-left: 10px;
}

.bl-rd-win__title {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bl-rd-win:not(.is-front) .bl-rd-win__title {
  color: var(--rd-ink-3);
}

.bl-rd-win__ctl {
  display: flex;
  flex: none;
  align-self: stretch;
}

.bl-rd-desk .bl-rd-win__ctl button {
  display: grid;
  place-items: center;
  width: 32px;
  color: var(--rd-ink-2);
  transition: background-color 90ms ease, color 90ms ease;
}

.bl-rd-win__ctl .bl-sd-icon {
  width: 12px;
  height: 12px;
}

.bl-rd-win__ctl button:is(:hover, .is-hover) {
  background: var(--rd-hover);
  color: var(--rd-ink);
}

.bl-rd-win__ctl button:is(:active, .is-active) {
  background: var(--rd-press);
}

.bl-rd-win__ctl .bl-rd-win__close:is(:hover, .is-hover) {
  background: #d8433a;
  color: #fff;
}

.bl-rd-win__ctl .bl-rd-win__close:is(:active, .is-active) {
  background: #b9352d;
  color: #fff;
}

/* Dusk: round buttons, title in the middle of the header bar. */
[data-skin="dusk"] .bl-rd-win__bar {
  position: relative;
  height: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.28);
}

[data-skin="dusk"] .bl-rd-win__lead {
  justify-content: center;
  padding: 0 76px;
}

[data-skin="dusk"] .bl-rd-win__ctl {
  position: absolute;
  top: 0;
  right: 9px;
  bottom: 0;
  align-items: center;
  gap: 6px;
}

.bl-rd-desk[data-skin="dusk"] .bl-rd-win__ctl button {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

[data-skin="dusk"] .bl-rd-win__ctl .bl-sd-icon {
  width: 9px;
  height: 9px;
  stroke-width: 2.2;
}

.bl-rd-desk[data-skin="dusk"] .bl-rd-win__ctl button:is(:hover, .is-hover) {
  background: rgba(255, 255, 255, 0.17);
}

.bl-rd-desk[data-skin="dusk"] .bl-rd-win__ctl .bl-rd-win__close:is(:hover, .is-hover) {
  background: #e0574d;
}

.bl-rd-win__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* ── Shared controls ───────────────────────────────────────────────────── */

.bl-rd-desk .bl-rd-tool {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  color: var(--rd-ink-2);
  transition: background-color 90ms ease;
}

.bl-rd-tool .bl-sd-icon {
  width: 13px;
  height: 13px;
}

.bl-rd-tool:is(:hover, .is-hover) {
  background: var(--rd-hover);
  color: var(--rd-ink);
}

.bl-rd-tool:is(:active, .is-active) {
  background: var(--rd-press);
}

.bl-rd-tool:disabled {
  background: none;
  opacity: 0.32;
}

.bl-rd-tool.is-on {
  background: var(--rd-select);
  color: var(--rd-accent);
}

.bl-rd-desk .bl-rd-link {
  color: var(--rd-accent);
  font-size: 10.5px;
  font-weight: 600;
}

.bl-rd-link:is(:hover, .is-hover) {
  text-decoration: underline;
}

.bl-rd-desk .bl-rd-btn {
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--rd-line-2);
  font-size: 10.5px;
  font-weight: 600;
}

.bl-rd-btn:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

.bl-rd-btn:is(:active, .is-active) {
  background: var(--rd-press);
}

/* A text field. The ghost repeats the text so the agent's caret can sit
   after it; a real caret belongs to whoever really focuses the field. */
.bl-rd-field {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  height: 24px;
  border-radius: 6px;
  background: var(--rd-field);
  box-shadow: inset 0 0 0 1px var(--rd-line-2);
  transition: box-shadow 110ms ease, background-color 110ms ease;
}

.bl-rd-field:is(:hover, .is-hover) {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rd-ink) 34%, transparent);
}

.bl-rd-field:is(:focus-within, .is-focus) {
  box-shadow: inset 0 0 0 1.5px var(--rd-accent);
}

.bl-rd-field input,
.bl-rd-ghost {
  grid-area: 1 / 2;
  align-self: stretch;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 500;
}

.bl-rd-field input {
  user-select: text;
  -webkit-user-select: text;
}

.bl-rd-field input:focus-visible {
  outline: 0;
}

.bl-rd-field input::placeholder {
  color: var(--rd-ink-3);
  opacity: 1;
}

.bl-rd-ghost {
  display: flex;
  align-items: center;
  overflow: hidden;
  color: transparent;
  white-space: pre;
  pointer-events: none;
}

.bl-rd-ghost > span {
  border-radius: 2px;
}

.bl-rd-ghost > i {
  display: none;
  flex: none;
  width: 1px;
  height: 13px;
  margin-left: 0.5px;
  background: var(--rd-ink);
  animation: bl-rd-caret 1060ms steps(1) infinite;
}

.bl-rd-field.is-focus .bl-rd-ghost > i {
  display: block;
}

.bl-rd-field.is-typing .bl-rd-ghost > i {
  animation: none;
}

.bl-rd-field.is-all .bl-rd-ghost > span {
  background: var(--rd-select-text);
}

.bl-rd-field.is-all .bl-rd-ghost > i {
  display: none;
}

.bl-rd-field--secret input,
.bl-rd-field--secret .bl-rd-ghost > span {
  letter-spacing: 1.5px;
  -webkit-text-security: disc;
}

@keyframes bl-rd-caret {
  0% {
    opacity: 1;
  }
  53% {
    opacity: 0;
  }
}

.bl-rd-spin {
  display: block;
  flex: none;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: bl-rd-spin 700ms linear infinite;
}

@keyframes bl-rd-spin {
  to {
    transform: rotate(1turn);
  }
}

.bl-rd-desk .bl-rd-empty {
  padding: 22px 12px;
  color: var(--rd-ink-3);
  font-size: 10.5px;
  text-align: center;
}

/* ── File manager ──────────────────────────────────────────────────────── */

.bl-rd-files {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  height: 100%;
}

.bl-rd-files__side {
  display: grid;
  align-content: start;
  gap: 1px;
  padding: 8px 6px;
  border-right: 1px solid var(--rd-line);
  background: var(--rd-chrome-2);
}

.bl-rd-desk .bl-rd-place {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  color: var(--rd-ink-2);
  font-size: 11px;
}

.bl-rd-place:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

.bl-rd-place.is-on {
  background: var(--rd-select);
  color: var(--rd-ink);
  font-weight: 600;
}

.bl-rd-files__main {
  display: grid;
  grid-template-rows: 30px 22px minmax(0, 1fr) 21px;
  min-width: 0;
}

.bl-rd-files__tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border-bottom: 1px solid var(--rd-line);
}

.bl-rd-crumbs {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.bl-rd-crumbs i {
  color: var(--rd-ink-3);
}

.bl-rd-crumbs i .bl-sd-icon {
  width: 9px;
  height: 9px;
}

.bl-rd-desk .bl-rd-crumbs button {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--rd-ink-2);
  font-size: 11px;
}

.bl-rd-crumbs button:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

.bl-rd-desk .bl-rd-crumbs button.is-here {
  color: var(--rd-ink);
  font-weight: 600;
}

.bl-rd-files__head,
.bl-rd-desk .bl-rd-file {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 62px 58px;
  align-items: center;
  column-gap: 8px;
}

.bl-rd-files__head {
  padding: 0 14px 0 36px;
  grid-template-columns: minmax(0, 1fr) 62px 58px;
  border-bottom: 1px solid var(--rd-line);
  color: var(--rd-ink-3);
  font-size: 9.5px;
  font-weight: 600;
}

.bl-rd-files__list {
  padding: 4px;
  overflow: hidden;
}

.bl-rd-desk .bl-rd-file {
  width: 100%;
  height: 25px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--rd-ink-2);
  font-size: 10.5px;
  white-space: nowrap;
}

.bl-rd-file__name {
  overflow: hidden;
  color: var(--rd-ink);
  font-size: 11.5px;
  text-overflow: ellipsis;
}

.bl-rd-file:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

.bl-rd-file:is(:active, .is-active),
.bl-rd-file.is-selected {
  background: var(--rd-select);
}

.bl-rd-files__status {
  display: flex;
  align-items: center;
  padding: 0 12px;
  overflow: hidden;
  border-top: 1px solid var(--rd-line);
  background: var(--rd-chrome-2);
  color: var(--rd-ink-3);
  font-size: 10px;
  white-space: nowrap;
}

/* ── Browser ───────────────────────────────────────────────────────────── */

.bl-rd-win--browser .bl-rd-win__bar {
  background: color-mix(in srgb, var(--rd-chrome) 86%, var(--rd-ink) 5%);
}

.bl-rd-win--browser .bl-rd-win__lead {
  align-items: flex-end;
  padding-left: 8px;
}

[data-skin="dusk"] .bl-rd-win--browser .bl-rd-win__lead {
  justify-content: flex-start;
  padding: 0 76px 0 8px;
}

[data-skin="dusk"] .bl-rd-win--browser .bl-rd-win__bar {
  border-bottom: 0;
}

.bl-rd-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 200px;
  height: 25px;
  padding: 0 12px 0 9px;
  border-radius: 7px 7px 0 0;
  background: var(--rd-chrome-2);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.bl-rd-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bl-rd-fav {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--rd-ink-3);
}

.bl-rd-browser {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bl-rd-browser__bar {
  position: relative;
  z-index: 3;
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  height: 31px;
  padding: 0 8px;
  border-bottom: 1px solid var(--rd-line);
  background: var(--rd-chrome-2);
}

.bl-rd-url {
  flex: 1;
  height: 22px;
  margin: 0 4px;
  border-radius: 11px;
  background: var(--rd-url);
  box-shadow: none;
}

.bl-rd-url:is(:hover, .is-hover) {
  box-shadow: inset 0 0 0 1px var(--rd-line-2);
}

.bl-rd-url:is(:focus-within, .is-focus) {
  background: var(--rd-field);
}

.bl-rd-url input,
.bl-rd-url .bl-rd-ghost {
  padding: 0 11px;
}

.bl-rd-url__lock {
  display: none !important;
  width: 10px;
  height: 10px;
  margin-left: 10px;
  color: var(--rd-ink-3);
}

.bl-rd-url.is-secure .bl-rd-url__lock {
  display: block !important;
}

.bl-rd-url.is-secure input,
.bl-rd-url.is-secure .bl-rd-ghost {
  padding-left: 6px;
}

.bl-rd-progress {
  position: absolute;
  top: 31px;
  right: 0;
  left: 0;
  z-index: 4;
  height: 2px;
  background: var(--rd-accent);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.bl-rd-progress.is-on {
  opacity: 1;
  animation: bl-rd-load 640ms cubic-bezier(0.1, 0.6, 0.3, 1) forwards;
}

@keyframes bl-rd-load {
  to {
    transform: scaleX(0.9);
  }
}

.bl-rd-browser__view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  color: #17201c;
}

.bl-rd-bubble {
  position: absolute;
  top: 35px;
  right: 8px;
  z-index: 5;
  display: grid;
  gap: 8px;
  width: 236px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--rd-win);
  box-shadow: 0 0 0 1px var(--rd-win-line), 0 14px 30px -10px rgba(6, 12, 28, 0.45);
  animation: bl-rd-drop 160ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

.bl-rd-desk .bl-rd-bubble__head {
  color: var(--rd-ink-3);
  font-size: 9.5px;
  font-weight: 600;
}

.bl-rd-bubble__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.bl-rd-bubble__row .bl-rd-kind {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.bl-rd-bubble__row div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.bl-rd-desk .bl-rd-bubble__row b {
  font-size: 11px;
  font-weight: 600;
}

.bl-rd-bubble__row span {
  color: var(--rd-ink-2);
  font-size: 10px;
}

.bl-rd-bubble .bl-rd-link {
  justify-self: start;
  margin-left: 26px;
}

@keyframes bl-rd-drop {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* Start page and the page that did not answer. */
.bl-rd-desk .bl-rd-start,
.bl-rd-desk .bl-rd-missing {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  height: 100%;
  padding: 0 40px 24px;
  background: #f6f7f9;
  color: #5a6475;
  font-size: 11px;
  text-align: center;
}

.bl-rd-desk .bl-rd-start__tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 10px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(22, 32, 54, 0.1), 0 1px 2px rgba(22, 32, 54, 0.06);
  color: #17202b;
  text-align: left;
  transition: box-shadow 110ms ease;
}

.bl-rd-start__tile:is(:hover, .is-hover) {
  box-shadow: 0 0 0 1px rgba(22, 32, 54, 0.22), 0 4px 10px -4px rgba(22, 32, 54, 0.2);
}

.bl-rd-start__tile svg {
  width: 24px;
  height: 24px;
}

.bl-rd-start__tile span {
  display: grid;
}

.bl-rd-desk .bl-rd-start__tile b {
  font-size: 11.5px;
  font-weight: 600;
}

.bl-rd-desk .bl-rd-start__tile small {
  color: #6c7686;
  font-size: 10px;
}

.bl-rd-missing {
  gap: 6px;
}

.bl-rd-missing .bl-sd-icon {
  width: 22px;
  height: 22px;
  color: #9aa3b1;
}

.bl-rd-desk .bl-rd-missing h3 {
  color: #17202b;
  font-size: 13px;
  font-weight: 700;
}

.bl-rd-desk .bl-rd-missing p {
  max-width: 320px;
  overflow-wrap: anywhere;
}

.bl-rd-desk .bl-rd-missing b {
  color: #17202b;
  font-weight: 600;
}

.bl-rd-desk .bl-rd-missing .bl-rd-btn {
  margin-top: 6px;
  box-shadow: inset 0 0 0 1px rgba(22, 32, 54, 0.2);
  color: #17202b;
}

.bl-rd-missing .bl-rd-btn:is(:hover, .is-hover) {
  background: rgba(22, 32, 54, 0.06);
}

/* ── The supplier portal (a web page: its own, light, theme) ───────────── */

.pt {
  --pt-brand: #0f6e63;
  --pt-ink: #17201c;
  --pt-ink-2: #55635c;
  --pt-ink-3: #7c8a83;
  --pt-line: #e3e8e2;
  --pt-line-2: #d3dad2;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #f6f8f5;
  color: var(--pt-ink);
  font-size: 11px;
}

.pt-top {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 16px;
  border-bottom: 1px solid var(--pt-line);
  background: #fff;
}

.pt-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--pt-ink-3);
  font-size: 10.5px;
}

.pt-brand svg {
  width: 15px;
  height: 15px;
}

.bl-rd-desk .pt-brand b {
  color: var(--pt-ink);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pt-account {
  color: var(--pt-ink-2);
  font-size: 10.5px;
}

.pt-head {
  display: flex;
  flex: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 16px 9px;
}

.bl-rd-desk .pt-head h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.bl-rd-desk .pt-head p {
  margin-top: 2px;
  color: var(--pt-ink-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.bl-rd-desk .pt-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--pt-line-2), 0 1px 1px rgba(15, 30, 25, 0.04);
  color: var(--pt-ink);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 90ms ease, box-shadow 90ms ease;
}

.pt-btn .bl-sd-icon {
  width: 11px;
  height: 11px;
}

.bl-rd-desk .pt-btn small {
  color: var(--pt-ink-3);
  font-size: inherit;
  font-weight: 500;
}

.pt-btn .bl-sd-icon:last-child {
  width: 9px;
  height: 9px;
  margin-left: 1px;
  color: var(--pt-ink-3);
  stroke-width: 2.2;
}

.pt-btn:is(:hover, .is-hover) {
  background: #f1f4f0;
}

.pt-btn:is(:active, .is-active),
.pt-btn.is-open {
  background: #e7ece6;
  box-shadow: inset 0 0 0 1px #b9c3b8;
}

.bl-rd-desk .pt-btn--primary {
  padding: 0 11px 0 9px;
  background: var(--pt-brand);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(15, 60, 52, 0.3);
  color: #fff;
}

.pt-btn--primary:is(:hover, .is-hover) {
  background: #0c5f55;
}

.pt-btn--primary:is(:active, .is-active) {
  background: #094b44;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.pt-btn--primary:disabled {
  opacity: 0.6;
}

.pt-btn--primary.is-busy {
  opacity: 1;
  background: #0c5f55;
}

.pt-btn--primary.is-busy .bl-sd-icon {
  animation: bl-rd-bob 500ms ease-in-out infinite alternate;
}

@keyframes bl-rd-bob {
  to {
    transform: translateY(2px);
  }
}

.pt-filters {
  position: relative;
  z-index: 2;
  display: flex;
  flex: none;
  gap: 6px;
  padding: 0 16px 9px;
}

.pt-select {
  position: relative;
}

.pt-menu {
  position: absolute;
  top: 27px;
  left: 0;
  display: grid;
  gap: 1px;
  min-width: 132px;
  padding: 3px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--pt-line-2), 0 10px 22px -8px rgba(15, 30, 25, 0.3);
  animation: bl-rd-drop 120ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

.bl-rd-desk .pt-menu button {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 10px 0 6px;
  border-radius: 4px;
  font-size: 10.5px;
  white-space: nowrap;
}

.pt-menu .bl-sd-icon {
  width: 10px;
  height: 10px;
  color: var(--pt-brand);
  stroke-width: 2.4;
  visibility: hidden;
}

.pt-menu .is-on {
  font-weight: 600;
}

.pt-menu .is-on .bl-sd-icon {
  visibility: visible;
}

.pt-menu button:is(:hover, .is-hover) {
  background: #e8efe8;
}

.pt-menu button:is(:active, .is-active) {
  background: #e1e9e1;
}

.pt-search {
  --rd-field: #fff;
  --rd-line-2: var(--pt-line-2);
  --rd-accent: var(--pt-brand);
  --rd-ink: var(--pt-ink);
  --rd-ink-3: var(--pt-ink-3);
  --rd-select-text: rgba(15, 110, 99, 0.22);
  flex: 1;
}

.pt-search .bl-sd-icon {
  width: 11px;
  height: 11px;
  margin-left: 8px;
  color: var(--pt-ink-3);
}

.pt-search input,
.pt-search .bl-rd-ghost {
  padding: 0 8px 0 6px;
  font-size: 10.5px;
}

.pt-table {
  flex: 1;
  min-height: 0;
  margin: 0 16px 12px;
  overflow-y: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--pt-line);
  scrollbar-width: thin;
  scrollbar-color: #c5cdc4 transparent;
}

.pt-row {
  display: grid;
  grid-template-columns: 58px 44px minmax(0, 1fr) 64px 62px 66px;
  align-items: center;
  column-gap: 10px;
  height: 27px;
  padding: 0 12px;
  border-bottom: 1px solid #eef1ed;
  font-size: 10.5px;
  white-space: nowrap;
}

.pt-row:last-child {
  border-bottom: 0;
}

.pt-row--head {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 24px;
  border-bottom: 1px solid var(--pt-line);
  background: #fafbf9;
  color: var(--pt-ink-3);
  font-size: 9.5px;
  font-weight: 600;
}

.pt-id {
  font-family: var(--bl-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.pt-item {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
}

.pt-row > span:nth-child(2),
.pt-row > span:nth-child(4) {
  color: var(--pt-ink-2);
}

.pt-row--head > span:nth-child(n) {
  color: inherit;
}

.pt-row > span:last-child {
  font-weight: 600;
}

.pt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--pt-ink-2);
  font-style: normal;
  font-weight: 500;
}

.pt-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2f8f5b;
}

.pt-status[data-status="Open"]::before {
  background: #d99a1c;
}

.pt-status[data-status="Shipped"]::before {
  background: #4a6fe0;
}

.bl-rd-desk .pt-none {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 30px 0;
  color: var(--pt-ink-2);
  font-size: 10.5px;
}

.pt-none .bl-rd-link {
  color: var(--pt-brand);
}

/* ── Fernway ───────────────────────────────────────────────────────────── */

.fw {
  --fw-brand: #dd4f28;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 46px 0;
}

.fw-logo {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: linear-gradient(160deg, #ff8f66, #dd4f28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.fw-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bl-rd-desk .fw h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.bl-rd-desk .fw > p {
  margin: 2px 0 13px;
  color: var(--rd-ink-2);
  font-size: 10.5px;
}

.fw-field {
  display: grid;
  margin-bottom: 7px;
}

.fw-field .bl-rd-field {
  --rd-accent: var(--fw-brand);
  --rd-select-text: rgba(221, 79, 40, 0.24);
  height: 27px;
  border-radius: 7px;
}

.fw-label {
  margin-bottom: 4px;
  color: var(--rd-ink-2);
  font-size: 10px;
  font-weight: 600;
}

.fw-note {
  min-height: 13px;
  margin-top: 3px;
  color: var(--rd-ink-3);
  font-size: 9.5px;
}

.fw-field.is-bad .bl-rd-field {
  box-shadow: inset 0 0 0 1.5px #d8433a;
}

.fw-field.is-bad .fw-note {
  color: #cf3d34;
}

[data-skin="dusk"] .fw-field.is-bad .fw-note {
  color: #ff8d83;
}

.fw-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  height: 3px;
  margin-top: 5px;
}

.fw-meter i {
  border-radius: 2px;
  background: var(--rd-line-2);
  transition: background-color 160ms ease;
}

.fw-meter[data-score="1"] i:nth-child(-n + 1) { background: #e0573f; }
.fw-meter[data-score="2"] i:nth-child(-n + 2) { background: #e0a030; }
.fw-meter[data-score="3"] i:nth-child(-n + 3) { background: #57a773; }
.fw-meter[data-score="4"] i:nth-child(-n + 4) { background: #2f9562; }

.bl-rd-desk .fw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 29px;
  margin-top: 3px;
  border-radius: 7px;
  background: var(--fw-brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(120, 40, 15, 0.35);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  transition: background-color 90ms ease, transform 90ms ease;
}

.fw-btn .bl-rd-spin {
  display: none;
}

.fw-btn.is-busy .bl-rd-spin {
  display: block;
}

.fw-btn:is(:hover, .is-hover) {
  background: #c94521;
}

.fw-btn:is(:active, .is-active) {
  background: #b23b1b;
  transform: scale(0.985);
}

.fw-btn.is-busy {
  background: #c94521;
  opacity: 0.85;
}

.fw--ready {
  align-items: center;
  justify-content: center;
  padding-bottom: 24px;
  text-align: center;
  animation: bl-rd-settle 260ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

.bl-rd-desk .fw--ready > p {
  margin: 4px 0 16px;
  max-width: 220px;
}

.bl-rd-desk .fw--ready > p b {
  color: var(--rd-ink);
  font-weight: 600;
}

.fw-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(47, 149, 98, 0.15);
  color: #2f9562;
}

[data-skin="dusk"] .fw-check {
  color: #6fd3a0;
}

.fw-check .bl-sd-icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.bl-rd-desk .fw-btn--quiet {
  height: 26px;
  padding: 0 14px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rd-line-2);
  color: var(--rd-ink);
  font-size: 10.5px;
}

.fw-btn--quiet:is(:hover, .is-hover) {
  background: var(--rd-hover);
}

.fw-btn--quiet:is(:active, .is-active) {
  background: var(--rd-press);
}

@keyframes bl-rd-settle {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

/* ── game: the running program ─────────────────────────────────────────── */

.bl-rd-win--game {
  --rd-win: #101824;
  --rd-chrome: #1a212d;
  --rd-ink: #e8eef5;
  --rd-ink-2: #aab6c5;
  --rd-ink-3: #7d8a9b;
  --rd-hover: rgba(255, 255, 255, 0.08);
  --rd-press: rgba(255, 255, 255, 0.14);
  color: var(--rd-ink);
}

.gm {
  position: relative;
  height: 100%;
  background: #101824;
}

.gm-view {
  position: absolute;
  inset: 0 0 28px;
  display: block;
  width: 100%;
  height: calc(100% - 28px);
}

.gm-splash {
  position: absolute;
  inset: 0 0 28px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  background: #0d121a;
  transition: opacity 260ms ease, visibility 0s 260ms;
}

.gm:not([data-phase="loading"]) .gm-splash {
  opacity: 0;
  visibility: hidden;
}

.bl-rd-desk .gm-splash b {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.gm-splash > span:not(.gm-load) {
  color: var(--rd-ink-3);
  font-size: 10.5px;
}

.gm-load {
  width: 150px;
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}

.gm-load i {
  display: block;
  height: 100%;
  background: #8fb8ff;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.bl-rd-desk .gm-splash small {
  margin-top: 4px;
  color: var(--rd-ink-3);
  font-size: 9.5px;
}

.gm-stats {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  padding: 5px 8px;
  border-radius: 5px;
  background: rgba(7, 11, 17, 0.74);
  color: #e8eef5;
  font: 500 9.5px / 1.5 var(--bl-font-mono);
  font-variant-ligatures: none;
}

.gm-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #161d28;
}

.bl-rd-desk .gm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 10.5px;
  font-weight: 600;
  transition: background-color 90ms ease;
}

.gm-btn .bl-sd-icon {
  width: 10px;
  height: 10px;
  stroke-width: 2.2;
}

.gm-btn:is(:hover, .is-hover) {
  background: rgba(255, 255, 255, 0.13);
}

.gm-btn:is(:active, .is-active) {
  background: rgba(255, 255, 255, 0.2);
}

.gm-btn.is-on {
  background: rgba(143, 184, 255, 0.24);
}

.gm-btn--right {
  margin-left: auto;
}

.gm-btn kbd {
  color: var(--rd-ink-3);
  font: 500 9px / 1 var(--bl-font-mono);
}

.gm[data-phase="loading"] .gm-bar button {
  opacity: 0.4;
}

/* ══ Reduced motion: nothing moves, every state is shown at once ════════════ */

@media (prefers-reduced-motion: reduce) {
  .bl-sd *,
  .bl-sd *::before,
  .bl-sd *::after {
    animation: none !important;
    transition: none !important;
  }

  .bl-rd-progress.is-on {
    transform: scaleX(0.9);
  }
}
