/* MOSAMBE — early access pages (/app, /join).
 *
 * Same tokens as index.html, deliberately duplicated rather than extracted:
 * the landing page keeps its single-file, no-build character, and these two
 * pages are the only other things on the site. If a third appears, pull the
 * shared half of this into a real stylesheet and link it from all three.
 */

:root {
  --paper: #F7F7F4;
  --grey: #D9D9D4;
  --ink: #111111;
  --lunar: #A9BCCB;
  --void: #0A0A0B;

  --ink-70: rgba(17, 17, 17, .70);
  --ink-45: rgba(17, 17, 17, .45);
  --ink-22: rgba(17, 17, 17, .22);
  --ink-10: rgba(17, 17, 17, .10);

  --display: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(20px, 6vw, 96px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 30rem;
  margin: 0 auto;
  padding: clamp(48px, 12vh, 120px) var(--pad) clamp(48px, 10vh, 96px);
}

.brand {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: clamp(40px, 8vh, 72px);
}

h1 {
  font-size: clamp(1.85rem, 5.5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.028em;
  font-weight: 500;
  margin: 0 0 .8rem;
  text-wrap: balance;
}

.sub { color: var(--ink-70); margin: 0 0 2rem; font-size: 1.02rem; }

.label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin: 2.4rem 0 .9rem;
}

/* Inputs are underlines, as on the landing page — no boxes. */
input, textarea {
  width: 100%;
  padding: 10px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-22);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  transition: border-color .18s ease;
}
input:focus, textarea:focus { outline: none; border-bottom-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-45); }

input.code-input {
  font-family: var(--mono);
  font-size: 1.4rem;
  letter-spacing: .5em;
  padding: 14px 0;
}

.field { margin-bottom: 1.5rem; }
.field .label { margin-top: 0; }

button {
  appearance: none;
  padding: 13px 24px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  font-family: var(--display);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .01em;
  cursor: pointer;
  transition: opacity .18s ease;
}
button:hover:not(:disabled) { opacity: .82; }
button:disabled { opacity: .35; cursor: default; }

button.plain {
  background: transparent;
  color: var(--ink-45);
  padding: 13px 0;
  font-size: .88rem;
}
button.plain:hover:not(:disabled) { color: var(--ink); opacity: 1; }

.actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.8rem; }

.msg {
  margin: 1.2rem 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--ink-45);
  min-height: 1.2em;
}
.msg.err { color: #A8402C; }
.msg.good { color: var(--ink); }

.fine { font-size: .86rem; color: var(--ink-45); margin-top: 2rem; }
.fine a, .sub a { color: var(--ink); text-underline-offset: 3px; }

/* --- thread ---------------------------------------------------------- */

.thread { margin: 0; }

.bubble {
  padding: .7rem .95rem;
  border-radius: 14px;
  margin-bottom: .5rem;
  font-size: .96rem;
  line-height: 1.5;
  max-width: 86%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.in { background: #fff; border: 1px solid var(--ink-10); }
.bubble.out { background: var(--ink); color: var(--paper); margin-left: auto; }

.empty {
  border: 1px dashed var(--ink-22);
  border-radius: 14px;
  padding: 1.5rem 1.1rem;
  text-align: center;
  color: var(--ink-45);
  font-size: .9rem;
}

/* --- invites --------------------------------------------------------- */

.invite {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--ink-10);
}
.invite:first-of-type { border-top: 1px solid var(--ink-10); }

.invite code {
  font-family: var(--mono);
  font-size: .98rem;
  letter-spacing: .14em;
}
.invite.used code { color: var(--ink-45); text-decoration: line-through; }

.invite .state {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.copy {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink-45);
  cursor: pointer;
  border-radius: 0;
}
.copy:hover { color: var(--ink); opacity: 1; }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--ink-10);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.foot a { color: var(--ink-45); }

/* --- memory ---------------------------------------------------------- */

.memory-kind {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin: 1.4rem 0 .3rem;
}
.memory-kind:first-child { margin-top: .6rem; }

.memory {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--ink-10);
}
.memory:first-of-type { border-top: 1px solid var(--ink-10); }

.memory-fact { font-size: .95rem; line-height: 1.45; }

/* The delete control stays quiet until you go looking for it — present, not
   inviting. It should never be the most prominent thing on the row. */
.memory .copy { flex: none; opacity: .55; }
.memory:hover .copy { opacity: 1; }

/* --- ops ------------------------------------------------------------- */

.check {
  padding: .6rem .8rem;
  margin-bottom: .4rem;
  border-radius: 10px;
  font-size: .9rem;
  line-height: 1.45;
  border: 1px solid var(--ink-10);
}
.check--block { border-color: rgba(168, 64, 44, .35); color: #A8402C; }
.check--warn  { border-color: rgba(160, 120, 20, .3); color: #7a5c10; }
.check--good  { color: var(--ink-70); }

.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: .5rem;
  margin-bottom: .5rem;
}
.count { border: 1px solid var(--ink-10); border-radius: 10px; padding: .7rem .8rem; }
.count-n { font-family: var(--mono); font-size: 1.25rem; line-height: 1.2; }
.count-l {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-45); margin-top: .25rem;
}

code { font-family: var(--mono); font-size: .88em; }

/* Connect a third-party account. Reads as an action, not a nav link — the
   button styles are reserved for form submits, so this borrows their weight
   without inheriting their full-width behaviour. */
.connect {
  display: inline-block;
  /* access.css has no global link-colour reset, so without this the browser
     default blue shows through and it stops looking like the rest of the site. */
  color: var(--ink);
  padding: .7rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: .9rem;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.connect:hover,
.connect:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- connection rows ----------
   A row per thing: what it does on the left, its real state on the right.
   Rows rather than cards because the list is meant to be read down in one
   pass, and a grid of cards makes eight items look like a product tour. */
.conn {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--ink-10);
}
.conn:first-of-type { border-top: 1px solid var(--ink-10); }
.conn--muted { opacity: .5; }

.conn__left { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.conn__name { font-size: .98rem; }
.conn__does { font-size: .82rem; color: var(--ink-45); line-height: 1.45; }

.conn__right {
  display: flex; align-items: center; gap: .6rem;
  flex: 0 0 auto; text-align: right;
}
.conn__right .state {
  font-family: var(--mono); font-weight: 300;
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-45); white-space: nowrap;
}
.connect--sm { padding: .38rem .7rem; font-size: .8rem; }

@media (max-width: 560px) {
  .conn { flex-direction: column; align-items: flex-start; gap: .45rem; }
  .conn__right { text-align: left; }
}
