/* proareta_ui — first-surface styles. Self-hosted everything: system
   font stack, no external assets. Palette: paper + ink + laurel. */

:root {
  --paper: #faf8f4;
  --ink: #23271f;
  --muted: #7a7f72;
  --laurel: #5a7d54;
  --laurel-soft: #e8efe4;
  --line: #e3dfd6;
  --agent-bg: #ffffff;
  --learner-bg: #eef2ea;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 -apple-system, "Segoe UI", system-ui, sans-serif;
}

.app { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

/* signup */
.signup { max-width: 30rem; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 0.9rem; }
.signup h1 { font-size: 2rem; margin: 0; letter-spacing: 0.01em; }
.tagline { color: var(--muted); margin: 0 0 0.75rem; }
.signup label { font-weight: 600; }
.signup input {
  padding: 0.7rem 0.9rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.fine-print { color: var(--muted); font-size: 0.85rem; }

/* layout */
.conversation-layout { display: grid; grid-template-columns: 1fr 15rem; gap: 1.25rem; }
@media (max-width: 44rem) { .conversation-layout { grid-template-columns: 1fr; } .rail { order: -1; } }

/* thread */
.thread { display: flex; flex-direction: column; gap: 0.8rem; padding-bottom: 1rem; }
.msg { position: relative; padding: 0.7rem 1rem; border-radius: 10px; max-width: 44rem; }
.msg--agent { background: var(--agent-bg); border: 1px solid var(--line); align-self: flex-start; }
.msg--learner { background: var(--learner-bg); align-self: flex-end; }
.msg--system { align-self: center; background: none; }
.msg-body p { margin: 0.35rem 0; }
.msg-body blockquote {
  margin: 0.5rem 0; padding: 0.4rem 0.8rem; border-left: 3px solid var(--laurel);
  background: var(--laurel-soft); border-radius: 0 6px 6px 0;
}
.system-marker { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.code-block {
  background: #2d2a26; color: #e8e4dc; padding: 0.75rem 1rem; border-radius: 8px;
  overflow-x: auto; font: 0.85rem/1.5 "SF Mono", ui-monospace, monospace;
}
.role-chip {
  display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--laurel); border: 1px solid var(--laurel); border-radius: 999px;
  padding: 0.05rem 0.5rem; margin-bottom: 0.35rem;
}
.evidence-glyph {
  position: absolute; right: -1.2rem; top: 0.8rem; color: var(--laurel);
  cursor: help; font-size: 0.8rem;
}
.quick-replies { display: flex; gap: 0.5rem; margin-top: 0.6rem; flex-wrap: wrap; }
.quick-reply {
  border: 1px solid var(--laurel); color: var(--laurel); background: none;
  border-radius: 999px; padding: 0.35rem 0.9rem; cursor: pointer; font-size: 0.9rem;
}
.quick-reply:hover { background: var(--laurel-soft); }

/* composer */
.composer { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.composer textarea {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit; border: 1px solid var(--line);
  border-radius: 10px; resize: vertical; background: #fff;
}
.composer-row { display: flex; justify-content: space-between; }
.pause { background: none; border: none; color: var(--muted); cursor: pointer; }

/* rail */
.rail {
  border: 1px solid var(--line); border-radius: 10px; padding: 0.75rem;
  height: fit-content; background: #fff;
}
.rail-toggle { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 0.8rem; }
.rail-movement { font-size: 0.8rem; font-weight: 600; margin: 0.5rem 0; }
.rail-chips { display: flex; flex-direction: column; gap: 0.35rem; }
.chip { font-size: 0.85rem; color: var(--muted); }
.chip--landed { color: var(--laurel); }
.chip em { color: var(--muted); font-size: 0.75rem; }
.rail-empty { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.rail-minutes { margin-top: 0.7rem; font-size: 0.75rem; color: var(--muted); }

/* reveal */
.reveal { max-width: 40rem; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 1.1rem; }
.reveal h1 { font-size: 1.6rem; margin: 0; }
.reveal-band { border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.1rem; background: #fff; }
.reveal-band h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 0.6rem; }
.map-chip { display: inline-block; margin: 0 0.5rem 0.4rem 0; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.95rem; }
.map-chip--demonstrated { background: var(--laurel-soft); color: var(--laurel); border: 1px solid var(--laurel); cursor: pointer; }
.map-chip--frontier { border: 1px dashed var(--laurel); color: var(--ink); }
.map-chip--unexplored { border: 1px solid var(--line); color: var(--muted); }
.band-note { color: var(--muted); font-size: 0.8rem; margin: 0.4rem 0 0; }
.evidence-panel {
  border: 1px solid var(--laurel); background: var(--laurel-soft);
  border-radius: 10px; padding: 0.9rem 1.1rem;
}
.wrap-actions { margin-top: 1rem; display: flex; justify-content: center; }

/* shared */
button.primary {
  background: var(--laurel); color: #fff; border: none; border-radius: 10px;
  padding: 0.65rem 1.3rem; font-size: 1rem; cursor: pointer;
}
button.primary:disabled { opacity: 0.45; cursor: default; }
button.primary:hover:not(:disabled) { filter: brightness(1.07); }

/* household (w16): picker, ceremony, disclosure */
.household { max-width: 32rem; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 0.9rem; }
.household h1 { font-size: 2rem; margin: 0; }
.household input {
  padding: 0.7rem 0.9rem; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.8rem; }
.member-card {
  display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start;
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; cursor: pointer; font: inherit; text-align: left;
}
.member-card:hover { border-color: var(--laurel); }
.member-name { font-weight: 600; font-size: 1.15rem; }
.member-start { color: var(--muted); font-size: 0.8rem; }
.pin-input { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; max-width: 12rem; }
.pin-input--inline { font-size: 1rem; letter-spacing: 0.2em; max-width: 8rem; padding: 0.3rem 0.5rem; }
.disclosure-card { text-align: left; }
.disclosure-text { font-size: 1.2rem; line-height: 1.6; background: var(--laurel-soft);
  border-left: 3px solid var(--laurel); padding: 0.9rem 1.1rem; border-radius: 0 8px 8px 0; }
.draft-tag { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.sitting-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; gap: 0.75rem; }
.disclosure-popover {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 0.7rem 1rem; margin-bottom: 0.75rem; font-size: 0.9rem;
}
.linklike {
  background: none; border: none; padding: 0; color: var(--laurel);
  cursor: pointer; font: inherit; text-decoration: underline;
}
.wrap-actions { display: flex; gap: 0.75rem; align-items: center; }

/* family view (w16): guardian management */
.family { max-width: 40rem; margin: 3vh auto 0; display: flex; flex-direction: column; gap: 1.2rem; }
.family h1 { font-size: 1.7rem; margin: 0; }
.family h2 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.family-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.family-list li {
  display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline;
  padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.row-actions { display: inline-flex; gap: 0.7rem; margin-left: auto; }
.family-code { font: 1.5rem/1.2 "SF Mono", ui-monospace, monospace; letter-spacing: 0.15em;
  background: var(--laurel-soft); padding: 0.6rem 0.9rem; border-radius: 8px; display: inline-block; }
.tenant-chips { display: flex; gap: 0.5rem; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.15rem 0.7rem; cursor: pointer; font: inherit; font-size: 0.8rem; }
.chip--active { border-color: var(--laurel); color: var(--laurel); }
.policy-panel { flex-basis: 100%; border-top: 1px dashed var(--line); padding-top: 0.6rem; margin-top: 0.3rem; }
.policy-form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 24rem; }
.policy-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; font-weight: 600; }
.policy-form select, .policy-form textarea {
  font: inherit; font-weight: 400; padding: 0.4rem 0.6rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
.family-entry { margin-top: 1.2rem; text-align: center; }

/* w20 (find #10): the persistent header — a visible route Home from
 * every authenticated stage. */
.app-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border, #2a2d2a);
}
.app-brand {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.app-header-grow { flex: 1; }
.app-who {
  font-size: 0.8rem;
  color: var(--text-muted, #9aa09a);
}
.app-home { white-space: nowrap; }
