/* LEVR Facilitator Platform — app shell styles (house style via levr-tokens.css) */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: "Geist", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
/* Make the `hidden` attribute reliable — component display rules (e.g. .overlay{display:grid})
   otherwise override the UA [hidden]{display:none}, leaving hidden overlays intercepting clicks. */
[hidden] {
  display: none !important;
}
/* .kicker base type lives in levr-tokens.css (var-driven); only add layout spacing here. */
.kicker {
  margin-bottom: 6px;
}
.muted {
  color: var(--muted);
}
/* screen-reader-only label (kept off-screen but in the a11y tree) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.err {
  color: var(--danger);
  font-size: 13px;
}
code {
  font-family: "JetBrains Mono", monospace;
  background: var(--hover-surface);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 0.85em;
}

/* ── sign-in gate ──
   Editorial / brand-as-ink: outlined provider buttons (colour comes only from the
   provider logos), a single black primary for email, the mono kicker up top. */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--sidebar-bg);
}
.gate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-elevated);
  border-radius: var(--radius-card);
  padding: clamp(28px, 6vw, 40px);
  width: min(400px, 100%);
  text-align: left;
}
.gate-card .kicker {
  display: block;
}
.gate-card h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 6px 0 8px;
}
.gate-card > .muted {
  color: var(--muted);
  margin: 0 0 22px;
}

/* Provider buttons — outlined, full-width, logo + label. */
.gate-social {
  display: grid;
  gap: 10px;
}
.gate-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}
.gate-provider:hover {
  background: var(--hover-surface);
  border-color: var(--ink-soft);
}
.gate-provider svg {
  flex: 0 0 auto;
}

.gate-email {
  display: grid;
  gap: 10px;
}
.gate-card input {
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-family: "Geist", system-ui, sans-serif; /* readable text, not mono */
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.gate-card input::placeholder {
  color: var(--muted);
}
.gate-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.gate-email .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  margin-top: 2px;
}
.gate-email .btn-ghost {
  width: 100%;
  justify-content: center;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
}
.gate-email .btn-ghost:hover {
  background: transparent;
  color: var(--ink);
}
.gate-card .err {
  color: var(--danger);
  font-size: 12.5px;
  margin: 14px 0 0;
}
/* Email + token are secondary — collapsed disclosures under the social buttons. */
.gate-alts {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}
.gate-alt {
  border-bottom: 1px solid var(--line);
}
.gate-alt > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 2px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gate-alt > summary::-webkit-details-marker {
  display: none;
}
.gate-alt > summary::after {
  content: "+";
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
}
.gate-alt[open] > summary::after {
  content: "\2013"; /* en-dash */
}
.gate-alt > summary:hover {
  color: var(--ink);
}
.gate-alt .gate-email {
  margin: 4px 0 16px;
}

/* ── buttons ──
   Base .btn-primary / .btn-ghost (fill, padding, inline-flex glyph alignment,
   hover, transition) live in levr-tokens.css — the house-style source of truth.
   Earlier this file redefined them, silently dropping the flex alignment used by
   the ●/▶/→ glyph CTAs and the ghost hover state. Only size modifiers live here. */

/* ── app layout ── */
#app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100%;
}
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  /* Pin to the viewport so the footer (Sign out / whoami) stays on-screen even when
     the main content is taller than the page — otherwise the grid column stretches to
     the full document height and margin-top:auto pushes the foot below the fold. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
  padding: 4px 8px 24px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  padding: 9px 12px;
  border-radius: var(--radius-control-sm);
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover {
  background: var(--hover-surface);
}
.nav-item.active {
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 500;
}
.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.whoami {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.whoami-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.whoami-email {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 48px;
}
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}
.view-head h1 {
  font-size: 26px;
  margin: 0;
  font-weight: 600;
}
.empty {
  padding: 40px 0;
}

/* ── cards grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
  padding: 20px;
  min-width: 0; /* let the card shrink in its grid track so long names truncate, not overflow */
  transition:
    box-shadow 0.18s,
    transform 0.18s;
}
/* Lift only on genuinely-clickable cards — a non-clickable engagement card lifting
   on hover reads as a false "click me" affordance (its rows are the link targets). */
.card.clickable:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
.card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere; /* long client names wrap instead of overflowing the card */
}
.card .meta {
  font-size: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}
.card-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

/* ── status chips (taxonomy pastels) ──
   The chip SHAPE (4px-radius square, Geist, sentence-case) is the canonical
   stencil chip defined in levr-tokens.css. Here we only map status → pastel.
   The previous mono-uppercase pill override has been removed so every chip in
   the app matches the brand guide. */
.chip.scheduled {
  background: var(--chip-draft-bg);
  color: var(--chip-draft-fg);
}
.chip.in_session {
  background: var(--chip-review-bg);
  color: var(--chip-review-fg);
}
.chip.build {
  background: var(--chip-published-bg);
  color: var(--chip-published-fg);
}
.chip.delivered {
  background: var(--chip-ready-bg);
  color: var(--chip-ready-fg);
}

/* ── engagement workshop rows ── */
.ws-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
}
.ws-name {
  font-weight: 500;
  min-width: 0; /* allow shrink so a long name ellipsizes instead of shoving the stage indicator out */
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-date {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.ws-row .chip {
  margin: 0 0 0 auto;
}

/* ── setup wizard ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.32);
  display: grid;
  place-items: center;
  padding: 24px;
}
/* Lock the page behind any open overlay so the background doesn't scroll under it (mobile). */
body.modal-open {
  overflow: hidden;
}
.wizard-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  width: min(560px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: 28px 30px;
}
.wizard-card.narrow {
  width: min(480px, 96vw);
}
.wizard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.wizard-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 600;
}
.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  padding: 2px 6px;
}
.icon-btn.sm {
  font-size: 16px;
}
.icon-btn:hover {
  color: var(--ink);
}

.stepper {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 20px 0 24px;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
}
.stepper li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--hover-surface);
  color: var(--muted);
  font-size: 11px;
}
.stepper li.active {
  color: var(--ink);
}
.stepper li.active span {
  background: var(--accent);
  color: var(--accent-fg);
}

.wiz-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lbl {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
  margin-top: 6px;
}
.field {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Geist", sans-serif;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
}
.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field:disabled {
  background: var(--hover-surface);
  color: var(--muted);
}
.field.sm {
  padding: 8px 10px;
  font-size: 13px;
}
textarea.field {
  resize: vertical;
}
.radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 4px;
}
.attendee {
  display: flex;
  gap: 8px;
  align-items: center;
}
.attendee .field {
  flex: 1;
}

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-control);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.dragover {
  background: var(--hover-surface);
}
.dropzone.dragover {
  border-color: var(--accent);
  color: var(--ink-soft);
}
.filelist {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filelist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  background: var(--hover-surface);
  padding: 7px 12px;
  border-radius: var(--radius-control-sm);
}
.review {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.rev-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}
.rev-k {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wizard-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}
.btn-ghost.sm {
  padding: 6px 12px;
  font-size: 12px;
  align-self: flex-start;
}

/* ── in-room recorder ── */
.rec-btn {
  margin-left: 8px;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  cursor: pointer;
}
.rec-btn:hover {
  background: var(--danger-soft);
}
.rec-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elevated);
  width: min(480px, 96vw);
  max-height: 90vh; /* the review panel can grow past the fold on phones — scroll within the card */
  overflow: auto;
  padding: 28px 30px;
}
.rec-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
}
.rec-timer {
  font-family: "JetBrains Mono", monospace;
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.rec-stats {
  font-size: 12px;
  text-align: center;
  min-height: 32px;
}
.rec-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
#rec-toggle.recording {
  background: var(--danger);
}
.rec-review {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}
.rec-review-head {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ── integrator console ── */
/* live polling indicator in the view header — tells staff the fleet is updating */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 6px;
}
.live-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--chip-ready-fg);
  animation: levr-pulse 1.6s ease-in-out infinite;
}
@keyframes levr-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ── loading skeletons (placeholders shown while a view's data is in flight) ── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--hover-surface);
  border-radius: 6px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--surface) 70%, transparent),
    transparent
  );
  animation: levr-shimmer 1.4s ease-in-out infinite;
}
@keyframes levr-shimmer {
  100% {
    transform: translateX(100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    animation: none;
  }
}
.skel-line {
  height: 12px;
  margin: 10px 0;
}
.skel-line.lg {
  height: 18px;
}
.skel-line.w-70 {
  width: 70%;
}
.skel-line.w-50 {
  width: 50%;
}
.skel-line.w-35 {
  width: 35%;
}
.skel-row {
  height: 46px;
  margin: 8px 0;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .live-badge .live-dot {
    animation: none;
  }
}
.console-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 900px) {
  .console-split {
    grid-template-columns: 360px 1fr;
  }
}
.runs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.run-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}
.run-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}
/* Selected run: accent ring + faint fill so it reads clearly against neighbours,
   not just a 1px border swap. */
.run-card.sel {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}
.run-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.run-kind {
  font-weight: 600;
  font-size: 14px;
}
.run-card .meta {
  margin-top: 6px;
}
.chip.run-queued {
  background: var(--chip-archived-bg);
  color: var(--chip-archived-fg);
}
.chip.run-claimed,
.chip.run-running {
  background: var(--chip-review-bg);
  color: var(--chip-review-fg);
}
.chip.run-done {
  background: var(--chip-ready-bg);
  color: var(--chip-ready-fg);
}
.chip.run-failed,
.chip.run-killed {
  background: var(--chip-error-bg);
  color: var(--chip-error-fg);
}
.chip.run-paused {
  background: var(--chip-draft-bg);
  color: var(--chip-draft-fg);
}
.chip[class*="run-"] {
  margin-top: 0;
}

.run-drawer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  min-height: 200px;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ev-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ev-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  align-items: baseline;
}
.ev-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  flex: 0 0 auto;
  max-width: 40%;
  word-break: break-word;
}
/* On narrow screens the fixed label column starves the message — stack instead. */
@media (max-width: 480px) {
  .ev-row {
    flex-direction: column;
    gap: 2px;
  }
  .ev-type {
    max-width: 100%;
  }
}
.ev-msg {
  color: var(--ink-soft);
}
.log-tail {
  margin-top: 14px;
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
}

/* ── workshop cockpit ── */
#ws-back {
  margin-bottom: 14px;
  align-self: flex-start;
}
.ws-head {
  margin-bottom: 18px;
}
.ws-sub {
  font-size: 13px;
  margin-top: 4px;
  font-family: "JetBrains Mono", monospace;
}
.ws-row.clickable {
  cursor: pointer;
  border-radius: var(--radius-control-sm);
  padding: 8px 6px;
  margin-left: -6px;
}
.ws-row.clickable:hover {
  background: var(--hover-surface);
}

.stage-stepper {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.stage-stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 130px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.stage-stepper li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--hover-surface);
  color: var(--muted);
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
}
/* At narrow widths the stepper wraps; lock items to a clean 2-up grid so a lone
   last item doesn't stretch full-width and break the spine's rhythm. */
@media (max-width: 560px) {
  .stage-stepper li {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}
.stage-stepper li.active {
  color: var(--ink);
  border-color: var(--line-strong);
}
.stage-stepper li.active span {
  background: var(--accent);
  color: var(--accent-fg);
}
/* "You are here": every completed stage gets the filled dot, so the current stage
   needs more than a 1px border to stand out — accent ring + soft fill + bold label. */
.stage-stepper li.current {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    var(--shadow-card);
  background: var(--accent-soft);
  font-weight: 600;
}

.ws-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
/* Go 2-col as soon as the sidebar collapses to a top bar (≤768px), so tablets in
   the 768–860px band use the freed width instead of a single stacked column. */
@media (min-width: 769px) {
  .ws-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.ws-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card);
  padding: 20px;
}
.ws-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ws-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.ws-card-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Kebab overflow menu for occasional (integrator) session actions. Native <details> so it's
   accessible and self-closing; a global click handler closes it when you click elsewhere. */
.overflow-menu {
  position: relative;
}
.overflow-trigger {
  list-style: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
  user-select: none;
}
.overflow-trigger::-webkit-details-marker {
  display: none;
}
.overflow-trigger:hover,
.overflow-menu[open] .overflow-trigger {
  color: var(--ink);
  background: var(--accent-soft);
}
.overflow-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-elevated);
}
.overflow-menu-item {
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.overflow-menu-item:hover {
  background: var(--accent-soft);
}

/* Integrator-only manual-upload drop zone: an overlay that only appears while a file is dragged
   over the Sessions card (revealed by JS toggling [hidden]). Two sides: audio | transcript. */
#ws-sessions-card {
  position: relative;
}
.ws-dropzone {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  gap: 12px;
  padding: 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-radius: var(--radius-card-sm);
}
.ws-drop-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-control);
  text-align: center;
  /* let drops register on the pane, not its text spans */
  pointer-events: auto;
}
.ws-drop-pane * {
  pointer-events: none;
}
.ws-drop-pane.dragover {
  background: var(--hover-surface);
  border-color: var(--accent);
}
.ws-drop-icon {
  font-size: 24px;
  line-height: 1;
}
.ws-drop-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.ws-drop-sub {
  font-size: 11px;
  color: var(--muted);
}
/* Busy: a drop is uploading — dim and lock the zone until it resolves. */
.ws-dropzone.busy {
  opacity: 0.55;
  pointer-events: none;
}

.ov-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.ov-row:last-child {
  border-bottom: none;
}
.ov-k {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 96px;
}
.ov-v {
  color: var(--ink-soft);
  flex: 1;
}

.rec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.rec-item:last-child {
  border-bottom: none;
}
.rec-item-h {
  font-weight: 500;
}
.run-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── dashboard pipeline polish ── */
.ws-row .stage-ind {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pips {
  display: inline-flex;
  gap: 3px;
}
.pip {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--line-strong);
  display: inline-block;
}
.pip.on {
  background: var(--ink-soft);
}
.pip.cur {
  background: var(--accent);
  transform: scale(1.25);
}
/* Matches the canonical stencil chip (Geist, sentence-case, 4px radius) so the
   dashboard stage tag and status chips read as one system. */
.stage-label {
  font-family: "Geist", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 2px 8px;
  border-radius: var(--radius-chip);
}
.stage-label.stage-prep {
  background: var(--chip-draft-bg);
  color: var(--chip-draft-fg);
}
.stage-label.stage-in_session {
  background: var(--chip-review-bg);
  color: var(--chip-review-fg);
}
.stage-label.stage-build {
  background: var(--chip-published-bg);
  color: var(--chip-published-fg);
}
.stage-label.stage-delivered {
  background: var(--chip-ready-bg);
  color: var(--chip-ready-fg);
}
.ws-chevron {
  color: var(--line-strong);
  font-size: 18px;
  line-height: 1;
  margin-left: 2px;
}
.ws-row.clickable:hover .ws-chevron {
  color: var(--muted);
}

/* ── toasts ── */
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.toast {
  background: var(--ink);
  color: var(--accent-fg);
  font-size: 13px;
  font-weight: 500;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  max-width: min(360px, calc(100vw - 40px)); /* never touch/overflow the screen edges on mobile */
}
.toast.in {
  opacity: 1;
  transform: none;
}
.toast-error {
  background: #7a2222;
}

/* ── empty states ── */
.empty-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  padding: 18px 4px;
}
.empty-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
  border: 2px dashed var(--line-strong);
}

/* ── subtle entrance animations ── */
@keyframes levr-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes levr-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.overlay {
  animation: levr-fade 0.14s ease;
}
.wizard-card,
.rec-card {
  animation: levr-pop 0.2s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.view:not([hidden]) {
  animation: levr-fade 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .overlay,
  .wizard-card,
  .rec-card,
  .view {
    animation: none;
  }
  .toast {
    transition: none;
  }
}

/* ── re-openable session rows (cockpit) ── */
.rec-item-wrap {
  border-bottom: 1px solid var(--line);
}
.rec-item-wrap:last-child {
  border-bottom: none;
}
.rec-row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 11px 4px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  border-radius: var(--radius-control-sm);
}
.rec-row-btn:hover {
  background: var(--hover-surface);
}
.rec-item-wrap.open .rec-row-btn {
  background: var(--hover-surface);
}
.rec-row-btn .rec-item-h {
  font-weight: 600;
  flex: none;
}
.rec-row-btn .rec-status {
  flex: 1;
}
.rec-chevron {
  color: var(--line-strong);
  font-size: 16px;
  line-height: 1;
}
.rec-row-btn:hover .rec-chevron {
  color: var(--muted);
}

.session-detail {
  padding: 6px 4px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
/* Optional framing the facilitator can attach when submitting a session — it rides into the
   next build's prompt as an instruction, not as transcript. Grows to fill the row so a real
   sentence fits, but stays visually secondary to the Submit button beside it. */
.submit-note {
  flex: 1 1 260px;
  min-width: 200px;
  font-size: 13px;
  padding: 7px 10px;
}
.btn-primary.sm {
  padding: 7px 14px;
  font-size: 13px;
}
.btn-ghost.sm.danger {
  color: var(--danger);
  border-color: #e6c8c8;
}
.btn-ghost.sm.danger:hover {
  background: var(--danger-soft);
}
.ok-chip {
  background: var(--chip-ready-bg);
  color: var(--chip-ready-fg);
  margin: 0;
}
.session-detail-body {
  background: var(--hover-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
}

/* ── calm facilitator build status (cockpit) ── */
.build-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 6px 0;
}
.build-status.done {
  color: var(--ink);
}
.build-status.snag {
  color: var(--danger);
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: none;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: levr-spin 0.7s linear infinite;
}
@keyframes levr-spin {
  to {
    transform: rotate(360deg);
  }
}
/* Where the room makes the decision the build is waiting on. */
.halt-where {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
/* The "Continue anyway" escape hatch — deliberately quiet, since waiting is the right default. */
.halt-actions {
  margin-top: 10px;
}

/* The halt picker — the one place a halt is answered. The room decides out loud around the
   dashboard; the facilitator commits it here, behind the session they already have. */
.halt-picker {
  margin-top: 4px;
}
.halt-ask {
  margin: 2px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.halt-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.halt-option {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.halt-option:hover {
  border-color: var(--line-strong);
}
.halt-option.picked {
  border-color: var(--accent);
  background: var(--hover-surface);
}
.halt-option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.halt-option-detail {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* The four-stage ladder under the build status. The Calibration Day builds in stages and
   halts twice for the room's decisions, so the facilitator can always see where the day is:
   what's built, what's building, what's still ahead. Deliberately quiet — it is orientation,
   not a progress bar. */
.stage-ladder {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 7px;
}
.stage-ladder li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-faint, var(--ink-soft));
  opacity: 0.6;
}
.stage-ladder .stage-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
}
.stage-ladder li.done {
  opacity: 1;
  color: var(--ink-soft);
}
.stage-ladder li.done .stage-dot {
  background: var(--line-strong);
  border-color: var(--line-strong);
}
.stage-ladder li.building,
.stage-ladder li.next {
  opacity: 1;
  color: var(--ink);
}
.stage-ladder li.building .stage-dot,
.stage-ladder li.next .stage-dot {
  border-color: var(--accent);
}
.stage-ladder li.building .stage-dot {
  background: var(--accent);
  animation: levr-stage-pulse 1.4s ease-in-out infinite;
}
@keyframes levr-stage-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stage-ladder li.building .stage-dot {
    animation: none;
  }
}

.build-bar {
  margin-top: 12px;
  height: 5px;
  border-radius: 999px;
  background: var(--hover-surface);
  overflow: hidden;
  position: relative;
}
.build-bar i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: var(--accent);
  animation: levr-indeterminate 1.5s ease-in-out infinite;
}
@keyframes levr-indeterminate {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .spinner,
  .build-bar i {
    animation: none;
  }
  .build-bar i {
    left: 0;
    width: 100%;
    opacity: 0.5;
  }
}

/* ── mobile: collapse the sidebar to a top bar, reflow headers (≤768px) ──
   A facilitator may run a Calibration Day from a tablet/phone in the room. Without
   this, the fixed 240px grid clips the header and mashes the primary CTA. */
@media (max-width: 768px) {
  #app {
    grid-template-columns: 1fr;
    min-height: 100%;
  }
  .sidebar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--sidebar-bg);
    /* override the desktop viewport-tall sidebar — here it's a short horizontal top bar */
    height: auto;
    overflow: visible;
  }
  .brand {
    padding: 0 6px 0 0;
    font-size: 18px;
  }
  .sidebar nav {
    flex-direction: row;
    flex: 1;
    gap: 4px;
    min-width: 0;
  }
  .nav-item {
    padding: 7px 12px;
    font-size: 13px;
    min-height: 44px; /* touch target — facilitators run this from a tablet/phone */
    display: flex;
    align-items: center;
  }
  .sidebar-foot {
    margin-top: 0;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .sidebar-foot .btn-ghost {
    min-height: 44px;
  }
  /* 16px inputs on touch so iOS Safari doesn't zoom-jump the viewport on focus */
  .field,
  .field.sm,
  .gate-card input,
  .search {
    font-size: 16px;
  }
  .whoami {
    display: none; /* reclaim width on small screens */
  }
  .main {
    max-width: 100%;
    padding: 20px 16px;
  }
  .view-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 22px;
  }
  .view-head h1 {
    font-size: 22px;
  }
  /* primary actions go full-width below the title instead of being squeezed inline */
  .view-head .btn-primary,
  #ws-run-stage {
    width: 100%;
  }
  .ws-head #ws-title {
    font-size: 21px;
  }
  .ws-row {
    flex-wrap: wrap;
  }
  .ws-row.clickable {
    min-height: 44px; /* touch target on the primary "open workshop" affordance */
  }
  .ws-row .stage-ind {
    margin-left: 0;
  }
}

/* ── transcript preview (the glance) ── */
.transcript-preview {
  width: 100%;
  margin: 14px 0 4px;
}
.tp-head {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.tp-body {
  background: var(--hover-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  text-align: left;
}

/* Provisioned deliverable site link (spec 09) — a Notion-style clickable link card:
   mono caption, bold URL, an "Open ↗" affordance, with a subtle hover/focus lift. */
.deliverable-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
.deliverable-card:hover {
  background: var(--hover-surface);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}
.deliverable-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.deliverable-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0; /* let the URL truncate/wrap instead of overflowing the card */
}
.deliverable-label {
  font-family: "JetBrains Mono", monospace;
  font-size: var(--fs-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.deliverable-url {
  font-weight: 600;
  font-size: 14px;
  overflow-wrap: anywhere; /* wrap long URLs at sensible points, not mid-token like break-all */
}
.deliverable-open {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.deliverable-card:hover .deliverable-open {
  color: var(--ink);
}
/* The deliverable card reuses the shared .build-status / .spinner idiom for deploy state,
   so its status line matches the build card. A little breathing room above that line. */
.deliverable-card + .build-status {
  margin-top: 10px;
}

/* ── invite facilitator ── */
.view-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.invite-list-head {
  display: block;
  margin: 20px 0 8px;
}
.invite-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
}
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.invite-row-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.invite-email {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-tenant {
  font-size: 11.5px;
}
