:root {
  color-scheme: light;
  --canvas: #f5f5f0;
  --paper: #fffefa;
  --paper-tint: #fafbf7;
  --wash: #eff4ef;
  --wash-strong: #e7efe8;
  --ink: #17352f;
  --ink-soft: #38554d;
  --muted: #71847a;
  --line: #e4eae3;
  --line-strong: #d4dfd5;
  --green: #08775f;
  --green-deep: #075c4e;
  --green-pale: #e9f5ed;
  --coral: #e88570;
  --coral-pale: #fff1e9;
  --sand: #f7efe0;
  --shadow: 0 18px 55px rgba(27, 61, 49, .10);
  --shadow-soft: 0 6px 24px rgba(27, 61, 49, .055);
  --radius: 18px;
  --font: 'DM Sans', 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
  --display: 'Manrope', 'Avenir Next', Avenir, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(8, 119, 95, .36);
  outline-offset: 3px;
}
a { color: var(--green); }
::selection { background: #cdebd8; color: var(--ink); }
[hidden] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: 74px minmax(300px, 338px) minmax(440px, 1fr) minmax(266px, 304px);
  width: 100%;
  height: 100dvh;
  min-height: 640px;
  overflow: hidden;
  background: var(--paper);
}

.app-shell:has(.detail-pane[hidden]), .app-shell.no-detail {
  grid-template-columns: 74px minmax(300px, 350px) minmax(0, 1fr);
}

.rail, .people-pane, .main-pane, .detail-pane { min-width: 0; min-height: 0; }

/* The rail is a quiet utility shelf. The people list carries primary navigation. */
.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 23px;
  padding: 20px 10px 18px;
  background: #f4f7f2;
  border-right: 1px solid var(--line);
  z-index: 4;
}

.brand {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border-radius: 15px;
  background: var(--ink);
  color: white;
  text-decoration: none;
  font: 800 22px/1 var(--display);
  letter-spacing: -.07em;
  box-shadow: 0 9px 17px rgba(16, 70, 53, .16);
}

.brand svg { width: 24px; height: 24px; }
.rail-nav { display: flex; flex-direction: column; gap: 7px; width: 100%; align-items: center; }
.rail-spacer { flex: 1; }
.rail-action {
  display: grid;
  place-items: center;
  position: relative;
  width: 47px;
  height: 47px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: #73867b;
  transition: color .18s var(--ease-out), background .18s var(--ease-out), transform .18s var(--ease-out);
}
@media (hover: hover) and (pointer: fine){.rail-action:hover { color: var(--green); background: #e9f0e9; transform: translateY(-1px); }}
.rail-action.active, .rail-action[aria-current="page"] {
  color: var(--green-deep);
  background: #e2eee6;
}
.rail-action.active::before, .rail-action[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--green);
}
.rail-action svg { width: 21px; height: 21px; stroke-width: 1.85; }
.rail-avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 13px; }

.people-pane {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
  z-index: 3;
}
.people-header { padding: 29px 22px 14px; }
.people-header-top, .pane-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.people-header h1, .people-header h2, .pane-title {
  margin: 0;
  font: 800 clamp(24px, 2vw, 28px)/1.15 var(--display);
  letter-spacing: -.057em;
}
.eyebrow {
  color: var(--green);
  font: 800 10px/1.25 var(--display);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.people-header .eyebrow { margin: 0 0 7px; }
.people-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; gap: 5px; align-items: center; }

.search-wrap { position: relative; display: flex; align-items: center; margin-top: 24px; }
.search-wrap svg, .search-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #8ea096;
  pointer-events: none;
}
.search-wrap input, .search-wrap .search-input {
  width: 100%;
  height: 43px;
  padding: 0 14px 0 41px;
  border: 1px solid #e7eee7;
  border-radius: 12px;
  outline: none;
  background: #f4f7f3;
  color: var(--ink);
  font-size: 13px;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.search-wrap input::placeholder { color: #94a49a; }
.search-wrap input:focus { border-color: #9ecab6; background: white; box-shadow: 0 0 0 3px rgba(8,119,95,.08); }
.search-wrap input:focus-visible { outline: none; }

.filter-row { display: flex; gap: 6px; padding: 0 22px 14px; overflow-x: auto; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font: 700 11px/1 var(--font);
  white-space: nowrap;
  transition: background .16s var(--ease-out), color .16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine){.filter-chip:hover { background: var(--wash); color: var(--ink); }}
.filter-chip.active, .filter-chip[aria-selected="true"] { background: var(--green-pale); color: var(--green-deep); }
.list-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 24px 10px;
  color: #8da197;
  font: 800 10px/1.25 var(--display);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.list-label button { border: 0; background: transparent; color: var(--green); font-size: 11px; letter-spacing: 0; text-transform: none; }
.people-list { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 18px; }
.people-list::-webkit-scrollbar, .main-content::-webkit-scrollbar, .detail-pane::-webkit-scrollbar { width: 6px; }
.people-list::-webkit-scrollbar-thumb, .main-content::-webkit-scrollbar-thumb, .detail-pane::-webkit-scrollbar-thumb { background: #dbe4dc; border-radius: 10px; }
.person-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 77px;
  gap: 13px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background .17s var(--ease-out), border-color .17s var(--ease-out), transform .17s var(--ease-out);
}
@media (hover: hover) and (pointer: fine){.person-item:hover { background: #f4f8f3; }}
.person-item.active, .person-item[aria-selected="true"] { background: #eaf4ed; border-color: #e2eee5; }
@media (hover: hover) and (pointer: fine){.person-item.active:hover { background: #e5f1e9; }}
.avatar {
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: #dce9df;
  color: #316655;
  font: 800 15px/1 var(--display);
  letter-spacing: -.03em;
  overflow: hidden;
}
.avatar[data-tone="rose"], .person-item:nth-child(4n + 2) .avatar { background: #f2e3df; color: #a66353; }
.avatar[data-tone="amber"], .person-item:nth-child(4n + 3) .avatar { background: #f4ead0; color: #8b7136; }
.avatar[data-tone="lavender"], .person-item:nth-child(4n + 4) .avatar { background: #e6e2f1; color: #706090; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.status-dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border: 3px solid var(--paper); border-radius: 50%; background: #46b784; }
.person-item.active .status-dot { border-color: #eaf4ed; }
.person-meta { min-width: 0; flex: 1; }
.person-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.person-name { overflow: hidden; color: var(--ink); font-weight: 800; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.person-time { color: #a4b0a7; font-size: 10px; white-space: nowrap; }
.person-preview { margin: 4px 0 0; overflow: hidden; color: #77897e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.person-cue {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 700;
}
.person-cue::before { content: ''; flex: 0 0 auto; width: 5px; height: 5px; border-radius: 50%; background: #7cba94; }
.person-cue.guess { color: #956d53; }
.person-cue.guess::before { background: #d6a071; }
.person-badge { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 10px; background: var(--green); color: white; font-size: 10px; font-weight: 800; }
.people-footer { border-top: 1px solid var(--line); padding: 13px 16px; }
.privacy-note { display: flex; align-items: center; gap: 9px; color: #8a9a91; font-size: 10px; line-height: 1.35; }
.privacy-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: #83ad90; }

/* The central surface reads like a quiet conversation, with insight attached to evidence. */
.main-pane { display: flex; flex-direction: column; position: relative; background: #fbfcf9; }
.main-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .4;
  background-image: radial-gradient(#dfe8df .55px, transparent .55px);
  background-size: 22px 22px;
}
.main-header {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 76px;
  padding: 12px clamp(18px, 2.6vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 254, 250, .95);
  backdrop-filter: blur(12px);
  z-index: 2;
}
.main-header-left, .main-header-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.main-header .avatar { width: 44px; height: 44px; border-radius: 15px; }
.main-header h2, .main-header h1 { margin: 0; font: 800 15px/1.2 var(--display); letter-spacing: -.025em; }
.main-header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.main-header-actions { display: flex; align-items: center; gap: 7px; }
.main-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(24px, 3vw, 44px) clamp(18px, 3.2vw, 48px) 34px;
  z-index: 1;
}
.content-inner { width: min(100%, 790px); margin: 0 auto; }
.main-content > .content-inner > * + * { margin-top: 22px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 29px 0 13px; }
.section-heading h2, .section-heading h3 { margin: 0; font: 800 15px/1.3 var(--display); letter-spacing: -.03em; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(27px, 3vw, 42px);
  border: 1px solid #d9e9db;
  border-radius: 24px;
  background: #eaf4e9;
  box-shadow: 0 14px 34px rgba(35, 78, 48, .05);
}
.hero-card::after {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -95px;
  top: -150px;
  border-radius: 50%;
  background: rgba(255,255,255,.42);
  box-shadow: 0 0 0 40px rgba(255,255,255,.15), 0 0 0 90px rgba(255,255,255,.08);
  pointer-events: none;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card .eyebrow { color: #478b69; }
.hero-card h1, .hero-card h2 {
  max-width: 530px;
  margin: 13px 0 11px;
  font: 800 clamp(26px, 2.5vw, 37px)/1.18 var(--display);
  letter-spacing: -.063em;
}
.hero-card p { max-width: 545px; margin: 0; color: #4b6a59; font-size: 13px; line-height: 1.65; }
.hero-card .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 21px; }
.hero-card .hero-mark { position: absolute; right: 30px; bottom: 22px; color: rgba(45, 110, 68, .13); font: 800 112px/1 var(--display); letter-spacing: -.1em; }

.section-card {
  padding: 23px 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.section-card + .section-card { margin-top: 12px; }
.section-card h3, .section-card h4 { margin: 0 0 7px; font: 800 14px/1.3 var(--display); letter-spacing: -.025em; }
.section-card p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.section-card p + p { margin-top: 10px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.card-heading h3 { margin: 0; }
.card-subtitle { color: var(--muted); font-size: 11px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.split-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }

.insight-card {
  position: relative;
  padding: 20px 22px 20px 25px;
  border: 1px solid #e4eae2;
  border-radius: 17px;
  background: #fffefa;
  box-shadow: var(--shadow-soft);
}
.insight-card::before { content: ''; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 0 3px 3px 0; background: #88b69a; }
.insight-card.guess::before { background: #d9ad8a; }
.insight-card .eyebrow { margin: 0 0 8px; color: var(--green); }
.insight-card.guess .eyebrow { color: #af785d; }
.insight-card h3 { margin: 0 0 5px; font: 800 17px/1.3 var(--display); letter-spacing: -.035em; }
.insight-card p { margin: 0; color: #54675d; font-size: 12px; line-height: 1.6; }
.insight-card blockquote { margin: 14px 0 0; padding: 12px 15px; border-left: 2px solid #cadfcd; border-radius: 0 8px 8px 0; background: #f5f8f3; color: #415c4c; font-size: 12px; line-height: 1.6; }
.insight-card .source-note { margin-top: 7px; }
.confidence-label, .source-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #87978a;
  font-size: 10px;
  font-weight: 600;
}
.confidence-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #94b99a; }
.confidence-label.guess::before { background: #d6a276; }

.message-list { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 0; margin: 0; list-style: none; }
.message-row { display: flex; flex-direction: column; align-items: flex-start; max-width: min(78%, 560px); }
.message-row.mine { align-self: flex-end; align-items: flex-end; }
.message-sender { margin: 0 0 5px 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.message-bubble {
  max-width: 100%;
  padding: 13px 16px;
  border: 1px solid #e2e9e0;
  border-radius: 5px 17px 17px 17px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
  box-shadow: 0 3px 11px rgba(31, 67, 48, .035);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.message-row.mine .message-bubble, .message-bubble.mine { border-color: #dcebdc; border-radius: 17px 5px 17px 17px; background: #ebf5e9; }
.message-bubble.highlight { border-color: #abd7b7; box-shadow: 0 0 0 3px rgba(131, 192, 143, .12); }
.message-meta { margin: 5px 4px 0; color: #a0ada2; font-size: 10px; }
.date-divider { align-self: center; margin: 2px 0 5px; padding: 6px 11px; border-radius: 20px; background: #edf1ea; color: #879789; font-size: 10px; font-weight: 700; }

.action-card {
  display: flex;
  align-items: flex-start;
  gap: 17px;
  padding: 22px 24px;
  border: 1px solid #f0dfd5;
  border-radius: 18px;
  background: #fff8f2;
}
.action-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; background: #fbe6d6; color: #b87659; }
.action-icon svg { width: 19px; height: 19px; }
.action-card h3 { margin: 0 0 5px; font: 800 14px/1.3 var(--display); letter-spacing: -.025em; }
.action-card p { margin: 0; color: #816b60; font-size: 12px; line-height: 1.6; }
.action-card .button { margin-top: 13px; }

.composer {
  position: relative;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #dfe7de;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.composer-label { display: block; margin: 0 0 8px 2px; color: var(--muted); font-size: 11px; font-weight: 700; }
.composer-input, .composer textarea {
  display: block;
  width: 100%;
  min-height: 78px;
  padding: 7px 9px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
}
.composer-input::placeholder, .composer textarea::placeholder { color: #a2afa4; }
.composer-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 3px 0; border-top: 1px solid var(--line); }
.composer-help { color: #9aaa9d; font-size: 10px; }

/* The optional memory column gives context without competing with the person. */
.detail-pane {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 24px 28px;
  background: #fffefa;
  border-left: 1px solid var(--line);
}
.detail-header { display: flex; align-items: center; justify-content: space-between; min-height: 76px; border-bottom: 1px solid var(--line); }
.detail-header h2, .detail-header h3 { margin: 0; font: 800 14px/1.2 var(--display); letter-spacing: -.03em; }
.detail-section { padding: 23px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h3 { margin: 0 0 13px; font: 800 12px/1.3 var(--display); }
.detail-section p { margin: 0; color: #687b6f; font-size: 11px; line-height: 1.6; }
.detail-section p + p { margin-top: 9px; }
.detail-profile { text-align: center; }
.detail-profile .avatar { width: 70px; height: 70px; margin: 0 auto 12px; border-radius: 22px; font-size: 22px; }
.detail-profile h3 { margin: 0; font: 800 18px/1.25 var(--display); letter-spacing: -.04em; }
.detail-profile p { margin: 5px 0 0; }
.detail-profile .tag { margin-top: 11px; }
.detail-stat-row { display: flex; justify-content: space-between; gap: 9px; margin-top: 15px; }
.detail-stat { flex: 1; padding: 10px; border-radius: 12px; background: #f6f8f3; color: #6c8071; font-size: 10px; text-align: center; }
.detail-stat strong { display: block; margin-bottom: 2px; color: var(--ink); font: 800 15px/1.2 var(--display); }
.memory-list { display: flex; flex-direction: column; gap: 0; padding: 0; margin: 0; list-style: none; }
.memory-entry { position: relative; padding: 0 0 20px 19px; border-left: 1px solid #d9e8da; }
.memory-entry:last-child { padding-bottom: 0; border-left-color: transparent; }
.memory-entry::before { content: ''; position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: #8bbf98; box-shadow: 0 0 0 3px #eef5ef; }
.memory-entry.guess::before { background: #d7aa85; box-shadow: 0 0 0 3px #fbf3ec; }
.memory-entry time { display: block; margin: 0 0 3px; color: #9aab9c; font-size: 10px; }
.memory-entry p { margin: 0; color: #486052; font-size: 11px; line-height: 1.55; }
.memory-entry .source-note { margin-top: 5px; font-size: 9px; }
.detail-actions { display: flex; flex-direction: column; gap: 8px; }
.detail-actions .button { justify-content: flex-start; width: 100%; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #d9e9d9;
  border-radius: 100px;
  background: #f0f8f0;
  color: #5d8967;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.tag.guess { border-color: #f2dfd2; background: #fff5ee; color: #ac7e64; }
.tag svg { width: 12px; height: 12px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #dce6dc;
  border-radius: 10px;
  background: white;
  color: #335a48;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .17s var(--ease-out), background .17s var(--ease-out), box-shadow .17s var(--ease-out), border-color .17s var(--ease-out);
}
@media (hover: hover) and (pointer: fine){.button:hover { transform: translateY(-1px); border-color: #bed7c1; background: #f8fcf7; box-shadow: 0 5px 14px rgba(24,79,50,.07); }}
.button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.button-primary { border-color: var(--green); background: var(--green); color: white; box-shadow: 0 6px 15px rgba(8,119,95,.12); }
@media (hover: hover) and (pointer: fine){.button-primary:hover { border-color: var(--green-deep); background: var(--green-deep); box-shadow: 0 8px 18px rgba(8,119,95,.18); }}
.button-quiet { border-color: transparent; background: transparent; color: var(--green); box-shadow: none; }
@media (hover: hover) and (pointer: fine){.button-quiet:hover { border-color: transparent; background: #edf5ee; box-shadow: none; }}
.button-coral { border-color: #e2a38f; background: #e78c72; color: white; }
@media (hover: hover) and (pointer: fine){.button-coral:hover { border-color: #d47b65; background: #d47b65; }}
.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #73897b;
  transition: color .16s var(--ease-out), background .16s var(--ease-out), border-color .16s var(--ease-out);
}
@media (hover: hover) and (pointer: fine){.icon-button:hover { border-color: #e2ece2; background: #f1f6ef; color: var(--green); }}
.icon-button svg { width: 18px; height: 18px; }
.text-link { padding: 0; border: 0; background: transparent; color: var(--green); font: 800 11px/1.3 var(--font); text-decoration: none; }
@media (hover: hover) and (pointer: fine){.text-link:hover { color: var(--green-deep); text-decoration: underline; text-underline-offset: 3px; }}
.muted { color: var(--muted); }
.small { font-size: 11px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 42px 24px; text-align: center; }
.empty-illustration {
  display: grid;
  place-items: center;
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 28px;
  border: 1px solid #dce9dc;
  border-radius: 44px;
  background: #e9f3e9;
  box-shadow: 0 25px 45px rgba(37, 84, 52, .07);
}
.empty-illustration::before, .empty-illustration::after { content: ''; position: absolute; border-radius: 50%; background: #86b69a; }
.empty-illustration::before { width: 44px; height: 44px; left: 25px; top: 37px; background: #f0cbb1; box-shadow: 52px 15px 0 #b5d0b3; }
.empty-illustration::after { width: 75px; height: 28px; left: 37px; bottom: 28px; border-radius: 50% 50% 13px 13px; background: #70a484; }
.empty-state .eyebrow { margin-bottom: 11px; }
.empty-state h1, .empty-state h2 { max-width: 480px; margin: 0; font: 800 clamp(27px, 3vw, 39px)/1.15 var(--display); letter-spacing: -.06em; }
.empty-state p { max-width: 435px; margin: 13px 0 0; color: #71867a; font-size: 13px; line-height: 1.65; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 23px; }
.empty-state.compact { min-height: 270px; padding: 28px 16px; }
.empty-state.compact .empty-illustration { width: 80px; height: 80px; margin-bottom: 17px; border-radius: 27px; transform: scale(.8); }
.empty-state.compact h2 { font-size: 17px; }
.empty-state.compact p { font-size: 11px; }

/* Import and settings are designed as calm, short tasks. */
.modal-backdrop { position: fixed; display: grid; place-items: center; inset: 0; padding: 22px; background: rgba(15, 35, 29, .43); backdrop-filter: blur(5px); z-index: 20; animation: fade-in .18s var(--ease-out) both; }
.modal { width: min(100%, 650px); max-height: min(88dvh, 870px); overflow-y: auto; border: 1px solid rgba(255,255,255,.5); border-radius: 23px; background: var(--paper); box-shadow: 0 30px 90px rgba(10,31,23,.24); animation: rise-in .25s var(--ease-out) both; }
.modal.small { width: min(100%, 450px); }
.modal.large { width: min(100%, 800px); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 29px 30px 20px; border-bottom: 1px solid var(--line); }
.modal-header .eyebrow { margin: 0 0 8px; }
.modal-header h2 { margin: 0; font: 800 23px/1.22 var(--display); letter-spacing: -.05em; }
.modal-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.modal-body { padding: 26px 30px; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 30px 25px; border-top: 1px solid var(--line); }
.modal-footer-actions { display: flex; gap: 8px; margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label { color: #435a4d; font-size: 11px; font-weight: 800; }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #dfe8df;
  border-radius: 10px;
  outline: 0;
  background: #fbfcfa;
  color: var(--ink);
  font-size: 12px;
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.field textarea { min-height: 145px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #90c3a1; box-shadow: 0 0 0 3px rgba(8,119,95,.09); }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline: 0; }
.field-help { color: #889b8d; font-size: 10px; line-height: 1.5; }
.dropzone { display: grid; place-items: center; min-height: 113px; padding: 17px; border: 1.5px dashed #bfd7c4; border-radius: 13px; background: #f7fbf7; color: #5d7d67; text-align: center; }
.dropzone.dragging { border-color: var(--green); background: #ecf8ed; }
.dropzone svg { width: 24px; height: 24px; margin-bottom: 7px; }
.dropzone strong { display: block; font-size: 12px; }
.dropzone span { font-size: 10px; }
.import-example { margin-top: 13px; padding: 12px 14px; border-radius: 10px; background: #f4f6f1; color: #678070; font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.view-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: #eef3ed; }
.view-toggle button { min-height: 30px; padding: 5px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.view-toggle button.active, .view-toggle button[aria-selected="true"] { background: white; color: var(--ink); box-shadow: 0 2px 7px rgba(28,69,43,.07); }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row strong { display: block; margin: 0 0 3px; color: var(--ink); font-size: 12px; }
.settings-row span { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.settings-row .button { flex: 0 0 auto; }
.danger { color: #b45d50 !important; }
.danger-zone { margin-top: 14px; padding: 15px; border: 1px solid #f1ddd7; border-radius: 12px; background: #fff8f6; }
.danger-zone h3 { margin: 0 0 4px; color: #9c5748; font-size: 12px; }
.danger-zone p { margin: 0; color: #a1786e; font-size: 10px; line-height: 1.55; }

.toast { position: fixed; right: 24px; bottom: 22px; display: flex; align-items: center; gap: 10px; max-width: min(390px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid #d7e7d8; border-radius: 13px; background: #fffefa; color: var(--ink); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; z-index: 50; animation: rise-in .23s var(--ease-out) both; }
.toast svg { width: 17px; height: 17px; color: var(--green); }
.toast.error { border-color: #f1d7ce; }
.toast.error svg { color: #bf6f57; }
.mobile-back { display: none; }
.mobile-only { display: none !important; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(9px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1420px) {
  .app-shell { grid-template-columns: 70px minmax(290px, 320px) minmax(400px, 1fr) minmax(246px, 280px); }
  .app-shell:has(.detail-pane[hidden]), .app-shell.no-detail { grid-template-columns: 70px minmax(290px, 320px) minmax(0, 1fr); }
  .detail-pane { padding-inline: 19px; }
}

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 70px 320px minmax(0, 1fr); }
  .app-shell:has(.detail-pane[hidden]), .app-shell.no-detail { grid-template-columns: 70px 320px minmax(0, 1fr); }
  .detail-pane { display: none; }
  .detail-pane.is-open { display: flex; position: fixed; top: 0; right: 0; bottom: 0; width: min(345px, 90vw); box-shadow: -15px 0 45px rgba(12,43,27,.12); z-index: 12; }
}

@media (max-width: 800px) {
  .app-shell, .app-shell:has(.detail-pane[hidden]), .app-shell.no-detail { grid-template-columns: 64px minmax(260px, 310px) minmax(0, 1fr); }
  .rail { padding-inline: 7px; }
  .rail-action.active::before, .rail-action[aria-current="page"]::before { left: -7px; }
  .people-header { padding-inline: 16px; }
  .filter-row { padding-inline: 16px; }
  .main-content { padding: 25px 20px; }
  .hero-card { padding: 28px; }
}

@media (max-width: 680px) {
  html, body { height: 100%; }
  .app-shell, .app-shell:has(.detail-pane[hidden]), .app-shell.no-detail { display: block; min-height: 0; height: 100dvh; }
  .rail { display: none; }
  .people-pane { width: 100%; height: 100%; border-right: 0; }
  .people-header { padding: 23px 19px 16px; }
  .people-header h1, .people-header h2, .pane-title { font-size: 28px; }
  .people-header .search-wrap { margin-top: 20px; }
  .filter-row { padding: 0 19px 14px; }
  .people-list { padding-inline: 9px; }
  .person-item { min-height: 80px; padding-inline: 12px; }
  .people-footer { padding: 12px 19px; }
  .main-pane { display: none; width: 100%; height: 100%; }
  .app-shell.mobile-open .people-pane { display: none; }
  .app-shell.mobile-open .main-pane { display: flex; }
  .mobile-back { display: grid; }
  .mobile-only { display: initial !important; }
  .main-header { min-height: 65px; padding: 9px 15px; }
  .main-header .avatar { width: 39px; height: 39px; border-radius: 13px; }
  .main-header-left, .main-header-person { gap: 8px; }
  .main-content { padding: 23px 17px 30px; }
  .hero-card { padding: 27px 24px; border-radius: 20px; }
  .hero-card h1, .hero-card h2 { font-size: 28px; }
  .section-card { padding: 20px; }
  .split-row { grid-template-columns: 1fr; }
  .message-row { max-width: 88%; }
  .detail-pane.is-open { width: 100%; z-index: 12; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.small, .modal.large { width: 100%; max-height: 93dvh; border-radius: 22px 22px 0 0; }
  .modal-header { padding: 25px 21px 18px; }
  .modal-body { padding: 20px 21px; }
  .modal-footer { padding: 17px 21px 23px; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

@media (max-width: 390px) {
  .main-header-actions .button span { display: none; }
  .main-header-actions .button { width: 35px; padding-inline: 0; }
  .hero-card h1, .hero-card h2 { font-size: 25px; }
  .action-card { padding: 18px; gap: 12px; }
  .action-icon { width: 34px; height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Emvona app's live structure. These rules keep the rhythm consistent as views change. */
.app-shell:not(.with-detail) { grid-template-columns: 74px minmax(300px, 350px) minmax(0, 1fr); }
.brand { overflow: visible; }
.brand-mark { display: inline-flex; align-items: baseline; position: relative; font: 800 22px/1 var(--display); letter-spacing: -.075em; }
.brand-mark > span { width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: #d6eebc; }
.brand-word, .rail-action > span, .rail-private > span { display: none; }
.rail-bottom { display: grid; place-items: center; margin-top: auto; width: 100%; }
.rail-private { display: grid; place-items: center; width: 38px; height: 38px; color: #87a797; }
.rail-private svg { stroke-width: 1.8; }

.people-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-bottom: 10px; }
.people-header .eyebrow { margin-bottom: 5px; }
.people-header .add-button { width: 38px; height: 38px; border-color: #d9e9db; background: #f0f8f0; color: var(--green); }
@media (hover: hover) and (pointer: fine){.people-header .add-button:hover { background: #e7f3e9; }}
.people-pane > .search-wrap { margin: 12px 20px 18px; }
.search-wrap kbd { position: absolute; right: 10px; padding: 3px 6px; border: 1px solid #e3e9e1; border-radius: 5px; background: white; color: #a0aea3; font: 600 10px/1 var(--font); }
.people-pane > .search-wrap input { padding-right: 54px; }
.list-heading { display: flex; justify-content: space-between; gap: 10px; padding: 12px 24px 9px; color: #8ca096; font: 800 10px/1.2 var(--display); letter-spacing: .1em; }
.list-heading > :last-child { letter-spacing: 0; font-size: 11px; }
.sample-banner { display: flex; align-items: flex-start; gap: 10px; margin: 2px 16px 10px; padding: 11px 13px; border: 1px solid #e3e9df; border-radius: 11px; background: #f8faf5; }
.sample-banner .status-dot { position: static; flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border: 0; background: #85b894; }
.sample-banner strong { display: block; margin-bottom: 2px; color: #4d6f58; font-size: 11px; }
.sample-banner p { margin: 0; color: #809186; font-size: 10px; line-height: 1.4; }
.people-footer .import-button { width: 100%; min-height: 39px; }
.people-footer p { margin: 8px 2px 0; color: #97a89a; font-size: 10px; line-height: 1.4; text-align: center; }
.list-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 42px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.list-empty strong { color: var(--ink); font-size: 12px; }

.avatar.small, .main-header .avatar.small { width: 42px; height: 42px; border-radius: 14px; }
.avatar.large { width: 70px; height: 70px; border-radius: 23px; font-size: 22px; }
.avatar.guessed { background: #f3e8d8; color: #a47451; }
.person-meta, .person-top, .person-bottom { display: block; }
.person-top, .person-bottom { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.person-name { display: block; min-width: 0; flex: 1; }
.person-date { flex: 0 0 auto; color: #a4b0a7; font-size: 10px; }
.person-preview { display: block; width: 100%; margin-top: 4px; }
.person-bottom { margin-top: 5px; }
.person-bottom .person-cue { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-pin { display: inline-flex; color: #90a795; transform: rotate(30deg); }
.person-pin svg { width: 12px; height: 12px; }

.main-person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.main-person > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.main-person strong { overflow: hidden; color: var(--ink); font: 800 14px/1.3 var(--display); text-overflow: ellipsis; white-space: nowrap; }
.main-person small { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.main-content > * { width: min(100%, 800px); margin-right: auto; margin-left: auto; }
.main-content > * + * { margin-top: 16px; }
.demo-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 3px 1px 2px; color: #90a39a; font: 800 10px/1.3 var(--display); letter-spacing: .09em; }
.demo-note .text-link { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; letter-spacing: 0; }
.demo-note .text-link svg { width: 13px; height: 13px; }
.hero-card { min-height: 184px; }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #4d8b66; font: 800 10px/1.3 var(--display); letter-spacing: .13em; }
.sparkle-mark { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1px solid #c9e1ca; border-radius: 9px; background: #def0df; color: #4c9b6d; }
.hero-kicker svg { width: 15px; height: 15px; }
.hero-card h2 { max-width: 640px; margin: 13px 0 27px; }
.hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #87a08b; font-size: 10px; }
.hero-foot .confidence-label { gap: 6px; color: #3f7f5b; font-size: 10px; }
.hero-foot .confidence-label.guess { color: #9f765d; }
.hero-foot .confidence-label::before { display: none; }
.hero-foot .status-dot { position: static; display: inline-block; width: 7px; height: 7px; border: 0; background: #7eb58f; }
.hero-foot .guess .status-dot { background: #d5a27e; }

.content-pair { display: grid; grid-template-columns: 1.12fr .88fr; gap: 14px; align-items: stretch; }
.content-pair > * { min-width: 0; }
.content-pair .section-card { margin: 0; }
.content-pair .insight-card, .content-pair .action-card { min-height: 207px; padding: 23px 24px; }
.content-pair .insight-card::before { top: 23px; bottom: 23px; }
.content-pair .insight-card .eyebrow, .content-pair .action-card .eyebrow { margin-bottom: 8px; font-size: 9px; }
.content-pair .insight-card h3, .content-pair .action-card h3 { margin: 0 0 10px; font: 800 16px/1.3 var(--display); letter-spacing: -.035em; }
.content-pair .insight-card blockquote { margin: 0; padding: 0; border: 0; background: none; color: #4e6655; font: 500 14px/1.5 'Newsreader', Georgia, serif; }
.card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; margin-top: 17px; color: #93a396; font-size: 10px; }
.card-foot .text-link { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; }
.card-foot svg { width: 13px; height: 13px; }
.content-pair .action-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0; background: #fff8f2; border-color: #f0dfd5; }
.content-pair .action-card .eyebrow { color: #b27a5e; }
.content-pair .action-card p { color: #826c60; font-size: 12px; }
.content-pair .action-card .button { margin-top: auto; padding-left: 0; }
.change-note { display: flex; align-items: stretch; gap: 15px; padding: 8px 2px; }
.change-line { display: block; flex: 0 0 auto; width: 2px; min-height: 44px; border-radius: 2px; background: #c8dfcb; }
.change-note .eyebrow { color: #8dac93; font-size: 9px; }
.change-note p { margin: 3px 0 0; color: #68816f; font-size: 11px; line-height: 1.55; }
.change-note strong { color: #416752; }

.composer.section-card { padding: 21px 22px 12px; }
.composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.composer-heading .eyebrow { margin-bottom: 5px; color: #7ca487; font-size: 9px; }
.composer-heading h3 { margin: 0; font: 800 16px/1.3 var(--display); letter-spacing: -.035em; }
.composer-heading .source-note { flex: 0 0 auto; }
.composer-input { min-height: 65px; margin: 10px 0; padding: 6px 0; }
.composer-input:focus-visible { outline: 0; }
.composer-actions { padding-top: 10px; }
.composer-actions > div:last-child { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.draft-feedback { max-width: 400px; color: #6a8b74; font-size: 10px; line-height: 1.4; }
.draft-feedback:empty::before { content: 'A gentle first line is enough.'; color: #a1aea1; }
.message-section { padding: 6px 0 15px; }
.message-section .section-heading { margin: 9px 0 17px; }
.message-section .section-heading .eyebrow { margin-bottom: 6px; font-size: 9px; }
.message-section .section-heading > span { color: #99a99d; font-size: 10px; }
.message-list { gap: 13px; }
.message-row { flex-direction: row; align-items: flex-end; gap: 9px; max-width: 88%; }
.message-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 9px; background: #e0ebdf; color: #6b9576; font: 800 9px/1 var(--display); }
.message-bubble { border-radius: 15px 15px 15px 4px; }
.message-bubble p { margin: 0; color: #496151; }
.message-bubble small { display: block; margin-top: 6px; color: #9daa9e; font-size: 9px; }
.message-note { display: block; margin-top: 16px; color: #a2afa2; }

.detail-header .eyebrow { max-width: 190px; font-size: 9px; line-height: 1.45; }
.detail-profile { padding: 24px 0 26px; border-bottom: 1px solid var(--line); }
.detail-profile h2 { margin: 0; font: 800 19px/1.25 var(--display); letter-spacing: -.04em; }
.detail-profile p { margin-top: 5px; color: #8a9b8e; font-size: 11px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.detail-section-head h3 { margin: 0; }
.detail-section-head span { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 7px; background: #edf4ec; color: #6e987a; font-size: 10px; font-weight: 800; }
.memory-entry { display: flex; gap: 0; }
.memory-entry .memory-dot { display: none; }
.memory-entry small { display: block; margin-bottom: 4px; color: #9aa99c; font-size: 9px; }
.memory-entry strong { display: block; margin-bottom: 2px; color: #3e6751; font-size: 11px; }
.memory-entry p { overflow-wrap: anywhere; }
.empty-memory { color: #9aaa9d; font-size: 11px; }
.detail-copy { margin-bottom: 16px !important; }
.detail-pane .field-label { display: block; margin-bottom: 7px; font-size: 10px; }
.detail-pane select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #dde8dc; border-radius: 9px; background: #f9fbf8; color: #4d6755; font-size: 11px; }
.detail-actions { padding: 22px 0; border-bottom: 1px solid var(--line); }
.detail-actions .text-link { display: inline-flex; align-items: center; gap: 7px; width: fit-content; min-height: 25px; }
.detail-actions svg { width: 14px; height: 14px; }
.danger-link { color: #b87062; }
.detail-pane > .privacy-note { padding-top: 19px; color: #8da193; }

.page-view .main-header { justify-content: flex-start; min-height: 123px; }
.page-header-inner .eyebrow { display: block; margin-bottom: 6px; font-size: 9px; }
.page-header-inner h1 { margin: 0; font: 800 22px/1.25 var(--display); letter-spacing: -.045em; }
.page-header-inner p { margin: 4px 0 0; color: #809186; font-size: 11px; }
.page-view .main-content { padding-top: 31px; }
.memory-page-content > *, .privacy-content > * { width: min(100%, 720px); }
.memory-story-list { display: flex; flex-direction: column; gap: 10px; }
.memory-story { display: flex; align-items: center; gap: 13px; width: 100%; padding: 17px 19px; color: inherit; text-align: left; transition: transform .17s var(--ease-out), border-color .17s var(--ease-out); }
@media (hover: hover) and (pointer: fine){.memory-story:hover { transform: translateY(-1px); border-color: #c8dfcd; }}
.memory-story > span:nth-child(2) { display: block; min-width: 0; flex: 1; }
.memory-story-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.memory-story-top strong { font-size: 12px; }
.memory-story-top small { color: #a0ada1; font-size: 10px; }
.memory-story-feeling { display: block; margin-top: 2px; color: var(--green); font-size: 10px; font-weight: 700; }
.memory-story-quote { display: block; overflow: hidden; max-width: 100%; margin-top: 7px; color: #667d6b; font: 500 13px/1.45 'Newsreader', Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.memory-story > svg { flex: 0 0 auto; color: #a2b2a4; }
.privacy-hero { display: flex; align-items: flex-start; gap: 17px; background: #ecf5ec; border-color: #d9e9da; }
.privacy-hero-icon { display: grid; place-items: center; flex: 0 0 auto; width: 45px; height: 45px; border-radius: 14px; background: #dceede; color: #4f9a65; }
.privacy-hero h2 { margin: 0 0 6px; font: 800 17px/1.3 var(--display); letter-spacing: -.035em; }
.privacy-hero p { margin: 0; color: #66806d; font-size: 11px; line-height: 1.65; }
.settings-card { margin-top: 14px; }
.settings-row { padding-block: 3px 16px; }
.settings-row + .settings-row { padding-top: 16px; }
.settings-row h3 { margin: 0 0 4px; font: 800 12px/1.3 var(--display); }
.settings-row p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.button-danger { border-color: #edcfca; background: #fff6f3; color: #a4564d; }
@media (hover: hover) and (pointer: fine){.button-danger:hover { border-color: #e3b7af; background: #fff0ec; box-shadow: none; }}
.settings-card .section-heading { margin: 0 0 13px; }
.source-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.source-row > span { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 31px; border-radius: 9px; background: #f0f5ee; color: #74a37f; }
.source-row > div { display: flex; flex-direction: column; gap: 3px; }
.source-row strong { font-size: 11px; }
.source-row small, .no-sources { color: #9bab9c; font-size: 10px; }
.no-sources { margin: 8px 0 0 !important; }

.modal-header { align-items: center; padding: 20px 24px 14px; }
.modal-header .eyebrow { margin: 0; font-size: 9px; }
.modal-body { padding: 19px 26px 24px; }
.modal-body > h2 { margin: 0 0 8px; font: 800 23px/1.2 var(--display); letter-spacing: -.045em; }
.modal-body > p { margin: 0 0 21px; color: #718578; font-size: 12px; line-height: 1.6; }
.modal form { display: flex; flex-direction: column; }
.modal .field-label { display: block; margin: 0 0 7px; font-size: 11px; }
.modal .field-label:not(:first-child) { margin-top: 17px; }
.modal input.field, .modal textarea.field, .modal select.field { display: block; width: 100%; min-height: 43px; margin: 0; padding: 10px 12px; border: 1px solid #dce7dc; border-radius: 11px; outline: 0; background: #fbfcfa; color: var(--ink); font-size: 12px; line-height: 1.5; }
.modal textarea.field { min-height: 95px; resize: vertical; }
.modal textarea.chat-field { min-height: 155px; }
.modal input.field:focus, .modal textarea.field:focus, .modal select.field:focus { border-color: #9bcbaa; box-shadow: 0 0 0 3px rgba(8,119,95,.09); }
.modal .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 17px 0 0; border-top: 1px solid var(--line); }
.modal .modal-footer > span { display: inline-flex; align-items: center; gap: 6px; color: #97a89a; font-size: 10px; }
.import-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 9px; }
.file-picker { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid #d9e8da; border-radius: 9px; color: var(--green); font-size: 11px; font-weight: 800; cursor: pointer; }
@media (hover: hover) and (pointer: fine){.file-picker:hover { background: #f1f8f0; }}
.file-picker svg { width: 15px; height: 15px; }
.import-tools > span { overflow: hidden; color: #a0ada1; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.format-help { margin: 12px 0 3px; color: #93a397; font-size: 10px; line-height: 1.5; }
.format-help code { padding: 2px 5px; border-radius: 4px; background: #eff4ee; color: #5e8064; font: 10px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.toast { display: none; }
.toast.visible { display: flex; }

@media (max-width: 1420px) {
  .app-shell:not(.with-detail) { grid-template-columns: 70px minmax(290px, 320px) minmax(0, 1fr); }
}
@media (max-width: 1160px) {
  .app-shell:not(.with-detail), .app-shell.with-detail { grid-template-columns: 70px 320px minmax(0, 1fr); }
  .detail-pane.is-open { display: flex; }
  .content-pair { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .app-shell:not(.with-detail), .app-shell.with-detail { grid-template-columns: 64px minmax(260px, 310px) minmax(0, 1fr); }
  .people-pane > .search-wrap { margin-inline: 16px; }
  .content-pair { grid-template-columns: 1fr; }
  .content-pair .action-card { min-height: 170px; }
}
@media (max-width: 680px) {
  .app-shell:not(.with-detail), .app-shell.with-detail { display: block; }
  .rail { display: flex; flex-direction: row; justify-content: center; position: fixed; inset: auto 0 0; width: 100%; height: 68px; padding: 5px 10px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); border-right: 0; background: rgba(255,254,250,.97); backdrop-filter: blur(12px); box-shadow: 0 -7px 20px rgba(23,59,36,.05); z-index: 15; }
  .brand, .rail-bottom { display: none; }
  .rail-nav { display: flex; flex-direction: row; justify-content: space-around; align-items: stretch; gap: 1px; width: min(100%, 440px); height: 100%; }
  .rail-action { display: flex; flex-direction: column; justify-content: center; gap: 4px; flex: 1; width: auto; height: 100%; border-radius: 10px; }
  .rail-action svg { width: 19px; height: 19px; }
  .rail-action > span { display: block; font-size: 9px; font-weight: 700; line-height: 1; }
  .rail-action.active::before, .rail-action[aria-current="page"]::before { top: 0; bottom: auto; left: calc(50% - 12px); width: 24px; height: 2px; border-radius: 0 0 3px 3px; }
  .people-pane { padding-bottom: 68px; }
  .people-footer { flex: 0 0 auto; }
  .app-shell:has(.main-pane.page-view) .people-pane { display: none; }
  .app-shell:has(.main-pane.page-view) .main-pane { display: flex; }
  .main-pane { padding-bottom: 68px; }
  .main-content { padding: 21px 17px 35px; }
  .main-content > * { width: 100%; }
  .main-content > * + * { margin-top: 14px; }
  .demo-note { font-size: 9px; }
  .hero-card { min-height: 0; padding: 25px 23px; }
  .hero-card h2 { margin-bottom: 25px; }
  .hero-foot { align-items: flex-start; }
  .content-pair { grid-template-columns: 1fr; }
  .content-pair .insight-card, .content-pair .action-card { min-height: 0; padding: 21px; }
  .content-pair .action-card .button { margin-top: 13px; }
  .composer-heading { align-items: flex-start; }
  .composer-heading .source-note { font-size: 9px; text-align: right; }
  .composer-actions { align-items: flex-start; }
  .message-row { max-width: 100%; }
  .page-view .main-header { min-height: 112px; padding: 17px 19px; }
  .page-view .main-content { padding-top: 23px; }
  .detail-pane.is-open { bottom: 68px; width: 100%; }
  .modal-backdrop { padding-bottom: 0; z-index: 30; }
  .modal, .modal.small, .modal.large { max-height: 93dvh; }
  .modal-body { padding: 17px 20px 24px; }
  .modal-header { padding: 17px 20px 13px; }
  .modal-footer { flex-wrap: wrap; }
  .toast.visible { bottom: 78px; z-index: 25; }
}
@media (max-width: 390px) {
  .hero-card h2 { font-size: 25px; }
  .hero-foot { flex-wrap: wrap; }
  .composer-heading .source-note { max-width: 100px; }
  .composer-actions { flex-direction: column; align-items: stretch; }
  .composer-actions > div:last-child { justify-content: flex-end; }
  .privacy-hero { flex-direction: column; }
  .settings-row { align-items: flex-start; }
}

/* Readability pass: supporting information is still secondary, but never miniature. */
.people-pane .person-name { font-size: 14px; }
.people-pane .person-preview { font-size: 12px; line-height: 1.4; }
.people-pane .person-date { font-size: 11px; }
.people-pane .person-cue { font-size: 11px; line-height: 1.35; }
.people-pane .sample-banner strong { font-size: 12px; }
.people-pane .sample-banner p,
.people-pane .people-footer p { font-size: 11px; }
.people-pane .list-heading { font-size: 11px; }
.main-person small { font-size: 11px; }
.demo-note { font-size: 11px; }
.hero-kicker, .hero-foot, .hero-foot .confidence-label { font-size: 11px; }
.content-pair .insight-card .eyebrow,
.content-pair .action-card .eyebrow,
.composer-heading .eyebrow,
.message-section .section-heading .eyebrow { font-size: 10px; }
.content-pair .action-card p { font-size: 13px; }
.content-pair .insight-card blockquote { font-size: 15px; }
.card-foot, .card-foot .text-link { font-size: 11px; }
.change-note .eyebrow { font-size: 10px; }
.change-note p { font-size: 12px; }
.composer-heading .source-note, .draft-feedback,
.message-section .section-heading > span,
.message-note { font-size: 11px; }
.message-bubble { font-size: 13px; }
.message-bubble small { font-size: 10px; }
.detail-header .eyebrow { font-size: 10px; }
.detail-profile p, .detail-section p,
.memory-entry p, .detail-pane select { font-size: 12px; }
.detail-pane .field-label, .memory-entry small { font-size: 11px; }
.memory-entry strong { font-size: 12px; }
.detail-pane > .privacy-note { font-size: 11px; }
.page-header-inner p, .privacy-hero p,
.settings-row p { font-size: 12px; }
.memory-story-top small, .memory-story-feeling,
.source-row small, .no-sources { font-size: 11px; }
.modal-body > p { font-size: 13px; }
.modal .field-label, .modal input.field,
.modal textarea.field, .modal select.field { font-size: 12px; }
.modal .modal-footer > span,
.import-tools > span, .format-help { font-size: 11px; }

@media (max-width: 680px) {
  .rail-action > span { font-size: 11px; }
  .rail-action { gap: 5px; }
.main-header .main-person small { font-size: 11px; }

  .detail-pane .memory-entry p { font-size: 12px; }
  .composer-heading .source-note { font-size: 10px; }
  .demo-note { font-size: 10px; }
}

/* A readable explanation sits behind the everyday check-in flow. */
.moment-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 14px;
  border: 1px solid #e3ebe2;
  border-radius: 11px;
  background: #f8faf6;
  color: #54735e;
  font-size: 12px;
}
.moment-context > span, .moment-context button { display: inline-flex; align-items: center; gap: 6px; }
.moment-context > span svg { flex: 0 0 auto; color: #73a280; }
.moment-context button {
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}
@media (hover: hover) and (pointer: fine){.moment-context button:hover { text-decoration: underline; }}
.understanding-card { padding: 0; overflow: hidden; scroll-margin-top: 16px; }
.understanding-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 25px 20px;
  background: #fbfcf8;
}
.understanding-heading .eyebrow { display: block; margin-bottom: 6px; color: #7aa086; font-size: 10px; }
.understanding-heading h3 { margin: 0 0 5px; font: 800 18px/1.3 var(--display); letter-spacing: -.04em; }
.understanding-heading p { max-width: 520px; color: #71867a; font-size: 12px; }
.understanding-heading .text-link { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; margin-top: 12px; font-size: 11px; }
.understanding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.understanding-cell { min-width: 0; padding: 21px 24px 24px; }
.understanding-cell:nth-child(odd) { border-right: 1px solid var(--line); }
.understanding-cell:nth-child(n + 3) { border-top: 1px solid var(--line); }
.understanding-step { display: block; margin-bottom: 8px; color: #8fa89a; font: 800 10px/1.3 var(--display); letter-spacing: .1em; }
.understanding-cell h4 { margin: 0 0 8px; color: var(--ink); font: 800 15px/1.35 var(--display); }
.understanding-cell > p { color: #647d6c; font-size: 12px; line-height: 1.55; }
.understanding-basis { display: inline-flex; margin-bottom: 8px; padding: 4px 8px; border-radius: 999px; background: #eaf3e8; color: #4f865d; font-size: 10px; font-weight: 800; }
.understanding-cell blockquote, .understanding-list blockquote { margin: 8px 0 0; color: #526c5a; font: 500 13px/1.5 'Newsreader', Georgia, serif; overflow-wrap: anywhere; }
.understanding-cell > blockquote { padding-left: 10px; border-left: 2px solid #bfd8c3; }
.understanding-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.understanding-list li { padding-left: 10px; border-left: 2px solid #d7e6d8; }
.understanding-item-top { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; }
.understanding-item-top strong { color: #3f654d; font-size: 12px; }
.understanding-item-top span { padding: 2px 5px; border-radius: 4px; font-size: 9px; font-weight: 800; }
.understanding-item-top .message-source { background: #edf4ec; color: #6a9576; }
.understanding-item-top .note-source { background: #f7eee0; color: #a07b54; }
.understanding-list p { margin-top: 4px; color: #657f6d; font-size: 12px; line-height: 1.5; }
.understanding-empty { color: #87988c !important; font-size: 12px; line-height: 1.55; }
.understanding-risk { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.understanding-risk > strong { display: block; margin-bottom: 8px; color: #9b7461; font-size: 10px; }
.understanding-risk .understanding-list li { border-left-color: #ead8cb; }
.understanding-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbf8; }
.understanding-foot p { color: #798a7e; font-size: 12px; }
.understanding-foot .button { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 1080px) {
  .understanding-grid { grid-template-columns: minmax(0, 1fr); }
  .understanding-cell:nth-child(odd) { border-right: 0; }
  .understanding-cell + .understanding-cell { border-top: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .understanding-heading { flex-direction: column; gap: 5px; padding: 20px; }
  .understanding-heading .text-link { margin-top: 0; }
  .understanding-cell { padding: 18px 20px; }
  .understanding-foot { align-items: flex-start; flex-direction: column; padding: 17px 20px; }
  .moment-context { font-size: 12px; }
}
