/* ===== Cockpit Phase 3 · canvas-visibility fix ============================
   Phase 2 hides #shell-chat with display:none, which drops it from grid flow
   — so #shell-canvas auto-places into the 0px first track instead of the
   1500px centre column, collapsing the live canvas to a ~2px sliver. Phase 3
   paints ON that canvas (Lens recompose, Continuous heat), so it must be
   visible. Pin the canvas to column 2 explicitly. Skipped in focus mode
   (single-column grid) and harmless in classic (canvas is already column 2).
   ========================================================================= */
#shell-root:not(.focus) #shell-workrow > #shell-canvas { grid-column: 2 / 3 !important; }

/* ===== Cockpit Phase 3 · M1  The Lens (audience dropdown) =================
   A compact trigger chip pinned to the canvas's top-left corner that opens a
   dismissible dropdown of audience lenses. Closed by default; closes on
   outside-click / Esc / select / re-click — so it never sits over the canvas.
   Matches the shell's clay/cream language. Absent entirely in classic mode.
   ========================================================================= */
#sh-lens {
  position: fixed; z-index: 46; left: 16px; top: 150px;
  font-family: var(--sans, 'Plus Jakarta Sans', system-ui, sans-serif);
}

/* --- trigger chip --- */
.sh-lens-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 10px; cursor: pointer;
  background: var(--paper, #fffdf8); border: 1px solid var(--line, #e6dccb);
  border-radius: 999px; color: var(--ink, #2a221d);
  box-shadow: 0 6px 18px -10px rgba(60, 42, 28, .3);
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.sh-lens-trigger:hover { border-color: var(--line-hover, #c9b896); background: var(--cream-2, #efe6d6); }
#sh-lens.open .sh-lens-trigger { border-color: var(--clay, #ba4526); background: var(--clay-wash, #f4e3dc); }
.sh-lens-tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay, #ba4526); box-shadow: 0 0 0 3px rgba(186, 69, 38, .16); flex: 0 0 auto; }
.sh-lens-tcap { font: 700 9px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: #a8977f; }
.sh-lens-tval { font: 600 12px var(--sans); color: var(--ink, #2a221d); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-lens-caret { font-size: 9px; color: var(--ink-2, #5b4f47); transition: transform .16s ease; }
#sh-lens.open .sh-lens-caret { transform: rotate(180deg); }

/* --- dropdown menu (hidden by default) --- */
.sh-lens-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  width: 172px; padding: 9px 9px 10px; box-sizing: border-box;
  background: var(--paper, #fffdf8); border: 1px solid var(--line, #e6dccb);
  border-radius: 12px; box-shadow: 0 14px 40px -16px rgba(60, 42, 28, .4), 0 2px 8px -4px rgba(60, 42, 28, .2);
  animation: shLensIn .16s cubic-bezier(.2, .8, .2, 1) both;
}
.sh-lens-menu[hidden] { display: none; }
@keyframes shLensIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.sh-lens-cap {
  font: 700 9px var(--sans); letter-spacing: .09em; color: #a8977f;
  text-transform: uppercase; padding: 0 2px 7px; display: flex; align-items: center; gap: 5px;
}
.sh-lens-cap::after { content: ""; flex: 1; height: 1px; background: var(--line, #e6dccb); }

.sh-lens-rail { display: flex; flex-direction: column; gap: 2px; }
.sh-lens-chip {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid transparent; background: none; cursor: pointer;
  font: 600 12px var(--sans); color: var(--ink, #2a221d);
  padding: 6px 8px; border-radius: 8px; text-align: left; transition: background .14s, color .14s, border-color .14s;
}
.sh-lens-chip:hover { background: var(--cream-2, #efe6d6); }
.sh-lens-chip .sh-lens-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: #cdbfa8; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); transition: background .14s, box-shadow .14s;
}
.sh-lens-chip.on { background: var(--clay-wash, #f4e3dc); color: var(--clay-deep, #8f3319); border-color: rgba(186, 69, 38, .22); }
.sh-lens-chip.on .sh-lens-dot { background: var(--clay, #ba4526); box-shadow: 0 0 0 3px rgba(186, 69, 38, .16); }
.sh-lens-chip .sh-lens-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sh-lens-hint {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line, #e6dccb);
  font: 500 10.5px var(--sans); line-height: 1.34; color: var(--ink-2, #5b4f47); min-height: 28px;
}

#sh-lens.sh-lens-off { opacity: .5; pointer-events: none; }

/* The Lens is the audience UI now — retire compose's own floating bar,
   segmented toggle, and mixer while it's active. Fully restored on disable()
   (body loses .sh-lens-on) and never applied in classic mode. */
body.sh-lens-on #cmp-bar,
body.sh-lens-on #cmp-toggle,
body.sh-lens-on #cmp-mixer { display: none !important; }

@media (prefers-reduced-motion: reduce) { .sh-lens-menu { animation: none; } }
@media (max-width: 720px) { #sh-lens { display: none; } }
