@font-face { font-family: 'Jost'; font-weight: 400; font-display: swap; src: url('../fonts/jost-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 500; font-display: swap; src: url('../fonts/jost-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 600; font-display: swap; src: url('../fonts/jost-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-weight: 700; font-display: swap; src: url('../fonts/jost-latin-700-normal.woff2') format('woff2'); }

/* Divine Lifting church platform — design system.
   Brand from the church seal: royal blue, gold ring, indigo Bible, magenta flame, on the site's deep navy. */


:root {
  --navy: #04091c;
  --navy-2: #0b1430;
  --navy-3: #16214a;
  --indigo: #251f5d;
  --blue: #007cc2;
  --blue-600: #0068a3;
  --blue-50: #e8f3fb;
  --gold: #bda869;
  --gold-600: #7d6a2f;
  --gold-50: #f7f2e3;
  --flame: #de1982;
  --flame-50: #fde8f2;

  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e7e4dc;
  --line-2: #d9d5ca;
  --ink: #141a2e;
  --ink-2: #4a5068;
  --ink-3: #62677a;

  --ok: #1f8a5b; --ok-50: #e6f5ee;
  --warn: #b7791f; --warn-50: #fdf3e1;
  --bad: #c0392b; --bad-50: #fbeae8;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(4, 9, 28, .06);
  --shadow: 0 1px 2px rgba(4, 9, 28, .05), 0 8px 24px rgba(4, 9, 28, .06);
  --shadow-lg: 0 20px 50px rgba(4, 9, 28, .18);
  --font: 'Jost', 'Century Gothic', 'Futura', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: var(--font);
  --side: 264px;
  --top: 64px;
  --tabbar: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15.5px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
svg { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.22em; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--ink); }
h1, .h1 { font: 600 30px/1.15 var(--display); letter-spacing: -.01em; }
h2, .h2 { font: 600 22px/1.25 var(--display); }
h3, .h3 { font: 600 17px/1.3 var(--font); }
p { margin: 0 0 .8em; }
small, .small { font-size: 13px; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.eyebrow { font: 600 11.5px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-600); margin-bottom: 8px; }
.serif { font-family: var(--display); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(0, 124, 194, .45); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14.5px/1 var(--font); cursor: pointer; text-decoration: none !important; transition: background .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(4, 9, 28, .18); }
.btn-primary:hover { background: var(--navy-3); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-600); }
.btn-gold { background: linear-gradient(180deg, #cdb97b, var(--gold)); color: var(--on-accent); }
.btn-gold:hover { background: var(--gold-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #f0c9c4; }
.btn-danger:hover { background: var(--bad-50); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-600); font: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- forms */
.stack > * + * { margin-top: 14px; }
.field label { display: block; font: 600 13px/1.3 var(--font); color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 13.5px; color: var(--ink-3); margin: 6px 0 0; }
.field-error { color: var(--bad); font-size: 13px; margin: 6px 0 0; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea, input:not([type]) {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: 400 15.5px/1.4 var(--font); transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 124, 194, .14); }
.is-invalid, [aria-invalid=true] { border-color: var(--bad) !important; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); cursor: pointer; }
.check { padding: 6px 0; }
.check input { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--navy); flex: 0 0 auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.section-label { font: 600 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-600); margin-top: 22px !important; }
.otp-input { text-align: center; font: 600 30px/1 var(--font) !important; letter-spacing: 12px; padding-left: 24px !important; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500; cursor: pointer; }
.choice input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid rgba(0, 124, 194, .45); }

/* ---------------------------------------------------------------- alerts and toasts */
.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14.5px; border: 1px solid; }
.alert-error { background: var(--bad-50); border-color: #f2cdc8; color: #8e2a20; }
.alert-ok { background: var(--ok-50); border-color: #bfe3d1; color: #165f40; }
.alert-info { background: var(--blue-50); border-color: #c7e1f3; color: #0a4f7a; }
.alert-warn { background: var(--warn-50); border-color: #f1dcb2; color: #7a5212; }
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); top: 16px; z-index: 90; width: min(92vw, 460px); }
.toast { background: var(--navy); color: #fff; padding: 13px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14.5px; display: flex; gap: 10px; align-items: center; animation: toast-in .25s ease-out; }
.toast.error { background: #7f1d1d; }
.toast.ok::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- auth screens */
.auth-body { min-height: 100vh; background:
  radial-gradient(900px 500px at 85% -10%, rgba(0, 124, 194, .35), transparent 60%),
  radial-gradient(700px 500px at -10% 110%, rgba(222, 25, 130, .18), transparent 60%),
  linear-gradient(160deg, var(--navy) 0%, var(--indigo) 100%); color: #fff; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px 40px; }
.auth-shell > div { width: 100%; }
.auth-card { margin-inline: auto; }
.auth-card { width: min(100%, 440px); background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); padding: 30px 26px; box-shadow: var(--shadow-lg); }
.auth-card.wide { width: min(100%, 560px); }
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-card > .muted { text-align: center; }
.auth-logo { width: 88px; height: 88px; margin: -74px auto 14px; border-radius: 50%; box-shadow: 0 10px 30px rgba(4, 9, 28, .35); background: #fff; }
.auth-brand { text-align: center; margin-bottom: 70px; }
.auth-brand .church { font: 600 15px/1.3 var(--display); letter-spacing: .02em; color: #fff; opacity: .92; }
.auth-brand .tag { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13px; color: rgba(255, 255, 255, .7); }
.auth-foot a { color: #fff; }
.scripture { font: italic 400 14px/1.55 var(--display); color: rgba(255, 255, 255, .78); text-align: center; max-width: 420px; margin: 22px auto 0; }
.scripture b { display: block; font: 600 11px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 8px; font-style: normal; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps span { width: 28px; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--gold); }
.group-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--gold-50); color: var(--gold-600); font: 600 12.5px/1 var(--font); }

/* ---------------------------------------------------------------- app shell */
.app { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: rgba(4, 9, 28, .96); color: #fff; backdrop-filter: blur(10px); }
.topbar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.topbar .brand img { width: 36px; height: 36px; border-radius: 50%; background: #fff; }
.topbar .brand b { font: 600 16px/1.1 var(--display); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand small { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.dot-count { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--flame); color: #fff; font: 700 10.5px/18px var(--font); text-align: center; }
.sidebar { display: none; }
.main { padding: 20px 16px calc(var(--tabbar) + 28px); max-width: 1080px; margin: 0 auto; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(4, 9, 28, .05); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-3); font: 600 12px/1 var(--font); text-decoration: none; }
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--brand-ink); }
.tabbar a.on svg { color: var(--blue); }
@media (min-width: 960px) {
  .sidebar { display: flex; flex-direction: column; position: fixed; top: var(--top); bottom: 0; left: 0; width: var(--side); padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .main { margin-left: var(--side); padding: 28px 32px 48px; max-width: none; }
  .main > .wrap { max-width: 1040px; margin: 0 auto; }
  .tabbar { display: none; }
}
.nav-label { font: 600 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 16px 12px 8px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; }
.nav a svg { width: 20px; height: 20px; color: var(--ink-3); }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--navy); color: #fff; }
.nav a.on svg { color: var(--gold); }
.nav a .count { margin-left: auto; background: var(--flame); color: #fff; border-radius: 999px; font: 700 11px/18px var(--font); padding: 0 7px; }
.side-foot { margin-top: auto; padding: 14px 12px 4px; font-size: 12px; color: var(--ink-3); }
.side-foot .link-btn { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.side-foot .link-btn svg { width: 20px; height: 20px; color: var(--ink-3); }

/* ---------------------------------------------------------------- page structure */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
@media (min-width: 760px) { .card-pad { padding: 22px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { margin: 0; font: 600 16px/1.3 var(--font); }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* hero: greeting card on Home */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 24px 22px; color: #fff;
  background: radial-gradient(500px 260px at 100% 0%, rgba(0, 124, 194, .55), transparent 60%), radial-gradient(400px 260px at 0% 120%, rgba(222, 25, 130, .3), transparent 60%), linear-gradient(140deg, var(--navy), var(--indigo)); box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 28px; margin-bottom: 6px; }
.hero p { color: rgba(255, 255, 255, .82); margin: 0; }
.hero .eyebrow { color: var(--gold); }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; border: 2px solid rgba(189, 168, 105, .35); }
.hero .verse { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .14); font: italic 400 14.5px/1.5 var(--display); color: rgba(255, 255, 255, .85); }
.hero .verse b { font: 600 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-style: normal; margin-left: 6px; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 760px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .label { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.stat .value { font: 600 28px/1.1 var(--display); margin-top: 6px; color: var(--brand-ink); }
.stat .delta { font-size: 12.5px; margin-top: 4px; color: var(--ink-3); }
.stat.accent { background: var(--navy); border-color: var(--navy); }
.stat.accent .label, .stat.accent .delta { color: rgba(255, 255, 255, .7); }
.stat.accent .value { color: var(--gold); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); }
.list .meta { font-size: 14px; color: var(--ink-3); }
.list a.row-link { color: inherit; text-decoration: none; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* avatars */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--blue-50); color: var(--blue-600); font: 700 14px/1 var(--font); object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 12px/1.2 var(--font); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tone-ok { background: var(--ok-50); color: #17704a; border-color: #c4e6d5; }
.tone-warn { background: var(--warn-50); color: #8a5a12; border-color: #f0dcb4; }
.tone-bad { background: var(--bad-50); color: var(--bad); border-color: #f0cbc6; }
.tone-blue { background: var(--blue-50); color: var(--blue-600); border-color: #c6e0f2; }
.tone-gold { background: var(--gold-50); color: var(--gold-600); border-color: #eadfbf; }
.tone-flame { background: var(--flame-50); color: #b0106a; border-color: #f6c6de; }
.tone-navy { background: var(--navy); color: #fff; border-color: var(--navy); }

/* announcements */
.post { padding: 18px; border-top: 1px solid var(--line); }
.post:first-child { border-top: 0; }
.post .post-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.post h3 { font: 600 18px/1.3 var(--display); margin-bottom: 6px; }
.post .body { color: var(--ink-2); white-space: pre-line; }
.post.pinned { background: linear-gradient(90deg, var(--gold-50), transparent 60%); }

/* events / calendar */
.when { width: 54px; flex: 0 0 auto; text-align: center; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); padding: 7px 0; }
.when .m { font: 700 10.5px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--flame); }
.when .d { font: 600 22px/1.1 var(--display); color: var(--brand-ink); margin-top: 3px; }
.day-head { font: 600 12px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 18px 18px 8px; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 600 12px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* tabs and filters */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font: 600 13.5px/1 var(--font); white-space: nowrap; text-decoration: none; }
.tabs a.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }

/* empty state */
.empty { text-align: center; padding: 38px 18px; color: var(--ink-3); }
.empty .icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--gold-50); color: var(--gold-600); }
.empty h3 { color: var(--ink); }

/* profile */
.profile-head { display: flex; gap: 16px; align-items: center; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); }

/* install banner */
.install { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--gold-50); border: 1px solid #eadfbf; }
.install img { width: 40px; height: 40px; border-radius: 10px; }

/* birthday card */
.bday { display: flex; gap: 12px; align-items: center; padding: 14px 18px; background: linear-gradient(90deg, var(--flame-50), var(--surface)); border-top: 1px solid var(--line); }

/* utilities */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; gap: 10px; align-items: center; } .between { justify-content: space-between; } .wrap-flex { flex-wrap: wrap; }
.right { text-align: right; } .center { text-align: center; }
.inline-form { display: inline; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { font-size: 13.5px; }

@media (max-width: 520px) {
  h1, .h1 { font-size: 25px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* icon sizing inside components */
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-sm svg { width: 16px; height: 16px; }
.avatar svg { width: 55%; height: 55%; }
.empty .icon svg { width: 26px; height: 26px; }
.install > div { flex: 1; min-width: 0; }
.show-sm { display: none !important; }
@media (max-width: 520px) { .show-sm { display: revert !important; } }

/* QA polish */
.badge svg { width: 13px; height: 13px; }
.card-head h2 svg, .card-head h3 svg, h2 > svg, h3 > svg { width: 20px; height: 20px; margin-right: 6px; color: var(--gold-600); vertical-align: -4px; }
.page-head a.small, .card-head a.small, .auth-card .link-btn, .auth-card .flex a { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; }
.page-head a.small svg { width: 16px; height: 16px; }
.row3.keep { grid-template-columns: 1fr 1.4fr 1fr !important; }
.table code { white-space: normal; word-break: break-all; font-size: 12.5px; }
.table th { white-space: nowrap; }
.table td.nowrap { white-space: nowrap; }
.table th a { color: inherit; }
.list-top > li { align-items: flex-start; }
input[type=file] { font: inherit; max-width: 100%; }
input[type=file]::file-selector-button { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: 600 14px var(--font); margin-right: 12px; cursor: pointer; }
details.filters > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.filters > summary::-webkit-details-marker { display: none; }
@media (min-width: 761px) { details.filters > summary { display: none; } }
.more-links { display: grid; gap: 10px; }
.more-links a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.more-links a svg { width: 22px; height: 22px; color: var(--blue); }
.more-links a .chev { margin-left: auto; color: var(--ink-3); }
input[type=file] { min-width: 0; width: 100%; }

/* =====================================================================
   Hydrotom-style theme: Jost, calm neutral canvas, dark sidebar, one accent.
   Church colours: navy ink (#04091c) with the seal's gold as the accent.
   ===================================================================== */
:root {
  --font: "Jost", "Century Gothic", "Futura", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--font);
  --bg: #f4f4ef; --surface: #ffffff; --surface-2: #f8f8f4;
  --line: #e4e4dc; --line-2: #cfd0c6;
  --ink: #161a17; --ink-2: #4a5049; --ink-3: #5d625b;
  --accent: #e3cf8f; --accent-deep: #cdb46a; --accent-soft: #f7f1dc;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 26, 23, .04), 0 1px 1px rgba(22, 26, 23, .03);
  --shadow: var(--shadow-sm);
  --side: 248px; --top: 60px;
}
body { font: 400 15px/1.5 var(--font); letter-spacing: 0; }
h1, .h1 { font: 600 26px/1.2 var(--font); letter-spacing: -.01em; }
h2, .h2 { font: 600 19px/1.25 var(--font); letter-spacing: -.01em; }
h3, .h3 { font: 600 16px/1.3 var(--font); }
.eyebrow, .section-label { font-family: var(--font); letter-spacing: .06em; color: var(--ink-3); }
a { color: var(--ink); font-weight: 500; }
a:hover { text-decoration: none; color: #000; }
:focus-visible { outline: 2px solid var(--accent-deep); }

/* buttons: squarer, flat */
.btn { border-radius: 10px; min-height: 40px; font: 600 14.5px/1 var(--font); box-shadow: none !important; }
.btn-sm { min-height: 34px; border-radius: 8px; font-size: 13.5px; }
@media (pointer: coarse) { .btn-sm { min-height: 42px; } .btn { min-height: 44px; } }
.btn-primary { background: var(--navy); color: var(--on-dark); }
.btn-primary:hover { background: #121a33; }
.btn-gold { background: var(--accent); color: var(--on-accent); }
.btn-gold:hover { background: var(--accent-deep); color: var(--on-accent); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); border-color: #9a9f95; }
.btn-blue { background: var(--navy); }

/* forms */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea, input:not([type]) {
  border-radius: 10px; min-height: 44px; font: 400 15px/1.4 var(--font); border-color: var(--line-2); }
input:focus, select:focus, textarea:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(205, 180, 106, .45); }
.field label { font: 600 13px/1.3 var(--font); color: var(--ink); }
.choice input:checked + span { background: var(--navy); border-color: var(--navy); }

/* cards and lists */
.card { border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head h2, .card-head h3 { font: 600 16px/1.3 var(--font); }
.post h3 { font: 600 17px/1.3 var(--font); }
.list .title { font-weight: 600; }

/* stats like Hydrotom tiles */
.stat { border-radius: var(--radius); }
.stat .value { font: 600 28px/1.1 var(--font); color: var(--ink); letter-spacing: -.01em; }
.stat.accent { background: var(--navy); }
.stat.accent .value { color: var(--accent); }

/* hero: calm, flat navy panel */
.hero { border-radius: var(--radius-lg); background: var(--navy); box-shadow: none; padding: 24px; }
.hero::after { border-color: rgba(227, 207, 143, .25); }
.hero h1 { font: 600 26px/1.2 var(--font); }
.hero .eyebrow { color: var(--accent); }
.hero .verse { font: italic 400 14.5px/1.5 var(--font); }
.hero .verse b { color: var(--accent); }
.when .d { font: 600 22px/1.1 var(--font); color: var(--ink); }
.when .m { color: var(--gold-600); }

/* avatars: ink with accent letters */
.avatar { background: var(--navy); color: var(--accent); font-weight: 600; }

/* badges */
.badge { font: 600 12px/1.2 var(--font); }
.tone-navy { background: var(--navy); color: var(--accent); }

/* tabs */
.tabs a { border-radius: 10px; font: 600 13.5px/1 var(--font); }
.tabs a.on { background: var(--navy); color: var(--accent); }

/* ---- shell ---- */
.topbar { background: var(--topbar-bg); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(10px); }
.topbar .brand { color: var(--ink); }
.topbar .brand b { font: 600 16px/1.1 var(--font); color: var(--ink); }
.topbar .brand small { color: var(--gold-600); letter-spacing: .1em; }
.topbar .brand img { box-shadow: 0 0 0 1px var(--line); }
.icon-btn { color: var(--ink); }
.icon-btn:hover { background: rgba(22, 26, 23, .06); }
.dot-count { background: var(--flame); }
.sidebar-brand { display: none; }
.tabbar { border-top: 1px solid var(--line); box-shadow: none; }
.tabbar a { font: 600 12px/1 var(--font); }
.tabbar a.on { color: var(--brand-ink); }
.tabbar a.on svg { color: var(--brand-ink); }
.tabbar a.on::before { content: ''; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent-deep); }
.tabbar a { position: relative; }

@media (min-width: 960px) {
  .topbar { margin-left: var(--side); padding: 0 32px; }
  .topbar .brand { display: none; }
  .sidebar { top: 0; background: var(--navy); border-right: 0; padding: 0 12px 16px; color: #c9cdd8; }
  .sidebar-brand { display: flex; align-items: center; gap: 11px; height: 72px; padding: 0 10px; color: var(--on-dark); text-decoration: none; }
  .sidebar-brand img { width: 38px; height: 38px; border-radius: 50%; background: #fff; }
  .sidebar-brand b { display: block; font: 600 18px/1.1 var(--font); color: var(--on-dark); }
  .sidebar-brand small { display: block; font: 500 11px/1.2 var(--font); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
  .nav-label { color: #7d8496; letter-spacing: .09em; padding: 18px 12px 6px; }
  .nav a { color: #c3c8d4; font: 500 14.5px/1.2 var(--font); padding: 9px 12px; border-radius: 9px; }
  .nav a svg { color: #8a91a3; width: 19px; height: 19px; }
  .nav a:hover { background: rgba(245, 241, 227, .07); color: var(--on-dark); }
  .nav a.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
  .nav a.on svg { color: var(--on-accent); }
  .nav a .count { background: rgba(227, 207, 143, .18); color: var(--accent); }
  .nav a.on .count { background: var(--navy); color: var(--accent); }
  .side-foot { border-top: 1px solid rgba(245, 241, 227, .08); color: #7d8496; }
  .side-foot .link-btn { color: #c3c8d4; }
  .side-foot .link-btn svg { color: #8a91a3; }
  .main { padding: 30px 36px 72px; }
}

/* sign-in screens */
.auth-body { background: var(--navy); background-image: radial-gradient(1000px 500px at 85% -10%, rgba(227, 207, 143, .12), transparent 60%); }
.auth-card { border-radius: 18px; padding: 32px 28px; }
.auth-card h1 { font: 600 26px/1.2 var(--font); }
.auth-brand .church { font: 600 17px/1.3 var(--font); color: var(--on-dark); }
.auth-brand .tag { color: var(--accent); letter-spacing: .14em; }
.scripture { font: italic 400 14px/1.55 var(--font); color: #aab0bf; }
.scripture b { color: var(--accent); }
.steps span.on { background: var(--accent-deep); }
.group-chip { background: var(--accent-soft); color: #6b5a22; }
.more-links a svg { color: var(--brand-ink); }
@media (min-width: 960px) {
  .sidebar-brand { flex: 0 0 auto; }
  .sidebar .nav { flex: 1 1 auto; overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #2a3350 transparent; }
  .side-foot { flex: 0 0 auto; }
  .sidebar { overflow: hidden; }
}

/* Brand like Hydrotom: icon + lowercase wordmark, no badge circle */
.brand-icon { border-radius: 50% !important; background: #fff; flex: 0 0 auto; }
.brand-word { font: 600 22px/1 var(--font); letter-spacing: -.01em; white-space: nowrap; }
.topbar .brand-word { font-size: 18px; color: var(--ink); }
@media (min-width: 960px) { .sidebar-brand { gap: 11px; padding: 0 12px; } .sidebar-brand .brand-word { color: var(--on-dark); font-size: 18px; line-height: 1.15; white-space: normal; max-width: 150px; } }
.auth-lockup { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 auto 28px; }
.lockup-icon { width: 64px; height: 64px; border-radius: 50%; background: #fff; }
.lockup-text { display: flex; flex-direction: column; gap: 6px; }
.lockup-word { font: 600 34px/1 var(--font); color: var(--on-dark); letter-spacing: -.01em; }
.lockup-tag { font: 500 11.5px/1.2 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.auth-logo { display: none; }

/* Hero watermark like Hydrotom: the church seal, faint, top right */
.hero { position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -50px; top: -60px; width: 300px; height: 300px; border: 0; border-radius: 0; background: url("../img/mark-watermark.png") no-repeat center / contain; opacity: .09; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
@media (max-width: 520px) { .hero::after { width: 220px; height: 220px; right: -60px; top: -40px; } }
/* registration link rows */
.invite-row .copy-field { flex-wrap: wrap; }
.invite-row .copy-field input { flex: 1 1 220px; min-width: 0; font-size: 13.5px; background: var(--surface-2); }
.card-head h2 svg { color: var(--gold-600); }

/* ===================================================== group chat (Slack-style) */
/* channel list: shared by the left bar (dark) and the Chat tab on phones (light) */
.chan-list { display: flex; flex-direction: column; gap: 14px; }
.chan-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 12px; font: 600 11.5px/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.chan-about { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px; color: inherit; opacity: .8; }
.chan-about:hover { background: var(--surface-2); opacity: 1; }
.chan-about svg { width: 16px; height: 16px; }
.chan { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 12px; border-radius: 9px; color: var(--ink-2); font: 500 15px/1.2 var(--font); text-decoration: none; }
.chan:hover { background: var(--surface-2); }
.chan .chan-hash { width: 18px; text-align: center; color: var(--ink-3); font-weight: 600; }
.chan .chan-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan.has-unread { color: var(--ink); font-weight: 700; }
.chan.on { background: var(--navy); color: #fff; }
.chan.on .chan-hash { color: var(--accent); }
.chan .count { margin-left: auto; background: var(--flame); color: #fff; border-radius: 999px; font: 700 11px/18px var(--font); padding: 0 7px; }
.chan svg { width: 18px; height: 18px; }
.chan.muted-chan { color: var(--ink-3); }
.avatar-xs { width: 22px; height: 22px; font-size: 10px; flex: 0 0 22px; }
.chan-add summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-radius: 9px; color: var(--ink-3); font: 500 14px/1.2 var(--font); }
.chan-add summary::-webkit-details-marker { display: none; }
.chan-add summary svg { width: 16px; height: 16px; }
.chan-add form { display: flex; flex-direction: column; gap: 8px; padding: 6px 12px 10px; }
.chan-add input[name=name] { min-height: 40px; }
.check-sm { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.stack-sm > * + * { margin-top: 8px; }
.chan-card { padding: 14px 6px; }
.count-pill { background: var(--flame); color: #fff; border-radius: 999px; font: 700 12px/22px var(--font); padding: 0 9px; white-space: nowrap; }
.tabbar a .tab-dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--flame); color: #fff; font: 700 10.5px/18px var(--font); }

/* the list inside the dark left bar */
@media (min-width: 960px) {
  .sidebar .nav { flex: 0 0 auto; overflow: visible; }
  .side-chat { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(245, 241, 227, .08); scrollbar-width: thin; scrollbar-color: #2a3350 transparent; }
  .side-chat .chan-group-head { color: #7d8496; }
  .side-chat .chan-about:hover { background: rgba(245, 241, 227, .07); }
  .side-chat .chan, .side-chat .chan-add summary { color: #c3c8d4; font-size: 14.5px; min-height: 34px; padding: 6px 12px; }
  .side-chat .chan .chan-hash { color: #6f778b; }
  .side-chat .chan:hover, .side-chat .chan-add summary:hover { background: rgba(245, 241, 227, .07); color: var(--on-dark); }
  .side-chat .chan.has-unread { color: #fff; font-weight: 700; }
  .side-chat .chan.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
  .side-chat .chan.on .chan-hash { color: var(--on-accent); }
  .side-chat .chan .count { background: var(--accent); color: var(--on-accent); }
  .side-chat .chan.on .count { background: var(--navy); color: var(--accent); }
  .side-chat .chan-add input { background: rgba(255, 255, 255, .06); border-color: rgba(245, 241, 227, .15); color: var(--on-dark); }
  .side-chat .check-sm { color: #c3c8d4; }
  .side-foot { display: none; }
}
.side-chat { display: none; }
@media (min-width: 960px) { .side-chat { display: block; } }

/* conversation page: fills the screen, composer pinned at the bottom */
.main-chat { padding: 0 !important; }
.wrap-chat { height: calc(100dvh - var(--top) - var(--tabbar) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
@media (min-width: 960px) { .wrap-chat { height: calc(100dvh - var(--top)); } }
.wrap-chat > .alert { margin: 12px 16px 0; }
.convo { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.convo-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.convo-title { font: 700 17px/1.2 var(--font); margin: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.convo-title .badge svg { width: 12px; height: 12px; vertical-align: -1px; }
.convo-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.convo-head .chan-hash { color: var(--ink-3); }
.convo-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 8px 0 12px; background: var(--surface); overscroll-behavior: contain; }
.convo-more { text-align: center; padding: 8px; }
.convo-empty { text-align: center; padding: 48px 24px 24px; max-width: 460px; margin: 0 auto; }
.convo-empty .icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; background: var(--accent-soft); color: var(--brand-ink); display: flex; align-items: center; justify-content: center; }
.convo-empty .icon svg { width: 28px; height: 28px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 16px 6px; color: var(--ink-3); font: 600 12.5px/1 var(--font); }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { position: relative; display: flex; gap: 10px; padding: 6px 16px 2px; }
.msg.cont { padding-top: 1px; }
.msg:hover { background: var(--surface-2); }
.msg-av { flex: 0 0 36px; }
.msg-av .avatar { width: 36px; height: 36px; border-radius: 10px; }
.msg-main { min-width: 0; flex: 1 1 auto; }
.msg-meta { display: flex; align-items: baseline; gap: 8px; }
.msg-meta strong { font: 700 15px/1.3 var(--font); color: var(--ink); }
.msg-meta time { font-size: 12px; color: var(--ink-3); }
.msg-body { font: 400 15.5px/1.5 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.msg-body a { color: var(--blue); text-decoration: underline; }
.msg-del { position: absolute; top: 4px; right: 12px; opacity: 0; }
.msg:hover .msg-del, .msg:focus-within .msg-del { opacity: 1; }
.msg-del button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; }
.msg-del button svg { width: 15px; height: 15px; }
.msg-del button:hover { color: var(--flame); }
@media (hover: none) { .msg-del { opacity: .55; } }
.composer { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); }
.composer:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(4, 9, 28, .08); }
.composer textarea { flex: 1 1 auto; border: 0; outline: 0; resize: none; min-height: 26px; max-height: 160px; padding: 6px 0; font: 400 16px/1.45 var(--font); background: transparent; box-shadow: none; }
.composer .send { flex: 0 0 40px; height: 40px; border: 0; border-radius: 10px; background: var(--navy); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.composer .send svg { width: 19px; height: 19px; }
.composer-hint { margin: -4px 16px 8px; font-size: 11.5px; color: var(--ink-3); }
.composer-note { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; display: flex; align-items: center; gap: 8px; background: var(--surface); }
.composer-note svg { width: 16px; height: 16px; }
.composer-error { margin: 0 14px 6px; padding: 8px 12px; border-radius: 10px; background: #fdecea; color: #8a1c13; font-size: 14px; }
.w-full { width: 100%; }
.convo-head .grow { flex: 1 1 auto; min-width: 0; }
.chan-add-menu { position: relative; }
.chan-add-menu summary { list-style: none; }
.chan-add-menu summary::-webkit-details-marker { display: none; }
.chan-add-menu .pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(4, 9, 28, .14); }
.chan-add-menu .pop input[type=text], .chan-add-menu .pop input:not([type]) { width: 100%; }
details#start > summary { cursor: pointer; list-style: none; }
details#start > summary::-webkit-details-marker { display: none; }

/* =====================================================================
   v3 · One calm system, in the Hydrotom manner.
   Warm off-white ground, white cards with one hairline edge, navy ink,
   gold used only for what is active or new. Words instead of icons.
   ===================================================================== */
:root {
  --bg: #f4f4ef; --surface: #ffffff; --surface-2: #f8f8f4; --tint: #efefe8;
  --line: #e4e4dc; --line-2: #cfd0c6; --rule: #eeeee7;
  --ink: #12151f; --ink-2: #3a3f4b; --ink-3: #5f6470;
  --navy: #04091c; --accent: #e3cf8f; --accent-deep: #c9b26a; --accent-soft: #f7f1dc;
  --flame: #c4242a;
  --radius: 14px; --radius-sm: 10px;
}
body { font: 400 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }

/* Words, not icons: decorative icons are gone everywhere except the phone tab bar,
   the bell on phones, back arrows, send and delete. */
.btn svg, .nav a svg, .more-links svg, .more-links .chev, .empty .icon, .card-head svg, .page-head svg,
h1 > svg, h2 > svg, h3 > svg, .link-btn svg, .badge svg, .actions svg, .chan svg, .chan-add summary svg,
.convo-title .badge svg, .composer-note svg, .alert svg, .meta svg, .side-foot svg { display: none !important; }
.list > li > span.avatar:not([class*="av-"]) { display: none; }
.convo-empty .icon { display: none; }

/* Type: one face, few sizes */
h1, .h1 { font: 600 26px/1.2 var(--font); letter-spacing: -.015em; }
h2, .h2 { font: 600 18px/1.3 var(--font); letter-spacing: -.01em; }
h3, .h3 { font: 600 16px/1.35 var(--font); }
.eyebrow { font: 500 13px/1.3 var(--font); letter-spacing: 0; text-transform: none; color: var(--ink-3); margin-bottom: 6px; }
.page-head { margin-bottom: 22px; }
.page-head .sub { color: var(--ink-3); font-size: 15px; }
.muted, .meta { color: var(--ink-3); }

/* Cards: flat, one hairline */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.card-pad { padding: 22px; }
.card-head { padding: 18px 22px 6px; border-bottom: 0; }
.card-head h2, .card-head h3 { font: 600 16px/1.3 var(--font); }
.card-head a.small { font-weight: 600; color: var(--ink-2); min-height: 0; }
.card-head a.small:hover { color: var(--ink); }
.card-foot { background: transparent; border-top: 1px solid var(--rule); padding: 14px 22px; }
.card-foot.center .btn { background: transparent; border: 0; color: var(--ink-2); padding: 0; min-height: 0; height: auto; }

/* Lists: rows, rules, no boxes */
.list > li { padding: 13px 22px; border-top: 1px solid var(--rule); gap: 14px; }
.list > li:first-child { border-top: 0; }
.list .title { font-weight: 600; font-size: 15px; }
.list .meta { font-size: 13.5px; }
.list a.row-link:hover .title { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Buttons: flat, 10px, one dark primary */
.btn { height: auto; min-height: 40px; padding: 0 16px; border-radius: 10px; font: 600 14px/1 var(--font); gap: 0; box-shadow: none !important; transform: none !important; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn-primary, .btn-blue, .btn-ok { background: var(--navy); color: var(--on-dark); border-color: var(--navy); }
.btn-primary:hover, .btn-blue:hover, .btn-ok:hover { background: #18203a; }
.btn-gold { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-gold:hover { background: var(--accent-deep); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #b9bbb0; }
.btn-danger { background: var(--surface); color: #a3201a; border-color: #ecc7c2; }
.btn-danger:hover { background: #fdeeec; }
.hero .btn-ghost { background: transparent; color: var(--on-dark); border-color: rgba(245, 241, 227, .28); }
.hero .btn-ghost:hover { background: rgba(245, 241, 227, .08); }
.link-btn { font-weight: 600; }

/* Badges and status pills: small, pale, same-hue text */
.badge { padding: 3px 9px; border: 0; font: 600 12px/1.3 var(--font); background: var(--tint); color: var(--ink-2); }
.tone-ok { background: #e6f4ea; color: #1d5e36; }
.tone-warn { background: #fff3d6; color: #7a4d00; }
.tone-bad { background: #fdeeec; color: #8f1d17; }
.tone-blue { background: #eaf0f9; color: #1f4c86; }
.tone-gold { background: var(--accent-soft); color: #6b5520; }
.tone-flame { background: #fdecec; color: #a3201a; }
.tone-navy { background: var(--navy); color: var(--on-dark); }

/* People: each with their own pale tint */
.avatar { background: #ecebe4; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
.av-0 { background: #f3e7c7; color: #5c4712; } .av-1 { background: #dcecf7; color: #1d4a6e; }
.av-2 { background: #e3f1e4; color: #24552d; } .av-3 { background: #f6e1e4; color: #7a2a36; }
.av-4 { background: #e9e4f4; color: #3e3466; } .av-5 { background: #fde9d9; color: #7a3d12; }
.av-6 { background: #dff0ee; color: #1f5550; } .av-7 { background: #ececea; color: #3a3d45; }
img.avatar-photo { background: var(--tint); }

/* Empty states: a title and a line, no picture */
.empty { padding: 34px 22px; }
.empty h3 { font-size: 16px; margin-bottom: 4px; }
.empty p { color: var(--ink-3); max-width: 420px; margin-left: auto; margin-right: auto; }

/* Date block on event rows */
.when { background: var(--surface-2); border: 0; border-radius: 10px; width: 52px; }
.when .m { color: var(--ink-3); letter-spacing: .04em; font-weight: 600; }
.when .d { color: var(--ink); }

/* Stats on leaders' screens: type, not tiles */
.stat { border-radius: var(--radius); box-shadow: none; }
.stat .label { font-size: 13px; }
.stat .value { font: 600 26px/1.1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat.accent { background: var(--navy); border-color: var(--navy); }
.stat.accent .value { color: var(--accent); }

/* Forms */
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea, input:not([type]) {
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); box-shadow: none; min-height: 42px; font-size: 15px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(227, 207, 143, .55); }
.field label { font-size: 13.5px; color: var(--ink); }
.choice span { border-color: var(--line-2); border-radius: 10px; }
.choice input:checked + span { background: var(--accent-soft); color: var(--ink); border-color: var(--brand-ink); }
.alert { border-radius: 10px; }

/* Toast: quiet, top centre */
.toast { background: var(--navy); color: var(--on-dark); border-radius: 12px; box-shadow: 0 18px 40px rgba(4, 9, 28, .22); }

/* Hero: Hydrotom's ink banner, one line of welcome and the verse */
.hero { background: var(--navy); border-radius: 18px; padding: 26px 28px; }
.hero h1 { font-size: 28px; color: var(--on-dark); }
.hero .eyebrow { color: var(--accent); font-weight: 500; }
.hero .verse { border-top-color: rgba(245, 241, 227, .12); font-style: italic; color: #c9ccd4; font-size: 15px; }
.hero .verse b { color: var(--accent); letter-spacing: .04em; font-size: 12px; }

/* ---------- shell ---------- */
.topbar { background: var(--topbar-bg); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: none; }
.topbar .icon-btn { color: var(--ink); }
.topbar .icon-btn:hover { background: var(--tint); }
.show-sm-only { display: inline-grid; }
.hide-sm-only { display: none !important; }
@media (min-width: 960px) {
  .show-sm-only { display: none !important; }
  .hide-sm-only { display: inline-flex !important; }
  .topbar { gap: 12px; }
}
.bell { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; font: 600 13.5px/1 var(--font); color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.bell:hover { color: var(--ink); border-color: var(--line-2); text-decoration: none; }
.bell b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; display: inline-grid; place-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 10px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--tint); }
.user-name { font-weight: 600; font-size: 14px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(4, 9, 28, .14); z-index: 60; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.menu-panel a, .menu-panel button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: none; font: 500 14px/1.3 var(--font); color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }
.menu-panel form { margin: 0; }

@media (min-width: 960px) {
  .sidebar { padding: 0 12px 16px; }
  .sidebar .nav { flex: 1 1 auto; overflow-y: auto; padding-top: 4px; }
  .nav a { gap: 0; padding: 9px 12px; font: 500 14.5px/1.2 var(--font); color: #c3c8d4; border-radius: 9px; }
  .nav a .count { margin-left: auto; }
  .nav-label { text-transform: none; letter-spacing: 0; font: 500 12.5px/1.2 var(--font); color: #7f8698; padding: 20px 12px 6px; }
  .main { padding: 28px 36px 64px; }
  .wrap { max-width: 1160px; }
}

/* phone tab bar: quiet, labels clear */
.tabbar { background: var(--surface); border-top: 1px solid var(--line); }
.tabbar a { color: var(--ink-3); font: 600 11.5px/1 var(--font); }
.tabbar a svg { width: 22px; height: 22px; stroke-width: 1.6; }
.tabbar a.on { color: var(--brand-ink); }
.tabbar a.on::before { background: var(--brand-ink); }

/* More page: one grouped list */
.more-links { gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.more-links a { border: 0; border-top: 1px solid var(--rule); border-radius: 0; min-height: 52px; font-weight: 500; padding: 0 18px; }
.more-links a:first-child { border-top: 0; }
.more-links a::after { content: "›"; margin-left: auto; color: var(--ink-3); font-size: 20px; line-height: 1; }
.more-links a:hover { background: var(--surface-2); }

/* ---------- chat, Hydrotom style: list and conversation inside one card ---------- */
.chan-group-head { text-transform: none; letter-spacing: 0; font: 600 13px/1.2 var(--font); color: var(--ink-3); padding: 4px 12px; }
.chan-about { width: auto; height: auto; padding: 4px 8px; font: 600 12.5px/1 var(--font); color: var(--ink-3); border-radius: 7px; text-decoration: none; opacity: 1; }
.chan-about:hover { background: var(--tint); color: var(--ink); text-decoration: none; }
.chan { font-size: 15px; min-height: 38px; }
.chan .count, .count-pill { background: var(--accent); color: var(--on-accent); }
.chan.on { background: var(--navy); color: var(--on-dark); }
.chan.on .chan-hash { color: var(--accent); }
.chan.on .count { background: var(--accent); color: var(--on-accent); }
.muted-chan::before { content: "+"; width: 18px; text-align: center; font-weight: 600; }

.chat-shell { display: grid; grid-template-columns: 1fr; background: var(--surface); }
.chat-side { display: none; }
@media (min-width: 960px) {
  .main-chat { padding: 24px 32px !important; }
  .wrap-chat { height: calc(100dvh - var(--top) - 48px); max-width: 1240px; }
  .chat-shell { grid-template-columns: 280px minmax(0, 1fr); flex: 1 1 auto; min-height: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
  .chat-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-right: 1px solid var(--line); }
  .chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 8px; }
  .chat-side-head h2 { margin: 0; font-size: 19px; }
  .chat-side .chan-list { overflow-y: auto; padding: 4px 8px 16px; }
  .chat-side .chan:hover { background: var(--tint); }
}
.convo { background: var(--surface); }
.convo-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 18px; }
.convo-title { font-size: 16px; }
.convo-scroll { background: var(--surface); }
.msg { padding: 7px 18px 3px; }
.msg:hover { background: var(--surface-2); }
.msg-av .avatar { border-radius: 50%; width: 36px; height: 36px; }
.msg-meta strong { font-size: 14.5px; }
.msg.mine .msg-meta strong { color: var(--brand-ink); }
.day-sep { font-weight: 500; }
.composer { border-color: var(--line-2); border-radius: 12px; margin: 0 14px 12px; }
.composer:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px rgba(227, 207, 143, .5); }
.composer .send { background: var(--navy); color: var(--accent); border-radius: 9px; }
.chan-add-menu .pop { border-radius: 12px; }
.chat-shell { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.chat-shell > .convo { min-height: 0; }
.hero .verse b { text-transform: none; letter-spacing: 0; font-size: 13px; font-style: normal; }
.invite-compact .copy-field input { display: none; }
.invite-compact .invite-row .grow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.invite-compact .invite-row .title, .invite-compact .invite-row .meta { grid-column: 1; }
.invite-compact .copy-field { grid-column: 2; grid-row: 1 / span 2; margin-top: 0 !important; display: flex; gap: 8px; }
@media (max-width: 640px) { .invite-compact .invite-row .grow { grid-template-columns: 1fr; } .invite-compact .copy-field { grid-column: 1; grid-row: auto; margin-top: 10px !important; } }
.hide-sm-only-t { display: none; }
@media (min-width: 960px) { .more-section { display: none; } .show-sm-only-t { display: none; } .hide-sm-only-t { display: inline; } }
/* chat rows: name over the last line, time at the right (previews only on the phone list) */
.chan-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.chan-text .chan-name { flex: none; }
.chan-last, .chan-when { display: none; }
.chan-card .chan { min-height: 60px; padding: 10px 12px; align-items: center; }
.chan-card .chan .chan-hash { align-self: flex-start; padding-top: 1px; }
.chan-card .chan-last { display: block; font: 400 13.5px/1.35 var(--font); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chan-card .chan.has-unread .chan-last { color: var(--ink); font-weight: 500; }
.chan-card .chan-when { display: block; align-self: flex-start; font: 500 12px/1.4 var(--font); color: var(--ink-3); margin-left: 8px; white-space: nowrap; }
.chan-card .chan .count { align-self: center; }
.chan-card .avatar-xs { width: 36px; height: 36px; flex-basis: 36px; font-size: 13px; }
.chan-card .chan:not(.dm) .chan-hash { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: inline-grid; place-items: center; color: var(--ink-2); font-size: 15px; flex: 0 0 36px; }
.more-section { margin-bottom: 20px !important; }

/* ===================== v4 · richer gold ===================== */
:root { --accent: #c9a227; --accent-deep: #a8851a; --accent-light: #e6c04a; --accent-soft: #f8edcc; --gold: #c9a227; }
.hero .eyebrow, .hero .verse b, .stat.accent .value { color: var(--accent-light); }
.btn-gold { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-gold:hover { background: #d8b13a; border-color: #d8b13a; color: var(--on-accent); }
@media (min-width: 960px) {
  .nav a.on { background: var(--accent); color: var(--on-accent); font-weight: 600; }
  .nav a .count { background: rgba(201, 162, 39, .22); color: var(--accent-light); }
  .nav a.on .count { background: var(--on-accent); color: var(--accent-light); }
}
.chan .count, .count-pill, .bell b { background: var(--accent); color: var(--on-accent); }
.chan.on .chan-hash { color: var(--accent-light); }
.composer .send { color: var(--accent-light); }
.tabbar a.on::before { background: var(--accent); height: 3px; }
.tabbar a .tab-dot, .dot-count { background: var(--accent-deep); color: #fff; }
input:focus, select:focus, textarea:focus, .composer:focus-within { box-shadow: 0 0 0 3px rgba(201, 162, 39, .35); }
.tone-gold { background: var(--accent-soft); color: #6a5110; }
.hero { box-shadow: inset 0 -3px 0 var(--accent); }

/* ===================== the feed ===================== */
.home-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .home-grid { grid-template-columns: minmax(0, 620px) minmax(280px, 340px); justify-content: center; gap: 28px; } .home-side { position: sticky; top: calc(var(--top) + 20px); } }
.home-side > * + * { margin-top: 16px; }
.hero-compact { padding: 22px 24px; }
.hero-compact h1 { font-size: 26px; }
.hero-compact .verse { margin-top: 12px; padding-top: 12px; }
.feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.feed-single { max-width: 620px; }

.post { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.post-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.post-head .avatar { width: 38px; height: 38px; font-size: 13px; }
.post-seal { background: #fff; border: 1px solid var(--line); padding: 2px; }
.post-who { font: 600 15px/1.2 var(--font); }
.post-meta { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.post-meta a { color: inherit; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; }
.post-menu summary { padding: 6px 10px; color: var(--ink-3); font-size: 13px; letter-spacing: .1em; }

.post-media { position: relative; background: #0b0d14; }
.post-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.post-track::-webkit-scrollbar { display: none; }
.post-slide { position: relative; flex: 0 0 100%; margin: 0; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; max-height: 680px; aspect-ratio: 4 / 5; }
.post-media:not(.is-carousel) .post-slide { aspect-ratio: auto; }
.post-slide img, .post-slide video { width: 100%; height: 100%; max-height: 680px; object-fit: contain; display: block; }
.post-media:not(.is-carousel) .post-slide img { height: auto; }
.post-dl { position: absolute; right: 10px; bottom: 10px; padding: 7px 12px; border-radius: 999px; background: rgba(10, 13, 24, .72); color: #fff; font: 600 12.5px/1 var(--font); text-decoration: none; }
.post-dl:hover { background: rgba(10, 13, 24, .9); text-decoration: none; color: #fff; }
.post-slide video ~ .post-dl { bottom: auto; top: 10px; }
.post-count { position: absolute; right: 10px; top: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(10, 13, 24, .72); color: #fff; font: 600 12px/1 var(--font); }
.post-slide:has(video) ~ .post-count, .post-media:has(video) .post-count { right: auto; left: 10px; }

.post-actions { display: flex; align-items: center; gap: 4px; padding: 8px 10px 2px; }
.act { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px; border: 0; background: none; border-radius: 10px; color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; }
.act:hover { background: var(--surface-2); text-decoration: none; }
.act svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.act.is-on { color: #d12d4f; }
.act.is-on svg { fill: currentColor; stroke: currentColor; }
.act.pop svg { animation: likepop .32s ease-out; }
@keyframes likepop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .act.pop svg { animation: none; } }
.act-text { margin-left: auto; color: var(--ink-2); font-size: 13.5px; }

.post-body { padding: 4px 16px 4px; }
.post-title { font: 600 17px/1.35 var(--font); margin: 4px 0 6px; }
.post-text { margin: 0 0 6px; font-size: 15px; line-height: 1.55; color: var(--ink); white-space: normal; }
.post-text.is-clamped { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-more, .post-all { font: 500 14px/1.4 var(--font); color: var(--ink-3); text-decoration: none; }
.post-more:hover, .post-all:hover { color: var(--ink); }
.post-comments { padding: 2px 16px 0; display: flex; flex-direction: column; gap: 3px; }
.post-c { margin: 0; font-size: 14.5px; line-height: 1.45; }
.post-reply { display: flex; align-items: center; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--rule); margin-top: 10px; }
.post-reply input { flex: 1; border: 0 !important; box-shadow: none !important; padding: 0; min-height: 36px; background: transparent; font-size: 14.5px; }
.post-reply button { border: 0; background: none; color: var(--accent-deep); font: 700 14px/1 var(--font); cursor: pointer; padding: 8px 4px; }
.post-reply input:placeholder-shown + button { opacity: .45; }

.post-bday { text-align: center; padding: 18px 20px 8px; background: var(--accent-soft); }
.post-bday .avatar-xl { width: 92px; height: 92px; font-size: 30px; margin: 0 auto 10px; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--accent); }
.post-bday h2 { font-size: 21px; margin: 4px 0 6px; }
.post-bday p { color: var(--ink-2); max-width: 420px; margin: 0 auto 6px; }
.post-announcement .post-head .post-who::after { content: ""; }

.post-thread .thread { padding: 4px 0; }
.tc { display: flex; gap: 10px; align-items: flex-start; padding: 10px 22px; border-top: 1px solid var(--rule); }
.tc:first-child { border-top: 0; }
.post-reply.in-thread { margin-top: 0; }
.feed-more { text-align: center; padding: 8px 0 24px; }

/* the media team's composer */
.composer-card { padding: 14px 16px; }
.cc-row { display: flex; gap: 10px; align-items: flex-start; }
.cc-row textarea { flex: 1; border: 0 !important; box-shadow: none !important; resize: none; padding: 8px 0; min-height: 40px; font-size: 15px; }
.cc-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 10px 0 2px; }
.cc-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--tint); }
.cc-thumb img, .cc-thumb video { width: 100%; height: 100%; object-fit: cover; }
.cc-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--accent); transition: width .2s; }
.cc-thumb.is-done .cc-bar { width: 100% !important; }
.cc-thumb.is-error { outline: 2px solid #c4242a; }
.cc-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(10, 13, 24, .7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.cc-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.cc-status { flex: 1; }
.cc-pick { cursor: pointer; }

/* phones: the strip above the feed */
.up-strip { display: flex; flex-direction: column; gap: 8px; }
.up-strip:empty { display: none; }
.up-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.up-k { font: 600 12.5px/1.2 var(--font); color: var(--accent-deep); }
.up-v { font: 500 14.5px/1.35 var(--font); }
@media (max-width: 640px) {
  .feed { margin: 0 -16px; gap: 10px; }
  .post, .composer-card, .feed > .card { border-radius: 0; border-left: 0; border-right: 0; }
}
.feed .post, .feed-single .post { padding: 0; margin: 0; box-shadow: none; }
.post-head .grow { flex: 1 1 auto; min-width: 0; }
.post-slide { aspect-ratio: 4 / 3; }
.post-slide img { object-fit: cover; }
.post-slide video { object-fit: contain; background: #0b0d14; }
.post-media:not(.is-carousel) .post-slide { aspect-ratio: auto; max-height: 720px; }
.post-media:not(.is-carousel) .post-slide img { object-fit: contain; max-height: 720px; }
.post-zoom { display: block; width: 100%; height: 100%; }
.quick-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: 600 13.5px/1 var(--font); text-decoration: none; }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.verse-card { background: var(--navy); border-color: var(--navy); color: var(--on-dark); font-style: italic; line-height: 1.55; }
.verse-ref { font-style: normal; font-weight: 600; color: var(--accent-light); margin-top: 8px !important; font-size: 13.5px; }
.up-strip { margin-bottom: 12px; }
@media (max-width: 640px) { .quick-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; } .chip { flex: none; } }

/* chat composer tools and media */
.composer { position: relative; align-items: flex-end; gap: 4px; padding: 6px 6px 6px 6px; }
.composer .tools { display: flex; align-items: center; gap: 2px; }
.tool { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); cursor: pointer; flex: none; }
.tool:hover { background: var(--surface-2); color: var(--ink); }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool-gif { font: 800 11.5px/1 var(--font); letter-spacing: .02em; border: 1.6px solid currentColor; width: 34px; height: 24px; border-radius: 6px; margin: 0 4px; }
.composer textarea { padding: 8px 4px; }
.composer.is-recording textarea, .composer.is-recording .tools, .composer.is-recording .send, .composer.is-recording .tool-mic { visibility: hidden; }
.rec { position: absolute; inset: 0; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; background: var(--surface); border-radius: 12px; font-weight: 600; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #d12d4f; animation: recblink 1s infinite; }
@keyframes recblink { 50% { opacity: .25; } }
.rec-hint { color: var(--ink-3); font-weight: 500; flex: 1; }
.pop-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40; width: min(360px, calc(100vw - 32px)); max-height: 320px; overflow-y: auto; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(4, 9, 28, .16); }
.emoji-panel { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-panel button { border: 0; background: none; font-size: 23px; line-height: 1; height: 40px; border-radius: 8px; cursor: pointer; }
.emoji-panel button:hover { background: var(--surface-2); }
.gif-panel { width: min(420px, calc(100vw - 32px)); }
.gif-panel input { margin-bottom: 8px; }
.gif-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gif-grid button { border: 0; padding: 0; background: var(--tint); border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; }
.gif-grid img { width: 100%; height: 100%; object-fit: cover; }
.msg-media { position: relative; margin: 4px 0 2px; max-width: min(380px, 100%); }
.msg-media img, .msg-media video { display: block; max-width: 100%; max-height: 340px; border-radius: 12px; background: var(--tint); }
.msg-gif img { max-height: 240px; }
.msg-dl { position: absolute; right: 8px; bottom: 8px; padding: 5px 10px; border-radius: 999px; background: rgba(10, 13, 24, .72); color: #fff; font: 600 12px/1 var(--font); text-decoration: none; opacity: 0; transition: opacity .15s; }
.msg-media:hover .msg-dl, .msg-media:focus-within .msg-dl { opacity: 1; }
@media (hover: none) { .msg-dl { opacity: 1; } }
.voice { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: var(--accent-soft); border-radius: 14px; max-width: 320px; }
.voice-k { font: 600 12px/1 var(--font); color: #6a5110; }
.voice audio { width: 100%; height: 36px; }
.file-chip { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; max-width: 320px; }
.file-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip span { font-size: 12.5px; color: var(--ink-3); }
.msg.uploading { color: var(--ink-3); font-size: 13.5px; padding: 6px 18px 6px 64px; }
@media (max-width: 520px) { .tool { width: 34px; } .tool-gif { width: 30px; margin: 0 2px; } .composer-hint { display: none; } }
.feed > .quick-row { margin-bottom: 0; }

/* ===================== v5 · Instagram-style shell: one column, bottom bar everywhere ===================== */
.app-ig .sidebar { display: none !important; }
.app-ig .topbar { margin-left: 0 !important; padding: 0 16px; }
.app-ig .topbar .brand { display: flex !important; }
.app-ig .main { margin-left: 0 !important; padding: 18px 16px calc(var(--tabbar) + 32px) !important; }
.app-ig .wrap { max-width: 860px; margin: 0 auto; }
.app-ig .tabbar { display: grid !important; }
@media (min-width: 960px) {
  .app-ig .topbar { padding: 0 max(24px, calc((100vw - 980px) / 2)); }
  .app-ig .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); bottom: 14px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 32px rgba(4, 9, 28, .12); height: 64px; padding-bottom: 0; }
  .app-ig .tabbar a.on::before { top: 0; }
  .app-ig .main { padding-bottom: 110px !important; }
}
.tabbar a .avatar-xs { width: 24px; height: 24px; font-size: 10px; flex-basis: 24px; }
.tabbar a.on .avatar-xs { box-shadow: 0 0 0 2px var(--brand-ink); }
.tabbar a { position: relative; }

/* Home: one centred feed column */
.home-grid { grid-template-columns: minmax(0, 620px) !important; justify-content: center; }
.app-ig .wrap:has(.home-grid) { max-width: 620px; }
.up-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; margin: 0 0 14px; padding-bottom: 2px; scrollbar-width: none; }
.up-row::-webkit-scrollbar { display: none; }
.up-row .up-item { flex: 0 0 auto; width: 210px; scroll-snap-align: start; }
.up-item.is-new { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }
.up-item.is-new .up-k { color: var(--accent-light); }
@media (max-width: 640px) { .up-row { margin: 0 -16px 12px; padding: 0 16px 2px; } }

/* Chat fills the space above the bottom bar */
.app-ig .main-chat { padding: 0 !important; }
.app-ig .wrap-chat { height: calc(100dvh - var(--top) - var(--tabbar) - env(safe-area-inset-bottom)); max-width: none; }
@media (min-width: 960px) {
  .app-ig .main-chat { padding: 16px 24px 96px !important; }
  .app-ig .wrap-chat { height: calc(100dvh - var(--top) - 112px); max-width: 1100px; margin: 0 auto; }
}

/* Profile: the menu lists */
.more-h { font: 600 13.5px/1.2 var(--font); color: var(--ink-3); margin: 18px 4px 8px; }
.more-section { display: block !important; }
.more-links a { justify-content: flex-start; gap: 10px; }
.more-links a .count-pill { margin-left: auto; }
.more-links a .count-pill + ::after { content: none; }
.post-menu { margin-left: auto; }
.post-menu summary { min-width: 40px; min-height: 36px; justify-content: center; }
.post-menu .menu-panel { min-width: 230px; max-height: 70vh; overflow-y: auto; }
.menu-panel .danger { color: #a3201a; }
.heart-burst { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M12 20.5s-7.5-4.6-9.3-9.2C1.4 8 3.5 4.5 7 4.5c2 0 3.5 1.1 5 3 1.5-1.9 3-3 5-3 3.5 0 5.6 3.5 4.3 6.8-1.8 4.6-9.3 9.2-9.3 9.2z'/%3E%3C/svg%3E");
  animation: burst .8s ease-out forwards; filter: drop-shadow(0 4px 12px rgba(0,0,0,.35)); }
@keyframes burst { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .heart-burst { animation-duration: .01s; } }
.post-slide { user-select: none; -webkit-user-select: none; }
/* public share page */
.public-post { background: var(--bg); }
.pub-head { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pub-head img { border-radius: 50%; }
.pub-main { max-width: 620px; margin: 20px auto 48px; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }
.pub-cta { text-align: center; padding: 24px; background: var(--navy); color: var(--on-dark); border-radius: 16px; }
.pub-cta h2 { color: var(--on-dark); }
.pub-cta p { color: #c9ccd4; }
.public-post .post { padding: 0; overflow: hidden; } .public-post .post-body { padding: 12px 16px 16px; }
.sms-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sms-summary > div { background: var(--surface-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.sms-summary strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* ===================== chat list, WhatsApp style ===================== */
.chat-rows { display: flex; flex-direction: column; }
.rows-h { display: flex; align-items: center; justify-content: space-between; font: 600 13.5px/1.2 var(--font); color: var(--ink-3); margin: 14px 14px 6px; }
.rows-h:first-child { margin-top: 6px; }
.rows-new { font: 600 13px/1 var(--font); color: var(--accent-deep); text-decoration: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--ink); text-decoration: none; border-radius: 12px; }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row.on { background: var(--accent-soft); }
.row-av { width: 50px; height: 50px; border-radius: 50%; flex: 0 0 50px; object-fit: cover; display: inline-grid; place-items: center; font: 700 16px/1 var(--font); }
.row-av-group { border-radius: 16px; }
img.row-av { background: var(--tint); }
.row-av-plus { background: var(--surface-2); color: var(--ink-2); font-size: 24px; font-weight: 400; }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-top, .row-bottom { display: flex; align-items: center; gap: 8px; }
.row-name { flex: 1 1 auto; min-width: 0; font: 600 15.5px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-when { font: 500 12px/1 var(--font); color: var(--ink-3); flex: none; }
.row.has-unread .row-when { color: var(--accent-deep); font-weight: 700; }
.row-last { flex: 1 1 auto; min-width: 0; font: 400 14px/1.3 var(--font); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.has-unread .row-last { color: var(--ink); font-weight: 500; }
.row-count { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 12px/22px var(--font); text-align: center; }
.chat-card { padding: 4px 4px 10px; }
@media (max-width: 640px) { .chat-card { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; } }
.chat-side .chat-rows { overflow-y: auto; padding: 0 6px 14px; }
.chat-side .row-av { width: 44px; height: 44px; flex-basis: 44px; font-size: 14px; }
.head-av { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }
.chan-tabs { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.chan-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font: 600 13.5px/1 var(--font); text-decoration: none; white-space: nowrap; }
.chan-tabs a.on { background: var(--navy); color: var(--on-dark); }
.chan-tabs .row-count { height: 18px; min-width: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }
.group-pic { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* =====================================================================
   v6 · bright palette — clean white, royal purple-navy, vivid gold, coral.
   Light is the default for everyone (users.theme NULL or 'light'). Dark is only
   used when the member picks Dark, or picks "Same as my phone" ('system') and
   the phone is dark. Dark is near-black neutral with a faint grain + warm glow.
   ===================================================================== */
:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f6f4fb; --tint: #efebf8; --field: #ffffff;
  --line: #ece8f5; --line-2: #d9d3ea; --rule: #f1eef8;
  --ink: #1a1530; --ink-2: #3f3a58; --ink-3: #5f5878;
  --navy: #1b1446; --navy-2: #2a2160; --navy-3: #3a2f80; --indigo: #2a2160; --navy-hover: #2a2160;
  --brand-ink: #1b1446;
  --on-dark: #ffffff; --on-dark-2: #d6d0f0;
  --accent: #f5b700; --accent-deep: #d99a00; --accent-light: #ffc933; --accent-soft: #fff3cc; --accent-text: #8a6100; --accent-ink: #7a5600;
  --gold: #f5b700; --gold-600: #8a6100; --gold-50: #fff3cc;
  --on-accent: #1b1446;
  --coral: #ff5a5f; --coral-soft: #ffe8e9; --coral-ink: #c8242b; --on-coral: #1b1446;
  --flame: #ff5a5f; --flame-50: #ffe8e9;
  --blue: #5b3fd6; --blue-600: #4b30c4; --blue-50: #efebff; --link: #4b30c4;
  --ok: #15803d; --ok-50: #e7f6ec; --ok-ink: #166534;
  --warn: #9a5b00; --warn-50: #fff1d6; --warn-ink: #8a4b00;
  --bad: #b42318; --bad-50: #fdecea; --bad-ink: #b42318; --bad-line: #f5c6c0;
  --info-50: #efebff; --info-ink: #3b2a99;
  --topbar-bg: #1b1446; --topbar-ink: #ffffff; --topbar-line: transparent;
  --hero-bg: radial-gradient(420px 220px at 100% 0%, rgba(255, 90, 95, .32), transparent 65%), radial-gradient(380px 240px at 0% 110%, rgba(245, 183, 0, .22), transparent 60%), linear-gradient(135deg, #1b1446 0%, #33237a 100%);
  --focus: rgba(245, 183, 0, .45);
  --shadow-sm: 0 1px 2px rgba(27, 20, 70, .05);
  --shadow-pop: 0 18px 40px rgba(27, 20, 70, .16);
  --primary: #1b1446; --primary-hover: #3a2f80; --on-primary: #ffffff;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0c; --surface: #141417; --surface-2: #1c1c21; --tint: #232329; --field: #101013;
  --line: #2a2a31; --line-2: #3a3a43; --rule: #1f1f25;
  --ink: #f2f2f5; --ink-2: #b4b4be; --ink-3: #8e8e99;
  --navy: #2c2c34; --navy-2: #34343d; --navy-3: #3d3d47; --indigo: #34343d; --navy-hover: #3d3d47;
  --brand-ink: #f2f2f5;
  --on-dark: #ffffff; --on-dark-2: #c9c9d1;
  --primary: #f5b700; --primary-hover: #ffc933; --on-primary: #0a0a0c;
  --accent-soft: #2a2312; --accent-text: #ffc933; --accent-ink: #ffd666; --gold-600: #ffc933; --gold-50: #2a2312;
  --on-accent: #0a0a0c; --on-coral: #0a0a0c;
  --coral-soft: #351a1c; --coral-ink: #ff8a8e; --flame-50: #351a1c;
  --blue: #a99cf0; --blue-600: #bdb2f5; --blue-50: #1e1d29; --link: #ffcf4d;
  --ok: #4ade80; --ok-50: #0f2418; --ok-ink: #7ee2a4;
  --warn: #ffc44d; --warn-50: #2a2008; --warn-ink: #ffd27a;
  --bad: #ff8a80; --bad-50: #2e1214; --bad-ink: #ff9a91; --bad-line: #5a2226;
  --info-50: #1e1d29; --info-ink: #d2cbf5;
  --topbar-bg: #0f0f12; --topbar-ink: #f2f2f5; --topbar-line: #2a2a31;
  --hero-bg: radial-gradient(420px 220px at 100% 0%, rgba(255, 90, 95, .22), transparent 65%), radial-gradient(380px 240px at 0% 110%, rgba(245, 183, 0, .14), transparent 60%), linear-gradient(135deg, #1e1e24 0%, #121215 100%);
  --focus: rgba(245, 183, 0, .4);
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .6), 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-pop: 0 18px 40px rgba(0, 0, 0, .65);
}
html[data-theme="dark"] [class*="av-"]:not(img) { filter: saturate(1.15) brightness(.8); }
html[data-theme="dark"] body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url("../img/grain.svg") repeat; background-size: 180px 180px; opacity: .06; }
html[data-theme="dark"] body::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 520px; z-index: -1; pointer-events: none; background: radial-gradient(520px 300px at 85% -60px, rgba(255, 90, 95, .10), transparent 70%), radial-gradient(560px 320px at 10% -80px, rgba(245, 183, 0, .09), transparent 70%); }
html[data-theme="dark"] .tabs a.on, html[data-theme="dark"] .chan-tabs a.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
html[data-theme="dark"] .topbar .brand small { color: var(--accent); }
html[data-theme="dark"] .toast.error { background: #5a1a1e; color: #fff; }
html[data-theme="dark"] .verse-card, html[data-theme="dark"] .up-item.is-new, html[data-theme="dark"] .stat.accent, html[data-theme="dark"] .pub-cta { background: var(--surface-2); border-color: var(--line-2); }
html[data-theme="dark"] .post-seal, html[data-theme="dark"] .brand-icon, html[data-theme="dark"] .lockup-icon { background: #f2f2f5; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0a0a0c; --surface: #141417; --surface-2: #1c1c21; --tint: #232329; --field: #101013;
    --line: #2a2a31; --line-2: #3a3a43; --rule: #1f1f25;
    --ink: #f2f2f5; --ink-2: #b4b4be; --ink-3: #8e8e99;
    --navy: #2c2c34; --navy-2: #34343d; --navy-3: #3d3d47; --indigo: #34343d; --navy-hover: #3d3d47;
    --brand-ink: #f2f2f5;
    --on-dark: #ffffff; --on-dark-2: #c9c9d1;
    --primary: #f5b700; --primary-hover: #ffc933; --on-primary: #0a0a0c;
    --accent-soft: #2a2312; --accent-text: #ffc933; --accent-ink: #ffd666; --gold-600: #ffc933; --gold-50: #2a2312;
    --on-accent: #0a0a0c; --on-coral: #0a0a0c;
    --coral-soft: #351a1c; --coral-ink: #ff8a8e; --flame-50: #351a1c;
    --blue: #a99cf0; --blue-600: #bdb2f5; --blue-50: #1e1d29; --link: #ffcf4d;
    --ok: #4ade80; --ok-50: #0f2418; --ok-ink: #7ee2a4;
    --warn: #ffc44d; --warn-50: #2a2008; --warn-ink: #ffd27a;
    --bad: #ff8a80; --bad-50: #2e1214; --bad-ink: #ff9a91; --bad-line: #5a2226;
    --info-50: #1e1d29; --info-ink: #d2cbf5;
    --topbar-bg: #0f0f12; --topbar-ink: #f2f2f5; --topbar-line: #2a2a31;
    --hero-bg: radial-gradient(420px 220px at 100% 0%, rgba(255, 90, 95, .22), transparent 65%), radial-gradient(380px 240px at 0% 110%, rgba(245, 183, 0, .14), transparent 60%), linear-gradient(135deg, #1e1e24 0%, #121215 100%);
    --focus: rgba(245, 183, 0, .4);
    --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .6), 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-pop: 0 18px 40px rgba(0, 0, 0, .65);
  }
  html[data-theme="system"] [class*="av-"]:not(img) { filter: saturate(1.15) brightness(.8); }
  html[data-theme="system"] body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: url("../img/grain.svg") repeat; background-size: 180px 180px; opacity: .06; }
  html[data-theme="system"] body::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 520px; z-index: -1; pointer-events: none; background: radial-gradient(520px 300px at 85% -60px, rgba(255, 90, 95, .10), transparent 70%), radial-gradient(560px 320px at 10% -80px, rgba(245, 183, 0, .09), transparent 70%); }
  html[data-theme="system"] .tabs a.on, html[data-theme="system"] .chan-tabs a.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
  html[data-theme="system"] .topbar .brand small { color: var(--accent); }
  html[data-theme="system"] .toast.error { background: #5a1a1e; color: #fff; }
  html[data-theme="system"] .verse-card, html[data-theme="system"] .up-item.is-new, html[data-theme="system"] .stat.accent, html[data-theme="system"] .pub-cta { background: var(--surface-2); border-color: var(--line-2); }
  html[data-theme="system"] .post-seal, html[data-theme="system"] .brand-icon, html[data-theme="system"] .lockup-icon { background: #f2f2f5; }
}

body { background: var(--bg); color: var(--ink); }
a, a:hover { color: var(--ink); }
.link-btn, .msg-body a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus, select:focus, textarea:focus, .composer:focus-within { border-color: var(--brand-ink); box-shadow: 0 0 0 3px var(--focus); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], select, textarea, input:not([type]) {
  background: var(--field); color: var(--ink); border-color: var(--line-2); }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input[type=file]::file-selector-button { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.check input, input[type=radio] { accent-color: var(--accent-deep); }
.choice span { background: var(--field); color: var(--ink); }
.choice input:checked + span { background: var(--accent-soft); color: var(--ink); border-color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent-deep); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); }
fieldset.theme-pick { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.theme-pick legend { padding: 0; font: 600 13.5px/1.3 var(--font); color: var(--ink); margin-bottom: 6px; }
.eyebrow, .section-label { color: var(--ink-3); }

/* buttons */
.btn-primary, .btn-blue, .btn-ok { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover, .btn-blue:hover, .btn-ok:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-gold { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-gold:hover { background: var(--accent-light); border-color: var(--accent-light); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--bad-ink); border-color: var(--bad-line); }
.btn-danger:hover { background: var(--bad-50); color: var(--bad-ink); }
.menu-panel .danger { color: var(--bad-ink); }
.hero .btn-ghost { background: rgba(255, 255, 255, .08); color: var(--on-dark); border-color: rgba(255, 255, 255, .3); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .16); color: var(--on-dark); }

/* alerts, toasts */
.alert-error { background: var(--bad-50); border-color: var(--bad-line); color: var(--bad-ink); }
.alert-ok { background: var(--ok-50); border-color: transparent; color: var(--ok-ink); }
.alert-info { background: var(--info-50); border-color: transparent; color: var(--info-ink); }
.alert-warn { background: var(--warn-50); border-color: transparent; color: var(--warn-ink); }
.toast { background: var(--navy); color: var(--on-dark); box-shadow: var(--shadow-pop); }
.toast.error { background: #b42318; color: #fff; }
.toast.ok::before { background: var(--accent); }
.composer-error { background: var(--bad-50); color: var(--bad-ink); }
.cc-thumb.is-error { outline-color: var(--coral); }

/* badges */
.badge { background: var(--tint); color: var(--ink-2); }
.tone-ok { background: var(--ok-50); color: var(--ok-ink); }
.tone-warn { background: var(--warn-50); color: var(--warn-ink); }
.tone-bad { background: var(--bad-50); color: var(--bad-ink); }
.tone-blue { background: var(--blue-50); color: var(--blue-600); }
.tone-gold { background: var(--accent-soft); color: var(--accent-ink); }
.tone-flame { background: var(--coral-soft); color: var(--coral-ink); }
.tone-navy { background: var(--navy); color: var(--on-dark); }
.group-chip, .voice-k { color: var(--accent-ink); }
.group-chip { background: var(--accent-soft); }
/* "new" counts are coral; text is the dark brand colour so it stays readable */
.dot-count, .tabbar a .tab-dot, .nav a .count, .chan .count, .count-pill, .row-count, .bell b,
.chan.on .count, .nav a.on .count { background: var(--coral); color: var(--on-coral); }
.dot-count, .tabbar a .tab-dot { box-shadow: 0 0 0 2px var(--surface); }
.topbar .dot-count { box-shadow: 0 0 0 2px var(--topbar-bg); }

/* gold as text needs the darker shade on white */
.post-reply button, .up-k, .rows-new, .row.has-unread .row-when { color: var(--accent-text); }
.when .m { color: var(--coral-ink); }

/* top bar: royal purple-navy */
.topbar, .app-ig .topbar { background: var(--topbar-bg); color: var(--topbar-ink); border-bottom: 1px solid var(--topbar-line); }
.topbar .brand, .topbar .brand-word, .topbar .brand b, .topbar .icon-btn, .topbar .user-name { color: var(--topbar-ink); }
.topbar .brand small { color: var(--accent-light); }
.topbar .icon-btn:hover, .topbar .menu summary:hover { background: rgba(255, 255, 255, .1); }
.topbar .bell { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: var(--topbar-ink); }
.topbar .bell:hover { background: rgba(255, 255, 255, .14); color: var(--topbar-ink); border-color: rgba(255, 255, 255, .35); }
.topbar .brand-icon { box-shadow: 0 0 0 2px var(--accent); }
.menu-panel, .pop-panel, .chan-add-menu .pop { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-pop); color: var(--ink); }
.menu-panel a, .menu-panel button { color: var(--ink); }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); }

/* bottom tab bar */
.tabbar { background: var(--surface); border-top-color: var(--line); }
.app-ig .tabbar { border-color: var(--line); box-shadow: var(--shadow-pop); }
.tabbar a { color: var(--ink-3); }
.tabbar a.on, .tabbar a.on svg { color: var(--brand-ink); }
.tabbar a.on::before { background: var(--accent); height: 3px; width: 32px; }
.tabbar a.on .avatar-xs { box-shadow: 0 0 0 2px var(--accent); }

/* hero and dark panels */
.hero { background: var(--hero-bg); box-shadow: inset 0 -3px 0 var(--accent); color: var(--on-dark); }
.hero h1 { color: var(--on-dark); }
.hero p, .hero .verse { color: var(--on-dark-2); }
.hero .verse { border-top-color: rgba(255, 255, 255, .16); }
.hero .eyebrow, .hero .verse b, .stat.accent .value, .verse-ref, .up-item.is-new .up-k { color: var(--accent-light); }
.verse-card, .up-item.is-new, .stat.accent, .pub-cta { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }
.pub-cta h2 { color: var(--on-dark); }
.pub-cta p, .stat.accent .label, .stat.accent .delta { color: var(--on-dark-2); }

/* cards, lists, tabs, chips */
.card, .post, .stat, .up-item, .chip, .tabs a, .more-links { background: var(--surface); border-color: var(--line); }
.install { background: var(--accent-soft); border-color: var(--line); }
.post.pinned { background: linear-gradient(90deg, var(--accent-soft), var(--surface) 60%); }
.tabs a.on, .chan-tabs a.on { background: var(--navy); border-color: var(--navy); color: var(--on-dark); }
.chip:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.list a.row-link:hover .title { color: var(--brand-ink); }
.row.on { background: var(--accent-soft); }
.stat .value { color: var(--ink); }
.when .d { color: var(--ink); }
.post-seal, .brand-icon, .lockup-icon, .qr-box { background: #fff; }
.post-bday { background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.post-bday .avatar-xl { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent); }
.bday { background: linear-gradient(90deg, var(--coral-soft), var(--surface)); }
/* likes and reactions: coral */
.act.is-on { color: var(--coral); }
.rec-dot { background: var(--coral); }
.msg-del button:hover { color: var(--coral-ink); }

/* chat */
.chan.on { background: var(--navy); color: var(--on-dark); }
.chan.on .chan-hash { color: var(--accent-light); }
.chat-side { background: var(--surface-2); border-color: var(--line); }
.chat-side .chan:hover, .row:hover { background: var(--tint); }
.chat-shell, .convo, .convo-head, .convo-scroll, .chan-tabs, .composer-note, .rec, .pub-head { background: var(--surface); }
.chan-tabs a { background: var(--surface-2); color: var(--ink-2); }
.composer { background: var(--field); border-color: var(--line-2); }
.composer textarea { color: var(--ink); }
.composer .send { background: var(--accent); color: var(--on-accent); }
.composer .send:hover { background: var(--accent-light); }
.msg.mine .msg-meta strong { color: var(--brand-ink); }
.voice { background: var(--accent-soft); }

/* default avatar: lavender with brand letters */
.avatar:not([class*="av-"]):not(img), .av-7 { background: var(--tint); color: var(--brand-ink); }
.cc-row textarea, .post-reply input { background: transparent; color: var(--ink); }


/* sign-in screens */
.auth-body { background: radial-gradient(900px 480px at 90% -10%, rgba(255, 90, 95, .28), transparent 60%), radial-gradient(700px 480px at -10% 110%, rgba(245, 183, 0, .2), transparent 60%), linear-gradient(160deg, #1b1446 0%, #33237a 100%); color: #fff; }
.auth-card { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.lockup-word, .auth-brand .church { color: #fff; }
.lockup-tag, .auth-brand .tag, .scripture b { color: #ffc933; }
.scripture { color: #d6d0f0; }
.auth-foot { color: #d6d0f0; }
.auth-foot a { color: #fff; }
.steps span { background: var(--line); }
.steps span.on { background: var(--accent); }

/* Save data: videos wait for a tap */
.ld-hold { position: relative; }
.ld-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 160px; border: 0; background: rgba(15, 11, 36, .55); color: #fff; font: 600 15px/1.2 var(--font); cursor: pointer; }
.ld-play span { padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.ld-hold video:not([src]) { min-height: 160px; }
