/* AskRoxy PWA shell stylesheet.
 *
 * Owns the presentation of the shell and every card in index.html. Linked
 * from <head> (render-blocking, on purpose: first paint must already be
 * styled) and precached by service-worker.js so a cold offline boot is not
 * an unstyled page. Extracted verbatim from the former inline <style>.
 */

:root {
  --cream: #fdf6ec; --caramel: #e8c39e; --brown: #8b5e3c; --dark: #4a3423;
  --pink: #f7b2ad; --green: #9ccc9c; --blue: #a8d5e5;
}
* { box-sizing: border-box; margin: 0; }
body {
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  background: var(--cream); color: var(--dark);
  min-height: 100vh; padding-bottom: 3rem;
  background-image: radial-gradient(#f3e5d3 12%, transparent 13%);
  background-size: 60px 60px;
}
.update-banner {
  background: #9ccc9c; color: #2f3e2f; text-align: center;
  font-size: 0.85rem; padding: 0.5rem 1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
}
.update-banner .pill { background: #2f3e2f; padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.undo-strip {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%);
  background: var(--dark); color: var(--cream); border-radius: 999px;
  padding: 0.45rem 0.5rem 0.45rem 1rem; display: flex; align-items: center;
  gap: 0.6rem; font-size: 0.85rem; z-index: 11; max-width: 92vw;
  box-shadow: 0 4px 14px rgba(74,52,35,0.3);
}
.undo-strip[hidden] { display: none; }
.undo-strip .pill { padding: 0.3rem 0.8rem; font-size: 0.8rem; background: var(--caramel); color: var(--dark); }
.dup-notice {
  background: #fdf1dc; border: 1px solid #e8c39e; border-radius: 0.9rem;
  padding: 0.6rem 0.7rem; margin-bottom: 0.6rem;
}
.dup-text { font-size: 0.85rem; line-height: 1.35; }
.dup-notice .card-actions { margin-top: 0.5rem; }
.dup-notice .pill { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
.edit-field { display: block; font-size: 0.78rem; color: #a08464; margin-bottom: 0.5rem; }
.edit-field input, .edit-field select {
  display: block; width: 100%; font-family: inherit; font-size: 1rem;
  color: var(--dark); border: 1px solid #e0cdb4; border-radius: 0.6rem;
  padding: 0.5rem 0.6rem; background: var(--cream); margin-top: 0.2rem;
}
.demo-ribbon {
  background: var(--dark); color: var(--cream); text-align: center;
  font-size: 0.8rem; padding: 0.4rem 1rem;
}
header {
  background: linear-gradient(135deg, var(--brown), #b07d4f);
  color: var(--cream); text-align: center; padding: 1.5rem 1rem 1.2rem;
  border-radius: 0 0 2rem 2rem; box-shadow: 0 4px 14px rgba(74,52,35,0.25);
}
header h1 { font-size: 2rem; letter-spacing: 0.5px; }
header .sub { opacity: 0.9; font-size: 0.95rem; margin-top: 0.2rem; }
header .hi { margin-top: 0.6rem; font-size: 1.05rem; }
main { max-width: 480px; margin: 0 auto; padding: 1rem; }
h2 { font-size: 1.05rem; margin: 1.1rem 0 0.5rem; color: var(--brown); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.card {
  background: #fff; border-radius: 1rem; padding: 0.7rem 0.8rem;
  box-shadow: 0 2px 6px rgba(74,52,35,0.08); min-height: 4.4rem;
}
.card .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: #a08464; }
.card .value { font-size: 1.05rem; font-weight: 600; margin-top: 0.2rem; }
.wag { grid-column: 1 / -1; }
.wag-track { background: #f0e2cf; border-radius: 999px; height: 14px; margin-top: 0.5rem; overflow: hidden; }
.wag-fill {
  height: 100%; width: 8%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--caramel), var(--green));
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; }
button.tap {
  appearance: none; border: none; cursor: pointer;
  background: #fff; border-radius: 1.1rem; padding: 0.8rem 0.2rem 0.6rem;
  box-shadow: 0 3px 0 rgba(139,94,60,0.35), 0 4px 10px rgba(74,52,35,0.08);
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  font-family: inherit; color: var(--dark);
  transition: transform 0.08s ease;
}
button.tap:active { transform: translateY(3px) scale(0.97); box-shadow: 0 0 0 rgba(0,0,0,0); }
button.tap .emoji { font-size: 1.7rem; line-height: 1; }
button.tap .name { font-size: 0.7rem; font-weight: 600; }
#toast {
  position: fixed; left: 50%; bottom: 4.5rem; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: var(--cream); padding: 0.7rem 1.1rem;
  border-radius: 999px; font-size: 0.9rem; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; max-width: 90vw; text-align: center;
  z-index: 10;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.paw-float {
  position: fixed; font-size: 1.6rem; pointer-events: none; z-index: 9;
  animation: floatUp 1.6s ease-out forwards;
}
@keyframes floatUp {
  from { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  to   { opacity: 0; transform: translateY(-140px) rotate(24deg) scale(1.6); }
}
footer { text-align: center; padding: 1.4rem 1rem 0; color: #a08464; font-size: 0.85rem; }
#quote { font-style: italic; min-height: 2.4em; transition: opacity 0.4s; }
.fine { font-size: 0.72rem; margin-top: 0.8rem; opacity: 0.8; }
.sync-badge {
  font-size: 0.7rem; font-weight: 600; vertical-align: middle;
  background: #f0e2cf; color: var(--dark); border-radius: 999px;
  padding: 0.2rem 0.6rem; margin-left: 0.4rem;
}
.sync-badge[data-state="synced"] { background: #dff0df; }
.sync-badge[data-state="queued"] { background: #fbe3c0; }
.pending-card { margin-top: 0.2rem; }
.search-card { margin-top: 0.2rem; }
.search-row { display: flex; gap: 0.5rem; }
.search-row input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 1rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.7rem; padding: 0.55rem 0.7rem;
  background: var(--cream);
}
.search-item {
  display: flex; gap: 0.6rem; align-items: flex-start;
  border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.5rem; cursor: pointer;
}
.search-item:first-child { border-top: none; }
.search-thumb { width: 44px; height: 44px; border-radius: 0.6rem; object-fit: cover; flex: none; }
.search-body { min-width: 0; flex: 1; }
.search-head { font-weight: 600; font-size: 0.95rem; }
.search-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.1rem; }
.search-note {
  font-size: 0.82rem; margin-top: 0.2rem; color: #7a6248;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pending-item {
  border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.5rem;
}
.pending-item:first-child { border-top: none; }
.pending-head { font-weight: 600; font-size: 0.95rem; }
.pending-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.15rem; }
.pending-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.pending-actions .pill { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
.pending-empty { font-size: 0.9rem; color: #a08464; padding: 0.3rem 0; }
.health-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #ccc;
  display: inline-block; margin-left: 0.45rem; vertical-align: middle;
}
.health-label { font-size: 0.68rem; color: #a08464; margin-left: 0.25rem; }
.card-actions { display: flex; gap: 0.6rem; margin: 0.7rem 0; flex-wrap: wrap; }
.passport-item { border-top: 1px solid #f0e2cf; padding: 0.55rem 0 0.4rem; }
.passport-item:first-child { border-top: none; }
.passport-head { font-weight: 600; font-size: 0.95rem; }
.passport-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.15rem; }
.passport-due { font-size: 0.85rem; margin-top: 0.15rem; }
.passport-due-unknown { color: #a08464; font-style: italic; }
.passport-due-overdue { color: #b4472f; font-weight: 600; }
.growth-chart { width: 100%; height: auto; margin: 0.3rem 0; }
.growth-line { fill: none; stroke: var(--brown); stroke-width: 2; }
.growth-dot { fill: var(--brown); }
/* Hollow: unconfirmed weights are shown but never joined to the trend. */
.growth-dot-pending { fill: #fff; stroke: #a08464; stroke-width: 1.5; }
.growth-label { font-size: 9px; fill: #a08464; }
.form-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; margin: 0.4rem 0; }
.detail-check {
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.82rem; color: #7a6248; margin-top: 0.5rem;
}
/* In-app alarm (D-018). Fixed and loud: it exists to be impossible to
   scroll past, and it darkens as the reminder gets more overdue. */
.alarm-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: #d9534f; color: #fff; padding: 0.7rem 0.9rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}
.alarm-banner[hidden] { display: none; }
.alarm-banner[data-level="3"] { background: #c9302c; }
.alarm-banner[data-level="4"] { background: #a82824; }
.alarm-title { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.alarm-meta { font-size: 0.82rem; opacity: 0.95; }
.alarm-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.alarm-actions .pill { background: #fff; color: #a82824; font-weight: 700; }
.alarm-actions .pill.ghost { background: rgba(255,255,255,0.18); color: #fff; }
.ringing-banner {
  background: #fbe3c0; color: var(--dark); border-radius: 0.8rem;
  padding: 0.55rem 0.7rem; margin-top: 0.6rem;
  font-size: 0.88rem; font-weight: 600;
}
button.pill {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  background: var(--brown); color: var(--cream); font-size: 0.85rem;
  padding: 0.55rem 0.9rem; border-radius: 999px; font-weight: 600;
}
button.pill:active { transform: scale(0.96); }
.card-note { font-size: 0.8rem; color: #7a6248; line-height: 1.35; }
.chip {
  display: inline-block; font-size: 0.6rem; font-weight: 600;
  background: #fbe3c0; color: var(--dark); border-radius: 999px;
  padding: 0.1rem 0.45rem; margin-left: 0.35rem; vertical-align: middle;
}
/* Emergency Mode (§25): read aloud by a frightened person, so everything
   is bigger than the rest of the app and the calls are thumb-sized. */
.emg-open {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  width: 100%; background: #b23b32; color: #fff; font-weight: 700;
  font-size: 1rem; padding: 0.85rem 1rem; border-radius: 1rem;
  margin-bottom: 0.9rem; box-shadow: 0 3px 0 rgba(120,35,28,0.5);
}
.emg-open:active { transform: translateY(2px); box-shadow: none; }
#emergency-overlay {
  position: fixed; inset: 0; z-index: 40; background: var(--cream);
  overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 3rem;
}
#emergency-overlay[hidden] { display: none; }
.emg-bar {
  position: sticky; top: 0; background: #b23b32; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.7rem 0.9rem; font-weight: 700;
}
.emg-bar button {
  appearance: none; border: 1px solid rgba(255,255,255,0.6); cursor: pointer;
  background: transparent; color: #fff; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; padding: 0.4rem 0.7rem; border-radius: 999px;
}
.emg-inner { max-width: 480px; margin: 0 auto; padding: 1rem; }
.emg-fresh { font-size: 0.8rem; color: #7a6248; margin-bottom: 0.6rem; }
.emg-head { margin-bottom: 0.9rem; }
.emg-name { font-size: 1.9rem; line-height: 1.1; }
.emg-sub { font-size: 1rem; color: #7a6248; margin-top: 0.15rem; }
.emg-block {
  background: #fff; border-radius: 1rem; padding: 0.8rem 0.9rem;
  margin-bottom: 0.7rem; box-shadow: 0 2px 6px rgba(74,52,35,0.08);
}
.emg-block-title {
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #a08464; margin-bottom: 0.4rem;
}
.emg-fact { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; padding: 0.25rem 0; }
.emg-fact-label { font-size: 0.8rem; color: #a08464; min-width: 5.5rem; }
.emg-fact-value { font-size: 1.25rem; font-weight: 700; }
.emg-list-item { padding: 0.35rem 0; font-size: 1.1rem; font-weight: 600; }
.emg-list-label { margin-right: 0.4rem; }
.emg-note { font-size: 0.85rem; color: #7a6248; font-weight: 400; }
.emg-missing { font-size: 0.95rem; color: #a08464; font-style: italic; }
.emg-stale { font-size: 0.78rem; color: #b23b32; margin-top: 0.2rem; }
.emg-contact { padding: 0.5rem 0; border-top: 1px solid #f0e2cf; }
.emg-contact:first-of-type { border-top: none; }
.emg-contact-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #a08464; }
.emg-contact-name { font-size: 1.15rem; font-weight: 700; margin: 0.1rem 0 0.3rem; }
.emg-call, .emg-map {
  display: block; margin-top: 0.3rem; padding: 0.7rem 0.8rem;
  background: #f3e9dc; border-radius: 0.8rem; color: var(--dark);
  font-size: 1.05rem; font-weight: 700; text-decoration: none;
}
.emg-call { background: #dff0df; }
.readonly { background: #f5efe6; color: #7a6248; }
.voice-card { margin-top: 0.2rem; }
.record-btn {
  appearance: none; border: none; cursor: pointer; font-family: inherit;
  width: 100%; background: var(--brown); color: var(--cream);
  border-radius: 1.1rem; padding: 0.9rem 1rem;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-size: 1rem; font-weight: 600; touch-action: none; user-select: none;
  -webkit-user-select: none; -webkit-touch-callout: none;
}
.record-btn .emoji { font-size: 1.4rem; }
.record-btn.recording { background: #c05a52; transform: scale(0.99); }
.record-timer {
  text-align: center; font-variant-numeric: tabular-nums;
  font-size: 0.95rem; font-weight: 600; color: var(--brown); min-height: 1.2em;
  margin-top: 0.35rem;
}
.voice-item { border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.5rem; }
.voice-item:first-child { border-top: none; }
.voice-item audio { width: 100%; margin-top: 0.4rem; }
.voice-item.pending { opacity: 0.85; }
#voice-preview { width: 100%; margin-bottom: 0.4rem; }
.photo-card { margin-top: 0.2rem; }
.photo-strip {
  display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.3rem;
  -webkit-overflow-scrolling: touch;
}
.photo-thumb { margin: 0; flex: 0 0 auto; width: 88px; }
.photo-thumb img {
  width: 88px; height: 88px; object-fit: cover; border-radius: 0.7rem;
  display: block; background: #f0e2cf; cursor: pointer;
}
.photo-thumb figcaption {
  font-size: 0.62rem; color: #a08464; text-align: center; margin-top: 0.2rem;
}
.photo-thumb.pending img { opacity: 0.72; }
.thumb-row { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.thumb-small {
  width: 64px; height: 64px; object-fit: cover; border-radius: 0.5rem;
  background: #f0e2cf; cursor: pointer;
}
.lightbox {
  position: fixed; inset: 0; z-index: 30; background: rgba(30,20,12,0.92);
  display: grid; place-items: center; padding: 1rem;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 0.8rem; }
.detail-preview {
  width: 100%; max-height: 220px; object-fit: contain;
  border-radius: 0.7rem; background: #f0e2cf;
}
.detail-panel { margin-top: 0.7rem; }
.detail-form { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.6rem 0 0.2rem; }
.form-row { display: flex; flex-direction: column; gap: 0.2rem; }
.form-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #a08464; }
.form-row input, .form-row select {
  font-family: inherit; font-size: 1rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.5rem 0.6rem;
  background: var(--cream); width: 100%;
}
.form-inline { display: flex; gap: 0.4rem; }
.form-inline input { flex: 1; }
.form-inline select { width: auto; }
.form-row textarea {
  font-family: inherit; font-size: 1rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.5rem 0.6rem;
  background: var(--cream); width: 100%; resize: vertical;
}
.form-hint { font-size: 0.75rem; color: #a08464; line-height: 1.3; }
#medical-status:not(:empty) {
  background: #fbe3c0; border-radius: 0.6rem; padding: 0.5rem 0.7rem; margin-top: 0.5rem;
}
.form-checks { display: flex; flex-wrap: wrap; gap: 0.7rem; padding-top: 0.15rem; }
.form-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; }
.form-check input { width: auto; }
.threshold-note {
  font-size: 0.75rem; color: #7a6248; line-height: 1.3;
  margin-top: 0.35rem; border-top: 1px solid #f0e2cf; padding-top: 0.3rem;
}
.detail-fields { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0.2rem; }
.detail-fields input, .detail-fields select {
  font-family: inherit; font-size: 1rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.5rem 0.6rem;
  background: var(--cream); min-width: 0;
}
.detail-fields input { flex: 1; }
button.pill.ghost { background: #f0e2cf; color: var(--dark); }
@media (prefers-reduced-motion: reduce) {
  .paw-float { animation: none; opacity: 0; }
  .wag-fill { transition: none; }
}
/* Login overlay (slice 6): shown when there is no session. */
#login-overlay {
  position: fixed; inset: 0; z-index: 20; background: var(--cream);
  display: grid; place-items: center; padding: 1.5rem;
  background-image: radial-gradient(#f3e5d3 12%, transparent 13%);
  background-size: 60px 60px;
}
#login-overlay[hidden] { display: none; }
.login-card {
  background: #fff; border-radius: 1.4rem; padding: 1.6rem 1.4rem;
  box-shadow: 0 6px 24px rgba(74,52,35,0.18); max-width: 340px; width: 100%;
  text-align: center;
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.login-card .sub { color: #a08464; font-size: 0.9rem; margin-bottom: 1rem; }
.account-list { display: grid; gap: 0.6rem; margin: 0.8rem 0; }
button.account {
  appearance: none; cursor: pointer; font-family: inherit;
  border: 2px solid #e0cdb4; background: var(--cream); color: var(--dark);
  border-radius: 1rem; padding: 0.8rem; font-size: 1rem; font-weight: 600;
}
button.account[data-selected="true"] { border-color: var(--brown); background: #f6e8d6; }
.login-actions { display: grid; gap: 0.6rem; margin-top: 0.6rem; }
#enroll-row { display: none; gap: 0.5rem; margin-top: 0.6rem; }
#enroll-row.show { display: flex; }
#enroll-code {
  flex: 1; min-width: 0; font-family: inherit; font-size: 1rem;
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.55rem 0.6rem;
  background: var(--cream); color: var(--dark);
}
.login-status { font-size: 0.82rem; color: #7a6248; min-height: 2.2em; margin-top: 0.6rem; }
.login-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--brown); font-size: 0.82rem; text-decoration: underline; margin-top: 0.7rem;
}
#identity { font-weight: 600; }
#logout-link {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--brown); font-size: 0.72rem; text-decoration: underline;
}

/* Spending & supplies (spec §27). */
.expense-row {
  display: flex; justify-content: space-between; gap: 0.5rem;
  font-size: 0.85rem; padding: 0.25rem 0; border-top: 1px solid #f0e2cf;
}
.expense-row:first-child { border-top: none; }
.expense-amount { font-weight: 600; }
.inventory-item { border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.4rem; }
.inventory-item:first-child { border-top: none; }
.inventory-item.low .inventory-head { color: #a8551f; }
.inventory-head { font-weight: 600; font-size: 0.95rem; }
.inventory-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.15rem; }

/* Training (spec §11). One block per skill: what she can do, how sure we are,
   and what the record says is missing — in that order, because that is the
   order a handler asks the questions. */
.training-group {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #a08464; margin: 0.8rem 0 0.3rem;
}
.training-skill { border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.5rem; }
.training-group + .training-skill { border-top: none; }
.training-head { font-weight: 600; font-size: 0.95rem; }
.training-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.15rem; }

/* --- caregiver wellbeing (spec §22.1) -------------------------------------- */
/* The privacy line is styled to be read, not skimmed past: somebody deciding
   whether to write "I'm overwhelmed" needs to know who sees it before they
   type, not after. */
.wellbeing-privacy {
  background: #f3ece2;
  border-left: 3px solid var(--brown);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.6rem;
}
.mood-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.7rem 0;
}
button.mood-btn {
  appearance: none;
  border: 1px solid #e0cdb4;
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.7rem 0.3rem;
  font-family: inherit;
  color: var(--dark);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-align: center;
}
button.mood-btn.selected {
  border-color: var(--brown);
  background: #f7efe4;
  box-shadow: inset 0 0 0 1px var(--brown);
}
.mood-emoji { font-size: 1.5rem; line-height: 1; }
.mood-label { font-size: 0.7rem; font-weight: 600; line-height: 1.2; }
.wellbeing-entry {
  border-top: 1px solid #f0e2cf;
  padding: 0.6rem 0 0.5rem;
}
.wellbeing-head { font-weight: 600; font-size: 0.95rem; }
.wellbeing-meta { font-size: 0.75rem; color: #a08464; margin-top: 0.15rem; }
.wellbeing-note { font-size: 0.9rem; margin-top: 0.35rem; white-space: pre-wrap; }
.wellbeing-help-line {
  background: #fbe3c0;
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

/* Timeline (spec §23): year → month → entries, read-only. */
/* Family journal (spec §22) */
.journal-entry {
  border-top: 1px solid #f0e2cf; padding: 0.7rem 0 0.6rem;
}
.journal-entry:first-child { border-top: none; }
.journal-text { white-space: pre-wrap; margin: 0.3rem 0; line-height: 1.4; }
.journal-entry .thumb { max-width: 96px; border-radius: 0.5rem; margin: 0.3rem 0.3rem 0 0; }
.journal-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.journal-tags .pill { font-size: 0.75rem; padding: 0.3rem 0.7rem; }
.journal-people { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.5rem 0; font-size: 0.85rem; }
.journal-person { display: inline-flex; align-items: center; gap: 0.25rem; }
#journal-text {
  width: 100%; font-family: inherit; font-size: 1rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.6rem;
  background: var(--cream); resize: vertical;
}

.timeline-year { margin-top: 0.8rem; }
.timeline-month { margin: 0.4rem 0 0.6rem 0.2rem; }
.timeline-entry {
  border-left: 2px solid #f0e2cf;
  padding: 0.35rem 0 0.35rem 0.7rem;
  margin-left: 0.3rem;
  font-size: 0.9rem;
}
.timeline-entry .pending-meta { margin-top: 0.1rem; }

/* Outings (spec §14). The route is drawn inline — no map tiles, no external
   requests (CSP), so it still renders on a walk with no signal. */
.outing-route { margin: 0.6rem 0; background: #f7ede0; border-radius: 0.8rem; min-height: 0; }
.outing-route:empty { display: none; }
.rating-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 0.6rem; margin: 0.6rem 0;
}
.rating-grid label, .outing-outcome {
  display: flex; align-items: center; justify-content: space-between; gap: 0.4rem;
  font-size: 0.82rem; color: #7a6248;
}
.rating-grid select, .outing-outcome select {
  font-family: inherit; font-size: 0.9rem; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.5rem; padding: 0.3rem 0.4rem;
  background: var(--cream);
}
.outing-outcome { margin: 0.4rem 0 0.6rem; }
.place-row { font-size: 0.9rem; padding: 0.3rem 0; border-top: 1px solid #f0e2cf; }
.place-row:first-child { border-top: none; }

/* Food card (spec §10). The uncounted list is deliberately plain text rather
   than a badge: "not counted" is information a person needs to read, not a
   status to glance past. */
#food-uncounted .card-note { color: #8a6d4f; }
#food-calorie-sources { margin-top: 0.2rem; }
#food-product-list, #food-recipe-list { margin-top: 0.4rem; }

/* --- Copy for AI (D-020) --------------------------------------------------- */
.ai-sections {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem;
  margin: 0.6rem 0; font-size: 0.85rem;
}
.ai-sections label { display: inline-flex; align-items: center; gap: 0.3rem; }
.ai-inline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; }
.ai-preview {
  width: 100%; margin-top: 0.6rem; font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem; line-height: 1.35; color: var(--dark);
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.5rem;
  background: var(--cream); resize: vertical;
}
#ai-paste-text {
  width: 100%; margin-top: 0.4rem; font-family: inherit; font-size: 0.9rem;
  border: 1px solid #e0cdb4; border-radius: 0.6rem; padding: 0.5rem;
  background: var(--cream); color: var(--dark); resize: vertical;
}
.ai-rule { border: none; border-top: 1px solid #f0e2cf; margin: 0.9rem 0 0.6rem; }

/* --- Health Watch (spec §30, §30.1) ---------------------------------------
   Severity is carried by the WORDS first: the level's name is printed in the
   heading, and colour only reinforces it. A red border says nothing when the
   card is read aloud to a vet tech, or to a reader who does not separate red
   from green. */
.hw-alert {
  border-left: 4px solid var(--caramel);
  background: #fffdf9;
  border-radius: 0.7rem;
  padding: 0.7rem 0.85rem;
  margin: 0.6rem 0;
}
.hw-alert h4 { font-size: 0.98rem; margin-bottom: 0.25rem; }
.hw-monitor { border-left-color: var(--blue); }
.hw-contact { border-left-color: var(--caramel); }
.hw-prompt  { border-left-color: #e8a33d; }
.hw-emergency { border-left-color: #d9534f; background: #fff5f5; }
.hw-why { font-size: 0.92rem; line-height: 1.4; }
.hw-meta { font-size: 0.78rem; color: #a08464; margin-top: 0.2rem; }
.hw-pending-note { font-size: 0.78rem; color: #8a6d3b; margin-top: 0.25rem; }
.hw-evidence {
  margin: 0.45rem 0 0.2rem 1.1rem;
  font-size: 0.82rem;
  color: #7a6248;
  line-height: 1.45;
}
.hw-empty { font-size: 0.9rem; color: #a08464; padding: 0.3rem 0; }
.hw-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.hw-actions .pill { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
.hw-rules-wrap { margin-top: 0.8rem; }
.hw-rules-wrap summary { font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--brown); }
.hw-rule { border-top: 1px solid #f0e2cf; padding: 0.6rem 0 0.5rem; }
.hw-rule:first-of-type { border-top: none; }
.hw-rule-title { font-weight: 600; font-size: 0.92rem; }
