/* The app surfaces. Same clinical register as the label — the product is
   trusted BECAUSE it doesn't try to seduce you. Inherits the tokens and the
   .row/.claim/.basis rules from label.css; this only adds the chrome around them. */

#app { max-width: 42rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

.screen-head { margin-bottom: 1.5rem; }
.screen-head h1 { font-size: 1.15rem; letter-spacing: .12em; margin: 0 0 .25rem; }
h2 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin: 1.75rem 0 .6rem; }

.note { color: var(--dim); font-size: .85rem; margin: .4rem 0 0; }
.status { color: var(--dim); font-size: .85rem; min-height: 1.2em; margin: .6rem 0 0; }

/* ── forms ─────────────────────────────────────────────────────────────── */
.form { margin: 0 0 1rem; }
.field { display: block; margin: 0 0 .9rem; }
.field span { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: .35rem; }

input, textarea {
  font: inherit;
  width: 100%;
  padding: .6rem .7rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
}
input:focus, textarea:focus { outline: 2px solid var(--dim); outline-offset: 1px; }

/* The recovery-phrase field — the one input where a typo means "you get
   nothing". Give it room: monospace (so the 12 words are easy to check against
   the paper) and enough height that the whole phrase is visible at once. */
textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.6;
  min-height: 6rem;
  resize: vertical;
}

button {
  font: inherit;
  padding: .6rem 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
button:hover { border-color: var(--dim); }
button:disabled { opacity: .5; cursor: default; }
button.primary { border-color: var(--ink); }
button.linkish { border: none; background: none; padding: 0; text-decoration: underline; cursor: pointer; color: inherit; font: inherit; }
button.linkish.danger { color: #b42318; }

.chat-nav { display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; margin: 0 0 1rem; font-size: .85rem; }
.leave-confirm { display: inline-flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.leave-confirm > span { color: var(--dim); }

.actions { display: flex; gap: .6rem; }
.rooms { list-style: none; padding: 0; margin: 0; }
.rooms li { padding: .35rem 0; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }

/* Pending-approval badge on the groups list — the knock gate, made discoverable. */
.knock-badge {
  border: 1px solid #b26a00; color: #8a5200; background: none;
  border-radius: 999px; padding: .1rem .5rem; font-size: .72rem; cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .knock-badge { border-color: #d98a2b; color: #e6a656; }
}

/* ── chat ──────────────────────────────────────────────────────────────── */
.invite { display: flex; gap: .5rem; margin: 0 0 1rem; }
.invite input { flex: 1; font-size: .8rem; color: var(--dim); }
.invite button { white-space: nowrap; }

.knocks:not(:empty) {
  border: 1px solid var(--line);
  border-left: 4px solid #9a6700;   /* someone is waiting — a decision to make */
  border-radius: 6px;
  padding: .75rem 1rem;
  margin: 0 0 1rem;
}
.knocks h2 { margin-top: 0; }
.knock { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .35rem 0; }

.timeline {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  padding: .75rem 1rem;
  min-height: 16rem;
  max-height: 26rem;
  overflow-y: auto;
}
/* Live member count under the chat header. */
.room-meta { color: var(--dim); font-size: .8rem; margin: -.4rem 0 1rem; }

/* The glanceable label summary — read the shape of the promises without drilling. */
.label-glance { margin: .25rem 0 .75rem; }
/* .label-summary and the chips are styled in label.css — the shared component
   stylesheet both this app AND the standalone label page load. Keeping them
   there is what keeps the filter looking the same in both places (one renderer,
   one story). Only app-specific layout lives here. */
.label-details > summary { color: var(--dim); font-size: .82rem; cursor: pointer; margin-bottom: .5rem; }

.msg { padding: .3rem 0; display: flex; gap: .6rem; align-items: baseline; }
.who { color: var(--dim); font-size: .78rem; flex: 0 0 auto; min-width: 4.5rem; }
.msg.mine .who { color: var(--ink); font-weight: 600; }
.msg.cont { padding-top: 0; margin-top: -.15rem; }
.time { color: var(--dim); font-size: .7rem; flex: 0 0 auto; opacity: .55; }
.empty { color: var(--dim); font-style: italic; padding: 1.5rem .2rem; }
.body { white-space: pre-wrap; word-break: break-word; flex: 1; }

/* A message we cannot read is a FACT, shown plainly — never hidden, never faked. */
.undecryptable { color: #b42318; font-size: .85rem; flex: 1; }

/* Report: a member choosing to disclose. Quiet until hovered — present, not loud. */
.report { flex: 0 0 auto; }
.report-btn {
  background: none; border: 0; color: var(--dim); cursor: pointer;
  font-size: .72rem; padding: .1rem .3rem; opacity: .35; transition: opacity .12s;
}
.msg:hover .report-btn { opacity: 1; }
.report-form { display: inline-flex; gap: .3rem; align-items: baseline; }
.report-form input { font-size: .78rem; padding: .1rem .3rem; }
.report-form button { font-size: .72rem; padding: .1rem .4rem; cursor: pointer; }
.report-done { color: #067647; font-size: .74rem; }
.report-err { color: #b42318; font-size: .74rem; }

.composer { display: flex; gap: .5rem; margin-top: .75rem; }
.composer input { flex: 1; }

/* ── the label, wherever it appears ────────────────────────────────────── */
.label-panel { margin-top: 2rem; }
.label-panel .rows, .label-details .rows { margin-top: .75rem; }
.label-foot { color: var(--dim); font-size: .82rem; margin-top: 1rem; }
.label-foot.stale { color: #9a6700; }

.label-details { margin-top: 2rem; }
.label-details summary {
  cursor: pointer;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
}

.error {
  border: 1px solid var(--line);
  border-left: 4px solid #b42318;
  border-radius: 6px;
  background: var(--card);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
}

/* ── identity (passkey) ────────────────────────────────────────────────── */
.sep { color: var(--dim); font-size: .8rem; margin: 1.25rem 0 .5rem; }
.seed {
  font-family: ui-monospace, monospace; font-size: 1rem; line-height: 1.6;
  word-spacing: .3rem; padding: 1rem; margin: 1rem 0;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--card, #f4f5f7);
  user-select: all; /* easy to read/transcribe, but we never auto-copy it */
}
/* 24 words in ONE column is a scroll — on a phone, a long one. Multi-column so
   the whole phrase is visible at once, which is what you need while copying it
   onto paper. `columns: <width>` fits as many as will go: 1 on a narrow phone,
   3-4 on a desktop, no media queries. Content flows DOWN each column, so the
   numbering still reads top-to-bottom the way a written list does. */
.seed-words {
  columns: 7.5rem; column-gap: 2rem;
  margin: 0; padding-left: 2.2rem;
}
.seed-words li { break-inside: avoid; padding-left: .4rem; }
/* The numbers are for keeping your place while transcribing — present, but the
   words are what matters, so they recede. ::marker is also not picked up by a
   text selection, so selecting the box yields words, not "1. horn 2. stick". */
.seed-words li::marker { color: var(--dim); font-size: .85em; }
.seed-code { word-spacing: .3rem; }
/* Breathing room between the format toggle and the action buttons — without it
   "show as a compact code" sits right on top of "I've written it down". */
.seed-format { margin: 1rem 0 1.5rem; font-size: .82rem; }

/* A quiet divider between an action and a more consequential one below it. */
.sep-rule { border: 0; border-top: 1px solid var(--line); margin: 2rem 0 1rem; }

/* Attachments. Images are capped so one photo cannot own the whole timeline. */
.attachment .attach-img {
  display: block;
  max-width: min(420px, 100%);
  max-height: 320px;
  border-radius: 6px;
  margin-top: 4px;
}
.composer button[title='attach a file'] {
  padding: 0 10px;
}
.timeline.dropping {
  outline: 2px dashed currentColor;
  outline-offset: -4px;
}

/* Groups you left: present, but unmistakably not somewhere you are. */
.left-head {
  font-size: 0.85rem;
  opacity: 0.6;
  margin: 18px 0 4px;
}
.rooms.left .left-row {
  opacity: 0.55;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.rooms.left .left-name {
  text-decoration: line-through;
}
.rooms.left .left-note {
  font-size: 0.8rem;
}

.build-id { opacity: 0.45; font-size: 0.75rem; }

.chat-search { width: 100%; margin: 6px 0 2px; }
.search-note { margin: 0 0 8px; font-size: 0.8rem; }

/* Search results: a list you jump FROM, so the conversation stays whole. */
.search-results { margin: 0 0 10px; }
.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  margin: 2px 0;
  background: none;
  border: 1px solid currentColor;
  border-radius: 6px;
  opacity: 0.85;
  cursor: pointer;
}
.search-hit:hover { opacity: 1; }
.hit-meta { display: block; font-size: 0.72rem; opacity: 0.7; }
.hit-text { display: block; font-size: 0.85rem; }
.search-hit mark { background: transparent; font-weight: 700; text-decoration: underline; }
.hit-nav { display: flex; gap: 12px; margin-top: 6px; }
/* Where a jumped-to message lands. Brief, so it marks without shouting. */
.msg.found { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }

/* Day separators and the unread divider. */
.day-sep {
  text-align: center;
  font-size: 0.72rem;
  opacity: 0.5;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.unread-sep {
  font-size: 0.7rem;
  opacity: 0.75;
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-top: 1px solid currentColor;
  padding-top: 4px;
}
