/* nine27 member app — mobile-first. Structure mirrors a native app (header / scroll view / tab bar)
   so a React Native / Expo port is a re-skin, not a redesign. */

:root {
  --header-h: 68px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --gutter: 16px;
  --maxw: 680px;
}

body.app { min-height: 100dvh; overscroll-behavior-y: none; }

/* ---------------- header ---------------- */
.top {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--safe-t);
  background: rgba(246, 243, 236, .92);
  -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px);
}
.top-inner {
  height: var(--header-h); max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
}
.top .foil-rule { max-width: none; }
.brand {
  justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-decoration: none; color: var(--ink);
}
.brand img { width: 26px; height: 26px; }
.brand .wordmark { font-size: 12px; letter-spacing: .34em; padding-left: .34em; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--sheet); border-radius: var(--r-sm);
  cursor: pointer; color: var(--ink);
}
.icon-btn svg { width: 18px; height: 18px; }
.avatar-btn { justify-self: end; padding: 0; overflow: hidden; font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.top-date { justify-self: start; font-size: 11px; line-height: 1.15; color: var(--muted); }
.top-date b { display: block; color: var(--ink); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------------- tab bar ---------------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding-bottom: var(--safe-b);
  background: rgba(255, 253, 248, .96);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); }
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-decoration: none; color: var(--faint);
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--foil);
}
.tab .badge {
  position: absolute; top: 9px; left: calc(50% + 7px); min-width: 8px; height: 8px; border-radius: 99px; background: var(--bronze);
}

/* ---------------- view ---------------- */
main.view {
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px var(--gutter) calc(var(--tabbar-h) + var(--safe-b) + 32px);
  animation: viewIn .45s var(--ease) both;
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 16px; }
.page-head h1 {
  margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1;
  letter-spacing: -.01em; font-stretch: 112%; font-variation-settings: "wdth" 112; color: var(--ink);
  text-transform: uppercase;
}
.page-head .label { color: var(--bronze); display: block; margin-bottom: 8px; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 30px 0 12px; color: var(--ink); }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.section-title .label { color: var(--ink); }

/* ---------------- paper primitives ---------------- */
.sheet {
  position: relative; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-sheet);
}
/* stacked sheets: two paper layers peeking out behind the card */
.stack { box-shadow: var(--shadow-sheet), 4px 4px 0 -1px var(--paper-2), 4px 4px 0 0 var(--line), 8px 8px 0 -1px var(--paper-2), 8px 8px 0 0 var(--line); }
/* folded top-right corner */
.fold::after {
  content: ""; position: absolute; top: -1px; right: -1px; width: 18px; height: 18px;
  background: linear-gradient(225deg, var(--paper) 50%, var(--sheet-edge) 50%);
  border-bottom-left-radius: 3px; box-shadow: -1px 1px 1px rgba(22, 25, 29, .06);
}
.pad { padding: 18px; }
.ink-card { background: var(--ink); color: #EDE6D6; border-color: var(--ink); }
.ink-card .label { color: var(--gold); }

.chip {
  white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 3px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.chip.meat { color: var(--meat); background: var(--meat-wash); border-color: transparent; }
.chip.vegan { color: var(--vegan); background: var(--vegan-wash); border-color: transparent; }
.chip.fast { color: var(--fast); background: var(--fast-wash); border-color: transparent; }
.chip.gold { color: var(--bronze-deep); background: var(--gold-wash); border-color: transparent; }
.dot { width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); display: inline-block; background: currentColor; }

.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; }
.meta b { color: var(--ink); font-weight: 700; }

/* ---------------- week strip ---------------- */
.week { display: grid; grid-template-columns: 28px repeat(7, 1fr) 28px; align-items: center; gap: 4px; margin-bottom: 18px; }
.week-nav { height: 52px; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.week-nav svg { width: 16px; height: 16px; }
.day {
  position: relative; height: 58px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0;
  color: var(--ink); -webkit-tap-highlight-color: transparent;
}
.day small { font-size: 9.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.day strong { font-size: 16px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.day .dot { width: 5px; height: 5px; }
.day.meat .dot { color: var(--meat); } .day.vegan .dot { color: var(--vegan); } .day.fast .dot { color: var(--fast); }
.day.is-today::after { content: ""; position: absolute; bottom: -5px; left: 35%; right: 35%; height: 2px; background: var(--foil); }
.day[aria-pressed="true"] { background: var(--ink); color: #F6F1E4; border-color: var(--ink); }
.day[aria-pressed="true"] small { color: var(--gold); }
.day[aria-pressed="true"] .dot { color: var(--gold) !important; }
.day.complete:not([aria-pressed="true"]) { border-color: var(--gold); background: var(--gold-wash); }

/* ---------------- today ---------------- */
.hello { display: grid; gap: 14px; margin: 4px 0 22px; }
.hello h1 { margin: 0; font-size: 34px; }
.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.progress span { height: 5px; border-radius: 1px; background: var(--line); }
.progress span.on { background: var(--foil); }
.progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.progress-row b { color: var(--ink); }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--bronze-deep); }
.streak svg { width: 14px; height: 14px; }

.cards { display: grid; gap: 16px; }
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.card-link:active { transform: scale(.99); }
@media (hover: hover) { .card-link:hover { box-shadow: var(--shadow-lift); } }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-top .label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.card-top .label svg { width: 16px; height: 16px; color: var(--bronze); }
.check {
  width: 22px; height: 22px; border-radius: 2px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none;
}
.check svg { width: 13px; height: 13px; opacity: 0; }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.check.on svg { opacity: 1; }
.card-title { font-size: 19px; font-weight: 800; color: var(--ink); line-height: 1.2; margin: 0 0 4px; letter-spacing: -.005em; }
.card-sub { color: var(--muted); font-size: 13.5px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-top: 12px; }
.split > div { background: var(--sheet); padding: 12px; }
.split .label { color: var(--bronze); font-size: 9.5px; }
.split strong { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink); line-height: 1.25; }
.split span { font-size: 12px; color: var(--muted); }
.more { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.more svg { width: 14px; height: 14px; color: var(--bronze); }
.ink-card .more { border-top-color: rgba(233, 220, 188, .22); color: #F6F1E4; }
.ink-card .more svg { color: var(--gold); }
.meal-lines { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.meal-lines li { display: grid; grid-template-columns: 78px 1fr; gap: 8px; font-size: 14px; color: var(--ink); }
.meal-lines li span { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding-top: 2px; }
.verse-snip { font-family: var(--font-serif); font-size: 21px; line-height: 1.35; color: #F6F1E4; margin: 4px 0 10px; }
.verse-ref { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.mini-posts { display: grid; gap: 10px; margin-top: 4px; }
.mini-post { display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 13.5px; }
.mini-post p { margin: 0; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post small { color: var(--muted); font-size: 11.5px; }

/* ---------------- day-type banner (Health) ---------------- */
.daytype {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center;
  padding: 16px 18px; margin-bottom: 18px; border-radius: var(--r);
  color: #fff; overflow: hidden;
}
.daytype.meat { background: var(--meat); }
.daytype.vegan { background: var(--vegan); }
.daytype.fast { background: var(--fast); }
.daytype::before { /* cut-paper band */
  content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .22; mix-blend-mode: overlay; pointer-events: none;
}
.daytype::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--foil); }
.daytype-ico { width: 44px; height: 44px; border: 1.5px solid rgba(255, 255, 255, .45); border-radius: 3px; display: grid; place-items: center; }
.daytype-ico svg { width: 22px; height: 22px; }
.daytype .label { color: rgba(255, 255, 255, .72); font-size: 10px; }
.daytype h2 { margin: 3px 0 4px; font-size: 22px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-stretch: 112%; font-variation-settings: "wdth" 112; line-height: 1.05; }
.daytype p { margin: 0; font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, .86); }

.rhythm { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: -6px 0 22px; }
.rhythm div { text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; padding: 6px 0; border-radius: 2px; text-transform: uppercase; }
.rhythm .meat { background: var(--meat-wash); color: var(--meat); }
.rhythm .vegan { background: var(--vegan-wash); color: var(--vegan); }
.rhythm .fast { background: var(--fast-wash); color: var(--fast); }
.rhythm .sel { outline: 1.5px solid var(--ink); outline-offset: 1px; }

.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 8px; }
.totals div { background: var(--sheet); padding: 10px 12px; }
.totals strong { display: block; font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.totals span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline b { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fast); padding-top: 2px; }
.rules { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }

/* ---------------- expandable rows (exercises, meals) ---------------- */
.list { display: grid; gap: 10px; }
.row { overflow: hidden; }
.row-head {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; text-align: left;
  padding: 14px 16px; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.row-num { font-size: 12px; font-weight: 800; color: var(--bronze); font-variant-numeric: tabular-nums; width: 22px; letter-spacing: .04em; }
.row-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.row-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.row-caret { width: 16px; height: 16px; color: var(--muted); transition: transform .25s var(--ease); }
.row.open .row-caret { transform: rotate(180deg); }
.row-body { display: none; padding: 0 16px 16px 52px; font-size: 14px; color: var(--ink-2); }
.row.open .row-body { display: block; animation: viewIn .3s var(--ease); }
.row-body p { margin: 0 0 10px; }
.row-body .label { color: var(--bronze); display: block; margin: 12px 0 6px; font-size: 10px; }
.row.done .row-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--gold); }
.set-check { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; border: 1px solid var(--line-strong); background: var(--sheet); border-radius: var(--r-sm); height: 36px; padding: 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.set-check .check { width: 16px; height: 16px; }
.set-check .check svg { width: 10px; height: 10px; }
.meal-row .row-head { grid-template-columns: 64px 1fr auto; }
.meal-slot { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--bronze); line-height: 1.3; }
.meal-slot small { display: block; color: var(--muted); font-weight: 600; letter-spacing: .04em; font-size: 12px; }
.meal-row .row-body { padding-left: 16px; }
.ingredients { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ingredients li { display: flex; gap: 10px; align-items: baseline; }
.ingredients li::before { content: ""; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg) translateY(-2px); flex: none; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 8px; }
.steps li::before { content: counter(s, decimal-leading-zero); font-weight: 800; font-size: 11.5px; color: var(--bronze); padding-top: 2px; }

/* ---------------- segmented control ---------------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 16px; }
.seg button {
  height: 40px; border: 0; background: none; cursor: pointer; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.seg button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 25, 29, .08), inset 0 -2px 0 var(--gold); }

.session-head h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; line-height: 1.05; color: var(--ink); text-transform: uppercase; font-stretch: 112%; font-variation-settings: "wdth" 112; letter-spacing: .01em; }
.why { font-size: 15px; color: var(--ink-2); margin: 0; }
.why-block { border-left: 2px solid var(--gold); padding: 2px 0 2px 14px; margin: 16px 0 0; }

/* ---------------- video poster ---------------- */
.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); cursor: pointer; margin-top: 16px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .arches { position: absolute; inset: 0; display: grid; place-items: end center; }
.video .arch { position: absolute; bottom: -2px; border-radius: 999px 999px 0 0; box-shadow: 0 -2px 10px rgba(22, 25, 29, .08); }
.video .a1 { width: 88%; height: 118%; background: #F1ECE1; }
.video .a2 { width: 66%; height: 92%; background: #F8F5EE; }
.video .a3 { width: 44%; height: 66%; background: #FFFDF8; }
.video .crest-wm { position: absolute; right: 12px; top: 10px; width: 22px; opacity: .9; }
.video .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 58px; height: 58px; border-radius: 50%; background: var(--ink); color: var(--gold);
  display: grid; place-items: center; box-shadow: 0 10px 24px -10px rgba(22, 25, 29, .6);
  transition: transform .2s var(--ease);
}
.video:hover .play { transform: translate(-50%, -50%) scale(1.05); }
.video .play svg { width: 20px; height: 20px; margin-left: 3px; }
.video .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
  background: linear-gradient(transparent, rgba(22, 25, 29, .75)); color: #fff; font-size: 13px; font-weight: 600;
}
.video .cap small { font-size: 11px; font-variant-numeric: tabular-nums; opacity: .85; white-space: nowrap; }
.video .soon { position: absolute; top: 10px; left: 10px; }

/* ---------------- scripture ---------------- */
.verse-card { padding: 26px 22px 22px; text-align: left; }
.verse-card .verse-ref { color: var(--bronze); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.verse-text { font-family: var(--font-serif); font-size: 21px; line-height: 1.5; color: var(--ink); margin: 16px 0 0; font-weight: 400; }
.verse-text mark { background: linear-gradient(transparent 62%, var(--gold-soft) 62%); color: inherit; }
.verse-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.prose p { font-size: 16px; line-height: 1.65; color: var(--ink-2); margin: 0 0 14px; }
.connected { display: grid; gap: 10px; }
.connected .sheet { padding: 16px; }
.connected .verse-ref { color: var(--bronze); font-size: 11px; }
.connected blockquote { margin: 8px 0; font-family: var(--font-serif); font-size: 17px; line-height: 1.45; color: var(--ink); }
.connected p { margin: 0; font-size: 13.5px; color: var(--muted); }
.questions { list-style: none; margin: 0; padding: 0; counter-reset: q; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.questions li { counter-increment: q; background: var(--sheet); padding: 14px 16px 14px 52px; position: relative; font-size: 15.5px; color: var(--ink); line-height: 1.45; }
.questions li::before { content: "Q" counter(q); position: absolute; left: 16px; top: 15px; font-size: 11px; font-weight: 800; color: var(--bronze); letter-spacing: .06em; }
.practice { padding: 20px; }
.practice p { margin: 8px 0 0; font-size: 17px; line-height: 1.45; color: #F6F1E4; font-weight: 600; }
textarea.journal { width: 100%; min-height: 110px; resize: vertical; margin-top: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--sheet); font: 16px/1.5 var(--font-serif); color: var(--ink); }
textarea.journal:focus { outline: none; border-color: var(--bronze); }
.saved-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; min-height: 1em; }

/* ---------------- complete button ---------------- */
.complete-bar { margin-top: 28px; display: grid; gap: 10px; }
.complete-bar .btn { width: 100%; min-height: 52px; }
.btn-done { background: var(--gold-wash); color: var(--bronze-deep); border-color: var(--gold); }
.btn .check { width: 18px; height: 18px; border-color: currentColor; }
.btn .check.on { background: var(--bronze-deep); border-color: var(--bronze-deep); color: #fff; }

/* ---------------- community ---------------- */
.channels { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1) 14px; padding: 2px var(--gutter) 6px; scroll-snap-type: x proximity; }
.channels::-webkit-scrollbar { display: none; }
.channel {
  flex: none; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sheet);
  font-size: 12px; font-weight: 700; letter-spacing: .06em; cursor: pointer; color: var(--ink-2); scroll-snap-align: start; white-space: nowrap;
}
.channel[aria-pressed="true"] { background: var(--ink); color: #F6F1E4; border-color: var(--ink); }
.channel-blurb { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }
.composer-trigger { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; text-align: left; cursor: pointer; margin-bottom: 18px; }
.composer-trigger span { color: var(--muted); font-size: 15px; }
.composer-trigger svg { width: 18px; height: 18px; color: var(--bronze); }

.av {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 3px;
  background: var(--paper-2); color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: .04em;
  border: 1px solid var(--line-strong);
}
.av.sm { width: 30px; height: 30px; font-size: 11px; }
.av.xs { width: 26px; height: 26px; font-size: 10px; }
.av.founder { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.feed { display: grid; gap: 14px; }
.post { padding: 16px; }
.post-head { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; }
.post-who { line-height: 1.25; min-width: 0; }
.post-who b { font-size: 14.5px; color: var(--ink); }
.post-who small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 2px; background: var(--gold-wash); color: var(--bronze-deep); font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; vertical-align: 2px; }
.pin { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--bronze); text-transform: uppercase; display: inline-flex; gap: 5px; align-items: center; }
.pin svg { width: 12px; height: 12px; }
.post h3 { margin: 12px 0 4px; font-size: 17.5px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.post-body { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.post-body.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.post-link { text-decoration: none; color: inherit; display: block; }
.imgs { display: grid; gap: 4px; margin-top: 12px; border-radius: var(--r-sm); overflow: hidden; }
.imgs.n1 { grid-template-columns: 1fr; }
.imgs.n2, .imgs.n4 { grid-template-columns: 1fr 1fr; }
.imgs.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.imgs.n3 img:first-child { grid-row: span 2; }
.imgs img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; background: var(--paper-2); cursor: zoom-in; }
.imgs.n1 img { aspect-ratio: auto; max-height: 460px; }
.imgs.n3 img:first-child { aspect-ratio: auto; }
.actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.act {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.act svg { width: 17px; height: 17px; }
a.act { text-decoration: none; }
.act:hover { background: var(--paper-2); color: var(--ink); }
.act.on { color: var(--bronze); }
.act.on svg { fill: var(--gold-soft); }
.act.danger:hover { color: var(--meat); }

.back { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); text-decoration: none; margin: 2px 0 14px; }
.back svg { width: 14px; height: 14px; }
.thread { display: grid; gap: 4px; margin-top: 18px; }
.comment { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; }
.comment-bubble { min-width: 0; }
.comment-meta { font-size: 12.5px; color: var(--muted); }
.comment-meta b { color: var(--ink); font-size: 13.5px; margin-right: 6px; }
.comment-text { margin: 3px 0 0; font-size: 14.5px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-img { margin-top: 8px; max-width: 240px; border-radius: var(--r-sm); border: 1px solid var(--line); cursor: zoom-in; }
.comment-actions { display: flex; gap: 2px; margin: 2px 0 0 -10px; }
.comment-actions .act { height: 28px; font-size: 12px; }
.comment-actions .act svg { width: 14px; height: 14px; }
.replies { grid-column: 2; display: grid; border-left: 2px solid var(--line-strong); padding-left: 12px; margin-top: 2px; }
.replies .comment { grid-template-columns: 26px 1fr; padding: 8px 0; }

.reply-box { grid-column: 2; margin-top: 6px; }
.inline-composer { display: grid; gap: 8px; }
.inline-composer .field { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: end; }
textarea.input, input.input, select.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sheet);
  padding: 11px 12px; font: 16px/1.45 var(--font-body); color: var(--ink);
}
textarea.input { resize: none; min-height: 44px; max-height: 200px; }
.input:focus { outline: none; border-color: var(--bronze); }
.send-btn { height: 44px; width: 44px; border-radius: var(--r-sm); border: 0; background: var(--ink); color: var(--gold); display: grid; place-items: center; cursor: pointer; }
.send-btn svg { width: 18px; height: 18px; }
.send-btn:disabled { opacity: .4; }
.attach-btn { height: 44px; width: 44px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.attach-btn svg { width: 18px; height: 18px; }
.previews { display: flex; gap: 8px; flex-wrap: wrap; }
.preview { position: relative; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 2px; border: 0; background: rgba(22, 25, 29, .8); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.preview.loading::after { content: ""; position: absolute; inset: 0; background: rgba(255, 253, 248, .6); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; }
.error-note { color: var(--meat); font-size: 13px; }

/* ---------------- sheet / modal ---------------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(22, 25, 29, .38); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; background: var(--paper);
  border-radius: 12px 12px 0 0; padding: 10px 18px calc(18px + var(--safe-b));
  animation: up .35s var(--ease) both; box-shadow: 0 -10px 40px -20px rgba(22, 25, 29, .4);
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.modal .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 14px; }
.modal h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; color: var(--ink); font-stretch: 112%; font-variation-settings: "wdth" 112; }
.modal .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; }
.form label > span { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.form .row-btns { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 95; background: rgba(12, 13, 15, .92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .2s ease both; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 99;
  background: var(--ink); color: #F6F1E4; padding: 11px 16px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); animation: up .3s var(--ease) both; display: flex; gap: 10px; align-items: center;
}
.toast svg { width: 16px; height: 16px; color: var(--gold); }

/* ---------------- desktop ---------------- */
@media (min-width: 900px) {
  :root { --header-h: 84px; --maxw: 760px; --gutter: 24px; }
  .brand img { width: 32px; height: 32px; }
  .brand .wordmark { font-size: 14px; }
  .tabs { position: sticky; top: calc(var(--header-h) + var(--safe-t) + 1px); bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); background: rgba(246, 243, 236, .92); }
  .tabs-inner { height: 52px; max-width: 620px; }
  .tab { flex-direction: row; gap: 8px; font-size: 11px; }
  .tab svg { width: 17px; height: 17px; }
  .tab[aria-current="page"]::before { top: auto; bottom: -1px; left: 14%; right: 14%; }
  .tab .badge { top: 14px; left: auto; right: 12%; }
  main.view { padding-bottom: 80px; padding-top: 28px; }
  .cards.grid2 { grid-template-columns: 1fr 1fr; }
  .cards.grid2 .span2 { grid-column: span 2; }
  .scrim { align-items: center; }
  .modal { border-radius: 10px; padding-bottom: 22px; }
  .modal .grab { display: none; }
  .toast { bottom: 28px; }
  .page-head h1 { font-size: 36px; }
}

.page-head h1.phrase { font-size: 24px; line-height: 1.08; }
@media (min-width: 900px) { .page-head h1.phrase { font-size: 28px; } }
.hello .page-head { flex-wrap: wrap; align-items: flex-end; row-gap: 10px; }
