/* ============ Nest — design system ============ */
:root {
  --bg: #faf6f0;
  --surface: #ffffff;
  --surface-2: #f4ede3;
  --ink: #33302b;
  --ink-soft: #6f6a61;
  --ink-faint: #9a948a;
  --line: #e8e0d4;
  --green: #5e7d5a;
  --green-soft: #e4ecdf;
  --green-deep: #46603f;
  --terra: #c9704f;
  --terra-soft: #f7e3da;
  --gold: #d9a441;
  --gold-soft: #f8ecd4;
  --blue: #5b7d99;
  --blue-soft: #e2ebf2;
  --plum: #8a6d8f;
  --plum-soft: #efe6f0;
  --danger: #b6503c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(60, 50, 35, 0.07), 0 6px 20px rgba(60, 50, 35, 0.06);
  --shadow-lift: 0 4px 10px rgba(60, 50, 35, 0.1), 0 14px 34px rgba(60, 50, 35, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino", Georgia, serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-deep); text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

/* ---------- layout ---------- */
#app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; color: var(--ink); }
.brand-mark { font-size: 24px; }
.brand-name { letter-spacing: -0.01em; }

.mainnav { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.mainnav a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--ink-soft); font-weight: 550; font-size: 15px;
  transition: background 0.15s, color 0.15s;
}
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.active { background: var(--green-soft); color: var(--green-deep); }
.nav-icon { font-size: 17px; }

.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); border: 1.5px solid var(--line);
  font-size: 19px; cursor: pointer;
}
.avatar-btn:hover { box-shadow: var(--shadow); }

.view {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 90px;
}

.tabbar { display: none; }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .mainnav { display: none; }
  .view { padding: 18px 14px 96px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 4px; border-radius: var(--radius-sm);
    color: var(--ink-faint); font-size: 11.5px; font-weight: 600;
  }
  .tabbar a.active { color: var(--green-deep); }
  .tabbar .nav-icon { font-size: 21px; }
}

/* ---------- shared bits ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 {
  font-family: var(--font-serif);
  font-size: 32px; margin: 0 0 6px; letter-spacing: -0.015em; font-weight: 650;
}
.page-head p { margin: 0; color: var(--ink-soft); font-size: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  border: 1px solid transparent;
  background: var(--green); color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform 0.06s, background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: var(--green-deep); box-shadow: var(--shadow); }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--green-deep); }
.btn.ghost:hover { background: var(--green-soft); box-shadow: none; }
.btn.small { padding: 6px 13px; font-size: 13.5px; }
.btn.terra { background: var(--terra); }
.btn.terra:hover { background: #b05c3d; }
.btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid transparent;
}
.chip.green { background: var(--green-soft); color: var(--green-deep); }
.chip.terra { background: var(--terra-soft); color: #a04f2f; }
.chip.gold { background: var(--gold-soft); color: #9c700f; }
.chip.blue { background: var(--blue-soft); color: #3d5e78; }
.chip.plum { background: var(--plum-soft); color: #6d4f73; }
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { border-color: currentColor; }

input[type="text"], input[type="date"], input[type="search"], input[type="email"],
input[type="password"], input[type="file"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit; font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--green); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 13px; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }

.empty {
  text-align: center; padding: 44px 20px; color: var(--ink-soft);
  background: var(--surface-2); border-radius: var(--radius);
  border: 1.5px dashed var(--line);
}
.empty .big { font-size: 40px; margin-bottom: 10px; }

/* ---------- home ---------- */
.hero {
  background: linear-gradient(135deg, #eef3e8 0%, #f8efe2 60%, #f7e6da 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 30px 26px;
  margin-bottom: 24px;
}
.hero h1 { font-family: var(--font-serif); font-size: 30px; margin: 0 0 6px; font-weight: 650; }
.hero p { margin: 0 0 18px; color: var(--ink-soft); max-width: 520px; }
.hero .row { flex-wrap: wrap; }

.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }

.home-card h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.home-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 14px; }

.mini-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 12px; border-radius: var(--radius-sm);
  transition: background 0.12s; cursor: pointer;
}
.mini-item:hover { background: var(--surface-2); }
.mini-item .emoji { font-size: 22px; line-height: 1.3; }
.mini-item .t { font-weight: 600; font-size: 14.5px; }
.mini-item .d { color: var(--ink-soft); font-size: 13px; }

.prompt-card {
  background: var(--gold-soft);
  border: 1px solid #eeddb5;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-top: 16px;
}
.prompt-card .q { font-family: var(--font-serif); font-size: 17px; font-style: italic; margin-bottom: 10px; }

/* ---------- coach ---------- */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 14px;
}
.topic-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.15s;
}
.topic-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); border-color: #d8ceba; }
.topic-card .emoji { font-size: 30px; margin-bottom: 8px; }
.topic-card h3 { margin: 0 0 4px; font-size: 16px; }
.topic-card p { margin: 0; font-size: 13px; color: var(--ink-soft); }

.playbook h2 { font-family: var(--font-serif); font-size: 25px; margin: 22px 0 4px; font-weight: 650; }
.playbook .lede { color: var(--ink-soft); margin: 0 0 6px; }

.pb-section { margin-top: 18px; }
.pb-section h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--ink-faint); margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.step {
  display: flex; gap: 14px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 9px;
}
.step .n {
  flex-shrink: 0; width: 27px; height: 27px; border-radius: 50%;
  background: var(--green-soft); color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.step .t { font-weight: 650; margin-bottom: 2px; }
.step .d { font-size: 14px; color: var(--ink-soft); }

.script {
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  padding: 11px 15px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 9px; font-size: 14.5px;
}
.script .say { font-style: italic; font-family: var(--font-serif); font-size: 15.5px; }
.script .when { font-size: 12.5px; color: #3d5e78; font-weight: 650; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em; }

.avoid-item, .prevent-item {
  padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14.5px;
}
.avoid-item { background: #f9e9e5; border: 1px solid #efd4cc; }
.prevent-item { background: var(--surface); border: 1px solid var(--line); }

.why-box {
  background: var(--plum-soft); border: 1px solid #e2d3e4;
  border-radius: var(--radius); padding: 16px 18px; font-size: 14.5px;
}

.plan-card { margin-bottom: 12px; cursor: pointer; transition: box-shadow 0.15s; }
.plan-card:hover { box-shadow: var(--shadow-lift); }

.checkin-dot {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 17px;
  background: var(--surface-2); border: 1px solid var(--line); margin-right: 6px;
}

.rating-row { display: flex; gap: 8px; margin: 10px 0 16px; }
.rating-row button {
  flex: 1; padding: 12px 6px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 22px; cursor: pointer; transition: all 0.12s;
}
.rating-row button:hover { border-color: var(--green); }
.rating-row button.sel { background: var(--green-soft); border-color: var(--green); }
.rating-row .lbl { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 4px; font-weight: 600; }

/* ---------- journal ---------- */
.moment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .moment-grid { grid-template-columns: 1fr; } }

.moment-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
  display: flex; flex-direction: column;
}
.moment-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.moment-card.proud { border-color: #e3c98a; background: linear-gradient(180deg, #fffdf6, #fff); }
.moment-card .photo { width: 100%; height: 170px; object-fit: cover; display: block; }
.moment-card .body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.moment-card h3 { margin: 0 0 5px; font-size: 16.5px; display: flex; gap: 8px; align-items: center; }
.moment-card .story { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.moment-card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.mood-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.mood-pick button {
  width: 44px; height: 44px; font-size: 22px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
}
.mood-pick button.sel { background: var(--gold-soft); border-color: var(--gold); }

.tag-pick { display: flex; gap: 7px; flex-wrap: wrap; }
.tag-pick .chip { cursor: pointer; user-select: none; padding: 6px 13px; font-size: 13px; }
.tag-pick .chip.sel { background: var(--green); color: #fff; }

.filterbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.filterbar input[type="search"] { max-width: 240px; }

/* ---------- community ---------- */
.post-card { margin-bottom: 14px; cursor: pointer; transition: box-shadow 0.15s; }
.post-card:hover { box-shadow: var(--shadow-lift); }
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.pavatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.post-head .who { font-weight: 650; font-size: 14.5px; }
.post-head .sub { font-size: 12.5px; color: var(--ink-faint); }
.post-card h3 { margin: 0 0 6px; font-size: 17px; }
.post-card .body-text { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 12px; white-space: pre-line; }
.post-card .body-text.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-actions { display: flex; gap: 6px; align-items: center; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; transition: all 0.12s;
}
.pill-btn:hover { background: var(--surface-2); }
.pill-btn.on { background: var(--terra-soft); border-color: #ecc4b3; color: #a04f2f; }
.pill-btn.on-gold { background: var(--gold-soft); border-color: #e8d3a2; color: #9c700f; }

.comment { display: flex; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }
.comment .pavatar { width: 33px; height: 33px; font-size: 16px; }
.comment .who { font-weight: 650; font-size: 13.5px; }
.comment .body-text { font-size: 14px; margin: 2px 0 0; }
.comment .faint { margin-left: 8px; font-weight: 400; }

.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px;
  border: 1px solid var(--line); margin-bottom: 18px;
}
.seg button {
  padding: 7px 17px; border-radius: 999px; border: none; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.seg button.sel { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

.user-card {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px;
}
.user-card .who { font-weight: 650; }
.user-card .bio { font-size: 13.5px; color: var(--ink-soft); }

/* ---------- groups ---------- */
.group-card {
  display: flex; align-items: center; gap: 15px;
  margin-bottom: 12px; cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.group-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.group-emoji {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: var(--green-soft); display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.group-emoji.big { width: 62px; height: 62px; font-size: 32px; }
.group-head { background: linear-gradient(135deg, #eef3e8 0%, #f8efe2 100%); }

.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px; letter-spacing: 0.12em; font-weight: 700;
  background: var(--surface-2); border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); padding: 16px; text-align: center;
  user-select: all;
}

.group-pick {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; font-size: 14.5px;
  transition: border-color 0.12s, background 0.12s;
}
.group-pick:hover { border-color: var(--green); background: #f7faf4; }

/* ---------- modal & toast ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(45, 38, 28, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadein 0.15s;
}
.modal {
  background: var(--surface); border-radius: 18px;
  max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto;
  padding: 26px 28px; box-shadow: var(--shadow-lift);
  animation: pop 0.18s;
}
.modal h2 { font-family: var(--font-serif); margin: 0 0 4px; font-size: 23px; font-weight: 650; }
.modal .sub { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } }

#toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fdfaf5; padding: 11px 20px;
  border-radius: 999px; font-size: 14.5px; font-weight: 550;
  box-shadow: var(--shadow-lift); animation: pop 0.2s;
}
@media (max-width: 760px) { #toast-root { bottom: 84px; } }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--ink-soft); }
.back-link:hover { color: var(--green-deep); }

.section-title { font-family: var(--font-serif); font-size: 21px; margin: 30px 0 14px; font-weight: 650; }

/* ---------- auth ---------- */
body.auth-mode .topbar, body.auth-mode .tabbar { display: none; }
.auth-wrap {
  min-height: calc(100vh - 60px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 0;
}
.auth-card { width: 100%; max-width: 400px; padding: 28px; }
.auth-card .seg { margin-bottom: 18px; }

/* ---------- reflections composer ---------- */
.compose { margin-bottom: 20px; padding: 16px 18px; }
.compose textarea {
  border: none; padding: 8px 2px; min-height: 52px; font-size: 15.5px;
  background: transparent;
}
.compose textarea:focus { border: none; outline: none; }

.compose-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.compose-tools .pill-btn { font-size: 16px; padding: 6px 11px; }
.tool-sep { width: 1px; height: 22px; background: var(--line); }

.mini-moods { display: flex; gap: 2px; }
.mini-moods button {
  width: 30px; height: 30px; font-size: 16px; border-radius: 8px;
  border: 1.5px solid transparent; background: transparent; cursor: pointer; padding: 0;
}
.mini-moods button:hover { background: var(--surface-2); }
.mini-moods button.sel { background: var(--gold-soft); border-color: var(--gold); }

.mini-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.mini-tags .chip { padding: 4px 10px; font-size: 12px; }
.mini-tags .chip.sel { background: var(--green); color: #fff; }

.prompt-ctx {
  background: var(--gold-soft); border: 1px solid #eeddb5; border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13.5px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.prompt-ctx em { font-family: var(--font-serif); }
.prompt-ctx button {
  margin-left: auto; border: none; background: none; cursor: pointer;
  color: var(--ink-faint); font-size: 13px; padding: 2px 6px;
}

#rf-attachments { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.attach { position: relative; }
.attach img { height: 74px; border-radius: 9px; display: block; }
.attach.audio { display: flex; align-items: center; }
.attach audio { height: 40px; max-width: 260px; }
.attach button {
  position: absolute; top: -7px; right: -7px;
  width: 21px; height: 21px; border-radius: 50%; border: none;
  background: var(--ink); color: #fff; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.attach.audio button { position: static; margin-left: 6px; background: var(--surface-2); color: var(--ink-soft); }

.share-select {
  width: auto; max-width: 190px;
  padding: 7px 10px; font-size: 13px; font-weight: 600;
  border-radius: 999px; color: var(--ink-soft);
}

.post-photo {
  width: 100%; max-height: 260px; object-fit: cover;
  border-radius: 10px; margin-bottom: 10px; display: block;
}

.rec-bar {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 12px; font-weight: 650;
}
.rec-bar[hidden] { display: none; }
.rec-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #d33c2a;
  animation: recpulse 1.1s infinite;
}
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.card-audio { width: 100%; height: 38px; margin-bottom: 10px; }

/* ---------- AI coach chat ---------- */
.chat-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - 150px);
  min-height: 420px;
}
@media (max-width: 760px) { .chat-shell { height: calc(100vh - 210px); } }

.chat-head { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; }
.chat-head select { width: auto; padding: 7px 10px; font-size: 13.5px; }

.chat-scroll {
  flex: 1; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.chat-msgs { display: flex; flex-direction: column; gap: 14px; max-width: 720px; margin: 0 auto; }

.msg { display: flex; gap: 10px; align-items: flex-end; }
.msg.mine { justify-content: flex-end; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-soft); display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.msg-body {
  max-width: 78%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 15px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: break-word;
}
.msg.coach .msg-body { background: var(--surface-2); border-bottom-left-radius: 5px; }
.msg.mine .msg-body { background: var(--green); color: #fff; border-bottom-right-radius: 5px; }

.chat-empty { text-align: center; padding: 34px 12px; }
.chat-sugs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chat-sugs .chip { padding: 8px 14px; font-size: 13.5px; background: var(--green-soft); color: var(--green-deep); border: none; font-family: inherit; }
.chat-sugs .chip:hover { background: #d5e0cd; }

.chat-compose {
  display: flex; gap: 10px; align-items: flex-end; margin-top: 12px;
}
.chat-compose textarea {
  flex: 1; resize: none; min-height: 44px; max-height: 140px;
  border-radius: 22px; padding: 11px 18px;
}
.chat-compose .btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 19px; flex-shrink: 0; }

.chat-error {
  background: #f9e9e5; border: 1px solid #efd4cc; color: #8c4130;
  border-radius: var(--radius-sm); padding: 11px 15px; font-size: 14px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
}

.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.age-pick { display: flex; gap: 7px; flex-wrap: wrap; }
.age-pick .chip { cursor: pointer; padding: 7px 14px; font-size: 13.5px; }
.age-pick .chip.sel { background: var(--green); color: #fff; }
