/* Bitcoin Alpha 2026 — LEM, the Lunar Expedition Manifest.
   Built from the printed displays and room signs: near-black ground, cream
   type, one orange for rules and numbers. Display type is Inter at 800 in
   capitals; small labels are Courier Prime, as on the signs' captions.
   Orange carries emphasis and the room numbers -- never body text. */

:root {
  --ground: #10120f;
  --panel: #161814;
  --panel-lift: #1d201b;
  --rule: #33352f;
  --rule-soft: #24261f;
  --ink: #f3ecdc;
  --ink-dim: #b8b1a2;
  --ink-faint: #7e796d;
  --orange: #de582b;

  /* Status keeps its names; the palette does not allow traffic lights. */
  --lamp-amber: var(--orange);
  --lamp-green: var(--ink);
  --lamp-red: #b9533a;

  --mono: "Courier Prime", "Courier New", ui-monospace, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  --rail-w: 5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

* { box-sizing: border-box; }

html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 10;
  background: var(--ink);
  color: var(--ground);
  padding: 0.5rem 0.75rem;
}

:where(a, input, button, textarea, summary):focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ---- masthead: the top band of every sign ----------------------------- */

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 1rem;
  padding: 1.25rem var(--gutter) 0;
}
.wordmark { display: flex; flex-direction: column; gap: 0.25rem; text-decoration: none; }
.wordmark-name {
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.wordmark-sub {
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.insignia { width: 48px; height: 48px; display: block; }
.nav {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 0.875rem 0;
  border-top: 2px solid var(--orange);
  overflow-x: auto;
  scrollbar-width: none;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none;
  color: var(--ink-dim);
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---- notices -------------------------------------------------------- */

.notice {
  margin: 0;
  padding: 0.75rem var(--gutter);
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--lamp-amber) 10%, var(--ground));
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink);
}

.empty {
  padding: 4rem var(--gutter);
  color: var(--ink-dim);
  font-family: var(--mono);
}

/* ---- the flight plan grid ------------------------------------------- */

.day { padding: 0 0 2rem; }

.day-head {
  margin: 0;
  padding: 1.75rem var(--gutter) 0.75rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.grid {
  display: grid;
  grid-template-columns: var(--rail-w) repeat(var(--cols, 4), minmax(0, 1fr));
  border-top: 1px solid var(--rule);
  padding-right: var(--gutter);
}

/* The time rail is the spine of the document — typed, right-aligned, quiet. */
.rail {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-dim);
  padding: 0.75rem 0.75rem 0.75rem var(--gutter);
  text-align: right;
  border-bottom: 1px solid var(--rule-soft);
  box-sizing: content-box;
  width: calc(var(--rail-w) - var(--gutter) - 0.75rem);
}

.col-head {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.rail.col-head { border-left: 0; }

.col-name { font-weight: 600; font-size: 0.9375rem; }
.col-room {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.cell {
  padding: 0.75rem;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}
.cell.is-empty { background: transparent; }

.span {
  grid-column: 2 / -1;
  border-bottom: 1px solid var(--rule-soft);
}
.span .cell {
  border-bottom: 0;
  background: var(--panel-lift);
}

.cell-link { text-decoration: none; }
.cell-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
}
.cell-link:hover .cell-title { color: var(--lamp-amber); }

.leads {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}
.leads.unassigned { color: var(--ink-faint); font-style: italic; }

.cell-meta,
.cell-track {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.cell-track { display: none; }

.cell.is-cancelled .cell-title {
  text-decoration: line-through;
  color: var(--ink-faint);
}

/* ---- status lamps --------------------------------------------------- */

.lamp {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-dim);
}
.lamp::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.lamp-tentative { color: var(--lamp-amber); }
.lamp-confirmed { color: var(--lamp-green); }
.lamp-cancelled { color: var(--lamp-red); }

/* ---- track key ------------------------------------------------------ */

.track-key {
  padding: 1.5rem var(--gutter) 0;
  border-top: 1px solid var(--rule);
  max-width: 46rem;
}
.track-key h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-dim);
}
.key-row {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule-soft);
  align-items: baseline;
}
.key-name { font-weight: 600; font-size: 0.875rem; }
.key-covers { font-size: 0.875rem; color: var(--ink-dim); }
.key-room {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ---- session detail -------------------------------------------------- */

.detail {
  max-width: 38rem;
  padding: 2rem var(--gutter) 4rem;
}
.detail-back { font-family: var(--mono); font-size: 0.8125rem; margin: 0 0 1.5rem; }
.detail-back a { color: var(--ink-dim); }
.detail-track {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--lamp-amber);
}
.detail-title {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.detail.is-cancelled .detail-title {
  text-decoration: line-through;
  color: var(--ink-dim);
}
.detail-when {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--ink-dim);
}
.detail-note {
  margin: 0 0 1.5rem;
  padding: 0.625rem 0.875rem;
  border-left: 2px solid var(--lamp-amber);
  background: var(--panel);
  font-size: 0.875rem;
}
.detail.is-cancelled .detail-note { border-left-color: var(--lamp-red); }
.lead-list {
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.lead-list a { text-decoration-color: var(--rule); }
.detail-abstract p { margin: 0; max-width: 34rem; }

.lead-sessions-head {
  margin: 2rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-dim);
}
.lead-sessions {
  margin: 0;
  padding: 0;
  list-style: none;
}
.lead-sessions li {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--rule-soft);
}
.lead-sessions li.is-cancelled a { text-decoration: line-through; color: var(--ink-faint); }
.lead-session-when {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ---- crew manifest --------------------------------------------------- */

.manifest { padding: 1.75rem var(--gutter) 3rem; }
.manifest-head {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.manifest-sub {
  margin: 0.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.topic-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 1.25rem 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  padding: 0.1875rem 0.5rem;
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.chip.is-on {
  background: var(--panel-lift);
  border-color: var(--lamp-amber);
  color: var(--ink);
}
/* An off-mission interest is a person thing, not a conference thing. */
.chip-interest { border-style: dashed; }
.chip-n { color: var(--ink-faint); }
.chip-more { border-style: dotted; }

.crew-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.crew {
  display: flex;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--panel);
}
.patch { width: 40px; height: 40px; flex: none; }
.crew-body { min-width: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.crew-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}
.crew-co {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}
.channels {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.npub { color: var(--ink-faint); }
.crew-bio { margin: 0; font-size: 0.8125rem; color: var(--ink-dim); }
.chips { margin: 0.125rem 0 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.no-topics {
  margin: 0.125rem 0 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

/* ---- track switcher (mobile) ----------------------------------------- */

.switch {
  display: none;
  margin: 0 var(--gutter) 0.75rem;
  border: 1px solid var(--rule);
  overflow: hidden;
}
.switch-opt { flex: 1; }
.switch-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-opt span {
  display: block;
  padding: 0.5rem 0.375rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
  border-left: 1px solid var(--rule);
  cursor: pointer;
}
.switch-opt:first-child span { border-left: 0; }
.switch-opt input:checked + span {
  background: var(--panel-lift);
  color: var(--ink);
}
.switch-opt input:focus-visible + span { outline: 2px solid var(--lamp-amber); outline-offset: -2px; }

/* ---- phones ----------------------------------------------------------
   Four columns cannot be read on a phone, so the grid becomes one flowing
   column: each time acts as a heading, its sessions stack beneath it, and the
   switcher narrows to a single track. Peak use of this page is in a corridor
   between rooms, so this is the primary layout, not a fallback. */

@media (max-width: 55rem) {
  .grid {
    display: block;
    padding-right: 0;
  }
  .col-head { display: none; }

  .rail {
    width: auto;
    text-align: left;
    padding: 1rem var(--gutter) 0.375rem;
    border-bottom: 0;
    color: var(--lamp-amber);
    font-size: 0.875rem;
  }

  .cell {
    border-left: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding: 0.875rem var(--gutter);
  }
  .cell.is-empty { display: none; }
  .cell-track { display: block; }
  .span { display: block; }

  .switch {
    display: flex;
    /* Five options squeezed into 390px wrap onto two lines and lose their
       shape. Scrolling keeps every label on one line and readable. */
    overflow-x: auto;
    scrollbar-width: none;
  }
  .switch::-webkit-scrollbar { display: none; }
  .switch-opt { flex: 0 0 auto; }
  .switch-opt span {
    white-space: nowrap;
    padding: 0.5rem 0.875rem;
  }

  /* Only cells that belong to a track are filtered. The opener and the closing
     carry no track, and everyone attends them, so they stay in every view. */
  .grid[data-only="propulsion"]   .cell[data-track]:not([data-track="propulsion"]),
  .grid[data-only="navigation"]   .cell[data-track]:not([data-track="navigation"]),
  .grid[data-only="life-support"] .cell[data-track]:not([data-track="life-support"]),
  .grid[data-only="payload"]      .cell[data-track]:not([data-track="payload"]) {
    display: none;
  }

  .key-row { grid-template-columns: 1fr; gap: 0.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- NOW panel: the live slot and who is in each room ---- */
.now {
  margin: 0 var(--gutter) 1.5rem;
  border: 1px solid var(--rule);
  background: var(--panel);
}
.now-head {
  margin: 0;
  padding: 0.5rem 0.875rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--rule);
}
.now.is-live .now-head { color: var(--lamp-amber); }
.now-cards {
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 1px;
  background: var(--rule-soft);
}
.now-card {
  background: var(--panel);
  padding: 0.75rem 0.875rem 1rem;
  min-width: 0;
}
.now-card .cell-track { display: block; }
.now-count {
  margin: 0.75rem 0 0.375rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-dim);
}
.now-empty {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}
.now-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.person-link {
  display: flex; gap: 0.625rem; align-items: center;
  padding: 0.125rem 0;
  text-decoration: none;
}
.person-link:hover .person-name { color: var(--lamp-amber); }
.person .patch { width: 28px; height: 28px; flex: none; }
.person-name { min-width: 0; font-size: 0.875rem; font-weight: 500; line-height: 1.3; }
.person-handle { color: var(--ink); text-decoration: none; }
.person-handle:hover { color: var(--lamp-amber); }
.person-real { font-size: 0.75rem; font-weight: 400; color: var(--ink-dim); }
.crew-link { text-decoration: none; }
.crew-link:hover { color: var(--lamp-amber); }

/* ---- Profile page ---- */
.profile-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.75rem; }
.profile-head .patch { width: 56px; height: 56px; flex: none; }
.profile-head .detail-title { margin: 0; }
.profile-real { margin: 0.125rem 0 0; color: var(--ink-dim); }
.profile-channels { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-dim); }
.profile-sub {
  margin: 1.5rem 0 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.now-more { margin-top: 0.625rem; }
.now-more > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  padding: 0.375rem 0.625rem;
  display: inline-block;
}
.now-more > summary::-webkit-details-marker { display: none; }
.now-more > summary:hover { color: var(--ink); border-color: var(--ink-faint); }
.now-more[open] > summary { margin-bottom: 0.625rem; }
.now-more[open] > summary::after { content: " · hide"; }

/* The live row in the grid */
.rail { position: relative; }
.rail.is-live { color: var(--lamp-amber); }
.rail.is-live::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--lamp-amber);
}
.cell.is-live, .span.is-live .cell { border-color: var(--lamp-amber); }

@media (max-width: 720px) {
  .now-cards { grid-template-columns: 1fr; }
  /* Six per room on a phone; the fold reveals every row. */
  .now-people > li:nth-child(n + 7) { display: none; }
  .now-card:has(.now-more[open]) .now-people > li { display: block; }
}
@media (min-width: 721px) {
  .now-more.is-phone-only { display: none; }
}

/* ---- Private notes ---- */
.note-form {
  margin-top: 1.75rem;
  padding: 1rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  max-width: 34rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.note-met { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9375rem; }
.note-met input { width: 1.1rem; height: 1.1rem; accent-color: var(--lamp-amber); }
.note-text { display: flex; flex-direction: column; gap: 0.375rem; }
.note-text > span { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.note-text textarea {
  font: inherit; font-size: 0.9375rem;
  color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule); padding: 0.5rem 0.625rem;
  resize: vertical; min-height: 4.5rem;
}
.note-text textarea:focus { outline: 2px solid var(--lamp-amber); outline-offset: -1px; }
.note-hint { margin: 0; font-size: 0.75rem; color: var(--ink-faint); }
.note-form button {
  align-self: flex-start;
  font: inherit; font-size: 0.875rem;
  color: var(--ground); background: var(--ink);
  border: 0; padding: 0.5rem 1rem; cursor: pointer;
}
.note-form button:hover { background: var(--lamp-amber); }
.met-mark { margin-left: 0.375rem; color: var(--lamp-green); font-size: 0.8125rem; }

/* ---- Session page: who is here, who is interested ---- */
.session-people { margin-top: 1.5rem; max-width: 34rem; }
.interest { margin: 0 0 0.75rem; }
.interest button {
  font: inherit; font-size: 0.875rem;
  color: var(--ground); background: var(--ink);
  border: 0; padding: 0.5rem 1rem; cursor: pointer;
}
.interest button:hover { background: var(--lamp-amber); }
.interest button.is-on { color: var(--ink); background: transparent; border: 1px solid var(--rule); }
.interest button.is-on:hover { border-color: var(--ink-faint); background: transparent; }

/* ---- Resources ---- */
.resources { padding: 1.75rem var(--gutter) 3rem; max-width: 40rem; }
.resource-list { display: flex; flex-direction: column; gap: 1rem; }
.resource { border: 1px solid var(--rule); background: var(--panel); padding: 1rem 1.125rem; }
.resource-role { margin: 0 0 0.25rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lamp-amber); }
.resource-name { margin: 0 0 0.5rem; font-size: 1.125rem; }
.resource-name a { text-decoration: none; }
.resource-name a:hover { color: var(--lamp-amber); }
.resource-line { margin: 0.125rem 0; }
.resource-dirs { font-family: var(--mono); font-size: 0.8125rem; color: var(--ink-dim); }
.resource-note { margin: 0.625rem 0 0; font-size: 0.875rem; color: var(--ink-dim); }

/* ---- Sign in ---- */
.join .detail-abstract { max-width: 34rem; }
.join-form { margin-top: 1rem; max-width: 24rem; display: flex; flex-direction: column; gap: 0.75rem; }
.join-form input {
  font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule); padding: 0.5rem 0.625rem;
}
.join-form input:focus { outline: 2px solid var(--lamp-amber); outline-offset: -1px; }
.join-form button, .leave button {
  align-self: flex-start;
  font: inherit; font-size: 0.875rem;
  color: var(--ground); background: var(--ink);
  border: 0; padding: 0.5rem 1rem; cursor: pointer;
}
.join-form button:hover { background: var(--lamp-amber); }
.leave { display: inline; margin: 0; }
.leave button { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.leave button:hover { color: var(--lamp-amber); }

/* ---- Messages ---- */
.nav-badge {
  display: inline-block; min-width: 1.25rem; padding: 0 0.375rem;
  border-radius: 999px; background: var(--lamp-amber); color: var(--ground);
  font-family: var(--mono); font-size: 0.75rem; text-align: center; line-height: 1.25rem;
}
.messages { padding: 1.75rem var(--gutter) 3rem; max-width: 40rem; }
.thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.thread { border-bottom: 1px solid var(--rule-soft); }
.thread .person-link { padding: 0.75rem 0; align-items: flex-start; }
.thread-body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.thread-last { font-size: 0.8125rem; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread.is-unread .thread-last { color: var(--ink); }
.unread-dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--lamp-amber); margin-left: 0.5rem; vertical-align: middle; }
.thread-head { margin: 0 0 1rem; font-size: 1rem; }
.msg-list { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.msg { max-width: 80%; align-self: flex-start; background: var(--panel); border: 1px solid var(--rule); padding: 0.5rem 0.75rem; }
.msg.is-mine { align-self: flex-end; border-color: var(--ink-faint); }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-when { display: block; margin-top: 0.25rem; font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-faint); }
.msg-empty { color: var(--ink-faint); }
.msg-form { display: flex; gap: 0.5rem; align-items: flex-end; }
.msg-form textarea {
  flex: 1; font: inherit; color: var(--ink); background: var(--ground);
  border: 1px solid var(--rule); padding: 0.5rem 0.625rem; resize: vertical; min-height: 2.75rem;
}
.msg-form textarea:focus { outline: 2px solid var(--lamp-amber); outline-offset: -1px; }
.msg-form button, .profile-actions button {
  font: inherit; font-size: 0.875rem; color: var(--ground); background: var(--ink);
  border: 0; padding: 0.5rem 1rem; cursor: pointer;
}
.msg-form button:hover, .profile-actions button:hover { background: var(--lamp-amber); }
.profile-actions { display: flex; gap: 0.5rem; margin: 0.75rem 0 0; }
.profile-actions form { margin: 0; }
.profile-actions button.is-quiet { color: var(--ink-dim); background: transparent; border: 1px solid var(--rule); }
.profile-actions button.is-quiet:hover { color: var(--ink); background: transparent; border-color: var(--ink-faint); }

/* ---- native shell ---------------------------------------------------- */

/* The shell draws edge to edge; keep content clear of the notch and the
   home indicator. A browser never gets the class, so nothing moves there. */
.native body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

.presence-toggle { margin-bottom: 0.5rem; }
.presence-toggle button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
}
.presence-toggle button:hover { color: var(--lamp-amber); }

/* ---- your profile ------------------------------------------------------ */

.me-form textarea { width: 100%; font: inherit; }
.share-check { display: flex; gap: 0.625rem; align-items: flex-start; margin: 0.5rem 0 1rem; }
.share-check input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; flex: none; }
.form-error { color: var(--lamp-red); }
.me .leave { display: block; margin-top: 1.5rem; color: var(--ink-dim); }
.manifest-search { display: flex; gap: 0.5rem; margin: 0 0 1rem; }
.manifest-search input { flex: 1; min-width: 0; font: inherit; padding: 0.5rem 0.75rem; background: var(--panel); color: var(--ink); border: 1px solid var(--rule); }
.manifest-search button { font: inherit; padding: 0.5rem 1rem; background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field-ok { font-family: var(--mono); font-size: 0.75rem; color: var(--lamp-green); }
.field-pending { font-family: var(--mono); font-size: 0.75rem; color: var(--lamp-amber); }
.form-info { color: var(--ink); border-left: 2px solid var(--lamp-amber); padding-left: 0.75rem; }
.share-box { border: 1px solid var(--rule); padding: 0.75rem 1rem; margin: 0.5rem 0 1rem; }
.share-box legend { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); padding: 0 0.25rem; }
.share-state { margin: 0; color: var(--ink-dim); font-size: 0.875rem; }
.join-hint { color: var(--ink-dim); font-size: 0.875rem; margin: 0.25rem 0 0.75rem; }
.join-code { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.profile-nostr { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0.75rem 0; }
.profile-nostr .nostr-open { font-weight: 600; }
.profile-nostr button { font: inherit; background: transparent; color: var(--ink-dim); border: 1px solid var(--rule); padding: 0.25rem 0.75rem; cursor: pointer; }
.npub-full { flex-basis: 100%; font-family: var(--mono); font-size: 0.75rem; color: var(--ink-faint); word-break: break-all; }

/* =======================================================================
   Poster system. Everything below follows the printed displays.
   ======================================================================= */

/* ---- hero: the poster block that opens a page ---- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 15rem;
  padding: 2.5rem var(--gutter) 2rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
}
.hero-copy { position: relative; z-index: 1; max-width: 32rem; }
.hero-kicker {
  margin: 0 0 0.75rem;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.hero-title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.5rem, 11vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 7ch;
}
.hero-number {
  margin: 0.5rem 0 0;
  font-weight: 500;
  font-size: clamp(3.5rem, 16vw, 6rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--orange);
}
.hero-sub {
  margin: 1.25rem 0 0;
  padding-top: 0.75rem;
  border-top: 2px solid var(--orange);
  display: inline-block;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-art { position: absolute; pointer-events: none; user-select: none; }
/* The moon rises from the lower right, as on the Lunar Destination display. */
/* Lighten drops the photo's black sky into the page's black, so no square edge. */
.hero-moon { width: min(28rem, 92vw); height: auto; right: -30%; top: -12%; mix-blend-mode: lighten; opacity: 0.9; }
.hero-earthrise { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; opacity: 0.85; }
.has-earthrise::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--ground) 0%, rgb(16 18 15 / 0.6) 55%, transparent 100%);
}
.hero-saturn { height: 130%; width: auto; right: 8%; top: 10%; }
.hero-insignia { width: min(11rem, 36vw); height: auto; right: var(--gutter); top: 2rem; }
@media (min-width: 56rem) {
  .hero { min-height: 20rem; }
  .hero-moon { right: -4%; top: -30%; width: 34rem; }
}

/* ---- room numbers, as painted on the doors ---- */
.room-no { color: var(--orange); font-weight: 700; font-family: var(--sans); }
.room-title { font-weight: 800; text-transform: uppercase; letter-spacing: -0.005em; font-size: 1.125rem; }
.room-title .room-no { font-weight: 500; font-size: 1.75rem; margin-right: 0.25rem; }
.col-room { font-family: var(--sans); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.cell-meta { letter-spacing: 0.02em; }

/* ---- type: display headings in capitals, labels in Courier ---- */
.day-head, .manifest-head, .detail .detail-title, .thread-head, .messages .manifest-head {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.day-head {
  font-size: 1.5rem;
  padding-top: 2.25rem;
  border-bottom: 2px solid var(--orange);
  margin: 0 var(--gutter);
  padding-left: 0;
  padding-right: 0;
}
.grid { border-top: 0; }
.manifest-head { font-size: 1.25rem; }
.detail-title { font-size: 1.875rem; line-height: 1.05; }
.cell-title { font-weight: 600; }
.cell-link:hover .cell-title, .crew-link:hover, .person-link:hover .person-name { color: var(--orange); }
.rail { color: var(--ink); font-weight: 700; }
.col-name { font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.875rem; }

/* ---- the NOW panel reads like the room signs ---- */
.now { border: 0; border-top: 2px solid var(--orange); background: transparent; margin-top: 1.5rem; }
.now-head { padding: 0.75rem 0; border-bottom: 0; letter-spacing: 0.1em; font-family: var(--sans); font-weight: 700; font-size: 0.75rem; }
.now.is-live .now-head { color: var(--orange); }
.now-cards { background: transparent; gap: 0.75rem; }
.now-card { background: var(--panel); border: 1px solid var(--rule); padding: 1rem; }
.now-card .cell-meta { font-family: var(--sans); font-weight: 800; font-size: 1rem; text-transform: uppercase; color: var(--ink); margin-top: 0.5rem; }
.now-card .cell-meta .room-no { font-weight: 500; font-size: 2.25rem; line-height: 1; display: block; letter-spacing: -0.03em; }
.now-count { color: var(--orange); font-family: var(--sans); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- status: words, not lamps ---- */
.lamp { font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.625rem; }
.lamp::before { border-radius: 0; width: 0.375rem; height: 0.375rem; }
.notice { background: var(--panel); border-left: 3px solid var(--orange); border-bottom: 0; margin: 1.25rem var(--gutter) 0; padding: 0.75rem 1rem; }

/* ---- empty flight plan: the Saturn V on the pad ---- */
.standby {
  display: flex; gap: 1.5rem; align-items: center;
  margin: 2rem var(--gutter); padding: 1.5rem;
  border: 1px solid var(--rule); background: var(--panel);
}
.standby img { height: 15rem; width: auto; flex: none; }
.standby-title { margin: 0 0 0.5rem; font-weight: 800; font-size: 1.375rem; line-height: 1.1; text-transform: uppercase; }
.standby-sub { margin: 0; color: var(--ink-dim); font-size: 0.9375rem; }

/* ---- controls: cream plates, capitals ---- */
.join-form button, .note-form button, .interest button, .msg-form button, .profile-actions button, .manifest-search button {
  font-family: var(--sans); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ground); background: var(--ink); border: 0; padding: 0.75rem 1.25rem; cursor: pointer;
}
.join-form button:hover, .note-form button:hover, .interest button:hover, .msg-form button:hover, .profile-actions button:hover, .manifest-search button:hover {
  background: var(--orange); color: var(--ink);
}
.profile-actions button.is-quiet, .interest button.is-on, .profile-nostr button {
  background: transparent; color: var(--ink-dim); border: 1px solid var(--rule);
}
.join-form input, .manifest-search input, .note-text textarea, .msg-form textarea, .me-form textarea {
  background: var(--panel); border: 1px solid var(--rule); color: var(--ink); padding: 0.75rem; font-size: 1rem;
}
.join-form input:focus, .manifest-search input:focus, .note-text textarea:focus, .msg-form textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; }
.note-text > span, .share-box legend, .profile-sub {
  font-family: var(--sans); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.1em; color: var(--ink-dim);
}
.share-check input, .note-met input { accent-color: var(--orange); }
.form-error { border-left: 3px solid var(--orange); padding-left: 0.75rem; color: var(--ink); }
.field-ok { color: var(--ink-dim); }
.field-pending { color: var(--orange); }

/* ---- crew cards ---- */
.crew-list { background: transparent; border: 0; gap: 0.75rem; }
.crew { border: 1px solid var(--rule); }
.crew-name { font-weight: 700; }
.chip { font-family: var(--sans); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.04em; text-transform: uppercase; }
.chip.is-on { border-color: var(--orange); }
.met-mark { color: var(--orange); }

/* ---- messages ---- */
.msg { background: var(--panel); border-color: var(--rule); }
.msg.is-mine { background: var(--panel-lift); border-color: var(--ink-faint); }
.nav-badge { background: var(--orange); color: var(--ink); border-radius: 0; font-family: var(--sans); font-weight: 700; }
.unread-dot { background: var(--orange); border-radius: 0; }
.msg-body a { color: var(--ink); text-decoration-color: var(--orange); }

/* ---- footer: the bottom band of every sign ---- */
.footer {
  margin-top: 2rem;
  padding: 1rem var(--gutter) 2.5rem;
  border-top: 2px solid var(--orange);
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.footer p { margin: 0.25rem 0 0; }
.footer-mark {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.6875rem;
}

/* Room first, as on the door; the session is what is behind it. */
.now-card { display: flex; flex-direction: column; }
.now-card .cell-meta { order: -1; margin: 0 0 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); }
.cell-track, .now-card .cell-track {
  font-family: var(--sans); font-weight: 700; font-size: 0.625rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); margin: 0 0 0.25rem;
}
.cell-meta { font-family: var(--sans); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-dim); }
.rail { font-family: var(--sans); letter-spacing: 0.04em; }
.switch { border-color: var(--rule); }
.switch-opt span { font-family: var(--sans); font-weight: 700; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; }
.switch-opt input:checked + span { background: var(--ink); color: var(--ground); }
.footer-links { margin-top: 0.5rem; }
.footer-links a { color: var(--ink-dim); }
.has-insignia .hero-copy { padding-right: min(11rem, 36vw); }
.has-insignia .hero-kicker { max-width: 14rem; }
.name-row > label { min-width: 0; }
.join-form input, .me-form textarea { width: 100%; min-width: 0; }
/* Meals and socials say what is on: the menu, the bar. */
.cell-note { margin: 0; font-size: 0.875rem; color: var(--ink-dim); max-width: 46rem; }
