/* MacTeam — Macedonian Missionary Service
   ─────────────────────────────────────────────────────────────────────────
   THE RULE: the app is the trailer's cab on the road.

   Warm, practical, legible in sunlight — the same family as the website so the
   two read as one ministry. Linen ground, opaque cream cards, navy for
   structure (header, nav), gold for exactly one thing: the action.

   Two constraints that are not taste:
   - Body text is 16px and inputs never go under it. iOS force-zooms below 16,
     and this is read at arm's length in a truck.
   - Anything tappable is at least --tap. A 30px button is a missed tap with
     gloves on.
*/

/* Both families are variable fonts. Google hands back ONE latin file per family
   — sourcesans3-400 and -600 are byte-identical — so each @font-face names the
   weight it wants and the browser sets the axis from that declaration. */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sourcesans3-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/sourcesans3-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --bg: #F8F2E7;
  --card: #FFFCF6;
  --ink: #27211B;
  --navy: #1B2432;
  --gold: #E0A03A;
  --gold-2: #B8801F;
  --mute: #7C6F61;
  --line: #EADFCF;
  --focus: #B8801F;
  --tap: 44px;

  /* on the navy bar and nav, where the ink tokens would be invisible */
  --on-navy: #F3ECE0;
  --on-navy-mute: #9FA9B8;

  --bad: #A8422F;
  --good: #4C6B45;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

  /* the ladder — if a new rule needs a size, it takes one of these */
  --t-micro: 10.5px;  /* chips, overlines */
  --t-cap:   11.5px;  /* caps labels, buttons, counts */
  --t-meta:  12.5px;  /* timestamps, sub-lines */
  --t-ui:    14px;    /* helper copy inside sheets */
  --t-body:  16px;    /* running text */
  --t-title: 18px;    /* the title of a card, whatever kind of card */
  --t-lede:  20px;    /* sheet headings */

  --r: 12px;          /* the system radius */
  --navh: 62px;       /* the fixed tab bar, less the safe-area inset */
  --appbot: 92px;     /* the clearance #app keeps below the last card */
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

#app { max-width: 560px; margin: 0 auto; padding-bottom: var(--appbot); }

h1, h2, h3, .k, .greet, .wm b { font-family: var(--serif); font-weight: 600; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--gold-2); }

/* iOS Safari force-zooms any input under 16px. Never go below it. */
input, textarea, select { font-size: 16px; }

/* One focus treatment for the whole app, gold, always visible — the ring is
   how a man on a keyboard or a switch knows where he is. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── header ───────────────────────────────────────────────────────────── */
header.bar {
  display: flex; align-items: center; gap: 11px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--navy);
  color: var(--on-navy);
}
.bar .mark { width: 32px; height: 32px; flex: none; display: block; }
.wm { line-height: 1.05; min-width: 0; }
.wm b { display: block; font-size: 19px; letter-spacing: .01em; }
.wm i { display: block; font-style: normal; font-size: 9px; letter-spacing: .14em;
        color: var(--gold); margin-top: 2px; white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis; }
.bar .right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.iconbtn { width: var(--tap); height: var(--tap); display: grid; place-items: center;
           color: var(--on-navy-mute); border-radius: 50%; position: relative; }
.iconbtn.on { color: var(--gold); }
.dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
       background: var(--gold); box-shadow: 0 0 0 2px var(--navy); }

/* ── page furniture ───────────────────────────────────────────────────── */
.greet { padding: 20px 16px 2px; font-size: 24px; line-height: 1.2; }
.hi { padding: 16px 16px 2px; font-size: var(--t-ui); color: var(--mute); }
.hi b { color: var(--ink); font-weight: 600; }

.sec { display: flex; align-items: baseline; padding: 24px 16px 6px; }
header.bar + .sec { padding-top: 16px; }
.sec h2 { font-family: var(--sans); font-size: var(--t-cap); letter-spacing: .18em;
          color: var(--mute); font-weight: 600; text-transform: uppercase; }
.sec .more { margin-left: auto; font-size: var(--t-cap); color: var(--gold-2);
             letter-spacing: .04em; text-decoration: none; position: relative;
             font-weight: 600; }
/* a count, not a control — no hit box, no gold */
.sec .tally { margin-left: auto; font-size: var(--t-cap); color: var(--mute);
              letter-spacing: .1em; font-weight: 600; }
/* 44px of hit box without a pixel of layout change */
.more::after { content: ""; position: absolute; top: 50%; transform: translateY(-50%);
               left: -16px; right: -6px; height: var(--tap); }

/* ── cards ────────────────────────────────────────────────────────────── */
.card {
  display: block; margin: 10px 16px 0; padding: 15px 16px; border-radius: var(--r);
  background: var(--card);                  /* opaque, always */
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(39, 33, 27, .05);
  color: inherit; text-decoration: none;
}
/* an overline — the label on a block, not a heading */
.card > s { display: block; text-decoration: none; font-size: var(--t-micro);
            letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
            font-weight: 600; }
.card > b { display: block; font-family: var(--serif); font-size: var(--t-title);
            font-weight: 600; line-height: 1.25; margin-top: 6px; }
.card > span { display: block; font-size: var(--t-meta); color: var(--mute);
               letter-spacing: .04em; margin-top: 4px; }
.card > p { font-size: var(--t-body); line-height: 1.55; margin-top: 8px; }

/* the one thing on Home a man is looking for */
.card.next { border-left: 4px solid var(--gold); padding-left: 13px; }
.card.ann { background: #FFF7E7; border-color: #EBD6AB; }
.card.hot { border-left: 4px solid var(--bad); padding-left: 13px; }
.card.done { border-color: var(--line); }

.row { display: flex; align-items: center; gap: 11px; }
.card .row + .row { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.row > b { font-family: var(--serif); font-size: var(--t-title); font-weight: 600;
           line-height: 1.25; min-width: 0; }
.row > span { font-size: var(--t-meta); color: var(--mute); margin-left: auto;
              white-space: nowrap; }
.row .btn { margin-left: 6px; }
/* a whole card that IS one row (the unread line): the block rules for a card's
   own <b>/<span> would stack them and push the second one down */
a.card.row > b { margin-top: 0; }
a.card.row > span { margin-top: 0; margin-left: auto; text-align: right; }

.k { font-size: var(--t-title); line-height: 1.25; }
.t { font-size: var(--t-meta); color: var(--mute); margin-top: 3px; }
.body { font-size: var(--t-body); line-height: 1.55; margin-top: 10px;
        white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { font-size: var(--t-body); line-height: 1.55; margin-top: 10px; color: var(--ink); }

/* a coordinator may change someone else's words — the card says so, quietly */
.edited { font-size: var(--t-micro); letter-spacing: .04em; color: var(--mute);
          font-style: italic; text-transform: none; }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; row-gap: 9px;
        margin-top: 12px; border-top: 1px solid var(--line); padding-top: 11px; }
.count { font-size: var(--t-meta); color: var(--mute); letter-spacing: .02em; }
.count b { color: var(--ink); font-weight: 600; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; min-height: var(--tap); border-radius: 999px;
  background: var(--gold); color: #241B06; border: 1px solid var(--gold);
  font-size: var(--t-cap); letter-spacing: .1em; font-weight: 600;
  text-transform: uppercase; white-space: nowrap; text-decoration: none;
}
.btn.small { padding: 8px 14px; }
/* already in / already done: seated into the card rather than raised off it */
.btn.in { background: #F6E3BE; border-color: #E2C68B; color: #4A360C; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.danger { background: transparent; border-color: #E0BCB2; color: var(--bad); }
/* FINISHED IS NOT BROKEN — a spent control gets a palette, never a fade. */
.btn:disabled { cursor: default; background: #EFE6D6; border-color: var(--line);
                color: #6B6053; }
.btn.in:disabled { background: #F6E3BE; border-color: #E2C68B; color: #4A360C; }

.cta {
  display: block; width: 100%; margin-top: 18px; padding: 14px; border-radius: 999px;
  background: var(--gold); color: #241B06; border: 1px solid var(--gold);
  font-size: 13px; letter-spacing: .12em; font-weight: 600; text-transform: uppercase;
  min-height: var(--tap);
}
.cta[disabled] { cursor: default; background: #EBD3A2; border-color: #EBD3A2; color: #3A2C0C; }
/* backing out of something is not the action the screen is for */
.cta.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
/* the one big commitment on a screen, kept off the edges */
.actbar { padding: 16px 16px 0; }
/* a row of secondary actions: + TRIP / + EVENT / + NEED, EDIT, SHOW PAST */
.actsrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 0; }
.actsrow.end { justify-content: center; padding-top: 22px; }

.btn:active, .cta:active:not([disabled]), .seg:active { transform: translateY(1px); }
.iconbtn:active { background: rgba(255, 255, 255, .10); }
nav.tabs a:active { color: var(--gold); }

/* In flight. wireOnce() stamps data-busy on every action button for the
   duration of the request; the 250ms delay means a fast tap never flashes and
   a slow one visibly works. */
.btn, .cta { position: relative; overflow: hidden; }
.btn[data-busy="1"]::after, .cta[data-busy="1"]::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  animation: work .9s linear .25s infinite, workon 0s linear .25s forwards;
}
@keyframes work   { from { transform: translateX(-100%) } to { transform: translateX(100%) } }
@keyframes workon { to { opacity: 1 } }

/* ── chips: ministry filters and status ───────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; white-space: nowrap;
  font-size: var(--t-micro); letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600; padding: 5px 10px; border-radius: 999px;
  background: #F1E8D8; border: 1px solid var(--line); color: var(--mute);
}
.chip.gold { background: #F6E3BE; border-color: #E2C68B; color: #4A360C; }
.chip.red { background: #F6E0DA; border-color: #E0BCB2; color: var(--bad); }
.chip.green { background: #E2EBDE; border-color: #C3D3BC; color: var(--good); }
/* a row of ministry filters — horizontally scrollable, each one a real target */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 2px;
         scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips .chip { flex: none; min-height: var(--tap); padding: 0 16px;
               font-size: var(--t-cap); }
.chips .chip.on { background: var(--gold); border-color: var(--gold); color: #241B06; }

/* ── schedule list ────────────────────────────────────────────────────── */
.mon { padding: 22px 16px 2px; font-size: var(--t-cap); letter-spacing: .18em;
       text-transform: uppercase; color: var(--mute); font-weight: 600; }
.item { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px;
        margin: 8px 16px 0; padding: 13px 14px; border-radius: var(--r);
        background: var(--card); border: 1px solid var(--line);
        box-shadow: 0 1px 2px rgba(39, 33, 27, .05);
        color: inherit; text-decoration: none; }
/* the day is the first thing read: what is on the calendar, then what it is */
.item .dt { flex: none; width: 74px; font-family: var(--serif); font-weight: 600;
            font-size: var(--t-ui); line-height: 1.25; color: var(--gold-2);
            padding-top: 1px; }
.item .mid { flex: 1 1 52%; min-width: 0; }
.item .mid > b { display: block; font-family: var(--serif); font-size: var(--t-title);
                 font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.item .sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
             margin-top: 5px; font-size: var(--t-meta); color: var(--mute); }
.item .act { margin-left: auto; display: flex; align-items: center; gap: 7px; }

/* ── talk: segments, channel and message rows ─────────────────────────── */
.segs { display: flex; gap: 8px; padding: 12px 16px 2px; }
.seg { flex: 1; min-height: var(--tap); border-radius: 999px; background: var(--card);
       border: 1px solid var(--line); color: var(--mute); font-size: var(--t-cap);
       letter-spacing: .1em; font-weight: 600; text-transform: uppercase; }
.seg.on { background: var(--gold); border-color: var(--gold); color: #241B06; }

/* a list row with no date block: a channel, a conversation, a member */
.item.thin, .item.person { align-items: center; }
.item.thin .sub span, .item.person .sub span { overflow-wrap: anywhere; }
/* the whole card is the tap, so it is a real button — width has to be asked for */
.item.person { width: calc(100% - 32px); text-align: left; }
/* how many are waiting, not merely that some are */
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px;
         padding: 0 6px; border-radius: 999px; background: var(--gold); color: #241B06;
         font-size: var(--t-cap); font-weight: 600; }
.mutedmark { display: inline-flex; vertical-align: -2px; margin-left: 6px;
             color: var(--mute); }

/* ── one conversation ─────────────────────────────────────────────────── */
.thead { padding: 12px 16px 14px; background: var(--card);
         border-bottom: 1px solid var(--line); }
.thead .back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap);
               font-size: var(--t-cap); letter-spacing: .14em; font-weight: 600;
               color: var(--mute); text-decoration: none; text-transform: uppercase; }
.thead h1 { font-size: 23px; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere; }
.thead .meta { margin-top: 5px; font-size: var(--t-micro); letter-spacing: .16em;
               text-transform: uppercase; color: var(--mute); font-weight: 600; }
.thead .actsrow { padding: 12px 0 0; }

.msgs { padding: 12px 16px 0; display: grid; gap: 10px; }
.msg { max-width: 82%; min-width: 42%; justify-self: start; padding: 9px 11px 8px 13px;
       border-radius: var(--r); border-bottom-left-radius: 4px;
       background: var(--card); border: 1px solid var(--line); }
.msg.mine { justify-self: end; border-bottom-left-radius: var(--r);
            border-bottom-right-radius: 4px;
            background: #F9EAD0; border-color: #E7D3AC; }
.msg .top { display: flex; align-items: center; gap: 8px; }
.msg .who { font-size: var(--t-cap); font-weight: 600; color: var(--mute);
            letter-spacing: .04em; min-width: 0; overflow-wrap: anywhere; }
.msg .body { margin-top: 3px; font-size: var(--t-body); white-space: pre-wrap;
             overflow-wrap: anywhere; }
.msg .w { font-size: var(--t-micro); color: var(--mute); letter-spacing: .06em;
          margin-top: 4px; }
/* the tombstone: it happened, and it is gone. Not a gap in the conversation. */
.msg.gone { background: transparent; border-style: dashed; min-width: 0; }
.msg.gone .body { margin-top: 0; font-style: italic; color: var(--mute);
                  font-size: var(--t-ui); }
/* small on the page, 44px to the thumb */
.dots { position: relative; margin-left: auto; flex: none; width: 26px; height: 22px;
        display: grid; place-items: center; border-radius: 6px; color: var(--mute);
        font-size: 19px; line-height: 1; }
.dots::after { content: ""; position: absolute; top: 50%; left: 50%;
               transform: translate(-50%, -50%); width: var(--tap); height: var(--tap); }

/* Stays with the thumb while the thread scrolls under it. Its own bottom
   padding is what clears the fixed tab bar, so the sticky offset stays 0 and
   the safe-area inset is only counted once. */
/* the composer carries its own clearance, so it gives #app's back — otherwise
   the two stack and a thread ends in a hand's width of empty linen */
.composer.thread { position: sticky; bottom: 0; z-index: 4;
                   margin: 14px 0 calc(0px - var(--appbot));
                   padding: 10px 16px calc(10px + var(--navh) + env(safe-area-inset-bottom));
                   background: var(--bg); border-top: 1px solid var(--line); }
.composer.thread textarea { min-height: 56px; }
.composer.thread .under { margin-top: 7px; }

/* ── one trip: the hero ───────────────────────────────────────────────── */
.hero { margin: 0; padding: 14px 16px 18px; background: var(--card);
        border-bottom: 1px solid var(--line); }
.hero .back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap);
              font-size: var(--t-cap); letter-spacing: .14em; font-weight: 600;
              color: var(--mute); text-decoration: none; text-transform: uppercase; }
.hero h1 { font-size: 27px; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere; }
.hero .meta { margin-top: 7px; font-size: var(--t-body); color: var(--gold-2);
              font-weight: 600; }
/* a row of chips under a title — the trip hero, an announcement, a member sheet */
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.tags:empty { display: none; }
.kv { display: flex; align-items: baseline; gap: 10px; margin-top: 11px; }
.kv s { flex: none; width: 74px; text-decoration: none; font-size: var(--t-micro);
        letter-spacing: .16em; text-transform: uppercase; color: var(--mute);
        font-weight: 600; }
.kv b { font-weight: 600; font-size: var(--t-ui); min-width: 0; overflow-wrap: anywhere; }
/* how the trip stands, at a glance, before the roster is read */
.counts { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 15px;
          padding-top: 13px; border-top: 1px solid var(--line); }
.counts span { font-size: var(--t-meta); color: var(--mute); letter-spacing: .02em; }
.counts b { font-family: var(--serif); font-size: 19px; color: var(--ink);
            margin-right: 3px; }
.cap { height: 6px; border-radius: 999px; background: #EFE6D6; margin-top: 12px;
       overflow: hidden; }
.cap i { display: block; height: 100%; background: var(--gold); }
.capnote { margin-top: 6px; font-size: var(--t-meta); color: var(--mute); }

/* ── roster / directory ───────────────────────────────────────────────── */
.roster { list-style: none; margin: 10px 16px 0; background: var(--card);
          border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.roster li { display: flex; flex-wrap: wrap; align-items: center; gap: 11px;
             padding: 11px 14px; min-height: 56px; }
.roster li + li { border-top: 1px solid var(--line); }
.roster li .who { min-width: 0; }
.roster li .nm { font-family: var(--serif); font-size: var(--t-title); font-weight: 600;
                 line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.roster li .sub { font-size: var(--t-meta); color: var(--mute); margin-top: 2px;
                  overflow-wrap: anywhere; }
.roster li .chip { margin-left: auto; }
/* a coordinator's three moves per person: their own line, never crowding the name */
.roster li .acts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 7px; }
/* the roster is also how a sheet lists people (who's free these dates) */
.sheet .roster { margin: 12px 0 0; }
.av { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid;
      place-items: center; background: #F1E8D8; border: 1px solid var(--line);
      font-size: var(--t-meta); font-weight: 600; color: var(--mute); }

/* ── availability ─────────────────────────────────────────────────────── */
.avail-range { display: flex; align-items: center; gap: 11px; margin: 8px 16px 0;
               padding: 11px 14px; min-height: 56px; background: var(--card);
               border: 1px solid var(--line); border-radius: var(--r); }
.avail-range b { font-size: var(--t-body); font-weight: 600; }
.avail-range .sub { font-size: var(--t-meta); color: var(--mute); margin-top: 2px;
                    overflow-wrap: anywhere; }
.avail-range .btn { margin-left: auto; }
/* inside the sheet the ranges are already inset by the sheet's own padding */
.sheet .avail-range { margin: 8px 0 0; }
.sheet #availlist p { margin-top: 12px; }

/* ── a list of things to do (the Team tab's own rows) ─────────────────── */
.menu { list-style: none; margin: 10px 16px 0; background: var(--card);
        border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%;
        text-align: left; padding: 12px 15px; min-height: var(--tap); color: var(--ink);
        text-decoration: none; font-size: var(--t-body); }
.menu i { font-style: normal; margin-left: auto; padding-left: 10px;
          font-size: var(--t-meta); color: var(--mute); text-align: right; }
.menu .out { color: var(--bad); }

/* ── nav ──────────────────────────────────────────────────────────────── */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 2px calc(8px + env(safe-area-inset-bottom));
  background: var(--navy);
}
nav.tabs a { display: grid; justify-items: center; align-content: center; gap: 4px;
             text-decoration: none; color: var(--on-navy-mute); position: relative;
             min-height: var(--tap); padding-top: 4px; }
nav.tabs a.on { color: var(--gold); }
nav.tabs a.on::before { content: ""; position: absolute; top: -6px; width: 24px; height: 2px;
                        border-radius: 2px; background: var(--gold); }
nav.tabs span { font-size: 9.5px; letter-spacing: .08em; font-weight: 600; }

/* ── auth ─────────────────────────────────────────────────────────────── */
.gate { max-width: 420px; margin: 0 auto; padding: 34px 22px 40px; min-height: 100vh;
        display: flex; flex-direction: column; justify-content: center; }
/* the mark sits on its own navy plate: the logo's lettering is white, and white
   on linen is not a logo, it is a gap */
.gate .crest { display: grid; justify-items: center; gap: 12px; margin-bottom: 26px;
               padding: 22px 18px; border-radius: var(--r); background: var(--navy);
               color: var(--on-navy); }
.gate .crest img, .gate .crest svg { width: 64px; height: 64px; display: block; }
.gate h1 { font-size: 30px; text-align: center; line-height: 1.1; }
.gate .sub { text-align: center; color: var(--gold); font-size: 10px; letter-spacing: .18em;
             margin-top: 5px; font-family: var(--sans); font-weight: 600; }
.gate label { display: block; font-size: var(--t-cap); letter-spacing: .14em; color: var(--mute);
              margin: 18px 0 7px; text-transform: uppercase; font-weight: 600; }
.gate input {
  width: 100%; padding: 13px 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); min-height: var(--tap);
}
.gate input:focus { outline: 0; border-color: var(--focus);
                    box-shadow: 0 0 0 2px rgba(184, 128, 31, .28); }
.gate .swap { margin-top: 20px; text-align: center; font-size: var(--t-ui); color: var(--mute); }
.gate .swap button { color: var(--gold-2); text-decoration: underline; font-size: var(--t-ui);
                     min-height: var(--tap); font-weight: 600; }
/* the gate's closing line is a line, not a callout — it must not pick up the
   boxed .note used inside the app */
.gate .note { margin-top: 14px; padding: 0; background: none; border: 0;
              font-size: var(--t-meta); line-height: 1.55; color: var(--mute);
              text-align: center; }
/* the front door says its own failures AT the form: the toast lives at
   bottom:96px, which is behind the keyboard he just typed the code with */
.gatemsg { margin-top: 14px; font-size: var(--t-ui); line-height: 1.5;
           color: var(--bad); text-align: center; }

/* ── composer / forms ─────────────────────────────────────────────────── */
.composer { margin: 12px 16px 0; }
.composer textarea, .composer input {
  width: 100%; padding: 12px 13px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); line-height: 1.5;
}
.composer textarea { min-height: 96px; resize: vertical; }
.composer input { min-height: var(--tap); margin-bottom: 9px; }
.composer ::placeholder { color: #9A8E7F; opacity: 1; }
.composer input:focus, .composer textarea:focus { outline: 0; border-color: var(--focus);
                    box-shadow: 0 0 0 2px rgba(184, 128, 31, .28); }
.composer .under { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.composer .two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
/* validation. The second selector is required: .composer textarea:focus is more
   specific than .composer .bad, and nag() focuses the box it is marking. */
.composer .bad, .composer .bad:focus { border-color: var(--bad);
                                       box-shadow: 0 0 0 2px rgba(168, 66, 47, .25); }
.toggle { display: flex; align-items: center; gap: 9px; font-size: var(--t-ui);
          color: var(--mute); min-height: var(--tap); cursor: pointer; }
.toggle input { width: 22px; height: 22px; accent-color: var(--gold-2); flex: none; }

.acctform { margin-top: 14px; }
.acctform label { display: block; font-size: var(--t-cap); letter-spacing: .14em; color: var(--mute);
                  text-transform: uppercase; margin: 14px 0 7px; font-weight: 600; }
.acctform input, .acctform select, .acctform textarea {
  width: 100%; padding: 12px 13px; min-height: var(--tap); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  font-family: var(--sans);
}
.acctform textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.acctform input:focus, .acctform select:focus, .acctform textarea:focus {
  outline: 0; border-color: var(--focus); box-shadow: 0 0 0 2px rgba(184, 128, 31, .28); }
.acctform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* A tick box is not a text field and its label is not a caps heading — both
   rules above would otherwise stretch the box to the sheet and stand the words
   above it in small caps. */
.acctform label.toggle { display: flex; align-items: center; gap: 9px; margin: 0;
                         font-size: var(--t-ui); letter-spacing: 0; text-transform: none;
                         font-weight: 400; color: var(--ink); }
.acctform input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; flex: none;
                                   padding: 0; border: 0; border-radius: 0;
                                   accent-color: var(--gold-2); }
/* the seven ministries, two up — seven full-width rows is a sheet you scroll
   past rather than read */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; margin-top: 4px; }
/* a skill you have added, with the way to take it back off */
.chip.pick { min-height: var(--tap); padding: 0 0 0 14px; font-size: var(--t-cap);
             background: #F6E3BE; border-color: #E2C68B; color: #4A360C; }
.chip.pick button { width: var(--tap); height: var(--tap); display: grid;
                    place-items: center; font-size: 19px; line-height: 1;
                    color: #6B5316; }

/* ── overlays / toast ─────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(27, 36, 50, .55);
           display: grid; place-items: center; padding: 20px; }
.sheet { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
         border-radius: var(--r); padding: 20px;
         box-shadow: 0 18px 40px rgba(27, 36, 50, .28); }
.sheet h3 { font-size: var(--t-lede); line-height: 1.3; margin-bottom: 8px; }
.sheet p { font-size: var(--t-ui); color: var(--mute); line-height: 1.55; }
.sheet ol { margin: 12px 0 0 18px; font-size: var(--t-ui); color: var(--mute); line-height: 1.7; }
.sheet .acts { display: flex; gap: 9px; margin-top: 18px; }
.sheet .acts .btn { flex: 1; }
/* four choices on one message: stacked, so each one is read before it is tapped */
.sheet .acts.col { flex-direction: column; margin-top: 14px; }
.sheet.tall { max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.quiet { font-size: var(--t-ui); color: var(--mute); line-height: 1.55; }
.sheet .quiet { margin-top: 8px; }
/* The words being acted on, shown back before the action is taken — in a sheet
   before a member reports a message, and in the console card where a director
   decides what to do about it. */
.quoted { margin-top: 12px; padding: 10px 12px; border-radius: 8px;
                 border-left: 3px solid var(--line); background: #F4ECDE;
                 color: var(--ink); font-size: var(--t-ui); white-space: pre-wrap;
                 overflow-wrap: anywhere; }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
         z-index: 30; background: var(--navy); color: var(--on-navy);
         border-radius: 999px; padding: 11px 18px; font-size: var(--t-ui);
         max-width: 88vw; text-align: center; opacity: 0; pointer-events: none;
         transition: opacity .18s; box-shadow: 0 8px 22px rgba(27, 36, 50, .3); }
#toast.show { opacity: 1; }
#toast.bad  { background: #7C2D1D; }
#toast.good { background: #3C5637; }

/* ── empty / error / loading ──────────────────────────────────────────── */
.empty { padding: 34px 22px; text-align: center; color: var(--mute); font-size: var(--t-ui);
         line-height: 1.6; }
.empty b { display: block; font-family: var(--serif); font-size: var(--t-title);
           color: var(--ink); margin-bottom: 6px; }
.footnote { margin: 14px 16px 0; font-size: var(--t-meta); line-height: 1.55; color: var(--mute); }
.footnote + .sec { padding-top: 20px; }
.note { margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r); font-size: var(--t-ui);
        line-height: 1.55; background: #FFF7E7; border: 1px solid #EBD6AB;
        border-left: 4px solid var(--gold); color: var(--ink); }
.note b { display: block; font-size: var(--t-cap); letter-spacing: .14em; margin-bottom: 5px;
          color: var(--gold-2); text-transform: uppercase; }
.loading { padding: 40px; text-align: center; color: var(--mute); font-size: var(--t-cap);
           letter-spacing: .18em; }

/* ── the console (admin.html) ─────────────────────────────────────────────
   Everything above is reused as-is: the navy bar, the chips (as the pane nav),
   cards, .roster, .item, .note, .empty. Only what the app has no equivalent of
   is below — a leader is often at a desk here, so the column is wider, and
   there is no tab bar to clear. */
body.console #app { max-width: 720px; padding-bottom: 40px; }
/* The pane nav is the app's chip row, but it must never scroll a pane out of
   sight: on a laptop a clipped row has no affordance at all, so it wraps. */
body.console .chips { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }
/* the console's only chrome control, sitting on the navy bar */
body.console .bar .btn.ghost { color: var(--on-navy); border-color: rgba(243, 236, 224, .32);
                               padding: 8px 14px; }
.whoami { font-size: var(--t-meta); color: var(--on-navy-mute); margin-right: 4px;
          max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* a generated passcode or a handed-over password: read aloud across a shop,
   typed by somebody else, and shown exactly once */
.bigcode { margin-top: 16px; padding: 18px 10px; border-radius: var(--r);
           background: #F6E3BE; border: 1px solid #E2C68B; color: #241B06;
           font-family: var(--serif); font-size: 34px; font-weight: 600;
           letter-spacing: .16em; text-align: center; overflow-wrap: anywhere; }

/* The role picker on a roster row. The label carries the accessible name; the
   select itself is the control, sized like every other tap in here.
   16px, never less: iOS force-zooms a smaller control the moment it is focused,
   and a leader who taps a role picker must not have the page jump under him. It
   is held to a button's size with padding, not by shrinking the words. */
.rolepick { display: inline-flex; }
.rolepick select { min-height: var(--tap); padding: 0 12px; border-radius: 999px;
                   background: var(--card); border: 1px solid var(--line); color: var(--ink);
                   font-size: 16px; line-height: 1.2; font-weight: 600; }
.rolepick select:focus { outline: 0; border-color: var(--focus);
                         box-shadow: 0 0 0 2px rgba(184, 128, 31, .28); }
/* said to a screen reader, shown to nobody */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
      clip-path: inset(50%); white-space: nowrap; }

/* the console's rows carry more than a name, and its lists are read on a laptop
   as often as a phone */
body.console .roster li { align-items: flex-start; }
body.console .roster li .acts { align-items: center; }
body.console .card > p.quiet { margin-top: 12px; }

/* ── verse footer ─────────────────────────────────────────────────────── */
.verse { margin: 28px 16px 20px; padding: 16px 10px; text-align: center;
         border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.verse p { font-family: var(--serif); font-style: italic; font-size: var(--t-title);
           line-height: 1.5; color: var(--ink); }
.verse s { display: block; text-decoration: none; font-size: var(--t-micro); letter-spacing: .18em;
           color: var(--mute); margin-top: 8px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  /* killing the animation would also kill the opacity keyframe and leave a man
     who asked his phone to stop moving things with no in-flight signal at all */
  .btn[data-busy="1"]::after, .cta[data-busy="1"]::after { opacity: 1; background: var(--gold-2); }
}
