/* LyvvOut Connect Portal styles */
:root {
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --surface-2: #FAF7F2;
  --line: #ECE5DC;
  --line-strong: #DDD3C6;
  --ink: #23211F;
  --muted: #5A544E;
  --faint: #8A837A;
  --terra: #A85339;
  --terra-dark: #8E4430;
  --terra-soft: #FAF0EB;
  --sage: #4E6B56;
  --teal: #0B4F6C;
  --copper: #C8823F;
  --danger: #B91C1C;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(45, 35, 25, .04);
  --shadow-hover: 0 10px 28px -8px rgba(45, 35, 25, .18);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --sidebar: 264px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); }
a { color: var(--terra); }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); margin: 0; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 600; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid rgba(168, 83, 57, .35); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.spacer { height: 24px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px;
  font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--terra-dark); }
/* Secondary: white with terracotta border, terracotta fill on hover */
.btn-secondary { background: var(--surface); color: var(--terra); border-color: var(--terra); }
.btn-secondary:hover:not(:disabled) { background: var(--terra); color: #fff; }
.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #E7B4B4; }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--terra); cursor: pointer; padding: 0; font-weight: 600; font-size: 13px; }
.link { color: var(--terra); font-weight: 600; text-decoration: none; font-size: 14px; }
.link.center { display: block; text-align: center; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; flex: none; }
.brand-name { font: 600 17px/1.2 var(--serif); color: var(--teal); }
.brand-role { font-size: 12px; color: var(--muted); }
.close-btn { display: none; margin-left: auto; background: none; border: 0; font-size: 28px; line-height: 1; color: var(--muted); cursor: pointer; }
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: block; padding: 10px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--terra-soft); color: var(--terra); font-weight: 600; }
.nav-item.small { font-size: 13px; padding: 8px 12px; }
.nav-section { display: block; padding: 14px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.nav-bottom { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.nav-item.support { border: 1px solid var(--line); text-align: center; }
.nav-user { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; gap: 8px; }
.main { margin-left: var(--sidebar); padding: 36px 40px 64px; max-width: calc(1200px + var(--sidebar)); outline: none; }
.topbar { display: none; }
.scrim { display: none; }
.preview-banner { position: sticky; top: 0; z-index: 60; background: #2F5785; color: #fff; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 20px; font-size: 14px; flex-wrap: wrap; }
.demo-banner { background: #FFF4D6; color: #6B5114; text-align: center; font-size: 13px; padding: 6px; font-weight: 600; }
.demo-banner a { color: inherit; text-decoration: underline; margin-left: 4px; }

@media (max-width: 1023px) {
  .topbar { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; height: 60px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .menu-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: grid; place-content: center; gap: 4px; cursor: pointer; }
  .menu-btn span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }
  .brand-mini { font: 600 18px var(--serif); color: var(--teal); text-decoration: none; display: flex; align-items: center; gap: 8px; }
  .brand-mini img { width: 30px; height: 30px; object-fit: contain; }
  .topbar-support { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--terra); text-decoration: none; border: 1px solid var(--terra); border-radius: 999px; padding: 6px 12px; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: none; width: min(86vw, 300px); }
  .menu-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .18); }
  .menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(35, 33, 31, .35); z-index: 35; }
  .close-btn { display: block; }
  .main { margin-left: 0; padding: 24px 24px 56px; }
}
@media (max-width: 599px) {
  .main { padding: 20px 16px 48px; }
  h1 { font-size: 25px; }
}

/* ---------- Page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header.detail { align-items: flex-start; }
.page-header .badges { margin-top: 10px; }
.eyebrow { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); font-weight: 600; margin-bottom: 6px; }
.page-desc { color: var(--muted); margin-top: 8px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; }
.back-link:hover { color: var(--terra); }
.section-title { margin: 8px 0 14px; font-size: 18px; }

/* ---------- Toolbar & chips ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar-row:empty { display: none; }
.chip-group { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.chip-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-width: 84px; }
.list-stats { display: flex; flex-direction: column; gap: 16px; margin-bottom: 18px; }
.list-stats .stats { margin-bottom: 0; }
.input { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.input:focus { border-color: var(--terra); outline: 3px solid rgba(168, 83, 57, .15); }
textarea.input { resize: vertical; min-height: 110px; }
.input.search { max-width: 360px; flex: 1 1 240px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--terra); color: var(--terra); }
.chip.active { background: var(--terra); border-color: var(--terra); color: #fff; }
.list-count { margin: 10px 0 12px; }

/* ---------- Record cards (approved format) ---------- */
.record-list { display: flex; flex-direction: column; gap: 14px; }
.record-list.compact { gap: 10px; }
.record { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow); min-width: 0; transition: box-shadow .2s, transform .2s, border-color .2s; }
.record.is-link { cursor: pointer; }
.record.is-link:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: var(--line-strong); }
.record-mark { flex: 0 0 6px; border-radius: 999px; background: var(--mark); }
.record-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.record-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.record-title { font-size: 18px; overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--bfg); background: var(--bbg); white-space: nowrap; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field-label { font-size: 12px; color: var(--faint); }
.field-value { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.record-summary { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.record-cta { color: var(--terra); font-weight: 600; font-size: 14px; }
.record-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.record-list.compact .record { padding: 14px 16px; }
.panel .record { box-shadow: none; }
@media (max-width: 1100px) { .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .record { padding: 16px; gap: 12px; } }

/* ---------- Panels, stats, charts ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; min-width: 0; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.panel .fields { margin-bottom: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .stats, .stats.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .stats, .stats.n3, .stats.n4 { grid-template-columns: 1fr; } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'icon value' 'icon label' 'icon hint'; column-gap: 14px; align-content: start; min-height: 112px; text-decoration: none; color: inherit; }
.stat-icon { grid-area: icon; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--terra-soft); color: var(--terra); }
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.teal { background: #E4EEF2; color: var(--teal); }
.stat-icon.sage { background: #E8F0EA; color: var(--sage); }
.stat-icon.gold { background: #F6EEDF; color: #8A6424; }
.stat-value { grid-area: value; }
.stat-label { grid-area: label; }
.stat-hint { grid-area: hint; }
.stat.is-link:hover { border-color: var(--terra); box-shadow: var(--shadow-hover); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font: 600 30px/1.1 var(--serif); color: var(--ink); }
.stat-hint { font-size: 12px; color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2 > .panel { margin-bottom: 18px; }
@media (max-width: 899px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }
.donut-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex: none; }
.donut-total { font: 600 30px var(--serif); fill: var(--ink); }
.donut-label { font-size: 12px; fill: var(--muted); }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 160px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.legend li strong { margin-left: auto; }
.legend.inline { flex-direction: row; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.legend.inline li strong { margin: 0; }
.dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 190px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-stack { flex: 1; width: 100%; max-width: 40px; display: flex; flex-direction: column-reverse; justify-content: flex-start; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.bar { display: block; width: 100%; }
.bar.in { background: #C86D51; }
.bar.out { background: #7E9A86; }
.bar-total { font-size: 13px; font-weight: 600; }
.bar-day { font-size: 12px; color: var(--muted); }
.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.topics li { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 32px; align-items: center; gap: 12px; font-size: 14px; }
.topic-bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.topic-bar span { display: block; height: 100%; background: var(--terra); border-radius: 99px; }
.topics strong { text-align: right; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 10px; border-radius: 99px; font-size: 13px; color: var(--muted); }
.prose { color: var(--ink); max-width: 760px; }

/* ---------- States ---------- */
.empty { padding: 28px 20px; text-align: center; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--line); border-top-color: var(--terra); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: #FDF2F2; border: 1px solid #F3C9C9; color: #7F1D1D; }
.alert-box { padding: 14px 18px; border-radius: var(--radius); background: #FDECEC; border: 1px solid #F2B8B8; color: #7F1D1D; margin-bottom: 18px; }
.notice { padding: 14px 18px; border-radius: var(--radius); background: #EEF3F8; border: 1px solid #CDDBEA; color: #23405F; margin-bottom: 18px; }
.form-error { color: var(--danger); font-size: 14px; font-weight: 500; }
.hint { color: var(--faint); font-size: 13px; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form.narrow { max-width: 560px; }
.label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.label.inline { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--muted); }
.label.inline .input { min-width: 200px; }
.row-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.row-actions.start { justify-content: flex-start; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 10px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--terra); }

/* Toggle rows */
.toggles { display: flex; flex-direction: column; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle-row:first-child { border-top: 0; }
.toggle-row > span:first-child { display: flex; flex-direction: column; }
.toggle-pair { display: flex; gap: 16px; }
.toggle-pair label { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch:checked { background: var(--sage); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }
.memberships { display: flex; flex-direction: column; }
.membership { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.membership:first-child { border-top: 0; }

/* ---------- Support ---------- */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 26px; }
.ticket-card { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: inherit; min-height: 180px; transition: box-shadow .2s, transform .2s; }
.ticket-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.ticket-card h3 { font-size: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-card .record-cta { margin-top: auto; }
.ticket-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ticket-date { font-size: 13px; color: var(--faint); }
.unread-dot { font-size: 12px; font-weight: 700; color: var(--terra); }
.thread { display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow-y: auto; }
.bubble-row { display: flex; gap: 10px; align-items: flex-start; }
.bubble-row.mine { flex-direction: row-reverse; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.bubble { max-width: min(640px, 80%); background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.mine .bubble { background: var(--terra-soft); border-color: #F0D9CF; }
.bubble-meta { display: flex; gap: 10px; font-size: 12px; color: var(--faint); margin-bottom: 4px; flex-wrap: wrap; }
.bubble-meta strong { color: var(--ink); }
.attachment { margin-top: 8px; font-size: 13px; }

/* ---------- Auth pages ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 32px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px -20px rgba(45,35,25,.18); }
.auth-card.wide { max-width: 720px; }
.auth-card h1 { font-size: 26px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 4px; }
.auth-brand img { width: 150px; height: auto; }
.demo-pick { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.agreement { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.agreement h2 { font-size: 17px; margin-bottom: 8px; }
.agreement-text { max-height: 260px; overflow-y: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; font-size: 14px; }
@media (max-width: 480px) { .auth-card { padding: 24px 18px; } }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 500;
  z-index: 100; transition: transform .25s, visibility .25s; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.2); visibility: hidden; }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#toast.tone-red { background: #8E1F1F; }
#toast.tone-gold { background: #6B5114; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Column chart (topics) */
.cols { display: flex; align-items: flex-end; gap: 12px; height: 220px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.col-bar { width: 100%; max-width: 54px; border-radius: 8px 8px 0 0; background: var(--c); min-height: 4px; }
.col-val { font-size: 13px; font-weight: 600; }
.col-labels { display: flex; gap: 12px; margin-top: 8px; }
.col-labels span { flex: 1; min-width: 0; text-align: center; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.3; }
.workspace-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.workspace-tag .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2E8B57; }
.workspace-tag.demo .live-dot { background: var(--copper); }
.tagline { color: var(--muted); margin-top: 6px; }
.roles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.role-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface-2); }
.role-card h3 { font-size: 16px; margin-bottom: 6px; }
.role-card p { font-size: 14px; color: var(--muted); }
@media (max-width: 760px) { .roles-grid { grid-template-columns: 1fr; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
.fixed-role { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; color: var(--teal); }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.fieldset legend { font-size: 14px; font-weight: 600; padding: 0 6px; }

/* Conversation Topics (horizontal bars) */
.topics-card .panel-head { align-items: flex-start; }
.topics-card .panel-head p { margin: 4px 0 0; }
.pill { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.topic-bars { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.topic-bars li { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 72px; align-items: center; gap: 14px; font-size: 14px; }
.topic-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-track { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.topic-track span { display: block; height: 100%; background: var(--c); border-radius: 99px; }
.topic-n { font-weight: 700; font-size: 13px; text-align: right; white-space: nowrap; }
.topics-note { display: flex; gap: 10px; align-items: center; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.topics-note svg { width: 18px; height: 18px; flex: none; color: var(--teal); }
@media (max-width: 560px) { .topic-bars li { grid-template-columns: 1fr 64px; } .topic-track { grid-column: 1 / -1; grid-row: 2; } }

.three-col { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .three-col { grid-template-columns: 1fr 1fr; } .three-col > :first-child { grid-column: 1 / -1; } }
.col-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.row-actions.start { justify-content: flex-start; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--line-strong); border-radius: 14px; background: var(--surface-2); cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--teal); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dz-title { font-weight: 700; color: var(--teal); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr.bad td { background: #FDF3EF; }
.bad-text { color: #B4432A; font-weight: 600; } .ok-text { color: var(--sage, #4E6B56); font-weight: 600; }
.label.inline-select { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; } .inline-select span { font-size: 13px; font-weight: 600; color: var(--muted); }
.inline-select .input { min-width: 180px; }
#review .row-actions { margin-top: 16px; } .data-table td.nowrap { white-space: nowrap; }

.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.agreement-upload { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.agreement-upload h3 { margin: 0 0 4px; font-size: 16px; }
.agreement-upload .fieldset .check { display: inline-flex; margin-right: 16px; }

/* Sensitive content */
.tracker { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; counter-reset: s; }
.tracker li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.tracker li::before { content: ''; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0; }
.tracker li:first-child::before { display: none; }
.tracker .dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tracker li.done .dot { background: var(--sage, #4E6B56); border-color: var(--sage, #4E6B56); }
.tracker li.done::before, .tracker li.now::before { background: var(--sage, #4E6B56); }
.tracker li.now .dot { border-color: var(--copper, #C8823F); box-shadow: 0 0 0 4px rgba(200,130,63,.18); }
.tracker li.now, .tracker li.done { color: var(--ink); font-weight: 600; }
.tracker li.stop .dot { background: #DC2626; border-color: #DC2626; } .tracker li.stop { color: #B4232A; font-weight: 600; }
@media (max-width: 640px) { .tracker { grid-template-columns: 1fr; } .tracker li { flex-direction: row; text-align: left; } .tracker li::before { display: none; } }
.ack-box { border: 1px solid var(--line-strong); border-left: 4px solid var(--teal); border-radius: 12px; padding: 18px; background: var(--surface-2); }
.ack-box h3 { margin: 0 0 8px; font-size: 16px; }
.ack-box p { margin: 0 0 8px; line-height: 1.6; }
.secure-view { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.secure-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--teal); color: #fff; font-weight: 600; }
.secure-head .muted { color: rgba(255,255,255,.85); }
.secure-body { position: relative; padding: 18px; min-height: 120px; background: var(--surface); }
.secure-body::after { content: attr(data-watermark); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform: rotate(-18deg); font-size: 22px; font-weight: 700; color: rgba(11,79,108,.07); pointer-events: none; white-space: nowrap; overflow: hidden; }
.secure-body audio { width: 100%; }
.secure-view > p { padding: 0 16px 12px; }
.tx-line { margin: 0 0 10px; line-height: 1.6; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history li { padding-left: 14px; border-left: 2px solid var(--line-strong); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.inline-form .input { flex: 1 1 260px; }
.muted.block, .block { display: block; }
.agreement-upload .fieldset { display: flex; flex-wrap: wrap; gap: 4px 20px; } .agreement-upload .fieldset legend { width: 100%; } .panel .prose { margin-top: 12px; }

/* Task bell */
.main-top { margin-left: var(--sidebar); max-width: 1200px; padding: 14px 40px 0; display: flex; justify-content: flex-end; }
.main-top + .main { padding-top: 4px; }
@media (max-width: 1024px) { .main-top { display: none; } .main-top + .main { padding-top: 24px; } }
.bell-anchor { position: relative; display: inline-flex; }
.bell { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--teal); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.bell:hover { border-color: var(--teal); }
.bell svg { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #DC2626; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.bell-count[hidden] { display: none; }
.topbar .bell-anchor { margin-left: 8px; } .topbar .bell { width: 36px; height: 36px; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 16px 40px rgba(31,27,23,.16); z-index: 60; padding: 8px; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bell-head a { color: var(--terra); text-decoration: none; font-weight: 600; }
.bell-item { display: flex; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14px; }
.bell-item:hover { background: var(--surface-2); }
.bell-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.bell-empty { padding: 12px 10px; margin: 0; }
.notice.warn { background: #FDF6EC; border-color: #EBD3AE; color: #6B4A1A; }
.notice.warn ul { margin: 6px 0; padding-left: 20px; }
.release-box p { margin: 0 0 10px; }
.inline-checks { display: flex; flex-wrap: wrap; gap: 4px 20px; } .inline-checks legend { width: 100%; }
.sched-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.sched-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sched-row.off { opacity: .6; }
.sched-row .row-actions { margin: 0; }
.sched-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.sched-form .hint { width: 100%; margin: 0; }
.day-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-pick span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.day-pick input:checked + span { background: var(--teal); border-color: var(--teal); color: #fff; }
.day-pick input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.demo-calls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border: 1px dashed var(--copper, #C8823F); background: color-mix(in srgb, var(--copper) 7%, var(--surface)); }
.demo-calls .row-actions { margin: 0; }
.live-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: -6px 0 14px; }
.live-note .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2F9E62; box-shadow: 0 0 0 4px rgba(47,158,98,.15); display: inline-block; }

/* Branded dialog */
.dlg-wrap { position: fixed; inset: 0; background: rgba(31,27,23,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.dlg { background: var(--surface); border-radius: 18px; padding: 24px; width: min(460px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.25); border-top: 5px solid var(--terra); }
.dlg h2 { margin: 0 0 8px; font-family: 'Playfair Display', Georgia, serif; font-size: 22px; }
.dlg p { margin: 0 0 14px; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.dlg .row-actions { margin-top: 16px; }
.toast-link { color: inherit; font-weight: 700; text-decoration: underline; margin-left: 6px; }
.btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.alert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
@media (max-width: 760px) { .alert-grid { grid-template-columns: 1fr; } }
ul.plain { margin: 8px 0 0; padding-left: 18px; line-height: 1.8; }
.esc-row { justify-content: space-between; margin-top: 8px; color: var(--ink); font-weight: 600; }
.esc-row .input { min-width: 150px; max-width: 170px; }
.sev-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sev-dot.critical { background: #DC2626; } .sev-dot.high { background: #C86D51; } .sev-dot.moderate { background: #B88D4E; } .sev-dot.low { background: #4E6B56; }

/* People controls */
.list-heading { font-family: 'Playfair Display', Georgia, serif; font-size: 22px; margin: 8px 0 12px; }
.pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; background: var(--surface); }
.pick input { accent-color: var(--teal); width: 16px; height: 16px; }
.btn-ghost-danger { background: transparent; border: 1px solid #E8B4A8; color: #B4432A; }
.btn-ghost-danger:hover { background: #FDF3EF; }
.bulk-bar { position: sticky; top: 8px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; background: var(--teal); color: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(11,79,108,.25); }
.bulk-bar .btn-secondary { background: var(--surface); }
.bulk-bar .btn-ghost-danger { background: var(--surface); }
.bulk-bar .link-btn { color: #fff; text-decoration: underline; margin-left: auto; }
.cap-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; }
@media (max-width: 900px) { .cap-groups { grid-template-columns: 1fr; } }
.cap-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 4px; }
.cap-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 16px; }
.doc-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.doc-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.doc-row > div:nth-child(2) { flex: 1; min-width: 0; }
.doc-row .row-actions { margin: 0; }
.doc-icon { flex: none; width: 42px; height: 42px; border-radius: 10px; background: #FDF3EF; color: var(--terra); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.needs-sign { color: #B4432A; font-weight: 700; }
.doc-upload { padding-top: 14px; border-top: 1px solid var(--line); }
.inline-check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 12px; }

/* ---------- Character ---------- */
.nav-item { display: flex; align-items: center; gap: 11px; border-left: 3px solid transparent; }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav-item.active { border-left-color: var(--terra); }
.nav-item.active svg { opacity: 1; }
.sidebar .brand { background: linear-gradient(135deg, var(--terra-soft), var(--surface) 70%); }
.panel > h2, .panel-head h2, .section-title { position: relative; padding-left: 14px; }
.panel > h2::before, .panel-head h2::before, .section-title::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: linear-gradient(var(--terra), var(--copper)); }
.stat { transition: transform .15s ease, box-shadow .15s ease; position: relative; overflow: hidden; }
.stat.is-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat::after { content: ''; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--terra-soft); opacity: .55; pointer-events: none; }
.record { transition: transform .15s ease, box-shadow .15s ease; }
.record.is-link:hover { transform: translateY(-1px); }
.home-hero { position: relative; overflow: hidden; border-radius: 20px; padding: 28px 30px; margin-bottom: 22px;
  background: radial-gradient(circle at 92% 20%, color-mix(in srgb, var(--copper) 22%, transparent), transparent 42%), linear-gradient(120deg, var(--terra-soft), var(--surface) 55%, color-mix(in srgb, var(--teal) 9%, var(--surface)));
  border: 1px solid var(--line); }
.home-hero::after { content: ''; position: absolute; right: 24px; bottom: -28px; width: 190px; height: 190px; background: url('/assets/logo-mark.png') center / contain no-repeat; opacity: .09; pointer-events: none; }
.home-hero .page-header { margin-bottom: 0; position: relative; z-index: 1; }
.home-hero h1 { font-size: 34px; }
.home-hero .tagline { font-style: italic; font-family: var(--serif); font-size: 17px; color: var(--muted); margin-top: 6px; }
@media (max-width: 600px) { .home-hero { padding: 20px; } .home-hero h1 { font-size: 27px; } .home-hero::after { width: 120px; height: 120px; } }

/* About page */
.about-hero { text-align: center; border-radius: 22px; padding: 44px 24px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 40%), linear-gradient(135deg, var(--teal), var(--terra)); }
.about-hero h1 { color: #fff; font-size: 36px; margin: 14px 0 10px; }
.about-hero p { max-width: 620px; margin: 0 auto 20px; font-size: 17px; opacity: .95; line-height: 1.6; }
.about-logo { height: 70px; background: #fff; border-radius: 16px; padding: 8px 14px; }
.btn-light { background: #fff; color: var(--teal); border: none; }
.about-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 12px; }
@media (max-width: 900px) { .about-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .about-steps { grid-template-columns: 1fr; } }
.about-step { background: var(--surface-2); border-radius: 14px; padding: 18px; border: 1px solid var(--line); }
.about-step h3 { font-size: 17px; margin: 10px 0 6px; }
.about-step p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.about-num { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; background: var(--terra); color: #fff; font-weight: 700; }
ul.checks { list-style: none; padding: 0; margin: 10px 0 0; } ul.checks li { padding: 6px 0 6px 26px; position: relative; }
ul.checks li::before { content: '✓'; position: absolute; left: 0; color: var(--sage); font-weight: 800; }
.notice-panel { border-left: 4px solid var(--terra); }
.about-contact { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }

/* ---------- Themes ---------- */
/* Family: switch between loved ones (can be in different communities). */
.loved-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.loved-strip-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
.loved-chip { display: grid; gap: 1px; text-align: left; font: inherit; cursor: pointer; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.loved-chip strong { font-size: 14px; font-weight: 600; }
.loved-chip span { font-size: 12px; color: var(--muted); }
.loved-chip:hover { border-color: var(--terra); }
.loved-chip.on { background: var(--terra-soft); border-color: var(--terra); }
.loved-chip:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; }
.retention-note { border-left: 3px solid var(--copper); }

:root[data-theme="ocean"] { --bg: #F1F6F8; --surface-2: #F5F9FB; --line: #DCE7EC; --line-strong: #C6D7DF; --terra: #0B6E8A; --terra-dark: #085870; --terra-soft: #E4F2F6; --teal: #123B5E; --copper: #3BA3B8; }
:root[data-theme="sage"] { --bg: #F2F5EF; --surface-2: #F7FAF4; --line: #DFE7DA; --line-strong: #CAD6C3; --terra: #4E7A5A; --terra-dark: #3E6248; --terra-soft: #EAF3EC; --teal: #2F5D50; --copper: #A3B86C; }
:root[data-theme="plum"] { --bg: #F8F3F7; --surface-2: #FBF7FA; --line: #EADFE8; --line-strong: #DCCBD9; --terra: #7A3E78; --terra-dark: #632F61; --terra-soft: #F5EAF4; --teal: #3E2F6B; --copper: #C07AA6; }
:root[data-theme="midnight"] { --bg: #13161B; --surface: #1C2028; --surface-2: #232834; --line: #2D3340; --line-strong: #3A4252; --ink: #EEF0F3; --muted: #AEB5C1; --faint: #7E8695;
  --terra: #E58C6E; --terra-dark: #CC7457; --terra-soft: #2C2421; --teal: #79BFDD; --copper: #E0A867; --sage: #8DB79A; color-scheme: dark; }
/* Obsidian: polished black glass with champagne gold and a soft violet sheen. */
:root[data-theme="obsidian"] { --bg: #0B0B0F; --surface: #15151B; --surface-2: #1C1C24; --line: #272731; --line-strong: #353541; --ink: #F3F1EC; --muted: #B4B0A8; --faint: #868279;
  --terra: #D4B47A; --terra-dark: #BC9A5E; --terra-soft: #262118; --teal: #B9B2EC; --copper: #E2C690; --sage: #9CC3A8; color-scheme: dark; }
:root[data-theme="obsidian"] .btn-primary, :root[data-theme="obsidian"] .btn-secondary:hover:not(:disabled), :root[data-theme="obsidian"] .chip.active,
:root[data-theme="obsidian"] .about-num, :root[data-theme="obsidian"] .nav-badge, :root[data-theme="obsidian"] .conv-unread { color: #17140E; }
:root[data-dark] .day-pick input:checked + span, :root[data-dark] .bulk-bar, :root[data-dark] .secure-head { color: #111318; }
:root[data-theme="obsidian"] .about-hero { background: radial-gradient(circle at 20% 10%, rgba(212,180,122,.22), transparent 45%), linear-gradient(135deg, #1C1C24, #2A2438); }
:root[data-theme="obsidian"] .btn-light { background: var(--terra); color: #17140E; }
:root[data-theme="obsidian"] .stat-icon.teal, :root[data-theme="obsidian"] .ag-n, :root[data-theme="obsidian"] .conv-avatar { background: #22202E; }
:root[data-dark] .input { background: var(--surface-2); color: var(--ink); }
:root[data-dark] .demo-banner { background: #3A3220; color: #F2DFA8; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.theme-opt { border: 2px solid var(--line); border-radius: 14px; padding: 12px; background: var(--surface); cursor: pointer; text-align: left; color: var(--ink); }
.theme-opt[aria-pressed="true"] { border-color: var(--terra); box-shadow: 0 0 0 3px var(--terra-soft); }
.theme-sw { display: flex; gap: 4px; margin-bottom: 8px; } .theme-sw span { flex: 1; height: 26px; border-radius: 6px; }
:root[data-dark] .stat-icon { background: var(--surface-2) !important; }
:root[data-dark] .toggle-row, :root[data-dark] .sched-row, :root[data-dark] .doc-row { background: var(--surface); }

/* Page guide */
.page-guide { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; margin: -6px 0 20px; border-radius: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--teal) 7%, var(--surface)), var(--surface)); border: 1px solid color-mix(in srgb, var(--teal) 18%, var(--line)); }
.pg-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--teal); border: 1px solid var(--line); }
.pg-icon svg { width: 20px; height: 20px; }
.pg-body { flex: 1; min-width: 0; }
.pg-body strong { font-family: var(--serif); font-size: 17px; font-weight: 600; display: block; margin-bottom: 2px; }
.pg-body p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.pg-close { flex: none; background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.pg-close:hover { color: var(--ink); border-color: var(--teal); }
.field-value.is-empty, .stat-value.is-empty { color: var(--faint); font-style: italic; font-weight: 400; }
.stat-value.is-empty { font-size: 18px; font-family: var(--serif); }
/* Notice cards (e.g. reviewer coverage) */
.care-note { display: flex; gap: 16px; padding: 18px 20px; border-radius: 16px; margin-bottom: 20px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--copper) 35%, var(--line)); box-shadow: inset 4px 0 0 var(--copper); }
.care-note .pg-icon { color: var(--copper); }
.care-note h3 { font-family: var(--serif); font-size: 17px; margin: 0 0 4px; }
.care-note p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.cov-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.cov-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.cov-chip b { font-weight: 600; }
.cov-chip .cov-n { color: var(--terra); font-weight: 700; }
.lo-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .lo-tiles { grid-template-columns: 1fr 1fr; } }
.lo-tile { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.lo-tile .stat-icon { flex: none; }
.lo-tile strong { font-size: 15px; }
.topic-bars.compact { gap: 10px; }
.topic-bars.compact li { grid-template-columns: minmax(120px, 170px) 1fr 32px; font-size: 13.5px; }
.topic-bars.compact .topic-track { height: 10px; }
.list-stats .grid-2 { margin-top: 0; }
/* "What they can do": one column of groups, each with an even two-column grid of switches */
.cap-groups { display: block; }
.cap-group { padding: 4px 0 10px; border-top: 1px solid var(--line); }
.cap-group:first-child { border-top: 0; }
.cap-group h3 { margin: 12px 0 8px; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
@media (max-width: 760px) { .cap-grid { grid-template-columns: 1fr; } }
.cap-grid .toggle-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0; background: var(--surface); min-height: 64px; align-items: center; }
.cap-grid .toggle-row + .toggle-row { border-top: 1px solid var(--line); }
.cap-grid .toggle-row:first-child { border-top: 1px solid var(--line); }
.ready-note { padding: 16px 18px; border-radius: 14px; margin-bottom: 14px; background: color-mix(in srgb, var(--sage) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sage) 30%, var(--line)); }
.ready-note h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 6px; }
.ready-note p { color: var(--muted); line-height: 1.55; margin: 0 0 4px; }
.ack-step2 { margin-top: 16px !important; }

/* Agreement documents (onboarding, copy and release) */
.agreement { border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 18px; background: var(--surface); box-shadow: 0 1px 2px rgba(35,33,31,.04); }
.agreement + .agreement { margin-top: 16px; }
.agreement h2 { font-size: 20px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.agreement h2 .muted { font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--copper); background: #FBF1E6; padding: 5px 9px; border-radius: 999px; }
.agreement-text { max-height: 340px; overflow-y: auto; background: #FCFAF7; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; font-size: 15px; scrollbar-width: thin; }
.agreement-text:focus { outline: 2px solid var(--teal); outline-offset: 2px; }
.ag-doc { color: var(--ink); }
.ag-doc a { color: var(--teal); font-weight: 600; text-underline-offset: 3px; }
.ag-lead { font: 400 17px/1.65 var(--serif); color: var(--ink); margin: 0 0 14px; }
.ag-p { margin: 12px 0 0; line-height: 1.7; color: var(--muted); }
.ag-label { font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--copper); margin: 18px 0 10px; }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ag-list li { position: relative; padding-left: 22px; line-height: 1.65; }
.ag-list li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); }
.ag-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ag-steps li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; line-height: 1.65; }
.ag-n { width: 28px; height: 28px; border-radius: 50%; background: #E4EEF2; color: var(--teal); font: 700 13px/28px var(--sans); text-align: center; }
.ag-steps strong { color: var(--ink); }
.ag-version { margin: 16px 0 0; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.agreement .check { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #F5F0EA; font-weight: 500; }
.agree-help { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.agree-help .support-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--teal); text-decoration: none; background: var(--surface); }
.agree-help .support-pill:hover { border-color: var(--teal); }
:root[data-dark] .agreement-text { background: rgba(255,255,255,.03); }
:root[data-dark] .agreement .check { background: rgba(255,255,255,.05); }
.demo-banner { display: flex; align-items: center; justify-content: center; gap: 10px 14px; flex-wrap: wrap; }
.demo-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.demo-view { border: 1px solid rgba(107,81,20,.35); background: transparent; color: inherit; border-radius: 999px; padding: 3px 10px; font: 600 12px/1.4 var(--sans); cursor: pointer; }
.demo-view.on { background: #6B5114; color: #FFF4D6; border-color: #6B5114; }
:root[data-dark] .demo-view.on { background: #F2DFA8; color: #3A3220; }
@media (min-width: 1024px) { .demo-banner { padding-left: calc(var(--sidebar) + 12px); } }
.ag-count { font: 700 11px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--copper); margin: 4px 0 8px; }
.ag-progress { display: flex; gap: 6px; margin-bottom: 16px; }
.ag-progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.ag-progress span.done { background: var(--teal); }
.ag-progress span.on { background: var(--copper); }
[data-ag-step] .row-actions { margin-top: 18px; }
.demo-fam { position: relative; display: inline-block; }
.demo-fam summary { list-style: none; display: inline-block; }
.demo-fam summary::-webkit-details-marker { display: none; }
.demo-fam-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 250px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; text-align: left; }
.demo-fam-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; color: var(--ink); font: 400 13px/1.35 var(--sans); }
.demo-fam-menu button:hover { background: var(--surface-2); }
.demo-fam-menu strong { display: block; font-weight: 600; }
.demo-fam-menu span { color: var(--muted); font-size: 12px; }
.nav-item.loved-one { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; }
.nav-item.loved-one.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* Messages */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--terra); color: #fff; font: 700 11px/20px var(--sans); text-align: center; }
.chip-row.tabs { margin: 0 0 18px; }
a.chip { text-decoration: none; display: inline-block; }
.messenger { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 520px; }
.conv-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px; overflow-y: auto; max-height: 70vh; }
.conv { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.conv:hover { background: var(--surface-2); }
.conv.active { background: #F5EDE3; }
.conv-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #E4EEF2; color: var(--teal); font: 700 15px/36px var(--serif); text-align: center; }
.conv-main { display: flex; flex-direction: column; min-width: 0; }
.conv-main strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.unread strong { color: var(--teal); }
.conv-unread { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; background: var(--terra); color: #fff; font: 700 11px/20px var(--sans); text-align: center; padding: 0 6px; }
.thread { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; min-width: 0; }
.thread-back { display: none; }
.thread-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.thread-head h2 { font-size: 20px; }
.thread-body { flex: 1; overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.thread-empty { margin: auto; }
.msg { max-width: 78%; background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 10px 14px; }
.msg.mine { align-self: flex-end; background: #E9F1F4; border-radius: 14px 14px 4px 14px; }
.msg.urgent { border: 1px solid #E7B3A3; background: #FDF1EC; }
.msg-meta { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.msg-body { line-height: 1.55; overflow-wrap: anywhere; }
.urgent-tag { font: 700 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: #C2410C; padding: 4px 7px; border-radius: 999px; }
.msg-ack { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.composer { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.composer-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice.small { font-size: 13px; padding: 10px 14px; }
@media (max-width: 860px) {
  .messenger { grid-template-columns: 1fr; }
  .messenger.has-thread .conv-list { display: none; }
  .messenger:not(.has-thread) .thread { display: none; }
  .thread-back { display: inline-block; }
}
/* Documents */
.pick-list { display: grid; gap: 4px; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick-row:hover { background: var(--surface-2); }
.doc-reader { max-height: 55vh; }
.sign-box { margin-top: 18px; display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.thread-body { min-height: 260px; }
@media (max-width: 860px) { .thread-body { max-height: 60vh; } }
.usage { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.usage-bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--teal); border-radius: 8px; }
.usage.near .usage-bar span { background: var(--copper); }
.usage.full .usage-bar span { background: #C2410C; }
.usage-note { color: #9A3412; margin: 8px 0 0; }
.usage-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.cov-list { display: grid; gap: 8px; }
.cov-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.cov-row b { font-weight: 600; min-width: 200px; }
.stat-value { font-size: 26px; }
.lock-bar { margin-top: 12px; }
[data-lock] .input:disabled { background: transparent; border-color: transparent; padding-left: 0; color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); cursor: default; }
[data-lock] select.input:disabled { appearance: none; -webkit-appearance: none; background-image: none; }
[data-lock].is-editing .input { background: var(--surface); }

/* ===================== Warmth pass (Oct 2026) =====================
   Same palette, more life: a soft glow behind the page, banners that carry the
   LyvvOut Connect name and the phone-wave motif from the logo, tone-tinted
   tiles, and empty states that feel welcoming instead of blank. */

/* Page: two very soft glows so the background isn't flat. */
.portal .main-wrap { background:
  radial-gradient(1100px 520px at 100% -10%, color-mix(in srgb, var(--copper) 9%, transparent), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--teal) 6%, transparent), transparent 60%);
  min-height: 100vh; }

/* Brand lockup on every banner */
.hero-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 10px; }
.hero-brand img { width: 26px; height: 26px; border-radius: 7px; background: var(--surface); box-shadow: 0 1px 3px rgba(45, 35, 25, .12); padding: 2px; }
.hero-brand-name { font: 700 15px/1 var(--serif); color: var(--teal); letter-spacing: .01em; }
.hero-brand-ctx { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--terra);
  padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid color-mix(in srgb, var(--terra) 22%, transparent); }
.hero-brand-ctx .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2E8B57; box-shadow: 0 0 0 3px color-mix(in srgb, #2E8B57 20%, transparent); }
.hero-brand-ctx.demo .live-dot { background: var(--copper); box-shadow: 0 0 0 3px color-mix(in srgb, var(--copper) 22%, transparent); }
.hero-date { margin: 0 0 2px; font-size: 13px; color: var(--muted); font-weight: 500; }

/* Banners: warm wash + sound-wave rings from the logo */
.home-hero { padding: 24px 28px; border-radius: 22px; border: 1px solid color-mix(in srgb, var(--terra) 14%, var(--line));
  background:
    radial-gradient(circle at 96% 8%, color-mix(in srgb, var(--copper) 26%, transparent), transparent 38%),
    radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--teal) 10%, transparent), transparent 45%),
    linear-gradient(120deg, var(--terra-soft), var(--surface) 58%, color-mix(in srgb, var(--teal) 7%, var(--surface)));
  box-shadow: 0 1px 2px rgba(45, 35, 25, .04), 0 18px 40px -28px color-mix(in srgb, var(--terra) 45%, transparent); }
.home-hero::before { content: none; }
/* Logo in the top right of every banner, clear enough to read, with a slow gentle float. */
.home-hero::after { width: 92px; height: 92px; right: 26px; top: 20px; bottom: auto; opacity: .9;
  filter: saturate(1.15) contrast(1.08) drop-shadow(0 8px 14px rgba(45, 35, 25, .16)); }
.home-hero:not(.is-home)::after { width: 70px; height: 70px; top: 16px; right: 22px; bottom: auto; }
.home-hero .page-header > div:first-child { padding-right: 104px; }
.home-hero.is-family::after { width: 64px; height: 64px; top: 16px; right: 18px; }
.home-hero.is-family .loved-card { margin-right: 70px; }
.home-hero.is-family .page-header > div:first-child { padding-right: 0; }
.home-hero h1 { margin: 0; }
.home-hero:not(.is-home) { padding: 20px 26px; }
.home-hero:not(.is-home) h1 { font-size: 30px; }
.home-hero .page-desc { max-width: 62ch; }

/* Today's affirmation */
.home-hero .affirmation { display: inline-grid; gap: 2px; margin: 12px 0 0; padding: 10px 16px 10px 40px; position: relative; max-width: 60ch;
  font-style: normal; background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid color-mix(in srgb, var(--copper) 28%, transparent); border-radius: 14px; }
.home-hero .affirmation::before { content: ''; position: absolute; left: 14px; top: 13px; width: 16px; height: 16px; background: var(--terra);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.5 1.2 4.3 2.5.8-1.3 2.2-2.5 4.3-2.5 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.5 1.2 4.3 2.5.8-1.3 2.2-2.5 4.3-2.5 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; }
.aff-label { font: 700 10.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--copper); }
.aff-text { font: italic 400 17px/1.4 var(--serif); color: var(--ink); }

/* Stat tiles take the color of their icon */
.stat { --tone: var(--terra); }
.stat:has(.stat-icon.teal) { --tone: var(--teal); }
.stat:has(.stat-icon.sage) { --tone: var(--sage); }
.stat:has(.stat-icon.gold) { --tone: var(--copper); }
.stat::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--tone), color-mix(in srgb, var(--tone) 25%, transparent)); }
.stat::after { width: 88px; height: 88px; right: -26px; top: -26px; background: color-mix(in srgb, var(--tone) 9%, transparent); opacity: 1; }
.stat-icon { box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 14%, transparent); }

/* Panels lift slightly */
.panel { box-shadow: 0 1px 2px rgba(45, 35, 25, .04), 0 10px 26px -22px rgba(45, 35, 25, .35); }

/* Empty states: welcoming, not blank */
.empty { display: grid; justify-items: center; gap: 8px; padding: 26px 20px; border: 1px solid color-mix(in srgb, var(--copper) 22%, var(--line)); border-style: solid;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--copper) 10%, transparent), transparent 70%), var(--surface); color: var(--muted); }
.empty-mark { width: 38px; height: 38px; border-radius: 50%; background: var(--terra-soft) url('/assets/logo-mark.png') center / 26px no-repeat; box-shadow: 0 0 0 6px color-mix(in srgb, var(--terra-soft) 60%, transparent); }

/* Charts with no data yet */
.bars-wrap { position: relative; }
.bars-wrap.is-quiet .bar-stack { background: linear-gradient(to top, color-mix(in srgb, var(--copper) 12%, var(--surface-2)), var(--surface-2)); }
.bars-note { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(86%, 340px); margin: 0; text-align: center; font-size: 13px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 20px -14px rgba(45, 35, 25, .4); }
.donut .donut-clear { stroke: color-mix(in srgb, var(--sage) 30%, var(--surface-2)); }
.all-clear { margin: 6px 0 0; font-size: 13px; color: var(--sage); font-weight: 600; }

/* ---------- Family: the most welcoming pages ---------- */
.portal[data-role="family_member"] .main-wrap { background:
  radial-gradient(1000px 520px at 100% -10%, color-mix(in srgb, var(--terra) 10%, transparent), transparent 60%),
  radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--copper) 9%, transparent), transparent 60%); }
.home-hero.is-family { border-color: color-mix(in srgb, var(--terra) 22%, var(--line));
  background:
    radial-gradient(circle at 88% 20%, color-mix(in srgb, var(--copper) 30%, transparent), transparent 40%),
    radial-gradient(circle at 10% 110%, color-mix(in srgb, var(--terra) 14%, transparent), transparent 46%),
    linear-gradient(125deg, var(--terra-soft), color-mix(in srgb, var(--copper) 10%, var(--surface)) 55%, var(--surface)); }
.home-hero.is-family .page-header { align-items: center; }
.hero-sub { margin: 6px 0 0; font-size: 16px; color: var(--muted); max-width: 56ch; }
.loved-card { position: relative; z-index: 1; display: grid; justify-items: center; gap: 4px; text-align: center; padding: 18px 22px; min-width: 190px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid color-mix(in srgb, var(--terra) 18%, transparent); border-radius: 20px;
  box-shadow: 0 16px 34px -24px color-mix(in srgb, var(--terra) 60%, transparent); }
.loved-avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font: 700 28px/1 var(--serif); color: #fff; letter-spacing: .02em;
  background: linear-gradient(140deg, var(--terra), var(--copper));
  box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px color-mix(in srgb, var(--copper) 45%, transparent), 0 14px 26px -12px color-mix(in srgb, var(--terra) 70%, transparent); }
.loved-avatar::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface) center / 15px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23A85339' d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.7 4.5c2.1 0 3.5 1.2 4.3 2.5.8-1.3 2.2-2.5 4.3-2.5 3.7 0 5.8 3.9 4.3 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E");
  box-shadow: 0 2px 6px rgba(45, 35, 25, .18); }
.loved-avatar.sm { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--copper) 45%, transparent); }
.loved-avatar.sm::after { width: 20px; height: 20px; background-size: 11px; }
.loved-name { margin-top: 8px; font: 600 19px/1.2 var(--serif); color: var(--ink); }
.loved-where { font-size: 13px; color: var(--muted); }
.loved-card .label.inline { margin-top: 6px; }
.portal[data-role="family_member"] .stat { border-radius: 18px; }
.portal[data-role="family_member"] .panel { border-radius: 18px; }
.good-to-know { position: relative; padding-left: 74px; background: linear-gradient(120deg, color-mix(in srgb, var(--sage) 9%, var(--surface)), var(--surface) 60%); }
.good-to-know::before { content: ''; position: absolute; left: 22px; top: 22px; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--sage) 16%, var(--surface)) center / 18px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E6B56' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 5-3.5 8.5-7 10-3.5-1.5-7-5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); }
.good-to-know h2 { padding-left: 0 !important; }
.good-to-know h2::before { display: none; }

@media (max-width: 760px) {
  .home-hero::after { width: 56px; height: 56px; top: 14px; right: 14px; }
  .home-hero .page-header > div:first-child { padding-right: 60px; }
  .home-hero.is-family .page-header { flex-direction: column; align-items: stretch; }
  .loved-card { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; column-gap: 14px; min-width: 0; padding: 14px; }
  .loved-card .loved-avatar { grid-row: span 2; width: 60px; height: 60px; font-size: 21px; }
  .loved-name { margin-top: 0; }
  .loved-card .label.inline { grid-column: 1 / -1; }
  .home-hero.is-family .loved-card { margin-right: 0; }
  .home-hero.is-family .page-header > div:first-child { padding-right: 60px; }
  .home-hero .affirmation { max-width: none; }
  .bars-note { top: 34%; }
}
@media (prefers-reduced-motion: no-preference) {
  .home-hero::after { animation: lc-float 6s ease-in-out infinite; }
  @keyframes lc-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-6px) rotate(-3deg); } }
  .home-hero.is-home .loved-avatar { animation: lc-breathe 4.5s ease-in-out infinite; }
  @keyframes lc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
}
:root[data-dark] .loved-avatar { color: #1C2028; }
:root[data-dark] .hero-brand img { background: var(--surface-2); }

/* "How to use this page" — on every page; opens on the first visit, then remembers open or closed. */
.howto { margin: 0 0 18px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line)); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(45, 35, 25, .04); }
.howto > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 18px; font-weight: 600; color: var(--teal); }
.howto > summary::-webkit-details-marker { display: none; }
.howto > summary::after { content: ''; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; }
.howto[open] > summary::after { transform: rotate(-135deg); }
.howto > summary:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: var(--radius); }
.howto-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--surface); background: var(--teal); }
.howto-body { padding: 0 18px 16px 52px; color: var(--ink); }
.howto-body p { margin: 0 0 8px; max-width: 75ch; }
.howto-body ol { margin: 0 0 8px; padding-left: 20px; display: grid; gap: 6px; max-width: 75ch; }
.howto-body li::marker { color: var(--terra); font-weight: 700; }
.howto-tip { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--copper) 10%, var(--surface)); color: var(--muted); font-size: 14px; }
@media (max-width: 600px) { .howto-body { padding: 0 16px 14px 16px; } }

/* Support, bottom of the menu: a polished card instead of a plain outlined link. */
.support-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 12px 12px 12px; border-radius: 14px; text-decoration: none;
  color: var(--ink); border: 1px solid color-mix(in srgb, var(--teal) 22%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 9%, var(--surface)), var(--surface) 70%);
  box-shadow: 0 1px 2px rgba(45, 35, 25, .04), 0 10px 22px -18px color-mix(in srgb, var(--teal) 70%, transparent);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.support-card:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); box-shadow: 0 14px 26px -16px color-mix(in srgb, var(--teal) 70%, transparent); }
.support-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.support-card-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--teal), color-mix(in srgb, var(--teal) 65%, var(--copper))); box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--teal) 80%, transparent); }
.support-card-icon svg { width: 20px; height: 20px; }
.support-card-text { display: grid; gap: 1px; min-width: 0; }
.support-card-text strong { font: 600 13.5px/1.25 var(--sans); color: var(--teal); }
.support-card-text span { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.support-card-arrow { font-size: 20px; line-height: 1; color: var(--teal); opacity: .6; }
.support-card.active { border-color: var(--teal); background: linear-gradient(135deg, color-mix(in srgb, var(--teal) 16%, var(--surface)), var(--surface) 75%); }
:root[data-dark] .support-card-icon { color: #13161B; }

/* Permission descriptions on invitation forms */
.cap-check { display: flex; align-items: flex-start; gap: 10px; }
.cap-check input { margin-top: 3px; }
.cap-check .block { display: block; margin-top: 2px; font-weight: 400; }
.toggle-row .muted.small { display: block; margin-top: 2px; line-height: 1.4; }

/* Team delegation: Community Administrators managed from a community page */
.delegate-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: var(--surface-2); }
.delegate-card .panel { box-shadow: none; border: none; padding: 0; margin: 12px 0; background: transparent; }
.delegate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.delegate-sub { font-size: 15px; margin: 18px 0 6px; }

/* Roles and responsibilities reference (Account page) */
.rr-details { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.rr-details summary { cursor: pointer; font-weight: 700; color: var(--teal); list-style-position: outside; }
.rr-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.rr-role { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface-2); }
.rr-role h3 { font-size: 16px; margin: 0 0 6px; color: var(--teal); }
.rr-role p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.rr-points { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.rr-group h3 { font-size: 15px; margin: 16px 0 6px; }
.rr-cap { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rr-cap > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.rr-who { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; max-width: 45%; }
.rr-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--terra-soft); color: var(--terra-dark); white-space: nowrap; }
:root[data-dark] .rr-tag { color: var(--terra); }
@media (max-width: 600px) { .rr-cap { flex-direction: column; } .rr-who { max-width: none; justify-content: flex-start; } }

/* Getting started checklist (Home): folds up like "How to use this page" */
.gs { margin: 0 0 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--terra) 30%, var(--line)); background: linear-gradient(120deg, var(--terra-soft), var(--surface) 60%); }
.gs > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 18px; font-weight: 600; color: var(--terra-dark); }
:root[data-dark] .gs > summary { color: var(--terra); }
.gs > summary::-webkit-details-marker { display: none; }
.gs > summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s ease; margin-left: 4px; }
.gs[open] > summary::after { transform: rotate(-135deg); }
.gs > summary:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: var(--radius); }
.gs-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--terra); flex: none; }
:root[data-theme="obsidian"] .gs-icon { color: #17140E; }
.gs-mini { margin-left: auto; width: 120px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.gs-mini span { display: block; height: 100%; background: var(--terra); border-radius: 99px; }
.gs-count { color: var(--muted); font-weight: 600; white-space: nowrap; }
.gs-inner { padding: 0 18px 16px 52px; }
.gs-inner > p { margin: 0 0 6px; max-width: 75ch; }
.gs-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.gs-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.gs-step.done { opacity: .75; }
.gs-step.done strong { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.gs-check { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; border: 2px solid var(--terra); color: var(--terra); }
.gs-step.done .gs-check { background: var(--terra); color: #fff; }
:root[data-theme="obsidian"] .gs-step.done .gs-check { color: #17140E; }
.gs-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 600px) { .gs-inner { padding-left: 18px; } .gs-mini { display: none; } .gs-step { flex-wrap: wrap; } .gs-step .btn { margin-left: 40px; } }

/* Notifications (Account page) */
.nt-list { display: grid; gap: 0; margin-top: 8px; }
.nt-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.nt-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nt-ch { display: grid; grid-template-columns: 84px 84px; gap: 8px; flex: none; }
.nt-switch { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
@media (max-width: 600px) { .nt-row { flex-direction: column; align-items: flex-start; } }

/* Demo presenter guide */
.demo-guide { background: transparent; border: 1px solid currentColor; border-radius: 999px; padding: 3px 12px; font: inherit; font-weight: 700; color: inherit; cursor: pointer; margin-right: 10px; }
.presenter { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 92vw; z-index: 60; background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: -12px 0 32px rgba(0,0,0,.12); display: flex; flex-direction: column; }
body.with-presenter #app { margin-right: 360px; }
@media (max-width: 1100px) { body.with-presenter #app { margin-right: 0; } }
.pg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--terra-soft); }
.pg-head > div { display: flex; flex-direction: column; gap: 2px; }
.pg-x { border: none; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.pg-body { overflow-y: auto; padding: 10px 14px 24px; }
.pg-lane { border-bottom: 1px solid var(--line); padding: 8px 2px; }
.pg-lane > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--teal); padding: 6px 0; }
.pg-intro { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.pg-steps { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.pg-step-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pg-todo { margin: 4px 0 0; font-size: 13px; }
.pg-say { margin: 4px 0 0; font-size: 13px; font-style: italic; color: var(--ink); background: var(--surface-2); border-left: 3px solid var(--copper); padding: 6px 8px; border-radius: 6px; }
.pg-say span { font-style: normal; font-weight: 700; color: var(--terra-dark); margin-right: 4px; }
/* Demo invitation email preview */
.mail-preview { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; text-align: left; margin: 12px 0; }
.mail-head { padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
.mail-subject { font-weight: 700; margin-top: 4px; }
.mail-body { padding: 14px; }
.mail-body p { margin: 0 0 10px; }

.pg-pop { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.presenter.standalone { position: static; width: auto; max-width: none; min-height: 100vh; border: none; box-shadow: none; }
.pg-note { margin: 0; padding: 10px 18px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* Live demo calls (Demo mode only) */
.live-demo { flex-basis: 100%; display: grid; gap: 10px; border-top: 1px dashed color-mix(in srgb, var(--copper, #C8823F) 50%, transparent); padding-top: 12px; }
.live-demo-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); gap: 10px; }
.live-demo .row-actions { margin: 0; flex-wrap: wrap; }
.live-call { position: fixed; right: 16px; top: 96px; z-index: 60; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--copper, #C8823F); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px 14px; }
.live-call .lc-row { display: flex; align-items: center; gap: 10px; }
.live-call .lc-who { flex: 1; }
.live-call .lc-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.live-call .lc-line { margin: 6px 0 0; max-height: 3.2em; overflow: hidden; }
.live-call .lc-dot { width: 10px; height: 10px; border-radius: 50%; background: #2E8B57; box-shadow: 0 0 0 0 rgba(46,139,87,.5); }
.live-call[data-mode="connecting"] .lc-dot { background: var(--copper, #C8823F); }
.live-call[data-speaking="1"] .lc-dot { animation: lcPulse 1s ease-out infinite; }
@keyframes lcPulse { to { box-shadow: 0 0 0 10px rgba(46,139,87,0); } }
@media (prefers-reduced-motion: reduce) { .live-call[data-speaking="1"] .lc-dot { animation: none; } }
body.with-presenter .live-call { right: 376px; }
@media (max-width: 1100px) { body.with-presenter .live-call { right: 16px; } }
.bell.bell-ping { animation: bellPing .9s ease-in-out 2; }
@keyframes bellPing { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .bell.bell-ping { animation: none; } }

/* Lock screen (quick unlock code) */
body.is-locked { overflow: hidden; }
.lock-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 80% 15%, #164E63 0%, #0E3A4A 55%, #0A2C38 100%); }
.lock-card { width: min(420px, 100%); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 32px 28px;
  box-shadow: 0 24px 64px rgba(5, 20, 28, .45); display: grid; gap: 14px; text-align: center; }
.lock-card h1 { font-family: var(--serif); font-size: 28px; margin: 0; }
.lock-card .muted { margin: 0; }
.lock-logo { width: 64px; height: 64px; object-fit: contain; justify-self: center; }
.lock-label { text-align: left; }
.lock-input { font-size: 28px; letter-spacing: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.lock-card .link-btn { justify-self: center; }

/* ---------- Public tour (/tour) ---------- */
.tour { min-height: 100vh; background: var(--bg); }
.tour-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tour-brand img { display: block; width: 44px; height: auto; }
.tour-tag { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tour-head-actions { margin-left: auto; display: flex; gap: 8px; }
.tour-body { max-width: 1120px; margin: 0 auto; padding: 24px 24px 64px; outline: none; }
.tour-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tour-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-align: center; }
.tour-steps li::before { content: ''; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.tour-steps li:first-child::before { display: none; }
.tour-steps .dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.tour-steps li.done .dot, .tour-steps li.now .dot { background: var(--teal); border-color: var(--teal); }
.tour-steps li.done::before, .tour-steps li.now::before { background: var(--teal); }
.tour-steps li.now { color: var(--ink); font-weight: 600; }
.tour-intro { max-width: 640px; margin: 40px auto 8px; text-align: center; }
.tour-intro h1 { font-size: 36px; margin-bottom: 12px; }
.tour-intro p { color: var(--muted); font-size: 16px; }
.tour-q { margin-top: 24px; color: var(--ink) !important; font-weight: 600; }
.tour-lang { justify-content: center; align-items: center; margin-top: 10px; }
.tour-lang .chip { font-size: 15px; padding: 9px 20px; }
.tour-callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.tour-callout p { margin: 4px 0 0; color: var(--muted); }
.tour-sim { margin: 0 0 16px; }
.tour-preview { border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: var(--bg); box-shadow: 0 10px 30px rgba(35, 33, 31, .08); }
.tour-preview-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.tour-preview-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.tour-preview-bar em { margin-left: 10px; font-size: 12px; font-style: normal; color: var(--muted); }
.tour-preview-body { padding: 20px; max-height: 620px; overflow: auto; }
.tour-preview-body .howto, .tour-preview-body .gs { display: none; }
.tour-nav { display: flex; justify-content: space-between; margin-top: 20px; }
.tour-calls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 14px; }
.tour-call h2 { font-size: 22px; margin: 4px 0 8px; }
.tour-call p { color: var(--muted); }
.tour-call audio { width: 100%; margin-top: 8px; }
.tour-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 22px 24px; border-radius: 16px; background: var(--teal); color: #fff; }
.tour-cta h2 { color: #fff; font-size: 24px; }
.tour-cta p { margin: 4px 0 0; color: rgba(255, 255, 255, .85); }
.tour-link { margin-top: 18px; text-align: center; }
@media (max-width: 760px) {
  .tour-head { padding: 10px 16px; flex-wrap: wrap; }
  .tour-tag { display: none; }
  .tour-body { padding: 16px 16px 48px; }
  .tour-steps span:not(.dot) { font-size: 11px; }
  .tour-calls { grid-template-columns: 1fr; }
  .tour-preview-body { padding: 12px; max-height: 520px; }
}
.tour-end { margin-top: 56px; }
.tour-end-actions { justify-content: center; margin: 22px 0 18px; }
