/* RM Platform — Sacred Warmth design tokens & shared components.
   Consumed by every mockup. See ../../MASTER.md for the rationale. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Karla:wght@400;500;700&display=swap');

:root {
  --ivory: #FAF7F0;
  --paper: #FFFDF8;
  --parchment: #F3EDE1;
  --charcoal: #2B2520;
  --umber: #6B5F52;
  --saffron: #C2570F;
  --saffron-deep: #A34708;
  --gold: #B98A2E;
  --gold-deep: #8A6420;
  --leaf: #3E6B4F;
  --leaf-tint: #E7F0EA;
  --clay: #B3261E;
  --clay-tint: #F9E9E7;
  --border: #E5DCCB;
  --shadow: rgba(67, 48, 15, 0.08);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Karla', 'Segoe UI', sans-serif;

  --r-card: 14px;
  --r-ctl: 10px;

  --speed: 200ms;

  --topbar-h: 60px;

  --card-pad: 24px;
  /* the one distance between cards, and the one between rows of a list */
  --card-gap: 24px;
  --list-gap: 12px;
}

/* ---- Scripts ---------------------------------------------------------
   Fraunces and Karla carry Latin only. Each non-Latin language swaps the
   two font tokens to a Noto Serif / Noto Sans pair for its script (loaded
   per locale by app.js's sendSetLang) and sets the metrics its glyphs
   need. `lang` on <html> is set by the same port, so these apply only to
   the active language. */
html:lang(zh-Hans) {
  --font-display: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
html:lang(zh-Hant) {
  --font-display: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --font-body: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}
html:lang(ja) {
  --font-display: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --font-body: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
html:lang(ko) {
  --font-display: 'Noto Serif KR', 'Apple SD Gothic Neo', 'Malgun Gothic', serif;
  --font-body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
html:lang(ru) {
  --font-display: 'Noto Serif', Georgia, serif;
  --font-body: 'Noto Sans', 'Segoe UI', sans-serif;
}

/* Han and Hangul read denser than Latin at equal size: more leading, no
   tracking, no italics (the scripts have none — emphasis becomes weight),
   and headings one step down on a phone. Cyrillic needs only the leading. */
html:lang(zh-Hans) body, html:lang(zh-Hant) body, html:lang(ja) body, html:lang(ko) body {
  line-height: 1.7;
  letter-spacing: 0;
}
html:lang(ru) body { line-height: 1.65; }
html:lang(zh-Hans) em, html:lang(zh-Hant) em, html:lang(ja) em, html:lang(ko) em,
html:lang(zh-Hans) i, html:lang(zh-Hant) i, html:lang(ja) i, html:lang(ko) i,
html:lang(zh-Hans) .chat-page .chat-origin-note,
html:lang(zh-Hant) .chat-page .chat-origin-note,
html:lang(ja) .chat-page .chat-origin-note,
html:lang(ko) .chat-page .chat-origin-note,
html:lang(zh-Hans) .chat-page .bubble-sealed,
html:lang(zh-Hant) .chat-page .bubble-sealed,
html:lang(ja) .chat-page .bubble-sealed,
html:lang(ko) .chat-page .bubble-sealed {
  font-style: normal;
  font-weight: 500;
}
/* The Noto serifs set Latin names wider than Fraunces; in the two-pane
   Connections list the CJK date is wider too, and a Sanskrit name broke
   mid-word. A smaller name and a tighter row keep it on one line. */
html:lang(zh-Hans) .connections-list .result-name, html:lang(zh-Hant) .connections-list .result-name,
html:lang(ja) .connections-list .result-name, html:lang(ko) .connections-list .result-name { font-size: 17px; }
html:lang(zh-Hans) .connections-list .conversation-row, html:lang(zh-Hant) .connections-list .conversation-row,
html:lang(ja) .connections-list .conversation-row, html:lang(ko) .connections-list .conversation-row { gap: 10px; }
@media (max-width: 767px) {
  html:lang(zh-Hans) h1, html:lang(zh-Hant) h1, html:lang(ja) h1, html:lang(ko) h1 { font-size: 34px; }
  html:lang(zh-Hans) h2, html:lang(zh-Hant) h2, html:lang(ja) h2, html:lang(ko) h2 { font-size: 26px; }
  /* form-group labels are labels, not display headings, in every script */
  html:lang(zh-Hans) .form-group > h2, html:lang(zh-Hant) .form-group > h2,
  html:lang(ja) .form-group > h2, html:lang(ko) .form-group > h2 { font-size: 17px; }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  /* faint warm grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 550;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: 0;
}

h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }

@media (min-width: 768px) {
  h1 { font-size: 52px; }
}

p { margin: 0 0 1em; }

a { color: var(--saffron-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.muted { color: var(--umber); }
.small { font-size: 15px; }

/* ---------- layout ---------- */

.shell { max-width: 480px; margin: 0 auto; padding: 0 20px 96px; }
.shell-wide { max-width: 1080px; margin: 0 auto; padding: 0 24px 64px; }

@media (min-width: 768px) {
  .shell { max-width: 560px; }
  .install-banner { max-width: 560px; }
}

/* ---------- ornament: gold double hairline with petal mark ---------- */

.ornament {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 48px 0;
  color: var(--gold);
}
.ornament::before,
.ornament::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--gold);
  opacity: 0.45;
}
.ornament svg { flex: none; opacity: 0.7; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--saffron);
  color: #fff;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--speed) ease-out, transform var(--speed) ease-out;
}
.btn:hover { background: var(--saffron-deep); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }

.btn-ghost {
  background: transparent;
  color: var(--saffron-deep);
  border: 1.5px solid var(--saffron);
}
.btn-ghost:hover { background: rgba(194, 87, 15, 0.07); }

.btn-quiet {
  background: transparent;
  color: var(--umber);
  font-weight: 500;
}
.btn-quiet:hover { background: var(--parchment); }

.btn-danger { background: var(--clay); }
.btn-danger:hover { background: #93201A; }

.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-block { width: 100%; }

/* ---------- cards ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
  padding: var(--card-pad);
}

/* ---------- form fields ---------- */

.field { margin-bottom: 20px; }

/* ---------- form groups ----------
   A form is a task on the page, not an object in a card: a group is the
   small gold label, its fields and its own buttons, on the ivory surface.
   Consecutive groups are parted by a hairline; a card beside a group takes
   the card gap (stakeholder, 2026-10-21). */
.form-group { min-width: 0; }
.form-group > h2 {
  font-size: 17px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 20px;
}
.form-group + .form-group {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.card + .form-group,
.form-group + .card { margin-top: var(--card-gap); }
.group-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--charcoal);
  transition: border-color var(--speed) ease-out;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
  border-color: var(--saffron);
}
.field .helper { font-size: 14px; color: var(--umber); margin-top: 6px; }
.field .error-msg,
.connection-request .error-msg,
.connections-list .error-msg { font-size: 14px; color: var(--clay); font-weight: 500; margin-top: 6px; }
.field.has-error input { border-color: var(--clay); }

/* ---------- combobox: searchable single-select ---------- */

.combobox { position: relative; }
.combobox-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 30;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  max-height: 24rem;
  overflow-y: auto;
}
.combobox-option { min-height: 44px; padding: 10px 14px; cursor: pointer; }
.combobox-option[aria-selected="true"],
.combobox-option:hover { background: var(--parchment); }
.combobox-empty { padding: 10px 14px; color: var(--umber); }

/* ---------- pills: visibility & status badges ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pill-public { background: var(--leaf-tint); color: var(--leaf); }
.pill-match { background: #F0E6D2; color: var(--gold-deep); }
.pill-private { background: var(--parchment); color: var(--umber); }
.pill-verified { background: var(--leaf-tint); color: var(--leaf); }
.pill-pending { background: #F0E6D2; color: var(--gold-deep); }
.pill-danger { background: var(--clay-tint); color: var(--clay); }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 20px;
  background: color-mix(in srgb, var(--ivory) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar > * { flex: none; }
.topbar .brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--charcoal);
  text-decoration: none;
  white-space: nowrap;
  /* the padding is cancelled by the margin: the hover surface grows, the
     row does not, so the brand sits where it always did. */
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* the mark beside the name: decorative, the name is always live text */
.brand-mark { display: block; width: 28px; height: 28px; flex: none; }
.topbar a.brand:hover { background: var(--parchment); }
.topbar a.brand:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
/* The language picker: a quiet native select, the one control that must
   read in every language at once (native names, never translated). */
.lang-select {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--umber);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  padding: 6px 10px;
  min-height: 36px;
  cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }
.topbar .lang-select { margin-right: 8px; }
.topbar .spacer { flex: 1 0 12px; }
.topbar .btn { white-space: nowrap; }
.topbar .btn svg { width: 20px; height: 20px; }

/* Margii tabs live in the topbar from 900px up and in the bottom nav below. */
.topbar-tabs { display: none; gap: 4px; }
.topbar-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  color: var(--umber);
  text-decoration: none;
}
.topbar-tabs a.active { color: var(--saffron-deep); }
/* Help, Notices and Settings are not in the bottom nav: on a phone their
   topbar icon is the only "you are here", so it carries an active state in
   the colour .topbar-tabs a.active uses. */
.topbar .btn-quiet.active,
.topbar-bell.active { background: var(--parchment); color: var(--saffron-deep); }
.topbar-tabs a:hover { background: var(--parchment); }
.topbar-tabs svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .topbar-tabs { display: flex; }
}

/* Below 900px — the same breakpoint at which the tabs leave the topbar for
   the bottom nav — the action buttons keep their icon and drop the word.
   One breakpoint for the whole nav behaviour. */
@media (max-width: 899px) {
  .topbar .topbar-label { display: none; }
  .topbar .btn { padding-inline: 10px; }
}

/* Below 600px the row itself tightens so a 360px phone keeps slack. */
@media (max-width: 599px) {
  .topbar { gap: 8px; padding: 0 16px; }
  /* the mark alone: the name stays for screen readers, the hero and the
     auth cards carry the emblem, the document title carries the name.
     Same declarations as .visually-hidden. */
  .topbar .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

/* Signed in, below 1024px the tabs and actions share the topbar with the
   brand, so it shows the mark alone and icon-only actions there too (the
   sidenav carries the name and the words from 1024px up). Anonymous topbars
   keep the name from 600px and the labels from 900px. The name's hide uses
   the same declarations as .visually-hidden. */
@media (max-width: 1023px) {
  .app-frame .topbar .topbar-label { display: none; }
  .app-frame .topbar .btn { padding-inline: 10px; }
  .app-frame .topbar .brand-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

/* ---------- bottom navigation (app screens, mobile) ---------- */

.bottomnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  background: var(--paper);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--umber);
  text-decoration: none;
}
.bottomnav a { position: relative; }
.bottomnav a.active { color: var(--saffron-deep); }
.bottomnav a:hover { background: var(--parchment); }
.bottomnav svg { width: 22px; height: 22px; }
/* After the base rule on purpose: equal specificity, so order decides. */
@media (min-width: 900px) {
  .bottomnav { display: none; }
}

/* The Connections count on a margii tab: the sidebar badge's look, small.
   In the bottom nav it sits on the icon's shoulder; in the topbar tab it
   follows the word. */
.nav-badge {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--clay);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.bottomnav .nav-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 6px);
}

/* ---------- avatar ---------- */

.avatar {
  border-radius: 999px;
  object-fit: cover;
  background: var(--parchment);
  border: 1px solid var(--border);
}

.avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--gold-deep);
}

/* ---------- quota dots ---------- */

.quota-dots { display: inline-flex; gap: 6px; align-items: center; }
.quota-dots i {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--saffron);
  display: inline-block;
}
.quota-dots i.used { background: var(--border); }

/* ---------- progress bar ---------- */

.progress { height: 6px; background: var(--parchment); border-radius: 999px; margin: 10px 0; }
.progress i { display: block; height: 100%; background: var(--saffron); border-radius: 999px; }

/* loading: the brand mark breathing where the content will be */
.spinner { display: flex; justify-content: center; padding: 48px 0; }
.spinner-mark {
  width: 40px;
  height: 40px;
  animation: breathe 1.4s ease-in-out infinite alternate;
}
@keyframes breathe {
  from { opacity: 0.45; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .spinner-mark { animation: breathe-still 1.4s ease-in-out infinite alternate; }
  @keyframes breathe-still { from { opacity: 0.45; } to { opacity: 1; } }
}

/* text for assistive technology only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- staggered entrance ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 420ms ease-out backwards; }
  .rise:nth-child(2) { animation-delay: 50ms; }
  .rise:nth-child(3) { animation-delay: 100ms; }
  .rise:nth-child(4) { animation-delay: 150ms; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
  }
}

/* ---------- landing page ---------- */
/* Styles for classes emitted by assets/src/Pages/Landing.elm.
   These were previously only in the page-local <style> block of
   design/mockups/01-landing.html. The .petal-watermark rule is omitted
   because Landing.elm does not render that element. */

/* hero section */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 56px 24px 64px;
}

/* the emblem: the full mark with its rays, above a hero or an auth card's title */
.emblem { display: block; margin: 0 auto; }
.hero .emblem { width: 160px; height: 160px; margin-bottom: 24px; }
.card .emblem { width: 72px; height: 72px; margin: 0 0 16px; }
.auth-page .emblem { width: 72px; height: 72px; margin: 0 auto 16px; }

/* Signed-out pages (Login, Forgot, Reset, Invite): the form sits on the page
   (stakeholder, 2026-10-21) — emblem and title centred, fields left-aligned,
   the one button full width. The invite's end-state message stays a card. */
.auth-page { padding-top: 36px; text-align: center; }
.auth-page h1 { margin-bottom: 6px; }
.auth-page > p,
.auth-page .invite-activation > p { margin: 0 0 28px; }
.auth-page form,
.auth-page .field { text-align: left; }
.auth-page form > .btn { width: 100%; }
.auth-page .invite-end { text-align: center; }

.hero .kicker {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 18px;
}

/* .kicker can appear standalone (not nested in .hero) per Landing.elm usage */
.kicker {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 18px;
}

.hero h1 { max-width: 17ch; margin: 0 auto 20px; text-wrap: balance; }

.lede {
  max-width: 46ch;
  margin: 0 auto 36px;
  font-size: 19px;
  color: var(--umber);
}

.actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* section layout */
.landing section { padding: 0 24px; }

/* Space between consecutive sections. The hero and #rm keep their own
   spacing (hero padding, ornament), so only section + section is spaced. */
.landing section + section { margin-top: 72px; }

.landing #begin { text-align: center; }
/* the closing invitation: room to breathe around the one button */
.landing #begin h2 { margin-bottom: 28px; }
.landing #begin .btn { margin: 0 0 28px; }

.section-inner { max-width: 720px; margin: 0 auto; }

.section-title { text-align: center; }

.section-kicker {
  display: block;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 10px;
}

/* how-it-works steps grid */
.steps {
  display: grid;
  gap: 18px;
  margin-top: 36px;
}

@media (min-width: 768px) {
  .steps { grid-template-columns: 1fr 1fr 1fr; }
}

.step { padding: 28px 24px; }

.step .num,
.num {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--saffron);
  display: block;
  margin-bottom: 10px;
}

.step h3 { font-size: 21px; }

.step p { margin: 0; color: var(--umber); font-size: 16px; }

/* trust box */
.trust {
  background: var(--parchment);
  border-radius: 20px;
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px;
}

.trust ul {
  list-style: none;
  margin: 28px auto 0;
  padding: 0;
  max-width: 560px;
  display: grid;
  gap: 16px;
}

.trust li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 16.5px;
}

.trust li svg {
  flex: none;
  margin-top: 3px;
  color: var(--leaf);
}

/* FAQ details/summary (scoped to .landing to avoid bleed into SPA forms) */
.landing details {
  border-bottom: 1px solid var(--border);
  padding: 18px 4px;
}

.landing details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.landing details summary::after {
  content: '+';
  color: var(--gold-deep);
  font-size: 20px;
}

.landing details[open] summary::after { content: '–'; }

.landing details p { margin: 12px 0 0; color: var(--umber); font-size: 16px; }

/* the ten principles */
.landing .principles {
  list-style: none;
  padding: 0;
  margin: 36px 0 0;
  display: grid;
  gap: 18px;
}

.landing .principle h3 { margin: 0 0 6px; font-size: 21px; }

.landing .principle p { margin: 0; color: var(--umber); }

.landing .principles-source { margin-top: 20px; text-align: center; }

/* footer */
.landing .landing-footer {
  margin-top: 0;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.landing .landing-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* ---------- field visibility toggle ---------- */

.vis-toggle { display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:4px 12px; border:1px solid var(--border); border-radius:999px; background:var(--leaf-tint); color:var(--leaf); font-size:13.5px; font-weight:700; cursor:pointer; }
.vis-toggle svg { width:16px; height:16px; }
.vis-toggle.vis-hidden { background:var(--parchment); color:var(--umber); }

/* ---------- profile pages ---------- */
/* Styles for the classes emitted by assets/src/Pages/MyProfile.elm
   (.profile-page editor; its read-only mode is .profile-view) and
   assets/src/Pages/ProfileView.elm (.profile-view).
   Promoted from the page-local <style> blocks of
   design/mockups/04-profile-setup.html and 05-profile-view.html so the live
   Elm pages gain the mockups' rhythm and component polish.

   Element / loose selectors are scoped under the wrapper classes so they
   cannot bleed into other screens (a prior reviewer flagged global selector
   bleed from the landing promotion). Class-only selectors may stay global.

   The 3-way segmented "vis-control" from mockup 04 is intentionally NOT
   promoted: the live app ships the binary eye `.vis-toggle` (above), which is
   integrated into `.field-label-row` here. Photo and chat-request styles are
   omitted — those screens belong to later phases. */

/* gold uppercase section header (shared by both profile pages).
   Reconciles mockup 04's `.section-header` and 05's `.section h2`.
   Scoped to the profile wrappers: `.section-header` is already used by
   Invitations.elm as a flex label+action row, so this must not bleed there. */
.profile-page .section-header,
.profile-view .section-header {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 12px;
}

.profile-page .section-helper,
.profile-view .section-helper {
  font-size: 14px;
  color: var(--umber);
  margin: 0 0 16px;
}

/* ----- edit page (.profile-page) ----- */

/* completeness card: big Fraunces numeral + thin saffron bar + nudge.
   The Elm card reuses the shared `.progress` / `.progress i` bar (defined
   above) rather than the mockup's separate `.progress-bar-track`, so the two
   are reconciled, not duplicated. */
.completeness-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.completeness-card .completeness-top {
  display: flex;
  align-items: center;
  gap: 20px;
}
.completeness-card .completeness-pct {
  flex: none;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 550;
  line-height: 1;
  color: var(--saffron);
}
.completeness-card .completeness-info {
  flex: 1;
  min-width: 0;
}
/* tighten the shared progress bar's vertical margins inside the card */
.completeness-card .progress { margin: 0 0 8px; }
.completeness-card .completeness-nudge {
  font-size: 13.5px;
  color: var(--umber);
  margin: 0;
}
/* While viewing, the card is a button and the way into editing: a saffron
   line of intent under the bar, a chevron in a parchment disc, and a lift
   on hover or focus. While editing the plain card carries the bar only. */
.completeness-card .completeness-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  color: var(--saffron-deep);
}
.completeness-card-live {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color var(--speed) ease-out, box-shadow var(--speed) ease-out, transform var(--speed) ease-out;
}
.completeness-card-live .completeness-chevron {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--parchment);
  color: var(--saffron-deep);
  transition: background var(--speed) ease-out, color var(--speed) ease-out;
}
.completeness-card-live .completeness-chevron::before {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: translateX(-1px) rotate(45deg);
}
.completeness-card-live:hover,
.completeness-card-live:focus-visible {
  border-color: var(--saffron);
  box-shadow: 0 6px 18px rgba(194, 87, 15, 0.14);
  transform: translateY(-1px);
}
.completeness-card-live:hover .completeness-chevron,
.completeness-card-live:focus-visible .completeness-chevron {
  background: var(--saffron);
  color: #fff;
}
.completeness-card-live:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .completeness-card-live, .completeness-card-live .completeness-chevron { transition: none; }
  .completeness-card-live:hover, .completeness-card-live:focus-visible { transform: none; }
}

/* both profile modes read name, completeness, photos: the completeness card
   sits between the identity (or header) card and the photos with the same
   gap the page gives its section cards */
.profile-page > .profile-form > .completeness-card { margin-top: var(--card-gap); }
.profile-view .profile-side-top > .completeness-card { margin-top: var(--card-gap); }

/* identity card: the acarya-attested header, read-only, opens the editor */
.identity-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.identity-list dt { color: var(--umber); font-weight: 600; }
.identity-list dd { margin: 0; }

/* the editor's controls sit in a fieldset (disabled while the discard prompt
   is up) that must not take part in layout: its children are the grid items */
.profile-form { display: contents; border: 0; margin: 0; padding: 0; min-width: 0; }
/* visibility intro line leads from the photos card into the sections */
.profile-page .vis-intro { margin: 18px 2px 4px; }

/* clear the fixed save bar (.cta-bar) + bottomnav so nothing is hidden */
/* Save button is inline at the end of the form (not sticky); just clear the
   bottom nav so the last row isn't hidden behind it. */
.profile-page { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
/* From 900px there is no bottom nav to clear (tabs live in the topbar) —
   same breakpoint, same reason as the .cta-bar rule below. */
@media (min-width: 900px) {
  .profile-page { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

.profile-save-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 32px;
}
.profile-save-row .btn-quiet { flex: none; white-space: nowrap; }

/* each section is a card or a group; the page's card gap between them (a
   group after a group takes the hairline rule instead) */
.profile-page section { margin-top: var(--card-gap); }
.profile-page section:first-of-type { margin-top: 32px; }

/* field rhythm inside a section card */
.profile-page .profile-field { margin-bottom: 24px; }
.profile-page .profile-field:last-child { margin-bottom: 0; }

/* label row: label left, eye toggle right-aligned (mockup 04 pattern) */
.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.field-label-row label {
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

/* the field input wrapper carries no extra bottom margin — .profile-field owns spacing */
.profile-page .profile-field .field { margin-bottom: 0; }

/* Yes/No bool: a clear connected button pair */
.bool-choice { display: flex; gap: 10px; }
.bool-choice .btn { flex: 1; }
/* the chosen option reads as selected (saffron fill) while the other stays ghost */
.bool-choice .btn.btn-active {
  background: var(--saffron);
  border-color: var(--saffron);
  color: #fff;
}

/* 1–10 scale select: keep it from stretching the full width on wide screens */
.profile-page .scale-field select { max-width: 8.5em; }

/* languages: a tidy responsive checkbox grid */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
}
@media (min-width: 480px) {
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
}
.lang-grid .lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.lang-grid .lang-item input { width: 18px; height: 18px; accent-color: var(--saffron); flex: none; }

/* ranking widget: numbered rows in a bordered group, reorder arrows at right */
.ranking-list {
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  overflow: hidden;
  background: var(--paper);
}
.ranking-list .ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.ranking-list .ranking-item:last-child { border-bottom: 0; }
.ranking-list .rank-num {
  flex: none;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--saffron);
  width: 1.4em;
  text-align: right;
}
.ranking-list .rank-label { flex: 1; min-width: 0; font-weight: 500; }
.ranking-list .rank-btns { flex: none; display: flex; gap: 4px; }
.ranking-list .rank-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  color: var(--umber);
}
.ranking-list .rank-btn:disabled { opacity: 0.3; }

/* sticky save bar — floats above the fixed bottomnav (mockup .cta-bar) */
.cta-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 64px; /* clears the bottomnav */
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--ivory) 35%);
  pointer-events: none;
  z-index: 30;
}
.cta-bar .inner {
  max-width: 480px;
  margin: 0 auto;
  pointer-events: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.cta-bar .inner .btn-quiet { flex: none; white-space: nowrap; }
@media (min-width: 768px) { .cta-bar .inner { max-width: 560px; } }
/* From 900px the bottom nav is gone (tabs live in the topbar); .cta-bar
   only needs to clear the viewport edge, not a floating nav — same
   breakpoint as the bottom nav's disappearance, one breakpoint per
   behaviour. */
@media (min-width: 900px) { .cta-bar { bottom: 16px; } }

/* ----- view page (.profile-view) ----- */

/* identity header: avatar + Fraunces display name + meta line */
.profile-view .profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-view .profile-header .result-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 550;
  line-height: 1.15;
  margin: 0 0 2px;
}
.profile-view .profile-header .result-meta,
.profile-view .profile-header .result-languages {
  color: var(--umber);
  font-size: 16px;
  margin: 0;
}

.profile-view section { margin-top: var(--card-gap); }
.profile-view section:first-of-type { margin-top: 32px; }

/* compose CTA / panel follow the sections but aren't a <section> themselves */
.profile-view .compose-cta { margin-top: var(--card-gap); }

/* quiet report/block actions — deliberately low-visual-weight, set apart
   from the compose CTA by a hairline rather than a card so neither reads as
   a primary action. */
.profile-view .actions-panel {
  margin-top: var(--card-gap);
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-view .actions-row { display: flex; }
.profile-view .actions-row .btn-quiet { font-size: 14.5px; color: var(--umber); }
/* the block confirmation stays a card; the report and compose forms are
   groups on the page (the group label style for their headings) */
.profile-view .actions-card.card { padding: 20px 24px; }
.profile-view .actions-card p { margin: 0 0 16px; color: var(--charcoal); }
.profile-view .form-group.actions-card,
.profile-view .compose-panel { margin-top: var(--card-gap); }

/* read-only dt/dd rows: label left (umber), value right (medium) —
   shared by both read-only profile views (another member's in
   ProfileView.elm, the owner's own in MyProfile.elm; both render through
   Profile/Render.elm under .profile-view — the editor emits no rows) and a
   request's disclosed-fields rows (ConnectionRequest.elm's "Shared with you"
   section; row-block is unused there, so left scoped to .profile-view). */
.profile-view .rows,
.connection-request .rows { display: grid; gap: 0; margin: 0; }
.profile-view .row,
.connection-request .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 16.5px;
}
.profile-view .row:last-child,
.connection-request .row:last-child { border-bottom: 0; }
.profile-view .row dt,
.connection-request .row dt { color: var(--umber); margin: 0; }
.profile-view .row dd,
.connection-request .row dd { margin: 0; font-weight: 500; text-align: right; }
/* free-text answers read as a paragraph block rather than a single right-aligned line */
.profile-view .row.row-block { display: block; }
.profile-view .row.row-block dt { margin-bottom: 6px; }
.profile-view .row.row-block dd { text-align: left; font-weight: 400; }
/* numbered ranking answer inside a row */
.profile-view .row dd ol {
  margin: 0;
  padding-left: 1.2em;
  font-weight: 500;
  text-align: left;
}
.profile-view .row.row-block dd ol { font-weight: 400; }
/* the owner's own read-only view lists fields they hid, dimmed and badged */
.row-hidden dt,
.row-hidden dd { color: var(--umber); }
.vis-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--umber);
  vertical-align: middle;
}

/* ---------- photo grid (profile-page editor + profile-view gallery) ---------- */

.profile-page .photo-grid,
.profile-view .photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-page .photo-tile,
.profile-view .photo-tile {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: var(--r-ctl);
  overflow: hidden;
  background: var(--parchment);
  border: 1px solid var(--border);
  flex: none;
}

.photo-tile .vis-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: var(--paper);
}

.profile-page .photo-tile img,
.profile-view .photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Controls overlay below the image inside the tile */
.profile-page .photo-tile-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px;
  background: linear-gradient(transparent, rgba(43, 37, 32, 0.65));
}

.profile-page .photo-tile-controls .vis-toggle {
  font-size: 12px;
  padding: 3px 8px;
  min-height: 36px;
  border-radius: 999px;
}

.profile-page .photo-tile-controls .vis-toggle svg {
  width: 13px;
  height: 13px;
}

.profile-page .photo-delete-btn {
  font-size: 12px;
  min-height: 36px;
  padding: 3px 8px;
  color: #fff;
  opacity: 0.85;
}

.profile-page .photo-delete-btn:hover {
  opacity: 1;
  background: rgba(179, 38, 30, 0.5);
}

.profile-page .photo-upload-btn {
  min-height: 48px;
  margin-top: 4px;
}

/* ---------- toasts (global, app-wide) ---------- */

.toast-region {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
  pointer-events: none;
}

@media (min-width: 640px) {
  .toast-region {
    left: auto;
    right: 16px;
    max-width: 380px;
    padding: 0;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  border-radius: 12px;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
}

.toast-message {
  flex: 1;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}

.toast-success {
  background: var(--leaf-tint);
  color: var(--leaf);
  border-left-color: var(--leaf);
}

.toast-error {
  background: var(--clay-tint);
  color: var(--clay);
  border-left-color: var(--clay);
}

.toast-close {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: -8px -4px -8px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.toast-close:hover {
  background: rgba(67, 48, 15, 0.08);
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in 240ms ease-out backwards; }
  @keyframes toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
  }
}

/* ── Discover page (scoped) ──────────────────────────────────────────────── */

.discover-page .topbar-count {
  font-size: 13.5px;
  color: var(--umber);
  font-family: var(--font-display);
}
/* The page has no title: the count and the way to the shortlist lead it. */
.discover-page .discover-head { text-align: center; margin: 24px 0 var(--card-gap); }
.discover-page .discover-head .topbar-count { margin: 0 0 8px; }

.discover-page .profile-card {
  margin-top: var(--card-gap);
}
.discover-page .discover-head + .profile-card { margin-top: 0; }

.discover-page .photo {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(130% 100% at 25% 15%, #DEC99E 0%, transparent 58%),
    radial-gradient(100% 90% at 80% 85%, #C9B48E 0%, transparent 52%),
    var(--parchment);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.discover-page .photo .initials {
  font-family: var(--font-display);
  font-size: 88px;
  color: var(--gold-deep);
  opacity: 0.55;
  user-select: none;
}

.discover-page .profile-body {
  padding: 20px 24px 24px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--r-card) var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
}
.discover-page .photo {
  border-radius: 14px 14px 0 0;
  border-bottom: 0;
}

/* the shared identity block (Ui/MemberIdentity.elm) at the card's size */
.discover-page .member-identity { margin-bottom: 14px; }
.discover-page .member-identity .result-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 550;
  margin: 0 0 4px;
}
.discover-page .member-identity .result-meta {
  font-size: 15.5px;
  color: var(--umber);
  margin: 0;
}
.discover-page .member-identity .result-languages {
  font-size: 14px;
  color: var(--umber);
  margin: 4px 0 0;
}

.discover-page .quote-section,
.connection-request .quote-section {
  background: var(--parchment);
  border-radius: var(--r-ctl);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.discover-page .quote-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 6px;
}
.discover-page .quote-text,
.connection-request .quote-text {
  font-size: 15.5px;
  color: var(--charcoal);
  line-height: 1.55;
  margin: 0;
}
/* Discover previews the words; a request's detail is where they are read
   in full. */
.discover-page .quote-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.connection-request .quote-text { white-space: pre-line; overflow-wrap: anywhere; }

.discover-page .key-facts {
  display: grid;
  gap: 0;
  margin-bottom: 16px;
}
.discover-page .fact-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
  font-size: 15.5px;
}
.discover-page .fact-row:last-child { border-bottom: 0; }
.discover-page .fact-label { color: var(--umber); }
.discover-page .fact-value { font-weight: 500; text-align: right; }

.discover-page .view-full-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--saffron-deep);
  text-decoration: none;
  padding: 6px 0;
}
.discover-page .view-full-link:hover { text-decoration: underline; }
.discover-page .view-full-link:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; border-radius: 4px; }

.discover-page .decision-section {
  margin-top: 32px;
}
.discover-page .decision-helper {
  font-size: 14px;
  color: var(--umber);
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.5;
  padding: 0 4px;
}
.discover-page .decision-buttons,
.connection-request .decision-buttons,
.profile-view .decision-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.discover-page .decision-buttons .btn,
.discover-page .decision-buttons .btn-ghost,
.discover-page .decision-buttons .btn-quiet,
.connection-request .decision-buttons .btn,
.connection-request .decision-buttons .btn-ghost,
.connection-request .decision-buttons .btn-quiet,
.profile-view .decision-buttons .btn,
.profile-view .decision-buttons .btn-ghost,
.profile-view .decision-buttons .btn-quiet {
  font-size: 15px;
  padding: 12px 8px;
  min-height: 52px;
  text-align: center;
}

/* Discover's decision row has three actions (pass / maybe / interested);
   a request's detail (accept/decline) and compose panel (cancel/send) each
   have exactly two, so both override the shared three-column grid. */
.connection-request .decision-buttons,
.profile-view .decision-buttons {
  grid-template-columns: 1fr 1fr;
}
/* Decline asks once, in the row itself: the question above its two
   answers, so nothing below moves. */
.connection-request .decision-buttons > p {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.discover-page .shortlist-footer {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.discover-page .shortlist-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 500;
  color: var(--saffron-deep);
  text-decoration: none;
}
.discover-page .shortlist-link:hover { text-decoration: underline; }
.discover-page .shortlist-link:focus-visible { outline: 2px solid var(--saffron); outline-offset: 3px; border-radius: 4px; }

/* ── Shortlist page (scoped) ─────────────────────────────────────────────── */
/* The results-list rules below (.results-header through .result-badge) are
   grouped with .search-page — Search's result cards reuse the same look. */

.search-page .results-header,
.shortlist-page .results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 16px;
}
.search-page .results-count,
.shortlist-page .results-count {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--umber);
}

.search-page .result-card,
.shortlist-page .result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
  text-decoration: none;
  color: inherit;
  margin-bottom: var(--list-gap);
  transition: background var(--speed) ease-out, box-shadow var(--speed) ease-out;
  position: relative;
}
.search-page .result-card:hover,
.shortlist-page .result-card:hover {
  background: #FFFEF9;
  box-shadow: 0 2px 4px var(--shadow), 0 12px 32px var(--shadow);
}
.search-page .result-card:focus-visible,
.shortlist-page .result-card:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
}

.search-page .result-avatar,
.shortlist-page .result-avatar,
.connection-request .result-avatar,
.connections-list .result-avatar {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-deep);
  opacity: 0.9;
}

/* The initials avatar keeps the plain .avatar-initials look (inherited text
   size, full opacity) — only photos take the shared result-avatar font/opacity. */
.search-page .result-avatar.avatar-initials,
.shortlist-page .result-avatar.avatar-initials {
  font-size: inherit;
  opacity: 1;
}

.search-page .result-body,
.shortlist-page .result-body,
.connection-request .result-body,
.connections-list .result-body {
  flex: 1;
  min-width: 0;
}
.search-page .result-name,
.shortlist-page .result-name,
.connection-request .result-name,
.connections-list .result-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 550;
  line-height: inherit;
  margin: 0 0 2px;
  color: var(--charcoal);
}
.search-page .result-meta,
.shortlist-page .result-meta,
.connection-request .result-meta,
.connections-list .result-meta,
.connections-list .result-detail {
  font-size: 14px;
  color: var(--umber);
  margin: 0 0 6px;
}
.shortlist-page .result-quote {
  font-size: 14.5px;
  color: var(--charcoal);
  margin: 0 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}
.search-page .result-languages,
.shortlist-page .result-languages,
.connection-request .result-languages,
.connections-list .result-languages {
  font-size: 13px;
  color: var(--umber);
  margin: 0;
}

.shortlist-page .result-chevron {
  flex: none;
  color: var(--border);
  margin-left: auto;
  padding-left: 4px;
}

.search-page .result-badge,
.shortlist-page .result-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.shortlist-page .result-actions { display: flex; gap: 8px; }
/* On a phone, Move and Remove sit in a full-width row under the member row,
   under a hairline — the desktop portrait card already lays them out that
   way with its own rules, so these stop at the breakpoint. */
@media (max-width: 1023px) {
  .shortlist-page .result-card { flex-wrap: wrap; }
  .shortlist-page .result-actions {
    width: 100%;
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  .shortlist-page .result-actions .btn { min-height: 44px; padding: 8px 14px; font-size: 14.5px; }
}

/* ── Search page (scoped) ────────────────────────────────────────────────── */

/* Search's and Shortlist's result markup is div.result-card > a.result-link
   (avatar + result-body) + trailing content (a badge, or the shortlist's
   actions) — unlike the flat mockup card, so .result-link needs its own
   flex layout. A request's detail uses the same avatar+body wrapper
   directly (no result-card ancestor, no badge) and shares this layout too. */
.search-page .result-link,
.shortlist-page .result-link,
.connection-request .result-link,
.connections-list .result-link {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.search-page .result-link:focus-visible,
.shortlist-page .result-link:focus-visible,
.connections-list .result-link:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 3px;
  border-radius: var(--r-ctl);
}

/* the hint and empty-state cards in the results column */
.search-page > .card { margin-top: var(--card-gap); }
/* The filters are a form group on the page at every width. On a phone the
   page name says "Search", so the group's heading is for assistive
   technology only; desktop shows it above the sticky column. */
@media (max-width: 1023px) {
  .search-page > h1 + .search-filters { margin-top: 24px; }
  .search-page > .search-filters > h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

.search-page .age-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.search-page .checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--umber);
  cursor: pointer;
}
.search-page .checkbox-field input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--saffron);
  cursor: pointer;
}

.search-page .filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.search-page .filter-actions .btn:first-child {
  flex: 1;
}

.search-page .error-msg {
  font-size: 15px;
  color: var(--clay);
  font-weight: 500;
  margin: 24px 0;
}

.search-page .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0 8px;
}
.search-page .pagination-page {
  font-size: 14px;
  color: var(--umber);
  font-weight: 500;
}

/* ── Connections list (scoped) ────────────────────────────────────────────── */

/* One row per conversation or request: the shared result-link layout
   (avatar + body), plus the time and unread count on the trailing edge. Rows are the tap target,
   so each carries the card's own surface rather than sitting in one. */
.connections-list .conversation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
  margin-bottom: var(--list-gap);
  transition: background var(--speed) ease-out, box-shadow var(--speed) ease-out;
}
.connections-list .conversation-row:hover {
  background: #FFFEF9;
  box-shadow: 0 2px 4px var(--shadow), 0 12px 32px var(--shadow);
}

.connections-list .connection-trail {
  flex: none;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.connections-list .connection-time {
  font-size: 13px;
  color: var(--umber);
  white-space: nowrap;
}
/* A declined or expired request: still there, set back, and it does not
   rise to meet the pointer. */
.connections-list .connection-ended { opacity: .6; }
.connections-list .connection-ended:hover {
  background: var(--paper);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
}

/* ── A request's detail (scoped) ─────────────────────────────────────────── */

/* Who asked, their words, what they shared, then the answer — one column,
   read top to bottom. The back button leads on a phone; on a desktop the
   list stands beside it and the button is hidden (see the desktop block). */
.connection-request .back-btn { margin: 12px 0 4px -10px; }
.connection-request .result-link { margin: 16px 0 20px; }
.connection-request .rows { margin-bottom: 24px; }
.connection-request .decision-buttons { margin-top: 24px; }

/* ── Chat page (scoped) ──────────────────────────────────────────────────── */

/* Mockup 10 fixes the composer to the viewport, but the app carries a fixed
   bottom nav there. So the thread scrolls inside its own region and the
   composer sits directly beneath it — always reachable, never overlapping
   the nav. */
.chat-page {
  display: flex;
  flex-direction: column;
  padding-bottom: 96px;
}

.chat-page .chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.chat-page .back-btn,
.connection-request .back-btn,
.announcements-page .back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--charcoal);
  text-decoration: none;
  cursor: pointer;
  flex: none;
}
.chat-page .back-btn svg,
.connection-request .back-btn svg,
.announcements-page .back-btn svg { width: 22px; height: 22px; }
.chat-page .back-btn:hover,
.connection-request .back-btn:hover,
.announcements-page .back-btn:hover { background: var(--parchment); }
.chat-page .back-btn:focus-visible,
.connection-request .back-btn:focus-visible,
.announcements-page .back-btn:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

.chat-page .chat-avatar,
.chat-page .avatar-initials {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
  flex: none;
  font-size: 15px;
}
.chat-page .chat-identity { min-width: 0; }
.chat-page .chat-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 550;
  margin: 0;
  line-height: 1.2;
}
.chat-page .enc-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--leaf);
  font-weight: 500;
}

/* the thread: its own scroll region, so the composer never drifts away */
.chat-page .chat-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 240px;
  max-height: calc(100dvh - 320px);
  padding: 16px 2px;
}

.chat-page .chat-older {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.chat-page .date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0;
}
.chat-page .date-divider span {
  font-size: 12.5px;
  color: var(--umber);
  font-weight: 700;
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 14px;
}

/* the thread's story: who asked, their note, who accepted — quiet, centred */
.chat-page .chat-origin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
  text-align: center;
}
.chat-page .chat-origin .date-divider { margin: 6px 0; }
.chat-page .chat-origin-note {
  max-width: 78%;
  margin: 0;
  color: var(--umber);
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.55;
  word-break: break-word;
}

.chat-page .msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
  gap: 3px;
}
.chat-page .msg-theirs { align-self: flex-start; align-items: flex-start; }
.chat-page .msg-mine { align-self: flex-end; align-items: flex-end; }

.chat-page .bubble {
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.55;
  word-break: break-word;
}
.chat-page .bubble-theirs {
  background: var(--paper);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--charcoal);
}
.chat-page .bubble-mine {
  background: #F7E5D6;
  border: 1px solid #E9C9AF;
  border-bottom-right-radius: 4px;
  color: var(--charcoal);
}
/* A blob this device cannot open says so, in the reader's own words. */
.chat-page .bubble-sealed {
  color: var(--umber);
  font-style: italic;
}

.chat-page .msg-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--umber);
  margin: 0 2px;
}
.chat-page .delivery {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--leaf);
  font-weight: 500;
}

.chat-page .chat-composer-wrap { display: flex; flex-direction: column; gap: 6px; }
.chat-page .chat-composer-wrap {
  position: sticky;
  bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--ivory);
  padding-top: 8px;
  z-index: 20;
}
/* After the base rule on purpose: the bottom nav is hidden here, so nothing to clear. */
@media (min-width: 900px) {
  .chat-page .chat-composer-wrap { bottom: 0; }
}
.chat-page .chat-unsent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--parchment);
  color: var(--umber);
  font-size: 13px;
}
.chat-page .chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.chat-page .composer-field {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  max-height: 120px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--charcoal);
  resize: none;
  overflow-y: auto;
  line-height: 1.5;
  transition: border-color var(--speed) ease-out;
}
.chat-page .composer-field:focus {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
  border-color: var(--saffron);
}
.chat-page .composer-field::placeholder { color: var(--umber); }
.chat-page .chat-composer .btn { border-radius: 999px; flex: none; }

.crypto-gate { margin-top: 24px; }

/* ── Settings page (scoped) — every block is a form group ───────────────── */


.settings-page .checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 15px;
  color: var(--umber);
  cursor: pointer;
}
.settings-page .checkbox-field:last-child { margin-bottom: 0; }
.settings-page .checkbox-field input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--saffron);
  cursor: pointer;
}
.settings-page .checkbox-field input[type="checkbox"][disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Account section: one concern per block, separated by a hairline rather
   than by another card — they belong together under one heading. */
.settings-page .account-block + .account-block {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.settings-page .account-block h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 6px;
}
.settings-page .account-block > p {
  margin: 0 0 16px;
}
.settings-page .account-block .field:first-of-type {
  margin-top: 16px;
}
/* A form-level failure (mismatch, wrong password, locked keys) sits outside
   any .field, so it needs the error voice spelled out here. Scoped to the
   form's own child so `.field .error-msg` keeps its own spacing. */
.settings-page form > .error-msg {
  color: var(--clay);
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 12px;
}

/* The one irreversible action on the page stands apart — its hairline and
   heading are clay; nothing else about the group changes. */
.settings-page .form-group + .danger-zone { border-top-color: var(--clay); }
.settings-page .danger-zone h2 {
  color: var(--clay);
  margin-bottom: 6px;
}
.settings-page .danger-zone > p {
  margin: 0 0 20px;
}
.settings-page .danger-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ── Admin panel (scoped) ────────────────────────────────────────────────── */
/* Mockup 12's vocabulary — stat cards, a bordered table card per section —
   without its sidebar: the app already has a topbar and a bottom nav, and a
   third navigation would be a third place to look.
   The admin area is seven pages behind a sub-nav strip (`.admin-nav`), one
   job per page; the dashboard summarises and links to the rest. */

.admin-page .admin-heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 550;
  color: var(--charcoal);
  margin: 24px 0 20px;
}

.admin-page .admin-section {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.admin-page .admin-section > p {
  padding: 16px 18px;
  margin: 0;
}

.admin-page .queue-table-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-page .queue-table-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.admin-page .admin-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-page .admin-controls select,
.admin-page .admin-search-input {
  min-height: 34px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--charcoal);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.admin-page .admin-controls select:focus,
.admin-page .admin-search-input:focus {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
}

/* ---- date range (Ui.DateRange): preset chips that fill From / To ----
   Measured like the admin filter select beside it (14px, 8px radius, 1px
   border, paper ground) so the two read as one family. The pressed chip
   speaks the nav's "you are here" colour. 44px touch floor on phones; the
   desktop frame keeps it too: nothing drops the chips to the select's 34px. */
.date-range {
  display: flex;
  align-items: center;
  gap: 8px 16px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.date-range-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.date-range-chip {
  min-height: 44px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--umber);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: color var(--speed) ease-out, background var(--speed) ease-out, border-color var(--speed) ease-out;
}
.date-range-chip:hover { color: var(--charcoal); background: var(--parchment); }
.date-range-chip[aria-pressed="true"] {
  color: var(--saffron-deep);
  background: var(--parchment);
  border-color: var(--saffron-deep);
}
.date-range-chip:focus-visible { outline: 2px solid var(--saffron); outline-offset: 1px; }
.date-range-fields {
  display: flex;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.date-range-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--umber);
}
.date-range-field input {
  min-height: 44px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--charcoal);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.date-range-field input:focus { outline: 2px solid var(--saffron); outline-offset: 1px; }

/* stat tiles */
.admin-page .stat-group { padding: 16px 18px 4px; }
.admin-page .stat-group + .stat-group { border-top: 1px solid var(--border); }
.admin-page .stat-group-title {
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--umber);
  margin: 0;
}
.admin-page .stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.admin-page .stat-card {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px 16px;
}
.admin-page .stat-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--umber);
  margin-bottom: 6px;
}
.admin-page .stat-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 550;
  color: var(--charcoal);
  line-height: 1;
}

/* tables */
.admin-page .admin-table-wrap { overflow-x: auto; }
.admin-page table,
.invitations-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}
.admin-page thead th,
.invitations-page thead th {
  background: var(--parchment);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--umber);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-page tbody tr,
.invitations-page tbody tr { border-bottom: 1px solid var(--border); }
.admin-page tbody tr:last-child,
.invitations-page tbody tr:last-child { border-bottom: none; }
.admin-page td,
.invitations-page td {
  padding: 13px 14px;
  vertical-align: top;
  color: var(--charcoal);
}
.admin-page td.muted-cell,
.invitations-page td.muted-cell { color: var(--umber); }
.admin-page .admin-name,
.invitations-page .admin-name { font-weight: 600; }
.admin-page .admin-subname,
.invitations-page .admin-subname { font-size: 12.5px; color: var(--umber); }
.admin-page .admin-body-cell { max-width: 320px; }

.admin-page .actions-cell,
.invitations-page .actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.admin-page .btn-sm,
.invitations-page .btn-sm {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 13.5px;
  border-radius: 8px;
  white-space: nowrap;
}

/* the inline reason / note panel, directly under the row it belongs to */
.admin-page .admin-panel-row { background: var(--parchment); }
/* Admin forms get a real inset between the card edge and the fields. The
   panel row's own cell padding is dropped so the inset is the panel's alone. */
.admin-page .admin-panel-row td { padding: 0; }
.admin-page .admin-panel { padding: 20px 24px; }
.admin-page .admin-panel .field { margin-bottom: 12px; }
.admin-page .admin-panel .field input,
.admin-page .admin-panel .field textarea { background: var(--paper); }
.admin-page .error-msg { color: var(--clay); font-weight: 500; }

/* Acaryas: the invite toggle sits above the list, right-aligned; its panel
   opens between the toggle and the list. */
.admin-page .admin-page-actions {
  display: flex;
  justify-content: flex-end;
  margin: -8px 0 16px;
}
.admin-page .admin-invite-panel { background: var(--parchment); }
.admin-page .admin-invite-panel .field:last-of-type { margin-bottom: 16px; }
.admin-page .admin-invite-panel .admin-panel > .muted { margin: 0 0 16px; }
.admin-page .admin-invite-panel .admin-panel > .btn-quiet { margin-top: 8px; }
/* Acaryas: an acarya's contact details in the same panel, read-only — the
   name, then each label above its value (label | value from 1024px). */
.admin-page .admin-details-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--charcoal);
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.admin-page .admin-details { margin: 0; }
.admin-page .admin-details-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.admin-page .admin-details-row:last-child { border-bottom: 0; }
.admin-page .admin-details dt { font-size: 12.5px; font-weight: 600; color: var(--umber); margin: 0 0 2px; }
.admin-page .admin-details dd { margin: 0; color: var(--charcoal); overflow-wrap: anywhere; }
.admin-page .admin-details-messengers { list-style: none; margin: 0; padding: 0; }
.admin-page .admin-details-messengers li + li { margin-top: 2px; }
.admin-page .admin-details-handle { color: var(--umber); }

.admin-page .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.admin-page .pagination-page { font-size: 14px; color: var(--umber); }

/* the page keeps clear of the toast stack at the bottom */
.admin-page { padding-bottom: 120px; }

/* ---- sub-nav ---- */
.admin-nav {
  display: flex;
  gap: 4px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--umber);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--speed) ease-out, border-color var(--speed) ease-out;
}
.admin-nav a:hover { color: var(--charcoal); }
.admin-nav a[aria-current="page"] {
  color: var(--saffron-deep);
  border-bottom-color: var(--saffron-deep);
}
.admin-nav a:focus-visible {
  outline: 2px solid var(--saffron-deep);
  outline-offset: -2px;
}
.admin-nav-badge {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--clay);
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

/* ---- dashboard ---- */
.admin-page .attention-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 18px 18px;
}
.admin-page .attention-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--parchment);
  color: var(--charcoal);
  text-decoration: none;
  transition: border-color var(--speed) ease-out;
}
.admin-page .attention-card:hover,
.admin-page .attention-card:focus-visible { border-color: var(--saffron-deep); }
.admin-page .attention-card:focus-visible {
  outline: 2px solid var(--saffron-deep);
  outline-offset: 2px;
}
.admin-page .attention-card-quiet { background: var(--paper); }
.admin-page .attention-card-quiet .stat-num { color: var(--umber); }
.admin-page .attention-none { font-size: 12.5px; color: var(--umber); }
@media (max-width: 640px) {
  .admin-page .attention-row { grid-template-columns: 1fr; }
}

.admin-page .stat-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
}
.admin-page .admin-link {
  margin-left: auto;
  color: var(--saffron-deep);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  /* 44px tap target without growing the header row */
  padding: 11px 6px;
  margin-block: -11px;
  margin-inline-end: -6px;
}
.admin-page .admin-link:hover { text-decoration: underline; }

/* ---- inbox intro, acarya invite card, ticket reply ---- */
.admin-page .admin-intro {
  max-width: 640px;
  margin: -8px 0 20px;
  color: var(--umber);
}
.admin-page .ticket-reply {
  padding: 20px 24px;
  border-radius: var(--r-card);
  background: var(--parchment);
}
.admin-page .ticket-reply .field textarea { background: var(--paper); }

/* narrow screens: each row becomes its own labelled card */
@media (max-width: 767px) {
  .search-page .search-hint { display: none; }
  /* On phones the sticky save row already carries Save; the header keeps
     only Cancel so one primary action is on screen (stakeholder, 2026-10-21). */
  .admin-page table,
  .admin-page thead,
  .admin-page tbody,
  .admin-page th,
  .admin-page td,
  .admin-page tr,
  .invitations-page table,
  .invitations-page thead,
  .invitations-page tbody,
  .invitations-page th,
  .invitations-page td,
  .invitations-page tr { display: block; }
  .admin-page thead,
  .invitations-page thead { display: none; }
  .admin-page tbody tr,
  .invitations-page tbody tr {
    padding: 12px 14px;
  }
  .admin-page td,
  .invitations-page td { padding: 5px 0; border: none; }
  .admin-page td::before,
  .invitations-page td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--umber);
    display: block;
  }
  .admin-page .admin-panel-row td::before { content: none; }
  .admin-page .admin-body-cell { max-width: none; }
  /* an invitee with nothing left to do shows no empty "Actions" label */
  .invitations-page td:has(> .actions-cell:empty) { display: none; }
}

/* ---- Invitations (acarya): every invitee, one panel above the list ---- */
/* The table borrows the admin table's rules above; these give the page its
   head, the create / correct panel and the list's card. */
.invitations-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 20px;
}
.invitations-head h2 { margin: 0; }

.profile-page section.discard-prompt { margin: 0 0 20px; }
.discard-actions { display: flex; gap: 8px; margin-top: 12px; }
.invite-panel {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.invite-panel h3 { margin: 0 0 4px; }
.invite-panel > .muted { margin: 0 0 16px; }
.invite-panel .field input,
.invite-panel .field select { background: var(--paper); }
.invite-panel > .btn-quiet { margin-top: 8px; }
.invitee-list {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}
.invitee-list > p { padding: 16px 18px; margin: 0; }
.invite-panel .error-msg,
.invitee-list .error-msg { color: var(--clay); font-weight: 500; }
.invitee-table-wrap { overflow-x: auto; }
/* The list failed to load: the line, and the one way to ask again. */
.invitee-retry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.invitee-retry .error-msg { margin: 0; }

/* ---- reset page: the lost-history warning ------------------------------ */
/* Shown only when this device holds no key, so it must read as a decision
   the member makes, not a notice they scroll past. */
.reset-page .reset-warning {
  background: var(--clay-tint);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 4px 0 20px;
}
.reset-page .reset-warning p { margin: 0 0 10px; font-size: 14.5px; }
.reset-page .reset-warning p:last-of-type { margin-bottom: 0; }
.reset-page .reset-warning .btn { margin-top: 14px; }

/* ---- invite link: the endings ---------------------------------------- */
/* One sentence that says what happened, one hint, one way out. */
.invite-end { text-align: center; }
.invite-end .invite-end-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 550;
  line-height: 1.3;
  margin: 0 0 12px;
}
.invite-end .muted { margin: 0 0 24px; }

/* ---- invite link: the form-level error ------------------------------- */
/* What belongs to no field (the network's attempt limit, a refusal that
   names no field) sits outside any .field; it speaks in the same voice as
   the field errors. */
.invite-form > .error-msg {
  color: var(--clay);
  font-weight: 500;
  font-size: 14px;
  margin: 0 0 12px;
}

/* ---- invite link: the terms row (as mockup 02-signup's .check-row) ---- */
/* The checkbox sits beside the sentence; the generic `.field input` sizing
   would otherwise stretch it into a full-width box on a line of its own. */
.field .check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--umber);
  cursor: pointer;
}
.field .check-label input[type="checkbox"] {
  flex: none;
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  margin-top: 2px;
  accent-color: var(--saffron);
  cursor: pointer;
}

/* ---------- topbar bell + badge (unread announcements) ---------- */

.topbar-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--umber);
}
.topbar-bell:hover { background: var(--parchment); }
.topbar-bell:focus-visible { outline: 2px solid var(--saffron); outline-offset: 2px; }

.topbar .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--saffron);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.topbar-bell .badge {
  position: absolute;
  top: 2px;
  right: 2px;
}

/* ---- paused banner (Discover / Search / Shortlist) --------------------- */
/* Shown in place of page content while the viewer's own profile is paused
   and the RPC that would have run it is refused (Ui/PausedBanner.elm). One
   primary action, so it centers like a decision the member makes, echoing
   .reset-page .reset-warning above. */
.paused-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 36px 24px;
}
.paused-banner-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 550;
  color: var(--charcoal);
  margin: 0;
}
.paused-banner .muted { margin: 0 0 12px; }
.paused-banner .btn { margin-top: 8px; }

/* ---- install banner (add to home screen) ------------------------------- */
/* Offered once, under the top bar and above the page, to a signed-in member
   whose browser can install the app (or, on iOS Safari, told the two taps).
   The shell's width on a phone; the content width in the desktop frame
   (Install.elm). The page keeps its own top padding, so the distance to the
   content below is the page edge, not a card gap. */
.install-banner {
  max-width: 480px;
  margin: 24px auto 0;
  padding: 0 20px;
}
.install-banner-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  padding: 16px 18px;
}
.install-banner-mark { width: 40px; height: 40px; flex: none; }
.install-banner-text { flex: 1 1 200px; min-width: 0; }
.install-banner-title { margin: 0; font-weight: 700; color: var(--charcoal); }
.install-banner-text .muted { margin: 4px 0 0; }
.install-banner-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  margin-left: auto;
}
.install-banner-actions .btn { min-height: 40px; padding: 8px 16px; font-size: 15px; }

/* ---- first-login welcome ---------------------------------------------- */
/* Read once, then never again: plain sentences and one button. */
.welcome-page { padding-top: 32px; }
.welcome-card h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 550;
  margin: 0 0 16px;
}
.welcome-card p { margin: 0 0 14px; color: var(--charcoal); }
.welcome-card .btn-block { margin-top: 10px; }
/* The acarya's card: the intro sentence leads into the form below it. */
.welcome-card .welcome-intro { margin: 8px 0 24px; font-weight: 500; }

/* ---- registration contribution ---------------------------------------- */
/* The ask on the page like the signed-out forms: a heading, plain
   sentences, the two fields and one full-width button; the thank-you is
   a card. The note (payment not completed) sits between the heading and
   the sentences. */
.contribute-page { padding-top: 32px; }
.contribute-page h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 550;
  margin: 0 0 16px;
}
.contribute-page > p { margin: 0 0 14px; }
.contribute-page .contribute-note { color: var(--saffron-deep); font-weight: 500; }
.contribute-page form { margin-top: 24px; }
.contribute-page form > .btn-block + .btn-block { margin-top: 10px; }
.contribute-page form > .muted { margin: 0 0 20px; }
.contribute-page form > .contribute-later { margin: 14px 0 0; text-align: center; }
.contribute-page form > .error-msg { margin: 0 0 16px; }
.contribute-thanks { text-align: center; }
.contribute-thanks h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 550;
  margin: 0 0 12px;
}
.contribute-thanks p { margin: 0 0 20px; }
.contribute-thanks .spinner { padding: 24px 0; }

/* ---- acarya profile form (welcome card, Settings) -------------------- */
/* Messengers: one row per app — checkbox and name, then its handle. On a
   phone the handle sits under its checkbox, indented to the name; from
   480px it takes the rest of the row. */
.messenger-group { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.messenger-group legend {
  display: block;
  padding: 0;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.messenger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 2px 0;
}
.messenger-row.messenger-other { align-items: flex-start; }
.messenger-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: 8.5em;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.messenger-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--saffron); flex: none; }
.messenger-row > .messenger-handle,
.messenger-other-inputs { flex: 1 1 100%; margin-left: 26px; min-width: 0; }
.messenger-other-inputs { display: flex; flex-direction: column; gap: 8px; }
.messenger-handle {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--charcoal);
  transition: border-color var(--speed) ease-out;
}
.messenger-handle:focus {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
  border-color: var(--saffron);
}
@media (min-width: 480px) {
  .messenger-row > .messenger-handle,
  .messenger-other-inputs { flex: 1 1 12em; margin-left: 0; }
}
/* Errors outside a .field — the messenger group's and the form's own —
   speak in the same voice as a field's. */
.messenger-group .error-msg,
.acarya-profile-form > .error-msg {
  font-size: 14px;
  color: var(--clay);
  font-weight: 500;
  margin: 6px 0 0;
}
.acarya-profile-form > .error-msg { margin: 0 0 12px; }
/* A failed load: the sentence, and beneath it the way to ask again. */
.acarya-profile-failed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.acarya-profile-failed > .error-msg {
  font-size: 14px;
  color: var(--clay);
  font-weight: 500;
  margin: 0;
}

/* ── Help page (scoped) ──────────────────────────────────────────────────── */

.help-page .faq { margin: 32px 0 var(--card-gap); }
.help-page .faq h2 { margin-bottom: 4px; }

/* details/summary FAQ, same treatment as .landing's (scoped separately —
   see the note by that block — so neither can bleed into the other). */
.help-page .faq details {
  border-bottom: 1px solid var(--border);
  padding: 18px 4px;
}
.help-page .faq details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 17px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.help-page .faq details summary::after {
  content: '+';
  color: var(--gold-deep);
  font-size: 20px;
}
.help-page .faq details[open] summary::after { content: '–'; }
.help-page .faq details p { margin: 12px 0 0; color: var(--umber); font-size: 16px; }

/* The selectable question rows and the pane are the desktop arrangement
   (Pages/Help.elm); on a phone the accordion, the inline form and the
   inline thread are the page. "Write a message" closes the list at both
   widths: it opens the pane on desktop and unfolds the form on a phone. */
.help-page .help-faq-row,
.help-page .help-detail { display: none; }
.help-page .help-ask { margin-top: var(--card-gap); }
/* the unfolded form is a plain group, no hairline of its own */
.help-page .help-inline > .form-group { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 1023px) {
  .help-page .help-ask .help-write { width: 100%; }
}

/* one ticket per card; the header is the whole tap target, the thread and
   reply box only exist in the DOM while expanded (Pages/Help.elm). Shared
   verbatim with the admin support queue (Pages/Admin/Support.elm) — same
   thread shape, same accordion, so the same classes rather than a
   duplicate admin-page set. The open thread on Notices
   (Ui/SupportThread.elm) uses the message and reply rules too. */
.help-page .ticket-thread + .ticket-thread,
.admin-page .ticket-thread + .ticket-thread { margin-top: var(--list-gap); }

.help-page .ticket-thread-toggle,
.help-page .help-ticket-row,
.admin-page .ticket-thread-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
/* the desktop's select-only ticket row: the toggle's look, shown only in
   the desktop block below */
.help-page .help-ticket-row { display: none; }
.help-page .ticket-thread-title,
.admin-page .ticket-thread-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
}
.help-page .ticket-thread-subject { flex: 1; }
/* Inbox: the title wraps, so on a narrow screen the mark and the pill drop
   together under a long subject instead of squeezing it; with room, one line. */
.admin-page .ticket-thread-title { flex-wrap: wrap; }
.admin-page .ticket-thread-subject { flex: 1 1 auto; min-width: 0; }
.admin-page .ticket-thread-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
/* Inbox: a thread the admin started with a member, marked quietly beside
   its subject. */
.admin-page .ticket-thread-mark {
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--umber);
  white-space: nowrap;
}
.help-page .ticket-thread-preview,
.admin-page .ticket-thread-preview { display: block; }

.help-page .ticket-thread-body,
.announcements-page .ticket-thread-body,
.admin-page .ticket-thread-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* the admin inbox reads whole threads in a row; each turn gets more air */
.admin-page .ticket-thread-body { gap: 16px; }
/* align-self, not the column's default stretch: a box is as wide as its
   text, up to 85%. The -mine rule below overrides the side with flex-end. */
.help-page .ticket-message,
.announcements-page .ticket-message,
.admin-page .ticket-message {
  align-self: flex-start;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--parchment);
}
.help-page .ticket-message-mine,
.announcements-page .ticket-message-mine,
.admin-page .ticket-message-mine {
  align-self: flex-end;
  background: var(--leaf-tint);
}
.help-page .ticket-message-author,
.announcements-page .ticket-message-author,
.admin-page .ticket-message-author {
  margin: 0 0 2px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--umber);
}
.help-page .ticket-message-body,
.announcements-page .ticket-message-body,
.admin-page .ticket-message-body { margin: 0; }
.help-page .ticket-message-time,
.announcements-page .ticket-message-time,
.admin-page .ticket-message-time { margin: 4px 0 0; }

.help-page .ticket-reply,
.announcements-page .ticket-reply,
.admin-page .ticket-reply { display: flex; flex-direction: column; gap: 10px; }
.help-page .ticket-reply .btn,
.announcements-page .ticket-reply .btn,
.admin-page .ticket-reply .btn { align-self: flex-end; }
/* the admin thread's reply row carries two buttons (Close, Send reply) in
   one `.actions-cell` rather than the single `.btn` the rule above expects
   — align the row itself to the same right edge instead */
.admin-page .ticket-reply .actions-cell { align-self: flex-end; }

/* ── Announcements page (scoped) ─────────────────────────────────────────── */

.announcements-page .announcement {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
  margin-bottom: var(--list-gap);
  overflow: hidden;
}

/* Unread carries three reinforcing signals, not colour alone: a saffron
   accent edge, a leading dot, and bold title weight. */
.announcements-page .announcement.unread { box-shadow: inset 3px 0 0 var(--saffron), 0 1px 2px var(--shadow), 0 8px 24px var(--shadow); }

.announcements-page .announcement-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.announcements-page .announcement-title {
  font-size: 16px;
  color: var(--umber);
}
.announcements-page .announcement.unread .announcement-title {
  font-weight: 700;
  color: var(--charcoal);
}
.announcements-page .announcement.unread .announcement-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--saffron);
  vertical-align: middle;
}
.announcements-page .announcement-time { flex: none; }
.announcements-page .announcement-body { margin: 0; padding: 0 18px 18px; color: var(--umber); }

.announcements-page .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
}
.announcements-page .pagination-page { font-size: 14px; color: var(--umber); }

/* ── Notices: the admin's threads with this member, among the announcements ── */

/* A thread row is an announcement row with a second line: the "For you"
   mark, then who wrote last and the start of what they wrote. */
.announcements-page .notice-thread .announcement-toggle { flex-wrap: wrap; row-gap: 6px; }
.announcements-page .notice-thread .announcement-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.announcements-page .notice-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
  min-width: 0;
}
.announcements-page .notice-for-you {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--leaf-tint);
  color: var(--leaf);
  font-size: 12.5px;
  font-weight: 700;
}
.announcements-page .notice-last {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.announcements-page .notice-closed { margin: 0; font-weight: 700; }

/* On a phone the open thread takes the list's place, with a back button;
   the desktop block below puts the list back beside it. */
.announcements-page.notices-has-thread .announcement-list { display: none; }
.announcements-page.notices-has-thread .announcement-detail { display: block; }
.announcements-page .notice-detail {
  padding: 12px 18px 20px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
}
.announcements-page .notice-detail .announcement-detail-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  overflow-wrap: anywhere;
}
.announcements-page .back-btn { margin-left: -10px; }

/* ── Admin Announcements: the member list as rows of the admin section ─── */

/* The admin Announcements page relies on the member .announcement-split and
   .announcement-detail rules above; only the row chrome differs here. */

/* The admin section is already the card, so the rows are flat rows with a
   rule between them, as in the admin tables, not cards inside a card. The
   unread signals are deliberately not repeated: this is the archive of what
   went out, not the admin's inbox. */
.admin-page .announcement-list .announcement { border-bottom: 1px solid var(--border); }
.admin-page .announcement-list .announcement:last-of-type { border-bottom: 0; }
.admin-page .announcement-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 150ms ease-out;
}
.admin-page .announcement-toggle:hover { background: var(--parchment); }
.admin-page .announcement-title {
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--charcoal);
  overflow-wrap: anywhere;
}
.admin-page .announcement-time { flex: none; }
/* The first line takes its own row under the title and stops at one line. */
.admin-page .announcement-excerpt {
  flex-basis: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* On a phone the open row shows the whole body under it, so the first line
   would only say the same thing twice. */
.admin-page .announcement-toggle[aria-expanded="true"] .announcement-excerpt { display: none; }
.admin-page .announcement-body { margin: 0; padding: 0 18px 18px; color: var(--umber); overflow-wrap: anywhere; }

/* ═══════════════════════════════════════════════════════════════════════
   Desktop frame (1024px and wider), signed-in app only.
   One breakpoint, one scope (.app-frame). Below it nothing here applies
   and every page is the phone/tablet layout. Each page's desktop rules
   live in this block, in the order the sidebar lists the pages.
   ═══════════════════════════════════════════════════════════════════════ */

/* Connections holds the list and the open row's pane in one page. On a
   phone only one of them shows. */
.connections-page .connections-blank { display: none; }
@media (max-width: 1023px) {
  .connections-page.connections-has-pane .connections-list { display: none; }
}

/* The member profile groups its side material (who, photos, actions) for
   the desktop column. On a phone the groups dissolve and `order` restores
   the reading order: who, photos, the answers, then the actions. */
@media (max-width: 1023px) {
  .profile-view { display: flex; flex-direction: column; }
  .profile-view .profile-side { display: contents; }
  .profile-view .profile-side-top { order: 1; }
  .profile-view .profile-main { order: 2; }
  .profile-view .profile-side-actions { order: 3; }
}

/* The profile editor's side column (section list, save) is a
   desktop arrangement; on a phone the same things sit in the page's flow. */
.profile-edit-side { display: none; }
/* Page start: the member pages carry no visible title (the h1 is for
   assistive technology only), so on a phone the first block sits 24px under
   the topbar. Settings' first card and the crypto gate already do; desktop
   gets its 32px from the app-frame padding. */
@media (max-width: 1023px) {
  /* a connections row is narrow beside its time and unread trail: the
     identity line stays, the languages line waits for the wider screen */
  .connections-list .result-languages { display: none; }
  .help-page .faq,
  .connections-list > h1 + *,
  .announcements-page > h1 + *,
  .profile-view .profile-side-top > :first-child,
  .profile-page > section.discard-prompt,
  .profile-page > .profile-form > section:first-of-type,
  .profile-page > h1 + p,
  .settings-page > h1 + .form-group,
  .discover-page > h1 + * { margin-top: 24px; }
}
/* The announcement pane is the desktop place for the open announcement;
   on a phone it opens under its title instead. */
.announcement-detail { display: none; }
/* Room under the list pages for the bottom navigation and its thumb zone. */
.discover-page,
.search-page,
.shortlist-page,
.contribute-page,
.connections-list { padding-bottom: 120px; }
.sidenav { display: none; }

@media (min-width: 1024px) {
  .app-frame {
    --side-w: 240px;
    --content-max: 1120px;
    --gutter: 40px;
    --card-pad: 32px;
    min-height: 100vh;
    padding-left: var(--side-w);
  }

  /* the phone/tablet navigation steps aside */
  .app-frame > .topbar,
  .app-frame > .bottomnav,
  .app-frame .admin-nav { display: none; }

  /* the toasts sit at the top of the viewport: there is no top bar to clear */
  .toast-region:has(+ .app-frame) { top: 16px; }

  /* no top bar above the page any more */
  .app-frame .shell,
  .app-frame .shell-wide { padding-top: 32px; }

  .sidenav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--side-w);
    padding: 20px 12px 16px;
    overflow-y: auto;
    background: var(--paper);
    border-right: 1px solid var(--border);
  }
  .sidenav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin: 0 0 20px;
    padding: 6px 12px;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.15;
    color: var(--charcoal);
    text-decoration: none;
  }
  .sidenav-brand .brand-mark { width: 32px; height: 32px; }
  .sidenav ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .sidenav .sidenav-foot {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
  .sidenav li a,
  .sidenav li button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--umber);
    font-family: var(--font-body);
    font-size: 15.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--speed) ease-out, color var(--speed) ease-out;
  }
  .sidenav li a > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidenav li a:hover,
  .sidenav li button:hover,
  .sidenav-brand:hover { background: var(--parchment); color: var(--charcoal); }
  .sidenav li a[aria-current="page"] {
    background: var(--parchment);
    color: var(--saffron-deep);
    font-weight: 700;
  }
  .sidenav li a:focus-visible,
  .sidenav li button:focus-visible,
  .sidenav-brand:focus-visible {
    outline: 2px solid var(--saffron-deep);
    outline-offset: -2px;
  }
  .sidenav-badge {
    flex: none;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--clay);
    color: var(--paper);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
  }

  /* ---- buttons: as wide as their words ---- */
  .app-frame .btn-block { width: auto; }
  .app-frame .decision-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
  }
  .app-frame .decision-buttons .btn,
  .app-frame .decision-buttons .btn-ghost,
  .app-frame .decision-buttons .btn-quiet {
    padding: 12px 16px;
    min-height: 48px;
    white-space: nowrap;
  }
  .app-frame .search-page .filter-actions .btn:first-child { flex: none; }

  /* ---- Discover: photo left, words and the decision right ---- */
  .app-frame .discover-page.discover-has-card {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    grid-template-rows: auto 1fr auto;
    column-gap: var(--gutter);
    max-width: var(--content-max);
    min-height: 100vh;
    padding: 32px var(--gutter);
  }
  .app-frame .discover-has-card .discover-head { grid-column: 2; grid-row: 1; margin: 0; text-align: left; }
  /* the sidebar carries Shortlist on desktop */
  .app-frame .discover-head .shortlist-link { display: none; }
  .app-frame .discover-has-card .profile-card { display: contents; }
  .app-frame .discover-has-card .photo {
    grid-column: 1;
    grid-row: 1 / -1;
    align-self: start;
    aspect-ratio: auto;
    height: calc(100vh - 64px);
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: var(--r-card);
  }
  .app-frame .discover-has-card .photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .app-frame .discover-has-card .profile-body {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    margin-top: 16px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .app-frame .discover-has-card .decision-section { grid-column: 2; grid-row: 3; }
  .app-frame .discover-has-card .decision-helper { text-align: right; }
  .app-frame .discover-page .shortlist-footer { display: none; }

  /* ---- member card: portrait, centred (Search, Shortlist) ---- */
  .app-frame .result-card {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 0;
    padding: 28px 20px 22px;
  }
  .app-frame .result-card .result-link {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 0;
    text-align: center;
    text-decoration: none;
    color: inherit;
  }
  .app-frame .result-card .result-link:focus-visible {
    outline: 2px solid var(--saffron);
    outline-offset: 3px;
    border-radius: var(--r-ctl);
  }
  .app-frame .result-card .result-avatar { width: 96px; height: 96px; font-size: 34px; }
  .app-frame .result-card .result-body { width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .app-frame .result-card .result-languages {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .app-frame .result-card .result-badge { position: absolute; top: 14px; right: 14px; }
  .app-frame .search-page .result-card { padding-top: 48px; }
  .app-frame .result-card .result-actions {
    justify-content: center;
    flex-wrap: wrap;
    margin: 16px 0 0;
  }
  .app-frame .result-card .result-actions .btn { min-height: 44px; padding: 8px 14px; font-size: 14.5px; }

  /* ---- Search: filters stay beside the results ---- */
  .app-frame .search-page {
    --filter-w: 280px;
    display: grid;
    grid-template-columns: var(--filter-w) minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
    max-width: var(--content-max);
    padding: 32px var(--gutter) 64px;
  }
  .app-frame .search-page > .search-filters {
    grid-column: 1;
    grid-row: 1 / span 6;
    position: sticky;
    top: 32px;
    margin-top: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .app-frame .search-page > :not(.search-filters):not(h1) { grid-column: 2; }
  /* the frame's padding is the page start; the phone card margin would double it */
  .app-frame .search-page > .card { margin-top: 0; }
  .app-frame .search-page section,
  .app-frame .shortlist-page section {
    display: grid;
    gap: 28px;
  }
  .app-frame .search-page section { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .app-frame .shortlist-page section { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .app-frame .search-page .results-header,
  .app-frame .shortlist-page .results-header { grid-column: 1 / -1; margin-bottom: -8px; }

  /* ---- Shortlist: two groups, each a full-width grid ---- */
  .app-frame .shortlist-page { max-width: var(--content-max); padding: 32px var(--gutter) 64px; }
  .app-frame .shortlist-page section + section { margin-top: var(--card-gap); }

  /* ---- Connections: list and pane side by side ---- */
  .app-frame .connections-page {
    --list-w: 320px;
    display: grid;
    grid-template-columns: var(--list-w) minmax(0, 1fr);
    height: 100vh;
  }
  .app-frame .connections-page .connections-list {
    max-width: none;
    margin: 0;
    padding: 24px 12px;
    overflow-y: auto;
    background: var(--paper);
    border-right: 1px solid var(--border);
  }
  .app-frame .connections-page .conversation-row {
    padding: 10px 12px;
    margin: 0 0 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
  }
  .app-frame .connections-page .conversation-row:hover,
  .app-frame .connections-page .conversation-row[aria-current="page"] {
    background: var(--parchment);
    box-shadow: none;
  }
  .app-frame .connections-page .conversation-row:focus-visible {
    outline: 2px solid var(--saffron);
    outline-offset: 2px;
    border-radius: 10px;
  }
  .app-frame .connections-page .conversation-row .result-body { min-width: 0; overflow-wrap: anywhere; }
  .app-frame .connections-page .chat-page {
    max-width: none;
    height: 100vh;
    min-height: 0;
    margin: 0;
    padding: 0 32px 24px;
  }
  /* A grid item with auto margins shrink-wraps its content, so the pane
     would be as wide as its longest line. Fill the cell up to .shell's
     max-width and let the auto margins centre it. */
  .app-frame .connections-page .connection-request { width: 100%; height: 100vh; overflow-y: auto; }
  .app-frame .connections-page .chat-header { padding-top: 16px; }
  .app-frame .connections-page .back-btn { display: none; }
  .app-frame .connections-page .chat-log { flex: 1; min-height: 0; max-height: none; }
  .app-frame .connections-page .connections-blank {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
  }
  .app-frame .chat-page .msg { max-width: 60%; }

  /* ---- Member profile: who they are stays in view ---- */
  .app-frame .profile-view {
    --side-col: 300px;
    display: grid;
    grid-template-columns: var(--side-col) minmax(0, 1fr);
    column-gap: var(--gutter);
    align-items: start;
    max-width: var(--content-max);
    padding: 32px var(--gutter) 64px;
  }
  .app-frame .profile-view > :not(.profile-side):not(.profile-main) { grid-column: 1 / -1; }
  .app-frame .profile-view .profile-side {
    position: sticky;
    top: 32px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    min-width: 0;
    overflow-wrap: anywhere;
    /* room inside the scroll box for focus outlines and card shadows */
    padding: 4px;
    margin: -4px;
  }
  .app-frame .profile-view .compose-cta,
  .app-frame .profile-view .profile-side-actions > .card { margin-top: var(--card-gap); }
  .app-frame .profile-view .profile-side .lang-grid { grid-template-columns: 1fr; }
  .app-frame .profile-view .profile-main > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: var(--card-gap);
  }
  .app-frame .profile-view .profile-main section { grid-column: 1 / -1; margin-top: 0; }
  .app-frame .profile-view .profile-main section.profile-section-facts { grid-column: auto; }

  /* ---- Profile editor: sections and save always in reach ---- */
  .app-frame .profile-page {
    --side-col: 260px;
    display: grid;
    grid-template-columns: var(--side-col) minmax(0, 1fr);
    column-gap: var(--gutter);
    align-items: start;
    max-width: var(--content-max);
    padding: 32px var(--gutter) 64px;
  }
  .app-frame .profile-page > *,
  .app-frame .profile-page > .profile-form > * { grid-column: 2; }
  /* the page's h1 is visually hidden (absolute), so it takes no row; with
     no page head the first form card starts at the frame padding */
  .app-frame .profile-page > .discard-prompt { grid-column: 1 / -1; grid-row: 1; }
  .app-frame .profile-page > p { grid-column: 1 / -1; }
  .app-frame .profile-page > .profile-form > section:first-of-type { margin-top: 0; }
  .app-frame .profile-page > .profile-form > .profile-edit-side {
    grid-column: 1;
    grid-row: 1 / span 12;
    position: sticky;
    /* 8px less than the frame padding: the box starts 8px above its cards
       (see the margin below), so the sticky offset keeps them at 32px */
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 8px 8px 32px;
    /* the negative margins give the sticky scroll box room for focus rings
       and shadows without moving the cards: the list lines up with the
       first form card at the frame padding */
    margin: -8px -8px -32px;
  }
  /* the discard prompt takes row 2, so the side starts below it */
  .app-frame .profile-page > .discard-prompt ~ .profile-form > .profile-edit-side { grid-row: 2 / span 12; }
  .app-frame .profile-page > .profile-form > .profile-save-row { display: none; }
  .app-frame .profile-edit-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
  }
  .app-frame .profile-edit-sections button {
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--umber);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
  }
  .app-frame .profile-edit-sections button:hover { background: var(--parchment); color: var(--charcoal); }
  .app-frame .profile-edit-sections button:focus-visible { outline: 2px solid var(--saffron-deep); outline-offset: -2px; }
  .app-frame .profile-edit-side > .btn { align-self: flex-start; }
  .app-frame .profile-page .photo-upload-btn { justify-self: start; width: auto; padding-left: 20px; padding-right: 20px; }

  /* short fields two per row inside a section group */
  .app-frame .profile-page .form-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
  }
  .app-frame .profile-page .form-group > * { grid-column: 1 / -1; }
  .app-frame .profile-page .form-group > .profile-field-short { grid-column: auto; }

  /* ---- Settings: notifications beside the rest ---- */
  /* Two independent columns of groups: Language, Account and the danger zone
     flow down the left; Notifications takes the right. Groups part
     themselves with hairlines inside a column; the one that opens the
     right column has none. The page's h1 is visually hidden and takes no
     row. */
  .app-frame .settings-page {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter);
    align-items: start;
    max-width: var(--content-max);
    padding: 32px var(--gutter) 64px;
  }
  .app-frame .settings-page > .form-group { grid-column: 1; }
  .app-frame .settings-page > .settings-notifications {
    grid-column: 2;
    grid-row: 1 / span 8;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  /* ---- install banner: the content width, 32px from the top ---- */
  .app-frame .install-banner {
    max-width: var(--content-max);
    margin: 32px auto 0;
    padding: 0 var(--gutter);
  }

  /* ---- Help: questions and messages left, the selection right ---- */
  /* The Announcements split: rows select, the pane shows. The phone's
     accordion, inline form and inline thread stay in the DOM, hidden. */
  .app-frame .help-page { max-width: var(--content-max); padding: 32px var(--gutter) 64px; }
  .app-frame .help-page .help-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: var(--gutter);
    align-items: start;
  }
  .app-frame .help-page .faq { margin-top: 0; }
  .app-frame .help-page .faq details,
  .app-frame .help-page .help-inline,
  .app-frame .help-list .ticket-thread > :not(.help-ticket-row) { display: none; }
  .app-frame .help-page .help-faq-row {
    display: flex;
    width: 100%;
    padding: 18px 4px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    color: inherit;
    overflow-wrap: anywhere;
  }
  .app-frame .help-page .help-faq-row:hover,
  .app-frame .help-page .help-faq-row[aria-current="true"],
  .app-frame .help-page .help-ticket-row:hover { background: var(--parchment); }
  .app-frame .help-page .help-faq-row:focus-visible,
  .app-frame .help-page .help-ticket-row:focus-visible { outline: 2px solid var(--saffron); outline-offset: -2px; }
  /* the select-only row fills its card, so the open one marks the whole card */
  .app-frame .help-list .ticket-thread { padding: 0; }
  .app-frame .help-page .help-ticket-row { display: flex; padding: var(--card-pad); border-radius: inherit; }
  .app-frame .help-page .help-ticket-row[aria-current="true"] { background: var(--parchment); }
  /* the compose form sits under its title as an answer sits under its question */
  .app-frame .help-page .help-compose { margin-top: 20px; }
  .app-frame .help-page .help-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* ---- first-login welcome: a short letter, not a full-width page ---- */
  /* .shell already centres it; widen the measure and give it more air. */
  .app-frame .welcome-page { max-width: 560px; padding-top: 48px; }
  .app-frame .contribute-page { max-width: 560px; padding-top: 48px; }

  /* ---- Invitations (acarya page) ---- */
  .app-frame .invitations-page { max-width: var(--content-max); padding: 32px var(--gutter); }
  /* the panel's form: email | legal name, sanskrit name | gender | date of
     birth, the button right-aligned beneath */
  .app-frame .invite-panel form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }
  .app-frame .invite-panel form > * { grid-column: 1 / -1; }
  .app-frame .invite-panel form > .field { grid-column: span 3; }
  .app-frame .invite-panel .invite-fields { display: contents; }
  .app-frame .invite-panel .invite-fields > * { grid-column: span 2; }
  .app-frame .invite-panel form > .btn { justify-self: end; }
  .app-frame .invite-panel > .btn-quiet { display: block; margin-left: auto; }

  /* ---- Announcements: list left, the open one right ---- */
  .app-frame .announcements-page { max-width: var(--content-max); padding: 32px var(--gutter) 64px; }
  .app-frame .announcement-split {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: var(--gutter);
    align-items: start;
  }
  .app-frame .announcement-list .announcement-body { display: none; }
  .app-frame .announcement-list .announcement-toggle[aria-expanded="true"] { background: var(--parchment); }
  .app-frame .announcement-list .announcement-title { min-width: 0; overflow-wrap: anywhere; }
  .app-frame .announcement-detail,
  .app-frame .help-page .help-detail {
    display: block;
    position: sticky;
    top: 32px;
    padding: 28px 32px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: 0 1px 2px var(--shadow), 0 8px 24px var(--shadow);
    /* always in view beside the list; a thread taller than the window
       scrolls inside the pane to reach its reply box */
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .app-frame .announcement-detail-title,
  .app-frame .notice-detail .announcement-detail-title {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    color: var(--charcoal);
    overflow-wrap: anywhere;
  }
  .app-frame .announcement-detail-body { margin: 20px 0 0; overflow-wrap: anywhere; color: var(--umber); }
  /* Notices: the list stays beside an open thread, which needs no back
     button. */
  .app-frame .announcements-page.notices-has-thread .announcement-list { display: block; }
  .app-frame .announcements-page .back-btn { display: none; }

  /* ---- Acaryas invite panel: the two fields side by side, Send at the end ---- */
  .app-frame .admin-invite-panel form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    align-items: start;
  }
  .app-frame .admin-invite-panel form > * { grid-column: 1 / -1; }
  .app-frame .admin-invite-panel form > .field { grid-column: auto; }
  .app-frame .admin-invite-panel form > .btn { justify-self: end; }
  .app-frame .admin-invite-panel .admin-panel > .btn-quiet { display: block; margin-left: auto; }
  /* a margii's correction (Margiis page): the acarya page's grid — email |
     legal name, sanskrit name | gender | date of birth */
  .app-frame .admin-invite-panel form:has(.invite-fields) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .app-frame .admin-invite-panel form:has(.invite-fields) > .field { grid-column: span 3; }
  .app-frame .admin-invite-panel .invite-fields { display: contents; }
  .app-frame .admin-invite-panel .invite-fields > * { grid-column: span 2; }
  /* an acarya's details: label | value */
  .app-frame .admin-details-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    column-gap: 24px;
    align-items: baseline;
  }
  .app-frame .admin-details dt { margin: 0; }

  /* ---- Admin Announcements: the member split, inside the admin section ---- */
  /* The member split, detail and title rules above already apply. Here the
     pane joins the section's card instead of floating as a second card. */
  .app-frame .admin-page .announcement-split { column-gap: 0; align-items: stretch; }
  .app-frame .admin-page .announcement-list { border-right: 1px solid var(--border); }
  .app-frame .admin-page .announcement-detail {
    position: static;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  /* The body lives in the pane on desktop, so the open row keeps its first line. */
  .app-frame .admin-page .announcement-toggle[aria-expanded="true"] .announcement-excerpt { display: block; }

  /* ---- Landing (anonymous) ---- */
  /* The anonymous page, not the signed-in frame: scoped .landing, never
     .app-frame. `.landing > main.shell` (0,2,1) beats `.shell` (0,1,0), so the
     shell opens to 1080px here and stays 480px below 1024px. */
  .landing > main.shell { max-width: 1080px; padding-left: 24px; padding-right: 24px; }
  .hero { padding-top: 72px; }
  .hero .emblem { width: 200px; height: 200px; }
  .landing .hero h1 { max-width: 20ch; }
  .landing section + section { margin-top: 88px; }
  /* The principles and the steps sit in a .section-inner; those two open to
     880px (the trust box's width) so the grids get the room the wide shell
     gives. Row auto-flow keeps the order 1 2 / 3 4 / … / 9 10. */
  .landing #principles .section-inner,
  .landing #how .section-inner { max-width: 880px; }
  .landing .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gutter, 40px);
    row-gap: 24px;
  }
  .landing .landing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
  }
  .landing .landing-footer p { margin: 0; }
  .landing > main.shell > .ornament { max-width: 320px; margin-left: auto; margin-right: auto; }
}
