/*
 * The Atlas shell. 1 October 2026, the UI brief of 30 September, sections
 * 1, 2 and 3. Claude gives the layout; Trybe gives the look: Muse's tokens
 * (muse.css :root), indigo glass, teal light, orange eyebrows with a dash.
 *
 * THREE LAYOUTS, one rule each:
 *   1024px and wider   body is a grid, sidebar | stage | panel. Opening
 *                      either narrows the stage fluidly; app/presence-src/
 *                      shell-core.ts keeps it at least 360px wide.
 *   below 1024px       sidebar and panel are overlays over a scrim. The
 *                      stage is exactly what it was.
 *   640px and below    the phone stage is untouched: the only change is the
 *                      two buttons in its top bar (repo rule: a desktop
 *                      change never alters the phone layout).
 *
 * THE NARROW STAGE. Muse's desktop rules are written against the VIEWPORT
 * (vw and @media), so a stage narrowed to 572px inside a 1280px window
 * would keep a desktop row that no longer fits. On desktop the stage is a
 * size container, its vw measures are restated in cqw (identical when
 * nothing is docked, because the stage is then the full width), and below
 * 900px of STAGE it reflows into one column: orb above the words, words
 * above the controls. Nothing in the column is positioned, so nothing in it
 * can overlap (the hero overlap brief, 27 September 2026).
 */

/* ------------------------------------------------- shared material -- */

.shell-sidebar,
.shell-panel,
.shell-menu {
  box-sizing: border-box;
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
}
.shell-sidebar *,
.shell-panel *,
.shell-menu * { box-sizing: border-box; }
.shell-sidebar button,
.shell-panel button,
.shell-menu button,
.shell-sidebar input,
.shell-panel input,
.shell-menu input { font-family: inherit; }
.shell-sidebar :focus-visible,
.shell-panel :focus-visible,
.shell-menu :focus-visible {
  outline: 2px solid #8ef7d9;
  outline-offset: 2px;
}

.shell-sidebar {
  background: linear-gradient(165deg, rgba(23, 27, 70, 0.98), rgba(38, 24, 78, 0.98));
  border-right: 1px solid rgba(73, 223, 198, 0.22);
}
.shell-panel {
  background: linear-gradient(200deg, rgba(23, 27, 70, 0.98), rgba(36, 22, 74, 0.98));
  border-left: 1px solid rgba(73, 223, 198, 0.22);
}

/* -------------------------------------------- overlays, below 1024 -- */

.shell-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(6, 6, 22, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.shell-scrim.is-on { opacity: 1; pointer-events: auto; }

.shell-sidebar,
.shell-panel {
  position: fixed;
  z-index: 60;
  top: 0;
  bottom: 0;
  visibility: hidden;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.34s;
}
.shell-sidebar {
  left: 0;
  width: min(320px, 88vw);
  transform: translateX(-104%);
  box-shadow: 14px 0 44px rgba(0, 0, 0, 0.42);
}
.shell-panel {
  right: 0;
  width: min(560px, 100vw);
  transform: translateX(104%);
  box-shadow: -14px 0 44px rgba(0, 0, 0, 0.42);
}
.shell-sidebar.is-open,
.shell-panel.is-open {
  visibility: visible;
  transform: none;
  transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

/* ------------------------------------------------ docked, 1024 up -- */

@media (min-width: 1024px) {
  body.has-shell {
    display: grid;
    grid-template-columns: var(--shell-sb-w, 0px) minmax(0, 1fr) var(--shell-pn-w, 0px);
    grid-template-rows: 100svh;
    place-items: stretch;
    padding: 0;
    background: #111430;
  }
  body.has-shell.shell-resizing { transition: none; cursor: col-resize; }
  body.shell-resizing iframe { pointer-events: none; }
  body.has-shell > .stage {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    max-width: none;
    min-width: 0;
    height: 100svh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    /* The closed chat sheet parks just past the stage's right edge; docked,
       the stage clips it, so the page never gains a sideways scroll. clip,
       not hidden: the stage does not become a scroll container. */
    overflow: clip;
  }
  .shell-sidebar,
  .shell-panel {
    position: relative;
    z-index: 1;
    grid-row: 1;
    width: auto;
    min-width: 0;
    overflow: hidden;
    transform: none;
    box-shadow: none;
    transition: none;
  }
  .shell-sidebar { grid-column: 1; }
  .shell-panel { grid-column: 3; }
  .shell-sidebar.is-open,
  .shell-panel.is-open { transition: none; }
  /* Fixed widths inside, so the content is revealed by the column, never reflowed by it. */
  .shell-sidebar .sb-inner { width: 288px; }
  .shell-panel .pn-inner { width: var(--shell-pn-w, 0px); min-width: 320px; }
  .shell-scrim { display: none; }
  .pn-handle { display: block; }

  /*
   * Collapse and expand, 2 October 2026: "one click and the whole panel
   * slides away, leaving only a slim edge with an arrow button ...
   * transform-only, GPU-composited, 60fps." The columns are SNAPPED by
   * shell.ts (before an opening, after a closing), never transitioned: a
   * transitioned grid column lays the stage out again on every frame. What
   * moves is each panel's inner sheet, by transform alone, clipped by its
   * own column.
   */
  .shell-sidebar .sb-inner,
  .shell-panel .pn-inner {
    position: relative;
    z-index: 1;
    will-change: transform;
    transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  /* A closed panel's column is 0px; its 1px border would still widen the page. */
  .shell-panel:not(.is-open) { border-left-width: 0; border-right-width: 0; }
  body.has-shell { overflow-x: clip; }
  /* Docked, the sidebar itself never hides: its slim edge lives in it. Only
     the sheet does, once it has slid out (inert keeps it out of reach). */
  .shell-sidebar,
  .shell-sidebar:not(.is-open) { visibility: visible; }
  .shell-sidebar:not(.is-open) .sb-inner {
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.34s;
  }
  .shell-panel:not(.is-open) .pn-inner { transform: translateX(100%); }
  .shell-sidebar.is-open .sb-inner,
  .shell-panel.is-open .pn-inner { transform: none; }
  /* The slim edge: the stage's own sidebar button is not needed beside it. */
  .sb-rail {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: 0;
    display: flex;
    justify-content: center;
    width: 28px;
    padding-top: max(18px, env(safe-area-inset-top));
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(42, 34, 104, 0.72), rgba(20, 24, 62, 0.82));
    opacity: 0;
    transition: opacity 0.2s ease;
  }
  .shell-sidebar:not(.is-open) .sb-rail { opacity: 1; }
  .sb-rail-btn {
    display: grid;
    place-items: center;
    width: 22px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(75, 222, 198, 0.32);
    border-radius: 11px;
    background: rgba(34, 30, 83, 0.6);
    color: #e8fffa;
    cursor: pointer;
  }
  .sb-rail-btn svg { width: 14px; height: 14px; }
  .sb-rail-btn:hover { border-color: rgba(75, 222, 198, 0.7); }
  .sb-rail-btn:focus-visible { outline: 2px solid #35e0c1; outline-offset: 2px; }
  .stage .shell-sb-btn { display: none; }
}
.sb-rail { display: none; }
@media (min-width: 1024px) {
  .sb-rail { display: flex; }
}

/* ------------------------------------------------------ stage bar -- */

.shell-sb-btn svg,
.shell-pn-btn svg { width: 19px; height: 19px; }
.shell-pn-btn { right: 70px; }
.shell-pn-btn.has-tabs::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35e0c1;
  box-shadow: 0 0 8px #35e0c1;
}
.stage.intro-active .shell-pn-btn { display: none; }
.stage.shell-sb-on .shell-sb-btn,
.stage.shell-pn-on .shell-pn-btn { display: none; }
@media (max-width: 640px) {
  /* Stacked under the chat button: the top bar's row is full on a phone. */
  .shell-pn-btn { right: 18px; top: calc(max(18px, env(safe-area-inset-top)) + 52px); }
}
@media (max-width: 360px) {
  .shell-pn-btn { right: 12px; width: 38px; height: 38px; top: calc(max(18px, env(safe-area-inset-top)) + 46px); }
}
@media (max-width: 300px) {
  .shell-pn-btn { right: 8px; width: 34px; height: 34px; top: calc(max(18px, env(safe-area-inset-top)) + 42px); }
}

/* Feature controls in the tool row, after the ear, the same circle. */
.talk-row.has-shell-controls { grid-auto-flow: column; grid-auto-columns: auto; }
.talk-row .shell-stage-control { aspect-ratio: 1; width: auto; padding: 0; color: #fff; font: 600 14px/1 "Poppins", sans-serif; }
.talk-row .shell-stage-control svg { width: 20px; height: 20px; }

/* "Open in panel" beside Copy on each reply, on one line. */
.bubble.atlas.has-panel-action { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; column-gap: 8px; }
.bubble.atlas.has-panel-action .bubble-text { flex: 1 0 100%; }
.bubble.atlas.has-panel-action .copy-btn { margin: 8px 0 0; }

/* -------------------------------------------------------- sidebar -- */

.sb-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
}
.sb-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-left: 6px; }
.sb-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: linear-gradient(95deg, #8ef7d9 0%, #31dfc1 45%, #c6a6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sb-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.sb-icon:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(73, 223, 198, 0.3); }
.sb-icon svg { width: 20px; height: 20px; }
.sb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(73, 223, 198, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.sb-search:focus-within { border-color: rgba(73, 223, 198, 0.75); box-shadow: 0 0 0 3px rgba(53, 224, 193, 0.16); }
.sb-search svg { flex: none; width: 17px; height: 17px; }
.sb-search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.sb-search input::placeholder { color: rgba(255, 250, 240, 0.6); }
.sb-new {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: linear-gradient(120deg, #146a64 0%, #1b5385 55%, #4c2a86 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.28), 0 8px 22px rgba(20, 106, 100, 0.3);
}
.sb-new:hover { border-color: rgba(142, 247, 217, 0.7); }
.sb-new svg { width: 18px; height: 18px; }

.sb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -8px;
  padding: 2px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(73, 223, 198, 0.3) transparent;
}
.sb-navs { display: flex; flex-direction: column; gap: 2px; }
.sb-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.sb-nav svg { flex: none; width: 19px; height: 19px; color: #83f7db; }
.sb-nav:hover,
.sb-row:hover { background: rgba(255, 255, 255, 0.07); }
.sb-badge {
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.18);
  color: #ffc08f;
  font-size: 11px;
  font-weight: 600;
}
.sb-sec { margin-top: 16px; }
.sb-sec[hidden] { display: none; }
.sb-sec-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; padding-left: 10px; }
.sb-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--trybe-orange, #ff8a35);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sb-eyebrow::before { content: ""; width: 16px; height: 1.5px; border-radius: 2px; background: currentColor; }
.sb-list { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.sb-group { margin: 12px 10px 4px; color: rgba(255, 250, 240, 0.62); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; }
.sb-row { position: relative; display: flex; align-items: stretch; border-radius: 12px; }
.sb-row.is-current {
  background: linear-gradient(120deg, rgba(53, 224, 193, 0.16), rgba(110, 41, 140, 0.22));
  box-shadow: inset 0 0 0 1px rgba(73, 223, 198, 0.38);
}
.sb-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 8px 4px 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.sb-row-project { flex-direction: row; align-items: center; gap: 10px; }
.sb-row-project svg { flex: none; width: 18px; height: 18px; color: #83f7db; }
.sb-row-title { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row-meta { font-size: 11px; color: var(--muted); }
.sb-row-snippet { font-size: 12px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sb-count { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); color: var(--muted); font-size: 11px; }
.sb-row-more {
  flex: none;
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.sb-row-more:hover { color: var(--ink); background: rgba(255, 255, 255, 0.08); }
.sb-row-more svg { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) {
  .sb-row-more { opacity: 0; }
  .sb-row:hover .sb-row-more,
  .sb-row:focus-within .sb-row-more,
  .sb-row.is-current .sb-row-more,
  .sb-row-more[aria-expanded="true"] { opacity: 1; }
}
.sb-row-drive {
  flex: none;
  align-self: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(73, 223, 198, 0.32);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}
.sb-viewall {
  min-height: 44px;
  margin-top: 4px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #83f7db;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.sb-viewall:hover { background: rgba(255, 255, 255, 0.06); }
.sb-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sb-mode {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.sb-mode:hover { border-color: rgba(73, 223, 198, 0.4); }
.sb-mode.is-active {
  border-color: rgba(73, 223, 198, 0.6);
  background: linear-gradient(140deg, rgba(53, 224, 193, 0.2), rgba(110, 41, 140, 0.3));
  font-weight: 600;
}
.sb-mode.is-locked { opacity: 0.55; }
.sb-mode-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.sb-mode-coach .sb-mode-dot { background: #35e0c1; box-shadow: 0 0 8px #35e0c1; }
.sb-mode-strategist .sb-mode-dot { background: #efbd85; box-shadow: 0 0 8px #efbd85; }
.sb-mode-mentor .sb-mode-dot { background: #74e3a5; box-shadow: 0 0 8px #74e3a5; }
.sb-mode-leader .sb-mode-dot { background: #d2a5ef; box-shadow: 0 0 8px #d2a5ef; }
.sb-foot { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.sb-conn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sb-conn-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.sb-dot.is-on { background: #35e0c1; box-shadow: 0 0 0 3px rgba(53, 224, 193, 0.2), 0 0 10px #35e0c1; }
.sb-dot.is-warn { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.sb-foot-btn {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.sb-foot-btn svg { width: 18px; height: 18px; }
.sb-empty { margin: 8px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sb-empty p { margin: 0 0 10px; }
.sb-pill {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(73, 223, 198, 0.45);
  border-radius: 999px;
  background: rgba(53, 224, 193, 0.12);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sb-rename {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(73, 223, 198, 0.7);
  border-radius: 10px;
  background: rgba(8, 10, 30, 0.6);
  color: var(--ink);
  font-size: 14px;
}
.sb-create { padding: 4px 2px; }
.sb-note { margin: 4px 2px 0; color: #ffc08f; font-size: 12px; }
.sb-note:empty { display: none; }

/* ---------------------------------------------------------- panel -- */

.pn-handle {
  display: none;
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 14px;
  cursor: col-resize;
  touch-action: none;
}
.pn-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 5px;
  width: 4px;
  height: 48px;
  margin-top: -24px;
  border-radius: 4px;
  background: rgba(131, 247, 219, 0.7);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pn-handle:hover::after,
.pn-handle:focus-visible::after,
body.shell-resizing .pn-handle::after { opacity: 1; }
.pn-handle:focus-visible { outline: none; }
.pn-inner { height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.pn-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.pn-tabs { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pn-tabs::-webkit-scrollbar { display: none; }
.pn-tab {
  flex: none;
  display: flex;
  align-items: center;
  max-width: 220px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.pn-tab.is-active {
  border-color: rgba(73, 223, 198, 0.45);
  background: linear-gradient(130deg, rgba(53, 224, 193, 0.18), rgba(110, 41, 140, 0.26));
}
.pn-tab-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 2px 0 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.pn-tab-main svg { flex: none; width: 16px; height: 16px; color: #83f7db; }
.pn-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-tab-close {
  flex: none;
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pn-tab-close:hover { color: var(--ink); }
.pn-tab-close svg { width: 14px; height: 14px; }
.pn-body { position: relative; flex: 1; min-height: 0; }
.pn-host { position: absolute; inset: 0; overflow: auto; padding: 22px 24px 32px; overscroll-behavior: contain; }
.pn-host[hidden] { display: none; }
.pn-host:has(> .pn-frame) { display: flex; flex-direction: column; padding: 0; }
.pn-frame { flex: 1; width: 100%; min-height: 320px; border: 0; background: #fff; }
.pn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.pn-bar-note { color: var(--muted); font-size: 12px; }
.pn-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(73, 223, 198, 0.45);
  border-radius: 999px;
  background: rgba(53, 224, 193, 0.12);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.pn-open:hover { border-color: rgba(0, 178, 169, 0.8); }

.pn-md { max-width: 72ch; color: var(--ink); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; user-select: text; }
.pn-md h2 { margin: 0 0 12px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.pn-md h3 { margin: 22px 0 8px; font-size: 18px; font-weight: 700; }
.pn-md h4 { margin: 18px 0 6px; font-size: 16px; font-weight: 600; }
.pn-md p { margin: 0 0 12px; }
.pn-md a { color: #83f7db; text-underline-offset: 3px; }
.pn-md code { padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.09); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.pn-md pre { margin: 0 0 14px; padding: 14px; overflow: auto; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; background: rgba(5, 6, 20, 0.55); }
.pn-md pre code { padding: 0; background: none; }
.pn-md blockquote { margin: 0 0 12px; padding: 4px 0 4px 14px; border-left: 3px solid var(--trybe-orange, #ff8a35); color: rgba(255, 250, 240, 0.88); }
.pn-md ul,
.pn-md ol { margin: 0 0 12px; padding-left: 22px; }
.pn-md li { margin: 4px 0; }
.pn-md hr { margin: 18px 0; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.pn-text { color: var(--ink); font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }

.pn-view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pn-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--trybe-orange, #ff8a35);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pn-eyebrow::before { content: ""; width: 22px; height: 1.5px; border-radius: 2px; background: currentColor; }
.pn-title { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.pn-sub { margin: 22px 0 8px; color: rgba(255, 250, 240, 0.78); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.pn-note { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pn-empty { margin: 8px 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.pn-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 0 14px;
  border: 1px solid rgba(73, 223, 198, 0.32);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 14px;
}
.pn-search::placeholder { color: rgba(255, 250, 240, 0.6); }
.pn-list { display: flex; flex-direction: column; gap: 2px; }
.pn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 178, 169, 0.32);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.pn-item:hover { border-color: rgba(0, 178, 169, 0.8); background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)); }
.pn-item:disabled { opacity: 0.5; cursor: default; }
.pn-item svg { flex: none; width: 20px; height: 20px; color: #83f7db; }
.pn-item-words { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pn-item-title { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pn-item-meta { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pn-badge { flex: none; padding: 4px 10px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pn-badge.is-ok { color: #8ef7d9; border-color: rgba(53, 224, 193, 0.5); background: rgba(53, 224, 193, 0.12); }
.pn-badge.is-warn { color: #ffd28a; border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.1); }
.pn-badge.is-error { color: #ffb4a8; border-color: rgba(255, 110, 90, 0.55); background: rgba(255, 110, 90, 0.12); }
.pn-badge.is-off,
.pn-badge.is-none { color: rgba(255, 250, 240, 0.8); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.05); }
.pn-job {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 178, 169, 0.32);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}
.pn-job-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pn-job .pn-item-title { white-space: normal; }
.pn-feed { margin: 0; padding: 0; list-style: none; }
.pn-feed-item { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.pn-feed-time { padding-top: 1px; color: #83f7db; font-size: 12px; font-variant-numeric: tabular-nums; }
.pn-feed .pn-item-title { white-space: normal; }
.pn-card {
  padding: 22px;
  border: 1px solid rgba(0, 178, 169, 0.4);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 178, 169, 0.12);
}
.pn-card-title { margin: 0 0 6px; font-size: 20px; }
.pn-card-url { margin: 0 0 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pn-section { margin-bottom: 8px; }

/* ----------------------------------------------------------- menu -- */

.shell-menu {
  position: fixed;
  z-index: 80;
  min-width: 220px;
  max-width: min(300px, calc(100vw - 16px));
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(73, 223, 198, 0.35);
  border-radius: 16px;
  background: rgba(22, 20, 60, 0.98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}
.shell-menu-item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.shell-menu-item:hover,
.shell-menu-item:focus-visible { background: rgba(255, 255, 255, 0.08); }
.shell-menu-item.is-danger { color: #ffb4a8; }
.shell-menu-item[aria-current="true"] { color: #83f7db; cursor: default; }
.shell-menu-head { margin: 10px 12px 4px; color: var(--trybe-orange, #ff8a35); font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.shell-menu-form input {
  width: 100%;
  min-height: 44px;
  margin: 4px 0;
  padding: 0 12px;
  border: 1px dashed rgba(73, 223, 198, 0.45);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.shell-menu-form input::placeholder { color: rgba(255, 250, 240, 0.6); }
.shell-menu-note { margin: 6px 12px; color: #ffc08f; font-size: 12px; }
.shell-menu-note:empty { display: none; }
.shell-menu-confirm { margin: 8px 12px 10px; color: var(--ink); font-size: 13px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
  .shell-sidebar,
  .shell-panel,
  .shell-scrim,
  body.has-shell { transition-duration: 0.01ms !important; }
  .shell-sidebar .sb-inner,
  .shell-panel .pn-inner,
  .sb-rail { transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------- the narrow stage -- */

@media (min-width: 900px) and (min-height: 561px) {
  /* The stage is the measure, not the window. Every line here restates a
     desktop rule from muse.css or live.css with cqw for vw: identical when
     nothing is docked, because the stage is then the window's width. */
  .stage { container: atlas-stage / inline-size; }
  .stage .orb-view::after { inset: 96px max(34px, calc((100cqw - 1220px) / 2)) 156px; }
  .stage .view-hero .orb-wrap { width: min(25cqw, 34vh, 310px); }
  .hero-row { gap: clamp(40px, 6cqw, 110px); }
  .hero-text { width: min(560px, 42cqw); }
  .orb-copy .mode-title,
  .presence-copy .mode-title { font-size: clamp(32px, 3.2cqw, 48px); }
  .orb-copy .mode-tagline,
  .presence-copy .mode-tagline { font-size: clamp(29px, 2.8cqw, 40px); }
  .orb-copy .mode-thought { font-size: clamp(15px, 1.25cqw, 18px); }
  .presence-copy .mode-thought { font-size: clamp(11px, 3.35cqw, 16.5px); }
  .view-hero .closing-lead { font-size: clamp(28px, min(3cqw, 5vh), 44px); }
  .view-hero .closing-outline { font-size: clamp(26px, min(2.8cqw, 4.6vh), 40px); }
  .view-hero .closing-sub { font-size: clamp(13px, 1.1cqw, 16px); }
}
@media (min-width: 1500px) and (min-height: 800px) {
  .stage .view-hero .orb-wrap { width: min(22cqw, 35vh, 350px); }
}
@media (min-width: 900px) and (min-height: 561px) {
  @container atlas-stage (max-width: 899px) {
    /* One column: eyebrow, orb, the model pill's room, the words. */
    .view-hero { top: 60px; bottom: 268px; left: 16px; right: 16px; gap: clamp(6px, 1.4vh, 14px); }
    .hero-row { flex-direction: column; gap: 8px; justify-content: center; }
    .stage .view-hero .orb-wrap { width: min(40cqw, 21vh, 220px); margin-bottom: 46px; }
    .hero-text { width: 100%; }
    .orb-copy .mode-title,
    .presence-copy .mode-title { font-size: clamp(24px, 6cqw, 40px); margin-bottom: 8px; }
    .orb-copy .mode-tagline,
    .presence-copy .mode-tagline { font-size: clamp(21px, 5.2cqw, 34px); }
    .orb-copy .mode-thought { font-size: clamp(13px, 2.6cqw, 16px); line-height: 1.42; }
    .view-hero .closing-lead { font-size: clamp(22px, 6cqw, 36px); }
    .view-hero .closing-outline { font-size: clamp(20px, 5.6cqw, 34px); }
    .view-hero .closing-sub { font-size: clamp(12px, 2.6cqw, 15px); }
    .stage .orb-view::after { inset: 92px 12px 150px; border-radius: 30px; }
    .controls { width: calc(100% - 32px); }
    /* The greeting takes the words' place while it plays, as on a phone. */
    .stage.intro-active .view-hero .orb-copy { display: none; }
  }
}
