/**
 * LivingPractice member container (W10) — styles.
 * Warm, quiet, unbranded-tech: a health formation space, not a SaaS dashboard.
 * Palette shares the LP green (#2D5C3E) with the live V5.1 surfaces; ground
 * is warm cream rather than app-white.
 */

:root {
  --ground: #FAF7F1;        /* warm cream */
  --ground-deep: #F2EDE3;
  --ink: #2B2B27;           /* warm near-black */
  --ink-soft: #6E6A5E;
  --green: #2D5C3E;         /* LP green */
  --green-soft: #3E7354;
  --green-wash: #E7EEE9;
  --line: #E3DCCE;
  --card: #FFFDF9;
  --radius: 18px;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); }
h1 { font-size: 26px; margin-bottom: 8px; }
h2 { font-size: 18px; }
h3 { font-size: 17px; margin-bottom: 4px; }
.soft { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 18px; }

.view { min-height: 100dvh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }

/* ─── quiet card (login / mfa / timeout) ─── */
#view-login, #view-mfa {
  align-items: center; justify-content: center; padding: 24px;
}
.quiet-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 30px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(60, 50, 30, 0.06);
}
.mark {
  width: 56px; height: 56px; margin: 0 auto 18px;
  background: url('icons/logo.svg') center / contain no-repeat;
}
.mark.small { width: 32px; height: 32px; margin: 0; }

form { text-align: left; margin-top: 12px; }
label { display: block; font-size: 13px; color: var(--ink-soft); margin: 14px 0 4px; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
input:focus { border-color: var(--green-soft); }

button {
  font-family: var(--sans); font-size: 15px; cursor: pointer;
  border: none; border-radius: 24px; padding: 12px 22px;
  transition: background 0.15s ease;
}
button.primary { background: var(--green); color: var(--ground); width: 100%; margin-top: 20px; }
button.primary:hover { background: var(--green-soft); }
button.primary.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; margin: 0; font-size: 18px; }
button.secondary {
  background: var(--green-wash); color: var(--green); width: 100%; margin-top: 8px;
}
button.ghost {
  background: transparent; color: var(--ink-soft); padding: 8px 12px;
}
button:disabled { opacity: 0.5; cursor: default; }

.form-note { font-size: 13.5px; color: #9A5B44; margin-top: 12px; min-height: 20px; text-align: center; }
.form-note.ok { color: var(--green-soft); }

/* ─── the space (conversation) ─── */
.space-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.space-header h2 { flex: 1; }
.space-header .ghost { font-size: 18px; }

main#conversation {
  flex: 1;
  overflow-y: auto;
  padding: 22px 18px 12px;
  display: flex; flex-direction: column; gap: 14px;
  max-width: 640px; width: 100%; margin: 0 auto;
}

.touch {
  max-width: 86%;
  padding: 13px 17px;
  border-radius: var(--radius);
  font-size: 15.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.touch.outbound {           /* the Mentor */
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
}
.touch.inbound {            /* the member */
  align-self: flex-end;
  background: var(--green-wash);
  color: var(--ink);
  border-bottom-right-radius: 6px;
}
.touch time {
  display: block; font-size: 11px; color: var(--ink-soft);
  margin-top: 6px; font-family: var(--sans);
}
.touch.pending { opacity: 0.65; }

.day-rest {
  text-align: center; color: var(--ink-soft); font-size: 12.5px;
  margin: 8px 0 2px; font-family: var(--serif); font-style: italic;
}

/* ─── composer ─── */
.composer {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--ground);
  border-top: 1px solid var(--line);
  position: sticky; bottom: 0;
}
.composer textarea {
  flex: 1;
  resize: none;
  max-height: 130px;
  padding: 12px 16px;
  font-size: 16px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: none;
  line-height: 1.45;
}
.composer textarea:focus { border-color: var(--green-soft); }

/* ─── settings sheet ─── */
.sheet {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(43, 43, 39, 0.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-body {
  width: 100%; max-width: 480px;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 28px 26px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  max-height: 86dvh; overflow-y: auto;
}
.sheet hr { border: none; border-top: 1px solid var(--line); margin: 22px 0; }

.dial { display: flex; flex-direction: column; gap: 8px; }
.dial label {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; font-size: 15px; color: var(--ink);
}
.dial label:has(input:checked) {
  border-color: var(--green); background: var(--green-wash);
}
.dial input { margin-top: 4px; accent-color: var(--green); }
.dial strong { display: block; font-weight: 600; font-size: 14.5px; }
.dial small { color: var(--ink-soft); font-size: 12.5px; line-height: 1.4; }

/* ─── timeout veil ─── */
.veil {
  position: fixed; inset: 0; z-index: 30;
  background: var(--ground);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

@media (min-width: 700px) {
  main#conversation { padding-top: 34px; }
  .sheet { align-items: center; }
  .sheet-body { border-radius: var(--radius); }
}
