/* Reach One
   Layout: app shell — left sidebar on wide screens, sticky top bar + bottom tab bar on phones;
   one reading column (~760px). Single deliberate theme: matte black, with royal purple panels,
   royal blue actions and red for Scripture references and the daily call to action. */
:root {
  --bg: #121212;          /* matte black */
  --surface: #1b1b1e;
  --surface-2: #26262a;
  --ink: #f5f5f6;
  --muted: #a3a3ad;
  --line: #303035;

  --purple: #5a2a9c;      /* royal purple */
  --purple-text: #b28af0;
  --blue: #3a62dc;        /* royal blue */
  --blue-text: #85a3ff;
  --red: #e3263a;         /* red */
  --red-text: #ff5d6e;

  --royal: var(--purple);
  --royal-ink: #ffffff;
  --royal-muted: #e4d8f7;
  --primary: var(--blue);
  --on-primary: #ffffff;
  --accent: var(--red-text);
  --on-red: #ffffff;
  --good: #3fcf8e;
  --danger: #ff5d6e;
  --sel: rgba(58, 98, 220, 0.38);
  --hit: rgba(90, 42, 156, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);

  --m-shared: #6f8fff;
  --m-salvations: #ff4d5f;
  --m-healings: #3fcf8e;
  --m-deliverances: #b28af0;
  --m-baptisms: #3cc7db;
  --m-spirit: #f5a33b;
  --m-prayed: #a3a3ad;

  --font-display: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-scripture: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --step--1: 0.84rem;
  --step-0: 1rem;
  --step-1: 1.14rem;
  --step-2: 1.36rem;
  --step-3: 1.72rem;
  --step-4: 2.2rem;
  --radius: 14px;
  --radius-sm: 9px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --tabbar-h: 64px;
  color-scheme: dark;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--bg);
}
img, video { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-1); font-weight: 650; }
p { margin: 0; }
cite { font-style: normal; font-family: var(--font-body); font-size: 0.82em; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--blue-text); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.015em; }
.label, .eyebrow { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.ico { width: 20px; height: 20px; flex: none; }
.ico.big { width: 44px; height: 44px; color: var(--muted); }

/* ---------- shell ---------- */
.app { min-height: 100%; }
.sidebar { display: none; }
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 10px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; color: #ffffff; }
.brand img { border-radius: 8px; }
#view {
  max-width: 800px;
  margin: 0 auto;
  padding-top: 18px;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 32px);
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex;
  flex-direction: column;
  gap: 22px;
  outline: none;
}
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: var(--tabbar-h);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.tab .ico { width: 23px; height: 23px; }
.tab.active { color: var(--blue-text); }
.tab.active .ico { stroke-width: 2.2; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
  .topbar, .tab-bar { display: none; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    background: #0d0d0d;
    border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 4px 10px 8px; }
  #side-nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    color: var(--muted);
  }
  .nav-item:hover { background: var(--surface-2); color: var(--ink); }
  .nav-item.active { background: var(--surface-2); color: var(--ink); }
  .nav-item.active .ico { color: var(--blue-text); }
  .side-verse { margin-top: auto; padding: 0 10px; font-family: var(--font-scripture); font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
  .side-verse cite { display: block; margin-top: 4px; }
  #view { padding-top: 36px; padding-bottom: 64px; gap: 26px; }
  body::before { background: var(--bg); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background-color 0.15s ease;
}
/* Long button labels wrap on narrow phones instead of pushing the page sideways. */
.btn.wrap, .btn[data-action="ics"] { max-width: 100%; white-space: normal; text-align: left; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn .ico { width: 18px; height: 18px; }
.btn.small { min-height: 36px; padding: 6px 13px; font-size: 0.92rem; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn.cta { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn.cta:hover { background: color-mix(in srgb, var(--red) 88%, #fff); }
.btn.on-dark { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); color: var(--royal-ink); }
.btn.on-dark:hover { background: rgba(255, 255, 255, 0.2); }
.btn.ghost-dark { background: transparent; border-color: transparent; color: var(--royal-muted); text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost-dark:hover { color: var(--royal-ink); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.armed, .icon-btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.small { min-width: 32px; height: 32px; }
.icon-btn.small .ico { width: 17px; height: 17px; }
.icon-btn.text { display: inline-flex; align-items: center; font-family: var(--font-body); font-size: 1rem; white-space: nowrap; }
.icon-btn.text small { font-size: 0.7em; }
.icon-btn .confirm-text { font-size: 0.78rem; font-family: var(--font-body); }
.link, .link-btn { color: var(--blue-text); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link:hover, .link-btn:hover { text-decoration: underline; }
.link-btn .ico { width: 16px; height: 16px; }

/* ---------- common blocks ---------- */
.block { display: flex; flex-direction: column; gap: 12px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.block-head.wrap { flex-wrap: wrap; align-items: center; }
.page-title { font-size: var(--step-3); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: var(--step-1); margin-bottom: 2px; }
.lede { font-family: var(--font-scripture); font-size: 1rem; color: var(--muted); max-width: 62ch; line-height: 1.5; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: -10px; }
.back:hover { color: var(--ink); }
.greeting { font-weight: 600; font-size: var(--step-1); }
.greeting span { display: block; font-weight: 400; font-size: var(--step--1); color: var(--muted); }
.chip { display: inline-block; align-self: flex-start; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty p { max-width: 46ch; color: var(--muted); }
.empty.small { padding: 22px 18px; }
.loading { display: flex; flex-direction: column; gap: 10px; padding: 30px 0; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width 0.2s ease; }

/* ---------- mission (home hero) ---------- */
.mission {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px 20px;
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(65, 105, 225, 0.45), transparent 55%),
    var(--royal);
  color: var(--royal-ink);
}
.mission .eyebrow { color: var(--royal-muted); }
.mission h1 { font-size: clamp(1.7rem, 6vw, var(--step-4)); line-height: 1.1; max-width: 14ch; }
.mission-art { position: absolute; right: -36px; top: -30px; color: #ffffff; opacity: 0.09; pointer-events: none; }
.mission-art .ico { width: 230px; height: 230px; stroke-width: 1.1; }
.mission-verse { font-family: var(--font-scripture); font-size: 0.98rem; line-height: 1.45; color: var(--royal-muted); max-width: 52ch; }
.mission-verse cite { color: #ffffff; }
.week { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 40px)); gap: 8px; }
.week li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700; color: var(--royal-muted); }
.week i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.22); }
.week i .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.week li.done i { background: var(--red); border-color: var(--red); color: var(--on-red); }
.week li.today i { border: 2px solid #ffffff; }
.week li.today span { color: #ffffff; }
.week li.missed i { border-style: dashed; opacity: 0.6; }
.mission-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin-top: 4px; }
.streak { display: flex; align-items: baseline; gap: 6px; color: var(--royal-muted); }
.streak .ico { color: var(--red-text); align-self: center; }
.streak strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--royal-ink); font-variant-numeric: tabular-nums; }
.mission-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mission.is-done h1 { color: #ffffff; }

.notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.notice > div:first-child { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--blue-text); }
.notice h2 { font-size: 1rem; }
.notice p { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 520px) {
  .notice { grid-template-columns: auto minmax(0, 1fr); }
  .notice .btn { grid-column: 1 / -1; }
}

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.stat:hover { border-color: var(--primary); }
.stat strong { font-family: var(--font-display); font-size: var(--step-3); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.stat i { position: absolute; top: 10px; right: 10px; color: var(--muted); }
.stat i .ico { width: 17px; height: 17px; }

.equip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.equip-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}
.equip-card:hover { border-color: var(--primary); }
.equip-card .ico { color: var(--blue-text); width: 24px; height: 24px; margin-bottom: 4px; }
.equip-card span { color: var(--muted); font-size: 0.9rem; line-height: 1.4; }
.equip-card.story-card { background: color-mix(in srgb, var(--purple) 30%, var(--surface)); border-color: color-mix(in srgb, var(--purple) 70%, var(--line)); }
.equip-card.story-card .ico { color: var(--purple-text); }
@media (max-width: 480px) { .equip { grid-template-columns: 1fr; } }

.latest { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.latest > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.latest strong { overflow-wrap: anywhere; }
.mini-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; flex: none; }
.empty-latest { border-style: dashed; }
.empty-latest > .ico { width: 32px; height: 32px; color: var(--muted); margin: 0 6px; }

/* ---------- verses ---------- */
.scripture { font-family: var(--font-scripture); }
.verse-card { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.verse-card blockquote { margin: 0; font-size: 1.04rem; line-height: 1.6; }
.verse-card blockquote sup, .chapter-text sup { font-family: var(--font-body); font-size: 0.6em; font-weight: 700; color: var(--muted); margin-right: 3px; }
.verse-card figcaption { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.verse-card figcaption .icon-btn { margin-left: auto; color: var(--muted); }
.ref-link { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 700; color: var(--accent); font-size: 0.94rem; }
.ref-link:hover { text-decoration: underline; }
.verse-note { color: var(--muted); font-size: 0.9rem; }
.verse-card.featured blockquote { font-size: 1.16rem; }
.verse-card.compact { padding: 12px 14px 8px; background: var(--surface-2); border-color: transparent; }
.verse-card.compact blockquote { font-size: 0.98rem; }
.verse-list { display: flex; flex-direction: column; gap: 10px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.toc a:hover { border-color: var(--primary); }
.verse-group { scroll-margin-top: 80px; }
.road { list-style: none; margin: 0; padding: 0; counter-reset: road; display: flex; flex-direction: column; gap: 10px; }
.road li { counter-increment: road; position: relative; padding-left: 46px; }
.road li::before {
  content: counter(road);
  box-shadow: 0 0 0 3px var(--bg);
  position: absolute;
  left: 0;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--royal);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 800;
}
.road li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 50px; bottom: -12px; width: 2px; background: var(--line); }

.chips-wrap { display: flex; flex-direction: column; gap: 8px; }
.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); font-weight: 700; font-size: 0.86rem; cursor: pointer; }
.ref-chip[aria-expanded="true"] { background: var(--red); border-color: var(--red); color: #ffffff; }
.chip-verse:empty { display: none; }

/* ---------- impact ---------- */
.profile-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.profile-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-meta h1 { font-size: var(--step-3); overflow-wrap: anywhere; }
.calling { font-family: var(--font-scripture); font-style: italic; font-size: 0.96rem; }
@media (max-width: 560px) {
  .profile-head { grid-template-columns: auto minmax(0, 1fr); }
  .profile-head > .btn { grid-column: 1 / -1; justify-self: start; }
}
.avatar { border-radius: 50%; object-fit: cover; flex: none; }
.avatar.lg { width: 84px; height: 84px; }
.avatar.placeholder { display: grid; place-items: center; background: var(--royal); color: #ffffff; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.avatar.placeholder .ico { width: 36px; height: 36px; }
.streak-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.streak-strip > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 12px 14px; }
.streak-strip > div + div { border-left: 1px solid var(--line); }
.streak-strip .ico { grid-row: span 2; color: var(--red-text); }
.streak-strip strong { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.streak-strip span { font-size: 0.78rem; color: var(--muted); line-height: 1.25; }
@media (max-width: 520px) {
  .streak-strip > div { grid-template-columns: 1fr; padding: 10px; }
  .streak-strip .ico { grid-row: auto; }
}
.seg { display: inline-flex; flex-wrap: nowrap; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; padding: 6px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
@media (max-width: 520px) { .block-head .seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; } .block-head .seg button { padding: 7px 4px; } }
.seg button.on { background: var(--blue); color: #ffffff; box-shadow: var(--shadow); }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-grid > .metric:first-child { grid-column: span 2; }
@media (min-width: 640px) { .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.metric { position: relative; padding: 14px 14px 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.metric::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--mc, var(--muted)); }
.metric-num { font-family: var(--font-display); font-size: var(--step-4); line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--mc); }
.metric-label { font-weight: 700; }
.metric-hint { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.metric-add { position: absolute; right: 12px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--mc); color: #121212; display: grid; place-items: center; cursor: pointer; }
.metric-add .ico { stroke-width: 2.4; }
.metric-add:hover { filter: brightness(1.08); }
.m-shared { --mc: var(--m-shared); }
.m-salvations { --mc: var(--m-salvations); }
.m-healings { --mc: var(--m-healings); }
.m-deliverances { --mc: var(--m-deliverances); }
.m-baptisms { --mc: var(--m-baptisms); }
.m-spirit { --mc: var(--m-spirit); }
.m-prayed { --mc: var(--m-prayed); }
.goal .progress { height: 12px; }
.goal .progress span { background: var(--m-salvations); }

.legend { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.key.saved, .bar.saved { background: var(--m-salvations); }
.key.healed, .bar.healed { background: var(--m-healings); }
.chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 18px 14px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.chart .bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 130px; width: 100%; border-bottom: 1px solid var(--line); }
.chart .bar { position: relative; width: min(18px, 40%); border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 700; color: var(--muted); padding-bottom: 2px; font-variant-numeric: tabular-nums; }
.chart .col > span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.activity { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.activity li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; }
.activity li + li { border-top: 1px solid var(--line); }
.activity .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mc); }
.act-main { display: flex; flex-direction: column; min-width: 0; }
.act-main span { font-size: 0.88rem; overflow-wrap: anywhere; }
.activity time { font-size: 0.82rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .field { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.92rem; min-width: 0; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 400;
  font-size: 1rem;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.photo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; display: inline-flex; }
label.inline input { width: auto; }

/* ---------- log dialog ---------- */
dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog::backdrop { background: rgba(8, 12, 28, 0.55); backdrop-filter: blur(2px); }
#log-form { display: flex; flex-direction: column; gap: 14px; padding: 22px 20px 18px; }
#log-form h2 { font-size: var(--step-2); }
#log-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pick-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 600; font-size: 0.9rem; }
.pick span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mc); }
.pick input:checked + span { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 14%, var(--surface)); }
.pick input:focus-visible + span { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.stepper { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.stepper input { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { border: 1px solid var(--line); height: 44px; font-size: 1.2rem; }

/* ---------- testimonies ---------- */
.filter-bar { display: flex; flex-direction: column; gap: 10px; }
.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px !important; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: 0.88rem; cursor: pointer; }
.chip-btn.on { background: var(--blue); color: #ffffff; border-color: var(--blue); }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.t-card { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.t-card:hover { border-color: var(--primary); }
.t-thumb { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); max-width: 100%; }
.t-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-thumb-ph { display: grid; place-items: center; height: 100%; color: var(--muted); }
.t-thumb-ph .ico { width: 34px; height: 34px; }
.t-thumb-ph.text { place-items: start; padding: 14px 16px; font-family: var(--font-scripture); font-size: 0.9rem; line-height: 1.4; overflow: hidden; color: var(--ink); }
.t-count { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 99px; background: rgba(8, 12, 28, 0.7); color: #fff; font-size: 0.74rem; font-weight: 600; }
.t-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.t-body strong { overflow-wrap: anywhere; }
.media-field { display: flex; flex-direction: column; gap: 10px; }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.media-head .label { color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 0.92rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.media-grid:empty { display: none; }
.media-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); max-width: 100%; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vid-badge { position: absolute; left: 6px; bottom: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.media-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(8, 12, 28, 0.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.media-remove .ico { width: 16px; height: 16px; }
.t-detail { display: flex; flex-direction: column; gap: 14px; }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gallery.single { grid-template-columns: 1fr; }
.gallery img, .gallery video { width: 100%; border-radius: 12px; display: block; background: #000; max-height: 70vh; object-fit: contain; }
.gallery a { display: block; }
.t-text { display: flex; flex-direction: column; gap: 12px; font-size: 1.08rem; max-width: 65ch; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line); padding-top: 16px; }

/* ---------- bible ---------- */
.bible-bar {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 61px);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
@media (min-width: 960px) { .bible-bar { top: 12px; } }
.bible-bar select { width: auto; min-height: 40px; padding: 6px 10px; }
#bible-book { flex: 6 1 0; min-width: 0; max-width: 240px; }
.bible-bar .icon-btn { min-width: 34px; padding: 0 4px; }
#bible-chapter { flex: 0 0 4.4em; }
@media (max-width: 480px) { .bar-spacer { display: none; } .bible-bar { gap: 4px; padding: 6px; } .bible-bar select { padding: 6px 4px 6px 8px; } }
.bar-spacer { flex: 1 1 0; min-width: 0; }
.chapter { padding: 22px 4px 8px; }
.chapter-title { font-family: var(--font-display); font-size: var(--step-3); margin-bottom: 14px; text-align: center; }
.chapter-title span { display: block; font-size: 0.42em; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.chapter-text { font-size: calc(1.06rem * var(--scripture-scale, 1)); line-height: 1.8; max-width: 66ch; margin: 0 auto; }
.chapter-text .verse { cursor: pointer; border-radius: 4px; padding: 1px 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color 0.2s; }
.chapter-text .verse:hover { background: var(--surface-2); }
.chapter-text .verse.hit { background: var(--hit); }
.chapter-text .verse.sel { background: var(--sel); text-decoration: underline; text-decoration-color: var(--red-text); text-underline-offset: 4px; }
.chapter-nav { display: flex; justify-content: space-between; margin-top: 28px; }
.verse-actions {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: calc(100vw - 24px);
}
.verse-actions span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.verse-actions .btn { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 30%, transparent); }
.verse-actions .icon-btn { color: var(--bg); font-size: 1.3rem; }
@media (min-width: 960px) { .verse-actions { bottom: 24px; left: calc(50% + 130px); } }
.bible-search { display: flex; gap: 8px; }
.bible-search .search { flex: 1; min-width: 0; }
.results { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.results button { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.results button:hover { border-color: var(--primary); }
.results strong { color: var(--accent); font-size: 0.9rem; }
.results .scripture { font-size: 0.97rem; line-height: 1.55; }
mark { background: var(--hit); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- story ---------- */
.story-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px 22px 24px;
  border-radius: 20px;
  background: radial-gradient(110% 80% at 0% 0%, rgba(65, 105, 225, 0.45), transparent 60%), var(--royal);
  color: var(--royal-ink);
}
.story-hero .crown { color: #ffffff; }
.story-hero .crown .ico { width: 44px; height: 44px; stroke-width: 1.5; }
.story-hero .eyebrow { color: var(--royal-muted); }
.story-hero h1 { font-size: clamp(1.9rem, 7vw, 2.9rem); line-height: 1.05; }
.story-hero p:not(.eyebrow) { color: var(--royal-muted); max-width: 54ch; font-size: 1.05rem; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.story { display: flex; flex-direction: column; gap: 22px; max-width: 62ch; }
.opener { font-size: 1rem; color: var(--muted); }
.opener q { font-family: var(--font-scripture); font-style: italic; font-size: 1.02rem; color: var(--ink); }
.scene { display: flex; flex-direction: column; gap: 6px; }
.scene h2 { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.scene p { font-family: var(--font-scripture); font-size: 1.12rem; line-height: 1.65; }
.scene.climax p { font-size: 1.24rem; font-weight: 600; }
.the-end { font-family: var(--font-display); text-align: center; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.82rem; font-weight: 700; padding-top: 4px; }
.meaning { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mean-row { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.mean-row + .mean-row { border-top: 1px solid var(--line); }
.mean-pair { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.mean-pair span { color: var(--muted); font-weight: 600; }
.mean-pair .ico { color: var(--red-text); width: 16px; height: 16px; }
.mean-pair strong { font-family: var(--font-display); font-size: 1.12rem; }
.mean-row > p { color: var(--muted); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }
.two-col > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ask { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 1.05rem; }
.ask li::marker { color: var(--accent); font-weight: 700; }
.prayer { padding: 18px; border-radius: var(--radius); background: color-mix(in srgb, var(--purple) 28%, var(--surface)); border: 1px solid color-mix(in srgb, var(--purple) 65%, var(--line)); }
.prayer blockquote { margin: 0; font-size: 1.04rem; line-height: 1.65; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 600px) { .tips { grid-template-columns: 1fr; } }
.tips li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.tips .ico { color: var(--good); margin-top: 2px; stroke-width: 2.4; }

/* ---------- defend ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; padding: 10px 14px; border: 0; background: none; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.tab-body { display: flex; flex-direction: column; gap: 18px; }
.tip-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tip-card { padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.tip-card p { color: var(--muted); font-size: 0.94rem; }
.accordion { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.accordion details + details { border-top: 1px solid var(--line); }
.accordion summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; cursor: pointer; font-weight: 700; font-size: 1.04rem; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion .chev { color: var(--muted); transition: transform 0.2s; }
.accordion details[open] .chev { transform: rotate(90deg); }
.acc-body { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 18px; max-width: 68ch; }
.acc-body .label { margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.fact { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.fact header { display: flex; flex-direction: column; gap: 2px; }
.fact .when { font-size: 0.8rem; font-weight: 700; color: var(--purple-text); letter-spacing: 0.03em; }
.fact > p { font-size: 0.97rem; }
.fact .source { font-size: 0.82rem; color: var(--muted); font-style: italic; }

/* ---------- more / reminders ---------- */
.more-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.more-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px; text-decoration: none; }
.more-item + .more-item { border-top: 1px solid var(--line); }
.more-item > .ico:first-child { color: var(--blue-text); width: 24px; height: 24px; }
.more-item div { display: flex; flex-direction: column; }
.more-item span { color: var(--muted); font-size: 0.9rem; }
.more-item .chev { color: var(--muted); }
.panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); align-items: flex-start; }
.panel > p { max-width: 62ch; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; align-self: stretch; }
.panel-head > div { display: flex; align-items: center; gap: 10px; }
.panel-head .ico { color: var(--blue-text); }
.panel.quiet { background: transparent; }
.help { align-self: stretch; border-radius: var(--radius-sm); background: var(--surface-2); padding: 10px 14px; }
.help summary { cursor: pointer; font-weight: 600; }
.help ul { margin: 8px 0 4px; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.94rem; }
.switch { position: relative; display: inline-block; width: 52px; height: 30px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span[aria-hidden] { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background-color 0.2s; pointer-events: none; }
.switch span[aria-hidden]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.2s; }
.switch input:checked + span[aria-hidden] { background: var(--good); }
.switch input:checked + span[aria-hidden]::after { transform: translateX(22px); }
.switch input:focus-visible + span[aria-hidden] { outline: 2.5px solid var(--primary); outline-offset: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  transform: translate(-50%, 12px);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 130px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- account ---------- */
.gbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  border: 1px solid #747775;
  background: #ffffff;
  color: #1f1f1f;
  font-family: Roboto, var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
}
.gbtn:hover { background: #f2f2f2; }
.g-logo { width: 20px; height: 20px; flex: none; }
.notice .gbtn { justify-self: start; }
@media (max-width: 520px) { .notice .gbtn { grid-column: 1 / -1; } }
.account-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-row > div:not(.avatar) { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.avatar.sm { width: 48px; height: 48px; font-size: 1.05rem; }
.avatar.sm .ico { width: 24px; height: 24px; }
#sync-status { color: var(--muted); }

/* =====================================================================
   Modern layer: glass surfaces, gradient accents, floating dock.
   ===================================================================== */
:root {
  --radius: 20px;
  --radius-sm: 12px;
  --card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)), var(--surface);
  --card-border: rgba(255, 255, 255, 0.075);
  --glass: rgba(26, 26, 30, 0.72);
  --grad-brand: linear-gradient(135deg, #6b34bd 0%, #3a62dc 100%);
  --grad-cta: linear-gradient(135deg, #ff4a5c 0%, #d11f4a 100%);
  --grad-panel: radial-gradient(90% 70% at 100% 0%, rgba(58, 98, 220, 0.75), transparent 60%),
    radial-gradient(70% 60% at 0% 100%, rgba(227, 38, 58, 0.32), transparent 60%),
    linear-gradient(160deg, #5f2ca6 0%, #3a1a74 100%);
  --dock-space: calc(env(safe-area-inset-bottom, 0px) + 112px);
}
body {
  background:
    radial-gradient(1100px 560px at 100% -8%, rgba(90, 42, 156, 0.18), transparent 60%),
    radial-gradient(900px 520px at -12% 108%, rgba(58, 98, 220, 0.1), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---- surfaces ---- */
.verse-card, .equip-card, .stat, .metric, .latest, .notice, .panel, .fact, .tip-card, .accordion,
.activity, .chart, .t-card, .more-list, .meaning, .tips li, .results button, .card, .profile-card, .menu-profile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
}
.panel.quiet { background: transparent; }
.verse-card.compact { background: rgba(255, 255, 255, 0.04); border-color: transparent; border-radius: 14px; }
.empty { border-color: rgba(255, 255, 255, 0.1); border-radius: var(--radius); }
.chip { background: rgba(178, 138, 240, 0.14); color: var(--purple-text); }
.toc a, .chip-btn, .ref-chip { background: rgba(255, 255, 255, 0.04); border-color: var(--card-border); }
.chip-btn.on { background: var(--grad-brand); border-color: transparent; }
.ref-chip[aria-expanded="true"] { background: var(--grad-cta); border-color: transparent; }
@media (hover: hover) {
  .equip-card, .stat, .latest, .t-card, .more-item, .results button, .menu-profile {
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  }
  .equip-card:hover, .stat:hover, .latest:hover, .t-card:hover, .results button:hover, .menu-profile:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ---- icon chips ---- */
.chip-ico {
  --c: var(--mc, var(--blue-text));
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: var(--c) !important; /* card rules like ".stat span" must not grey the icon */
  background: color-mix(in srgb, var(--c) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 24%, transparent);
}
.chip-ico .ico { width: 21px; height: 21px; margin: 0; color: inherit; stroke-width: 2.1; }
.chip-ico.sm { width: 34px; height: 34px; border-radius: 11px; }
.chip-ico.sm .ico { width: 17px; height: 17px; }
.tint-red { --mc: var(--red-text); }
.tint-blue { --mc: var(--blue-text); }
.tint-purple { --mc: var(--purple-text); }
.tint-white { --mc: #ffffff; }

/* ---- buttons ---- */
.btn { background: rgba(255, 255, 255, 0.05); border-color: var(--card-border); }
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn.primary { background: var(--grad-brand); border-color: transparent; box-shadow: 0 6px 18px rgba(58, 98, 220, 0.32); }
.btn.primary:hover { background: var(--grad-brand); filter: brightness(1.1); }
.btn.cta { background: var(--grad-cta); border-color: transparent; box-shadow: 0 8px 22px rgba(227, 38, 58, 0.38); }
.btn.cta:hover { background: var(--grad-cta); filter: brightness(1.08); }
.btn.glass, .btn.on-dark { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.24); color: #ffffff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.07); }
.btn.armed, .icon-btn.armed { background: var(--danger); border-color: var(--danger); color: #fff; }
.link .ico { width: 15px; height: 15px; }

/* ---- form controls ---- */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--card-border);
  border-radius: 12px;
}
.seg { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); padding: 4px; }
.seg button.on { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 14px rgba(58, 98, 220, 0.35); }
.progress { background: rgba(255, 255, 255, 0.07); }
.progress span { background: var(--grad-brand); }

/* ---- top bar ---- */
.topbar {
  background: rgba(18, 18, 18, 0.62);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.top-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 2px;
  background: var(--grad-brand);
  text-decoration: none;
  transition: box-shadow 0.2s ease;
}
.top-avatar .avatar { width: 36px; height: 36px; border: 2px solid var(--bg); font-size: 0.78rem; }
.top-avatar.active { box-shadow: 0 0 0 3px rgba(178, 138, 240, 0.4); }
.avatar.xs { width: 36px; height: 36px; font-size: 0.8rem; }
.avatar.xs .ico { width: 18px; height: 18px; }
.avatar.placeholder { background: var(--grad-brand); }

/* ---- floating dock (phones) ---- */
#view { padding-bottom: var(--dock-space); }
.tab-bar {
  left: 50%;
  right: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateX(-50%);
  width: min(500px, calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  grid-template-columns: 1fr 1fr 76px 1fr 1fr;
  align-items: center;
  padding: 6px;
  border-radius: 28px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.tab {
  height: 54px;
  border-radius: 22px;
  gap: 3px;
  font-size: 0.66rem;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.tab .ico { width: 22px; height: 22px; }
.tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(107, 52, 189, 0.6), rgba(58, 98, 220, 0.6));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 18px rgba(58, 98, 220, 0.25);
}
.fab {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin-top: -30px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--grad-cta);
  box-shadow: 0 12px 28px rgba(227, 38, 58, 0.5), 0 0 0 6px var(--bg);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.fab .ico { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:hover { filter: brightness(1.08); }
.fab:active { transform: scale(0.93); }
.toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 104px); border-radius: 16px; background: #f5f5f6; color: #121212; }
.verse-actions { bottom: calc(env(safe-area-inset-bottom, 0px) + 100px); background: rgba(245, 245, 246, 0.96); }

/* ---- sidebar (computers) ---- */
.side-profile { display: none; }
@media (min-width: 960px) {
  #view { padding-bottom: 64px; }
  .sidebar { background: rgba(13, 13, 15, 0.9); border-right: 1px solid rgba(255, 255, 255, 0.06); gap: 16px; }
  .side-log { width: 100%; }
  .nav-item { border-radius: 14px; transition: background-color 0.15s ease, color 0.15s ease; }
  .nav-item:hover { background: rgba(255, 255, 255, 0.05); }
  .nav-item.active {
    background: linear-gradient(135deg, rgba(107, 52, 189, 0.4), rgba(58, 98, 220, 0.28));
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  }
  .nav-item.active .ico { color: #ffffff; }
  .side-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 10px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    text-decoration: none;
    min-width: 0;
  }
  .side-profile div:not(.avatar) { display: flex; flex-direction: column; min-width: 0; }
  .side-profile strong { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-profile span { font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .toast { bottom: 28px; }
  .verse-actions { bottom: 24px; }
}

/* ---- home dashboard ---- */
.dash-head { display: flex; flex-direction: column; gap: 4px; }
.dash-title { font-size: clamp(1.6rem, 6vw, 2.15rem); font-weight: 800; letter-spacing: -0.025em; }
.dash-title span { background: linear-gradient(90deg, #cfa9ff, #8aa8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mission {
  border-radius: 28px;
  padding: 22px;
  gap: 16px;
  background: var(--grad-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 22px 50px rgba(90, 42, 156, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.mission-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mission-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mission h2 { font-size: clamp(1.6rem, 6.4vw, 2.35rem); line-height: 1.06; font-weight: 800; letter-spacing: -0.025em; color: #fff; max-width: 12ch; }
.mission.is-done h2 { color: #fff; }
.ring { position: relative; width: 78px; height: 78px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: rgba(255, 255, 255, 0.18); }
.ring-fill { stroke: #ffffff; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5)); }
.ring > div { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; padding-top: 25px; gap: 1px; }
.ring strong { font-size: 1.4rem; font-weight: 800; color: #fff; line-height: 1; }
.ring span { font-size: 0.78rem; color: var(--royal-muted); }
.week li.done i { background: var(--grad-cta); border-color: transparent; box-shadow: 0 4px 12px rgba(227, 38, 58, 0.45); }
.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--royal-muted);
  font-size: 0.85rem;
}
.streak-pill .ico { width: 18px; height: 18px; color: #ff8a96; }
.streak-pill strong { color: #fff; font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.btn.ghost-dark { color: rgba(255, 255, 255, 0.78); }

.notice { gap: 14px; }
.stat { padding: 14px; gap: 4px; }
.stat .chip-ico { width: 36px; height: 36px; border-radius: 12px; margin-bottom: 6px; }
.stat .chip-ico .ico { width: 18px; height: 18px; }
.stat strong { font-family: var(--font-body); font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.stat span { font-size: 0.8rem; }
.stat i { top: 14px; right: 12px; }

.equip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.equip .story-card, .equip .bible-card { grid-column: 1 / -1; }
@media (max-width: 480px) { .equip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 640px) {
  .equip { grid-template-columns: 1.25fr 1fr 1fr; }
  .equip .story-card { grid-column: 1; grid-row: span 2; }
  .equip .bible-card { grid-column: 2 / 4; }
}
.equip-card { padding: 18px; gap: 6px; }
.equip-card .chip-ico { margin-bottom: 8px; }
.equip-card.story-card { background: var(--grad-panel); border-color: rgba(255, 255, 255, 0.12); color: #fff; }
.equip-card.story-card strong { font-size: 1.15rem; }
.equip-card.story-card span { color: var(--royal-muted); }
.equip-card.story-card em { margin-top: auto; padding-top: 10px; font-style: normal; font-weight: 700; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 4px; }
.equip-card.story-card em .ico { width: 16px; height: 16px; margin: 0; color: inherit; }
.verse-card.featured { position: relative; overflow: hidden; padding-top: 24px; }
.verse-card.featured::before {
  content: "\201C";
  position: absolute;
  right: 16px;
  top: -6px;
  font-size: 5.5rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.28;
  pointer-events: none;
}
.latest { padding: 12px 14px 12px 12px; }
.latest > div:not(.avatar) { flex: 1; }
.latest .chev { color: var(--muted); }
.mini-thumb { border-radius: 14px; }

/* ---- impact ---- */
.profile-card { overflow: hidden; display: flex; flex-direction: column; }
.profile-banner { height: 88px; background: var(--grad-panel); }
.profile-body { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 0 18px 16px; }
.profile-body > .avatar { margin-top: -46px; width: 92px; height: 92px; border: 4px solid var(--surface); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); font-size: 1.7rem; }
.profile-body > .btn, .profile-body > .gbtn { position: absolute; right: 16px; top: 12px; }
.profile-meta h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--card-border); }
.profile-stats > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; min-width: 0; }
.profile-stats > div + div { border-left: 1px solid var(--card-border); }
.profile-stats .chip-ico { width: 32px; height: 32px; border-radius: 10px; margin-bottom: 2px; }
.profile-stats .chip-ico .ico { width: 16px; height: 16px; }
.profile-stats strong { font-size: 1.4rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.profile-stats span { font-size: 0.75rem; color: var(--muted); }
.metric { padding: 14px; gap: 2px; }
.metric::before { display: none; }
.metric-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.metric-add {
  position: static;
  width: 34px;
  height: 34px;
  background: color-mix(in srgb, var(--mc) 16%, transparent);
  color: var(--mc);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 30%, transparent);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.metric-add .ico { width: 18px; height: 18px; }
.metric-add:hover { background: var(--mc); color: #121212; filter: none; }
.metric-num { font-family: var(--font-body); font-size: 2.1rem; font-weight: 800; letter-spacing: -0.025em; color: var(--ink); }
.metric-grid > .metric:first-child .metric-num { font-size: 2.5rem; }
.metric-hint { padding-right: 0; }
.goal.card { padding: 16px 18px; }
.goal-num { color: var(--muted); }
.goal-num strong { color: var(--ink); font-size: 1.2rem; font-weight: 800; }
.goal .progress { height: 10px; }
.goal .progress span { background: var(--grad-cta); }
.chart { padding: 22px 14px 12px; }
.chart .bars { border-bottom-color: var(--card-border); }
.chart .bar { width: min(16px, 38%); border-radius: 8px 8px 3px 3px; }
.bar.saved { background: linear-gradient(180deg, #ff6b7b, rgba(255, 77, 95, 0.3)); }
.bar.healed { background: linear-gradient(180deg, #62e2a6, rgba(63, 207, 142, 0.28)); }
.activity li { padding: 12px 10px 12px 14px; }
.activity li + li { border-top-color: var(--card-border); }

/* ---- other sections ---- */
.t-card { overflow: hidden; }
.t-thumb { aspect-ratio: 4 / 3; }
.t-thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(transparent, rgba(0, 0, 0, 0.45)); pointer-events: none; }
.t-count { z-index: 1; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); }
.story-hero { border-radius: 28px; background: var(--grad-panel); border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 22px 50px rgba(90, 42, 156, 0.3); }
.story-hero h1 { font-weight: 800; letter-spacing: -0.025em; }
.tabs {
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  width: fit-content;
  max-width: 100%;
}
.tabs button { padding: 8px 14px; border-radius: 999px; border-bottom: 0; margin: 0; font-size: 0.86rem; }
.tabs button.on { background: var(--grad-brand); color: #fff; }
.bible-bar { background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-color: var(--card-border); border-radius: 18px; }
.road li::before { background: var(--grad-brand); }
.menu-profile { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; min-width: 0; }
.menu-profile > div:not(.avatar) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.menu-profile span { color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }
.menu-profile .chev, .more-item .chev { color: var(--muted); }
.more-item + .more-item { border-top-color: var(--card-border); }

/* ---- log sheet ---- */
dialog { background: #18181b; border: 1px solid var(--card-border); border-radius: 26px; }
@media (max-width: 600px) {
  dialog {
    width: 100%;
    max-width: 100%;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: sheet-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  #log-form::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); margin: -8px 0 2px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ---- page transition ---- */
#view > * { animation: rise 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
#view > *:nth-child(2) { animation-delay: 0.03s; }
#view > *:nth-child(3) { animation-delay: 0.06s; }
#view > *:nth-child(4) { animation-delay: 0.09s; }
#view > *:nth-child(n + 5) { animation-delay: 0.12s; }
@keyframes rise { from { opacity: 0.25; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #view > *, dialog { animation: none !important; }
}
