/* The Holistic Tapestry: calm cream, sage and plum, from Jeannine's design. */
:root {
  --bg: #F6F3EE;
  --surface: #FFFFFF;
  --surface-2: #FBF9F6;
  --line: #E7E1D8;
  --text: #2E2A27;
  --muted: #6B635D;
  --sage: #6E7B5E;
  --sage-soft: #EEF0E8;
  --plum: #7A4E63;
  --blush: #F3E8E8;
  --radius: 18px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tabbar: 72px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.6 var(--sans);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px calc(var(--tabbar) + 40px + env(safe-area-inset-bottom));
}

.icon { width: 24px; height: 24px; flex: none; }
.icon.inline { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 40px; }
h2 { font-size: 28px; margin-bottom: 14px; }
.sub { color: var(--plum); margin: 6px 0 0; font-size: 18px; }
.lead { color: var(--muted); margin: 18px 0 24px; }

/* ---------- Welcome ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 20;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 32px calc(40px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.welcome .logo { width: 140px; height: 140px; margin-bottom: 28px; }
.welcome-title { font-size: 56px; line-height: 1.02; font-weight: 500; }
.welcome-title .accent { display: block; color: var(--plum); }
.welcome-tagline { color: var(--sage); font-size: 22px; margin: 14px 0 0; }
.welcome .wave { width: 100%; height: 40px; margin: 28px 0 20px; }
.welcome-motto { text-align: center; text-wrap: balance; color: var(--muted); margin: 0 0 24px; }
.welcome .btn { align-self: center; min-width: 220px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--sage); color: #fff; border: 0; border-radius: 999px;
  padding: 14px 28px; font: 600 18px var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: #5F6B50; }
.btn.ghost { background: transparent; color: var(--sage); border: 1.5px solid var(--sage); }
.btn .icon { width: 20px; height: 20px; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 3px; border-radius: 6px; }

/* ---------- Home ---------- */
.home-head h1 { font-size: 40px; font-weight: 500; }
.home-head .wave { width: 100%; height: 34px; margin-top: 4px; }
.question { margin: 20px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 6px 14px; text-decoration: none; min-height: 128px;
}
.tile:hover { border-color: #D3C9BC; }
.tile-icon { width: 40px; height: 40px; color: var(--muted); margin-bottom: 10px; }
.tile strong { font-size: 15px; font-weight: 700; line-height: 1.25; }
.tile span { font-size: 13px; line-height: 1.35; color: var(--muted); margin-top: 2px; }
.urgent {
  display: flex; align-items: center; gap: 14px; margin-top: 22px;
  background: var(--blush); border-radius: var(--radius); padding: 18px 18px;
  text-decoration: none;
}
.urgent-icon { width: 40px; height: 40px; color: var(--plum); }
.urgent > span { flex: 1; display: flex; flex-direction: column; }
.urgent strong { color: var(--plum); font-size: 18px; }
.urgent > span > span { color: var(--muted); font-size: 15px; }
.chev { width: 20px; height: 20px; color: var(--muted); }

@media (max-width: 380px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Section and list pages ---------- */
.back {
  display: inline-flex; align-items: center; gap: 4px; margin: -6px 0 18px -6px;
  padding: 6px; color: var(--muted); text-decoration: none; font-size: 16px;
}
.back .icon { width: 20px; height: 20px; }
.section-head .section-icon { width: 44px; height: 44px; color: var(--sage); margin-bottom: 10px; }
.page-head { margin-bottom: 22px; }
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px 10px 10px; text-decoration: none;
}
.card:hover { border-color: #D3C9BC; }
.card-img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; }
.card-img.is-empty { display: grid; place-items: center; background: var(--sage-soft); color: var(--sage); }
.card-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-text strong { font-size: 17px; line-height: 1.3; }
.card-text span { font-size: 15px; color: var(--muted); }
.soon { font-size: 13px; font-style: normal; color: var(--plum); }
.soon-block { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; }
.group { margin-top: 34px; }
.small-head { font: 700 14px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; color: var(--muted);
}
.search input { flex: 1; border: 0; outline: 0; background: none; font: inherit; color: var(--text); }
.search:focus-within { border-color: var(--sage); }

/* ---------- Chapter ---------- */
.chapter-head { position: relative; padding-right: 56px; }
.kicker { font: 700 13px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--sage); margin: 0 0 6px; }
.fav {
  position: absolute; top: 0; right: 0; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--plum);
  display: grid; place-items: center; cursor: pointer;
}
.fav[aria-pressed="true"] svg { fill: var(--plum); }

.photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--sage-soft); }
.photo img { width: 100%; height: auto; }
.photo figcaption { font-size: 14px; color: var(--muted); padding: 8px 12px 10px; background: var(--surface); }
.photo.is-empty { display: grid; place-items: center; }
.photo.is-empty .logo { width: 84px; height: 84px; opacity: .55; }
.photo.cover { margin: 24px 0 8px; }
.photo.cover.is-empty, .photo.wide.is-empty { aspect-ratio: 16 / 9; }
.photo.wide { margin: 18px 0; }

.prose { margin-top: 18px; }
.prose h3 { font: 700 19px/1.35 var(--sans); margin: 30px 0 8px; color: var(--text); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 18px; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--sage); }
.prose strong { font-weight: 700; }
.prose blockquote {
  margin: 24px 0; padding: 16px 20px; background: var(--sage-soft);
  border-left: 3px solid var(--sage); border-radius: 0 12px 12px 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: 12px; margin: 18px 0; }
.prose a { color: var(--plum); }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 24px; }
.gallery .photo:only-child { grid-column: 1 / -1; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 36px; }
.pager a {
  display: flex; align-items: center; gap: 6px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; font-size: 15px; line-height: 1.3;
}
.pager a.next { justify-content: flex-end; text-align: right; }
.pager small { display: block; color: var(--muted); font-size: 13px; }
.pager .icon { width: 18px; height: 18px; color: var(--muted); }

/* ---------- More and help ---------- */
.links, .contacts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.links li > a, .links li > div {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.links strong { flex: 1 1 70%; }
.links span { flex-basis: 100%; order: 3; color: var(--muted); font-size: 15px; }
.contacts li {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.contacts span { color: var(--muted); font-size: 16px; }
.contacts .btn { margin-top: 6px; }
.fine { margin-top: 34px; font-size: 15px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: rgba(251, 249, 246, .96); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}
.tabbar a {
  flex: 0 1 160px; height: var(--tabbar);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 13px;
}
.tabbar a.is-active { color: var(--sage); font-weight: 700; }
.tabbar a.is-active .icon { stroke-width: 1.8; }
