/* The Signal Room: BlockTalk at a radio array, at dusk
   (docs/design/signal-array.md). The conversation is a logbook on paper; the
   dishes drift while the room is idle and slew while an answer is on its way.
   The classes keep the room's first name, the Lamp Room. */

.bb-lamp {
  --bb-l-text: var(--bb-night-text);
  --bb-l-text-2: var(--bb-night-text-2);
  --bb-l-page: #FBF7EE;
  --bb-l-card: #F4EEE1;
  --bb-l-rule: rgba(27, 33, 41, 0.14);
  --bb-l-mark: #D99A2B;
  position: relative;
  isolation: isolate;
  overflow: clip;
  min-height: 0;
  padding: 0 0 var(--bb-space-10);
  color: var(--bb-l-text);
  background: #232937;
  font-family: var(--bb-font-text);
}

/* The sky: night above, a glow round the dishes, a warm band where the sun
   went down, mist low. */
.bb-lamp__sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 440px 300px at 74% 170px, rgba(255, 213, 138, 0.16), rgba(255, 213, 138, 0) 70%),
    radial-gradient(ellipse 90% 18% at 55% 40%, rgba(214, 160, 104, 0.16), rgba(214, 160, 104, 0) 72%),
    linear-gradient(180deg, #141924 0%, #1F2533 22%, #2B3140 40%, #383944 52%, #2C303C 66%, #232937 100%);
}

.bb-lamp__sky::before,
.bb-lamp__sky::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  height: 22%;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(220, 214, 204, 0.12), rgba(220, 214, 204, 0) 70%);
  filter: blur(18px);
}

.bb-lamp__sky::before { top: 30%; }
.bb-lamp__sky::after { top: 44%; left: 10%; opacity: 0.7; }

@media (prefers-reduced-motion: no-preference) {
  .bb-lamp__sky::before { animation: bb-l-drift 40s ease-in-out infinite alternate; }
  .bb-lamp__sky::after { animation: bb-l-drift 55s ease-in-out infinite alternate-reverse; }
}

@keyframes bb-l-drift {
  from { transform: translateX(-4%); }
  to { transform: translateX(4%); }
}

/* ---- The head: the array and the room's name ------------------------ */

.bb-lamp__head {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(340px, 30vw, 500px);
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: var(--bb-space-8) var(--bb-margin) var(--bb-space-7);
}

.bb-lamp__scene {
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: min(66%, 860px);
  margin: 0;
}

.bb-lamp__frame { position: relative; display: block; }
.bb-lamp__still { display: block; width: 100%; height: auto; }

/* The live model draws over the still in the same box, and the still stays
   underneath as the page's first paint and everyone else's picture. */
.bb-lamp__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bb-dur-4) var(--bb-ease-out);
}

.bb-lamp__scene.is-live .bb-lamp__canvas { opacity: 1; }
.bb-lamp__scene.is-live .bb-lamp__still { opacity: 0; transition: opacity var(--bb-dur-4) var(--bb-ease-out); }

/* On the still, the two feeds brighten while an answer is on its way. Each
   sits where the camera in lib/signal_array_rig puts it. */
.bb-lamp__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 49.85% 7.8%, rgba(255, 220, 150, 0.6), rgba(255, 220, 150, 0) 9%),
    radial-gradient(circle at 62.93% 11.22%, rgba(255, 220, 150, 0.6), rgba(255, 220, 150, 0) 11%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--bb-dur-3);
}

.bb-lamp__scene.is-live .bb-lamp__frame::after { display: none; }
.bb-lamp.is-thinking .bb-lamp__frame::after { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .bb-lamp.is-thinking .bb-lamp__frame::after { animation: bb-l-pulse 0.9s ease-in-out infinite alternate; }
}

@keyframes bb-l-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.bb-lamp__credit {
  position: absolute;
  top: 66%;
  right: 12%;
  font-family: var(--bb-font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--bb-l-text-2);
  white-space: nowrap;
}

.bb-lamp__credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.bb-lamp__title { position: relative; max-width: 34rem; }

.bb-lamp__kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--bb-font-mono);
  font-size: var(--bb-fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bb-lamp);
}

.bb-lamp__kicker::after { content: ""; width: 48px; height: 1px; background: currentColor; }

.bb-lamp__name {
  margin: var(--bb-space-3) 0 0;
  font-family: var(--bb-font-serif);
  font-size: clamp(3.4rem, 2rem + 4.4vw, 6.25rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.015em;
  color: var(--bb-l-text);
}

.bb-lamp__lede {
  margin: var(--bb-space-4) 0 0;
  font-size: var(--bb-fs-lead);
  line-height: 1.5;
  color: var(--bb-l-text-2);
}

/* ---- The room: the keeper's card and the log ------------------------- */

.bb-lamp .chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--bb-space-6);
  align-items: start;
  max-width: var(--bb-max);
  min-height: 0;
  height: auto;
  margin: 0 auto;
  padding: 0 var(--bb-margin);
  background: none;
}

.bb-lamp .chat-sidebar {
  position: sticky;
  top: 96px;
  display: block;
  min-height: 0;
  padding: var(--bb-space-5);
  color: var(--bb-ink);
  background: var(--bb-l-card);
  border: 0;
  border-radius: var(--bb-radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.bb-lamp .sidebar-header {
  display: grid;
  gap: var(--bb-space-3);
  margin: 0 0 var(--bb-space-3);
  padding: 0;
  background: none;
  border: 0;
}

.bb-lamp .sidebar-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--bb-font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.15;
  color: var(--bb-ink);
}

/* The keeper's card carries the lamp's mark beside its title. */
.bb-lamp .sidebar-header h2::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  background: var(--bb-l-mark);
}

.bb-lamp .trial-info { padding: 0; overflow: visible; background: none; }
.bb-lamp .trial-description p { margin: 0 0 var(--bb-space-3); font-size: 0.92rem; line-height: 1.55; color: var(--bb-ink-2); }
.bb-lamp .trial-description p:first-child { color: var(--bb-ink); }
.bb-lamp .trial-cta { margin-top: var(--bb-space-4); }

.bb-lamp :is(.btn-sidebar-cta, .btn-new-chat, .btn-delete-session) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 42px;
  padding: 0 var(--bb-space-4);
  font-family: var(--bb-font-text);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bb-ink);
  text-decoration: none;
  background: transparent;
  border: 1.5px solid var(--bb-ink);
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 3px 0 0 var(--bb-ink);
  cursor: pointer;
  transition: transform var(--bb-dur-1) var(--bb-ease-out), box-shadow var(--bb-dur-1) var(--bb-ease-out);
}

.bb-lamp :is(.btn-sidebar-cta, .btn-new-chat, .btn-delete-session):hover { color: var(--bb-ink); background: rgba(255, 255, 255, 0.5); transform: translateY(-1px); box-shadow: 0 4px 0 0 var(--bb-ink); }
.bb-lamp :is(.btn-sidebar-cta, .btn-new-chat, .btn-delete-session):focus-visible { outline: 2px solid var(--bb-signal); outline-offset: 3px; }

.bb-lamp .conversation-list { margin: var(--bb-space-3) 0 0; padding: 0; overflow-y: auto; }

.bb-lamp .conversation-item {
  position: relative;
  margin: 0;
  padding: 10px 28px 10px 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--bb-l-rule);
  border-radius: 0;
}

.bb-lamp .conversation-item.active .conversation-title { color: var(--bb-signal-ink); }
.bb-lamp .conversation-link { display: block; color: var(--bb-ink); text-decoration: none; }
.bb-lamp .conversation-title { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.bb-lamp .conversation-meta { display: flex; gap: 6px; font-family: var(--bb-font-mono); font-size: 0.7rem; color: var(--bb-ink-2); }

.bb-lamp .btn-delete-chat {
  position: absolute;
  top: 8px;
  right: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--bb-ink-2);
  background: none;
  border: 0;
  cursor: pointer;
}

.bb-lamp .mode-badge {
  margin-left: 6px;
  padding: 0 6px;
  font-family: var(--bb-font-mono);
  font-size: 0.65rem;
  color: var(--bb-ink-2);
  border: 1px solid currentColor;
  border-radius: 3px;
}

/* The log: paper under the lamp, warmer where the light falls. */
.bb-lamp .chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: var(--bb-ink);
  background: linear-gradient(180deg, #FFF6E2 0%, var(--bb-l-page) 28%);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.bb-lamp .chat-header {
  padding: var(--bb-space-4) var(--bb-space-6);
  color: var(--bb-ink);
  background: none;
  border: 0;
  border-bottom: 1.5px solid var(--bb-ink);
}

.bb-lamp .chat-header-content { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-space-4); }
.bb-lamp .chat-header-text { display: flex; flex: 1; align-items: center; gap: var(--bb-space-3); }
.bb-lamp .bb-lamp__keeper { width: 34px; height: 34px; object-fit: contain; }

.bb-lamp .chat-subtitle {
  margin: 0;
  font-family: var(--bb-font-mono);
  font-size: var(--bb-fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-ink-2);
}

.bb-lamp .chat-messages {
  flex: 1;
  min-height: 380px;
  max-height: min(68vh, 760px);
  overflow-y: auto;
  padding: var(--bb-space-2) var(--bb-space-6) var(--bb-space-5);
  background: none;
  scroll-behavior: smooth;
}

/* Until the first question the log is only the welcome, shown whole; the
   controller scrolls the box to its end on load, which would cut its top. */
.bb-lamp .chat-messages:not(:has(.user-message)) { max-height: none; overflow: visible; }

/* ---- Entries in the log --------------------------------------------- */

.bb-lamp .message {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: var(--bb-space-4);
  margin: 0;
  padding: var(--bb-space-5) 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--bb-l-rule);
  animation: none;
}

.bb-lamp .chat-messages > .message:first-child,
.bb-lamp .welcome-message + .message { border-top: 0; }

.bb-lamp .message-avatar {
  display: flex;
  flex: 0 0 104px;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  padding-top: 5px;
  font-family: var(--bb-font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--bb-ink-2);
  background: none;
  border-radius: 0;
  align-self: start;
}

.bb-lamp .user-message .message-avatar { order: -1; }
.bb-lamp .message-avatar img { width: 22px; height: 22px; object-fit: contain; border-radius: 0; }
.bb-lamp .assistant-message .message-avatar::after { content: "BlockTalk"; }

.bb-lamp :is(.error-message, .warning-message) .message-avatar {
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--bb-paper);
  background: var(--bb-signal-ink);
}

.bb-lamp .warning-message .message-avatar { color: var(--bb-ink); background: var(--bb-l-mark); }

.bb-lamp .message-content {
  min-width: 0;
  text-align: left;
  max-width: 46em;
  margin: 0;
  padding: 0;
  color: var(--bb-ink);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* The old chat drew every message as a bubble; the log has none. */
.bb-lamp .message-text {
  padding: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bb-ink);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* What the visitor asks is written into the log by hand. */
.bb-lamp .user-message .message-text {
  font-family: var(--bb-font-serif);
  font-size: 1.32rem;
  font-style: italic;
  line-height: 1.4;
}

.bb-lamp .message-text > :first-child { margin-top: 0; }
.bb-lamp .message-text > :last-child { margin-bottom: 0; }
.bb-lamp .message-text p { margin: 0 0 0.8em; }
.bb-lamp .message-text :is(ul, ol) { margin: 0 0 0.8em; padding-left: 1.3em; }
.bb-lamp .message-text li + li { margin-top: 0.35em; }
.bb-lamp .message-text strong { font-weight: 600; }
.bb-lamp .message-text hr { margin: 1.1em 0; border: 0; border-top: 1px solid var(--bb-l-rule); }
.bb-lamp .message-text code { padding: 0 4px; font-family: var(--bb-font-mono); font-size: 0.88em; background: rgba(27, 33, 41, 0.06); border-radius: 3px; }

.bb-lamp .message-text a,
.bb-lamp .user-message .message-text a {
  font-weight: 600;
  color: var(--bb-ink);
  text-decoration: underline;
  text-decoration-color: var(--bb-signal);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.bb-lamp .message-text a:hover { color: var(--bb-signal-ink); }

.bb-lamp .message-text a.product-buy-btn {
  display: inline-flex;
  margin: 0.25em 0.4em 0.25em 0;
  padding: 6px 12px;
  color: var(--bb-paper);
  text-decoration: none;
  background: var(--bb-ink);
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 3px 0 0 var(--bb-signal);
  transform: none;
}

.bb-lamp .message-text a.product-buy-btn:hover { color: var(--bb-paper); background: var(--bb-ink); transform: translateY(-1px); }

.bb-lamp .message-timestamp {
  margin: var(--bb-space-2) 0 0;
  font-family: var(--bb-font-mono);
  font-size: 0.68rem;
  color: var(--bb-ink-2);
}

.bb-lamp .error-message .message-text { color: var(--bb-signal-ink); }

/* Answers BlockTalk gives as data (structured replies). */
.bb-lamp :is(.structured-summary, .response-summary) { margin: 0 0 0.8em; }
.bb-lamp :is(.evidence-table-container, .evidence-table) { overflow-x: auto; }
.bb-lamp :is(table.evidence-table, table.data-table) { width: 100%; margin: 0.8em 0; border-collapse: collapse; font-size: 0.9rem; }

.bb-lamp :is(table.evidence-table, table.data-table) :is(th, td) {
  padding: 6px 10px 6px 0;
  text-align: left;
  border-bottom: 1px solid var(--bb-l-rule);
}

.bb-lamp :is(table.evidence-table, table.data-table) th {
  font-family: var(--bb-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bb-ink-2);
  border-bottom-color: var(--bb-ink);
}

.bb-lamp :is(.recommendations-container, .recommendations-grid, .insights-container, .key-insights) h4 {
  margin: 1em 0 0.5em;
  font-family: var(--bb-font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-ink-2);
}

.bb-lamp :is(.recommendation-card, .rec-card) {
  margin: 0 0 0.8em;
  padding: 0.6em 0 0.6em 14px;
  background: none;
  border: 0;
  border-left: 3px solid var(--bb-ink);
  border-radius: 0;
  box-shadow: none;
}

.bb-lamp :is(.verdict, .rec-verdict, .intent-badge) { font-family: var(--bb-font-mono); font-size: 0.78rem; color: var(--bb-ink-2); background: none; }
.bb-lamp :is(.source-notes, .response-notes) { margin-top: 0.8em; font-size: 0.82rem; color: var(--bb-ink-2); }

/* The lamp works while BlockTalk is answering: three squares in the log
   pulse in step with the beam above. */
.bb-lamp .typing-indicator { gap: var(--bb-space-4); border-top: 1px solid var(--bb-l-rule); }
.bb-lamp .typing-dots { display: flex; gap: 6px; padding: 8px 0; background: none; }

.bb-lamp .typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--bb-l-mark);
  border-radius: 0;
  animation: bb-l-dot 1.2s ease-in-out infinite;
}

.bb-lamp .typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.bb-lamp .typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bb-l-dot {
  0%, 100% { opacity: 0.3; transform: none; }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ---- The empty log: what the keeper can do --------------------------- */

.bb-lamp .welcome-message {
  max-width: 44em;
  margin: 0;
  padding: var(--bb-space-6) 0 var(--bb-space-3);
  text-align: left;
  color: var(--bb-ink);
  background: none;
}

.bb-lamp .welcome-message h2 {
  margin: 0 0 var(--bb-space-2);
  font-family: var(--bb-font-serif);
  font-size: clamp(1.9rem, 1.5rem + 1vw, 2.5rem);
  font-weight: 500;
  line-height: 1.1;
  color: var(--bb-ink);
}

.bb-lamp .welcome-message > p { margin: 0; color: var(--bb-ink-2); }

.bb-lamp .capabilities-list {
  display: grid;
  margin: var(--bb-space-4) 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.bb-lamp .capabilities-list li {
  position: relative;
  margin: 0;
  padding: 9px 0 9px 22px;
  font-size: 0.98rem;
  border-top: 1px solid var(--bb-l-rule);
}

.bb-lamp .capabilities-list li::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--bb-l-mark);
  transform: translateY(-50%);
}

.bb-lamp .example-prompts { margin: var(--bb-space-6) 0 0; }

.bb-lamp .example-prompts > p {
  margin: 0 0 var(--bb-space-3);
  font-family: var(--bb-font-mono);
  font-size: var(--bb-fs-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-ink-2);
}

.bb-lamp .example-prompts > p strong { font-weight: 500; }

.bb-lamp .prompt-chips {
  display: grid;
  gap: 0;
  border-top: 1.5px solid var(--bb-ink);
}

.bb-lamp .prompt-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--bb-space-4);
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 4px;
  font-family: var(--bb-font-text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  color: var(--bb-ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--bb-l-rule);
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background-color var(--bb-dur-2), padding var(--bb-dur-2) var(--bb-ease-out);
}

.bb-lamp .prompt-chip::after { content: "\2192"; flex: 0 0 auto; color: var(--bb-signal-ink); }
.bb-lamp .prompt-chip:hover { color: var(--bb-ink); background: rgba(217, 154, 43, 0.12); padding-left: 10px; transform: none; }
.bb-lamp .prompt-chip:focus-visible { outline: 2px solid var(--bb-signal); outline-offset: -2px; }

/* ---- The pen: writing into the log ------------------------------------ */

.bb-lamp .chat-input-container {
  padding: var(--bb-space-4) var(--bb-space-6) var(--bb-space-5);
  background: var(--bb-l-card);
  border: 0;
  border-top: 1.5px solid var(--bb-ink);
}

.bb-lamp .chat-form { display: flex; gap: var(--bb-space-3); margin: 0; }

.bb-lamp .chat-input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  margin: 0;
  padding: 12px 16px;
  font-family: var(--bb-font-text);
  font-size: 1.05rem;
  color: var(--bb-ink);
  background: #FFFFFF;
  border: 1.5px solid rgba(27, 33, 41, 0.45);
  border-radius: var(--bb-radius-sm);
  box-shadow: none;
}

.bb-lamp .chat-input::placeholder { color: #6E7684; }
.bb-lamp .chat-input:focus { border-color: var(--bb-ink); outline: none; box-shadow: 0 0 0 3px rgba(216, 67, 43, 0.22); }

.bb-lamp .btn-send {
  min-height: 52px;
  padding: 0 var(--bb-space-6);
  font-family: var(--bb-font-text);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bb-paper);
  background: var(--bb-ink);
  border: 1.5px solid var(--bb-ink);
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 4px 0 0 var(--bb-signal);
  cursor: pointer;
  transition: transform var(--bb-dur-1) var(--bb-ease-out), box-shadow var(--bb-dur-1) var(--bb-ease-out);
}

.bb-lamp .btn-send:hover { background: var(--bb-ink); transform: translateY(-1px); box-shadow: 0 5px 0 0 var(--bb-signal); }
.bb-lamp .btn-send:active { transform: translateY(4px); box-shadow: none; }
.bb-lamp .btn-send:disabled { opacity: 0.55; cursor: progress; transform: none; }
.bb-lamp .btn-send:focus-visible { outline: 2px solid var(--bb-signal); outline-offset: 3px; }

.bb-lamp .input-hint { margin: var(--bb-space-3) 0 0; font-size: 0.84rem; text-align: left; color: var(--bb-ink-2); }

/* ---- Narrow screens ---------------------------------------------------- */

@media (max-width: 899px) {
  /* The still is 16:10; the title starts below it so the credit, under
     the model, never crosses the title. */
  .bb-lamp__head { min-height: 0; padding-top: min(calc(60vw + 12px), 400px); padding-bottom: var(--bb-space-6); }
  .bb-lamp__scene { width: min(96%, 620px); }
  .bb-lamp__credit { top: auto; right: 4%; bottom: 2%; white-space: normal; text-align: right; }
  .bb-lamp .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .bb-lamp .chat-sidebar { position: static; display: block; order: 2; }
  .bb-lamp .chat-header-content { flex-direction: row; }
}

@media (max-width: 640px) {
  .bb-lamp .chat-layout { padding: 0 var(--bb-space-3); }
  .bb-lamp :is(.chat-header, .chat-input-container) { padding-left: var(--bb-space-4); padding-right: var(--bb-space-4); }
  .bb-lamp .chat-messages { min-height: 300px; max-height: 62vh; padding: var(--bb-space-2) var(--bb-space-4) var(--bb-space-4); }
  .bb-lamp .message { grid-template-columns: minmax(0, 1fr); gap: var(--bb-space-2); padding: var(--bb-space-4) 0; }
  .bb-lamp .chat-form { flex-direction: column; }
  .bb-lamp .btn-send { width: 100%; }
  .bb-lamp .prompt-chips { flex-direction: column; }
  .bb-lamp .prompt-chip { width: 100%; }
}

/* ---- The BlockTalk page (/block-talk/join) ------------------------------ */

.bb-lamp--join .bb-lamp__sky { bottom: auto; height: min(1100px, 100%); }

.bb-lamp__name--long {
  max-width: 12em;
  font-size: clamp(2.6rem, 1.5rem + 3.2vw, 4.75rem);
  line-height: 1.02;
  text-wrap: balance;
}

.bb-lamp__actions { margin: var(--bb-space-6) 0 0; }

/* The manual's brick button turned for dark ground: paper face, lamp plate. */
.bb-lamp__ask {
  display: inline-flex;
  align-items: center;
  gap: var(--bb-space-2);
  min-height: 52px;
  padding: 0 var(--bb-space-6);
  font-size: 1.02rem;
  font-weight: 600;
  color: #10131A;
  text-decoration: none;
  background: #F1ECE1;
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 4px 0 0 var(--bb-lamp);
  transition: transform var(--bb-dur-1) var(--bb-ease-out), box-shadow var(--bb-dur-1) var(--bb-ease-out);
}

.bb-lamp__ask:hover { color: #10131A; transform: translateY(-1px); box-shadow: 0 5px 0 0 var(--bb-lamp); }
.bb-lamp__ask:active { transform: translateY(4px); box-shadow: none; }
.bb-lamp__ask:focus-visible { outline: 2px solid var(--bb-lamp); outline-offset: 3px; }

.bb-lamp--join :is(.features-section, .use-cases-section, .signup-section, .eeat-section, .faq-section) {
  max-width: var(--bb-max);
  margin: 0 auto;
  padding: var(--bb-space-9) var(--bb-margin) 0;
  color: var(--bb-l-text);
  background: none;
  border: 0;
}

.bb-lamp--join :is(.features-container, .use-cases-container, .signup-container, .eeat-container, .faq-container) {
  max-width: none;
  margin: 0;
  padding: 0;
  background: none;
}

.bb-lamp--join .section-title {
  margin: 0 0 var(--bb-space-6);
  padding: var(--bb-space-4) 0 0;
  font-family: var(--bb-font-serif);
  font-size: clamp(2rem, 1.5rem + 1.5vw, 3rem);
  font-weight: 500;
  line-height: 1.08;
  text-align: left;
  color: var(--bb-l-text);
  background: none;
  border-top: 1px solid rgba(233, 228, 216, 0.3);
  -webkit-text-fill-color: currentColor;
}

.bb-lamp--join :is(.features-grid, .use-cases-grid) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--bb-space-6) var(--bb-space-5);
}

.bb-lamp--join .feature-card {
  margin: 0;
  padding: var(--bb-space-4) 0 0;
  text-align: left;
  color: var(--bb-l-text);
  background: none;
  border: 0;
  border-top: 1px solid rgba(233, 228, 216, 0.18);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.bb-lamp--join .feature-card:hover { transform: none; box-shadow: none; }

.bb-lamp--join :is(.feature-title, .eeat-title) {
  margin: 0 0 var(--bb-space-2);
  font-family: var(--bb-font-serif);
  font-size: 1.45rem;
  font-weight: 500;
  color: var(--bb-l-text);
}

.bb-lamp--join :is(.feature-description, .eeat-description) { margin: 0; font-size: 0.98rem; line-height: 1.6; color: var(--bb-l-text-2); }

/* What visitors ask, written into the log as the chat writes them. */
.bb-lamp--join .use-case {
  margin: 0;
  padding: 0 0 0 var(--bb-space-4);
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid var(--bb-lamp);
  border-radius: 0;
  box-shadow: none;
}

.bb-lamp--join .use-case-title {
  margin: 0 0 var(--bb-space-2);
  font-family: var(--bb-font-mono);
  font-size: var(--bb-fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bb-lamp);
}

.bb-lamp--join .use-case-description {
  margin: 0;
  font-family: var(--bb-font-serif);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--bb-l-text);
}

/* The invitation is a page of the log itself. */
.bb-lamp--join .signup-container {
  max-width: 880px;
  padding: var(--bb-space-7) var(--bb-space-7) var(--bb-space-6);
  color: var(--bb-ink);
  background: linear-gradient(180deg, #FFF6E2 0%, var(--bb-l-page) 40%);
  border-radius: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.bb-lamp--join .signup-content { text-align: left; }

.bb-lamp--join .signup-title {
  margin: 0 0 var(--bb-space-3);
  font-family: var(--bb-font-serif);
  font-size: clamp(2rem, 1.6rem + 1vw, 2.6rem);
  font-weight: 500;
  color: var(--bb-ink);
}

.bb-lamp--join .signup-description { max-width: 38em; margin: 0; font-size: 1.02rem; line-height: 1.6; color: var(--bb-ink-2); }
.bb-lamp--join .start-ctas { display: flex; flex-wrap: wrap; gap: var(--bb-space-4); margin: var(--bb-space-5) 0 0; justify-content: flex-start; }

.bb-lamp--join .start-cta {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 var(--bb-space-5);
  font-weight: 600;
  color: var(--bb-paper);
  text-decoration: none;
  background: var(--bb-ink);
  border: 1.5px solid var(--bb-ink);
  border-radius: var(--bb-radius-sm);
  box-shadow: 0 4px 0 0 var(--bb-signal);
  transform: none;
}

.bb-lamp--join .start-cta:hover { color: var(--bb-paper); background: var(--bb-ink); transform: translateY(-1px); }
.bb-lamp--join .start-cta-secondary { color: var(--bb-ink); background: transparent; box-shadow: 0 4px 0 0 var(--bb-ink); }
.bb-lamp--join .start-cta-secondary:hover { color: var(--bb-ink); background: rgba(27, 33, 41, 0.05); }

.bb-lamp--join .eeat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-space-6); }

.bb-lamp--join .eeat-card {
  margin: 0;
  padding: var(--bb-space-4) 0 0;
  background: none;
  border: 0;
  border-top: 1px solid rgba(233, 228, 216, 0.18);
  border-radius: 0;
  box-shadow: none;
}

/* Questions as native details: the global accordion script leaves them be,
   and its stylesheet's collapsed answers and markers are undone here. */
.bb-lamp--join .faq-list { display: block; margin: 0; }

.bb-lamp--join .faq-item {
  margin: 0;
  padding: var(--bb-space-5) 0;
  color: var(--bb-l-text);
  background: none;
  border: 0;
  border-top: 1px solid rgba(233, 228, 216, 0.18);
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.bb-lamp--join .faq-item:last-child { border-bottom: 1px solid rgba(233, 228, 216, 0.18); }

.bb-lamp--join .faq-item > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--bb-space-4);
  list-style: none;
  cursor: pointer;
}

.bb-lamp--join .faq-item > summary::-webkit-details-marker { display: none; }
.bb-lamp--join .faq-item > summary::after { content: "+"; flex: 0 0 auto; font-family: var(--bb-font-mono); font-size: 1.3rem; color: var(--bb-lamp); }
.bb-lamp--join .faq-item[open] > summary::after { content: "\2212"; }
.bb-lamp--join .faq-item > summary:focus-visible { outline: 2px solid var(--bb-lamp); outline-offset: 4px; }

.bb-lamp--join .faq-question {
  display: block;
  margin: 0;
  padding: 0;
  font-family: var(--bb-font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--bb-l-text);
  background: none;
  border: 0;
  border-radius: 0;
}

.bb-lamp--join .faq-question::after { content: none; }

.bb-lamp--join .faq-answer {
  max-width: 46em;
  max-height: none;
  overflow: visible;
  margin: var(--bb-space-3) 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--bb-l-text-2);
}

@media (max-width: 899px) {
  .bb-lamp--join :is(.features-grid, .use-cases-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .bb-lamp--join :is(.features-grid, .use-cases-grid, .eeat-grid) { grid-template-columns: minmax(0, 1fr); }
  .bb-lamp--join .signup-container { padding: var(--bb-space-6) var(--bb-space-4) var(--bb-space-5); }
}
/*
 * The Lamp Room: BlockTalk's pages (docs/design/lamp-room.md). Linked only
 * by those pages, through DesignWorldHelper#design_world, and scoped under
 * .bb-lamp.

 */
